@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.
@@ -76,21 +76,24 @@ function ensurePnpmWorkspaceIncludes(pnpmWorkspacePath, targetPath) {
76
76
  }
77
77
  }
78
78
  }
79
- function ensureVsCodeSettings(cwd) {
79
+ function ensureVsCodeExtensions(cwd) {
80
80
  const vscodeDir = path.join(cwd, ".vscode");
81
- const settingsFile = path.join(vscodeDir, "settings.json");
81
+ const extFile = path.join(vscodeDir, "extensions.json");
82
82
  if (!fs.existsSync(vscodeDir))
83
83
  fs.mkdirSync(vscodeDir, { recursive: true });
84
- let settings = {};
85
- if (fs.existsSync(settingsFile)) {
84
+ let config = { recommendations: [] };
85
+ if (fs.existsSync(extFile)) {
86
86
  try {
87
- settings = JSON.parse(fs.readFileSync(settingsFile, "utf-8"));
87
+ config = JSON.parse(fs.readFileSync(extFile, "utf-8"));
88
88
  }
89
89
  catch { }
90
90
  }
91
- settings["typescript.tsdk"] = "node_modules/typescript/lib";
92
- settings["typescript.enablePromptUseWorkspaceTsdk"] = true;
93
- fs.writeFileSync(settingsFile, JSON.stringify(settings, null, 2) + "\n", "utf-8");
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
- ensureVsCodeSettings(cwd);
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
- ensureVsCodeSettings(cwd);
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
@@ -179,5 +179,6 @@ function init(modules) {
179
179
  }
180
180
  return { create, getExternalFiles };
181
181
  }
182
+ init.TypeGenerator = TypeGenerator;
182
183
  export default init;
183
184
  export { init };
package/package.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
2
  "name": "@testspectra/cli",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "TestSpectra Zero-Config Cross-Platform Test Runner CLI",
5
- "main": "./dist/plugin.cjs",
6
- "module": "./dist/index.js",
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 && esbuild src/plugin.ts --bundle --platform=node --format=cjs --outfile=dist/plugin.cjs --footer:js=\"module.exports = init; module.exports.default = init;\" --external:typescript",
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.57",
32
+ "@testspectra/matchers": "^1.0.59",
35
33
  "chalk": "^5.3.0",
36
34
  "commander": "^12.1.0",
37
35
  "dotenv": "^16.4.5",
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "testspectra.testspectra-vscode"
4
+ ]
5
+ }
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "devDependencies": {
11
11
  "@testspectra/cli": "workspace:*",
12
- "@testspectra/matchers": "^1.0.57",
12
+ "@testspectra/matchers": "^1.0.59",
13
13
  "@types/node": "^20.14.0",
14
14
  "@wdio/globals": "^9.2.8",
15
15
  "@wdio/mocha-framework": "^9.2.8",
@@ -11,11 +11,6 @@
11
11
  "node",
12
12
  "@wdio/globals/types",
13
13
  "@wdio/mocha-framework"
14
- ],
15
- "plugins": [
16
- {
17
- "name": "@testspectra/cli"
18
- }
19
14
  ]
20
15
  },
21
16
  "include": [
@@ -11,11 +11,6 @@
11
11
  "node",
12
12
  "@wdio/globals/types",
13
13
  "@wdio/mocha-framework"
14
- ],
15
- "plugins": [
16
- {
17
- "name": "@testspectra/cli"
18
- }
19
14
  ]
20
15
  },
21
16
  "include": [
@@ -5,12 +5,7 @@
5
5
  "moduleResolution": "NodeNext",
6
6
  "skipLibCheck": true,
7
7
  "strict": true,
8
- "noEmit": true,
9
- "plugins": [
10
- {
11
- "name": "@testspectra/cli"
12
- }
13
- ]
8
+ "noEmit": true
14
9
  },
15
10
  "files": [],
16
11
  "references": [
@@ -11,11 +11,6 @@
11
11
  "node",
12
12
  "@wdio/globals/types",
13
13
  "@wdio/mocha-framework"
14
- ],
15
- "plugins": [
16
- {
17
- "name": "@testspectra/cli"
18
- }
19
14
  ]
20
15
  },
21
16
  "include": [
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "testspectra.testspectra-vscode"
4
+ ]
5
+ }
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@testspectra/cli": "workspace:*",
14
- "@testspectra/matchers": "^1.0.57",
14
+ "@testspectra/matchers": "^1.0.59",
15
15
  "@types/node": "^20.14.0",
16
16
  "@wdio/globals": "^9.2.8",
17
17
  "@wdio/mocha-framework": "^9.2.8",
@@ -11,11 +11,6 @@
11
11
  "node",
12
12
  "@wdio/globals/types",
13
13
  "@wdio/mocha-framework"
14
- ],
15
- "plugins": [
16
- {
17
- "name": "@testspectra/cli"
18
- }
19
14
  ]
20
15
  },
21
16
  "include": [
@@ -11,11 +11,6 @@
11
11
  "node",
12
12
  "@wdio/globals/types",
13
13
  "@wdio/mocha-framework"
14
- ],
15
- "plugins": [
16
- {
17
- "name": "@testspectra/cli"
18
- }
19
14
  ]
20
15
  },
21
16
  "include": [
@@ -5,12 +5,7 @@
5
5
  "moduleResolution": "NodeNext",
6
6
  "skipLibCheck": true,
7
7
  "strict": true,
8
- "noEmit": true,
9
- "plugins": [
10
- {
11
- "name": "@testspectra/cli"
12
- }
13
- ]
8
+ "noEmit": true
14
9
  },
15
10
  "files": [],
16
11
  "references": [
@@ -11,11 +11,6 @@
11
11
  "node",
12
12
  "@wdio/globals/types",
13
13
  "@wdio/mocha-framework"
14
- ],
15
- "plugins": [
16
- {
17
- "name": "@testspectra/cli"
18
- }
19
14
  ]
20
15
  },
21
16
  "include": [
@@ -11,11 +11,6 @@
11
11
  "node",
12
12
  "@wdio/globals/types",
13
13
  "@wdio/mocha-framework"
14
- ],
15
- "plugins": [
16
- {
17
- "name": "@testspectra/cli"
18
- }
19
14
  ]
20
15
  },
21
16
  "include": [
@@ -1,4 +0,0 @@
1
- {
2
- "typescript.tsdk": "node_modules/typescript/lib",
3
- "typescript.enablePromptUseWorkspaceTsdk": true
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "typescript.tsdk": "node_modules/typescript/lib",
3
- "typescript.enablePromptUseWorkspaceTsdk": true
4
- }