@testspectra/cli 1.0.39 → 1.0.41

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.
@@ -283,6 +283,12 @@ export async function initCommand(options = {}) {
283
283
  if (pkg.dependencies && pkg.dependencies["@testspectra/cli"]) {
284
284
  pkg.dependencies["@testspectra/cli"] = cliDepVersion;
285
285
  }
286
+ if (pkg.devDependencies && pkg.devDependencies["@testspectra/matchers"]) {
287
+ pkg.devDependencies["@testspectra/matchers"] = cliDepVersion;
288
+ }
289
+ if (pkg.dependencies && pkg.dependencies["@testspectra/matchers"]) {
290
+ pkg.dependencies["@testspectra/matchers"] = cliDepVersion;
291
+ }
286
292
  content = JSON.stringify(pkg, null, 2);
287
293
  }
288
294
  catch { }
@@ -314,6 +320,34 @@ export async function initCommand(options = {}) {
314
320
  }
315
321
  chosenProjects = projectChoices;
316
322
  }
323
+ else {
324
+ // No packages auto-detected — ask user to manually enter feature names
325
+ p.log.warn(chalk.yellow("No feature packages found in workspace. You can enter feature names to scaffold."));
326
+ const featureNamesInput = await p.text({
327
+ message: "Enter feature module names (comma-separated), or leave blank to skip:",
328
+ placeholder: "auth, catalog, payment",
329
+ defaultValue: "",
330
+ });
331
+ if (p.isCancel(featureNamesInput)) {
332
+ p.cancel("Setup cancelled.");
333
+ return;
334
+ }
335
+ const raw = featureNamesInput.trim();
336
+ if (raw) {
337
+ // Build relPaths from feature names using a sensible default location
338
+ const featureBaseInput = await p.text({
339
+ message: "Enter base directory for feature modules:",
340
+ placeholder: "packages/features",
341
+ defaultValue: "packages/features",
342
+ });
343
+ if (p.isCancel(featureBaseInput)) {
344
+ p.cancel("Setup cancelled.");
345
+ return;
346
+ }
347
+ const featureBase = featureBaseInput.trim() || "packages/features";
348
+ chosenProjects = raw.split(",").map((n) => `${featureBase}/${n.trim()}`).filter(Boolean);
349
+ }
350
+ }
317
351
  let e2eFolderName = "e2e";
318
352
  let sharedTestingRelPath = "shared/testing";
319
353
  if (!options.force) {
@@ -368,6 +402,9 @@ export async function initCommand(options = {}) {
368
402
  if (tPkg.devDependencies && tPkg.devDependencies["@testspectra/cli"]) {
369
403
  tPkg.devDependencies["@testspectra/cli"] = cliDepVersion;
370
404
  }
405
+ if (tPkg.devDependencies && tPkg.devDependencies["@testspectra/matchers"]) {
406
+ tPkg.devDependencies["@testspectra/matchers"] = cliDepVersion;
407
+ }
371
408
  fs.writeFileSync(rootPkgPath, JSON.stringify(tPkg, null, 2), "utf-8");
372
409
  }
373
410
  catch {
@@ -382,6 +419,8 @@ export async function initCommand(options = {}) {
382
419
  rootPkg.devDependencies = {};
383
420
  if (!rootPkg.devDependencies["@testspectra/cli"])
384
421
  rootPkg.devDependencies["@testspectra/cli"] = cliDepVersion;
422
+ if (!rootPkg.devDependencies["@testspectra/matchers"])
423
+ rootPkg.devDependencies["@testspectra/matchers"] = cliDepVersion;
385
424
  if (!rootPkg.devDependencies["typescript"])
386
425
  rootPkg.devDependencies["typescript"] = "^5.4.5";
387
426
  if (!rootPkg.devDependencies["@wdio/globals"])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testspectra/cli",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "TestSpectra Zero-Config Cross-Platform Test Runner CLI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@clack/prompts": "^1.7.0",
24
- "@testspectra/matchers": "^1.0.0",
24
+ "@testspectra/matchers": "^1.0.41",
25
25
  "chalk": "^5.3.0",
26
26
  "commander": "^12.1.0",
27
27
  "dotenv": "^16.4.5",
@@ -9,6 +9,7 @@
9
9
  },
10
10
  "devDependencies": {
11
11
  "@testspectra/cli": "workspace:*",
12
+ "@testspectra/matchers": "^1.0.41",
12
13
  "@types/node": "^20.14.0",
13
14
  "@wdio/globals": "^9.2.8",
14
15
  "@wdio/mocha-framework": "^9.2.8",
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@testspectra/cli": "workspace:*",
14
+ "@testspectra/matchers": "^1.0.41",
14
15
  "@types/node": "^20.14.0",
15
16
  "@wdio/globals": "^9.2.8",
16
17
  "@wdio/mocha-framework": "^9.2.8",