Skip to content

Commit 0940bb2

Browse files
committed
revised postinstlal
1 parent f670123 commit 0940bb2

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qa-shadow-report",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"bin": {
55
"qa-shadow-report": "./cli.js",
66
"qasr": "./cli.js",

scripts/postInstall.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,20 @@ const createConfigFile = () => {
114114
const defaultConfigContent = `
115115
// Sample Configuration File: Adjust values below to match your project's setup
116116
117-
module.exports = {
117+
// TypeScript type definition (will be ignored in JavaScript)
118+
/** @type {{
119+
teamNames?: string[];
120+
testTypes?: string[];
121+
testCategories?: string[];
122+
googleSpreadsheetUrl?: string;
123+
googleKeyFilePath?: string;
124+
testData?: string;
125+
csvDownloadsPath?: string;
126+
weeklySummaryStartDay?: string;
127+
}} */
128+
129+
// Support both CommonJS and ES Modules
130+
const config = {
118131
// Uncomment the relevant teams or add your own in the Describe block or It block:
119132
// describe('[oregano] Unit test our math functions', () => {
120133
// context('math', () => {
@@ -169,6 +182,13 @@ const createConfigFile = () => {
169182
// Weekly summary settings (optional). To activate, set weekly summary sart date, summary will includes the start date and the following 7 days.
170183
// weeklySummaryStartDay: 'Monday' OR process.env.WEEKLY_SUMMARY_START_DAY
171184
};
185+
186+
// Support both CommonJS and ES Modules
187+
if (typeof module !== 'undefined' && module.exports) {
188+
module.exports = config;
189+
} else {
190+
export default config;
191+
}
172192
`;
173193
fs.writeFileSync(configFilePath, defaultConfigContent, {
174194
encoding: 'utf-8',

0 commit comments

Comments
 (0)