@testspectra/cli 1.0.19 → 1.0.20

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.
@@ -418,25 +418,19 @@ pnpm type-check
418
418
  \`\`\`
419
419
  `;
420
420
  fs.writeFileSync(path.join(cwd, "ARCHITECTURE.md"), archDocContent, "utf-8");
421
- // 8. Update root README.md
421
+ // 8. Safely append to root README.md (do not overwrite existing content)
422
422
  const rootReadmePath = path.join(cwd, "README.md");
423
- const readmeContent = `# ${projectName} (TestSpectra Monorepo)
424
-
425
- Automated cross-platform E2E testing powered by [TestSpectra](https://github.com/testspectra).
426
-
427
- ## Architecture & Layout
428
-
429
- This project follows TestSpectra's **Centralized Configuration, Distributed Implementation** architecture.
430
- Detailed architecture, file locations, and zero-import mechanics are documented in:
431
- šŸ‘‰ **[ARCHITECTURE.md](./ARCHITECTURE.md)**
432
-
433
- ## Commands
434
-
435
- - **Run all E2E tests**: \`pnpm nx run-many -t e2e\`
436
- - **Run affected E2E tests**: \`pnpm nx affected -t e2e\`
437
- - **Type-check all suites**: \`pnpm type-check\`
438
- `;
439
- fs.writeFileSync(rootReadmePath, readmeContent, "utf-8");
423
+ const archSection = `\n## E2E Testing Architecture (TestSpectra)\n\nThis workspace uses TestSpectra's **Centralized Configuration, Distributed Implementation** architecture.\nDetailed architecture, folder map, and zero-import mechanics are documented in: \nšŸ‘‰ **[ARCHITECTURE.md](./ARCHITECTURE.md)**\n\n- **Run all E2E tests**: \`pnpm nx run-many -t e2e\`\n- **Run affected E2E tests**: \`pnpm nx affected -t e2e\`\n- **Type-check E2E suites**: \`pnpm type-check\`\n`;
424
+ if (fs.existsSync(rootReadmePath)) {
425
+ const existing = fs.readFileSync(rootReadmePath, "utf-8");
426
+ if (!existing.includes("ARCHITECTURE.md")) {
427
+ fs.appendFileSync(rootReadmePath, archSection, "utf-8");
428
+ }
429
+ }
430
+ else {
431
+ const readmeContent = `# ${projectName}\n\nAutomated cross-platform E2E testing powered by [TestSpectra](https://github.com/testspectra).\n${archSection}`;
432
+ fs.writeFileSync(rootReadmePath, readmeContent, "utf-8");
433
+ }
440
434
  console.log(`\n\x1b[32m[TestSpectra]\x1b[0m Enterprise Nx Monorepo initialized successfully!`);
441
435
  console.log(`\x1b[36m- Centralized Configuration:\x1b[0m ./spectra.config.ts`);
442
436
  console.log(`\x1b[36m- Centralized App Data/Cache:\x1b[0m ./.testspectra/`);
@@ -484,19 +478,19 @@ pnpm type-check
484
478
  \`\`\`
485
479
  `;
486
480
  fs.writeFileSync(path.join(cwd, "ARCHITECTURE.md"), standaloneArchDoc, "utf-8");
487
- const standaloneReadme = `# ${projectName}
488
-
489
- TestSpectra automated testing project.
490
-
491
- ## Architecture & Layout
492
- Detailed architecture and folder structure are documented in:
493
- šŸ‘‰ **[ARCHITECTURE.md](./ARCHITECTURE.md)**
494
-
495
- ## Commands
496
- - **Run tests**: \`pnpm test\`
497
- - **Type-check**: \`pnpm type-check\`
498
- `;
499
- fs.writeFileSync(path.join(cwd, "README.md"), standaloneReadme, "utf-8");
481
+ // Safely update root README.md (do not overwrite existing content)
482
+ const standaloneReadmePath = path.join(cwd, "README.md");
483
+ const standaloneArchSection = `\n## E2E Testing Architecture (TestSpectra)\n\nDetailed test architecture and folder map are documented in: \nšŸ‘‰ **[ARCHITECTURE.md](./ARCHITECTURE.md)**\n\n- **Run tests**: \`pnpm test\`\n- **Type-check**: \`pnpm type-check\`\n`;
484
+ if (fs.existsSync(standaloneReadmePath)) {
485
+ const existing = fs.readFileSync(standaloneReadmePath, "utf-8");
486
+ if (!existing.includes("ARCHITECTURE.md")) {
487
+ fs.appendFileSync(standaloneReadmePath, standaloneArchSection, "utf-8");
488
+ }
489
+ }
490
+ else {
491
+ const standaloneReadme = `# ${projectName}\n\nTestSpectra automated testing project.\n${standaloneArchSection}`;
492
+ fs.writeFileSync(standaloneReadmePath, standaloneReadme, "utf-8");
493
+ }
500
494
  console.log(`\x1b[32m[TestSpectra]\x1b[0m Initialized project from template successfully!`);
501
495
  console.log(`\x1b[32m[TestSpectra]\x1b[0m Generated documentation at ./ARCHITECTURE.md`);
502
496
  console.log(`\x1b[32m[TestSpectra]\x1b[0m Generated ambient multi-platform types in .testspectra/types/`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testspectra/cli",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "TestSpectra Zero-Config Cross-Platform Test Runner CLI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",