@hydranium/cli 1.0.0-next.10
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/LICENSE +21 -0
- package/README.md +240 -0
- package/heap-analysis/analyze-heap.mjs +798 -0
- package/heap-analysis/heap/core/aggregate.mjs +152 -0
- package/heap-analysis/heap/core/bucket-label.mjs +23 -0
- package/heap-analysis/heap/core/cutpoints.mjs +51 -0
- package/heap-analysis/heap/core/diff.mjs +56 -0
- package/heap-analysis/heap/core/format.mjs +47 -0
- package/heap-analysis/heap/core/holders.mjs +80 -0
- package/heap-analysis/heap/core/load.mjs +46 -0
- package/heap-analysis/heap/core/report.mjs +68 -0
- package/heap-analysis/heap/core/strings.mjs +80 -0
- package/heap-analysis/heap/langium/concepts.mjs +230 -0
- package/heap-analysis/heap/langium/glsp.classifier.mjs +80 -0
- package/heap-analysis/heap/langium/langium.classifier.mjs +203 -0
- package/heap-analysis/heap/renderer/renderer.mjs +122 -0
- package/lib/cli-version.d.ts +21 -0
- package/lib/cli-version.d.ts.map +1 -0
- package/lib/cli-version.js +30 -0
- package/lib/cli-version.js.map +1 -0
- package/lib/cli.d.ts +11 -0
- package/lib/cli.d.ts.map +1 -0
- package/lib/cli.js +135 -0
- package/lib/cli.js.map +1 -0
- package/lib/commands/analyze-heap-args.d.ts +46 -0
- package/lib/commands/analyze-heap-args.d.ts.map +1 -0
- package/lib/commands/analyze-heap-args.js +174 -0
- package/lib/commands/analyze-heap-args.js.map +1 -0
- package/lib/commands/analyze-heap.d.ts +37 -0
- package/lib/commands/analyze-heap.d.ts.map +1 -0
- package/lib/commands/analyze-heap.js +63 -0
- package/lib/commands/analyze-heap.js.map +1 -0
- package/lib/commands/ast-ground-truth-args.d.ts +23 -0
- package/lib/commands/ast-ground-truth-args.d.ts.map +1 -0
- package/lib/commands/ast-ground-truth-args.js +47 -0
- package/lib/commands/ast-ground-truth-args.js.map +1 -0
- package/lib/commands/ast-ground-truth-driver.d.ts +10 -0
- package/lib/commands/ast-ground-truth-driver.d.ts.map +1 -0
- package/lib/commands/ast-ground-truth-driver.js +72 -0
- package/lib/commands/ast-ground-truth-driver.js.map +1 -0
- package/lib/commands/ast-ground-truth.d.ts +31 -0
- package/lib/commands/ast-ground-truth.d.ts.map +1 -0
- package/lib/commands/ast-ground-truth.js +36 -0
- package/lib/commands/ast-ground-truth.js.map +1 -0
- package/lib/commands/generate-transfer-model-args.d.ts +38 -0
- package/lib/commands/generate-transfer-model-args.d.ts.map +1 -0
- package/lib/commands/generate-transfer-model-args.js +183 -0
- package/lib/commands/generate-transfer-model-args.js.map +1 -0
- package/lib/commands/generate-transfer-model-config.d.ts +32 -0
- package/lib/commands/generate-transfer-model-config.d.ts.map +1 -0
- package/lib/commands/generate-transfer-model-config.js +122 -0
- package/lib/commands/generate-transfer-model-config.js.map +1 -0
- package/lib/commands/generate-transfer-model.d.ts +110 -0
- package/lib/commands/generate-transfer-model.d.ts.map +1 -0
- package/lib/commands/generate-transfer-model.js +587 -0
- package/lib/commands/generate-transfer-model.js.map +1 -0
- package/lib/commands/harness-args.d.ts +198 -0
- package/lib/commands/harness-args.d.ts.map +1 -0
- package/lib/commands/harness-args.js +339 -0
- package/lib/commands/harness-args.js.map +1 -0
- package/lib/commands/headless-harness.d.ts +97 -0
- package/lib/commands/headless-harness.d.ts.map +1 -0
- package/lib/commands/headless-harness.js +121 -0
- package/lib/commands/headless-harness.js.map +1 -0
- package/lib/commands/init-args.d.ts +81 -0
- package/lib/commands/init-args.d.ts.map +1 -0
- package/lib/commands/init-args.js +250 -0
- package/lib/commands/init-args.js.map +1 -0
- package/lib/commands/init-prompt.d.ts +66 -0
- package/lib/commands/init-prompt.d.ts.map +1 -0
- package/lib/commands/init-prompt.js +71 -0
- package/lib/commands/init-prompt.js.map +1 -0
- package/lib/commands/init-templates.d.ts +42 -0
- package/lib/commands/init-templates.d.ts.map +1 -0
- package/lib/commands/init-templates.js +1902 -0
- package/lib/commands/init-templates.js.map +1 -0
- package/lib/commands/init-wizard.d.ts +65 -0
- package/lib/commands/init-wizard.d.ts.map +1 -0
- package/lib/commands/init-wizard.js +302 -0
- package/lib/commands/init-wizard.js.map +1 -0
- package/lib/commands/init-workspace.d.ts +168 -0
- package/lib/commands/init-workspace.d.ts.map +1 -0
- package/lib/commands/init-workspace.js +372 -0
- package/lib/commands/init-workspace.js.map +1 -0
- package/lib/commands/init.d.ts +273 -0
- package/lib/commands/init.d.ts.map +1 -0
- package/lib/commands/init.js +303 -0
- package/lib/commands/init.js.map +1 -0
- package/lib/commands/lint-grammar-args.d.ts +23 -0
- package/lib/commands/lint-grammar-args.d.ts.map +1 -0
- package/lib/commands/lint-grammar-args.js +63 -0
- package/lib/commands/lint-grammar-args.js.map +1 -0
- package/lib/commands/lint-grammar-driver.d.ts +10 -0
- package/lib/commands/lint-grammar-driver.d.ts.map +1 -0
- package/lib/commands/lint-grammar-driver.js +72 -0
- package/lib/commands/lint-grammar-driver.js.map +1 -0
- package/lib/commands/lint-grammar-report.d.ts +24 -0
- package/lib/commands/lint-grammar-report.d.ts.map +1 -0
- package/lib/commands/lint-grammar-report.js +65 -0
- package/lib/commands/lint-grammar-report.js.map +1 -0
- package/lib/commands/lint-grammar.d.ts +33 -0
- package/lib/commands/lint-grammar.d.ts.map +1 -0
- package/lib/commands/lint-grammar.js +42 -0
- package/lib/commands/lint-grammar.js.map +1 -0
- package/lib/commands/measure-memory-args.d.ts +23 -0
- package/lib/commands/measure-memory-args.d.ts.map +1 -0
- package/lib/commands/measure-memory-args.js +106 -0
- package/lib/commands/measure-memory-args.js.map +1 -0
- package/lib/commands/measure-memory-driver.d.ts +10 -0
- package/lib/commands/measure-memory-driver.d.ts.map +1 -0
- package/lib/commands/measure-memory-driver.js +110 -0
- package/lib/commands/measure-memory-driver.js.map +1 -0
- package/lib/commands/measure-memory.d.ts +68 -0
- package/lib/commands/measure-memory.d.ts.map +1 -0
- package/lib/commands/measure-memory.js +100 -0
- package/lib/commands/measure-memory.js.map +1 -0
- package/lib/commands/model-docs-args.d.ts +23 -0
- package/lib/commands/model-docs-args.d.ts.map +1 -0
- package/lib/commands/model-docs-args.js +53 -0
- package/lib/commands/model-docs-args.js.map +1 -0
- package/lib/commands/model-docs-driver.d.ts +10 -0
- package/lib/commands/model-docs-driver.d.ts.map +1 -0
- package/lib/commands/model-docs-driver.js +61 -0
- package/lib/commands/model-docs-driver.js.map +1 -0
- package/lib/commands/model-docs-report.d.ts +18 -0
- package/lib/commands/model-docs-report.d.ts.map +1 -0
- package/lib/commands/model-docs-report.js +123 -0
- package/lib/commands/model-docs-report.js.map +1 -0
- package/lib/commands/model-docs.d.ts +30 -0
- package/lib/commands/model-docs.d.ts.map +1 -0
- package/lib/commands/model-docs.js +37 -0
- package/lib/commands/model-docs.js.map +1 -0
- package/lib/commands/projects-args.d.ts +25 -0
- package/lib/commands/projects-args.d.ts.map +1 -0
- package/lib/commands/projects-args.js +49 -0
- package/lib/commands/projects-args.js.map +1 -0
- package/lib/commands/projects.d.ts +45 -0
- package/lib/commands/projects.d.ts.map +1 -0
- package/lib/commands/projects.js +39 -0
- package/lib/commands/projects.js.map +1 -0
- package/lib/commands/query-args.d.ts +25 -0
- package/lib/commands/query-args.d.ts.map +1 -0
- package/lib/commands/query-args.js +46 -0
- package/lib/commands/query-args.js.map +1 -0
- package/lib/commands/query.d.ts +32 -0
- package/lib/commands/query.d.ts.map +1 -0
- package/lib/commands/query.js +29 -0
- package/lib/commands/query.js.map +1 -0
- package/lib/commands/reflect-args.d.ts +23 -0
- package/lib/commands/reflect-args.d.ts.map +1 -0
- package/lib/commands/reflect-args.js +59 -0
- package/lib/commands/reflect-args.js.map +1 -0
- package/lib/commands/reflect-driver.d.ts +10 -0
- package/lib/commands/reflect-driver.d.ts.map +1 -0
- package/lib/commands/reflect-driver.js +66 -0
- package/lib/commands/reflect-driver.js.map +1 -0
- package/lib/commands/reflect-report.d.ts +20 -0
- package/lib/commands/reflect-report.d.ts.map +1 -0
- package/lib/commands/reflect-report.js +127 -0
- package/lib/commands/reflect-report.js.map +1 -0
- package/lib/commands/reflect.d.ts +30 -0
- package/lib/commands/reflect.d.ts.map +1 -0
- package/lib/commands/reflect.js +38 -0
- package/lib/commands/reflect.js.map +1 -0
- package/lib/commands/save-args.d.ts +26 -0
- package/lib/commands/save-args.d.ts.map +1 -0
- package/lib/commands/save-args.js +59 -0
- package/lib/commands/save-args.js.map +1 -0
- package/lib/commands/save.d.ts +38 -0
- package/lib/commands/save.d.ts.map +1 -0
- package/lib/commands/save.js +48 -0
- package/lib/commands/save.js.map +1 -0
- package/lib/commands/validate-args.d.ts +23 -0
- package/lib/commands/validate-args.d.ts.map +1 -0
- package/lib/commands/validate-args.js +60 -0
- package/lib/commands/validate-args.js.map +1 -0
- package/lib/commands/validate-driver.d.ts +10 -0
- package/lib/commands/validate-driver.d.ts.map +1 -0
- package/lib/commands/validate-driver.js +72 -0
- package/lib/commands/validate-driver.js.map +1 -0
- package/lib/commands/validate-report.d.ts +30 -0
- package/lib/commands/validate-report.d.ts.map +1 -0
- package/lib/commands/validate-report.js +87 -0
- package/lib/commands/validate-report.js.map +1 -0
- package/lib/commands/validate.d.ts +34 -0
- package/lib/commands/validate.d.ts.map +1 -0
- package/lib/commands/validate.js +41 -0
- package/lib/commands/validate.js.map +1 -0
- package/lib/commands/watch-args.d.ts +26 -0
- package/lib/commands/watch-args.d.ts.map +1 -0
- package/lib/commands/watch-args.js +59 -0
- package/lib/commands/watch-args.js.map +1 -0
- package/lib/commands/watch.d.ts +75 -0
- package/lib/commands/watch.d.ts.map +1 -0
- package/lib/commands/watch.js +112 -0
- package/lib/commands/watch.js.map +1 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +16 -0
- package/lib/index.js.map +1 -0
- package/lib/log-level.d.ts +39 -0
- package/lib/log-level.d.ts.map +1 -0
- package/lib/log-level.js +47 -0
- package/lib/log-level.js.map +1 -0
- package/lib/package-name.d.ts +33 -0
- package/lib/package-name.d.ts.map +1 -0
- package/lib/package-name.js +37 -0
- package/lib/package-name.js.map +1 -0
- package/lib/spawn-data-server.d.ts +102 -0
- package/lib/spawn-data-server.d.ts.map +1 -0
- package/lib/spawn-data-server.js +154 -0
- package/lib/spawn-data-server.js.map +1 -0
- package/lib/testing/echo-server.d.ts +11 -0
- package/lib/testing/echo-server.d.ts.map +1 -0
- package/lib/testing/echo-server.js +79 -0
- package/lib/testing/echo-server.js.map +1 -0
- package/package.json +105 -0
- package/src/cli-version.ts +32 -0
- package/src/cli.ts +139 -0
- package/src/commands/analyze-heap-args.ts +184 -0
- package/src/commands/analyze-heap.ts +76 -0
- package/src/commands/ast-ground-truth-args.ts +63 -0
- package/src/commands/ast-ground-truth-driver.ts +81 -0
- package/src/commands/ast-ground-truth.ts +49 -0
- package/src/commands/generate-transfer-model-args.ts +203 -0
- package/src/commands/generate-transfer-model-config.ts +128 -0
- package/src/commands/generate-transfer-model.ts +716 -0
- package/src/commands/harness-args.ts +429 -0
- package/src/commands/headless-harness.ts +165 -0
- package/src/commands/init-args.ts +273 -0
- package/src/commands/init-prompt.ts +149 -0
- package/src/commands/init-templates.ts +2037 -0
- package/src/commands/init-wizard.ts +378 -0
- package/src/commands/init-workspace.ts +442 -0
- package/src/commands/init.ts +554 -0
- package/src/commands/lint-grammar-args.ts +79 -0
- package/src/commands/lint-grammar-driver.ts +83 -0
- package/src/commands/lint-grammar-report.ts +74 -0
- package/src/commands/lint-grammar.ts +57 -0
- package/src/commands/measure-memory-args.ts +123 -0
- package/src/commands/measure-memory-driver.ts +128 -0
- package/src/commands/measure-memory.ts +143 -0
- package/src/commands/model-docs-args.ts +69 -0
- package/src/commands/model-docs-driver.ts +68 -0
- package/src/commands/model-docs-report.ts +133 -0
- package/src/commands/model-docs.ts +48 -0
- package/src/commands/projects-args.ts +62 -0
- package/src/commands/projects.ts +76 -0
- package/src/commands/query-args.ts +61 -0
- package/src/commands/query.ts +58 -0
- package/src/commands/reflect-args.ts +75 -0
- package/src/commands/reflect-driver.ts +76 -0
- package/src/commands/reflect-report.ts +138 -0
- package/src/commands/reflect.ts +51 -0
- package/src/commands/save-args.ts +74 -0
- package/src/commands/save.ts +84 -0
- package/src/commands/validate-args.ts +76 -0
- package/src/commands/validate-driver.ts +84 -0
- package/src/commands/validate-report.ts +95 -0
- package/src/commands/validate.ts +58 -0
- package/src/commands/watch-args.ts +74 -0
- package/src/commands/watch.ts +185 -0
- package/src/index.ts +16 -0
- package/src/log-level.ts +49 -0
- package/src/package-name.ts +39 -0
- package/src/spawn-data-server.ts +247 -0
- package/src/testing/echo-server.ts +93 -0
|
@@ -0,0 +1,23 @@
|
|
|
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 { type UsageError } from './harness-args.js';
|
|
10
|
+
import { type ValidateCommandOptions } from './validate.js';
|
|
11
|
+
/**
|
|
12
|
+
* Every flag `validate` accepts, derived from the sets the parser is handed so
|
|
13
|
+
* the list cannot claim a flag the parser would reject. `--services` is consumed
|
|
14
|
+
* by the shared harness parser itself, so it is in neither set.
|
|
15
|
+
*/
|
|
16
|
+
export declare const VALIDATE_FLAGS: readonly string[];
|
|
17
|
+
/** The subset that takes a value, so `--help` in a value position reads as data. */
|
|
18
|
+
export declare const VALIDATE_VALUE_FLAGS: readonly string[];
|
|
19
|
+
/** The `--help` text, as data, held to {@link VALIDATE_FLAGS} by a test. */
|
|
20
|
+
export declare const VALIDATE_HELP: readonly string[];
|
|
21
|
+
export declare function parseValidateArgs(args: string[], onError?: UsageError): ValidateCommandOptions;
|
|
22
|
+
export declare function runValidateCommand(args: string[]): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=validate-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-args.d.ts","sourceRoot":"","sources":["../../src/commands/validate-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EASJ,KAAK,UAAU,EACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAe,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAKzE;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAAmD,CAAC;AAEhG,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAAoC,CAAC;AAEvF,4EAA4E;AAC5E,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAkB1C,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAA0B,GAAG,sBAAsB,CAU7G;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { exitWithUsage, helpRequested, LOG_LEVEL_FLAG, logLevelHelpLine, logLevelOption, parseHarnessArgs, printHelp, SERVICES_FLAG } from './harness-args.js';
|
|
10
|
+
import { OUT_FILE_FLAG } from './headless-harness.js';
|
|
11
|
+
import { runValidate } from './validate.js';
|
|
12
|
+
const VALUE_FLAGS = [OUT_FILE_FLAG, LOG_LEVEL_FLAG];
|
|
13
|
+
const BOOL_FLAGS = ['--strict', '--json'];
|
|
14
|
+
/**
|
|
15
|
+
* Every flag `validate` accepts, derived from the sets the parser is handed so
|
|
16
|
+
* the list cannot claim a flag the parser would reject. `--services` is consumed
|
|
17
|
+
* by the shared harness parser itself, so it is in neither set.
|
|
18
|
+
*/
|
|
19
|
+
export const VALIDATE_FLAGS = [SERVICES_FLAG, ...VALUE_FLAGS, ...BOOL_FLAGS];
|
|
20
|
+
/** The subset that takes a value, so `--help` in a value position reads as data. */
|
|
21
|
+
export const VALIDATE_VALUE_FLAGS = [SERVICES_FLAG, ...VALUE_FLAGS];
|
|
22
|
+
/** The `--help` text, as data, held to {@link VALIDATE_FLAGS} by a test. */
|
|
23
|
+
export const VALIDATE_HELP = [
|
|
24
|
+
'Usage: hydranium-cli validate --services <module> <workspace> [--strict] [--json] [--out-file <file>] [--log-level <lvl>]',
|
|
25
|
+
'',
|
|
26
|
+
'Build a workspace headlessly and report its validation diagnostics — a CI gate:',
|
|
27
|
+
'the process exits non-zero when any error is found. `<module>` is an ESM module',
|
|
28
|
+
'exporting a zero-arg `createServices(): { shared }` thunk (the head wires its own',
|
|
29
|
+
'filesystem inside). Needs @hydranium/core.',
|
|
30
|
+
'',
|
|
31
|
+
'Options:',
|
|
32
|
+
' --services <module> ESM module exporting `createServices(): { shared }` (required).',
|
|
33
|
+
' <workspace> Workspace root (path or file URI) to validate (required).',
|
|
34
|
+
' --strict Also fail (non-zero exit) on warnings, not only errors.',
|
|
35
|
+
' --json Emit the raw JSON result instead of the human report.',
|
|
36
|
+
' --out-file <file> Write the report to this file instead of stdout. The gate',
|
|
37
|
+
' still decides the exit code, and the file is written only',
|
|
38
|
+
' once the report exists, unlike a shell redirection, which',
|
|
39
|
+
' truncates the file before the workspace is even built.',
|
|
40
|
+
logLevelHelpLine(22)
|
|
41
|
+
];
|
|
42
|
+
export function parseValidateArgs(args, onError = exitWithUsage) {
|
|
43
|
+
const { servicesModule, workspace, options } = parseHarnessArgs(args, 'validate', VALUE_FLAGS, BOOL_FLAGS, { onError });
|
|
44
|
+
return {
|
|
45
|
+
servicesModule,
|
|
46
|
+
workspace,
|
|
47
|
+
strict: options['--strict'] === 'true',
|
|
48
|
+
json: options['--json'] === 'true',
|
|
49
|
+
outFile: options[OUT_FILE_FLAG],
|
|
50
|
+
logLevel: logLevelOption(options[LOG_LEVEL_FLAG])
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function runValidateCommand(args) {
|
|
54
|
+
if (helpRequested(args, VALIDATE_VALUE_FLAGS)) {
|
|
55
|
+
printHelp(VALIDATE_HELP);
|
|
56
|
+
return Promise.resolve();
|
|
57
|
+
}
|
|
58
|
+
return runValidate(parseValidateArgs(args));
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=validate-args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-args.js","sourceRoot":"","sources":["../../src/commands/validate-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,aAAa,EAEf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAA+B,MAAM,eAAe,CAAC;AAEzE,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,cAAc,CAAU,CAAC;AAC7D,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAU,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,aAAa,EAAE,GAAG,WAAW,EAAE,GAAG,UAAU,CAAC,CAAC;AAEhG,oFAAoF;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAsB,CAAC,aAAa,EAAE,GAAG,WAAW,CAAC,CAAC;AAEvF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC7C,2HAA2H;IAC3H,EAAE;IACF,iFAAiF;IACjF,iFAAiF;IACjF,mFAAmF;IACnF,4CAA4C;IAC5C,EAAE;IACF,UAAU;IACV,yFAAyF;IACzF,mFAAmF;IACnF,iFAAiF;IACjF,+EAA+E;IAC/E,mFAAmF;IACnF,mFAAmF;IACnF,mFAAmF;IACnF,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,IAAc,EAAE,UAAsB,aAAa;IAClF,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACxH,OAAO;QACJ,cAAc;QACd,SAAS;QACT,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,MAAM;QACtC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,MAAM;QAClC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC;QAC/B,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;KACnD,CAAC;AACL,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAc;IAC9C,IAAI,aAAa,CAAC,IAAI,EAAE,oBAAoB,CAAC,EAAE,CAAC;QAC7C,SAAS,CAAC,aAAa,CAAC,CAAC;QACzB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,WAAW,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=validate-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-driver.d.ts","sourceRoot":"","sources":["../../src/commands/validate-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF"}
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
* Spawned child of the `validate` subcommand. Launched by the parent with
|
|
11
|
+
* `node <this> --services <module> <workspace> [--json] [--strict]
|
|
12
|
+
* [--out-file <file>]`. It dynamic-imports the head's services module, runs the
|
|
13
|
+
* framework's `validateWorkspace`, delivers the report (human or `--json`) to
|
|
14
|
+
* stdout or the named file, and exits with the gate code (non-zero on errors;
|
|
15
|
+
* `--strict` also fails on warnings). Never imported — only spawned.
|
|
16
|
+
*/
|
|
17
|
+
import { emitReport, loadHeadlessContext, OUT_FILE_FLAG } from './headless-harness.js';
|
|
18
|
+
import { formatValidationReport, validationExitCode } from './validate-report.js';
|
|
19
|
+
function parseArgs(argv) {
|
|
20
|
+
const parsed = { json: false, strict: false };
|
|
21
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
22
|
+
const flag = argv[index];
|
|
23
|
+
const next = () => {
|
|
24
|
+
const value = argv[index + 1];
|
|
25
|
+
if (value === undefined) {
|
|
26
|
+
console.error(`Missing value for ${flag}`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
index += 1;
|
|
30
|
+
return value;
|
|
31
|
+
};
|
|
32
|
+
switch (flag) {
|
|
33
|
+
case '--services':
|
|
34
|
+
parsed.servicesModule = next();
|
|
35
|
+
break;
|
|
36
|
+
case '--json':
|
|
37
|
+
parsed.json = true;
|
|
38
|
+
break;
|
|
39
|
+
case '--strict':
|
|
40
|
+
parsed.strict = true;
|
|
41
|
+
break;
|
|
42
|
+
case OUT_FILE_FLAG:
|
|
43
|
+
parsed.outFile = next();
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
if (flag.startsWith('--')) {
|
|
47
|
+
console.error(`Unknown option: ${flag}`);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
parsed.workspace = flag;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
async function main(argv) {
|
|
56
|
+
const args = parseArgs(argv);
|
|
57
|
+
if (!args.servicesModule || !args.workspace) {
|
|
58
|
+
console.error('validate-driver: --services <module> and a <workspace> are required.');
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
const { createServices, coreNode } = await loadHeadlessContext(args.servicesModule);
|
|
62
|
+
const result = await coreNode.validateWorkspace({ createServices, workspace: args.workspace });
|
|
63
|
+
emitReport(formatValidationReport(result, { json: args.json }), args.outFile);
|
|
64
|
+
return validationExitCode(result, args.strict);
|
|
65
|
+
}
|
|
66
|
+
main(process.argv.slice(2))
|
|
67
|
+
.then(code => process.exit(code))
|
|
68
|
+
.catch((error) => {
|
|
69
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=validate-driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-driver.js","sourceRoot":"","sources":["../../src/commands/validate-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAUlF,SAAS,S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AAC;AAED,KAAK,UAAU,IAAI,CAAC,IAAc;IAC/B,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QAC3C,OAAO,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAC;QACtF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACpF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,iBAAiB,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC/F,UAAU,CAAC,sBAAsB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9E,OAAO,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACvB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAChC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IACvB,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 type { WorkspaceValidationResult } from '@hydranium/core/node';
|
|
10
|
+
/**
|
|
11
|
+
* The exit code for a validation run: non-zero blocks the CI gate.
|
|
12
|
+
* Errors always fail; `strict` additionally fails on warnings. Info/hint
|
|
13
|
+
* findings are advisory and never affect the exit code.
|
|
14
|
+
*/
|
|
15
|
+
export declare function validationExitCode(result: WorkspaceValidationResult, strict?: boolean): number;
|
|
16
|
+
/**
|
|
17
|
+
* Render a validation result for the terminal. `json` emits the raw
|
|
18
|
+
* {@link WorkspaceValidationResult} (the machine-readable CI contract); the
|
|
19
|
+
* default is a human report that groups findings by document — one header per
|
|
20
|
+
* file followed by `line:col severity message (code)` lines — and closes
|
|
21
|
+
* with the {@link summaryLine} tally.
|
|
22
|
+
*
|
|
23
|
+
* Findings arrive already grouped contiguously by document (the framework
|
|
24
|
+
* collector iterates per document), so a header is emitted whenever the URI
|
|
25
|
+
* changes rather than pre-bucketing.
|
|
26
|
+
*/
|
|
27
|
+
export declare function formatValidationReport(result: WorkspaceValidationResult, options?: {
|
|
28
|
+
json?: boolean;
|
|
29
|
+
}): string;
|
|
30
|
+
//# sourceMappingURL=validate-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-report.d.ts","sourceRoot":"","sources":["../../src/commands/validate-report.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAYtE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,yBAAyB,EAAE,MAAM,UAAQ,GAAG,MAAM,CAQ5F;AAwBD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,yBAAyB,EAAE,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,CAuBlH"}
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
/** `s` when `count !== 1`, else empty. */
|
|
10
|
+
function plural(count) {
|
|
11
|
+
return count === 1 ? '' : 's';
|
|
12
|
+
}
|
|
13
|
+
/** `<n> file` / `<n> files`. */
|
|
14
|
+
function fileCount(documents) {
|
|
15
|
+
return `${documents} file${plural(documents)}`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The exit code for a validation run: non-zero blocks the CI gate.
|
|
19
|
+
* Errors always fail; `strict` additionally fails on warnings. Info/hint
|
|
20
|
+
* findings are advisory and never affect the exit code.
|
|
21
|
+
*/
|
|
22
|
+
export function validationExitCode(result, strict = false) {
|
|
23
|
+
if (result.counts.error > 0) {
|
|
24
|
+
return 1;
|
|
25
|
+
}
|
|
26
|
+
if (strict && result.counts.warning > 0) {
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
/** One-line severity tally over the file count, or the clean-workspace message. */
|
|
32
|
+
function summaryLine(result) {
|
|
33
|
+
const { error, warning, info, hint } = result.counts;
|
|
34
|
+
if (error + warning + info + hint === 0) {
|
|
35
|
+
return `No problems found in ${fileCount(result.documents)}.`;
|
|
36
|
+
}
|
|
37
|
+
const parts = [];
|
|
38
|
+
if (error) {
|
|
39
|
+
parts.push(`${error} error${plural(error)}`);
|
|
40
|
+
}
|
|
41
|
+
if (warning) {
|
|
42
|
+
parts.push(`${warning} warning${plural(warning)}`);
|
|
43
|
+
}
|
|
44
|
+
if (info) {
|
|
45
|
+
parts.push(`${info} info`);
|
|
46
|
+
}
|
|
47
|
+
if (hint) {
|
|
48
|
+
parts.push(`${hint} hint${plural(hint)}`);
|
|
49
|
+
}
|
|
50
|
+
return `${parts.join(', ')} in ${fileCount(result.documents)}.`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Render a validation result for the terminal. `json` emits the raw
|
|
54
|
+
* {@link WorkspaceValidationResult} (the machine-readable CI contract); the
|
|
55
|
+
* default is a human report that groups findings by document — one header per
|
|
56
|
+
* file followed by `line:col severity message (code)` lines — and closes
|
|
57
|
+
* with the {@link summaryLine} tally.
|
|
58
|
+
*
|
|
59
|
+
* Findings arrive already grouped contiguously by document (the framework
|
|
60
|
+
* collector iterates per document), so a header is emitted whenever the URI
|
|
61
|
+
* changes rather than pre-bucketing.
|
|
62
|
+
*/
|
|
63
|
+
export function formatValidationReport(result, options = {}) {
|
|
64
|
+
if (options.json) {
|
|
65
|
+
return JSON.stringify(result, undefined, 2);
|
|
66
|
+
}
|
|
67
|
+
const lines = [];
|
|
68
|
+
let currentUri;
|
|
69
|
+
for (const finding of result.findings) {
|
|
70
|
+
if (finding.uri !== currentUri) {
|
|
71
|
+
if (currentUri !== undefined) {
|
|
72
|
+
lines.push('');
|
|
73
|
+
}
|
|
74
|
+
lines.push(finding.uri);
|
|
75
|
+
currentUri = finding.uri;
|
|
76
|
+
}
|
|
77
|
+
const location = `${finding.line + 1}:${finding.character + 1}`;
|
|
78
|
+
const code = finding.code !== undefined ? ` (${finding.code})` : '';
|
|
79
|
+
lines.push(` ${location.padEnd(7)} ${finding.severity.padEnd(7)} ${finding.message}${code}`);
|
|
80
|
+
}
|
|
81
|
+
if (result.findings.length > 0) {
|
|
82
|
+
lines.push('');
|
|
83
|
+
}
|
|
84
|
+
lines.push(summaryLine(result));
|
|
85
|
+
return lines.join('\n');
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=validate-report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AAC,MAAM,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,KAAK,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC,CAAC;IACjG,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAChC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { type DriverSpawnOptions } from './headless-harness.js';
|
|
10
|
+
/** Options for the {@link runValidate} subcommand. */
|
|
11
|
+
export interface ValidateCommandOptions extends DriverSpawnOptions {
|
|
12
|
+
/** ESM module exporting a zero-arg `createServices(): { shared }` thunk. */
|
|
13
|
+
readonly servicesModule: string;
|
|
14
|
+
/** Workspace root (filesystem path or file URI) to build and validate. */
|
|
15
|
+
readonly workspace: string;
|
|
16
|
+
/** Emit the raw JSON result instead of the human report. */
|
|
17
|
+
readonly json?: boolean;
|
|
18
|
+
/** Also fail (non-zero exit) on warnings, not only errors. */
|
|
19
|
+
readonly strict?: boolean;
|
|
20
|
+
/** Write the report to this file instead of stdout; the gate still sets the exit code. */
|
|
21
|
+
readonly outFile?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Build the argv the driver child parses. Pure → unit-testable. */
|
|
24
|
+
export declare function buildValidateDriverArgs(options: ValidateCommandOptions): string[];
|
|
25
|
+
/**
|
|
26
|
+
* Headless workspace validation — a CI gate that builds a workspace, runs the
|
|
27
|
+
* language's validation checks, prints the diagnostics, and exits non-zero when
|
|
28
|
+
* any error is found (`--strict` also fails on warnings). Like the other headless
|
|
29
|
+
* harnesses the binary is language-agnostic, so the head passes a `createServices`
|
|
30
|
+
* module (`--services`); the work runs in a spawned child that dynamic-imports it.
|
|
31
|
+
* The child's exit code propagates to this process so shells and CI see the gate.
|
|
32
|
+
*/
|
|
33
|
+
export declare function runValidate(options: ValidateCommandOptions): Promise<void>;
|
|
34
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAiC,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQ/F,sDAAsD;AACtD,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAC/D,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,oEAAoE;AACpE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,EAAE,CAYjF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 { fileURLToPath } from 'node:url';
|
|
10
|
+
import { OUT_FILE_FLAG, runDriverChild } from './headless-harness.js';
|
|
11
|
+
/**
|
|
12
|
+
* Absolute path to the spawned driver. From `lib/commands/validate.js` the
|
|
13
|
+
* compiled driver sits beside it at `lib/commands/validate-driver.js`.
|
|
14
|
+
*/
|
|
15
|
+
const DRIVER = fileURLToPath(new URL('./validate-driver.js', import.meta.url));
|
|
16
|
+
/** Build the argv the driver child parses. Pure → unit-testable. */
|
|
17
|
+
export function buildValidateDriverArgs(options) {
|
|
18
|
+
const args = ['--services', options.servicesModule, options.workspace];
|
|
19
|
+
if (options.json) {
|
|
20
|
+
args.push('--json');
|
|
21
|
+
}
|
|
22
|
+
if (options.strict) {
|
|
23
|
+
args.push('--strict');
|
|
24
|
+
}
|
|
25
|
+
if (options.outFile !== undefined) {
|
|
26
|
+
args.push(OUT_FILE_FLAG, options.outFile);
|
|
27
|
+
}
|
|
28
|
+
return args;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Headless workspace validation — a CI gate that builds a workspace, runs the
|
|
32
|
+
* language's validation checks, prints the diagnostics, and exits non-zero when
|
|
33
|
+
* any error is found (`--strict` also fails on warnings). Like the other headless
|
|
34
|
+
* harnesses the binary is language-agnostic, so the head passes a `createServices`
|
|
35
|
+
* module (`--services`); the work runs in a spawned child that dynamic-imports it.
|
|
36
|
+
* The child's exit code propagates to this process so shells and CI see the gate.
|
|
37
|
+
*/
|
|
38
|
+
export function runValidate(options) {
|
|
39
|
+
return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildValidateDriverArgs(options)], options);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAE/F;;;GAGG;AACH,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAgB/E,oEAAoE;AACpE,MAAM,UAAU,uBAAuB,CAAC,OAA+B;IACpE,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACvE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,IAAI,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,OAA+B;IACxD,OAAO,cAAc,CAAC,CAAC,2BAA2B,EAAE,MAAM,EAAE,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9G,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { type UsageError } from './harness-args.js';
|
|
10
|
+
import { type WatchCommandOptions } from './watch.js';
|
|
11
|
+
/**
|
|
12
|
+
* Every flag `watch` accepts, derived from its own list plus the shared spawn
|
|
13
|
+
* flags, so the list cannot claim a flag the parser would reject.
|
|
14
|
+
*/
|
|
15
|
+
export declare const WATCH_FLAGS: readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* The subset that takes a value, so `--help` in a value position reads as data.
|
|
18
|
+
* Every flag in this family takes one, so the two lists coincide.
|
|
19
|
+
*/
|
|
20
|
+
export declare const WATCH_VALUE_FLAGS: readonly string[];
|
|
21
|
+
/** The `--help` text, as data, held to {@link WATCH_FLAGS} by a test. */
|
|
22
|
+
export declare const WATCH_HELP: readonly string[];
|
|
23
|
+
/** Parse the argv; the abort signal is the entry point's to supply, not the command line's. */
|
|
24
|
+
export declare function parseWatchArgs(args: string[], onError?: UsageError): WatchCommandOptions;
|
|
25
|
+
export declare function runWatchCommand(args: string[]): Promise<void>;
|
|
26
|
+
//# sourceMappingURL=watch-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-args.d.ts","sourceRoot":"","sources":["../../src/commands/watch-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAQJ,KAAK,UAAU,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAIjF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,MAAM,EAAgD,CAAC;AAE1F;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAAgB,CAAC;AAEhE,yEAAyE;AACzE,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAYvC,CAAC;AAEF,+FAA+F;AAC/F,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAA0B,GAAG,mBAAmB,CAWvG;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAS7D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { assertRequired, exitWithUsage, helpRequested, parseFlagOptions, parseServerSpawnOptions, printHelp, SERVER_SPAWN_VALUE_FLAGS } from './harness-args.js';
|
|
10
|
+
import { runWatch, wireSigintAbort } from './watch.js';
|
|
11
|
+
const OWN_FLAGS = ['--uri', '--client-id'];
|
|
12
|
+
/**
|
|
13
|
+
* Every flag `watch` accepts, derived from its own list plus the shared spawn
|
|
14
|
+
* flags, so the list cannot claim a flag the parser would reject.
|
|
15
|
+
*/
|
|
16
|
+
export const WATCH_FLAGS = [...SERVER_SPAWN_VALUE_FLAGS, ...OWN_FLAGS];
|
|
17
|
+
/**
|
|
18
|
+
* The subset that takes a value, so `--help` in a value position reads as data.
|
|
19
|
+
* Every flag in this family takes one, so the two lists coincide.
|
|
20
|
+
*/
|
|
21
|
+
export const WATCH_VALUE_FLAGS = WATCH_FLAGS;
|
|
22
|
+
/** The `--help` text, as data, held to {@link WATCH_FLAGS} by a test. */
|
|
23
|
+
export const WATCH_HELP = [
|
|
24
|
+
'Usage: hydranium-cli watch --server "<cmd>..." --uri <uri> [--client-id <id>] [--cwd <dir>] [--log-level <level>]',
|
|
25
|
+
'',
|
|
26
|
+
'Subscribe to document updates at `<uri>` and print events as newline-delimited',
|
|
27
|
+
'JSON. Long-running — exits cleanly on SIGINT (Ctrl-C).',
|
|
28
|
+
'',
|
|
29
|
+
'Options:',
|
|
30
|
+
' --server "<cmd>" Command-line for the data-server subprocess (required).',
|
|
31
|
+
' --uri <uri> Document URI (required).',
|
|
32
|
+
' --client-id <id> Subscriber identity. Default: hydranium-cli.',
|
|
33
|
+
' --cwd <dir> Working directory for the spawned child. Default: cwd.',
|
|
34
|
+
' --log-level <lvl> Log threshold for the spawned server (off|error|warn|info|debug|trace).'
|
|
35
|
+
];
|
|
36
|
+
/** Parse the argv; the abort signal is the entry point's to supply, not the command line's. */
|
|
37
|
+
export function parseWatchArgs(args, onError = exitWithUsage) {
|
|
38
|
+
const { serverCommand, serverArgs, cwd, logLevel, extra } = parseServerSpawnOptions(args, 'watch', onError);
|
|
39
|
+
const { uri, clientId } = parseFlagOptions(extra, 'watch', OWN_FLAGS, onError);
|
|
40
|
+
return {
|
|
41
|
+
serverCommand,
|
|
42
|
+
serverArgs,
|
|
43
|
+
cwd,
|
|
44
|
+
logLevel,
|
|
45
|
+
uri: assertRequired(uri, '--uri', 'watch', onError),
|
|
46
|
+
clientId
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function runWatchCommand(args) {
|
|
50
|
+
if (helpRequested(args, WATCH_VALUE_FLAGS)) {
|
|
51
|
+
printHelp(WATCH_HELP);
|
|
52
|
+
return Promise.resolve();
|
|
53
|
+
}
|
|
54
|
+
const options = parseWatchArgs(args);
|
|
55
|
+
const controller = new AbortController();
|
|
56
|
+
const unwire = wireSigintAbort(controller);
|
|
57
|
+
return runWatch({ ...options, signal: controller.signal }).finally(() => unwire());
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=watch-args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-args.js","sourceRoot":"","sources":["../../src/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AI,aAAa,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,CAAC;QAC1C,SAAS,CAAC,UAAU,CAAC,CAAC;QACtB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IACD,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAC3C,OAAO,QAAQ,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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 type { LogThreshold, TransferElement } from '@hydranium/protocol';
|
|
10
|
+
import type { DataClientProtocol, DataServerProtocol } from '@hydranium/protocol/data';
|
|
11
|
+
/**
|
|
12
|
+
* Options for the {@link runWatch} subcommand. Subscribes to document
|
|
13
|
+
* updates at `uri` and writes each event as one JSON line. Long-running
|
|
14
|
+
* — exits on SIGINT (Ctrl-C) or when `signal` aborts. Each event is
|
|
15
|
+
* line-flushable for `jq` / `tee` pipelines.
|
|
16
|
+
*
|
|
17
|
+
* `clientId` defaults to `'hydranium-cli'`. `signal` is the test seam
|
|
18
|
+
* — production CLI wires SIGINT directly. `__handleForTest` bypasses
|
|
19
|
+
* the spawn step for unit tests.
|
|
20
|
+
*/
|
|
21
|
+
export interface WatchCommandOptions {
|
|
22
|
+
readonly serverCommand: string;
|
|
23
|
+
readonly serverArgs?: readonly string[];
|
|
24
|
+
readonly cwd?: string;
|
|
25
|
+
/** Log threshold for the spawned server, set on its `HYDRANIUM_LOG_LEVEL` env. */
|
|
26
|
+
readonly logLevel?: LogThreshold;
|
|
27
|
+
readonly uri: string;
|
|
28
|
+
readonly clientId?: string;
|
|
29
|
+
readonly write?: (line: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* AbortSignal that cancels the subscription loop. Production wires
|
|
32
|
+
* SIGINT via {@link wireSigintAbort}; tests pass a controlled signal
|
|
33
|
+
* to assert deterministic teardown.
|
|
34
|
+
*/
|
|
35
|
+
readonly signal?: AbortSignal;
|
|
36
|
+
/**
|
|
37
|
+
* Test-only injection — supplies the typed server proxy along with a
|
|
38
|
+
* "fire event" hook that runWatch calls during construction to wire
|
|
39
|
+
* its local client. Production CLI never passes this; subcommand
|
|
40
|
+
* unit tests do.
|
|
41
|
+
*/
|
|
42
|
+
readonly __handleForTest?: WatchTestHandle;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Test seam for {@link runWatch}. Wraps the bits of `DataServerHandle`
|
|
46
|
+
* the watch loop actually uses — the typed server proxy plus a
|
|
47
|
+
* `bindClient` hook the test fixture uses to capture the local
|
|
48
|
+
* `DataClientProtocol` so it can fire events at it.
|
|
49
|
+
*/
|
|
50
|
+
export interface WatchTestHandle {
|
|
51
|
+
readonly server: Pick<DataServerProtocol<TransferElement>, 'watchModelDocument' | 'unwatchModelDocument'>;
|
|
52
|
+
/**
|
|
53
|
+
* Called once during {@link runWatch} startup with the watch loop's
|
|
54
|
+
* local {@link DataClientProtocol}. Test fixtures stash the reference
|
|
55
|
+
* and invoke `client.onDocumentUpdated(event)` to simulate the
|
|
56
|
+
* data-server's notification.
|
|
57
|
+
*/
|
|
58
|
+
bindClient(client: DataClientProtocol<TransferElement>): void;
|
|
59
|
+
/** Mirror of `DataServerHandle.shutdown` — tests can stub as a no-op. */
|
|
60
|
+
shutdown(timeoutMs?: number): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Mirror of `DataServerHandle.whenTerminated`. Omit it for a fixture with no
|
|
63
|
+
* child to lose; supply it to drive the premature-death race, which is the
|
|
64
|
+
* only way a test reaches {@link runWatch}'s shutdown filtering.
|
|
65
|
+
*/
|
|
66
|
+
readonly whenTerminated?: Promise<never>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Wire SIGINT to abort the given controller. Returns a function that
|
|
70
|
+
* un-wires the listener — call it once the subcommand exits so future
|
|
71
|
+
* SIGINTs don't trigger an already-aborted controller.
|
|
72
|
+
*/
|
|
73
|
+
export declare function wireSigintAbort(controller: AbortController): () => void;
|
|
74
|
+
export declare function runWatch(options: WatchCommandOptions): Promise<void>;
|
|
75
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAgC,MAAM,0BAA0B,CAAC;AAIrH;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,QAA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