@mondaydotcomorg/z2h-cli 0.7.2-feat-arielle-build-after-create-and-improve-setup-script-c31a761 → 0.7.2
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.map +1 -1
- package/dist/commands/build.js +0 -1
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +0 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +0 -5
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +0 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +0 -3
- package/dist/esm/commands/build.d.ts.map +1 -1
- package/dist/esm/commands/build.mjs +0 -1
- package/dist/esm/commands/clean.d.ts.map +1 -1
- package/dist/esm/commands/clean.mjs +0 -1
- package/dist/esm/commands/create.d.ts.map +1 -1
- package/dist/esm/commands/create.mjs +0 -5
- package/dist/esm/commands/deploy.d.ts.map +1 -1
- package/dist/esm/commands/deploy.mjs +0 -1
- package/dist/esm/commands/dev.d.ts.map +1 -1
- package/dist/esm/commands/dev.mjs +0 -3
- package/dist/esm/index.mjs +1 -4
- package/dist/esm/migrations/auto-migrate.mjs +3 -3
- package/dist/esm/templates/app/claude-settings.mjs +1 -1
- package/dist/index.js +1 -4
- package/dist/migrations/auto-migrate.js +3 -3
- package/dist/templates/app/claude-settings.js +1 -1
- package/package.json +1 -1
- package/src/commands/__tests__/create.test.ts +0 -7
- package/src/commands/build.ts +0 -1
- package/src/commands/clean.ts +0 -1
- package/src/commands/create.ts +0 -6
- package/src/commands/deploy.ts +0 -1
- package/src/commands/dev.ts +0 -3
- package/src/index.ts +1 -4
- package/src/migrations/auto-migrate.ts +4 -4
- package/src/templates/app/CLAUDE.md +1 -3
- package/src/templates/app/claude-settings.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCpE"}
|
package/dist/commands/build.js
CHANGED
|
@@ -5,7 +5,6 @@ const execa = require('execa');
|
|
|
5
5
|
const util_logger = require('../util/logger.js');
|
|
6
6
|
const shadow_prepare = require('../shadow/prepare.js');
|
|
7
7
|
|
|
8
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
9
8
|
async function buildCommand(opts) {
|
|
10
9
|
if (opts.json) {
|
|
11
10
|
util_logger.setOutputMode('json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../src/commands/clean.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../src/commands/clean.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBpE"}
|
package/dist/commands/clean.js
CHANGED
|
@@ -4,7 +4,6 @@ const fsExtra = require('fs-extra');
|
|
|
4
4
|
const util_logger = require('../util/logger.js');
|
|
5
5
|
const shadow_paths = require('../shadow/paths.js');
|
|
6
6
|
|
|
7
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
8
7
|
async function cleanCommand(opts) {
|
|
9
8
|
if (opts.json) {
|
|
10
9
|
util_logger.setOutputMode('json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA6BD,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAkFvF"}
|
package/dist/commands/create.js
CHANGED
|
@@ -10,7 +10,6 @@ const util_manifest = require('../util/manifest.js');
|
|
|
10
10
|
const util_appName = require('../util/app-name.js');
|
|
11
11
|
const constants = require('../constants.js');
|
|
12
12
|
const util_npm_install = require('../util/npm/install.js');
|
|
13
|
-
const commands_build = require('./build.js');
|
|
14
13
|
|
|
15
14
|
const _interopDefault = e => e && e.__esModule ? e : { default: e };
|
|
16
15
|
|
|
@@ -98,10 +97,6 @@ async function createCommand(appName, opts) {
|
|
|
98
97
|
}
|
|
99
98
|
util_logger.info(`installing dependencies for ${appName}...`);
|
|
100
99
|
await util_npm_install.runYarnInstall({ cwd: workspace });
|
|
101
|
-
// build/dev/deploy all locate the consumer via process.cwd() — chdir before calling them.
|
|
102
|
-
util_logger.info(`pre-building ${appName}`);
|
|
103
|
-
process.chdir(appDir);
|
|
104
|
-
await commands_build.buildCommand({});
|
|
105
100
|
util_logger.output(`[z2h-cli] app ready at ${appDir}`, {
|
|
106
101
|
ok: true,
|
|
107
102
|
appDir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA+EtE"}
|
package/dist/commands/deploy.js
CHANGED
|
@@ -18,7 +18,6 @@ const _interopDefault = e => e && e.__esModule ? e : { default: e };
|
|
|
18
18
|
const path__default = /*#__PURE__*/_interopDefault(path);
|
|
19
19
|
const os__default = /*#__PURE__*/_interopDefault(os);
|
|
20
20
|
|
|
21
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
22
21
|
async function deployCommand(opts) {
|
|
23
22
|
if (opts.json) {
|
|
24
23
|
util_logger.setOutputMode('json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAID,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAuEhE"}
|
package/dist/commands/dev.js
CHANGED
|
@@ -16,7 +16,6 @@ const path__default = /*#__PURE__*/_interopDefault(path);
|
|
|
16
16
|
const fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
17
17
|
|
|
18
18
|
const TRIDENT_READY_PATTERN = /Server started at/i;
|
|
19
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
20
19
|
async function devCommand(opts) {
|
|
21
20
|
if (opts.json) {
|
|
22
21
|
util_logger.setOutputMode('json');
|
|
@@ -31,8 +30,6 @@ async function devCommand(opts) {
|
|
|
31
30
|
const server = execa.execa('yarn', ['start'], {
|
|
32
31
|
cwd: ctx.paths.shadowDir,
|
|
33
32
|
stdio: ['inherit', 'pipe', 'inherit'],
|
|
34
|
-
// Trident requires NPM_TOKEN to be set or it refuses to start; 'FAKE_TOKEN' satisfies the check without real credentials.
|
|
35
|
-
env: { ...process.env, NPM_TOKEN: process.env.NPM_TOKEN ?? 'FAKE_TOKEN' },
|
|
36
33
|
});
|
|
37
34
|
const pidFile = path__default.default.join(ctx.paths.shadowDir, 'dev.pid');
|
|
38
35
|
if (server.pid) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCpE"}
|
|
@@ -3,7 +3,6 @@ import { execa } from 'execa';
|
|
|
3
3
|
import { setOutputMode, info, output } from '../util/logger.mjs';
|
|
4
4
|
import { prepareShadow } from '../shadow/prepare.mjs';
|
|
5
5
|
|
|
6
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
7
6
|
async function buildCommand(opts) {
|
|
8
7
|
if (opts.json) {
|
|
9
8
|
setOutputMode('json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/commands/clean.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/commands/clean.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBpE"}
|
|
@@ -2,7 +2,6 @@ import { pathExists, remove } from 'fs-extra';
|
|
|
2
2
|
import { setOutputMode, info, output } from '../util/logger.mjs';
|
|
3
3
|
import { resolveConsumerPaths } from '../shadow/paths.mjs';
|
|
4
4
|
|
|
5
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
6
5
|
async function cleanCommand(opts) {
|
|
7
6
|
if (opts.json) {
|
|
8
7
|
setOutputMode('json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/create.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA6BD,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAkFvF"}
|
|
@@ -8,7 +8,6 @@ import { readManifest } from '../util/manifest.mjs';
|
|
|
8
8
|
import { mfAppName } from '../util/app-name.mjs';
|
|
9
9
|
import { APP_NAME_PATTERN } from '../constants.mjs';
|
|
10
10
|
import { runYarnInstall } from '../util/npm/install.mjs';
|
|
11
|
-
import { buildCommand } from './build.mjs';
|
|
12
11
|
|
|
13
12
|
// Names reserved by the host MF (mf-bigbrain-zth) for platform pages under
|
|
14
13
|
// /bigbrain-vibe/<name>. Creating an app with one of these would shadow the
|
|
@@ -92,10 +91,6 @@ async function createCommand(appName, opts) {
|
|
|
92
91
|
}
|
|
93
92
|
info(`installing dependencies for ${appName}...`);
|
|
94
93
|
await runYarnInstall({ cwd: workspace });
|
|
95
|
-
// build/dev/deploy all locate the consumer via process.cwd() — chdir before calling them.
|
|
96
|
-
info(`pre-building ${appName}`);
|
|
97
|
-
process.chdir(appDir);
|
|
98
|
-
await buildCommand({});
|
|
99
94
|
output(`[z2h-cli] app ready at ${appDir}`, {
|
|
100
95
|
ok: true,
|
|
101
96
|
appDir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA+EtE"}
|
|
@@ -11,7 +11,6 @@ import { readZthAuth } from '../util/auth/auth-store.mjs';
|
|
|
11
11
|
import { mfAppName, cleanAppName } from '../util/app-name.mjs';
|
|
12
12
|
import { buildCommand } from './build.mjs';
|
|
13
13
|
|
|
14
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
15
14
|
async function deployCommand(opts) {
|
|
16
15
|
if (opts.json) {
|
|
17
16
|
setOutputMode('json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/commands/dev.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/commands/dev.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAID,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAuEhE"}
|
|
@@ -9,7 +9,6 @@ import { ensureConsumerPkg } from '../shadow/consumer-pkg.mjs';
|
|
|
9
9
|
import { syncShadow } from '../shadow/sync.mjs';
|
|
10
10
|
|
|
11
11
|
const TRIDENT_READY_PATTERN = /Server started at/i;
|
|
12
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
13
12
|
async function devCommand(opts) {
|
|
14
13
|
if (opts.json) {
|
|
15
14
|
setOutputMode('json');
|
|
@@ -24,8 +23,6 @@ async function devCommand(opts) {
|
|
|
24
23
|
const server = execa('yarn', ['start'], {
|
|
25
24
|
cwd: ctx.paths.shadowDir,
|
|
26
25
|
stdio: ['inherit', 'pipe', 'inherit'],
|
|
27
|
-
// Trident requires NPM_TOKEN to be set or it refuses to start; 'FAKE_TOKEN' satisfies the check without real credentials.
|
|
28
|
-
env: { ...process.env, NPM_TOKEN: process.env.NPM_TOKEN ?? 'FAKE_TOKEN' },
|
|
29
26
|
});
|
|
30
27
|
const pidFile = path.join(ctx.paths.shadowDir, 'dev.pid');
|
|
31
28
|
if (server.pid) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -19,10 +19,7 @@ const { version } = createRequire(import.meta.url)('../package.json');
|
|
|
19
19
|
const UPDATE_SCRIPT = path.join(os.homedir(), 'Development', 'bigbrain-z2h', 'z2h', 'setup', 'update.sh');
|
|
20
20
|
function selfUpdate() {
|
|
21
21
|
try {
|
|
22
|
-
execa('bash', [UPDATE_SCRIPT], {
|
|
23
|
-
detached: true,
|
|
24
|
-
stdio: 'ignore',
|
|
25
|
-
}).unref();
|
|
22
|
+
execa('bash', [UPDATE_SCRIPT], { detached: true, stdio: 'ignore' }).unref();
|
|
26
23
|
}
|
|
27
24
|
catch (err) {
|
|
28
25
|
errorLog(`Z2H auto-update failed to start: ${err.message}`);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { execa } from 'execa';
|
|
2
|
-
import { pathExists, readJson, writeJson, writeFile } from 'fs-extra';
|
|
3
|
-
import { createRequire } from 'node:module';
|
|
4
1
|
import path from 'node:path';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
5
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { pathExists, readJson, writeJson, writeFile } from 'fs-extra';
|
|
5
|
+
import { execa } from 'execa';
|
|
6
6
|
import semver from 'semver';
|
|
7
7
|
import { warn, info, errorLog } from '../util/logger.mjs';
|
|
8
8
|
import { getWorkspaceHome, isZ2hWorkspace } from '../util/workspace.mjs';
|
|
@@ -9,7 +9,7 @@ var hooks = {
|
|
|
9
9
|
hooks: [
|
|
10
10
|
{
|
|
11
11
|
type: "command",
|
|
12
|
-
command: "if [ -f .zth/dev.pid ]; then
|
|
12
|
+
command: "if [ -f .zth/dev.pid ]; then kill $(cat .zth/dev.pid) 2>/dev/null; rm .zth/dev.pid; fi"
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
}
|
package/dist/index.js
CHANGED
|
@@ -25,10 +25,7 @@ const { version } = node_module.createRequire((typeof document === 'undefined' ?
|
|
|
25
25
|
const UPDATE_SCRIPT = path__default.default.join(os__default.default.homedir(), 'Development', 'bigbrain-z2h', 'z2h', 'setup', 'update.sh');
|
|
26
26
|
function selfUpdate() {
|
|
27
27
|
try {
|
|
28
|
-
execa.execa('bash', [UPDATE_SCRIPT], {
|
|
29
|
-
detached: true,
|
|
30
|
-
stdio: 'ignore',
|
|
31
|
-
}).unref();
|
|
28
|
+
execa.execa('bash', [UPDATE_SCRIPT], { detached: true, stdio: 'ignore' }).unref();
|
|
32
29
|
}
|
|
33
30
|
catch (err) {
|
|
34
31
|
util_logger.errorLog(`Z2H auto-update failed to start: ${err.message}`);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const execa = require('execa');
|
|
4
|
-
const fsExtra = require('fs-extra');
|
|
5
|
-
const node_module = require('node:module');
|
|
6
3
|
const path = require('node:path');
|
|
4
|
+
const node_module = require('node:module');
|
|
7
5
|
const node_url = require('node:url');
|
|
6
|
+
const fsExtra = require('fs-extra');
|
|
7
|
+
const execa = require('execa');
|
|
8
8
|
const semver = require('semver');
|
|
9
9
|
const util_logger = require('../util/logger.js');
|
|
10
10
|
const util_workspace = require('../util/workspace.js');
|
|
@@ -11,7 +11,7 @@ var hooks = {
|
|
|
11
11
|
hooks: [
|
|
12
12
|
{
|
|
13
13
|
type: "command",
|
|
14
|
-
command: "if [ -f .zth/dev.pid ]; then
|
|
14
|
+
command: "if [ -f .zth/dev.pid ]; then kill $(cat .zth/dev.pid) 2>/dev/null; rm .zth/dev.pid; fi"
|
|
15
15
|
}
|
|
16
16
|
]
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,6 @@ import { mkdtemp, rm, writeJson, readJson, ensureDir, pathExists, writeFile } fr
|
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
5
|
|
|
6
6
|
import { runYarnInstall } from '../../util/npm/install';
|
|
7
|
-
import { buildCommand } from '../build';
|
|
8
7
|
import { createCommand } from '../create';
|
|
9
8
|
import * as manifest from '../../util/manifest';
|
|
10
9
|
|
|
@@ -15,11 +14,6 @@ vi.mock('../../util/npm/install', () => ({
|
|
|
15
14
|
runYarnInstall: vi.fn().mockResolvedValue(undefined),
|
|
16
15
|
}));
|
|
17
16
|
|
|
18
|
-
// Mock build so tsc/yarn build don't run in tests.
|
|
19
|
-
vi.mock('../build', () => ({
|
|
20
|
-
buildCommand: vi.fn().mockResolvedValue(undefined),
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
17
|
vi.spyOn(manifest, 'readManifest').mockResolvedValue({});
|
|
24
18
|
|
|
25
19
|
async function makeWorkspace(tmp: string): Promise<void> {
|
|
@@ -39,7 +33,6 @@ describe('create', () => {
|
|
|
39
33
|
tmp = await mkdtemp(path.join(os.tmpdir(), 'z2h-c-'));
|
|
40
34
|
process.env.Z2H_WORKSPACE_HOME = tmp;
|
|
41
35
|
vi.mocked(runYarnInstall).mockClear();
|
|
42
|
-
vi.mocked(buildCommand).mockClear();
|
|
43
36
|
});
|
|
44
37
|
|
|
45
38
|
afterEach(async () => {
|
package/src/commands/build.ts
CHANGED
|
@@ -8,7 +8,6 @@ export interface BuildOptions {
|
|
|
8
8
|
publicUrl?: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
12
11
|
export async function buildCommand(opts: BuildOptions): Promise<void> {
|
|
13
12
|
if (opts.json) {
|
|
14
13
|
setOutputMode('json');
|
package/src/commands/clean.ts
CHANGED
package/src/commands/create.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { readManifest } from '../util/manifest';
|
|
|
8
8
|
import { mfAppName } from '../util/app-name';
|
|
9
9
|
import { APP_NAME_PATTERN } from '../constants';
|
|
10
10
|
import { runYarnInstall } from '../util/npm/install';
|
|
11
|
-
import { buildCommand } from './build';
|
|
12
11
|
|
|
13
12
|
export interface CreateOptions {
|
|
14
13
|
template?: string;
|
|
@@ -119,11 +118,6 @@ export async function createCommand(appName: string, opts: CreateOptions): Promi
|
|
|
119
118
|
info(`installing dependencies for ${appName}...`);
|
|
120
119
|
await runYarnInstall({ cwd: workspace });
|
|
121
120
|
|
|
122
|
-
// build/dev/deploy all locate the consumer via process.cwd() — chdir before calling them.
|
|
123
|
-
info(`pre-building ${appName}`);
|
|
124
|
-
process.chdir(appDir);
|
|
125
|
-
await buildCommand({});
|
|
126
|
-
|
|
127
121
|
output(`[z2h-cli] app ready at ${appDir}`, {
|
|
128
122
|
ok: true,
|
|
129
123
|
appDir,
|
package/src/commands/deploy.ts
CHANGED
|
@@ -23,7 +23,6 @@ export interface DeployOptions {
|
|
|
23
23
|
json?: boolean;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
27
26
|
export async function deployCommand(opts: DeployOptions): Promise<void> {
|
|
28
27
|
if (opts.json) {
|
|
29
28
|
setOutputMode('json');
|
package/src/commands/dev.ts
CHANGED
|
@@ -15,7 +15,6 @@ export interface DevOptions {
|
|
|
15
15
|
|
|
16
16
|
const TRIDENT_READY_PATTERN = /Server started at/i;
|
|
17
17
|
|
|
18
|
-
// Should be run from the consumer app directory — uses process.cwd() to locate it.
|
|
19
18
|
export async function devCommand(opts: DevOptions): Promise<void> {
|
|
20
19
|
if (opts.json) {
|
|
21
20
|
setOutputMode('json');
|
|
@@ -32,8 +31,6 @@ export async function devCommand(opts: DevOptions): Promise<void> {
|
|
|
32
31
|
const server = execa('yarn', ['start'], {
|
|
33
32
|
cwd: ctx.paths.shadowDir,
|
|
34
33
|
stdio: ['inherit', 'pipe', 'inherit'],
|
|
35
|
-
// Trident requires NPM_TOKEN to be set or it refuses to start; 'FAKE_TOKEN' satisfies the check without real credentials.
|
|
36
|
-
env: { ...process.env, NPM_TOKEN: process.env.NPM_TOKEN ?? 'FAKE_TOKEN' },
|
|
37
34
|
});
|
|
38
35
|
|
|
39
36
|
const pidFile = path.join(ctx.paths.shadowDir, 'dev.pid');
|
package/src/index.ts
CHANGED
|
@@ -21,10 +21,7 @@ const UPDATE_SCRIPT = path.join(os.homedir(), 'Development', 'bigbrain-z2h', 'z2
|
|
|
21
21
|
|
|
22
22
|
function selfUpdate(): void {
|
|
23
23
|
try {
|
|
24
|
-
execa('bash', [UPDATE_SCRIPT], {
|
|
25
|
-
detached: true,
|
|
26
|
-
stdio: 'ignore',
|
|
27
|
-
}).unref();
|
|
24
|
+
execa('bash', [UPDATE_SCRIPT], { detached: true, stdio: 'ignore' }).unref();
|
|
28
25
|
} catch (err) {
|
|
29
26
|
errorLog(`Z2H auto-update failed to start: ${(err as Error).message}`);
|
|
30
27
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { execa } from 'execa';
|
|
2
|
-
import { pathExists, readJson, writeFile, writeJson } from 'fs-extra';
|
|
3
|
-
import { createRequire } from 'node:module';
|
|
4
1
|
import path from 'node:path';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
5
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { pathExists, readJson, writeJson, writeFile } from 'fs-extra';
|
|
5
|
+
import { execa } from 'execa';
|
|
6
6
|
import semver from 'semver';
|
|
7
|
-
import {
|
|
7
|
+
import { info, warn, errorLog } from '../util/logger';
|
|
8
8
|
import { getWorkspaceHome, isZ2hWorkspace } from '../util/workspace';
|
|
9
9
|
|
|
10
10
|
const STATE_FILE = '.z2h-migrations-state.json';
|
|
@@ -27,9 +27,7 @@ The orchestrator routes to `z2h:feature-development`, which handles the typechec
|
|
|
27
27
|
|
|
28
28
|
## 🌟 Data-Fetching Hierarchy
|
|
29
29
|
|
|
30
|
-
When a request needs data, follow `z2h:coding-standards-mf` §0: write a `runQuery` helper for Snowflake data (TS module using `getBigBrainAPI()` for React apps; vanilla `<script>` using `window.location.origin` for html-embed apps), write a client-side fetch for other browser-accessible sources, or tell the user to reach out at `#ask-zero-to-hero` if the data needs an API key or server-side access. Backend changes to `bigbrain-zth` are not in scope
|
|
31
|
-
|
|
32
|
-
**Query storage:** All SQL query strings go in `src/queries.ts`, not inline in components or hooks. Import from there.
|
|
30
|
+
When a request needs data, follow `z2h:coding-standards-mf` §0: write a `runQuery` helper for Snowflake data (TS module using `getBigBrainAPI()` for React apps; vanilla `<script>` using `window.location.origin` for html-embed apps), write a client-side fetch for other browser-accessible sources, or tell the user to reach out at `#ask-zero-to-hero` if the data needs an API key or server-side access. Backend changes to `bigbrain-zth` are not in scope.
|
|
33
31
|
|
|
34
32
|
---
|
|
35
33
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"hooks": [
|
|
11
11
|
{
|
|
12
12
|
"type": "command",
|
|
13
|
-
"command": "if [ -f .zth/dev.pid ]; then
|
|
13
|
+
"command": "if [ -f .zth/dev.pid ]; then kill $(cat .zth/dev.pid) 2>/dev/null; rm .zth/dev.pid; fi"
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
}
|