@zibby/cli 0.1.9 → 0.1.11
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
CHANGED
package/src/auth/cli-login.js
CHANGED
|
@@ -272,7 +272,6 @@ export async function showLoginStatus(options = {}) {
|
|
|
272
272
|
// Verify token
|
|
273
273
|
if (token) {
|
|
274
274
|
try {
|
|
275
|
-
const fetch = (await import('node-fetch')).default;
|
|
276
275
|
const response = await fetch(`${apiUrl}/projects`, {
|
|
277
276
|
headers: { 'Authorization': `Bearer ${token}` }
|
|
278
277
|
});
|
|
@@ -343,7 +342,6 @@ export async function showLoginStatus(options = {}) {
|
|
|
343
342
|
if (token) {
|
|
344
343
|
try {
|
|
345
344
|
const oraSpinner = (await import('ora')).default;
|
|
346
|
-
const fetch = (await import('node-fetch')).default;
|
|
347
345
|
|
|
348
346
|
const spinner = oraSpinner('Verifying authentication...').start();
|
|
349
347
|
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { join, dirname } from 'path';
|
|
3
|
+
import { createRequire } from 'module';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
|
|
8
|
+
function findCorePackagePath() {
|
|
9
|
+
try {
|
|
10
|
+
return dirname(require.resolve('@zibby/core/package.json'));
|
|
11
|
+
} catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
|
|
9
16
|
async function runScript(scriptName, description, headed = false, cloudSync = false, video = 'on', viewport = null) {
|
|
10
|
-
const corePackagePath =
|
|
17
|
+
const corePackagePath = findCorePackagePath();
|
|
18
|
+
if (!corePackagePath) {
|
|
19
|
+
throw new Error('@zibby/core not found. Run: npm install @zibby/core');
|
|
20
|
+
}
|
|
11
21
|
const scriptPath = join(corePackagePath, 'scripts', scriptName);
|
|
12
22
|
|
|
13
23
|
const env = { ...process.env };
|
|
@@ -64,7 +74,10 @@ export async function setupCiCommand(_options) {
|
|
|
64
74
|
|
|
65
75
|
export async function testWithVideoCommand(testFile, options) {
|
|
66
76
|
try {
|
|
67
|
-
const corePackagePath =
|
|
77
|
+
const corePackagePath = findCorePackagePath();
|
|
78
|
+
if (!corePackagePath) {
|
|
79
|
+
throw new Error('@zibby/core not found. Run: npm install @zibby/core');
|
|
80
|
+
}
|
|
68
81
|
const scriptPath = join(corePackagePath, 'scripts', 'test-with-video.sh');
|
|
69
82
|
|
|
70
83
|
const args = [scriptPath, testFile || 'tests/'];
|
package/src/commands/upload.js
CHANGED
|
@@ -4,7 +4,6 @@ import { glob } from 'glob';
|
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import ora from 'ora';
|
|
6
6
|
import dotenv from 'dotenv';
|
|
7
|
-
import fetch from 'node-fetch';
|
|
8
7
|
import { getApiUrl, getCurrentEnvironment, getFrontendUrl } from '../config/environments.js';
|
|
9
8
|
import { getSessionToken, getUserInfo } from '../config/config.js';
|
|
10
9
|
|
package/src/commands/workflow.js
CHANGED
|
@@ -3,7 +3,6 @@ import { resolve, join } from 'path';
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import ora from 'ora';
|
|
5
5
|
import dotenv from 'dotenv';
|
|
6
|
-
import fetch from 'node-fetch';
|
|
7
6
|
import { getApiUrl, getCurrentEnvironment } from '../config/environments.js';
|
|
8
7
|
import { validateGraphConfig } from '@zibby/core/framework/graph-compiler.js';
|
|
9
8
|
import { generateWorkflowCode, generateNodeConfigsJson } from '@zibby/core/framework/code-generator.js';
|