@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,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 `ast-ground-truth` subcommand. Launched by the parent with
|
|
11
|
+
* `node <this> --services <module> <workspace> [--out-file <file>]`. It
|
|
12
|
+
* dynamic-imports the head's services module, runs the framework's
|
|
13
|
+
* `collectAstGroundTruth`, and writes the `{ documents, totalAstNodes, byType }`
|
|
14
|
+
* JSON to stdout (or `--out-file`). Never imported — only spawned.
|
|
15
|
+
*/
|
|
16
|
+
import * as fs from 'node:fs';
|
|
17
|
+
import { loadHeadlessContext, OUT_FILE_FLAG } from './headless-harness.js';
|
|
18
|
+
function parseArgs(argv) {
|
|
19
|
+
const parsed = {};
|
|
20
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
21
|
+
const flag = argv[index];
|
|
22
|
+
const next = () => {
|
|
23
|
+
const value = argv[index + 1];
|
|
24
|
+
if (value === undefined) {
|
|
25
|
+
console.error(`Missing value for ${flag}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
index += 1;
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
31
|
+
switch (flag) {
|
|
32
|
+
case '--services':
|
|
33
|
+
parsed.servicesModule = next();
|
|
34
|
+
break;
|
|
35
|
+
case OUT_FILE_FLAG:
|
|
36
|
+
parsed.outFile = next();
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
if (flag.startsWith('--')) {
|
|
40
|
+
console.error(`Unknown option: ${flag}`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
parsed.workspace = flag;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return parsed;
|
|
47
|
+
}
|
|
48
|
+
async function main(argv) {
|
|
49
|
+
const args = parseArgs(argv);
|
|
50
|
+
if (!args.servicesModule || !args.workspace) {
|
|
51
|
+
console.error('ast-ground-truth-driver: --services <module> and a <workspace> are required.');
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
const { createServices, coreNode } = await loadHeadlessContext(args.servicesModule);
|
|
55
|
+
const result = await coreNode.collectAstGroundTruth({ createServices, workspace: args.workspace });
|
|
56
|
+
const json = JSON.stringify(result, undefined, 2);
|
|
57
|
+
if (args.outFile) {
|
|
58
|
+
fs.writeFileSync(args.outFile, `${json}\n`);
|
|
59
|
+
// Progress to stderr keeps stdout clean for callers that capture either form.
|
|
60
|
+
console.error(`Ground truth: ${result.documents} docs, ${result.totalAstNodes} AST nodes -> ${args.outFile}`);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
console.log(json);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
main(process.argv.slice(2))
|
|
67
|
+
.then(() => process.exit(0))
|
|
68
|
+
.catch((error) => {
|
|
69
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=ast-ground-truth-driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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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,31 @@
|
|
|
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 runAstGroundTruth} subcommand. */
|
|
11
|
+
export interface AstGroundTruthCommandOptions 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. */
|
|
15
|
+
readonly workspace: string;
|
|
16
|
+
/** Write the JSON to this file instead of stdout. */
|
|
17
|
+
readonly outFile?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Build the argv the driver child parses. Pure → unit-testable. */
|
|
20
|
+
export declare function buildGroundTruthDriverArgs(options: AstGroundTruthCommandOptions): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Headless live-model `$type` census — the ground truth the offline heap
|
|
23
|
+
* analyzer validates a snapshot's classification against
|
|
24
|
+
* (`analyze-heap --validate <gt.json>`). Like `measure-memory`, the binary is
|
|
25
|
+
* language-agnostic, so the head passes a `createServices` module (`--services`);
|
|
26
|
+
* the work runs in a spawned child that dynamic-imports it, builds the workspace,
|
|
27
|
+
* and emits the `{ documents, totalAstNodes, byType }` JSON on stdout (or
|
|
28
|
+
* `--out-file`). No `--expose-gc` needed — this walks the AST, it does not weigh it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function runAstGroundTruth(options: AstGroundTruthCommandOptions): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=ast-ground-truth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-ground-truth.d.ts","sourceRoot":"","sources":["../../src/commands/ast-ground-truth.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAiC,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQ/F,4DAA4D;AAC5D,MAAM,WAAW,4BAA6B,SAAQ,kBAAkB;IACrE,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,oEAAoE;AACpE,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,4BAA4B,GAAG,MAAM,EAAE,CAM1F;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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/ast-ground-truth.js`
|
|
13
|
+
* the compiled driver sits beside it at `lib/commands/ast-ground-truth-driver.js`.
|
|
14
|
+
*/
|
|
15
|
+
const DRIVER = fileURLToPath(new URL('./ast-ground-truth-driver.js', import.meta.url));
|
|
16
|
+
/** Build the argv the driver child parses. Pure → unit-testable. */
|
|
17
|
+
export function buildGroundTruthDriverArgs(options) {
|
|
18
|
+
const args = ['--services', options.servicesModule, options.workspace];
|
|
19
|
+
if (options.outFile !== undefined) {
|
|
20
|
+
args.push(OUT_FILE_FLAG, options.outFile);
|
|
21
|
+
}
|
|
22
|
+
return args;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Headless live-model `$type` census — the ground truth the offline heap
|
|
26
|
+
* analyzer validates a snapshot's classification against
|
|
27
|
+
* (`analyze-heap --validate <gt.json>`). Like `measure-memory`, the binary is
|
|
28
|
+
* language-agnostic, so the head passes a `createServices` module (`--services`);
|
|
29
|
+
* the work runs in a spawned child that dynamic-imports it, builds the workspace,
|
|
30
|
+
* and emits the `{ documents, totalAstNodes, byType }` JSON on stdout (or
|
|
31
|
+
* `--out-file`). No `--expose-gc` needed — this walks the AST, it does not weigh it.
|
|
32
|
+
*/
|
|
33
|
+
export function runAstGroundTruth(options) {
|
|
34
|
+
return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildGroundTruthDriverArgs(options)], options);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=ast-ground-truth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-ground-truth.js","sourceRoot":"","sources":["../../src/commands/ast-ground-truth.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,8BAA8B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAYvF,oEAAoE;AACpE,MAAM,UAAU,0BAA0B,CAAC,OAAqC;IAC7E,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACvE,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;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAqC;IACpE,OAAO,cAAc,CAAC,CAAC,2BAA2B,EAAE,MAAM,EAAE,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACjH,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 GenerateTransferModelOptions } from './generate-transfer-model.js';
|
|
10
|
+
import { type UsageError } from './harness-args.js';
|
|
11
|
+
/**
|
|
12
|
+
* Every flag `generate-transfer-model` accepts.
|
|
13
|
+
*
|
|
14
|
+
* Listed rather than derived: this command takes no `--services` and no
|
|
15
|
+
* positional, so it parses its own switch instead of going through the shared
|
|
16
|
+
* harness parser, and there is no flag set to derive the list from. A test
|
|
17
|
+
* therefore drives the parser with each name to prove the switch has a case for
|
|
18
|
+
* it, which the harness-backed commands get for free.
|
|
19
|
+
*/
|
|
20
|
+
export declare const GENERATE_TRANSFER_MODEL_FLAGS: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* The subset that takes a value, so `--help` in a value position reads as data.
|
|
23
|
+
* `--watch` is the only presence-only flag; `--regen-command` is the one where a
|
|
24
|
+
* caller plausibly writes that literal text into a generated header.
|
|
25
|
+
*/
|
|
26
|
+
export declare const GENERATE_TRANSFER_MODEL_VALUE_FLAGS: readonly string[];
|
|
27
|
+
/** The `--help` text, as data, held to {@link GENERATE_TRANSFER_MODEL_FLAGS} by a test. */
|
|
28
|
+
export declare const GENERATE_TRANSFER_MODEL_HELP: readonly string[];
|
|
29
|
+
/** The flags as read, before any config file or langium-config derivation is folded in. */
|
|
30
|
+
export interface ParsedGenerateOptions {
|
|
31
|
+
flags: Partial<GenerateTransferModelOptions>;
|
|
32
|
+
configFile?: string;
|
|
33
|
+
langiumConfigFile?: string;
|
|
34
|
+
watch: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare function parseGenerateOptions(args: string[], onError?: UsageError): ParsedGenerateOptions;
|
|
37
|
+
export declare function runGenerateTransferModelCommand(args: string[]): void | Promise<void>;
|
|
38
|
+
//# sourceMappingURL=generate-transfer-model-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-transfer-model-args.d.ts","sourceRoot":"","sources":["../../src/commands/generate-transfer-model-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,EAA6C,KAAK,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC5H,OAAO,EAA2C,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG7F;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAa1D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,EAAE,SAAS,MAAM,EAAqE,CAAC;AAEvI,2FAA2F;AAC3F,eAAO,MAAM,4BAA4B,EAAE,SAAS,MAAM,EA4BzD,CAAC;AAEF,2FAA2F;AAC3F,MAAM,WAAW,qBAAqB;IACnC,KAAK,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAA0B,GAAG,qBAAqB,CAsE/G;AAcD,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCpF"}
|
|
@@ -0,0 +1,183 @@
|
|
|
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 * as fs from 'node:fs';
|
|
10
|
+
import { deriveAstFileFromLangiumConfig, loadTransferModelConfig, mergeTransferModelOptions } from './generate-transfer-model-config.js';
|
|
11
|
+
import { generateTransferModel, watchTransferModel } from './generate-transfer-model.js';
|
|
12
|
+
import { exitWithUsage, helpRequested, printHelp } from './harness-args.js';
|
|
13
|
+
import { wireSigintAbort } from './watch.js';
|
|
14
|
+
/**
|
|
15
|
+
* Every flag `generate-transfer-model` accepts.
|
|
16
|
+
*
|
|
17
|
+
* Listed rather than derived: this command takes no `--services` and no
|
|
18
|
+
* positional, so it parses its own switch instead of going through the shared
|
|
19
|
+
* harness parser, and there is no flag set to derive the list from. A test
|
|
20
|
+
* therefore drives the parser with each name to prove the switch has a case for
|
|
21
|
+
* it, which the harness-backed commands get for free.
|
|
22
|
+
*/
|
|
23
|
+
export const GENERATE_TRANSFER_MODEL_FLAGS = [
|
|
24
|
+
'--config',
|
|
25
|
+
'--langium-config',
|
|
26
|
+
'--watch',
|
|
27
|
+
'--ast-file',
|
|
28
|
+
'--augmentation-file',
|
|
29
|
+
'--out-file',
|
|
30
|
+
'--element-type-name',
|
|
31
|
+
'--terminals-name',
|
|
32
|
+
'--terminals-source-name',
|
|
33
|
+
'--skip-type-alias',
|
|
34
|
+
'--skip-terminal',
|
|
35
|
+
'--regen-command'
|
|
36
|
+
];
|
|
37
|
+
/**
|
|
38
|
+
* The subset that takes a value, so `--help` in a value position reads as data.
|
|
39
|
+
* `--watch` is the only presence-only flag; `--regen-command` is the one where a
|
|
40
|
+
* caller plausibly writes that literal text into a generated header.
|
|
41
|
+
*/
|
|
42
|
+
export const GENERATE_TRANSFER_MODEL_VALUE_FLAGS = GENERATE_TRANSFER_MODEL_FLAGS.filter(flag => flag !== '--watch');
|
|
43
|
+
/** The `--help` text, as data, held to {@link GENERATE_TRANSFER_MODEL_FLAGS} by a test. */
|
|
44
|
+
export const GENERATE_TRANSFER_MODEL_HELP = [
|
|
45
|
+
'Usage: hydranium-cli generate-transfer-model [options]',
|
|
46
|
+
'',
|
|
47
|
+
'Generate a serializable transfer-model TypeScript file from a Langium AST. The',
|
|
48
|
+
'required inputs (--ast-file / --augmentation-file / --out-file) may instead come',
|
|
49
|
+
'from a --config JSON file, and --ast-file can be auto-discovered from a Langium',
|
|
50
|
+
"config's `out` directory. Precedence, highest first: explicit flags, then the",
|
|
51
|
+
'--config file, then the langium-config-derived --ast-file.',
|
|
52
|
+
'',
|
|
53
|
+
'Options:',
|
|
54
|
+
' --config <path> JSON config supplying any of the options below.',
|
|
55
|
+
" Relative paths resolve against the config's dir.",
|
|
56
|
+
" --langium-config <path> Derive --ast-file from this config's `out` dir",
|
|
57
|
+
' (<out>/ast.ts). Defaults to ./langium-config.json.',
|
|
58
|
+
' --watch Regenerate on AST / augmentation file changes.',
|
|
59
|
+
' --ast-file <path> Langium-generated AST source file (required).',
|
|
60
|
+
' --augmentation-file <path> Module-augmentation file (required).',
|
|
61
|
+
' --out-file <path> Destination for the generated transfer model (required).',
|
|
62
|
+
" Do NOT point this inside langium-cli's own `out`",
|
|
63
|
+
' directory: it treats that directory as exclusively',
|
|
64
|
+
' its own, so every `langium generate` reports this',
|
|
65
|
+
' file as unexpected and offers to delete it.',
|
|
66
|
+
' --element-type-name <name> Base element type name in output. Default: TransferElement.',
|
|
67
|
+
' --terminals-name <name> Terminals const name in output. Default: ModelTerminals.',
|
|
68
|
+
' --terminals-source-name <n> Source-side terminals variable name. Default: <LanguageId>Terminals.',
|
|
69
|
+
' --skip-type-alias <name> Type alias to exclude (repeatable).',
|
|
70
|
+
' --skip-terminal <name> Terminal to exclude (repeatable).',
|
|
71
|
+
' --regen-command <text> Header line shown in the generated file (regen instructions).'
|
|
72
|
+
];
|
|
73
|
+
export function parseGenerateOptions(args, onError = exitWithUsage) {
|
|
74
|
+
const skipTypeAliases = [];
|
|
75
|
+
const skipTerminals = [];
|
|
76
|
+
const flags = {};
|
|
77
|
+
let configFile;
|
|
78
|
+
let langiumConfigFile;
|
|
79
|
+
let watch = false;
|
|
80
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
81
|
+
const flag = args[index];
|
|
82
|
+
const next = () => {
|
|
83
|
+
const value = args[index + 1];
|
|
84
|
+
if (value === undefined) {
|
|
85
|
+
onError(`Missing value for ${flag}`);
|
|
86
|
+
}
|
|
87
|
+
index += 1;
|
|
88
|
+
return value;
|
|
89
|
+
};
|
|
90
|
+
switch (flag) {
|
|
91
|
+
case '--config':
|
|
92
|
+
configFile = next();
|
|
93
|
+
break;
|
|
94
|
+
case '--langium-config':
|
|
95
|
+
langiumConfigFile = next();
|
|
96
|
+
break;
|
|
97
|
+
case '--watch':
|
|
98
|
+
watch = true;
|
|
99
|
+
break;
|
|
100
|
+
case '--ast-file':
|
|
101
|
+
flags.astFile = next();
|
|
102
|
+
break;
|
|
103
|
+
case '--augmentation-file':
|
|
104
|
+
flags.augmentationFile = next();
|
|
105
|
+
break;
|
|
106
|
+
case '--out-file':
|
|
107
|
+
flags.outFile = next();
|
|
108
|
+
break;
|
|
109
|
+
case '--element-type-name':
|
|
110
|
+
flags.elementTypeName = next();
|
|
111
|
+
break;
|
|
112
|
+
case '--terminals-name':
|
|
113
|
+
flags.terminalsName = next();
|
|
114
|
+
break;
|
|
115
|
+
case '--terminals-source-name':
|
|
116
|
+
flags.terminalsSourceName = next();
|
|
117
|
+
break;
|
|
118
|
+
case '--skip-type-alias':
|
|
119
|
+
skipTypeAliases.push(next());
|
|
120
|
+
break;
|
|
121
|
+
case '--skip-terminal':
|
|
122
|
+
skipTerminals.push(next());
|
|
123
|
+
break;
|
|
124
|
+
case '--regen-command':
|
|
125
|
+
flags.regenCommand = next();
|
|
126
|
+
break;
|
|
127
|
+
default:
|
|
128
|
+
onError(`Unknown option: ${flag}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Only record the repeatable arrays when the flag actually appeared, so an empty
|
|
132
|
+
// `--skip-*` doesn't shadow a config-file value in the merge (first-defined-wins).
|
|
133
|
+
if (skipTypeAliases.length) {
|
|
134
|
+
flags.skipTypeAliases = skipTypeAliases;
|
|
135
|
+
}
|
|
136
|
+
if (skipTerminals.length) {
|
|
137
|
+
flags.skipTerminals = skipTerminals;
|
|
138
|
+
}
|
|
139
|
+
return { flags, configFile, langiumConfigFile, watch };
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Only auto-detect the default `./langium-config.json` when it exists — an explicit
|
|
143
|
+
* `--langium-config` always wins and is returned as-is (the caller reports errors if
|
|
144
|
+
* it is unreadable).
|
|
145
|
+
*/
|
|
146
|
+
function resolveLangiumConfigPath(explicit) {
|
|
147
|
+
if (explicit !== undefined) {
|
|
148
|
+
return explicit;
|
|
149
|
+
}
|
|
150
|
+
return fs.existsSync('langium-config.json') ? 'langium-config.json' : undefined;
|
|
151
|
+
}
|
|
152
|
+
export function runGenerateTransferModelCommand(args) {
|
|
153
|
+
if (helpRequested(args, GENERATE_TRANSFER_MODEL_VALUE_FLAGS)) {
|
|
154
|
+
printHelp(GENERATE_TRANSFER_MODEL_HELP);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const parsed = parseGenerateOptions(args);
|
|
158
|
+
// Assemble option sources highest-precedence first: explicit flags, then the
|
|
159
|
+
// --config file, then a langium-config-derived --ast-file. Merge validates the
|
|
160
|
+
// three required paths are present after all sources are considered.
|
|
161
|
+
const sources = [parsed.flags];
|
|
162
|
+
if (parsed.configFile !== undefined) {
|
|
163
|
+
sources.push(loadTransferModelConfig(parsed.configFile));
|
|
164
|
+
}
|
|
165
|
+
const langiumConfig = resolveLangiumConfigPath(parsed.langiumConfigFile);
|
|
166
|
+
if (langiumConfig !== undefined) {
|
|
167
|
+
const derivedAstFile = deriveAstFileFromLangiumConfig(langiumConfig);
|
|
168
|
+
if (derivedAstFile !== undefined) {
|
|
169
|
+
if (parsed.langiumConfigFile !== undefined) {
|
|
170
|
+
console.log(`Deriving --ast-file from ${langiumConfig}: ${derivedAstFile}`);
|
|
171
|
+
}
|
|
172
|
+
sources.push({ astFile: derivedAstFile });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const options = mergeTransferModelOptions(...sources);
|
|
176
|
+
if (parsed.watch) {
|
|
177
|
+
const controller = new AbortController();
|
|
178
|
+
const unwire = wireSigintAbort(controller);
|
|
179
|
+
return watchTransferModel(options, { signal: controller.signal }).finally(() => unwire());
|
|
180
|
+
}
|
|
181
|
+
generateTransferModel(options);
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=generate-transfer-model-args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-transfer-model-args.js","sourceRoot":"","sources":["../../src/commands/generate-transfer-model-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACzI,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAqC,MAAM,8BAA8B,CAAC;AAC5H,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,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,CAAC;IACD,MAAM,aAAa,GAAG,wBAAwB,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACzE,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,cAAc,GAAG,8BAA8B,CAAC,aAAa,CAAC,CAAC;QACrE,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YAChC,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;gBAC1C,OAAO,CAAC,GAAG,CAAC,4BAA4B,aAAa,KAAK,cAAc,EAAE,CAAC,CAAC;YAC/E,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;QAC7C,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,yBAAyB,CAAC,GAAG,OAAO,CAAC,CAAC;IACtD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,kBAAkB,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7F,CAAC;IACD,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { GenerateTransferModelOptions } from './generate-transfer-model.js';
|
|
10
|
+
/**
|
|
11
|
+
* Read a transfer-model JSON config file into a partial options object. Only the
|
|
12
|
+
* known {@link GenerateTransferModelOptions} keys are picked (unknown keys are
|
|
13
|
+
* ignored); the {@link PATH_KEYS} are resolved relative to the config file's own
|
|
14
|
+
* directory so a config can use paths relative to itself. Throws a clear error on
|
|
15
|
+
* unreadable / non-object / invalid JSON.
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadTransferModelConfig(configPath: string): Partial<GenerateTransferModelOptions>;
|
|
18
|
+
/**
|
|
19
|
+
* Derive the Langium-generated AST file path from a `langium-config.json`: the
|
|
20
|
+
* generator emits `ast.ts` into the config's `out` directory, so the AST file is
|
|
21
|
+
* `<config-dir>/<out>/ast.ts`. Returns `undefined` when the config declares no
|
|
22
|
+
* `out` (nothing to derive). Throws on unreadable / invalid JSON.
|
|
23
|
+
*/
|
|
24
|
+
export declare function deriveAstFileFromLangiumConfig(langiumConfigPath: string): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Merge partial option sources into a complete {@link GenerateTransferModelOptions},
|
|
27
|
+
* highest precedence first: for each field the first source that defines it wins.
|
|
28
|
+
* Pure over its inputs. Throws listing every required path (`astFile` /
|
|
29
|
+
* `augmentationFile` / `outFile`) still missing after the merge.
|
|
30
|
+
*/
|
|
31
|
+
export declare function mergeTransferModelOptions(...sources: Array<Partial<GenerateTransferModelOptions>>): GenerateTransferModelOptions;
|
|
32
|
+
//# sourceMappingURL=generate-transfer-model-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-transfer-model-config.d.ts","sourceRoot":"","sources":["../../src/commands/generate-transfer-model-config.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAUjF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAmCjG;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAa5F;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC,GAAG,4BAA4B,CAmChI"}
|
|
@@ -0,0 +1,122 @@
|
|
|
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 * as fs from 'node:fs';
|
|
10
|
+
import * as path from 'node:path';
|
|
11
|
+
/** Path-valued option keys — resolved relative to a config/langium-config file's directory. */
|
|
12
|
+
const PATH_KEYS = ['astFile', 'augmentationFile', 'outFile'];
|
|
13
|
+
/** Resolve `value` against `baseDir` when it is relative; absolute paths pass through. */
|
|
14
|
+
function resolveAgainst(baseDir, value) {
|
|
15
|
+
return path.isAbsolute(value) ? value : path.resolve(baseDir, value);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Read a transfer-model JSON config file into a partial options object. Only the
|
|
19
|
+
* known {@link GenerateTransferModelOptions} keys are picked (unknown keys are
|
|
20
|
+
* ignored); the {@link PATH_KEYS} are resolved relative to the config file's own
|
|
21
|
+
* directory so a config can use paths relative to itself. Throws a clear error on
|
|
22
|
+
* unreadable / non-object / invalid JSON.
|
|
23
|
+
*/
|
|
24
|
+
export function loadTransferModelConfig(configPath) {
|
|
25
|
+
let raw;
|
|
26
|
+
try {
|
|
27
|
+
raw = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
throw new Error(`Cannot read transfer-model config '${configPath}': ${error instanceof Error ? error.message : String(error)}`);
|
|
31
|
+
}
|
|
32
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
|
|
33
|
+
throw new Error(`Transfer-model config '${configPath}' must be a JSON object.`);
|
|
34
|
+
}
|
|
35
|
+
const source = raw;
|
|
36
|
+
const baseDir = path.dirname(path.resolve(configPath));
|
|
37
|
+
const result = {};
|
|
38
|
+
const stringKeys = [
|
|
39
|
+
'astFile',
|
|
40
|
+
'augmentationFile',
|
|
41
|
+
'outFile',
|
|
42
|
+
'elementTypeName',
|
|
43
|
+
'terminalsName',
|
|
44
|
+
'terminalsSourceName',
|
|
45
|
+
'regenCommand'
|
|
46
|
+
];
|
|
47
|
+
for (const key of stringKeys) {
|
|
48
|
+
const value = source[key];
|
|
49
|
+
if (typeof value === 'string') {
|
|
50
|
+
result[key] = PATH_KEYS.includes(key) ? resolveAgainst(baseDir, value) : value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
for (const key of ['skipTypeAliases', 'skipTerminals']) {
|
|
54
|
+
const value = source[key];
|
|
55
|
+
if (Array.isArray(value) && value.every(entry => typeof entry === 'string')) {
|
|
56
|
+
result[key] = value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Derive the Langium-generated AST file path from a `langium-config.json`: the
|
|
63
|
+
* generator emits `ast.ts` into the config's `out` directory, so the AST file is
|
|
64
|
+
* `<config-dir>/<out>/ast.ts`. Returns `undefined` when the config declares no
|
|
65
|
+
* `out` (nothing to derive). Throws on unreadable / invalid JSON.
|
|
66
|
+
*/
|
|
67
|
+
export function deriveAstFileFromLangiumConfig(langiumConfigPath) {
|
|
68
|
+
let raw;
|
|
69
|
+
try {
|
|
70
|
+
raw = JSON.parse(fs.readFileSync(langiumConfigPath, 'utf-8'));
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
throw new Error(`Cannot read langium-config '${langiumConfigPath}': ${error instanceof Error ? error.message : String(error)}`);
|
|
74
|
+
}
|
|
75
|
+
const out = raw?.out;
|
|
76
|
+
if (typeof out !== 'string') {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
const baseDir = path.dirname(path.resolve(langiumConfigPath));
|
|
80
|
+
return path.resolve(baseDir, out, 'ast.ts');
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Merge partial option sources into a complete {@link GenerateTransferModelOptions},
|
|
84
|
+
* highest precedence first: for each field the first source that defines it wins.
|
|
85
|
+
* Pure over its inputs. Throws listing every required path (`astFile` /
|
|
86
|
+
* `augmentationFile` / `outFile`) still missing after the merge.
|
|
87
|
+
*/
|
|
88
|
+
export function mergeTransferModelOptions(...sources) {
|
|
89
|
+
const pick = (key) => {
|
|
90
|
+
for (const source of sources) {
|
|
91
|
+
if (source[key] !== undefined) {
|
|
92
|
+
return source[key];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
};
|
|
97
|
+
const astFile = pick('astFile');
|
|
98
|
+
const augmentationFile = pick('augmentationFile');
|
|
99
|
+
const outFile = pick('outFile');
|
|
100
|
+
const missing = [
|
|
101
|
+
['astFile (--ast-file)', astFile],
|
|
102
|
+
['augmentationFile (--augmentation-file)', augmentationFile],
|
|
103
|
+
['outFile (--out-file)', outFile]
|
|
104
|
+
]
|
|
105
|
+
.filter(([, value]) => value === undefined)
|
|
106
|
+
.map(([label]) => label);
|
|
107
|
+
if (missing.length) {
|
|
108
|
+
throw new Error(`Missing required transfer-model option(s): ${missing.join(', ')}`);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
astFile: astFile,
|
|
112
|
+
augmentationFile: augmentationFile,
|
|
113
|
+
outFile: outFile,
|
|
114
|
+
elementTypeName: pick('elementTypeName'),
|
|
115
|
+
terminalsName: pick('terminalsName'),
|
|
116
|
+
terminalsSourceName: pick('terminalsSourceName'),
|
|
117
|
+
skipTypeAliases: pick('skipTypeAliases'),
|
|
118
|
+
skipTerminals: pick('skipTerminals'),
|
|
119
|
+
regenCommand: pick('regenCommand')
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=generate-transfer-model-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-transfer-model-config.js","sourceRoot":"","sources":["../../src/commands/generate-transfer-model-config.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,+FAA+F;AAC/F,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,kBAAkB,EAAE,SAAS,CAAU,CAAC;AAEtE,0FAA0F;AAC1F,SAAS,cAAc,CAAC,OAAe,EAAE,KAAa;IACnD,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACvD,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACF,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,sCAAsC,UAAU,MAAM,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACnI,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,0BAA0B,UAAU,0BAA0B,CAAC,CAAC;IACnF,CAAC;I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