@testspectra/cli 1.0.19 ā 1.0.21
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 +25 -31
- package/dist/types/generator.js +2 -2
- package/package.json +1 -2
package/dist/commands/init.js
CHANGED
|
@@ -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.
|
|
421
|
+
// 8. Safely append to root README.md (do not overwrite existing content)
|
|
422
422
|
const rootReadmePath = path.join(cwd, "README.md");
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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
|
-
|
|
488
|
-
|
|
489
|
-
TestSpectra
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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/dist/types/generator.js
CHANGED
|
@@ -59,7 +59,7 @@ export class TypeGenerator {
|
|
|
59
59
|
for (const platform of platforms) {
|
|
60
60
|
const hierarchy = PLATFORM_HIERARCHY[platform];
|
|
61
61
|
let content = `// Auto-generated ambient declarations for TestSpectra [${platform.toUpperCase()}]\n`;
|
|
62
|
-
content += `//
|
|
62
|
+
content += `// Managed automatically by TestSpectra Language Service Plugin.\n\n`;
|
|
63
63
|
content += `/// <reference types="@wdio/globals/types" />\n`;
|
|
64
64
|
content += `/// <reference types="@wdio/mocha-framework" />\n`;
|
|
65
65
|
content += `/// <reference path="./fixtures.d.ts" />\n\n`;
|
|
@@ -271,7 +271,7 @@ export class TypeGenerator {
|
|
|
271
271
|
static generateFixturesDeclaration(cwd) {
|
|
272
272
|
const fixturesDirs = this.getEntityDirs(cwd, "fixtures");
|
|
273
273
|
let content = `// Auto-generated ambient fixture declarations for TestSpectra\n`;
|
|
274
|
-
content += `//
|
|
274
|
+
content += `// Managed automatically by TestSpectra Language Service Plugin.\n\n`;
|
|
275
275
|
content += `interface TestSpectraFixtures {\n`;
|
|
276
276
|
const declaredFixtures = new Set();
|
|
277
277
|
for (const fixturesDir of fixturesDirs) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testspectra/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "TestSpectra Zero-Config Cross-Platform Test Runner CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@testspectra/matchers": "^1.0.0",
|
|
24
24
|
"chalk": "^5.3.0",
|
|
25
|
-
"chokidar": "^3.6.0",
|
|
26
25
|
"commander": "^12.1.0",
|
|
27
26
|
"dotenv": "^16.4.5",
|
|
28
27
|
"inquirer": "^9.3.2",
|