@zibby/cli 0.1.12 → 0.1.13
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/bin/zibby.js +1 -1
- package/package.json +2 -2
- package/src/commands/init.js +11 -22
- package/src/commands/run.js +1 -16
package/bin/zibby.js
CHANGED
|
@@ -57,7 +57,7 @@ program
|
|
|
57
57
|
.option('--folder <path>', 'Folder path within collection (optional, requires --collection)')
|
|
58
58
|
.option('--sync', 'Force upload to cloud (overrides cloudSync: false)')
|
|
59
59
|
.option('--no-sync', 'Skip upload to cloud (overrides cloudSync: true)')
|
|
60
|
-
.option('--config <path>', 'Path to config file', '.zibby.config.
|
|
60
|
+
.option('--config <path>', 'Path to config file', '.zibby.config.mjs')
|
|
61
61
|
.option('--auto-approve', 'Auto-approve MCP tools (for CI/CD)')
|
|
62
62
|
.option('-o, --open', 'Open test results in browser after completion')
|
|
63
63
|
.option('--verbose', 'Show info level logs')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zibby/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Zibby CLI - Test automation generator and runner",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@aws-sdk/client-sqs": "^3.1000.0",
|
|
35
35
|
"@zibby/skills": "^0.1.0",
|
|
36
|
-
"@zibby/core": "^0.1.
|
|
36
|
+
"@zibby/core": "^0.1.10",
|
|
37
37
|
"chalk": "^5.3.0",
|
|
38
38
|
"commander": "^12.0.0",
|
|
39
39
|
"dotenv": "^17.2.3",
|
package/src/commands/init.js
CHANGED
|
@@ -32,9 +32,9 @@ export async function initCommand(projectName, options) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// If in existing directory, check if already initialized (unless --force)
|
|
35
|
-
if (!isNewProject && existsSync(join(targetDir, '.zibby.config.
|
|
35
|
+
if (!isNewProject && existsSync(join(targetDir, '.zibby.config.mjs')) && !options.force) {
|
|
36
36
|
console.log(chalk.yellow('\n⚠️ Zibby is already initialized in this directory!\n'));
|
|
37
|
-
console.log(chalk.white('Config file found: .zibby.config.
|
|
37
|
+
console.log(chalk.white('Config file found: .zibby.config.mjs'));
|
|
38
38
|
console.log(chalk.gray('Use --force or -f to reinitialize\n'));
|
|
39
39
|
process.exit(0);
|
|
40
40
|
}
|
|
@@ -150,14 +150,14 @@ export async function initCommand(projectName, options) {
|
|
|
150
150
|
const { graphPath, nodesPath, readmePath, resultHandlerPath } = TemplateFactory.getTemplateFiles(templateName);
|
|
151
151
|
const targetZibbyDir = join(targetDir, '.zibby');
|
|
152
152
|
|
|
153
|
-
// Copy graph.
|
|
153
|
+
// Copy graph.mjs
|
|
154
154
|
const graphTemplate = await readFile(graphPath, 'utf-8');
|
|
155
|
-
await writeFile(join(targetZibbyDir, 'graph.
|
|
155
|
+
await writeFile(join(targetZibbyDir, 'graph.mjs'), graphTemplate);
|
|
156
156
|
|
|
157
|
-
// Copy result-handler.
|
|
157
|
+
// Copy result-handler.mjs (workflow-specific post-processing)
|
|
158
158
|
if (resultHandlerPath) {
|
|
159
159
|
const rhTemplate = await readFile(resultHandlerPath, 'utf-8');
|
|
160
|
-
await writeFile(join(targetZibbyDir, 'result-handler.
|
|
160
|
+
await writeFile(join(targetZibbyDir, 'result-handler.mjs'), rhTemplate);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
// Copy README
|
|
@@ -181,7 +181,7 @@ export async function initCommand(projectName, options) {
|
|
|
181
181
|
|
|
182
182
|
// Always create Zibby config
|
|
183
183
|
const configContent = generateConfig(answers, options);
|
|
184
|
-
await writeFile(join(targetDir, '.zibby.config.
|
|
184
|
+
await writeFile(join(targetDir, '.zibby.config.mjs'), configContent);
|
|
185
185
|
|
|
186
186
|
// Always create .env.example
|
|
187
187
|
const envContent = generateEnvFile(answers, options);
|
|
@@ -205,21 +205,10 @@ export async function initCommand(projectName, options) {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
// Create package.json for new projects
|
|
208
|
+
// Create package.json for new projects only (don't modify existing ones)
|
|
209
209
|
if (isNewProject) {
|
|
210
210
|
const packageJsonContent = generatePackageJson(projectNameActual, answers);
|
|
211
211
|
await writeFile(join(targetDir, 'package.json'), packageJsonContent);
|
|
212
|
-
} else if (!existsSync(join(targetDir, 'package.json'))) {
|
|
213
|
-
const minimalPkg = JSON.stringify({ type: 'module', private: true }, null, 2);
|
|
214
|
-
await writeFile(join(targetDir, 'package.json'), minimalPkg);
|
|
215
|
-
} else {
|
|
216
|
-
try {
|
|
217
|
-
const existingPkg = JSON.parse(await readFile(join(targetDir, 'package.json'), 'utf-8'));
|
|
218
|
-
if (!existingPkg.type) {
|
|
219
|
-
existingPkg.type = 'module';
|
|
220
|
-
await writeFile(join(targetDir, 'package.json'), JSON.stringify(existingPkg, null, 2));
|
|
221
|
-
}
|
|
222
|
-
} catch { /* leave existing package.json alone if unparseable */ }
|
|
223
212
|
}
|
|
224
213
|
|
|
225
214
|
// Create .gitignore if doesn't exist
|
|
@@ -715,7 +704,7 @@ npx playwright test --ui
|
|
|
715
704
|
|
|
716
705
|
## Configuration
|
|
717
706
|
|
|
718
|
-
Edit \`.zibby.config.
|
|
707
|
+
Edit \`.zibby.config.mjs\` to customize:
|
|
719
708
|
- Agent settings (model, temperature)
|
|
720
709
|
- Browser settings (headless, viewport)
|
|
721
710
|
- Cloud sync${answers.cloudSync ? ' (enabled)' : ' (disabled)'}
|
|
@@ -726,11 +715,11 @@ Edit \`.zibby.config.js\` to customize:
|
|
|
726
715
|
\`\`\`
|
|
727
716
|
${projectName}/
|
|
728
717
|
├── .zibby/
|
|
729
|
-
│ ├── graph.
|
|
718
|
+
│ ├── graph.mjs # Workflow definition
|
|
730
719
|
│ ├── nodes/ # Custom nodes
|
|
731
720
|
│ └── output/ # Workflow execution results (gitignored)
|
|
732
721
|
│ └── sessions/ # Session artifacts & recordings
|
|
733
|
-
├── .zibby.config.
|
|
722
|
+
├── .zibby.config.mjs # Configuration
|
|
734
723
|
├── .env # API keys (gitignored)
|
|
735
724
|
├── test-specs/ # Test specifications (committed)
|
|
736
725
|
│ └── examples/
|
package/src/commands/run.js
CHANGED
|
@@ -24,20 +24,6 @@ envFiles.forEach(envFile => {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
function ensureEsmPackageJson(dir) {
|
|
28
|
-
const pkgPath = resolve(dir, 'package.json');
|
|
29
|
-
try {
|
|
30
|
-
if (existsSync(pkgPath)) {
|
|
31
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
32
|
-
if (!pkg.type) {
|
|
33
|
-
pkg.type = 'module';
|
|
34
|
-
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
writeFileSync(pkgPath, JSON.stringify({ type: 'module', private: true }, null, 2) + '\n');
|
|
38
|
-
}
|
|
39
|
-
} catch { /* leave it alone */ }
|
|
40
|
-
}
|
|
41
27
|
|
|
42
28
|
function getGeneratedTestPath(specPath, config) {
|
|
43
29
|
const specsDir = config?.paths?.specs || 'test-specs';
|
|
@@ -590,7 +576,6 @@ export async function runCommand(specPath, options) {
|
|
|
590
576
|
playwrightArtifacts: true, // Enable trace.zip generation for exact selectors
|
|
591
577
|
};
|
|
592
578
|
|
|
593
|
-
ensureEsmPackageJson(process.cwd());
|
|
594
579
|
const configPath = resolve(process.cwd(), options.config);
|
|
595
580
|
if (existsSync(configPath)) {
|
|
596
581
|
try {
|
|
@@ -813,7 +798,7 @@ export async function runCommand(specPath, options) {
|
|
|
813
798
|
// Stop spinner before test execution to allow clean streaming output
|
|
814
799
|
spinner.stop();
|
|
815
800
|
|
|
816
|
-
const fallbackAgentModule = await import('@zibby/core/templates/browser-test-automation/graph.
|
|
801
|
+
const fallbackAgentModule = await import('@zibby/core/templates/browser-test-automation/graph.mjs').catch(() => null);
|
|
817
802
|
|
|
818
803
|
const result = await runTest(fullSpecPath, {
|
|
819
804
|
...config,
|