@testspectra/cli 1.0.57 → 1.0.59
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 +13 -10
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/plugin.cjs +2 -1
- package/dist/plugin.js +1 -0
- package/package.json +5 -7
- package/templates/default/.vscode/extensions.json +5 -0
- package/templates/default/package.json +1 -1
- package/templates/default/tsconfig.spectra.android.json +0 -5
- package/templates/default/tsconfig.spectra.ios.json +0 -5
- package/templates/default/tsconfig.spectra.json +1 -6
- package/templates/default/tsconfig.spectra.web.json +0 -5
- package/templates/nx/.vscode/extensions.json +5 -0
- package/templates/nx/package.json +1 -1
- package/templates/nx/tsconfig.spectra.android.json +0 -5
- package/templates/nx/tsconfig.spectra.ios.json +0 -5
- package/templates/nx/tsconfig.spectra.json +1 -6
- package/templates/nx/tsconfig.spectra.shared.json +0 -5
- package/templates/nx/tsconfig.spectra.web.json +0 -5
- package/templates/default/.vscode/settings.json +0 -4
- package/templates/nx/.vscode/settings.json +0 -4
package/dist/commands/init.js
CHANGED
|
@@ -76,21 +76,24 @@ function ensurePnpmWorkspaceIncludes(pnpmWorkspacePath, targetPath) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function ensureVsCodeExtensions(cwd) {
|
|
80
80
|
const vscodeDir = path.join(cwd, ".vscode");
|
|
81
|
-
const
|
|
81
|
+
const extFile = path.join(vscodeDir, "extensions.json");
|
|
82
82
|
if (!fs.existsSync(vscodeDir))
|
|
83
83
|
fs.mkdirSync(vscodeDir, { recursive: true });
|
|
84
|
-
let
|
|
85
|
-
if (fs.existsSync(
|
|
84
|
+
let config = { recommendations: [] };
|
|
85
|
+
if (fs.existsSync(extFile)) {
|
|
86
86
|
try {
|
|
87
|
-
|
|
87
|
+
config = JSON.parse(fs.readFileSync(extFile, "utf-8"));
|
|
88
88
|
}
|
|
89
89
|
catch { }
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
if (!Array.isArray(config.recommendations))
|
|
92
|
+
config.recommendations = [];
|
|
93
|
+
if (!config.recommendations.includes("testspectra.testspectra-vscode")) {
|
|
94
|
+
config.recommendations.push("testspectra.testspectra-vscode");
|
|
95
|
+
}
|
|
96
|
+
fs.writeFileSync(extFile, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
94
97
|
}
|
|
95
98
|
function scanDirectoriesForProjects(cwd, patterns) {
|
|
96
99
|
const foundProjects = [];
|
|
@@ -518,7 +521,7 @@ export async function initCommand(options = {}) {
|
|
|
518
521
|
fs.writeFileSync(rootTsConfigPath, JSON.stringify(rootTsConfig, null, 2), "utf-8");
|
|
519
522
|
// 7. Generate Ambient Types in ROOT only
|
|
520
523
|
TypeGenerator.writeDeclarationFiles(cwd);
|
|
521
|
-
|
|
524
|
+
ensureVsCodeExtensions(cwd);
|
|
522
525
|
const sharedPoLine = `${sharedTestingRelPath}/page-objects`.padEnd(28, " ");
|
|
523
526
|
const sharedStepsLine = `${sharedTestingRelPath}/steps`.padEnd(28, " ");
|
|
524
527
|
const sharedActLine = `${sharedTestingRelPath}/actions`.padEnd(28, " ");
|
|
@@ -709,7 +712,7 @@ pnpm type-check
|
|
|
709
712
|
}
|
|
710
713
|
}
|
|
711
714
|
TypeGenerator.writeDeclarationFiles(cwd);
|
|
712
|
-
|
|
715
|
+
ensureVsCodeExtensions(cwd);
|
|
713
716
|
// Standalone Architecture Documentation
|
|
714
717
|
const standaloneArchDoc = `# TestSpectra Project Architecture
|
|
715
718
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { init } from "./plugin.js";
|
|
3
2
|
export * from "./config/schema.js";
|
|
4
3
|
export * from "./config/loader.js";
|
|
5
4
|
export * from "./types/generator.js";
|
|
6
5
|
export * from "@testspectra/matchers";
|
|
7
|
-
export { init as initTsPlugin, init };
|
|
8
|
-
export default init;
|
|
9
6
|
export declare function createCliProgram(): Command;
|
|
10
7
|
export declare function runCli(args?: string[]): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -5,13 +5,10 @@ import { doctorCommand } from "./commands/doctor.js";
|
|
|
5
5
|
import { initCommand } from "./commands/init.js";
|
|
6
6
|
import { runCommand } from "./commands/run.js";
|
|
7
7
|
import { watchCommand } from "./commands/watch.js";
|
|
8
|
-
import { init } from "./plugin.js";
|
|
9
8
|
export * from "./config/schema.js";
|
|
10
9
|
export * from "./config/loader.js";
|
|
11
10
|
export * from "./types/generator.js";
|
|
12
11
|
export * from "@testspectra/matchers";
|
|
13
|
-
export { init as initTsPlugin, init };
|
|
14
|
-
export default init;
|
|
15
12
|
export function createCliProgram() {
|
|
16
13
|
const program = new Command();
|
|
17
14
|
program
|
package/dist/plugin.cjs
CHANGED
|
@@ -566,9 +566,10 @@ function init(modules) {
|
|
|
566
566
|
}
|
|
567
567
|
return { create, getExternalFiles };
|
|
568
568
|
}
|
|
569
|
+
init.TypeGenerator = TypeGenerator;
|
|
569
570
|
var plugin_default = init;
|
|
570
571
|
// Annotate the CommonJS export names for ESM import in node:
|
|
571
572
|
0 && (module.exports = {
|
|
572
573
|
init
|
|
573
574
|
});
|
|
574
|
-
module.exports = init; module.exports.default = init;
|
|
575
|
+
module.exports = init; module.exports.default = init; module.exports.TypeGenerator = init.TypeGenerator;
|
package/dist/plugin.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testspectra/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.59",
|
|
4
4
|
"description": "TestSpectra Zero-Config Cross-Platform Test Runner CLI",
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
10
9
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"require": "./dist/plugin.cjs",
|
|
12
10
|
"import": "./dist/index.js",
|
|
13
11
|
"default": "./dist/index.js"
|
|
14
12
|
},
|
|
@@ -19,7 +17,7 @@
|
|
|
19
17
|
"testspectra": "./bin/spectra.js"
|
|
20
18
|
},
|
|
21
19
|
"scripts": {
|
|
22
|
-
"build": "tsc
|
|
20
|
+
"build": "tsc",
|
|
23
21
|
"watch": "tsc -w",
|
|
24
22
|
"prepublishOnly": "npm run build"
|
|
25
23
|
},
|
|
@@ -31,7 +29,7 @@
|
|
|
31
29
|
],
|
|
32
30
|
"dependencies": {
|
|
33
31
|
"@clack/prompts": "^1.7.0",
|
|
34
|
-
"@testspectra/matchers": "^1.0.
|
|
32
|
+
"@testspectra/matchers": "^1.0.59",
|
|
35
33
|
"chalk": "^5.3.0",
|
|
36
34
|
"commander": "^12.1.0",
|
|
37
35
|
"dotenv": "^16.4.5",
|