@zibby/cli 0.1.7 → 0.1.9
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/package.json +2 -3
- package/src/commands/run.js +16 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zibby/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Zibby CLI - Test automation generator and runner",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,10 +37,9 @@
|
|
|
37
37
|
"chalk": "^5.3.0",
|
|
38
38
|
"commander": "^12.0.0",
|
|
39
39
|
"dotenv": "^17.2.3",
|
|
40
|
-
"glob": "^
|
|
40
|
+
"glob": "^13.0.0",
|
|
41
41
|
"handlebars": "^4.7.8",
|
|
42
42
|
"inquirer": "^13.3.0",
|
|
43
|
-
"node-fetch": "^3.3.2",
|
|
44
43
|
"open": "^10.2.0",
|
|
45
44
|
"ora": "^8.0.1"
|
|
46
45
|
},
|
package/src/commands/run.js
CHANGED
|
@@ -5,7 +5,6 @@ import { glob } from 'glob';
|
|
|
5
5
|
import chalk from 'chalk';
|
|
6
6
|
import ora from 'ora';
|
|
7
7
|
import dotenv from 'dotenv';
|
|
8
|
-
import fetch from 'node-fetch';
|
|
9
8
|
import open from 'open';
|
|
10
9
|
import { getApiUrl, getAccountApiUrl, getCurrentEnvironment, getFrontendUrl } from '../config/environments.js';
|
|
11
10
|
import { getSessionToken, getUserInfo } from '../config/config.js';
|
|
@@ -25,6 +24,21 @@ envFiles.forEach(envFile => {
|
|
|
25
24
|
}
|
|
26
25
|
});
|
|
27
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
|
+
|
|
28
42
|
function getGeneratedTestPath(specPath, config) {
|
|
29
43
|
const specsDir = config?.paths?.specs || 'test-specs';
|
|
30
44
|
const generatedDir = config?.paths?.generated || 'tests';
|
|
@@ -576,6 +590,7 @@ export async function runCommand(specPath, options) {
|
|
|
576
590
|
playwrightArtifacts: true, // Enable trace.zip generation for exact selectors
|
|
577
591
|
};
|
|
578
592
|
|
|
593
|
+
ensureEsmPackageJson(process.cwd());
|
|
579
594
|
const configPath = resolve(process.cwd(), options.config);
|
|
580
595
|
if (existsSync(configPath)) {
|
|
581
596
|
try {
|