@quolu/lattice 0.60.0 → 0.60.1
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/bin/lattice.mjs +5 -5
- package/package.json +1 -1
- package/src/sensor-node-runtime.mjs +7 -9
package/bin/lattice.mjs
CHANGED
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { installPipeCloseGuard } from '../src/cli-stdio.mjs';
|
|
5
|
-
import { runRuntimeCli } from '../src/runtime-cli.mjs';
|
|
6
5
|
import { renderCliHelp } from '../src/cli-help.mjs';
|
|
7
|
-
import {
|
|
6
|
+
import { relaunchForNode22IfNeeded } from '../src/sensor-node-runtime.mjs';
|
|
8
7
|
import packageJson from '../package.json' with { type: 'json' };
|
|
9
8
|
|
|
10
9
|
installPipeCloseGuard();
|
|
11
10
|
|
|
12
11
|
const args = process.argv.slice(2);
|
|
13
|
-
const
|
|
12
|
+
const node22RelaunchStatus = relaunchForNode22IfNeeded({
|
|
14
13
|
args,
|
|
15
14
|
scriptPath: fileURLToPath(import.meta.url),
|
|
16
15
|
});
|
|
17
16
|
const help = renderCliHelp(args);
|
|
18
17
|
|
|
19
|
-
if (
|
|
20
|
-
process.exitCode =
|
|
18
|
+
if (node22RelaunchStatus !== null) {
|
|
19
|
+
process.exitCode = node22RelaunchStatus;
|
|
21
20
|
} else if (help !== null) {
|
|
22
21
|
process.stdout.write(help);
|
|
23
22
|
} else if (args.length === 1 && args[0] === '--version') {
|
|
@@ -125,6 +124,7 @@ if (sensorRelaunchStatus !== null) {
|
|
|
125
124
|
});
|
|
126
125
|
} else {
|
|
127
126
|
try {
|
|
127
|
+
const { runRuntimeCli } = await import('../src/runtime-cli.mjs');
|
|
128
128
|
process.exitCode = await runRuntimeCli({
|
|
129
129
|
argv: args,
|
|
130
130
|
cwd: process.cwd(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quolu/lattice",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.1",
|
|
4
4
|
"description": "Schedulability compiler for multi-agent development: observe real code boundaries, refactor the conflicting seam, recompile the plan for parallel execution",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Quo / クオ at kitepon.dev",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
|
|
3
3
|
export const SQLITE_EXPERIMENTAL_WARNING_FLAG = '--disable-warning=ExperimentalWarning';
|
|
4
|
-
const RELAUNCH_GUARD_ENV = '
|
|
4
|
+
const RELAUNCH_GUARD_ENV = 'LATTICE_SQLITE_WARNING_RELAUNCHED';
|
|
5
5
|
|
|
6
6
|
export function sensorNodeRuntimeFlags(nodeVersion = process.versions.node) {
|
|
7
7
|
const major = Number(nodeVersion.split('.')[0]);
|
|
8
8
|
return major === 22 ? [SQLITE_EXPERIMENTAL_WARNING_FLAG] : [];
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export function
|
|
11
|
+
export function node22RelaunchArgv(
|
|
12
12
|
scriptPath,
|
|
13
13
|
args,
|
|
14
14
|
execArgv = process.execArgv,
|
|
@@ -20,20 +20,18 @@ export function sensorRelaunchArgv(
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Node 22 prints node:sqlite's ExperimentalWarning to stderr.
|
|
24
|
-
*
|
|
25
|
-
* surface with Node's warning-category flag before node:sqlite is imported.
|
|
23
|
+
* Node 22 prints node:sqlite's ExperimentalWarning to stderr. The CLI has a
|
|
24
|
+
* JSON-only output contract, so relaunch before any command can import node:sqlite.
|
|
26
25
|
*/
|
|
27
|
-
export function
|
|
26
|
+
export function relaunchForNode22IfNeeded({ args, scriptPath, env = process.env }) {
|
|
28
27
|
const flags = sensorNodeRuntimeFlags();
|
|
29
|
-
if (
|
|
30
|
-
|| flags.length === 0
|
|
28
|
+
if (flags.length === 0
|
|
31
29
|
|| flags.every((flag) => process.execArgv.includes(flag))
|
|
32
30
|
|| env[RELAUNCH_GUARD_ENV] === '1') return null;
|
|
33
31
|
|
|
34
32
|
const result = spawnSync(
|
|
35
33
|
process.execPath,
|
|
36
|
-
|
|
34
|
+
node22RelaunchArgv(scriptPath, args),
|
|
37
35
|
{
|
|
38
36
|
cwd: process.cwd(),
|
|
39
37
|
env: { ...env, [RELAUNCH_GUARD_ENV]: '1' },
|