@intentius/chant 0.26.0 → 0.27.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.
@@ -23,11 +23,12 @@ export interface BuildOptions {
23
23
  */
24
24
  env?: string;
25
25
  /**
26
- * chant #1022 (epic #1019) — opt-in: fold source modules statically
27
- * instead of importing/running them (`chant build --fold`). Falls back to
28
- * run per-file for anything the folder can't represent. Merged with the
29
- * project's `chant.config.ts` `build.fold` via {@link resolveFoldEnabled}
30
- * this flag, when true, always wins for the invocation.
26
+ * chant #1022/#1134 (epic #1019) — fold source modules statically instead
27
+ * of importing/running them; the DEFAULT build path since #1134. Falls
28
+ * back to run per-file for anything the folder can't represent. Tri-state:
29
+ * `--fold` → true, `--no-fold` false, unset → the project config /
30
+ * default via {@link resolveFoldEnabled}. An explicit flag always wins for
31
+ * the invocation, in either direction.
31
32
  */
32
33
  fold?: boolean;
33
34
  /**
@@ -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;AAUnD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,2CAA2C;IAC3C,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,8CAA8C;IAC9C,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAA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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,CA+Y9E;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":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAoE9E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAoQpD;AA2aD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5E"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAqE9E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAwQpD;AA8aD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5E"}
package/dist/config.d.ts CHANGED
@@ -147,12 +147,12 @@ export interface ChantConfig {
147
147
  */
148
148
  build?: {
149
149
  /**
150
- * Opt-in: fold source modules statically instead of importing/running
151
- * them, falling back to run per-file for anything the folder can't
152
- * represent (composite factory calls, non-`new` exports, …). Default
153
- * `false`. The `--fold` CLI flag overrides this per-invocation (a flag
154
- * of `true` always wins; the flag cannot force fold *off* when this is
155
- * `true`). See {@link resolveFoldEnabled}.
150
+ * Fold source modules statically instead of importing/running them,
151
+ * falling back to run per-file for anything the folder can't represent.
152
+ * DEFAULT `true` since chant #1134 — set `false` to make this project
153
+ * run every module (the pre-#1134 behavior). The `--fold`/`--no-fold`
154
+ * CLI flags override this per-invocation in either direction. See
155
+ * {@link resolveFoldEnabled}.
156
156
  */
157
157
  fold?: boolean;
158
158
  /**
@@ -322,10 +322,13 @@ export declare function resolveOwnershipMarker(config: ChantConfig): OwnershipMa
322
322
  export declare function resolveAutoReleaseDisabled(config: ChantConfig, cliFlag?: boolean): boolean;
323
323
  /**
324
324
  * Whether `chant build` should use the fold path (#1022, epic #1019)
325
- * instead of running each source module. Opt-in: off unless the CLI's
326
- * `--fold` flag was passed (`cliFlag`) or the project config sets
327
- * `build.fold: true` the flag always wins for that one invocation,
328
- * regardless of config.
325
+ * instead of running each source module. DEFAULT-ON since chant #1134: fold
326
+ * is the build path unless something turns it off. Precedence, most specific
327
+ * wins: an explicit CLI flag (`--fold` true, `--no-fold` false, arriving
328
+ * here as `cliFlag`), then the project config's `build.fold`, then the
329
+ * default of `true`. The epic's evidence base for the flip — coverage,
330
+ * byte-identity, and the sandbox execution boundary — is recorded on #1134
331
+ * and #1090.
329
332
  */
330
333
  export declare function resolveFoldEnabled(config: ChantConfig, cliFlag?: boolean): boolean;
331
334
  /**
@@ -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,M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CAAC,EAAE,OAAO,GAAG,OAAO,CAIlF;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAGrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAE1F;AAED;;;;;;;;;;;GAWG;AACH,MAAM,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Declarative infrastructure-as-code toolkit — TypeScript on Node.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -322,7 +322,7 @@ export const testEntity = {
322
322
  expect(byName.get("env")).toEqual({ name: "env", value: "from-file", source: "params-file" });
323
323
  });
324
324
 
325
- test("--fold is opt-in: omitting it builds via the unchanged run path", async () => {
325
+ test("fold is the default (#1134): omitting the flag folds; --no-fold restores the run path", async () => {
326
326
  await writeFile(
327
327
  join(testDir, "test.infra.ts"),
328
328
  `
@@ -345,7 +345,21 @@ export const testEntity = {
345
345
  expect(result.success).toBe(true);
346
346
  expect(result.resourceCount).toBe(1);
347
347
  const anyFoldLine = errorSpy.mock.calls.map((call) => String(call[0])).some((line) => line.includes("[fold:"));
348
- expect(anyFoldLine).toBe(false);
348
+ expect(anyFoldLine).toBe(true);
349
+
350
+ errorSpy.mockClear();
351
+ const runResult = await buildCommand({
352
+ path: testDir,
353
+ format: "json",
354
+ serializers: [mockSerializer],
355
+ fold: false,
356
+ });
357
+ expect(runResult.success).toBe(true);
358
+ expect(runResult.resourceCount).toBe(1);
359
+ const anyFoldLineOff = errorSpy.mock.calls
360
+ .map((call) => String(call[0]))
361
+ .some((line) => line.includes("[fold:"));
362
+ expect(anyFoldLineOff).toBe(false);
349
363
  } finally {
350
364
  errorSpy.mockRestore();
351
365
  }
@@ -35,11 +35,12 @@ export interface BuildOptions {
35
35
  */
36
36
  env?: string;
37
37
  /**
38
- * chant #1022 (epic #1019) — opt-in: fold source modules statically
39
- * instead of importing/running them (`chant build --fold`). Falls back to
40
- * run per-file for anything the folder can't represent. Merged with the
41
- * project's `chant.config.ts` `build.fold` via {@link resolveFoldEnabled}
42
- * this flag, when true, always wins for the invocation.
38
+ * chant #1022/#1134 (epic #1019) — fold source modules statically instead
39
+ * of importing/running them; the DEFAULT build path since #1134. Falls
40
+ * back to run per-file for anything the folder can't represent. Tri-state:
41
+ * `--fold` → true, `--no-fold` false, unset → the project config /
42
+ * default via {@link resolveFoldEnabled}. An explicit flag always wins for
43
+ * the invocation, in either direction.
43
44
  */
44
45
  fold?: boolean;
45
46
 
@@ -147,9 +148,9 @@ export async function buildCommand(options: BuildOptions): Promise<BuildResult>
147
148
  const configDir = loaded.configPath ? dirname(loaded.configPath) : infraPath;
148
149
  const policies = config.lint?.policies ?? [];
149
150
 
150
- // #1022 — opt-in fold path: the CLI flag wins over `chant.config.ts`'s
151
- // `build.fold`, which wins over the (unchanged) default of running every
152
- // module.
151
+ // #1022/#1134 — fold is the default build path: an explicit CLI flag
152
+ // (--fold/--no-fold) wins over `chant.config.ts`'s `build.fold`, which
153
+ // wins over the default of `true`.
153
154
  const fold = resolveFoldEnabled(config, options.fold);
154
155
 
155
156
  // #1045 Phase 2 — opt-in sandboxed execution of run-fallback files (or,
@@ -4,6 +4,12 @@ import { parseArgs, waitForStreamDrain } from "./main";
4
4
  import { resolveCommand, type CommandDef, type ParsedArgs } from "./registry";
5
5
 
6
6
  describe("parseArgs", () => {
7
+ test("--fold and --no-fold set the tri-state fold option (#1134)", () => {
8
+ expect(parseArgs(["build", "src"]).fold).toBeUndefined();
9
+ expect(parseArgs(["build", "src", "--fold"]).fold).toBe(true);
10
+ expect(parseArgs(["build", "src", "--no-fold"]).fold).toBe(false);
11
+ });
12
+
7
13
  test("parses command as first positional arg", () => {
8
14
  const result = parseArgs(["build"]);
9
15
  expect(result.command).toBe("build");
package/src/cli/main.ts CHANGED
@@ -69,6 +69,7 @@ const BOOLEAN_FLAGS = new Set([
69
69
  "--bump",
70
70
  "--no-release-record",
71
71
  "--fold",
72
+ "--no-fold",
72
73
  "--sandbox",
73
74
  ]);
74
75
 
@@ -294,6 +295,10 @@ export function parseArgs(args: string[]): ParsedArgs {
294
295
  result.noReleaseRecord = true;
295
296
  } else if (arg === "--fold") {
296
297
  result.fold = true;
298
+ } else if (arg === "--no-fold") {
299
+ // chant #1134 — fold is the default build path; this is the explicit
300
+ // opt-out, and like --fold it beats chant.config.ts's build.fold.
301
+ result.fold = false;
297
302
  } else if (arg === "--sandbox") {
298
303
  result.sandbox = true;
299
304
  } else if (arg === "--param") {
@@ -514,8 +519,11 @@ Options:
514
519
  to run per-file for anything else outside the fold
515
520
  subset (a cross-file-only reference, a re-export,
516
521
  \`export default\`, ...). Logs which path each file
517
- took. Default: off (also settable via
518
- chant.config.ts's build.fold: true; #1022)
522
+ took. DEFAULT since #1134 this flag forces it on
523
+ over a chant.config.ts \`build.fold: false\`.
524
+ --no-fold (build) Opt out of folding for this invocation: every
525
+ source module is imported and run, the pre-#1134
526
+ behavior. Beats chant.config.ts's build.fold.
519
527
  --sandbox (build) Run run-fallback source files (or every
520
528
  file, without --fold) together, isolated, in one
521
529
  sandboxed child process instead of in-process
@@ -1,5 +1,11 @@
1
1
  import { describe, test, expect, beforeEach, afterEach } from "vitest";
2
- import { loadChantConfig, DEFAULT_CHANT_CONFIG, resolveAutoReleaseDisabled, resolveSbomFormat } from "./config";
2
+ import {
3
+ loadChantConfig,
4
+ DEFAULT_CHANT_CONFIG,
5
+ resolveAutoReleaseDisabled,
6
+ resolveFoldEnabled,
7
+ resolveSbomFormat,
8
+ } from "./config";
3
9
  import { writeFileSync, mkdirSync, rmSync } from "fs";
4
10
  import { join } from "path";
5
11
 
@@ -128,6 +134,27 @@ describe("loadChantConfig", () => {
128
134
  });
129
135
  });
130
136
 
137
+ describe("resolveFoldEnabled (#1134 — fold is the default build path)", () => {
138
+ test("default (no flag, no config) → fold ON", () => {
139
+ expect(resolveFoldEnabled({})).toBe(true);
140
+ });
141
+
142
+ test("config build.fold: false turns it off; true keeps it on", () => {
143
+ expect(resolveFoldEnabled({ build: { fold: false } })).toBe(false);
144
+ expect(resolveFoldEnabled({ build: { fold: true } })).toBe(true);
145
+ expect(resolveFoldEnabled({ build: {} })).toBe(true);
146
+ });
147
+
148
+ test("--fold (flag true) beats config false", () => {
149
+ expect(resolveFoldEnabled({ build: { fold: false } }, true)).toBe(true);
150
+ });
151
+
152
+ test("--no-fold (flag false) beats config true and the default", () => {
153
+ expect(resolveFoldEnabled({ build: { fold: true } }, false)).toBe(false);
154
+ expect(resolveFoldEnabled({}, false)).toBe(false);
155
+ });
156
+ });
157
+
131
158
  describe("resolveAutoReleaseDisabled", () => {
132
159
  test("default (no flag, no config) → not disabled", () => {
133
160
  expect(resolveAutoReleaseDisabled({})).toBe(false);
package/src/config.ts CHANGED
@@ -139,12 +139,12 @@ export interface ChantConfig {
139
139
  */
140
140
  build?: {
141
141
  /**
142
- * Opt-in: fold source modules statically instead of importing/running
143
- * them, falling back to run per-file for anything the folder can't
144
- * represent (composite factory calls, non-`new` exports, …). Default
145
- * `false`. The `--fold` CLI flag overrides this per-invocation (a flag
146
- * of `true` always wins; the flag cannot force fold *off* when this is
147
- * `true`). See {@link resolveFoldEnabled}.
142
+ * Fold source modules statically instead of importing/running them,
143
+ * falling back to run per-file for anything the folder can't represent.
144
+ * DEFAULT `true` since chant #1134 — set `false` to make this project
145
+ * run every module (the pre-#1134 behavior). The `--fold`/`--no-fold`
146
+ * CLI flags override this per-invocation in either direction. See
147
+ * {@link resolveFoldEnabled}.
148
148
  */
149
149
  fold?: boolean;
150
150
 
@@ -353,14 +353,18 @@ export function resolveAutoReleaseDisabled(config: ChantConfig, cliFlag?: boolea
353
353
 
354
354
  /**
355
355
  * Whether `chant build` should use the fold path (#1022, epic #1019)
356
- * instead of running each source module. Opt-in: off unless the CLI's
357
- * `--fold` flag was passed (`cliFlag`) or the project config sets
358
- * `build.fold: true` the flag always wins for that one invocation,
359
- * regardless of config.
356
+ * instead of running each source module. DEFAULT-ON since chant #1134: fold
357
+ * is the build path unless something turns it off. Precedence, most specific
358
+ * wins: an explicit CLI flag (`--fold` true, `--no-fold` false, arriving
359
+ * here as `cliFlag`), then the project config's `build.fold`, then the
360
+ * default of `true`. The epic's evidence base for the flip — coverage,
361
+ * byte-identity, and the sandbox execution boundary — is recorded on #1134
362
+ * and #1090.
360
363
  */
361
364
  export function resolveFoldEnabled(config: ChantConfig, cliFlag?: boolean): boolean {
362
- if (cliFlag) return true;
363
- return config.build?.fold === true;
365
+ if (cliFlag !== undefined) return cliFlag;
366
+ if (config.build?.fold !== undefined) return config.build.fold;
367
+ return true;
364
368
  }
365
369
 
366
370
  /**