@mondaydotcomorg/z2h-cli 0.7.1 → 0.7.2-fix-arielle-cli-infinite-updates-and-skill-improves-0f06f2d

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.
@@ -18,8 +18,22 @@ import { trackDuration } from './util/tracker.mjs';
18
18
  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
+ // Re-entrancy guard. update.sh runs `z2h-cli migrate` (and may run other
22
+ // z2h-cli commands); without this, each command would fire selfUpdate again
23
+ // and spawn a fresh update.sh — an infinite loop of detached updates. We tag
24
+ // the spawned update.sh with Z2H_UPDATE_RUNNING, so every z2h-cli it invokes
25
+ // inherits the flag and skips its own selfUpdate. The flag lives only on the
26
+ // spawned child's environment — it never touches the user's shell, so there
27
+ // is nothing to unset.
28
+ if (process.env.Z2H_UPDATE_RUNNING) {
29
+ return;
30
+ }
21
31
  try {
22
- execa('bash', [UPDATE_SCRIPT], { detached: true, stdio: 'ignore' }).unref();
32
+ execa('bash', [UPDATE_SCRIPT], {
33
+ detached: true,
34
+ stdio: 'ignore',
35
+ env: { ...process.env, Z2H_UPDATE_RUNNING: '1' },
36
+ }).unref();
23
37
  }
24
38
  catch (err) {
25
39
  errorLog(`Z2H auto-update failed to start: ${err.message}`);
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/shadow/scaffold.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAyG9C;;;GAGG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvG"}
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/shadow/scaffold.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA0G9C;;;GAGG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvG"}
@@ -1,7 +1,8 @@
1
1
  import path from 'node:path';
2
2
  import { ensureDir, writeFile, writeJson } from 'fs-extra';
3
3
 
4
- const WRAPPER_TEMPLATE = `import ConsumerApp from '../../src/index';
4
+ const WRAPPER_TEMPLATE = `import '@vibe/core/tokens';
5
+ import ConsumerApp from '../../src/index';
5
6
  import React from 'react';
6
7
  import * as ReactDOM from 'react-dom/client';
7
8
  import { ErrorBoundary } from 'react-error-boundary';
package/dist/index.js CHANGED
@@ -24,8 +24,22 @@ const path__default = /*#__PURE__*/_interopDefault(path);
24
24
  const { version } = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)))('../package.json');
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
+ // Re-entrancy guard. update.sh runs `z2h-cli migrate` (and may run other
28
+ // z2h-cli commands); without this, each command would fire selfUpdate again
29
+ // and spawn a fresh update.sh — an infinite loop of detached updates. We tag
30
+ // the spawned update.sh with Z2H_UPDATE_RUNNING, so every z2h-cli it invokes
31
+ // inherits the flag and skips its own selfUpdate. The flag lives only on the
32
+ // spawned child's environment — it never touches the user's shell, so there
33
+ // is nothing to unset.
34
+ if (process.env.Z2H_UPDATE_RUNNING) {
35
+ return;
36
+ }
27
37
  try {
28
- execa.execa('bash', [UPDATE_SCRIPT], { detached: true, stdio: 'ignore' }).unref();
38
+ execa.execa('bash', [UPDATE_SCRIPT], {
39
+ detached: true,
40
+ stdio: 'ignore',
41
+ env: { ...process.env, Z2H_UPDATE_RUNNING: '1' },
42
+ }).unref();
29
43
  }
30
44
  catch (err) {
31
45
  util_logger.errorLog(`Z2H auto-update failed to start: ${err.message}`);
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/shadow/scaffold.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAyG9C;;;GAGG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvG"}
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/shadow/scaffold.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA0G9C;;;GAGG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvG"}
@@ -7,7 +7,8 @@ const _interopDefault = e => e && e.__esModule ? e : { default: e };
7
7
 
8
8
  const path__default = /*#__PURE__*/_interopDefault(path);
9
9
 
10
- const WRAPPER_TEMPLATE = `import ConsumerApp from '../../src/index';
10
+ const WRAPPER_TEMPLATE = `import '@vibe/core/tokens';
11
+ import ConsumerApp from '../../src/index';
11
12
  import React from 'react';
12
13
  import * as ReactDOM from 'react-dom/client';
13
14
  import { ErrorBoundary } from 'react-error-boundary';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondaydotcomorg/z2h-cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.2-fix-arielle-cli-infinite-updates-and-skill-improves-0f06f2d",
4
4
  "bin": "./bin/z2h-cli.js",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/src/index.ts CHANGED
@@ -20,8 +20,23 @@ const { version } = createRequire(import.meta.url)('../package.json') as { versi
20
20
  const UPDATE_SCRIPT = path.join(os.homedir(), 'Development', 'bigbrain-z2h', 'z2h', 'setup', 'update.sh');
21
21
 
22
22
  function selfUpdate(): void {
23
+ // Re-entrancy guard. update.sh runs `z2h-cli migrate` (and may run other
24
+ // z2h-cli commands); without this, each command would fire selfUpdate again
25
+ // and spawn a fresh update.sh — an infinite loop of detached updates. We tag
26
+ // the spawned update.sh with Z2H_UPDATE_RUNNING, so every z2h-cli it invokes
27
+ // inherits the flag and skips its own selfUpdate. The flag lives only on the
28
+ // spawned child's environment — it never touches the user's shell, so there
29
+ // is nothing to unset.
30
+ if (process.env.Z2H_UPDATE_RUNNING) {
31
+ return;
32
+ }
33
+
23
34
  try {
24
- execa('bash', [UPDATE_SCRIPT], { detached: true, stdio: 'ignore' }).unref();
35
+ execa('bash', [UPDATE_SCRIPT], {
36
+ detached: true,
37
+ stdio: 'ignore',
38
+ env: { ...process.env, Z2H_UPDATE_RUNNING: '1' },
39
+ }).unref();
25
40
  } catch (err) {
26
41
  errorLog(`Z2H auto-update failed to start: ${(err as Error).message}`);
27
42
  }
@@ -2,7 +2,8 @@ import path from 'node:path';
2
2
  import { ensureDir, writeFile, writeJson } from 'fs-extra';
3
3
  import type { ConsumerPaths } from '../types';
4
4
 
5
- const WRAPPER_TEMPLATE = `import ConsumerApp from '../../src/index';
5
+ const WRAPPER_TEMPLATE = `import '@vibe/core/tokens';
6
+ import ConsumerApp from '../../src/index';
6
7
  import React from 'react';
7
8
  import * as ReactDOM from 'react-dom/client';
8
9
  import { ErrorBoundary } from 'react-error-boundary';
@@ -27,7 +27,9 @@ 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.
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 — no modifications, no suggestions, no workarounds.
31
+
32
+ **Query storage:** All SQL query strings go in `src/queries.ts`, not inline in components or hooks. Import from there.
31
33
 
32
34
  ---
33
35