@canonical/summon-core 0.34.0 → 0.35.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/esm/discovery/discoverGeneratorTree.js +14 -10
- package/dist/esm/discovery/discoverGeneratorTree.js.map +1 -1
- package/dist/esm/execute/collectAnswers.js +21 -16
- package/dist/esm/execute/collectAnswers.js.map +1 -1
- package/dist/esm/execute/execute.js +67 -22
- package/dist/esm/execute/execute.js.map +1 -1
- package/dist/esm/execute/index.js +1 -1
- package/dist/esm/execute/index.js.map +1 -1
- package/dist/esm/execute/validateAnswers.js +19 -5
- package/dist/esm/execute/validateAnswers.js.map +1 -1
- package/dist/esm/format/effects.js +197 -51
- package/dist/esm/format/effects.js.map +1 -1
- package/dist/esm/format/formatFlagName.js +17 -0
- package/dist/esm/format/formatFlagName.js.map +1 -0
- package/dist/esm/format/index.js +19 -1
- package/dist/esm/format/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/projection/answers.js +84 -0
- package/dist/esm/projection/answers.js.map +1 -0
- package/dist/esm/projection/buildOptionInfo.js +77 -0
- package/dist/esm/projection/buildOptionInfo.js.map +1 -0
- package/dist/esm/projection/commander/configureGroupedHelp.js +39 -0
- package/dist/esm/projection/commander/configureGroupedHelp.js.map +1 -0
- package/dist/esm/projection/commander/emitToProcess.js +15 -0
- package/dist/esm/projection/commander/emitToProcess.js.map +1 -0
- package/dist/esm/projection/commander/index.js +20 -0
- package/dist/esm/projection/commander/index.js.map +1 -0
- package/dist/esm/projection/commander/registerGeneratorCommands.js +222 -0
- package/dist/esm/projection/commander/registerGeneratorCommands.js.map +1 -0
- package/dist/esm/projection/decideInteraction.js +73 -0
- package/dist/esm/projection/decideInteraction.js.map +1 -0
- package/dist/esm/projection/extractAnswers.js +52 -0
- package/dist/esm/projection/extractAnswers.js.map +1 -0
- package/dist/esm/projection/groupedHelp.js +74 -0
- package/dist/esm/projection/groupedHelp.js.map +1 -0
- package/dist/esm/projection/index.js +26 -0
- package/dist/esm/projection/index.js.map +1 -0
- package/dist/esm/projection/kebab.js +18 -0
- package/dist/esm/projection/kebab.js.map +1 -0
- package/dist/esm/projection/projectGenerator.js +46 -0
- package/dist/esm/projection/projectGenerator.js.map +1 -0
- package/dist/esm/projection/types.js +16 -0
- package/dist/esm/projection/types.js.map +1 -0
- package/dist/esm/projection/usage.js +144 -0
- package/dist/esm/projection/usage.js.map +1 -0
- package/dist/esm/prompt/answerPromptWithDefaults.js +7 -5
- package/dist/esm/prompt/answerPromptWithDefaults.js.map +1 -1
- package/dist/esm/prompt/autoPrompt.js +2 -3
- package/dist/esm/prompt/autoPrompt.js.map +1 -1
- package/dist/esm/prompt/ink/mount.js +1 -1
- package/dist/esm/prompt/ink/mount.js.map +1 -1
- package/dist/esm/prompt/ink/session.js +21 -6
- package/dist/esm/prompt/ink/session.js.map +1 -1
- package/dist/esm/prompt/inkPrompt.js +10 -1
- package/dist/esm/prompt/inkPrompt.js.map +1 -1
- package/dist/esm/prompt/mcpPrompt.js +1 -1
- package/dist/esm/prompt/mcpPrompt.js.map +1 -1
- package/dist/esm/stamp/applyStamp.js +50 -52
- package/dist/esm/stamp/applyStamp.js.map +1 -1
- package/dist/esm/stamp/createStampOnEffectStart.js +4 -1
- package/dist/esm/stamp/createStampOnEffectStart.js.map +1 -1
- package/dist/esm/stamp/runTaskWithStamp.js +8 -9
- package/dist/esm/stamp/runTaskWithStamp.js.map +1 -1
- package/dist/esm/template/index.js +2 -0
- package/dist/esm/template/index.js.map +1 -1
- package/dist/esm/template/loadTemplate.js +43 -0
- package/dist/esm/template/loadTemplate.js.map +1 -0
- package/dist/esm/template/prependStamp.js +11 -8
- package/dist/esm/template/prependStamp.js.map +1 -1
- package/dist/esm/template/rawFile.js +25 -0
- package/dist/esm/template/rawFile.js.map +1 -0
- package/dist/esm/template/tasks/template.js +12 -3
- package/dist/esm/template/tasks/template.js.map +1 -1
- package/dist/esm/template/tasks/templateDir.js +5 -0
- package/dist/esm/template/tasks/templateDir.js.map +1 -1
- package/dist/esm/testing/conformance/fixtures.js +0 -2
- package/dist/esm/testing/conformance/fixtures.js.map +1 -1
- package/dist/esm/testing/conformance/flagizeAnswers.js +91 -0
- package/dist/esm/testing/conformance/flagizeAnswers.js.map +1 -0
- package/dist/esm/testing/conformance/index.js +1 -0
- package/dist/esm/testing/conformance/index.js.map +1 -1
- package/dist/esm/testing/index.js +1 -1
- package/dist/esm/testing/index.js.map +1 -1
- package/dist/types/discovery/discoverGeneratorTree.d.ts +3 -3
- package/dist/types/discovery/discoverGeneratorTree.d.ts.map +1 -1
- package/dist/types/execute/collectAnswers.d.ts +4 -3
- package/dist/types/execute/collectAnswers.d.ts.map +1 -1
- package/dist/types/execute/execute.d.ts +27 -1
- package/dist/types/execute/execute.d.ts.map +1 -1
- package/dist/types/execute/index.d.ts +1 -1
- package/dist/types/execute/index.d.ts.map +1 -1
- package/dist/types/execute/validateAnswers.d.ts.map +1 -1
- package/dist/types/format/effects.d.ts +61 -7
- package/dist/types/format/effects.d.ts.map +1 -1
- package/dist/types/format/formatFlagName.d.ts +14 -0
- package/dist/types/format/formatFlagName.d.ts.map +1 -0
- package/dist/types/format/index.d.ts +20 -1
- package/dist/types/format/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/projection/answers.d.ts +54 -0
- package/dist/types/projection/answers.d.ts.map +1 -0
- package/dist/types/projection/buildOptionInfo.d.ts +25 -0
- package/dist/types/projection/buildOptionInfo.d.ts.map +1 -0
- package/dist/types/projection/commander/configureGroupedHelp.d.ts +29 -0
- package/dist/types/projection/commander/configureGroupedHelp.d.ts.map +1 -0
- package/dist/types/projection/commander/emitToProcess.d.ts +10 -0
- package/dist/types/projection/commander/emitToProcess.d.ts.map +1 -0
- package/dist/types/projection/commander/index.d.ts +21 -0
- package/dist/types/projection/commander/index.d.ts.map +1 -0
- package/dist/types/projection/commander/registerGeneratorCommands.d.ts +95 -0
- package/dist/types/projection/commander/registerGeneratorCommands.d.ts.map +1 -0
- package/dist/types/projection/decideInteraction.d.ts +70 -0
- package/dist/types/projection/decideInteraction.d.ts.map +1 -0
- package/dist/types/projection/extractAnswers.d.ts +23 -0
- package/dist/types/projection/extractAnswers.d.ts.map +1 -0
- package/dist/types/projection/groupedHelp.d.ts +25 -0
- package/dist/types/projection/groupedHelp.d.ts.map +1 -0
- package/dist/types/projection/index.d.ts +29 -0
- package/dist/types/projection/index.d.ts.map +1 -0
- package/dist/types/projection/kebab.d.ts +16 -0
- package/dist/types/projection/kebab.d.ts.map +1 -0
- package/dist/types/projection/projectGenerator.d.ts +22 -0
- package/dist/types/projection/projectGenerator.d.ts.map +1 -0
- package/dist/types/projection/types.d.ts +118 -0
- package/dist/types/projection/types.d.ts.map +1 -0
- package/dist/types/projection/usage.d.ts +92 -0
- package/dist/types/projection/usage.d.ts.map +1 -0
- package/dist/types/prompt/answerPromptWithDefaults.d.ts +5 -3
- package/dist/types/prompt/answerPromptWithDefaults.d.ts.map +1 -1
- package/dist/types/prompt/autoPrompt.d.ts.map +1 -1
- package/dist/types/prompt/ink/mount.d.ts.map +1 -1
- package/dist/types/prompt/ink/session.d.ts +1 -1
- package/dist/types/prompt/ink/session.d.ts.map +1 -1
- package/dist/types/prompt/inkPrompt.d.ts +7 -0
- package/dist/types/prompt/inkPrompt.d.ts.map +1 -1
- package/dist/types/stamp/applyStamp.d.ts +6 -2
- package/dist/types/stamp/applyStamp.d.ts.map +1 -1
- package/dist/types/stamp/createStampOnEffectStart.d.ts.map +1 -1
- package/dist/types/stamp/runTaskWithStamp.d.ts +3 -1
- package/dist/types/stamp/runTaskWithStamp.d.ts.map +1 -1
- package/dist/types/template/index.d.ts +4 -0
- package/dist/types/template/index.d.ts.map +1 -1
- package/dist/types/template/loadTemplate.d.ts +40 -0
- package/dist/types/template/loadTemplate.d.ts.map +1 -0
- package/dist/types/template/prependStamp.d.ts +5 -2
- package/dist/types/template/prependStamp.d.ts.map +1 -1
- package/dist/types/template/rawFile.d.ts +32 -0
- package/dist/types/template/rawFile.d.ts.map +1 -0
- package/dist/types/template/tasks/template.d.ts +8 -0
- package/dist/types/template/tasks/template.d.ts.map +1 -1
- package/dist/types/template/tasks/templateDir.d.ts.map +1 -1
- package/dist/types/template/tasks/types.d.ts +2 -0
- package/dist/types/template/tasks/types.d.ts.map +1 -1
- package/dist/types/testing/conformance/fixtures.d.ts.map +1 -1
- package/dist/types/testing/conformance/flagizeAnswers.d.ts +38 -0
- package/dist/types/testing/conformance/flagizeAnswers.d.ts.map +1 -0
- package/dist/types/testing/conformance/index.d.ts +1 -0
- package/dist/types/testing/conformance/index.d.ts.map +1 -1
- package/dist/types/testing/index.d.ts +1 -1
- package/dist/types/testing/index.d.ts.map +1 -1
- package/dist/types/types/GeneratorDefinition.d.ts +10 -1
- package/dist/types/types/GeneratorDefinition.d.ts.map +1 -1
- package/dist/types/types/ReservedOption.d.ts +1 -1
- package/dist/types/types/ReservedOption.d.ts.map +1 -1
- package/package.json +21 -8
|
@@ -6,6 +6,14 @@ import type { TemplateOptions } from "./types.js";
|
|
|
6
6
|
* When `options.content` is provided, uses it directly instead of
|
|
7
7
|
* reading from `options.source`. This supports compiled binaries
|
|
8
8
|
* where template files are embedded and pre-loaded.
|
|
9
|
+
*
|
|
10
|
+
* The silent `readFile(options.source)` fallback survives ONLY outside
|
|
11
|
+
* embedded context: once a host has injected an embedded manifest
|
|
12
|
+
* ({@link hasEmbeddedTemplates}), a content-less call FAILS with a named
|
|
13
|
+
* error instead of falling through to a disk read that would die with a raw
|
|
14
|
+
* `ENOENT … /$bunfs/…` mid-generation, after directories were already made.
|
|
15
|
+
* Source runs (empty manifest — the summon bin, tests) are byte-identical to
|
|
16
|
+
* before.
|
|
9
17
|
*/
|
|
10
18
|
export default function template(options: TemplateOptions): Task<void>;
|
|
11
19
|
//# sourceMappingURL=template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/template/tasks/template.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,IAAI,EAGV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/template/tasks/template.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,IAAI,EAGV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,CAqBrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateDir.d.ts","sourceRoot":"","sources":["../../../../src/template/tasks/templateDir.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,IAAI,EAAQ,MAAM,iBAAiB,CAAC;AAInE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAerD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"templateDir.d.ts","sourceRoot":"","sources":["../../../../src/template/tasks/templateDir.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,IAAI,EAAQ,MAAM,iBAAiB,CAAC;AAInE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAerD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,CA2C3E"}
|
|
@@ -13,6 +13,8 @@ export interface TemplateOptions {
|
|
|
13
13
|
* Use this when the template is embedded or pre-loaded (e.g. compiled binaries).
|
|
14
14
|
*/
|
|
15
15
|
content?: string;
|
|
16
|
+
/** Applied to the rendered content before it is written. */
|
|
17
|
+
transform?: (content: string) => string;
|
|
16
18
|
}
|
|
17
19
|
export interface TemplateDirOptions {
|
|
18
20
|
/** Source directory containing templates */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/template/tasks/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,kDAAkD;IAClD,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/template/tasks/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,kDAAkD;IAClD,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC;AAED,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IACxD,iDAAiD;IACjD,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../src/testing/conformance/fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACrD;AASD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,kBAAkB,
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../src/testing/conformance/fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACrD;AASD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,kBAAkB,EAwC7D,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAIxD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turn a conformance fixture's ANSWER SET into the CLI argument vector that
|
|
3
|
+
* expresses it — the projection's flag grammar, driven backwards. The
|
|
4
|
+
* cross-CLI matrix derives each producer's argv from the SAME answers with
|
|
5
|
+
* this one function, so the two binaries are always handed identical inputs
|
|
6
|
+
* (modulo the mount prefix) and an argv hand-drift cannot fake parity.
|
|
7
|
+
*
|
|
8
|
+
* Rules (the inverse of `extractAnswers` + `buildOptionInfo`):
|
|
9
|
+
* - an answer equal to its prompt's default is OMITTED (it could never be
|
|
10
|
+
* expressed explicitly for a confirm anyway — the equality trick);
|
|
11
|
+
* - a confirm answers with `buildOptionInfo`'s PRIMARY registered long
|
|
12
|
+
* form — `--<kebab>` for `true` (registered exactly when the default is
|
|
13
|
+
* not `true`; a default-`true` confirm answered `true` was omitted
|
|
14
|
+
* above), `--no-<kebab>` for `false` (registered ONLY for a default-
|
|
15
|
+
* `true` confirm). PRECONDITION: a confirm answered `false` must
|
|
16
|
+
* declare `default: true` — a default-less (or default-`false`,
|
|
17
|
+
* non-omitted) confirm has NO registered spelling for `false`, and this
|
|
18
|
+
* helper THROWS naming the prompt rather than hand the matrix an argv
|
|
19
|
+
* both binaries reject as an unknown option;
|
|
20
|
+
* - the positional prompt's answer is emitted positionally, first;
|
|
21
|
+
* - text/select answers become `--<kebab>=<value>`;
|
|
22
|
+
* - a multiselect becomes `--<kebab>=<comma,list>`.
|
|
23
|
+
*/
|
|
24
|
+
import type { PromptLike } from "../../projection/types.js";
|
|
25
|
+
/**
|
|
26
|
+
* Express an answer set as CLI arguments (positional first, flags in prompt
|
|
27
|
+
* order).
|
|
28
|
+
*
|
|
29
|
+
* @param prompts - The command's prompts (live or projected).
|
|
30
|
+
* @param answers - The answers to express.
|
|
31
|
+
* @returns The argument vector.
|
|
32
|
+
* @throws If a confirm answered `false` declares no `default: true` — no
|
|
33
|
+
* registered spelling exists for that answer (the module header's
|
|
34
|
+
* PRECONDITION), so the matrix must fail loudly rather than hand both
|
|
35
|
+
* binaries an argv they reject as an unknown option.
|
|
36
|
+
*/
|
|
37
|
+
export declare function flagizeAnswers(prompts: readonly PromptLike[], answers: Readonly<Record<string, unknown>>): string[];
|
|
38
|
+
//# sourceMappingURL=flagizeAnswers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagizeAnswers.d.ts","sourceRoot":"","sources":["../../../../src/testing/conformance/flagizeAnswers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAc5D;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACzC,MAAM,EAAE,CA0CV"}
|
|
@@ -14,6 +14,7 @@ export type { TreeDiff } from "./diffTrees.js";
|
|
|
14
14
|
export { diffTrees, formatTreeDiff, isIdentical } from "./diffTrees.js";
|
|
15
15
|
export type { ConformanceFixture } from "./fixtures.js";
|
|
16
16
|
export { CONFORMANCE_FIXTURES, fixture } from "./fixtures.js";
|
|
17
|
+
export { flagizeAnswers } from "./flagizeAnswers.js";
|
|
17
18
|
export type { ReferenceRun } from "./produceReference.js";
|
|
18
19
|
export { produceReference } from "./produceReference.js";
|
|
19
20
|
export type { TreeSnapshot } from "./snapshotTree.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/conformance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxE,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/conformance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxE,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* contract that may move faster.
|
|
8
8
|
*/
|
|
9
9
|
export type { ConformanceFixture, ReferenceRun, TreeDiff, TreeSnapshot, } from "./conformance/index.js";
|
|
10
|
-
export { CONFORMANCE_FIXTURES, diffTrees, fixture, formatTreeDiff, isIdentical, produceReference, snapshotTree, } from "./conformance/index.js";
|
|
10
|
+
export { CONFORMANCE_FIXTURES, diffTrees, fixture, flagizeAnswers, formatTreeDiff, isIdentical, produceReference, snapshotTree, } from "./conformance/index.js";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,SAAS,EACT,OAAO,EACP,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,YAAY,GACb,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,SAAS,EACT,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,YAAY,GACb,MAAM,wBAAwB,CAAC"}
|
|
@@ -11,7 +11,16 @@ export default interface GeneratorDefinition<TAnswers = Record<string, unknown>>
|
|
|
11
11
|
meta: GeneratorMeta;
|
|
12
12
|
/** Prompts to collect answers from user */
|
|
13
13
|
prompts: PromptDefinition[];
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Pure function that returns a Task describing the generation.
|
|
16
|
+
*
|
|
17
|
+
* The returned task must be RE-INTERPRETABLE: compose it from combinators
|
|
18
|
+
* (`sequence_`, `when`, `flatMap`, …), never from a single-use `gen()` —
|
|
19
|
+
* a gen() task closes over one iterator, and the runners interpret a build
|
|
20
|
+
* more than once (dry-run preview, undo collection with backtracking).
|
|
21
|
+
* `execute()` shields callers by invoking `generate` freshly per
|
|
22
|
+
* interpretation, but direct drivers of one build get truncated re-drives.
|
|
23
|
+
*/
|
|
15
24
|
generate: (answers: TAnswers) => Task<void>;
|
|
16
25
|
}
|
|
17
26
|
//# sourceMappingURL=GeneratorDefinition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorDefinition.d.ts","sourceRoot":"","sources":["../../../src/types/GeneratorDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,mBAAmB,CAC1C,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAElC,yCAAyC;IACzC,IAAI,EAAE,aAAa,CAAC;IACpB,2CAA2C;IAC3C,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B
|
|
1
|
+
{"version":3,"file":"GeneratorDefinition.d.ts","sourceRoot":"","sources":["../../../src/types/GeneratorDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,mBAAmB,CAC1C,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAElC,yCAAyC;IACzC,IAAI,EAAE,aAAa,CAAC;IACpB,2CAA2C;IAC3C,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B;;;;;;;;;OASG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;CAC7C"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Reserved option names for CLI global options.
|
|
3
3
|
* Generator prompts MUST NOT use these names.
|
|
4
4
|
*/
|
|
5
|
-
type ReservedOption = "help" | "version" | "dryRun" | "dry-run" | "yes" | "output" | "preview" | "generators" | "run" | "init" | "llm" | "format" | "showFiles" | "show-files" | "verbose" | "generatedStamp";
|
|
5
|
+
type ReservedOption = "help" | "version" | "dryRun" | "dry-run" | "yes" | "output" | "preview" | "generators" | "run" | "init" | "llm" | "format" | "showFiles" | "show-files" | "verbose" | "generatedStamp" | "generated-stamp";
|
|
6
6
|
export type { ReservedOption as default };
|
|
7
7
|
//# sourceMappingURL=ReservedOption.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReservedOption.d.ts","sourceRoot":"","sources":["../../../src/types/ReservedOption.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,KAAK,cAAc,GACf,MAAM,GACN,SAAS,GACT,QAAQ,GACR,SAAS,GACT,KAAK,GACL,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,KAAK,GACL,MAAM,GACN,KAAK,GACL,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,SAAS,GACT,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ReservedOption.d.ts","sourceRoot":"","sources":["../../../src/types/ReservedOption.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,KAAK,cAAc,GACf,MAAM,GACN,SAAS,GACT,QAAQ,GACR,SAAS,GACT,KAAK,GACL,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,KAAK,GACL,MAAM,GACN,KAAK,GACL,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,YAAY,EAAE,cAAc,IAAI,OAAO,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/summon-core",
|
|
3
3
|
"description": "Code generation framework: generator definitions, templates, stamps, discovery. Built on @canonical/task.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.35.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
"./testing": {
|
|
14
14
|
"types": "./dist/types/testing/index.d.ts",
|
|
15
15
|
"import": "./dist/esm/testing/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./format": {
|
|
18
|
+
"types": "./dist/types/format/index.d.ts",
|
|
19
|
+
"import": "./dist/esm/format/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./projection": {
|
|
22
|
+
"types": "./dist/types/projection/index.d.ts",
|
|
23
|
+
"import": "./dist/esm/projection/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./projection/commander": {
|
|
26
|
+
"types": "./dist/types/projection/commander/index.d.ts",
|
|
27
|
+
"import": "./dist/esm/projection/commander/index.js"
|
|
16
28
|
}
|
|
17
29
|
},
|
|
18
30
|
"files": [
|
|
@@ -51,26 +63,27 @@
|
|
|
51
63
|
},
|
|
52
64
|
"devDependencies": {
|
|
53
65
|
"@biomejs/biome": "2.4.9",
|
|
54
|
-
"@canonical/biome-config": "^0.
|
|
55
|
-
"@canonical/typescript-config": "^0.
|
|
56
|
-
"@canonical/webarchitect": "^0.
|
|
66
|
+
"@canonical/biome-config": "^0.35.0",
|
|
67
|
+
"@canonical/typescript-config": "^0.35.0",
|
|
68
|
+
"@canonical/webarchitect": "^0.35.0",
|
|
57
69
|
"@types/bun": "^1.3.10",
|
|
58
70
|
"@types/ejs": "^3.1.5",
|
|
59
|
-
"@types/node": "^
|
|
71
|
+
"@types/node": "^26.0.0",
|
|
60
72
|
"@types/react": "^19.2.14",
|
|
61
73
|
"ink-testing-library": "^4.0.0",
|
|
62
74
|
"typescript": "^5.9.3",
|
|
63
75
|
"vitest": "^4.0.18"
|
|
64
76
|
},
|
|
65
77
|
"dependencies": {
|
|
66
|
-
"@canonical/task": "^0.
|
|
67
|
-
"@canonical/utils": "^0.
|
|
78
|
+
"@canonical/task": "^0.35.0",
|
|
79
|
+
"@canonical/utils": "^0.35.0",
|
|
68
80
|
"chalk": "^5.6.2",
|
|
81
|
+
"commander": "^14.0.3",
|
|
69
82
|
"ejs": "^5.0.0",
|
|
70
83
|
"ink": "^6.8.0",
|
|
71
84
|
"ink-select-input": "^6.2.0",
|
|
72
85
|
"ink-text-input": "^6.0.0",
|
|
73
86
|
"react": "^19.2.4"
|
|
74
87
|
},
|
|
75
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "5198c5399ef657959272c0e35924391573d81146"
|
|
76
89
|
}
|