@testspectra/cli 1.0.32 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/commands/init.js
CHANGED
|
@@ -345,6 +345,7 @@ export async function initCommand(options = {}) {
|
|
|
345
345
|
const rootConfigFiles = [
|
|
346
346
|
"spectra.config.ts",
|
|
347
347
|
"tsconfig.spectra.json",
|
|
348
|
+
"tsconfig.spectra.shared.json",
|
|
348
349
|
"tsconfig.spectra.web.json",
|
|
349
350
|
"tsconfig.spectra.android.json",
|
|
350
351
|
"tsconfig.spectra.ios.json",
|
package/dist/types/generator.js
CHANGED
|
@@ -242,20 +242,20 @@ export class TypeGenerator {
|
|
|
242
242
|
content += ` ${actionName}: (typeof import('${matchedFile}') extends { default: infer T } ? T : typeof import('${matchedFile}'));\n`;
|
|
243
243
|
declaredActions.add(actionName);
|
|
244
244
|
}
|
|
245
|
-
else {
|
|
246
|
-
content += ` ${actionName}: (...args: any[]) => Promise<any>;\n`;
|
|
247
|
-
declaredActions.add(actionName);
|
|
248
|
-
}
|
|
249
245
|
}
|
|
250
246
|
else if (entry.isFile() && entry.name.endsWith(".ts")) {
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
247
|
+
const parts = entry.name.split(".");
|
|
248
|
+
const stem = parts.length > 2 ? parts[parts.length - 2] : parts[0];
|
|
249
|
+
const actionName = parts[0];
|
|
250
|
+
if (hierarchy.includes(stem) || hierarchy.includes(parts[1])) {
|
|
251
|
+
if (declaredActions.has(actionName))
|
|
252
|
+
continue;
|
|
253
|
+
let rel = path.relative(path.join(cwd, ".testspectra/types"), path.join(actionsDir, entry.name)).replace(/\\/g, "/").replace(/\.ts$/, ".js");
|
|
254
|
+
if (!rel.startsWith("."))
|
|
255
|
+
rel = `./${rel}`;
|
|
256
|
+
content += ` ${actionName}: (typeof import('${rel}') extends { default: infer T } ? T : typeof import('${rel}'));\n`;
|
|
257
|
+
declaredActions.add(actionName);
|
|
258
|
+
}
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -296,20 +296,20 @@ export class TypeGenerator {
|
|
|
296
296
|
content += ` ${stepName}: (typeof import('${matchedFile}') extends { default: infer T } ? T : typeof import('${matchedFile}'));\n`;
|
|
297
297
|
declaredSteps.add(stepName);
|
|
298
298
|
}
|
|
299
|
-
else {
|
|
300
|
-
content += ` ${stepName}: (...args: any[]) => Promise<any>;\n`;
|
|
301
|
-
declaredSteps.add(stepName);
|
|
302
|
-
}
|
|
303
299
|
}
|
|
304
300
|
else if (entry.isFile() && entry.name.endsWith(".ts")) {
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
301
|
+
const parts = entry.name.split(".");
|
|
302
|
+
const stem = parts.length > 2 ? parts[parts.length - 2] : parts[0];
|
|
303
|
+
const stepName = parts[0];
|
|
304
|
+
if (hierarchy.includes(stem) || hierarchy.includes(parts[1])) {
|
|
305
|
+
if (declaredSteps.has(stepName))
|
|
306
|
+
continue;
|
|
307
|
+
let rel = path.relative(path.join(cwd, ".testspectra/types"), path.join(stepsDir, entry.name)).replace(/\\/g, "/").replace(/\.ts$/, ".js");
|
|
308
|
+
if (!rel.startsWith("."))
|
|
309
|
+
rel = `./${rel}`;
|
|
310
|
+
content += ` ${stepName}: (typeof import('${rel}') extends { default: infer T } ? T : typeof import('${rel}'));\n`;
|
|
311
|
+
declaredSteps.add(stepName);
|
|
312
|
+
}
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"composite": true,
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"types": ["node", "@wdio/globals/types", "@wdio/mocha-framework"]
|
|
11
|
+
},
|
|
12
|
+
"include": [
|
|
13
|
+
".testspectra/types/common.d.ts",
|
|
14
|
+
".testspectra/types/fixtures.d.ts",
|
|
15
|
+
"shared/testing/**/*.ts"
|
|
16
|
+
],
|
|
17
|
+
"exclude": [
|
|
18
|
+
"node_modules",
|
|
19
|
+
"dist"
|
|
20
|
+
]
|
|
21
|
+
}
|