@intentius/chant 0.22.0 → 0.24.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/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/lint.d.ts.map +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts +22 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/lsp/server.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/plugins.d.ts +8 -0
- package/dist/cli/plugins.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/config.d.ts +18 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/discovery/fold-import.d.ts +38 -8
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/index.d.ts +15 -4
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/fold/subset.d.ts +16 -2
- package/dist/fold/subset.d.ts.map +1 -1
- package/dist/lint/config.d.ts +1 -12
- package/dist/lint/config.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/project-root.d.ts +51 -0
- package/dist/project-root.d.ts.map +1 -0
- package/package.json +1 -1
- 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 +44 -41
- package/src/cli/commands/lint.test.ts +74 -0
- package/src/cli/commands/lint.ts +33 -9
- package/src/cli/handlers/build.test.ts +149 -0
- package/src/cli/handlers/build.ts +28 -8
- package/src/cli/handlers/run.test.ts +191 -5
- package/src/cli/handlers/run.ts +61 -8
- package/src/cli/lsp/server.ts +7 -2
- package/src/cli/main.test.ts +23 -0
- package/src/cli/main.ts +17 -3
- package/src/cli/plugins.ts +10 -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/config.ts +23 -0
- package/src/discovery/fold-import.ts +202 -20
- package/src/discovery/index.test.ts +131 -0
- package/src/discovery/index.ts +38 -8
- package/src/discovery/sandbox/fold-boundary.test.ts +254 -0
- package/src/fold/subset.test.ts +28 -14
- package/src/fold/subset.ts +16 -2
- package/src/lint/config.test.ts +9 -4
- package/src/lint/config.ts +7 -23
- package/src/lint/engine.ts +12 -0
- package/src/lint/policy.ts +5 -5
- 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/project-root.test.ts +105 -0
- package/src/project-root.ts +78 -0
|
@@ -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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AAW,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;AAgFlD,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>;
|
|
@@ -31,6 +32,14 @@ export declare function runOpCancel(ctx: CommandContext): Promise<number>;
|
|
|
31
32
|
* (`../../components/driver.ts`) rather than a `*.op.ts` Op. Checked first,
|
|
32
33
|
* mirroring `runGraph`'s `if (ctx.args.components) return
|
|
33
34
|
* runComponentGraph(ctx)` branch (../handlers/graph.ts).
|
|
35
|
+
*
|
|
36
|
+
* chant #1116 — `--report` with `--components` is checked and hard-errored
|
|
37
|
+
* before that dispatch. There is no preview/dry-run mode for the component
|
|
38
|
+
* driver: unlike the Op path (where `--report` reads a past Temporal run),
|
|
39
|
+
* `runOpComponents` has never read `ctx.args.report` at all, so the flag was
|
|
40
|
+
* silently ignored and the command fell through to a real dispatch — observed
|
|
41
|
+
* live reaching an actual cloud shell-out. Erroring here is the safe minimum
|
|
42
|
+
* called out on the issue; a real preview is future work.
|
|
34
43
|
*/
|
|
35
44
|
export declare function runOp(ctx: CommandContext): Promise<number>;
|
|
36
45
|
/**
|
|
@@ -64,6 +73,18 @@ export declare function runOp(ctx: CommandContext): Promise<number>;
|
|
|
64
73
|
* Opt out with `--no-release-record` or `chant.config.ts`'s
|
|
65
74
|
* `release.autoRecord: false`; the default is ON. A failed run never reaches
|
|
66
75
|
* this step, so it writes nothing.
|
|
76
|
+
*
|
|
77
|
+
* chant #1108 — resolves this invocation's declared build-time parameters
|
|
78
|
+
* (`chant.config.ts`'s `buildParams`, against `--param`/`--params-file`/a
|
|
79
|
+
* declared `env` mapping) the exact same way `chant build` does
|
|
80
|
+
* (`resolveCliBuildParams`, shared with `buildCommand`), BEFORE either the
|
|
81
|
+
* local or `--temporal` path discovers/imports any `*.component.ts` file.
|
|
82
|
+
* Before this, `params.*` (`@intentius/chant/params`) was always `{}` under
|
|
83
|
+
* this command, no matter what a component's `chant.config.ts` declared or a
|
|
84
|
+
* CI job's environment supplied — see chant #1108. `chant.config.ts` is
|
|
85
|
+
* loaded once here (with the same defensive fallback the post-run
|
|
86
|
+
* auto-release check below used to apply itself) and reused for that check,
|
|
87
|
+
* rather than loaded a second time.
|
|
67
88
|
*/
|
|
68
89
|
export declare function runOpComponents(ctx: CommandContext): Promise<number>;
|
|
69
90
|
/**
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBhE;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"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;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IAgB7F;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB3D;;;OAGG;IACH,kBAAkB,CAAC,YAAY,EAAE,mBAAmB,GAAG,IAAI;IA0C3D;;OAEG;YACW,QAAQ;IAyBtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA+BxB;;OAEG;IACH,OAAO,CAAC,WAAW;IAuCnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;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"}
|
package/dist/cli/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAsB9E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAsB9E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA+NpD;AA0ZD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5E"}
|
package/dist/cli/plugins.d.ts
CHANGED
|
@@ -32,6 +32,14 @@ export declare function loadPlugins(lexiconNames: string[]): Promise<LexiconPlug
|
|
|
32
32
|
* that never needed live module exports to begin with. This is strictly
|
|
33
33
|
* better than routing the detection through the sandbox: it removes the
|
|
34
34
|
* execution entirely rather than containing it, at no bundling/spawn cost.
|
|
35
|
+
*
|
|
36
|
+
* chant #1117 — walks up from `projectPath` to the project root
|
|
37
|
+
* (`loadChantConfigUpward`) rather than reading `projectPath` alone: `chant
|
|
38
|
+
* build src/<stack>` calls this with the stack's own subdirectory, and a
|
|
39
|
+
* project that declares `lexicons` only in its root `chant.config.ts` (never
|
|
40
|
+
* detectable by `detectLexicons()`'s import scan alone, e.g. a lexicon that's
|
|
41
|
+
* loaded but never imported by name in that particular stack's files) would
|
|
42
|
+
* otherwise silently miss it.
|
|
35
43
|
*/
|
|
36
44
|
export declare function resolveProjectLexicons(projectPath: string): Promise<string[]>;
|
|
37
45
|
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/cli/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAKjE;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA6B5E;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CA6BlF;AAED
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/cli/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAKjE;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA6B5E;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CA6BlF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAUnF"}
|
|
@@ -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,E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;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,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"}
|
package/dist/config.d.ts
CHANGED
|
@@ -280,6 +280,24 @@ export declare const DEFAULT_CHANT_CONFIG: ChantConfig;
|
|
|
280
280
|
* Returns default config if neither exists.
|
|
281
281
|
*/
|
|
282
282
|
export declare function loadChantConfig(dir: string): Promise<ResolvedConfig>;
|
|
283
|
+
/**
|
|
284
|
+
* Load project configuration by walking up from `startDir` to the project
|
|
285
|
+
* root (chant #1117), instead of trying only `startDir` itself.
|
|
286
|
+
*
|
|
287
|
+
* `chant build src/<stack>` (and anything else invoked with a subdirectory —
|
|
288
|
+
* `lint.policies`' `evaluateProjectPolicies`, `--components --generate`)
|
|
289
|
+
* builds scoped to that subdirectory, but `chant.config.ts` almost always
|
|
290
|
+
* lives at the project root, one or more levels up. Before this, callers
|
|
291
|
+
* either read `startDir` alone or bolted on a single `dirname()` fallback —
|
|
292
|
+
* fine for a one-level-deep stack, silently blind to anything deeper
|
|
293
|
+
* (loomster's `src/<stack>` layout is exactly one level too deep: `buildParams`'
|
|
294
|
+
* declared `env:` mappings never resolved, so `LOOM_TIER`/`LOOM_ENV` were inert
|
|
295
|
+
* under every `npm run synth:*` for two releases — loomster#162). Uses the
|
|
296
|
+
* same walk `chant lint`/`chant graph` already used ({@link findProjectConfig},
|
|
297
|
+
* shared with `./lint/config.ts`'s `findProjectRoot`) — one config-discovery
|
|
298
|
+
* contract for the whole CLI.
|
|
299
|
+
*/
|
|
300
|
+
export declare function loadChantConfigUpward(startDir: string): Promise<ResolvedConfig>;
|
|
283
301
|
/**
|
|
284
302
|
* Resolve the ownership marker to stamp from project config, or undefined when
|
|
285
303
|
* ownership marking is off (no `stack`, or `enabled: false`).
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAA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AAM,WAAW,uBAAuB;IACtC,gJAAgJ;IAChJ,OAAO,EAAE,OAAO,CAAC;IACjB,qIAAqI;IACrI,GAAG,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACtB,6RAA6R;IAC7R,sBAAsB,EAAE;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,uBAAuB,CAanF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAW1E"}
|
|
@@ -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
|
/**
|
|
@@ -164,6 +177,20 @@ export interface FoldSession {
|
|
|
164
177
|
* established one.
|
|
165
178
|
*/
|
|
166
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;
|
|
167
194
|
}
|
|
168
195
|
/**
|
|
169
196
|
* chant #1063 — the package specifier a lexicon NAME (`"aws"`, `"gitlab"`)
|
|
@@ -180,8 +207,11 @@ export declare function lexiconPackageName(lexiconName: string): string;
|
|
|
180
207
|
* @param lexicons - chant #1063: the lexicon NAMES active for this build
|
|
181
208
|
* (`["aws", "k8s"]`). Converted to package specifiers via
|
|
182
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}.
|
|
183
213
|
*/
|
|
184
|
-
export declare function createFoldSession(intrinsics?: readonly IntrinsicDef[], buildParams?: Readonly<Record<string, BuildParamValue>>, lexicons?: readonly string[]): FoldSession;
|
|
214
|
+
export declare function createFoldSession(intrinsics?: readonly IntrinsicDef[], buildParams?: Readonly<Record<string, BuildParamValue>>, lexicons?: readonly string[], sandbox?: boolean): FoldSession;
|
|
185
215
|
/**
|
|
186
216
|
* Attempt to fold one source file with zero execution of its own top-level
|
|
187
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;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,MAAM,MAAM,cAAc,GACtB;IACE,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"fold-import.d.ts","sourceRoot":"","sources":["../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ions {
|
|
|
60
60
|
* in-process `importModule` step (every file, when {@link fold} isn't set;
|
|
61
61
|
* only the per-file run-fallback remainder, when it is) instead runs
|
|
62
62
|
* together, isolated, in one sandboxed child process — see
|
|
63
|
-
* `./sandbox/run.ts`.
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
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.
|
|
67
78
|
*/
|
|
68
79
|
sandbox?: boolean;
|
|
69
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,MAAM,YAAY,CAAC;AAQ/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;I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C;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/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.
|
|
@@ -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,WAAW,CAAC,EAAE,CAAC,UAAU,CAchE,CAAC;AAEH,oFAAoF;AACpF,eAAO,MAA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,EAAE,GACnC,eAAe,GAAG,SAAS,CAiK7B"}
|
package/dist/lint/config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { Severity, RuleConfig } from "./rule.js";
|
|
3
|
+
export { findProjectRoot } from "../project-root.js";
|
|
3
4
|
export declare const LintConfigSchema: z.ZodObject<{
|
|
4
5
|
rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
|
|
5
6
|
error: "error";
|
|
@@ -75,18 +76,6 @@ export declare function parseRuleConfig(value: RuleConfig): ParsedRuleConfig;
|
|
|
75
76
|
* Default configuration with all rules enabled at strict preset severities
|
|
76
77
|
*/
|
|
77
78
|
export declare const DEFAULT_CONFIG: LintConfig;
|
|
78
|
-
/**
|
|
79
|
-
* Walk up from `startDir` to the nearest ancestor holding a chant project
|
|
80
|
-
* config (`chant.config.ts` or `chant.config.json`). Returns that directory, or
|
|
81
|
-
* `startDir` unchanged when none is found before the filesystem root.
|
|
82
|
-
*
|
|
83
|
-
* Linting a subpath (`chant graph src --format ir`, `chant lint src/lib`) must
|
|
84
|
-
* still see the project-root config: its `lint.overrides` globs are written
|
|
85
|
-
* project-root-relative (`src/lib/**`), and a rule set scoped only to the lint
|
|
86
|
-
* arg would silently drop them. Config discovery therefore anchors on the
|
|
87
|
-
* project root, not the path being linted.
|
|
88
|
-
*/
|
|
89
|
-
export declare function findProjectRoot(startDir: string): string;
|
|
90
79
|
/**
|
|
91
80
|
* Load lint configuration from a directory.
|
|
92
81
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lint/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"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E,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAkBpG"}
|
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"}
|