@hydranium/cli 1.0.0-next.23 → 1.0.0-next.232
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/README.md +37 -15
- package/bin/hydranium-cli.js +13 -0
- package/lib/cli-version.js.map +1 -1
- package/lib/cli.js +0 -0
- package/lib/commands/analyze-heap-args.js.map +1 -1
- package/lib/commands/analyze-heap.d.ts +3 -0
- package/lib/commands/analyze-heap.d.ts.map +1 -1
- package/lib/commands/analyze-heap.js +2 -1
- package/lib/commands/analyze-heap.js.map +1 -1
- package/lib/commands/ast-ground-truth-args.d.ts +3 -2
- package/lib/commands/ast-ground-truth-args.d.ts.map +1 -1
- package/lib/commands/ast-ground-truth-args.js +11 -9
- package/lib/commands/ast-ground-truth-args.js.map +1 -1
- package/lib/commands/ast-ground-truth.js +1 -1
- package/lib/commands/ast-ground-truth.js.map +1 -1
- package/lib/commands/generate-ast-builder.d.ts +49 -0
- package/lib/commands/generate-ast-builder.d.ts.map +1 -0
- package/lib/commands/generate-ast-builder.js +200 -0
- package/lib/commands/generate-ast-builder.js.map +1 -0
- package/lib/commands/generate-transfer-model-args.d.ts.map +1 -1
- package/lib/commands/generate-transfer-model-args.js +11 -1
- package/lib/commands/generate-transfer-model-args.js.map +1 -1
- package/lib/commands/generate-transfer-model-config.d.ts.map +1 -1
- package/lib/commands/generate-transfer-model-config.js +3 -1
- package/lib/commands/generate-transfer-model-config.js.map +1 -1
- package/lib/commands/generate-transfer-model.d.ts +9 -0
- package/lib/commands/generate-transfer-model.d.ts.map +1 -1
- package/lib/commands/generate-transfer-model.js +16 -3
- package/lib/commands/generate-transfer-model.js.map +1 -1
- package/lib/commands/harness-args.d.ts +37 -42
- package/lib/commands/harness-args.d.ts.map +1 -1
- package/lib/commands/harness-args.js +65 -25
- package/lib/commands/harness-args.js.map +1 -1
- package/lib/commands/headless-harness.d.ts +37 -20
- package/lib/commands/headless-harness.d.ts.map +1 -1
- package/lib/commands/headless-harness.js +68 -17
- package/lib/commands/headless-harness.js.map +1 -1
- package/lib/commands/init-args.js +6 -6
- package/lib/commands/init-args.js.map +1 -1
- package/lib/commands/init-prompt.d.ts.map +1 -1
- package/lib/commands/init-templates.d.ts +8 -10
- package/lib/commands/init-templates.d.ts.map +1 -1
- package/lib/commands/init-templates.js +245 -140
- package/lib/commands/init-templates.js.map +1 -1
- package/lib/commands/init-wizard.js +4 -4
- package/lib/commands/init-wizard.js.map +1 -1
- package/lib/commands/init-workspace.d.ts +13 -3
- package/lib/commands/init-workspace.d.ts.map +1 -1
- package/lib/commands/init-workspace.js +21 -6
- package/lib/commands/init-workspace.js.map +1 -1
- package/lib/commands/init.d.ts +16 -10
- package/lib/commands/init.d.ts.map +1 -1
- package/lib/commands/init.js +17 -15
- package/lib/commands/init.js.map +1 -1
- package/lib/commands/lint-grammar-args.d.ts +3 -2
- package/lib/commands/lint-grammar-args.d.ts.map +1 -1
- package/lib/commands/lint-grammar-args.js +13 -10
- package/lib/commands/lint-grammar-args.js.map +1 -1
- package/lib/commands/lint-grammar-report.js.map +1 -1
- package/lib/commands/lint-grammar.js +1 -1
- package/lib/commands/lint-grammar.js.map +1 -1
- package/lib/commands/measure-memory-args.d.ts +3 -2
- package/lib/commands/measure-memory-args.d.ts.map +1 -1
- package/lib/commands/measure-memory-args.js +20 -10
- package/lib/commands/measure-memory-args.js.map +1 -1
- package/lib/commands/measure-memory-driver.js +3 -2
- package/lib/commands/measure-memory-driver.js.map +1 -1
- package/lib/commands/measure-memory.js +1 -1
- package/lib/commands/measure-memory.js.map +1 -1
- package/lib/commands/model-docs-args.d.ts +4 -3
- package/lib/commands/model-docs-args.d.ts.map +1 -1
- package/lib/commands/model-docs-args.js +12 -10
- package/lib/commands/model-docs-args.js.map +1 -1
- package/lib/commands/model-docs.js +1 -1
- package/lib/commands/model-docs.js.map +1 -1
- package/lib/commands/projects-args.d.ts.map +1 -1
- package/lib/commands/projects-args.js +5 -5
- package/lib/commands/projects-args.js.map +1 -1
- package/lib/commands/projects.d.ts +3 -4
- package/lib/commands/projects.d.ts.map +1 -1
- package/lib/commands/projects.js +2 -2
- package/lib/commands/projects.js.map +1 -1
- package/lib/commands/query-args.d.ts.map +1 -1
- package/lib/commands/query-args.js +5 -5
- package/lib/commands/query-args.js.map +1 -1
- package/lib/commands/query.d.ts +3 -4
- package/lib/commands/query.d.ts.map +1 -1
- package/lib/commands/query.js +2 -2
- package/lib/commands/query.js.map +1 -1
- package/lib/commands/reflect-args.d.ts +3 -2
- package/lib/commands/reflect-args.d.ts.map +1 -1
- package/lib/commands/reflect-args.js +13 -10
- package/lib/commands/reflect-args.js.map +1 -1
- package/lib/commands/reflect-report.js.map +1 -1
- package/lib/commands/reflect.js +1 -1
- package/lib/commands/reflect.js.map +1 -1
- package/lib/commands/save-args.d.ts.map +1 -1
- package/lib/commands/save-args.js +6 -4
- package/lib/commands/save-args.js.map +1 -1
- package/lib/commands/save.d.ts +8 -4
- package/lib/commands/save.d.ts.map +1 -1
- package/lib/commands/save.js +31 -6
- package/lib/commands/save.js.map +1 -1
- package/lib/commands/validate-args.d.ts +3 -2
- package/lib/commands/validate-args.d.ts.map +1 -1
- package/lib/commands/validate-args.js +13 -10
- package/lib/commands/validate-args.js.map +1 -1
- package/lib/commands/validate-report.js.map +1 -1
- package/lib/commands/validate.js +1 -1
- package/lib/commands/validate.js.map +1 -1
- package/lib/commands/watch-args.d.ts.map +1 -1
- package/lib/commands/watch-args.js +6 -4
- package/lib/commands/watch-args.js.map +1 -1
- package/lib/commands/watch.d.ts +3 -4
- package/lib/commands/watch.d.ts.map +1 -1
- package/lib/commands/watch.js +20 -2
- package/lib/commands/watch.js.map +1 -1
- package/lib/driver-heap.d.ts +52 -0
- package/lib/driver-heap.d.ts.map +1 -0
- package/lib/driver-heap.js +51 -0
- package/lib/driver-heap.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/log-level.d.ts +21 -11
- package/lib/log-level.d.ts.map +1 -1
- package/lib/log-level.js +25 -14
- package/lib/log-level.js.map +1 -1
- package/lib/spawn-data-server.d.ts +6 -1
- package/lib/spawn-data-server.d.ts.map +1 -1
- package/lib/spawn-data-server.js +2 -1
- package/lib/spawn-data-server.js.map +1 -1
- package/lib/stderr-connection-logger.d.ts +12 -0
- package/lib/stderr-connection-logger.d.ts.map +1 -0
- package/lib/stderr-connection-logger.js +16 -0
- package/lib/stderr-connection-logger.js.map +1 -0
- package/lib/testing/echo-server.js +8 -1
- package/lib/testing/echo-server.js.map +1 -1
- package/package.json +39 -39
- package/src/commands/analyze-heap.ts +4 -1
- package/src/commands/ast-ground-truth-args.ts +15 -12
- package/src/commands/ast-ground-truth.ts +1 -1
- package/src/commands/generate-ast-builder.ts +246 -0
- package/src/commands/generate-transfer-model-args.ts +11 -1
- package/src/commands/generate-transfer-model-config.ts +3 -1
- package/src/commands/generate-transfer-model.ts +25 -3
- package/src/commands/harness-args.ts +73 -28
- package/src/commands/headless-harness.ts +86 -26
- package/src/commands/init-args.ts +6 -6
- package/src/commands/init-templates.ts +255 -142
- package/src/commands/init-wizard.ts +4 -4
- package/src/commands/init-workspace.ts +31 -7
- package/src/commands/init.ts +36 -26
- package/src/commands/lint-grammar-args.ts +17 -13
- package/src/commands/lint-grammar.ts +1 -1
- package/src/commands/measure-memory-args.ts +25 -13
- package/src/commands/measure-memory-driver.ts +3 -2
- package/src/commands/measure-memory.ts +1 -1
- package/src/commands/model-docs-args.ts +16 -13
- package/src/commands/model-docs.ts +1 -1
- package/src/commands/projects-args.ts +5 -4
- package/src/commands/projects.ts +4 -6
- package/src/commands/query-args.ts +5 -4
- package/src/commands/query.ts +4 -6
- package/src/commands/reflect-args.ts +17 -13
- package/src/commands/reflect.ts +1 -1
- package/src/commands/save-args.ts +6 -3
- package/src/commands/save.ts +49 -10
- package/src/commands/validate-args.ts +17 -13
- package/src/commands/validate.ts +1 -1
- package/src/commands/watch-args.ts +6 -3
- package/src/commands/watch.ts +28 -7
- package/src/driver-heap.ts +65 -0
- package/src/index.ts +1 -0
- package/src/log-level.ts +42 -14
- package/src/spawn-data-server.ts +14 -2
- package/src/stderr-connection-logger.ts +18 -0
- package/src/testing/echo-server.ts +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AASlF,OAAO,EAAE,MAAM,EAAmB,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AA2D1D;;;;;;;;;;;;;;;GAeG;AACH,KAAK,UAAU,uBAAuB,CAAC,cAA0C,EAAE,MAA+B;IAC/G,IAAI,CAAC,cAAc,EAAE,CAAC;QACnB,OAAO,IAAI,OAAO,CAAO,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,CAAC;QACF,MAAM,cAAc,CAAC;IACxB,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACrB,MAAM,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3D,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACnB,OAAO;QACV,CAAC;QACD,MAAM,GAAG,CAAC;IACb,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,UAA2B;IACxD,MAAM,OAAO,GAAG,GAAS,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ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AC;IACxD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
/**
|
|
10
|
+
* Heap ceiling in MiB for a driver child on a machine with no cgroup limit.
|
|
11
|
+
*
|
|
12
|
+
* The subcommands that spawn one build a whole workspace in that child —
|
|
13
|
+
* `measure-memory` deliberately so, `analyze-heap` loads an entire heap
|
|
14
|
+
* snapshot — so the default Node would pick from physical RAM is too low for
|
|
15
|
+
* the workspaces these are pointed at.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DRIVER_HEAP_MB = 8192;
|
|
18
|
+
/** Environment variable an operator raises or lowers {@link driverHeapArgs} with. */
|
|
19
|
+
export declare const DRIVER_HEAP_ENV = "HYDRANIUM_CLI_MAX_OLD_SPACE_MB";
|
|
20
|
+
/**
|
|
21
|
+
* Smallest ceiling {@link DRIVER_HEAP_ENV} may state. A driver child builds a
|
|
22
|
+
* whole workspace, so a value this far below the default is a unit mistake
|
|
23
|
+
* rather than a deliberate squeeze.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MIN_DRIVER_HEAP_MB = 256;
|
|
26
|
+
/**
|
|
27
|
+
* A cgroup reading, so a caller — in practice a test — can decide the ceiling
|
|
28
|
+
* instead of inheriting the machine's. Omitted fields fall back to this
|
|
29
|
+
* process's own reading.
|
|
30
|
+
*/
|
|
31
|
+
export interface HeapReading {
|
|
32
|
+
readonly constrained?: number;
|
|
33
|
+
readonly total?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The `execArgv` prefix every driver child is spawned under.
|
|
37
|
+
*
|
|
38
|
+
* Inside a container this is EMPTY on purpose. {@link DRIVER_HEAP_MB} is sized
|
|
39
|
+
* for a workstation, and handing it to a process under a smaller cgroup limit
|
|
40
|
+
* is worse than handing it nothing: V8 has no reason to collect hard below a
|
|
41
|
+
* ceiling it will never reach, so the kernel OOM-kills the container first and
|
|
42
|
+
* the failure arrives as a signal against the whole cgroup rather than as a
|
|
43
|
+
* heap error the parent can attribute. Left to itself, Node sizes the heap from
|
|
44
|
+
* the limit instead.
|
|
45
|
+
*
|
|
46
|
+
* That trades away the ability to use a LARGE container's memory, since Node's
|
|
47
|
+
* derived default is a fraction of the limit — which is what {@link DRIVER_HEAP_ENV}
|
|
48
|
+
* is for. An operator who states a number has decided, so it wins in a
|
|
49
|
+
* container too.
|
|
50
|
+
*/
|
|
51
|
+
export declare function driverHeapArgs(reading?: HeapReading): string[];
|
|
52
|
+
//# sourceMappingURL=driver-heap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver-heap.d.ts","sourceRoot":"","sources":["../src/driver-heap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,qFAAqF;AACrF,eAAO,MAAM,eAAe,mCAAmC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,WAAgB,GAAG,MAAM,EAAE,CAOlE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { heapCeilingArgs } from '@hydranium/core/node';
|
|
10
|
+
/**
|
|
11
|
+
* Heap ceiling in MiB for a driver child on a machine with no cgroup limit.
|
|
12
|
+
*
|
|
13
|
+
* The subcommands that spawn one build a whole workspace in that child —
|
|
14
|
+
* `measure-memory` deliberately so, `analyze-heap` loads an entire heap
|
|
15
|
+
* snapshot — so the default Node would pick from physical RAM is too low for
|
|
16
|
+
* the workspaces these are pointed at.
|
|
17
|
+
*/
|
|
18
|
+
export const DRIVER_HEAP_MB = 8192;
|
|
19
|
+
/** Environment variable an operator raises or lowers {@link driverHeapArgs} with. */
|
|
20
|
+
export const DRIVER_HEAP_ENV = 'HYDRANIUM_CLI_MAX_OLD_SPACE_MB';
|
|
21
|
+
/**
|
|
22
|
+
* Smallest ceiling {@link DRIVER_HEAP_ENV} may state. A driver child builds a
|
|
23
|
+
* whole workspace, so a value this far below the default is a unit mistake
|
|
24
|
+
* rather than a deliberate squeeze.
|
|
25
|
+
*/
|
|
26
|
+
export const MIN_DRIVER_HEAP_MB = 256;
|
|
27
|
+
/**
|
|
28
|
+
* The `execArgv` prefix every driver child is spawned under.
|
|
29
|
+
*
|
|
30
|
+
* Inside a container this is EMPTY on purpose. {@link DRIVER_HEAP_MB} is sized
|
|
31
|
+
* for a workstation, and handing it to a process under a smaller cgroup limit
|
|
32
|
+
* is worse than handing it nothing: V8 has no reason to collect hard below a
|
|
33
|
+
* ceiling it will never reach, so the kernel OOM-kills the container first and
|
|
34
|
+
* the failure arrives as a signal against the whole cgroup rather than as a
|
|
35
|
+
* heap error the parent can attribute. Left to itself, Node sizes the heap from
|
|
36
|
+
* the limit instead.
|
|
37
|
+
*
|
|
38
|
+
* That trades away the ability to use a LARGE container's memory, since Node's
|
|
39
|
+
* derived default is a fraction of the limit — which is what {@link DRIVER_HEAP_ENV}
|
|
40
|
+
* is for. An operator who states a number has decided, so it wins in a
|
|
41
|
+
* container too.
|
|
42
|
+
*/
|
|
43
|
+
export function driverHeapArgs(reading = {}) {
|
|
44
|
+
return heapCeilingArgs({
|
|
45
|
+
desktopDefaultMb: DRIVER_HEAP_MB,
|
|
46
|
+
envValue: process.env[DRIVER_HEAP_ENV],
|
|
47
|
+
minMb: MIN_DRIVER_HEAP_MB,
|
|
48
|
+
...reading
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=driver-heap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver-heap.js","sourceRoot":"","sources":["../src/driver-heap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,qFAAqF;AACrF,MAAM,CAAC,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAYtC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,cAAc,CAAC,OAAO,GAAgB,EAAE;IACrD,OAAO,eAAe,CAAC;QACpB,gBAAgB,EAAE,cAAc;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QACtC,KAAK,EAAE,kBAAkB;QACzB,GAAG,OAAO;KACZ,CAAC,CAAC;AACN,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
+
export * from './commands/generate-ast-builder.js';
|
|
9
10
|
export * from './commands/generate-transfer-model.js';
|
|
10
11
|
export * from './commands/projects.js';
|
|
11
12
|
export * from './commands/query.js';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,uCAAuC,CAAC;AACtD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
+
export * from './commands/generate-ast-builder.js';
|
|
9
10
|
export * from './commands/generate-transfer-model.js';
|
|
10
11
|
export * from './commands/projects.js';
|
|
11
12
|
export * from './commands/query.js';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,uCAAuC,CAAC;AACtD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
|
package/lib/log-level.d.ts
CHANGED
|
@@ -7,20 +7,30 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
import { type LogThreshold } from '@hydranium/protocol';
|
|
10
|
+
/** The log flags every subcommand takes, as the env {@link logEnv} hands its child. */
|
|
11
|
+
export interface LogOptions {
|
|
12
|
+
/** Threshold for the client sink; the server's log-level setting replaces it. */
|
|
13
|
+
readonly logLevel?: LogThreshold;
|
|
14
|
+
/** File the server tees its log to; `{workspace}` expands once it is known. */
|
|
15
|
+
readonly logFile?: string;
|
|
16
|
+
/** The file's own threshold, which the log-level setting does not change. */
|
|
17
|
+
readonly logFileLevel?: LogThreshold;
|
|
18
|
+
}
|
|
10
19
|
/**
|
|
11
|
-
* Validate a raw `--log-level` argument into a
|
|
12
|
-
* an unrecognised value so the CLI's top-level
|
|
13
|
-
* and exits non-zero (mirroring how the other
|
|
14
|
-
* for the argv-supplied value; the resolved
|
|
15
|
-
* {@link
|
|
20
|
+
* Validate a raw `--log-level` / `--log-file-level` argument into a
|
|
21
|
+
* {@link LogThreshold}. Throws on an unrecognised value so the CLI's top-level
|
|
22
|
+
* `catch` surfaces a clean error and exits non-zero (mirroring how the other
|
|
23
|
+
* option parsers fail fast). Use for the argv-supplied value; the resolved
|
|
24
|
+
* threshold is handed to {@link logEnv} to target the spawned server.
|
|
16
25
|
*/
|
|
17
|
-
export declare function parseLogLevelOption(raw: string): LogThreshold;
|
|
26
|
+
export declare function parseLogLevelOption(raw: string, flag?: string): LogThreshold;
|
|
18
27
|
/**
|
|
19
28
|
* Build the environment override that targets *only the spawned server's* log
|
|
20
|
-
*
|
|
21
|
-
* `
|
|
22
|
-
*
|
|
23
|
-
*
|
|
29
|
+
* configuration, or `undefined` when no log flag was given. Passed to
|
|
30
|
+
* `spawnDataServer` as `env`, it sets the same `HYDRANIUM_LOG_LEVEL` /
|
|
31
|
+
* `HYDRANIUM_LOG_FILE` / `HYDRANIUM_LOG_FILE_LEVEL` variables the server reads
|
|
32
|
+
* at startup — the CLI's own logging is unaffected, unlike ambient variables
|
|
33
|
+
* that the child would inherit alongside the parent. The server owns *how* log level
|
|
24
34
|
* works; this only routes the CLI's request onto the channel it already reads.
|
|
25
35
|
*
|
|
26
36
|
* **The variable is read by `LspLogger`'s constructor**, which is bound on the
|
|
@@ -35,5 +45,5 @@ export declare function parseLogLevelOption(raw: string): LogThreshold;
|
|
|
35
45
|
* not go to stdout: that is the JSON-RPC channel, so a log line there would
|
|
36
46
|
* corrupt the very request this flag was set to diagnose.
|
|
37
47
|
*/
|
|
38
|
-
export declare function
|
|
48
|
+
export declare function logEnv(options: LogOptions): Record<string, string> | undefined;
|
|
39
49
|
//# sourceMappingURL=log-level.d.ts.map
|
package/lib/log-level.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-level.d.ts","sourceRoot":"","sources":["../src/log-level.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,
|
|
1
|
+
{"version":3,"file":"log-level.d.ts","sourceRoot":"","sources":["../src/log-level.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAMJ,KAAK,YAAY,EACnB,MAAM,qBAAqB,CAAC;AAE7B,uFAAuF;AACvF,MAAM,WAAW,UAAU;IACxB,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,SAAgB,GAAG,YAAY,CAMnF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAY9E"}
|
package/lib/log-level.js
CHANGED
|
@@ -6,27 +6,28 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
-
import { DEFAULT_LOG_LEVEL_ENV, LEVEL_ORDER, parseLogLevel } from '@hydranium/protocol';
|
|
9
|
+
import { DEFAULT_LOG_FILE_ENV, DEFAULT_LOG_FILE_LEVEL_ENV, DEFAULT_LOG_LEVEL_ENV, LEVEL_ORDER, parseLogLevel } from '@hydranium/protocol';
|
|
10
10
|
/**
|
|
11
|
-
* Validate a raw `--log-level` argument into a
|
|
12
|
-
* an unrecognised value so the CLI's top-level
|
|
13
|
-
* and exits non-zero (mirroring how the other
|
|
14
|
-
* for the argv-supplied value; the resolved
|
|
15
|
-
* {@link
|
|
11
|
+
* Validate a raw `--log-level` / `--log-file-level` argument into a
|
|
12
|
+
* {@link LogThreshold}. Throws on an unrecognised value so the CLI's top-level
|
|
13
|
+
* `catch` surfaces a clean error and exits non-zero (mirroring how the other
|
|
14
|
+
* option parsers fail fast). Use for the argv-supplied value; the resolved
|
|
15
|
+
* threshold is handed to {@link logEnv} to target the spawned server.
|
|
16
16
|
*/
|
|
17
|
-
export function parseLogLevelOption(raw) {
|
|
17
|
+
export function parseLogLevelOption(raw, flag = '--log-level') {
|
|
18
18
|
const level = parseLogLevel(raw);
|
|
19
19
|
if (!level) {
|
|
20
|
-
throw new Error(`Invalid
|
|
20
|
+
throw new Error(`Invalid ${flag}: ${raw} (expected one of: ${Object.keys(LEVEL_ORDER).join(', ')})`);
|
|
21
21
|
}
|
|
22
22
|
return level;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Build the environment override that targets *only the spawned server's* log
|
|
26
|
-
*
|
|
27
|
-
* `
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
* configuration, or `undefined` when no log flag was given. Passed to
|
|
27
|
+
* `spawnDataServer` as `env`, it sets the same `HYDRANIUM_LOG_LEVEL` /
|
|
28
|
+
* `HYDRANIUM_LOG_FILE` / `HYDRANIUM_LOG_FILE_LEVEL` variables the server reads
|
|
29
|
+
* at startup — the CLI's own logging is unaffected, unlike ambient variables
|
|
30
|
+
* that the child would inherit alongside the parent. The server owns *how* log level
|
|
30
31
|
* works; this only routes the CLI's request onto the channel it already reads.
|
|
31
32
|
*
|
|
32
33
|
* **The variable is read by `LspLogger`'s constructor**, which is bound on the
|
|
@@ -41,7 +42,17 @@ export function parseLogLevelOption(raw) {
|
|
|
41
42
|
* not go to stdout: that is the JSON-RPC channel, so a log line there would
|
|
42
43
|
* corrupt the very request this flag was set to diagnose.
|
|
43
44
|
*/
|
|
44
|
-
export function
|
|
45
|
-
|
|
45
|
+
export function logEnv(options) {
|
|
46
|
+
const env = {};
|
|
47
|
+
if (options.logLevel !== undefined) {
|
|
48
|
+
env[DEFAULT_LOG_LEVEL_ENV] = options.logLevel;
|
|
49
|
+
}
|
|
50
|
+
if (options.logFile !== undefined) {
|
|
51
|
+
env[DEFAULT_LOG_FILE_ENV] = options.logFile;
|
|
52
|
+
}
|
|
53
|
+
if (options.logFileLevel !== undefined) {
|
|
54
|
+
env[DEFAULT_LOG_FILE_LEVEL_ENV] = options.logFileLevel;
|
|
55
|
+
}
|
|
56
|
+
return Object.keys(env).length > 0 ? env : undefined;
|
|
46
57
|
}
|
|
47
58
|
//# sourceMappingURL=log-level.js.map
|
package/lib/log-level.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-level.js","sourceRoot":"","sources":["../src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,SAAS,CAAC;AACxD,CAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { type TransferDiagnostic, type TransferElement } from '@hydranium/protocol';
|
|
10
10
|
import { type DataClientProtocol, type DataServerProtocol } from '@hydranium/protocol/data';
|
|
11
11
|
import { type ChildProcess } from 'node:child_process';
|
|
12
|
-
import { type MessageConnection } from 'vscode-jsonrpc/node';
|
|
12
|
+
import { type Logger as ConnectionLogger, type MessageConnection } from 'vscode-jsonrpc/node';
|
|
13
13
|
/**
|
|
14
14
|
* Options for {@link spawnDataServer}. `command` is the binary or script
|
|
15
15
|
* path; `args` are the command-line arguments passed to it. The adopter's
|
|
@@ -42,6 +42,11 @@ export interface SpawnDataServerOptions {
|
|
|
42
42
|
* scripted use; set to `'pipe'` to capture for assertion in tests.
|
|
43
43
|
*/
|
|
44
44
|
readonly stderr?: 'inherit' | 'ignore' | 'pipe';
|
|
45
|
+
/**
|
|
46
|
+
* Where the connection to the child logs its protocol faults, such as a
|
|
47
|
+
* response that matches no request. Default: this process's stderr.
|
|
48
|
+
*/
|
|
49
|
+
readonly logger?: ConnectionLogger;
|
|
45
50
|
}
|
|
46
51
|
/**
|
|
47
52
|
* Lifecycle handle for a spawned data-server. Owns the child process,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-data-server.d.ts","sourceRoot":"","sources":["../src/spawn-data-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAkB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAGJ,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAC;AAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"spawn-data-server.d.ts","sourceRoot":"","sources":["../src/spawn-data-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFA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AIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,SAAS,SAAS,eAAe,EAAE,WAAW,SAAS,kBAAkB,GAAG,kBAAkB,EAC3H,OAAO,EAAE,sBAAsB,EAC/B,WAAW,CAAC,EAAE,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,GACxD,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAqH1C;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,SAAS,SAAS,eAAe,EAAE,WAAW,SAAS,kBAAkB,EAAE,CAAC,EAC9G,OAAO,EAAE,sBAAsB,EAC/B,GAAG,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EACzH,WAAW,CAAC,EAAE,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,GACxD,OAAO,CAAC,CAAC,CAAC,CAYZ"}
|
package/lib/spawn-data-server.js
CHANGED
|
@@ -10,6 +10,7 @@ import { createRpcProxy } from '@hydranium/protocol';
|
|
|
10
10
|
import { DATA_CLIENT_PROTOCOL_METHODS, DATA_SERVER_WIRE_PREFIX } from '@hydranium/protocol/data';
|
|
11
11
|
import { spawn } from 'node:child_process';
|
|
12
12
|
import { StreamMessageReader, StreamMessageWriter, createMessageConnection } from 'vscode-jsonrpc/node';
|
|
13
|
+
import { STDERR_CONNECTION_LOGGER } from './stderr-connection-logger.js';
|
|
13
14
|
/**
|
|
14
15
|
* Spawn a data-server subprocess and wire a typed proxy over its
|
|
15
16
|
* stdio JSON-RPC. The function returns once the connection is
|
|
@@ -61,7 +62,7 @@ export function spawnDataServer(options, localClient) {
|
|
|
61
62
|
});
|
|
62
63
|
const reader = new StreamMessageReader(child.stdout);
|
|
63
64
|
const writer = new StreamMessageWriter(child.stdin);
|
|
64
|
-
const connection = createMessageConnection(reader, writer);
|
|
65
|
+
const connection = createMessageConnection(reader, writer, options.logger ?? STDERR_CONNECTION_LOGGER);
|
|
65
66
|
// Consume transport error / close so a child that dies mid-stream (its stdout
|
|
66
67
|
// closing, a write landing on a torn-down stdin) is observed here rather than
|
|
67
68
|
// escaping as an unhandled error — the death is reported via `whenTerminated`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-data-server.js","sourceRoot":"","sources":["../src/spawn-data-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,cAAc,EAAiD,MAAM,qBAAqB,CAAC;AACpG,OAAO,EACJ,4BAA4B,EAC5B,uBAAuB,EAGzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"spawn-data-server.js","sourceRoot":"","sources":["../src/spawn-data-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,cAAc,EAAiD,MAAM,qBAAqB,CAAC;AACpG,OAAO,EACJ,4BAA4B,EAC5B,uBAAuB,EAGzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACJ,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EAGzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AA0EzE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAC5B,OAA+B,EAC/B,WAAwD;IAExD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,EAAE;QAC7D,G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F,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CACjC,OAA+B,EAC/B,GAAyH,EACzH,WAAwD;IAExD,MAAM,MAAM,GAAG,eAAe,CAAyB,OAAO,EAAE,WAAW,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,4EAA4E;IAC5E,iFAAiF;IACjF,wEAAwE;IACxE,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,CAAC;QACF,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;IAClE,CAAC;YAAS,CAAC;QACR,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import type { Logger as ConnectionLogger } from 'vscode-jsonrpc/node';
|
|
10
|
+
/** Every connection line goes to stderr: stdout carries the command's output or the protocol stream. */
|
|
11
|
+
export declare const STDERR_CONNECTION_LOGGER: ConnectionLogger;
|
|
12
|
+
//# sourceMappingURL=stderr-connection-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stderr-connection-logger.d.ts","sourceRoot":"","sources":["../src/stderr-connection-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,wGAAwG;AACxG,eAAO,MAAM,wBAAwB,EAAE,gBAKtC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
/** Every connection line goes to stderr: stdout carries the command's output or the protocol stream. */
|
|
10
|
+
export const STDERR_CONNECTION_LOGGER = {
|
|
11
|
+
error: message => console.error(message),
|
|
12
|
+
warn: message => console.error(message),
|
|
13
|
+
info: message => console.error(message),
|
|
14
|
+
log: message => console.error(message)
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=stderr-connection-logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stderr-connection-logger.js","sourceRoot":"","sources":["../src/stderr-connection-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,wGAAwG;AACxG,MAAM,CAAC,MAAM,wBAAwB,GAAqB;IACvD,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;IACxC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;IACvC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;CACxC,CAAC"}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
import { DataServer } from '@hydranium/data-server';
|
|
20
20
|
import { makeTestServices } from '@hydranium/core/testing';
|
|
21
21
|
import { StreamMessageReader, StreamMessageWriter, createMessageConnection } from 'vscode-jsonrpc/node';
|
|
22
|
+
import { STDERR_CONNECTION_LOGGER } from '../stderr-connection-logger.js';
|
|
22
23
|
function parseFakeRoot(text) {
|
|
23
24
|
const match = /^name:(.+)$/.exec(text);
|
|
24
25
|
return { $type: 'FakeRoot', name: match ? match[1] : 'unknown' };
|
|
@@ -60,7 +61,13 @@ function main() {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
|
-
const
|
|
64
|
+
const writer = new StreamMessageWriter(process.stdout);
|
|
65
|
+
const connection = createMessageConnection(new StreamMessageReader(process.stdin), writer, STDERR_CONNECTION_LOGGER);
|
|
66
|
+
if (process.argv.includes('--send-response-without-id')) {
|
|
67
|
+
// A response the parent cannot match to a request, for its connection to log.
|
|
68
|
+
const response = { jsonrpc: '2.0', id: null, result: null };
|
|
69
|
+
writer.write(response).catch((error) => STDERR_CONNECTION_LOGGER.error(String(error)));
|
|
70
|
+
}
|
|
64
71
|
if (process.argv.includes('--exit-on-request')) {
|
|
65
72
|
// Fail-fast fixture mode: read a full request (the reader parses the whole
|
|
66
73
|
// message, so the parent's write completed — no partial-write race) then die
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echo-server.js","sourceRoot":"","sources":["../../src/testing/echo-server.ts"],"names":[],"mappings":";AACA;;;;;;;kFAOkF;AAElF;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"echo-server.js","sourceRoot":"","sources":["../../src/testing/echo-server.ts"],"names":[],"mappings":";AACA;;;;;;;kFAOkF;AAElF;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAA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wBAAwB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC9C,2EAA2E;QAC3E,6EAA6E;QAC7E,8EAA8E;QAC9E,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,UAAU,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO;IACV,CAAC;IAED,IAAI,UAAU,CAAW,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtD,UAAU,CAAC,MAAM,EAAE,CAAC;IACpB,sEAAsE;IACtE,qEAAqE;IACrE,6CAA6C;AAChD,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/cli",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.232",
|
|
4
4
|
"description": "Build-time codegen tools + data-server subcommands for the hydranium framework.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"cli",
|
|
7
|
+
"codegen",
|
|
6
8
|
"hydranium",
|
|
7
9
|
"langium",
|
|
8
10
|
"language-server",
|
|
9
|
-
"lsp"
|
|
10
|
-
"cli",
|
|
11
|
-
"codegen"
|
|
11
|
+
"lsp"
|
|
12
12
|
],
|
|
13
13
|
"homepage": "https://github.com/eclipse-emfcloud/hydranium/tree/main/packages/cli",
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/eclipse-emfcloud/hydranium/issues"
|
|
16
16
|
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "Hydranium Team"
|
|
20
|
+
},
|
|
17
21
|
"repository": {
|
|
18
22
|
"type": "git",
|
|
19
23
|
"url": "https://github.com/eclipse-emfcloud/hydranium.git",
|
|
20
24
|
"directory": "packages/cli"
|
|
21
25
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"name": "Hydranium Team"
|
|
26
|
+
"bin": {
|
|
27
|
+
"hydranium-cli": "bin/hydranium-cli.js"
|
|
25
28
|
},
|
|
29
|
+
"files": [
|
|
30
|
+
"bin",
|
|
31
|
+
"lib",
|
|
32
|
+
"src",
|
|
33
|
+
"heap-analysis",
|
|
34
|
+
"!lib/**/*.tsbuildinfo"
|
|
35
|
+
],
|
|
36
|
+
"type": "module",
|
|
26
37
|
"sideEffects": [
|
|
27
38
|
"./lib/cli.js",
|
|
28
39
|
"./lib/commands/*-driver.js",
|
|
29
40
|
"./lib/testing/echo-server.js"
|
|
30
41
|
],
|
|
31
|
-
"
|
|
42
|
+
"main": "lib/index.js",
|
|
43
|
+
"types": "lib/index.d.ts",
|
|
32
44
|
"exports": {
|
|
33
45
|
".": {
|
|
34
46
|
"types": "./lib/index.d.ts",
|
|
@@ -39,21 +51,13 @@
|
|
|
39
51
|
"default": "./lib/cli.js"
|
|
40
52
|
}
|
|
41
53
|
},
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
"bin": {
|
|
45
|
-
"hydranium-cli": "lib/cli.js"
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
46
56
|
},
|
|
47
|
-
"files": [
|
|
48
|
-
"lib",
|
|
49
|
-
"src",
|
|
50
|
-
"heap-analysis",
|
|
51
|
-
"!lib/**/*.tsbuildinfo"
|
|
52
|
-
],
|
|
53
57
|
"scripts": {
|
|
54
|
-
"build": "tsc -b
|
|
58
|
+
"build": "tsc -b",
|
|
55
59
|
"clean": "rimraf lib tsconfig.tsbuildinfo",
|
|
56
|
-
"lint": "
|
|
60
|
+
"lint": "oxlint --format stylish --config ../../oxlint.config.cjs src test --max-warnings 0",
|
|
57
61
|
"prepack": "node -e \"const m=require('./package.json'),fs=require('node:fs');const missing=[m.main,...Object.values(m.bin||{})].filter(entry=>entry&&!fs.existsSync(entry));if(missing.length){console.error('prepack '+m.name+': not built ('+missing.join(', ')+' missing). Run the build before packing: a files entry that matches nothing is skipped silently, so the tarball would ship src only.');process.exit(1);}\"",
|
|
58
62
|
"test": "npm run typecheck:test && vitest run",
|
|
59
63
|
"typecheck:test": "tsc --noEmit -p tsconfig.test.json",
|
|
@@ -65,23 +69,23 @@
|
|
|
65
69
|
"ts-morph": "^25.0.0"
|
|
66
70
|
},
|
|
67
71
|
"devDependencies": {
|
|
68
|
-
"@hydranium/core": "1.0.0-next.
|
|
69
|
-
"@hydranium/data-server": "1.0.0-next.
|
|
70
|
-
"@hydranium/langium": "1.0.0-next.
|
|
71
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
72
|
+
"@hydranium/core": "1.0.0-next.232",
|
|
73
|
+
"@hydranium/data-server": "1.0.0-next.232",
|
|
74
|
+
"@hydranium/langium": "1.0.0-next.232",
|
|
75
|
+
"@hydranium/protocol": "1.0.0-next.232",
|
|
72
76
|
"rimraf": "^5.0.0",
|
|
73
|
-
"typescript": "^
|
|
74
|
-
"vscode-jsonrpc": "9.0.
|
|
75
|
-
"vscode-languageserver": "
|
|
77
|
+
"typescript": "^7.0.2",
|
|
78
|
+
"vscode-jsonrpc": "9.0.0",
|
|
79
|
+
"vscode-languageserver": "10.0.1"
|
|
76
80
|
},
|
|
77
81
|
"peerDependencies": {
|
|
78
|
-
"@hydranium/core": "1.0.0-next.
|
|
79
|
-
"@hydranium/data-server": "1.0.0-next.
|
|
80
|
-
"@hydranium/langium": "1.0.0-next.
|
|
81
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
82
|
+
"@hydranium/core": "1.0.0-next.232",
|
|
83
|
+
"@hydranium/data-server": "1.0.0-next.232",
|
|
84
|
+
"@hydranium/langium": "1.0.0-next.232",
|
|
85
|
+
"@hydranium/protocol": "1.0.0-next.232",
|
|
82
86
|
"@memlab/core": "^2.0.3",
|
|
83
87
|
"@memlab/heap-analysis": "^2.0.3",
|
|
84
|
-
"vscode-jsonrpc": "9.0.
|
|
88
|
+
"vscode-jsonrpc": "^9.0.0"
|
|
85
89
|
},
|
|
86
90
|
"peerDependenciesMeta": {
|
|
87
91
|
"@memlab/core": {
|
|
@@ -94,13 +98,9 @@
|
|
|
94
98
|
"engines": {
|
|
95
99
|
"node": ">=22.13"
|
|
96
100
|
},
|
|
97
|
-
"
|
|
98
|
-
"access": "public"
|
|
99
|
-
},
|
|
100
|
-
"//build": "The chmod is load-bearing, not cruft. npm sets a bin's executable bit through bin-links' fixBin, but ONLY when it first creates the link — and `tsc` never sets it, so after `npm run clean` (which deletes lib/) a rebuild leaves lib/cli.js at 0644 and the node_modules/.bin/hydranium-cli symlink resolves to a non-executable target. Every example's `generate` step then dies with `sh: hydranium-cli: Permission denied`, surfacing as an opaque npm error code 127 during `turbo run build`. npm rebuild, npm rebuild @hydranium/cli AND a full npm install all fail to restore it, because npm will not revisit an existing workspace symlink; only a from-scratch `rm -rf node_modules` install does. Written as `node -e` rather than `chmod +x` so it stays portable — on Windows npm generates .cmd/.ps1 shims where the bit is irrelevant and chmodSync is harmless. The example packages' bins need no such step: their tests spawn them via process.execPath, never through the shim.",
|
|
101
|
-
"//exports": "Two keys, and the SHORT list is the point: `files` ships the whole compiled tree, so without a map every `lib/commands/*.js`, every internal helper and `lib/testing/echo-server.js` is deep-importable the moment this publishes, and semver then applies to all of it. `.` is the library barrel (the data-server subcommands an adopter calls as functions). `./lib/cli.js` is the BINARY ARTEFACT, and it is declared because a consumer that spawns the CLI resolves it BY SPECIFIER — `createRequire(import.meta.url).resolve('@hydranium/cli/lib/cli.js')` — to get the path npx would run; `bin` gives a shim on PATH, not a path, so dropping this key breaks that resolution and the failure surfaces as \"hydranium-cli is not built\", naming the wrong cause. It is declared in the `/lib/` spelling ONLY: that spelling already resolves under both of this repo's module resolvers, so the twin rule (which exists so a BARE subpath is reachable from node10) has nothing to add here and a bare twin would only be a second name for one artefact. `heap-analysis/` needs no key even though `files` ships it — `analyze-heap` reaches the analyzer through a `new URL(..., import.meta.url)` file URL, which `exports` does not gate, and the package's own tests reach it relatively. `./testing` is deliberately absent: `echo-server` is a spawnable stdio fixture, not a reusable export.",
|
|
101
|
+
"//exports": "Two keys, and the SHORT list is the point: `files` ships the whole compiled tree, so without a map every `lib/commands/*.js`, every internal helper and `lib/testing/echo-server.js` is deep-importable the moment this publishes, and semver then applies to all of it. `.` is the library barrel (the data-server subcommands an adopter calls as functions). `./lib/cli.js` is the BINARY ARTEFACT, and it is declared because a consumer that spawns the CLI resolves it BY SPECIFIER — `createRequire(import.meta.url).resolve('@hydranium/cli/lib/cli.js')` — to get the path npx would run; `bin` gives a shim on PATH, not a path, so dropping this key breaks that resolution and the failure surfaces as \"hydranium-cli is not built\", naming the wrong cause. `heap-analysis/` needs no key even though `files` ships it — `analyze-heap` reaches the analyzer through a `new URL(..., import.meta.url)` file URL, which `exports` does not gate, and the package's own tests reach it relatively. `./testing` is deliberately absent: `echo-server` is a spawnable stdio fixture, not a reusable export.",
|
|
102
102
|
"//memlab": "@memlab/core and @memlab/heap-analysis are OPTIONAL PEER dependencies, not optionalDependencies, and the distinction is the whole point: npm installs optionalDependencies BY DEFAULT, both memlab packages pin puppeteer exactly, and puppeteer's postinstall downloads a Chrome binary — so every adopter of this CLI paid ~86 MB and a browser download for the one subcommand almost none of them run, and the download can fail and be walked past as a warning. An optional peer is not auto-installed, so `analyze-heap` documents `npm install @memlab/core @memlab/heap-analysis` as the opt-in and every other subcommand is unaffected. Taken pre-publish deliberately: after publish the install shape is what adopters already have.",
|
|
103
|
-
"//peerDependencies": "`vscode-jsonrpc`
|
|
104
|
-
"//prepack": "The publish guard,
|
|
103
|
+
"//peerDependencies": "`vscode-jsonrpc` takes a caret, so the framework shares the transport the LSP connection resolves, which an `init` scaffold pins: each `vscode-languageserver-protocol` release pins its transport exactly, so an exact peer would name a copy a fresh install rarely holds. The caret excludes 8.x, so a tree whose top holds GLSP's copy fails the peer with a named ERESOLVE warning, an error under `--strict-peer-deps`, rather than resolving silently. No peer reaches a NESTED copy, such as GLSP's or one the LSP packages nest. The wire compares message types and `ResponseError`s by copy identity, so the framework sends typed messages by method name and recognises errors with `isResponseError` rather than `instanceof`.",
|
|
104
|
+
"//prepack": "The publish guard, a `prepack` rather than a `prepare`: `prepack` runs only when a tarball is made (`npm pack`, `npm publish`) and never on install, so it cannot break the install it has no business touching. What it defends against: `files` lists `lib`, `lib` is gitignored, and a `files` entry matching nothing is skipped SILENTLY — so `npm publish` from an unbuilt tree emits a tarball of `src` and nothing else, with no error.",
|
|
105
105
|
"//sideEffects": "The listed modules RUN on load rather than exporting anything: `cli.js` is the `bin`, each `*-driver.js` is spawned as its own process and calls `main(process.argv)` at top level, and `echo-server.js` starts a server. Their whole purpose is the effect, so a bundler must never treat them as prunable. Everything else here is library code with no module-level state beyond `new URL(..., import.meta.url)` constants."
|
|
106
106
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
10
|
import { fileURLToPath } from 'node:url';
|
|
11
|
+
import { driverHeapArgs, type HeapReading } from '../driver-heap.js';
|
|
11
12
|
import { spawnNodeChild } from './headless-harness.js';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -41,6 +42,8 @@ export interface AnalyzeHeapDeps {
|
|
|
41
42
|
readonly __spawnForTest?: (execArgs: string[]) => Promise<number>;
|
|
42
43
|
/** Override the memlab-availability check. */
|
|
43
44
|
readonly __memlabInstalledForTest?: () => boolean;
|
|
45
|
+
/** Decide the heap ceiling from a stated cgroup reading rather than the machine's. */
|
|
46
|
+
readonly __heapReadingForTest?: HeapReading;
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
/**
|
|
@@ -69,7 +72,7 @@ export async function runAnalyzeHeap(args: string[], deps: AnalyzeHeapDeps = {})
|
|
|
69
72
|
return;
|
|
70
73
|
}
|
|
71
74
|
const spawnChild = deps.__spawnForTest ?? spawnNodeChild;
|
|
72
|
-
const code = await spawnChild([
|
|
75
|
+
const code = await spawnChild([...driverHeapArgs(deps.__heapReadingForTest), ANALYZER, ...args]);
|
|
73
76
|
if (code) {
|
|
74
77
|
process.exitCode = code;
|
|
75
78
|
}
|