@mondaydotcomorg/z2h-cli 0.15.0 → 0.15.2-feat-eitantsh-z2h-admin-panel-package-388aad6
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/build.d.ts +0 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +0 -3
- package/dist/commands/clean.d.ts +1 -4
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +1 -4
- package/dist/commands/create-workspace.d.ts +1 -4
- package/dist/commands/create-workspace.d.ts.map +1 -1
- package/dist/commands/create-workspace.js +1 -4
- package/dist/commands/create.d.ts +0 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +0 -3
- package/dist/commands/delete.d.ts +0 -1
- package/dist/commands/delete.d.ts.map +1 -1
- package/dist/commands/delete.js +1 -4
- package/dist/commands/deploy.d.ts +0 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +4 -7
- package/dist/commands/dev.d.ts +0 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +0 -3
- package/dist/commands/doctor.d.ts +1 -4
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +2 -5
- package/dist/commands/edit.d.ts +1 -4
- package/dist/commands/edit.d.ts.map +1 -1
- package/dist/commands/edit.js +1 -4
- package/dist/commands/generate-z2h-token.d.ts +0 -1
- package/dist/commands/generate-z2h-token.d.ts.map +1 -1
- package/dist/commands/generate-z2h-token.js +0 -3
- package/dist/commands/grant.d.ts +1 -5
- package/dist/commands/grant.d.ts.map +1 -1
- package/dist/commands/grant.js +1 -10
- package/dist/commands/migrate.d.ts +0 -1
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +106 -4
- package/dist/commands/tag.d.ts +0 -1
- package/dist/commands/tag.d.ts.map +1 -1
- package/dist/commands/tag.js +1 -4
- package/dist/esm/commands/build.d.ts +0 -1
- package/dist/esm/commands/build.d.ts.map +1 -1
- package/dist/esm/commands/build.mjs +1 -4
- package/dist/esm/commands/clean.d.ts +1 -4
- package/dist/esm/commands/clean.d.ts.map +1 -1
- package/dist/esm/commands/clean.mjs +2 -5
- package/dist/esm/commands/create-workspace.d.ts +1 -4
- package/dist/esm/commands/create-workspace.d.ts.map +1 -1
- package/dist/esm/commands/create-workspace.mjs +2 -5
- package/dist/esm/commands/create.d.ts +0 -1
- package/dist/esm/commands/create.d.ts.map +1 -1
- package/dist/esm/commands/create.mjs +1 -4
- package/dist/esm/commands/delete.d.ts +0 -1
- package/dist/esm/commands/delete.d.ts.map +1 -1
- package/dist/esm/commands/delete.mjs +2 -5
- package/dist/esm/commands/deploy.d.ts +0 -1
- package/dist/esm/commands/deploy.d.ts.map +1 -1
- package/dist/esm/commands/deploy.mjs +5 -8
- package/dist/esm/commands/dev.d.ts +0 -1
- package/dist/esm/commands/dev.d.ts.map +1 -1
- package/dist/esm/commands/dev.mjs +1 -4
- package/dist/esm/commands/doctor.d.ts +1 -4
- package/dist/esm/commands/doctor.d.ts.map +1 -1
- package/dist/esm/commands/doctor.mjs +3 -6
- package/dist/esm/commands/edit.d.ts +1 -4
- package/dist/esm/commands/edit.d.ts.map +1 -1
- package/dist/esm/commands/edit.mjs +2 -5
- package/dist/esm/commands/generate-z2h-token.d.ts +0 -1
- package/dist/esm/commands/generate-z2h-token.d.ts.map +1 -1
- package/dist/esm/commands/generate-z2h-token.mjs +1 -4
- package/dist/esm/commands/grant.d.ts +1 -5
- package/dist/esm/commands/grant.d.ts.map +1 -1
- package/dist/esm/commands/grant.mjs +2 -11
- package/dist/esm/commands/migrate.d.ts +0 -1
- package/dist/esm/commands/migrate.d.ts.map +1 -1
- package/dist/esm/commands/migrate.mjs +101 -5
- package/dist/esm/commands/tag.d.ts +0 -1
- package/dist/esm/commands/tag.d.ts.map +1 -1
- package/dist/esm/commands/tag.mjs +2 -5
- package/dist/esm/index.mjs +20 -29
- package/dist/esm/util/tracker.d.ts.map +1 -1
- package/dist/esm/util/tracker.mjs +4 -1
- package/dist/esm/util/workspace.d.ts +3 -0
- package/dist/esm/util/workspace.d.ts.map +1 -1
- package/dist/esm/util/workspace.mjs +64 -2
- package/dist/index.js +19 -28
- package/dist/util/tracker.d.ts.map +1 -1
- package/dist/util/tracker.js +4 -1
- package/dist/util/workspace.d.ts +3 -0
- package/dist/util/workspace.d.ts.map +1 -1
- package/dist/util/workspace.js +65 -0
- package/package.json +1 -1
- package/src/commands/__tests__/doctor.test.ts +12 -5
- package/src/commands/build.ts +1 -6
- package/src/commands/clean.ts +2 -9
- package/src/commands/create-workspace.ts +2 -10
- package/src/commands/create.ts +1 -6
- package/src/commands/delete.ts +2 -7
- package/src/commands/deploy.ts +5 -10
- package/src/commands/dev.ts +1 -6
- package/src/commands/doctor.ts +3 -11
- package/src/commands/edit.ts +2 -10
- package/src/commands/generate-z2h-token.ts +1 -6
- package/src/commands/grant.ts +2 -16
- package/src/commands/migrate.ts +139 -6
- package/src/commands/tag.ts +2 -7
- package/src/index.ts +29 -41
- package/src/util/tracker.ts +6 -1
- package/src/util/workspace.ts +75 -1
- package/dist/esm/migrations/auto-migrate.d.ts +0 -2
- package/dist/esm/migrations/auto-migrate.d.ts.map +0 -1
- package/dist/esm/migrations/auto-migrate.mjs +0 -169
- package/dist/migrations/auto-migrate.d.ts +0 -2
- package/dist/migrations/auto-migrate.d.ts.map +0 -1
- package/dist/migrations/auto-migrate.js +0 -177
- package/src/migrations/auto-migrate.ts +0 -217
package/dist/commands/build.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,wBAAsB,YAAY,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCzE"}
|
package/dist/commands/build.js
CHANGED
|
@@ -7,9 +7,6 @@ const shadow_prepare = require('../shadow/prepare.js');
|
|
|
7
7
|
|
|
8
8
|
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
9
9
|
async function buildCommand(opts = {}) {
|
|
10
|
-
if (opts.json) {
|
|
11
|
-
util_logger.setOutputMode('json');
|
|
12
|
-
}
|
|
13
10
|
const ctx = await shadow_prepare.prepareShadow();
|
|
14
11
|
// Typecheck against the shadow's tsconfig (the consumer dir has none).
|
|
15
12
|
// Errors fail the build before we waste time on the Trident pipeline.
|
package/dist/commands/clean.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../src/commands/clean.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../src/commands/clean.ts"],"names":[],"mappings":"AAKA,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAclD"}
|
package/dist/commands/clean.js
CHANGED
|
@@ -5,10 +5,7 @@ const util_logger = require('../util/logger.js');
|
|
|
5
5
|
const shadow_paths = require('../shadow/paths.js');
|
|
6
6
|
|
|
7
7
|
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
8
|
-
async function cleanCommand(
|
|
9
|
-
if (opts.json) {
|
|
10
|
-
util_logger.setOutputMode('json');
|
|
11
|
-
}
|
|
8
|
+
async function cleanCommand() {
|
|
12
9
|
const paths = shadow_paths.resolveConsumerPaths(process.cwd());
|
|
13
10
|
const existed = await fs.pathExists(paths.shadowDir);
|
|
14
11
|
if (existed) {
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
json?: boolean;
|
|
3
|
-
}
|
|
4
|
-
export declare function createWorkspaceCommand(opts?: CreateWorkspaceOptions): Promise<void>;
|
|
1
|
+
export declare function createWorkspaceCommand(): Promise<void>;
|
|
5
2
|
//# sourceMappingURL=create-workspace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-workspace.d.ts","sourceRoot":"","sources":["../../src/commands/create-workspace.ts"],"names":[],"mappings":"AASA,
|
|
1
|
+
{"version":3,"file":"create-workspace.d.ts","sourceRoot":"","sources":["../../src/commands/create-workspace.ts"],"names":[],"mappings":"AASA,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CA0C5D"}
|
|
@@ -13,10 +13,7 @@ const _interopDefault = e => e && e.__esModule ? e : { default: e };
|
|
|
13
13
|
|
|
14
14
|
const path__default = /*#__PURE__*/_interopDefault(path);
|
|
15
15
|
|
|
16
|
-
async function createWorkspaceCommand(
|
|
17
|
-
if (opts.json) {
|
|
18
|
-
util_logger.setOutputMode('json');
|
|
19
|
-
}
|
|
16
|
+
async function createWorkspaceCommand() {
|
|
20
17
|
const home = util_workspace.getWorkspaceHome();
|
|
21
18
|
const templatesDir = util_templates.getTemplatesDir();
|
|
22
19
|
const wsTemplatesDir = path__default.default.join(templatesDir, 'workspace');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAA2C,MAAM,4BAA4B,CAAC;AAKpH,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,CAAC;AAEzC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAA2C,MAAM,4BAA4B,CAAC;AAKpH,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,CAAC;AAEzC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA6BD,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8F5F"}
|
package/dist/commands/create.js
CHANGED
|
@@ -43,9 +43,6 @@ async function isDirEmpty(dir) {
|
|
|
43
43
|
return entries.length === 0;
|
|
44
44
|
}
|
|
45
45
|
async function createCommand(appName, opts = {}) {
|
|
46
|
-
if (opts.json) {
|
|
47
|
-
util_logger.setOutputMode('json');
|
|
48
|
-
}
|
|
49
46
|
// Validate workspace.
|
|
50
47
|
const workspace = await util_workspace.assertWorkspace();
|
|
51
48
|
// Validate app name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/commands/delete.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/commands/delete.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAkBD,wBAAsB,aAAa,CAAC,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B3E"}
|
package/dist/commands/delete.js
CHANGED
|
@@ -19,9 +19,6 @@ async function confirmByName(appSlug) {
|
|
|
19
19
|
}
|
|
20
20
|
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
21
21
|
async function deleteCommand(opts = {}) {
|
|
22
|
-
if (opts.json) {
|
|
23
|
-
util_logger.setOutputMode('json');
|
|
24
|
-
}
|
|
25
22
|
const cwdName = util_appName.getCwdAppName();
|
|
26
23
|
if (!cwdName) {
|
|
27
24
|
throw new Error('Run this from inside a consumer app directory (the one with your package.json).');
|
|
@@ -30,7 +27,7 @@ async function deleteCommand(opts = {}) {
|
|
|
30
27
|
const appName = util_appName.mfAppName(cwdName); // canonical mf- bundle name the backend keys on
|
|
31
28
|
// Confirmation. --json is always non-interactive, so it requires --yes.
|
|
32
29
|
if (!opts.yes) {
|
|
33
|
-
if (
|
|
30
|
+
if (util_logger.getOutputMode() === 'json' || !process.stdin.isTTY) {
|
|
34
31
|
throw new Error('Refusing to delete without confirmation — pass --yes to delete non-interactively.');
|
|
35
32
|
}
|
|
36
33
|
if (!(await confirmByName(appSlug))) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,UAAU,EAA2C,MAAM,4BAA4B,CAAC;AAKtG,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,UAAU,EAA2C,MAAM,4BAA4B,CAAC;AAKtG,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,wBAAsB,aAAa,CAAC,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmJ3E"}
|
package/dist/commands/deploy.js
CHANGED
|
@@ -27,9 +27,6 @@ const os__default = /*#__PURE__*/_interopDefault(os);
|
|
|
27
27
|
|
|
28
28
|
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
29
29
|
async function deployCommand(opts = {}) {
|
|
30
|
-
if (opts.json) {
|
|
31
|
-
util_logger.setOutputMode('json');
|
|
32
|
-
}
|
|
33
30
|
const paths = shadow_paths.resolveConsumerPaths(process.cwd());
|
|
34
31
|
const consumerPkg = (await fs.readJson(paths.consumerPkg));
|
|
35
32
|
if (!consumerPkg.name) {
|
|
@@ -77,7 +74,7 @@ async function deployCommand(opts = {}) {
|
|
|
77
74
|
const keyPrefix = `${appName}/${nextVersion}`;
|
|
78
75
|
const url = `${constants.BUCKET_READ_DNS_URL}/${keyPrefix}`;
|
|
79
76
|
util_logger.info('building');
|
|
80
|
-
await commands_build.buildCommand({
|
|
77
|
+
await commands_build.buildCommand({ publicUrl: url });
|
|
81
78
|
if (!(await fs.pathExists(paths.shadowBuild))) {
|
|
82
79
|
throw new Error(`No build output at ${paths.shadowBuild} after build step.`);
|
|
83
80
|
}
|
|
@@ -128,7 +125,7 @@ async function deployCommand(opts = {}) {
|
|
|
128
125
|
// The two are separate endpoints, so the CLI picks based on the version it
|
|
129
126
|
// was handed.
|
|
130
127
|
if (nextVersion === 1) {
|
|
131
|
-
const visibility = await resolveFirstDeployVisibility(appName
|
|
128
|
+
const visibility = await resolveFirstDeployVisibility(appName);
|
|
132
129
|
util_logger.info(`registering app "${appName}" → v${nextVersion} (${visibility})`);
|
|
133
130
|
await registerApp(appName, token, nextVersion, entry, visibility, gitRemote);
|
|
134
131
|
}
|
|
@@ -221,8 +218,8 @@ async function updateApp(appName, token, version, entry, gitRemote) {
|
|
|
221
218
|
// First deploy only: decide whether the app is born public or private. The
|
|
222
219
|
// choice is passed to the register endpoint (default private). Non-interactive
|
|
223
220
|
// runs (--json or no TTY) always default to private.
|
|
224
|
-
async function resolveFirstDeployVisibility(appName
|
|
225
|
-
if (json || !process.stdout.isTTY) {
|
|
221
|
+
async function resolveFirstDeployVisibility(appName) {
|
|
222
|
+
if (util_logger.getOutputMode() === 'json' || !process.stdout.isTTY) {
|
|
226
223
|
return 'private';
|
|
227
224
|
}
|
|
228
225
|
const rl = node_readline.createInterface({ input: process.stdin, output: process.stdout });
|
package/dist/commands/dev.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAKD,wBAAsB,UAAU,CAAC,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAyErE"}
|
package/dist/commands/dev.js
CHANGED
|
@@ -19,9 +19,6 @@ const fs__default = /*#__PURE__*/_interopDefault(fs$1);
|
|
|
19
19
|
const TRIDENT_READY_PATTERN = /Server started at/i;
|
|
20
20
|
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
21
21
|
async function devCommand(opts = {}) {
|
|
22
|
-
if (opts.json) {
|
|
23
|
-
util_logger.setOutputMode('json');
|
|
24
|
-
}
|
|
25
22
|
const ctx = await shadow_prepare.prepareShadow();
|
|
26
23
|
const { port } = ctx;
|
|
27
24
|
const url = `https://bigbrain.me/bigbrain-vibe/${ctx.appName}?zth_local=${port}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AA2TA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAqEnD"}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -263,10 +263,7 @@ function renderCheck(c) {
|
|
|
263
263
|
process.stdout.write(` ${icon} ${label}${detail}\n`);
|
|
264
264
|
}
|
|
265
265
|
// ── command ───────────────────────────────────────────────────────────────────
|
|
266
|
-
async function doctorCommand(
|
|
267
|
-
if (opts.json) {
|
|
268
|
-
util_logger.setOutputMode('json');
|
|
269
|
-
}
|
|
266
|
+
async function doctorCommand() {
|
|
270
267
|
let pluginsJson = null;
|
|
271
268
|
try {
|
|
272
269
|
if (await fs.pathExists(CLAUDE_PLUGINS_JSON)) {
|
|
@@ -292,7 +289,7 @@ async function doctorCommand(opts = {}) {
|
|
|
292
289
|
];
|
|
293
290
|
const allChecks = sections.flatMap(s => s.checks);
|
|
294
291
|
const issues = allChecks.filter(c => c.status !== 'ok');
|
|
295
|
-
if (
|
|
292
|
+
if (util_logger.getOutputMode() === 'json') {
|
|
296
293
|
util_logger.output('', {
|
|
297
294
|
ok: issues.filter(c => c.status === 'fail').length === 0,
|
|
298
295
|
checks: allChecks,
|
package/dist/commands/edit.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/commands/edit.ts"],"names":[],"mappings":"AAWA,
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/commands/edit.ts"],"names":[],"mappings":"AAWA,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2ChE"}
|
package/dist/commands/edit.js
CHANGED
|
@@ -15,10 +15,7 @@ const _interopDefault = e => e && e.__esModule ? e : { default: e };
|
|
|
15
15
|
|
|
16
16
|
const path__default = /*#__PURE__*/_interopDefault(path);
|
|
17
17
|
|
|
18
|
-
async function editCommand(appName
|
|
19
|
-
if (opts.json) {
|
|
20
|
-
util_logger.setOutputMode('json');
|
|
21
|
-
}
|
|
18
|
+
async function editCommand(appName) {
|
|
22
19
|
const workspace = await util_workspace.assertWorkspace();
|
|
23
20
|
const mfName = util_appName.mfAppName(appName);
|
|
24
21
|
const app = await util_broker_app.fetchApp(mfName);
|
|
@@ -10,7 +10,6 @@ export interface GenerateZ2HTokenOptions {
|
|
|
10
10
|
noBrowser?: boolean;
|
|
11
11
|
/** Override the page URL — useful when pointing at staging. */
|
|
12
12
|
url?: string;
|
|
13
|
-
json?: boolean;
|
|
14
13
|
}
|
|
15
14
|
export declare function generateZ2HTokenCommand(opts?: GenerateZ2HTokenOptions): Promise<void>;
|
|
16
15
|
//# sourceMappingURL=generate-z2h-token.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-z2h-token.d.ts","sourceRoot":"","sources":["../../src/commands/generate-z2h-token.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sBAAsB,yDAAyD,CAAC;AAC7F,eAAO,MAAM,mBAAmB,SAAU,CAAC;AAE3C,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-z2h-token.d.ts","sourceRoot":"","sources":["../../src/commands/generate-z2h-token.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sBAAsB,yDAAyD,CAAC;AAC7F,eAAO,MAAM,mBAAmB,SAAU,CAAC;AAE3C,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAwDD,wBAAsB,uBAAuB,CAAC,IAAI,GAAE,uBAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B/F"}
|
|
@@ -62,9 +62,6 @@ async function runLoopbackFlow(pageUrl) {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
async function generateZ2HTokenCommand(opts = {}) {
|
|
65
|
-
if (opts.json) {
|
|
66
|
-
util_logger.setOutputMode('json');
|
|
67
|
-
}
|
|
68
65
|
const pageUrl = opts.url ?? process.env.Z2H_TOKEN_PAGE_URL ?? DEFAULT_TOKEN_PAGE_URL;
|
|
69
66
|
// --no-browser bypasses both auto-open and the loopback round-trip — the
|
|
70
67
|
// user opens the URL themselves and pastes the token. Useful when the
|
package/dist/commands/grant.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
export interface GrantOptions {
|
|
2
2
|
public?: boolean;
|
|
3
3
|
level?: 'owner' | 'editor' | 'viewer';
|
|
4
|
-
json?: boolean;
|
|
5
4
|
}
|
|
6
5
|
export declare function grantCommand(email: string | undefined, opts: GrantOptions): Promise<void>;
|
|
7
6
|
export declare function revokeCommand(email: string | undefined, opts: GrantOptions): Promise<void>;
|
|
8
|
-
export
|
|
9
|
-
json?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function transferOwnerCommand(email: string | undefined, opts: TransferOwnerOptions): Promise<void>;
|
|
7
|
+
export declare function transferOwnerCommand(email: string | undefined): Promise<void>;
|
|
12
8
|
//# sourceMappingURL=grant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/commands/grant.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/commands/grant.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;CACvC;AAkBD,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B/F;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBhG;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBnF"}
|
package/dist/commands/grant.js
CHANGED
|
@@ -17,9 +17,6 @@ async function postGrant(appName, token, body) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
async function grantCommand(email, opts) {
|
|
20
|
-
if (opts.json) {
|
|
21
|
-
util_logger.setOutputMode('json');
|
|
22
|
-
}
|
|
23
20
|
if (!opts.public && !email) {
|
|
24
21
|
throw new Error('Specify what to grant — e.g. --public or provide an email');
|
|
25
22
|
}
|
|
@@ -45,9 +42,6 @@ async function grantCommand(email, opts) {
|
|
|
45
42
|
util_logger.output(`[z2h-cli] "${appName}" granted to: ${parts.join(', ')}`, { ok: true, appName, granted: parts });
|
|
46
43
|
}
|
|
47
44
|
async function revokeCommand(email, opts) {
|
|
48
|
-
if (opts.json) {
|
|
49
|
-
util_logger.setOutputMode('json');
|
|
50
|
-
}
|
|
51
45
|
if (!opts.public && !email) {
|
|
52
46
|
throw new Error('Specify what to revoke — e.g. --public or provide an email');
|
|
53
47
|
}
|
|
@@ -68,10 +62,7 @@ async function revokeCommand(email, opts) {
|
|
|
68
62
|
: `[z2h-cli] "${appName}" is now private (owners/admins only)`;
|
|
69
63
|
util_logger.output(msg, { ok: true, appName, revoked });
|
|
70
64
|
}
|
|
71
|
-
async function transferOwnerCommand(email
|
|
72
|
-
if (opts.json) {
|
|
73
|
-
util_logger.setOutputMode('json');
|
|
74
|
-
}
|
|
65
|
+
async function transferOwnerCommand(email) {
|
|
75
66
|
if (!email) {
|
|
76
67
|
throw new Error('Specify the new owner — e.g. z2h-cli transfer-owner someone@monday.com');
|
|
77
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AA6CA,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkGjG"}
|
package/dist/commands/migrate.js
CHANGED
|
@@ -1,13 +1,115 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
+
const node_module = require('node:module');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const node_url = require('node:url');
|
|
6
|
+
const fs = require('fs-extra');
|
|
7
|
+
const semver = require('semver');
|
|
3
8
|
const util_logger = require('../util/logger.js');
|
|
4
|
-
const
|
|
9
|
+
const util_workspace = require('../util/workspace.js');
|
|
5
10
|
|
|
11
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
12
|
+
const _interopDefault = e => e && e.__esModule ? e : { default: e };
|
|
13
|
+
|
|
14
|
+
const path__default = /*#__PURE__*/_interopDefault(path);
|
|
15
|
+
const semver__default = /*#__PURE__*/_interopDefault(semver);
|
|
16
|
+
|
|
17
|
+
const STATE_FILE = '.z2h-migrations-state.json';
|
|
18
|
+
// ─── Helpers ───
|
|
19
|
+
async function readMigrationState(workspaceHome) {
|
|
20
|
+
const statePath = path__default.default.join(workspaceHome, STATE_FILE);
|
|
21
|
+
if (!(await fs.pathExists(statePath))) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
return (await fs.readJson(statePath));
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function writeMigrationState(workspaceHome, state) {
|
|
32
|
+
const statePath = path__default.default.join(workspaceHome, STATE_FILE);
|
|
33
|
+
await fs.writeJson(statePath, state, { spaces: 2 });
|
|
34
|
+
}
|
|
6
35
|
async function migrateCommand(cliVersion, opts = {}) {
|
|
7
|
-
|
|
8
|
-
|
|
36
|
+
const workspaceHome = util_workspace.getWorkspaceHome();
|
|
37
|
+
if (!(await util_workspace.isZ2hWorkspace(workspaceHome))) {
|
|
38
|
+
util_logger.warn('no Z2H workspace found');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const state = await readMigrationState(workspaceHome);
|
|
42
|
+
const lastVersion = state?.lastMigratedVersion ?? '0.0.0';
|
|
43
|
+
if (!semver__default.default.gt(cliVersion, lastVersion)) {
|
|
44
|
+
util_logger.info('workspace is up to date — no migrations pending');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
util_logger.info(`migrating workspace from v${lastVersion} → v${cliVersion}...`);
|
|
48
|
+
// migrations.json is at the package root — two dirs up from dist/migrations/
|
|
49
|
+
const thisDir = path__default.default.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('commands/migrate.js', document.baseURI).href))));
|
|
50
|
+
const migrationsJsonPath = path__default.default.resolve(thisDir, '..', '..', 'migrations.json');
|
|
51
|
+
if (!(await fs.pathExists(migrationsJsonPath))) {
|
|
52
|
+
util_logger.warn('migrations.json not found — skipping migrations');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const migrationsJson = (await fs.readJson(migrationsJsonPath));
|
|
56
|
+
// Filter to pending migrations (version > lastVersion AND <= cliVersion).
|
|
57
|
+
// CONVENTION: a migration's `version` field must equal the CLI release it
|
|
58
|
+
// ships with (not the feature branch version). This ensures the `gt` check
|
|
59
|
+
// always catches a migration on the exact upgrade that introduces it.
|
|
60
|
+
const pending = Object.entries(migrationsJson.migrations)
|
|
61
|
+
.filter(([, entry]) => semver__default.default.gt(entry.version, lastVersion) && semver__default.default.lte(entry.version, cliVersion))
|
|
62
|
+
.sort(([, a], [, b]) => semver__default.default.compare(a.version, b.version));
|
|
63
|
+
if (opts.dryRun) {
|
|
64
|
+
util_logger.info(`${pending.length} pending migration(s) (dry-run — no changes will be applied):`);
|
|
65
|
+
for (const [, entry] of pending) {
|
|
66
|
+
util_logger.info(` - ${entry.description} (v${entry.version})`);
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (pending.length === 0) {
|
|
71
|
+
await writeMigrationState(workspaceHome, { lastMigratedVersion: cliVersion });
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const nxReady = await util_workspace.ensureWorkspaceNx(workspaceHome);
|
|
75
|
+
if (!nxReady) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
util_logger.info(`applying ${pending.length} workspace migration(s)...`);
|
|
79
|
+
// Resolve NX from the workspace's node_modules (not from CLI's own deps)
|
|
80
|
+
const wsRequire = node_module.createRequire(path__default.default.join(workspaceHome, 'package.json'));
|
|
81
|
+
const { FsTree, flushChanges } = wsRequire('nx/src/generators/tree');
|
|
82
|
+
let needsInstall = false;
|
|
83
|
+
for (const [name, entry] of pending) {
|
|
84
|
+
const tree = new FsTree(workspaceHome, false);
|
|
85
|
+
try {
|
|
86
|
+
const factoryPath = path__default.default.resolve(path__default.default.dirname(migrationsJsonPath), entry.migrate);
|
|
87
|
+
const mod = require(factoryPath);
|
|
88
|
+
const fn = mod.default || mod;
|
|
89
|
+
fn(tree);
|
|
90
|
+
const changes = tree.listChanges();
|
|
91
|
+
if (changes.length > 0) {
|
|
92
|
+
if (changes.some(c => c.path.endsWith('package.json'))) {
|
|
93
|
+
needsInstall = true;
|
|
94
|
+
}
|
|
95
|
+
flushChanges(workspaceHome, changes);
|
|
96
|
+
util_logger.info(` ✓ ${entry.description}`);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
util_logger.info(` ○ ${entry.description} (no changes needed)`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
const errorMessage = `migration "${name}" failed: ${err.message}`;
|
|
104
|
+
util_logger.errorLog(`${errorMessage}\nSkipping remaining migrations — run "z2h-cli migrate" to retry.`);
|
|
105
|
+
throw new Error(errorMessage);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (needsInstall) {
|
|
109
|
+
await util_workspace.runYarnInstall(workspaceHome, 'package.json changed');
|
|
9
110
|
}
|
|
10
|
-
await
|
|
111
|
+
await writeMigrationState(workspaceHome, { lastMigratedVersion: cliVersion });
|
|
112
|
+
util_logger.info('workspace migrations complete.');
|
|
11
113
|
}
|
|
12
114
|
|
|
13
115
|
exports.migrateCommand = migrateCommand;
|
package/dist/commands/tag.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { type AppTag, type CatalogEntry } from '../util/tags';
|
|
|
2
2
|
export interface TagOptions {
|
|
3
3
|
/** Repeatable `--tag` — sets the full tag set non-interactively. */
|
|
4
4
|
tag?: string[];
|
|
5
|
-
json?: boolean;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
7
|
* Closed-list prompt: one numbered pick per dimension (app type, team). Enter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/commands/tag.ts"],"names":[],"mappings":"AAMA,OAAO,EAML,KAAK,MAAM,EACX,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,UAAU;IACzB,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/commands/tag.ts"],"names":[],"mappings":"AAMA,OAAO,EAML,KAAK,MAAM,EACX,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,UAAU;IACzB,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAgCD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA0ClH;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B5F"}
|
package/dist/commands/tag.js
CHANGED
|
@@ -87,9 +87,6 @@ async function promptForTags(appSlug, catalog, current) {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
async function tagCommand(appArg, opts) {
|
|
90
|
-
if (opts.json) {
|
|
91
|
-
util_logger.setOutputMode('json');
|
|
92
|
-
}
|
|
93
90
|
const appSlug = await resolveAppSlug(appArg);
|
|
94
91
|
// Non-interactive write: `--tag` flags set the full set directly.
|
|
95
92
|
if (opts.tag && opts.tag.length > 0) {
|
|
@@ -101,7 +98,7 @@ async function tagCommand(appArg, opts) {
|
|
|
101
98
|
// Read-only listing: agents (`--json`) and any non-TTY caller get the catalog
|
|
102
99
|
// + current tags without a prompt — then they set tags via `--tag`. This also
|
|
103
100
|
// avoids hanging on `readline` when no human is attached to stdin.
|
|
104
|
-
if (
|
|
101
|
+
if (util_logger.getOutputMode() === 'json' || !process.stdin.isTTY) {
|
|
105
102
|
util_logger.output(`[z2h-cli] "${appSlug}"\n catalog: ${catalog.map(t => `${t.name} (${util_tags.TAG_TYPE_LABELS[t.type]})`).join(', ') || '(none)'}\n current: ${formatTags(current)}`, { ok: true, appName: appSlug, catalog, current });
|
|
106
103
|
return;
|
|
107
104
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,wBAAsB,YAAY,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCzE"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { pathExists } from 'fs-extra';
|
|
2
2
|
import { execa } from 'execa';
|
|
3
|
-
import {
|
|
3
|
+
import { info, output } from '../util/logger.mjs';
|
|
4
4
|
import { prepareShadow } from '../shadow/prepare.mjs';
|
|
5
5
|
|
|
6
6
|
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
7
7
|
async function buildCommand(opts = {}) {
|
|
8
|
-
if (opts.json) {
|
|
9
|
-
setOutputMode('json');
|
|
10
|
-
}
|
|
11
8
|
const ctx = await prepareShadow();
|
|
12
9
|
// Typecheck against the shadow's tsconfig (the consumer dir has none).
|
|
13
10
|
// Errors fail the build before we waste time on the Trident pipeline.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/commands/clean.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/commands/clean.ts"],"names":[],"mappings":"AAKA,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAclD"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { pathExists, remove } from 'fs-extra';
|
|
2
|
-
import {
|
|
2
|
+
import { info, output } from '../util/logger.mjs';
|
|
3
3
|
import { resolveConsumerPaths } from '../shadow/paths.mjs';
|
|
4
4
|
|
|
5
5
|
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
6
|
-
async function cleanCommand(
|
|
7
|
-
if (opts.json) {
|
|
8
|
-
setOutputMode('json');
|
|
9
|
-
}
|
|
6
|
+
async function cleanCommand() {
|
|
10
7
|
const paths = resolveConsumerPaths(process.cwd());
|
|
11
8
|
const existed = await pathExists(paths.shadowDir);
|
|
12
9
|
if (existed) {
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
json?: boolean;
|
|
3
|
-
}
|
|
4
|
-
export declare function createWorkspaceCommand(opts?: CreateWorkspaceOptions): Promise<void>;
|
|
1
|
+
export declare function createWorkspaceCommand(): Promise<void>;
|
|
5
2
|
//# sourceMappingURL=create-workspace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-workspace.d.ts","sourceRoot":"","sources":["../../../src/commands/create-workspace.ts"],"names":[],"mappings":"AASA,
|
|
1
|
+
{"version":3,"file":"create-workspace.d.ts","sourceRoot":"","sources":["../../../src/commands/create-workspace.ts"],"names":[],"mappings":"AASA,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CA0C5D"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { pathExists, readdir, ensureDir, writeFile, copy } from 'fs-extra';
|
|
4
|
-
import {
|
|
4
|
+
import { output, info } from '../util/logger.mjs';
|
|
5
5
|
import { getWorkspaceHome } from '../util/workspace.mjs';
|
|
6
6
|
import { getTemplatesDir } from '../util/templates.mjs';
|
|
7
7
|
import { runYarnInstall } from '../util/npm/install.mjs';
|
|
8
8
|
import { workspaceYarnrcContents, workspaceNpmrcContents } from '../util/npm/broker-config.mjs';
|
|
9
9
|
|
|
10
|
-
async function createWorkspaceCommand(
|
|
11
|
-
if (opts.json) {
|
|
12
|
-
setOutputMode('json');
|
|
13
|
-
}
|
|
10
|
+
async function createWorkspaceCommand() {
|
|
14
11
|
const home = getWorkspaceHome();
|
|
15
12
|
const templatesDir = getTemplatesDir();
|
|
16
13
|
const wsTemplatesDir = path.join(templatesDir, 'workspace');
|