@intentius/chant 0.21.0 → 0.23.0
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/dist/build.d.ts +7 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/cli/build-params-cli.d.ts +55 -0
- package/dist/cli/build-params-cli.d.ts.map +1 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-examples.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts +14 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/lsp/server.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +33 -2
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/discover.d.ts +28 -0
- package/dist/components/discover.d.ts.map +1 -1
- package/dist/discovery/fold-import.d.ts +71 -9
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/index.d.ts +27 -4
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/fold/fold.d.ts.map +1 -1
- package/dist/fold/subset.d.ts +39 -2
- package/dist/fold/subset.d.ts.map +1 -1
- package/dist/lint/engine.d.ts +11 -1
- package/dist/lint/engine.d.ts.map +1 -1
- package/dist/lint/rule.d.ts +14 -0
- package/dist/lint/rule.d.ts.map +1 -1
- package/dist/serializer-walker.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/build.ts +9 -0
- package/src/cli/build-params-cli.test.ts +139 -0
- package/src/cli/build-params-cli.ts +107 -0
- package/src/cli/commands/build.ts +25 -36
- package/src/cli/commands/check-lexicon-examples.ts +16 -1
- package/src/cli/commands/lint.test.ts +74 -0
- package/src/cli/commands/lint.ts +33 -9
- package/src/cli/handlers/build.test.ts +147 -0
- package/src/cli/handlers/build.ts +23 -8
- package/src/cli/handlers/run.test.ts +160 -5
- package/src/cli/handlers/run.ts +46 -8
- package/src/cli/lsp/server.ts +7 -2
- package/src/components/cli-support.test.ts +221 -3
- package/src/components/cli-support.ts +37 -6
- package/src/components/discover.test.ts +63 -1
- package/src/components/discover.ts +42 -0
- package/src/discovery/fold-import.test.ts +328 -1
- package/src/discovery/fold-import.ts +414 -31
- package/src/discovery/index.test.ts +131 -0
- package/src/discovery/index.ts +53 -8
- package/src/discovery/sandbox/fold-boundary.test.ts +254 -0
- package/src/fold/fold.ts +6 -2
- package/src/fold/subset.test.ts +95 -15
- package/src/fold/subset.ts +46 -5
- package/src/lint/engine.ts +12 -0
- package/src/lint/rule.ts +14 -0
- package/src/lint/rules/evl001-non-literal-expression.test.ts +39 -0
- package/src/lint/rules/evl001-non-literal-expression.ts +1 -1
- package/src/serializer-walker.ts +14 -0
package/dist/build.d.ts
CHANGED
|
@@ -87,6 +87,13 @@ export interface BuildOptions {
|
|
|
87
87
|
* The CLI populates this from `options.plugins.flatMap(p => p.intrinsics?.() ?? [])`.
|
|
88
88
|
*/
|
|
89
89
|
intrinsics?: IntrinsicDef[];
|
|
90
|
+
/**
|
|
91
|
+
* chant #1063 — the lexicon names loaded for this build. Passed straight
|
|
92
|
+
* through to {@link DiscoveryOptions.lexicons} in `./discovery/index`;
|
|
93
|
+
* ignored unless {@link fold} is set. The CLI populates this from
|
|
94
|
+
* `options.plugins.map(p => p.name)`.
|
|
95
|
+
*/
|
|
96
|
+
lexicons?: readonly string[];
|
|
90
97
|
/**
|
|
91
98
|
* chant #1045 Phase 2 — opt-in: run-fallback files (or, when {@link fold}
|
|
92
99
|
* isn't set, every file) execute together, isolated, in one sandboxed
|
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjE,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AAsB,qBAAqB,CACzC,IAAI,EAAE,sBAAsB,EAC5B,WAAW,EAAE,UAAU,EAAE,EACzB,KAAK,SAAsB,EAC3B,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,CAgBtB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type BuildParamsConfig } from "../build-params.js";
|
|
2
|
+
import type { BuildParamProvenance } from "../provenance.js";
|
|
3
|
+
/**
|
|
4
|
+
* Shared CLI-layer wiring for chant #1064's build-time parameters, factored
|
|
5
|
+
* out (chant #1108) so every command that discovers project source before
|
|
6
|
+
* running it resolves `chant.config.ts`'s declared `buildParams` the exact
|
|
7
|
+
* same way: `chant build` (`../commands/build.ts`'s `buildCommand`), the
|
|
8
|
+
* component deploy driver (`./handlers/run.ts`'s `chant run --components`
|
|
9
|
+
* local + `--temporal` paths), and generate mode (`./handlers/build.ts`'s
|
|
10
|
+
* `chant build --components --generate <lexicon>`).
|
|
11
|
+
*
|
|
12
|
+
* Before #1108, only `buildCommand` ran this sequence — `chant run
|
|
13
|
+
* --components` never resolved `--param`/`--params-file`/a declared `env`
|
|
14
|
+
* mapping at all, so a `*.component.ts` file reading `params.<name>`
|
|
15
|
+
* (`@intentius/chant/params`) always saw `{}`, no matter what a CI job
|
|
16
|
+
* exported into the environment. See ../build-params.ts's module doc for the
|
|
17
|
+
* full precedence rules this wraps.
|
|
18
|
+
*/
|
|
19
|
+
/** Parse repeated `--param name=value` flags into a flat `{ name: value }` record — the raw (unvalidated) strings {@link resolveCliBuildParams} resolves against a project's declared `buildParams`. `undefined` when no `--param` flag was given, matching `resolveBuildParams`'s "no cli input" shape. */
|
|
20
|
+
export declare function parseParamFlags(entries?: string[]): Record<string, string> | undefined;
|
|
21
|
+
/** Inputs {@link resolveCliBuildParams} needs from a parsed CLI invocation — the `--param`/`--params-file` half of {@link resolveBuildParams}'s `BuildParamsInput` (the `env` half is always `process.env`, resolved internally). */
|
|
22
|
+
export interface CliBuildParamsArgs {
|
|
23
|
+
/** Already-parsed `--param name=value` flags (see {@link parseParamFlags}), or the CLI's already-typed `Record<string,string>` (`chant build`'s own flag parsing does this itself — see `./handlers/build.ts`). */
|
|
24
|
+
cli?: Record<string, string>;
|
|
25
|
+
/** `--params-file <path>` — a JSON file of `{ "name": value }` values, read and parsed here. */
|
|
26
|
+
paramsFile?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface CliBuildParamsResolution {
|
|
29
|
+
success: boolean;
|
|
30
|
+
/** Every successfully resolved parameter. Empty when the project declares none, or when `success` is `false`. */
|
|
31
|
+
provenance: BuildParamProvenance[];
|
|
32
|
+
/** `formatError`-wrapped messages, ready to print as-is. Empty when `success` is `true`. */
|
|
33
|
+
errors: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve this invocation's declared build-time parameters (`chant.config.ts`'s
|
|
37
|
+
* `buildParams`) against `args`/the process environment, and log each
|
|
38
|
+
* resolved value — the identical resolution + logging sequence `chant build`
|
|
39
|
+
* runs (`../commands/build.ts`'s `buildCommand`), factored out so every other
|
|
40
|
+
* command that discovers project source runs it too (chant #1108).
|
|
41
|
+
*
|
|
42
|
+
* A resolution failure (an unknown `--param`/`--params-file` name, a missing
|
|
43
|
+
* required value, a type/enum mismatch, or an unreadable `--params-file`) is
|
|
44
|
+
* returned as `{ success: false, errors }` — never thrown — so the caller can
|
|
45
|
+
* print each message and exit non-zero exactly like a build error, matching
|
|
46
|
+
* chant #1064's acceptance criterion that this never surfaces as a thrown
|
|
47
|
+
* error from inside user source.
|
|
48
|
+
*
|
|
49
|
+
* On success, every resolved parameter is logged via `console.error` as
|
|
50
|
+
* `[param] <name> = <value> (<source>)` — unconditional, not gated on
|
|
51
|
+
* `--verbose`, so a build's environment-varying inputs are always visible,
|
|
52
|
+
* the same way #1022's fold decisions are.
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveCliBuildParams(buildParamsConfig: BuildParamsConfig | undefined, args: CliBuildParamsArgs): CliBuildParamsResolution;
|
|
55
|
+
//# sourceMappingURL=build-params-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-params-cli.d.ts","sourceRoot":"","sources":["../../src/cli/build-params-cli.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D;;;;;;;;;;;;;;;GAeG;AAEH,4SAA4S;AAC5S,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAQtF;AAED,qOAAqO;AACrO,MAAM,WAAW,kBAAkB;IACjC,mNAAmN;IACnN,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,iHAAiH;IACjH,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC,4FAA4F;IAC5F,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CACnC,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,EAChD,IAAI,EAAE,kBAAkB,GACvB,wBAAwB,CAkC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AASnD;;GAEG;AACH,MAAM,WA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uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2JAA2J;IAC3J,WAAW,CAAC,EAAE,OAAO,kBAAkB,EAAE,oBAAoB,EAAE,CAAC;CACjE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAgV9E;AAiDD;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAIlD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAItD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,YAAY,EACrB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GACxC,MAAM,IAAI,CAmCZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-lexicon-examples.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/check-lexicon-examples.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;
|
|
1
|
+
{"version":3,"file":"check-lexicon-examples.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/check-lexicon-examples.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAUH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAoE1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/lint.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAW,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/lint.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAW,MAAM,iBAAiB,CAAC;AAmBzE;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAW5D;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAmBhC;AAgED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oBAAoB;IACpB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACrC,qCAAqC;IACrC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AA0PD;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAoJ3E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAIxD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,EACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GACtC,MAAM,IAAI,CAiCZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA2ElD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6EnE"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type ChantConfig } from "../../config.js";
|
|
1
2
|
import type { CommandContext } from "../registry.js";
|
|
2
3
|
export declare function makeTemporalClient(profileName: string | undefined, projectPath: string): Promise<{
|
|
3
4
|
client: import("./run-client.js").TemporalClientHandle;
|
|
4
5
|
profile: import("./run-client.js").WorkerProfile;
|
|
5
|
-
config:
|
|
6
|
+
config: ChantConfig;
|
|
6
7
|
}>;
|
|
7
8
|
export declare function runOpList(ctx: CommandContext): Promise<number>;
|
|
8
9
|
export declare function runOpStatus(ctx: CommandContext): Promise<number>;
|
|
@@ -64,6 +65,18 @@ export declare function runOp(ctx: CommandContext): Promise<number>;
|
|
|
64
65
|
* Opt out with `--no-release-record` or `chant.config.ts`'s
|
|
65
66
|
* `release.autoRecord: false`; the default is ON. A failed run never reaches
|
|
66
67
|
* this step, so it writes nothing.
|
|
68
|
+
*
|
|
69
|
+
* chant #1108 — resolves this invocation's declared build-time parameters
|
|
70
|
+
* (`chant.config.ts`'s `buildParams`, against `--param`/`--params-file`/a
|
|
71
|
+
* declared `env` mapping) the exact same way `chant build` does
|
|
72
|
+
* (`resolveCliBuildParams`, shared with `buildCommand`), BEFORE either the
|
|
73
|
+
* local or `--temporal` path discovers/imports any `*.component.ts` file.
|
|
74
|
+
* Before this, `params.*` (`@intentius/chant/params`) was always `{}` under
|
|
75
|
+
* this command, no matter what a component's `chant.config.ts` declared or a
|
|
76
|
+
* CI job's environment supplied — see chant #1108. `chant.config.ts` is
|
|
77
|
+
* loaded once here (with the same defensive fallback the post-run
|
|
78
|
+
* auto-release check below used to apply itself) and reused for that check,
|
|
79
|
+
* rather than loaded a second time.
|
|
67
80
|
*/
|
|
68
81
|
export declare function runOpComponents(ctx: CommandContext): Promise<number>;
|
|
69
82
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/run.ts"],"names":[],"mappings":"AAIA,OAAO,EAA+C,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAO7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA4ClD,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM;;;;GAO5F;AA8BD,wBAAsB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAgEpE;AAoFD,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuCtE;AA0CD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6CnE;AA2DD;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAkCtE;AAID,2LAA2L;AAC3L,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BtE;AAmCD;;;;;;;;;;;;GAYG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAchE;AA6ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsF1E;AA+OD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiFrE;AAuLD,wBAAgB,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAMjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/lsp/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/lsp/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,eAAe,CAAC;AAKjE;;GAEG;AACH,UAAU,cAAc;IACtB,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,UAAU,eAAe;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAA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gB;IA4BxB;;OAEG;YACW,gBAAgB;IAO9B;;OAEG;YACW,kBAAkB;IAQhC;;OAEG;YACW,kBAAkB;IA0BhC;;OAEG;IACH,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CASzB"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* discovered component(s) through the interpret `driver.ts` on the local
|
|
22
22
|
* executor, the CLI entrypoint the driver (#556) never had.
|
|
23
23
|
*/
|
|
24
|
+
import type { BuildParamProvenance } from "../provenance.js";
|
|
24
25
|
import { type Archetype } from "./component.js";
|
|
25
26
|
import { type DriverComponent, type DriverRunResult } from "./driver.js";
|
|
26
27
|
import { type ComponentPipelineOptions } from "../lexicon.js";
|
|
@@ -92,6 +93,8 @@ export interface GenerateComponentsResult {
|
|
|
92
93
|
needs: string[];
|
|
93
94
|
}>;
|
|
94
95
|
error?: string;
|
|
96
|
+
/** This invocation's resolved build-time parameters (chant #1108) — the generate-mode counterpart of `../cli/commands/build.ts`'s `BuildResult.buildParams`. Empty when the project declares/supplies none. */
|
|
97
|
+
buildParams?: BuildParamProvenance[];
|
|
95
98
|
}
|
|
96
99
|
/**
|
|
97
100
|
* Generate mode (#563): discover every `Component` under `path` and
|
|
@@ -103,7 +106,16 @@ export interface GenerateComponentsResult {
|
|
|
103
106
|
* the target lexicon's `generateComponentPipeline` (#688); core owns only the
|
|
104
107
|
* generic discovery + graph.
|
|
105
108
|
*/
|
|
106
|
-
export declare function generateComponentsPipeline(path: string, lexicon: GenerateLexicon, options?: ComponentPipelineOptions, sandbox?: boolean
|
|
109
|
+
export declare function generateComponentsPipeline(path: string, lexicon: GenerateLexicon, options?: ComponentPipelineOptions, sandbox?: boolean,
|
|
110
|
+
/**
|
|
111
|
+
* chant #1108 — this invocation's resolved build-time parameter values
|
|
112
|
+
* (../cli/handlers/build.ts resolves them, the same sequence `chant build`
|
|
113
|
+
* runs, BEFORE calling this function), forwarded into discovery so a
|
|
114
|
+
* `params.<name>` reference inside a discovered `*.component.ts` file
|
|
115
|
+
* resolves instead of reading `{}`. See `discoverComponents`'s
|
|
116
|
+
* `buildParams` option (./discover.ts) for the full doc.
|
|
117
|
+
*/
|
|
118
|
+
buildParams?: BuildParamProvenance[]): Promise<GenerateComponentsResult>;
|
|
107
119
|
/**
|
|
108
120
|
* Find the first `gate` step anywhere in a component's `deploy`/`rollback`
|
|
109
121
|
* composition (including nested fan-out phases), mirroring
|
|
@@ -167,6 +179,21 @@ export interface RunComponentsOptions {
|
|
|
167
179
|
* `--progress-json`, in which case nothing changes.
|
|
168
180
|
*/
|
|
169
181
|
onProgress?: (event: RunProgressEvent) => void;
|
|
182
|
+
/**
|
|
183
|
+
* chant #1108 — this run's resolved build-time parameter values, resolved
|
|
184
|
+
* the exact same way `chant build` resolves them
|
|
185
|
+
* (../cli/build-params-cli.ts's `resolveCliBuildParams`, driven by
|
|
186
|
+
* `--param`/`--params-file`/a declared `env` mapping/`chant.config.ts`'s
|
|
187
|
+
* `buildParams` defaults). The CLI handler (../cli/handlers/run.ts)
|
|
188
|
+
* resolves + logs these BEFORE calling `runComponents`, the same
|
|
189
|
+
* sequencing `chant build` uses — this function only forwards the
|
|
190
|
+
* already-resolved values into discovery (`resolveComponentTargets` below,
|
|
191
|
+
* then `discoverComponents`); it does not resolve them itself, so
|
|
192
|
+
* `runComponents` stays free of CLI-flag-parsing/formatting concerns.
|
|
193
|
+
* Default: none — `params.*` stays `{}`, matching every caller (including
|
|
194
|
+
* every test in `cli-support.test.ts`) that doesn't supply this.
|
|
195
|
+
*/
|
|
196
|
+
buildParams?: BuildParamProvenance[];
|
|
170
197
|
}
|
|
171
198
|
/** Result of `chant run --components <name|all>`. */
|
|
172
199
|
export interface RunComponentsResult {
|
|
@@ -181,6 +208,8 @@ export interface RunComponentsResult {
|
|
|
181
208
|
component: string;
|
|
182
209
|
signalName: string;
|
|
183
210
|
};
|
|
211
|
+
/** This run's resolved build-time parameters (chant #1108) — the component-driver counterpart of `../cli/commands/build.ts`'s `BuildResult.buildParams`. Present only once the run actually reached dispatch (mirrors `BuildResult.buildParams`, which is likewise absent on an early-error return). */
|
|
212
|
+
buildParams?: BuildParamProvenance[];
|
|
184
213
|
}
|
|
185
214
|
/**
|
|
186
215
|
* Run one named component, or every discovered component (`selector ===
|
|
@@ -223,6 +252,8 @@ export interface ResolvedComponentTargets {
|
|
|
223
252
|
* without also inheriting the local executor's pre-flight gate rejection
|
|
224
253
|
* (gates are exactly what the durable path exists to support).
|
|
225
254
|
*/
|
|
226
|
-
export declare function resolveComponentTargets(path: string, selector: string, sandbox?: boolean
|
|
255
|
+
export declare function resolveComponentTargets(path: string, selector: string, sandbox?: boolean,
|
|
256
|
+
/** chant #1108 — this invocation's resolved build-time parameter values, forwarded into `discoverComponents` so a `params.<name>` reference inside a discovered `*.component.ts` file resolves instead of reading `{}`. See `discoverComponents`'s `buildParams` option (./discover.ts). */
|
|
257
|
+
buildParams?: BuildParamProvenance[]): Promise<ResolvedComponentTargets>;
|
|
227
258
|
export declare function runComponents(path: string, selector: string, options?: RunComponentsOptions): Promise<RunComponentsResult>;
|
|
228
259
|
//# sourceMappingURL=cli-support.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-support.d.ts","sourceRoot":"","sources":["../../src/components/cli-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAQL,KAAK,eAAe,EAEpB,KAAK,eAAe,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAuC,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;A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,MAAM,EAChB,OAAO,CAAC,EAAE,OAAO;AACjB,4RAA4R;AAC5R,WAAW,CAAC,EAAE,oBAAoB,EAAE,GACnC,OAAO,CAAC,wBAAwB,CAAC,CAsBnC;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAuG9B"}
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
*/
|
|
42
42
|
import { DiscoveryError } from "../errors.js";
|
|
43
43
|
import { type Component } from "./component.js";
|
|
44
|
+
import type { BuildParamProvenance } from "../provenance.js";
|
|
44
45
|
/** One discovered component, paired with the file it was exported from. */
|
|
45
46
|
export interface DiscoveredComponent {
|
|
46
47
|
component: Component;
|
|
@@ -67,6 +68,33 @@ export interface ComponentDiscoveryOptions {
|
|
|
67
68
|
* requested.
|
|
68
69
|
*/
|
|
69
70
|
sandbox?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* chant #1108 — this invocation's resolved build-time parameter values
|
|
73
|
+
* (../build-params.ts's `resolveBuildParams`, driven by the CLI's
|
|
74
|
+
* `--param`/`--params-file`/a declared `env` mapping/`chant.config.ts`'s
|
|
75
|
+
* `buildParams` defaults — see ../cli/build-params-cli.ts's
|
|
76
|
+
* `resolveCliBuildParams`, the exact resolution `chant build` runs).
|
|
77
|
+
* Populated into ../params.ts's shared `params` object (`setBuildParams`,
|
|
78
|
+
* below) before any `*.component.ts` file is scanned/imported, mirroring
|
|
79
|
+
* ../discovery/index.ts's `discover()` — the lexicon-resource counterpart
|
|
80
|
+
* of this function, and the thing chant #1108 exists to bring this one to
|
|
81
|
+
* parity with. Before #1108, no caller populated this, so a live `import {
|
|
82
|
+
* params } from "@intentius/chant/params"` inside a component file (e.g. a
|
|
83
|
+
* naming helper deriving a stack name) always saw `{}`.
|
|
84
|
+
*
|
|
85
|
+
* Default: none — `params` stays `{}`, matching every caller that doesn't
|
|
86
|
+
* resolve build-time parameters today (`chant list/describe/graph/lint
|
|
87
|
+
* --components`, `chant components status`); only the run and generate
|
|
88
|
+
* call sites (../cli/handlers/run.ts, ../cli/handlers/build.ts) pass a
|
|
89
|
+
* resolved value.
|
|
90
|
+
*
|
|
91
|
+
* Only takes effect for the in-process (non-sandboxed) import path below —
|
|
92
|
+
* `{ sandbox: true }`'s child process gets its own, unpopulated `params`
|
|
93
|
+
* module instance, the same pre-existing gap `discover({ sandbox: true })`
|
|
94
|
+
* has for lexicon resources (chant #1045 Phase 2 never threaded
|
|
95
|
+
* `buildParams` into its sandboxed child either; out of scope here too).
|
|
96
|
+
*/
|
|
97
|
+
buildParams?: BuildParamProvenance[];
|
|
70
98
|
}
|
|
71
99
|
/** One already-imported `*.component.ts` module — the input to {@link collectComponents}. */
|
|
72
100
|
export interface ImportedComponentModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/components/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAMH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/components/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAMH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,SAAS,CAAC;IACrB,0HAA0H;IAC1H,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,0GAA0G;IAC1G,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC7C,oDAAoD;IACpD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACtC;AAED,6FAA6F;AAC7F,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAuDD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,uBAAuB,EAAE,GAAG;IAC9E,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC7C,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B,CAkCA;AA6BD;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,wBAAwB,CAAC,CAsCnC"}
|
|
@@ -47,16 +47,29 @@ import type { BuildParamValue } from "../build-params.js";
|
|
|
47
47
|
export type FoldedEntity = [name: string, entity: Declarable | CompositeInstance];
|
|
48
48
|
export type FoldFileResult = {
|
|
49
49
|
ok: true;
|
|
50
|
+
/**
|
|
51
|
+
* The `Declarable`/`CompositeInstance` subset of {@link
|
|
52
|
+
* FoldFileResult.exportedValues} — how many resources this file
|
|
53
|
+
* contributed, for the `[fold:fold] x.ts — N resource(s)` decision
|
|
54
|
+
* line. chant #1112: NOT what discovery collects from. Collection
|
|
55
|
+
* reads `exportedValues`, so that `./collect.ts` stays the single
|
|
56
|
+
* owner of which exports become entities — see {@link
|
|
57
|
+
* applyResolvedValue}.
|
|
58
|
+
*/
|
|
50
59
|
entities: FoldedEntity[];
|
|
51
60
|
/**
|
|
52
61
|
* chant #1020 — EVERY exported name's fully-resolved value, not just
|
|
53
|
-
* the `Declarable`/`CompositeInstance` ones
|
|
54
|
-
* plain value folds too (a string, a number, a plain object)
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
62
|
+
* the `Declarable`/`CompositeInstance` ones also listed in `entities`:
|
|
63
|
+
* a plain value folds too (a string, a number, a plain object). A
|
|
64
|
+
* successful fold means `scanExports` recognized every export the file
|
|
65
|
+
* has (anything else disqualifies the whole file), so this IS the
|
|
66
|
+
* file's complete export namespace — the same table the run path gets
|
|
67
|
+
* from actually importing it. Two consumers: `discover()` passes it
|
|
68
|
+
* straight to `collectEntities` (chant #1112), and another file's
|
|
69
|
+
* cross-file reference resolves against it — see `buildExternals`
|
|
70
|
+
* below and the module doc on `planFoldTaint` for why a
|
|
71
|
+
* resource/composite value here MUST be the exact same object every
|
|
72
|
+
* referencing file sees.
|
|
60
73
|
*/
|
|
61
74
|
exportedValues: Map<string, unknown>;
|
|
62
75
|
/**
|
|
@@ -147,9 +160,58 @@ export interface FoldSession {
|
|
|
147
160
|
* doesn't use build-time parameters pays nothing extra here.
|
|
148
161
|
*/
|
|
149
162
|
readonly buildParams?: Readonly<Record<string, BuildParamValue>>;
|
|
163
|
+
/**
|
|
164
|
+
* chant #1063 — the exact package specifiers of the lexicons LOADED for
|
|
165
|
+
* this build (`@intentius/chant-lexicon-aws`, …), derived from the lexicon
|
|
166
|
+
* names the build already resolved (`resolveProjectLexicons` ->
|
|
167
|
+
* `loadPlugins`, see ../cli/plugins.ts). This is the entire allowlist
|
|
168
|
+
* {@link buildExternals} will follow a bare import specifier into — see
|
|
169
|
+
* {@link activeLexiconPackage} for why the set is matched by TEXT and
|
|
170
|
+
* built from names the build already knows, rather than by resolving
|
|
171
|
+
* specifiers to find out what they are.
|
|
172
|
+
*
|
|
173
|
+
* Empty when the caller supplied no lexicon list, which disables
|
|
174
|
+
* lexicon-package resolution entirely rather than falling back to
|
|
175
|
+
* something more permissive: "an active lexicon of this build" is the
|
|
176
|
+
* boundary, and a build that can't say what its lexicons are hasn't
|
|
177
|
+
* established one.
|
|
178
|
+
*/
|
|
179
|
+
readonly lexiconPackages: ReadonlySet<string>;
|
|
180
|
+
/**
|
|
181
|
+
* chant #1093 — this build asked for the #1045 sandbox
|
|
182
|
+
* (`DiscoveryOptions.sandbox`, `chant build --sandbox`), so fold must not
|
|
183
|
+
* import or invoke a module the CLI process isn't already trusted to
|
|
184
|
+
* execute. See {@link isTrustedExecutableBinding} for what that allowlist
|
|
185
|
+
* is and {@link sandboxedExecutionRefusal} for what happens at each site
|
|
186
|
+
* that would otherwise execute one.
|
|
187
|
+
*
|
|
188
|
+
* `false` (the default, plain `--fold`) leaves every resolution path
|
|
189
|
+
* exactly as it was: fold already trusts the code enough to fall back to
|
|
190
|
+
* an in-process `importModule` when it can't fold something, so gating
|
|
191
|
+
* only the fold half would buy nothing there.
|
|
192
|
+
*/
|
|
193
|
+
readonly sandbox: boolean;
|
|
150
194
|
}
|
|
151
|
-
/**
|
|
152
|
-
|
|
195
|
+
/**
|
|
196
|
+
* chant #1063 — the package specifier a lexicon NAME (`"aws"`, `"gitlab"`)
|
|
197
|
+
* is installed under. The one naming convention the whole CLI already
|
|
198
|
+
* depends on: `loadPlugin(name)` imports exactly this
|
|
199
|
+
* (../cli/plugins.ts), `detectLexicons` scans source for exactly this
|
|
200
|
+
* (../detectLexicon.ts), and `chant init` writes exactly this into
|
|
201
|
+
* package.json.
|
|
202
|
+
*/
|
|
203
|
+
export declare function lexiconPackageName(lexiconName: string): string;
|
|
204
|
+
/**
|
|
205
|
+
* Create a fresh, empty {@link FoldSession}.
|
|
206
|
+
*
|
|
207
|
+
* @param lexicons - chant #1063: the lexicon NAMES active for this build
|
|
208
|
+
* (`["aws", "k8s"]`). Converted to package specifiers via
|
|
209
|
+
* {@link lexiconPackageName}; see {@link FoldSession.lexiconPackages}.
|
|
210
|
+
* @param sandbox - chant #1093: this build asked for the #1045 sandbox, so
|
|
211
|
+
* fold may not import or invoke anything outside the trusted allowlist —
|
|
212
|
+
* see {@link FoldSession.sandbox}.
|
|
213
|
+
*/
|
|
214
|
+
export declare function createFoldSession(intrinsics?: readonly IntrinsicDef[], buildParams?: Readonly<Record<string, BuildParamValue>>, lexicons?: readonly string[], sandbox?: boolean): FoldSession;
|
|
153
215
|
/**
|
|
154
216
|
* Attempt to fold one source file with zero execution of its own top-level
|
|
155
217
|
* code. Returns the folded, instantiated entities on success, or a reason
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fold-import.d.ts","sourceRoot":"","sources":["../../src/discovery/fold-import.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"fold-import.d.ts","sourceRoot":"","sources":["../../src/discovery/fold-import.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAkB3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,mGAAmG;AACnG,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,iBAAiB,CAAC,CAAC;AAElF,MAA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;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,GAAE,SAAS,YAAY,EAAO,EACxC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,EACvD,QAAQ,GAAE,SAAS,MAAM,EAAO,EAChC,OAAO,UAAQ,GACd,WAAW,CAWb;AAu5DD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,UAAU,GAAE,SAAS,YAAY,EAAO,EACxC,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,cAAc,CAAC,CAEzB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,GACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CA8EtB"}
|
|
@@ -43,15 +43,38 @@ export interface DiscoveryOptions {
|
|
|
43
43
|
* then falls back to run at the unregistered tag).
|
|
44
44
|
*/
|
|
45
45
|
intrinsics?: IntrinsicDef[];
|
|
46
|
+
/**
|
|
47
|
+
* chant #1063 — the lexicon NAMES loaded for this build (`["aws", "k8s"]`),
|
|
48
|
+
* i.e. what `resolveProjectLexicons()` returned and `loadPlugins()` then
|
|
49
|
+
* imported. Threaded into the fold session as the ALLOWLIST of packages a
|
|
50
|
+
* bare import specifier may be resolved into, so a lexicon's plain data
|
|
51
|
+
* exports (`Azure`/`GCP`'s pseudo-parameter namespaces, AWS's `S3Actions`,
|
|
52
|
+
* gitlab's `CI`) fold as identifier values instead of failing the file.
|
|
53
|
+
* Only meaningful when {@link fold} is set. Default: none — a caller that
|
|
54
|
+
* doesn't say which lexicons are active gets no bare-specifier resolution
|
|
55
|
+
* at all, rather than a looser fallback.
|
|
56
|
+
*/
|
|
57
|
+
lexicons?: readonly string[];
|
|
46
58
|
/**
|
|
47
59
|
* chant #1045 Phase 2 — opt-in: whatever would otherwise reach the
|
|
48
60
|
* in-process `importModule` step (every file, when {@link fold} isn't set;
|
|
49
61
|
* only the per-file run-fallback remainder, when it is) instead runs
|
|
50
62
|
* together, isolated, in one sandboxed child process — see
|
|
51
|
-
* `./sandbox/run.ts`.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
63
|
+
* `./sandbox/run.ts`.
|
|
64
|
+
*
|
|
65
|
+
* chant #1093 — this ALSO tightens what fold itself may do in this process.
|
|
66
|
+
* Fold executes none of a file's own top-level code, but it does import and
|
|
67
|
+
* invoke the module behind a composite factory / resource constructor /
|
|
68
|
+
* intrinsic tag; when that module is project-owned, a file reported as
|
|
69
|
+
* "folded" still ran project code here. With `sandbox` set, fold refuses
|
|
70
|
+
* any import outside chant's own packages and this build's active lexicons,
|
|
71
|
+
* and the file demotes to the (sandboxed) run path instead — so the
|
|
72
|
+
* security property is uniform: under `sandbox`, project source executes
|
|
73
|
+
* only inside the child, folded or not. Fold COVERAGE is therefore lower
|
|
74
|
+
* under `sandbox` than under plain `fold` — deliberately.
|
|
75
|
+
*
|
|
76
|
+
* Default `false` — behavior, including performance (no bundling, no child
|
|
77
|
+
* process, no IPC) and fold coverage, is unchanged unless requested.
|
|
55
78
|
*/
|
|
56
79
|
sandbox?: boolean;
|
|
57
80
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/discovery/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,M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CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAE7B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAClC,8DAA8D;IAC9D,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACvC,qDAAqD;IACrD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,mDAAmD;IACnD,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB;;;OAGG;IACH,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAyRjG"}
|
package/dist/fold/fold.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fold.d.ts","sourceRoot":"","sources":["../../src/fold/fold.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,
|
|
1
|
+
{"version":3,"file":"fold.d.ts","sourceRoot":"","sources":["../../src/fold/fold.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAaL,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAGlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH;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AI,EAAE,EAAE,CAAC,aAAa,EACtB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,EAClC,UAAU,GAAE,SAAS,YAAY,EAAO,EACxC,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GACvC,cAAc,CA6BhB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,QAAQ,SAAc,EACtB,UAAU,GAAE,SAAS,YAAY,EAAO,GACvC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CA6BjC"}
|
package/dist/fold/subset.d.ts
CHANGED
|
@@ -67,8 +67,22 @@ import { type IntrinsicDef } from "../lexicon.js";
|
|
|
67
67
|
* the flow-sensitivity note below — the single divergence in the other
|
|
68
68
|
* direction, and the one this module treats as a wart). A caller with
|
|
69
69
|
* no registry degrades to "assume it runs", which is safe and cheap to
|
|
70
|
-
* reason about
|
|
71
|
-
*
|
|
70
|
+
* reason about.
|
|
71
|
+
*
|
|
72
|
+
* chant #1106 — EVL is no longer such a caller by default. `runLint`
|
|
73
|
+
* (../lint/engine.ts) takes the active lexicons' `IntrinsicDef[]` as a
|
|
74
|
+
* parameter and puts it on `LintContext.intrinsics`
|
|
75
|
+
* (../lint/rule.ts), and EVL001 (evl001-non-literal-expression.ts)
|
|
76
|
+
* passes it straight through to `checkObjectMember`. `chant lint`'s
|
|
77
|
+
* three CLI entry points (the `lint` command's initial pass, its
|
|
78
|
+
* `--fix` re-lint, and the LSP's per-file diagnostics) all resolve the
|
|
79
|
+
* project's lexicons and thread their intrinsics through, mirroring
|
|
80
|
+
* how `discover()` has done it for the fold path since #1039/#1105 —
|
|
81
|
+
* so `chant lint` on a real project no longer flags `Ref(...)` that
|
|
82
|
+
* `fold()` accepts. A `LintContext` built without that plumbing (a
|
|
83
|
+
* unit test constructing one directly, a consumer that hasn't
|
|
84
|
+
* resolved lexicons) still gets the pre-#1044 conservative answer —
|
|
85
|
+
* that path was never wrong, only stricter than it had to be.
|
|
72
86
|
* 3. Runtime *type* of a folded value — e.g. spreading `const n = 5`
|
|
73
87
|
* (`{...n}`) is shape-valid (`n` is a plain identifier) but `fold()`
|
|
74
88
|
* rejects it once it discovers `n` folds to a number, not an object.
|
|
@@ -105,11 +119,34 @@ export declare const SUPPORTED_UNARY_OPERATORS: ReadonlySet<ts.SyntaxKind>;
|
|
|
105
119
|
export declare function isLiteralPropertyName(node: ts.PropertyName): node is ts.Identifier | ts.StringLiteral | ts.NumericLiteral;
|
|
106
120
|
/** An element-access key foldable without execution: a string or numeric LITERAL only (EVL003 semantics). */
|
|
107
121
|
export declare function isLiteralElementKey(node: ts.Expression): node is ts.StringLiteral | ts.NumericLiteral;
|
|
122
|
+
/**
|
|
123
|
+
* A short, single-line rendering of `node`'s source text for embedding in a
|
|
124
|
+
* diagnostic message — never the raw `getText()`, which reproduces the
|
|
125
|
+
* node's ENTIRE source verbatim and can span dozens of lines for a real
|
|
126
|
+
* composite call or object literal (chant #1054: a fold fallback reason that
|
|
127
|
+
* embeds one of these buries the actual error after it, and breaks any
|
|
128
|
+
* line-oriented consumer of `[fold:run]` output). Internal whitespace
|
|
129
|
+
* (including newlines) collapses to a single space, and the result is capped
|
|
130
|
+
* to a bounded length so one pathological node can't blow out an otherwise
|
|
131
|
+
* one-line reason either.
|
|
132
|
+
*/
|
|
133
|
+
export declare function briefNodeText(node: ts.Node, maxLength?: number): string;
|
|
108
134
|
export declare function computedPropertyNameMessage(node: ts.PropertyName): string;
|
|
109
135
|
export declare function dynamicElementAccessMessage(keyNode: ts.Expression): string;
|
|
110
136
|
export declare const UNSUPPORTED_OBJECT_MEMBER_MESSAGE = "unsupported object member";
|
|
111
137
|
export declare const UNSUPPORTED_UNARY_MESSAGE = "unsupported unary";
|
|
112
138
|
export declare function unsupportedBinaryMessage(opKind: ts.SyntaxKind): string;
|
|
139
|
+
/**
|
|
140
|
+
* chant #1054 — the ONE wording for "a bare function/method call used where
|
|
141
|
+
* chant needs a value it can fold." Before this, `fold()` (this message) and
|
|
142
|
+
* `../discovery/fold-import.ts`'s `resolveCallExpression` (a top-level
|
|
143
|
+
* export's own call-as-a-value check) had each grown their own hand-written
|
|
144
|
+
* copy — "function call as a value" here, "call expression as a value"
|
|
145
|
+
* there — for the identical rejection, which meant a tool grouping fallback
|
|
146
|
+
* reasons by text had to match both to avoid silently under-counting one of
|
|
147
|
+
* them. `resolveCallExpression` now calls this function directly instead of
|
|
148
|
+
* building its own string.
|
|
149
|
+
*/
|
|
113
150
|
export declare function callExpressionMessage(node: ts.CallExpression): string;
|
|
114
151
|
export declare function unsupportedExpressionMessage(node: ts.Node): string;
|
|
115
152
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subset.d.ts","sourceRoot":"","sources":["../../src/fold/subset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"subset.d.ts","sourceRoot":"","sources":["../../src/fold/subset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AAEH,mEAAmE;AACnE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/C,uGAAuG;AACvG,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;IACd,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,0FAA0F;AAC1F,eAAO,MAAM,0BAA0B,EAAE,WA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CACjC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,UAAU,CAAC,EAAE,SAAS,YAAY,EAAE,GACnC,eAAe,GAAG,SAAS,CAiK7B"}
|
package/dist/lint/engine.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LintRule, LintDiagnostic } from "./rule.js";
|
|
2
|
+
import type { IntrinsicDef } from "../lexicon.js";
|
|
2
3
|
/**
|
|
3
4
|
* Result of a lint run, separating active diagnostics from suppressed ones.
|
|
4
5
|
*/
|
|
@@ -38,7 +39,16 @@ export declare function parseDisableComments(content: string): DisableDirective[
|
|
|
38
39
|
* @param files - Array of file paths to lint
|
|
39
40
|
* @param rules - Array of lint rules to execute
|
|
40
41
|
* @param ruleOptions - Optional map of rule ID to options object
|
|
42
|
+
* @param intrinsics - chant #1106 — the active lexicons' registered
|
|
43
|
+
* intrinsics (e.g. AWS's `Ref`, `GetAtt`), put on every file's
|
|
44
|
+
* `LintContext.intrinsics` so a rule built on `../fold/subset.ts`'s
|
|
45
|
+
* shared predicate (EVL001) answers exactly like `fold()` does for a
|
|
46
|
+
* registered, opted-in call, instead of degrading to "every call is a
|
|
47
|
+
* violation". Mirrors how `discover()` has threaded the same
|
|
48
|
+
* `IntrinsicDef[]` into the fold path since #1039/#1105. Optional and
|
|
49
|
+
* defaulting to none, so a caller that hasn't resolved a project's
|
|
50
|
+
* lexicons (a unit test, `bench.test.ts`) is unaffected.
|
|
41
51
|
* @returns LintRunResult with diagnostics and suppressed items
|
|
42
52
|
*/
|
|
43
|
-
export declare function runLint(files: string[], rules: LintRule[], ruleOptions?: Map<string, Record<string, unknown
|
|
53
|
+
export declare function runLint(files: string[], rules: LintRule[], ruleOptions?: Map<string, Record<string, unknown>>, intrinsics?: readonly IntrinsicDef[]): Promise<LintRunResult>;
|
|
44
54
|
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/lint/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAe,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/lint/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAe,MAAM,QAAQ,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,mFAAmF;IACnF,UAAU,EAAE,KAAK,CAAC,cAAc,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;IACpC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAkED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAyCxE;AAgDD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,OAAO,CAC3B,KAAK,EAAE,MAAM,EAAE,EACf,KAAK,EAAE,QAAQ,EAAE,EACjB,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAClD,UAAU,CAAC,EAAE,SAAS,YAAY,EAAE,GACnC,OAAO,CAAC,aAAa,CAAC,CAsDxB"}
|