@canonical/summon-core 0.37.0 → 0.40.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/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/layer/componentLayer.js +84 -0
- package/dist/esm/layer/componentLayer.js.map +1 -0
- package/dist/esm/layer/index.js +2 -0
- package/dist/esm/layer/index.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/layer/componentLayer.d.ts +43 -0
- package/dist/types/layer/componentLayer.d.ts.map +1 -0
- package/dist/types/layer/index.d.ts +2 -0
- package/dist/types/layer/index.d.ts.map +1 -0
- package/package.json +8 -8
package/dist/esm/index.js
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Cascade layers (which component tier a package's stylesheets sit in)
|
|
12
|
+
// =============================================================================
|
|
13
|
+
export { COMPONENT_TIER_LAYERS, componentLayerFor, GLOBAL_COMPONENT_LAYER, isSubTierLayer, } from "./layer/index.js";
|
|
10
14
|
export { applyStamp, createGeneratorStamp, createStampOnEffectStart, runTaskWithStamp, } from "./stamp/index.js";
|
|
11
15
|
export { CONFIRM_ANSWER_KEY, collectAnswers, execute, GENERATOR_CANCELLED, GENERATOR_INVALID_ANSWER, invalidAnswersError, isInvalidAnswersError, validateAnswers, } from "./execute/index.js";
|
|
12
16
|
export { answerPromptWithDefaults, autoPrompt, inkPrompt, MISSING_REQUIRED_ANSWER, mcpPrompt, missingRequiredError, } from "./prompt/index.js";
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["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AAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which cascade layer a package's component stylesheets sit in.
|
|
3
|
+
*
|
|
4
|
+
* `@canonical/styles` orders the component tiers in one statement, and the
|
|
5
|
+
* order follows the design system's own tier tree, flat: `ds.components.global`
|
|
6
|
+
* below `ds.components.sites`, `documentation`, `stores` and `apps`, and a
|
|
7
|
+
* sub-tier package — one product's own components — in a layer of its own named
|
|
8
|
+
* after it, `ds.components.apps-lxd`. Flat rather than nested because a nested
|
|
9
|
+
* layer sorts inside its parent, so `ds.components.apps.lxd` would sit below
|
|
10
|
+
* every rule written directly in `ds.components.apps`, which is the opposite of
|
|
11
|
+
* what a product tier needs.
|
|
12
|
+
*
|
|
13
|
+
* The mapping is by package name because that is the one identifier a generator
|
|
14
|
+
* always has, and because it is the name the tier tree is keyed on. Getting it
|
|
15
|
+
* from the package rather than from the author is the point: a wrong layer is
|
|
16
|
+
* silent, and reintroduces the source-order race the layers exist to end.
|
|
17
|
+
*
|
|
18
|
+
* Owner ruling 2026-09-06 (VC.31). `ds.components.app` is retired.
|
|
19
|
+
*/
|
|
20
|
+
/** The root of the component tiers; the layer a tierless package falls back to. */
|
|
21
|
+
export const GLOBAL_COMPONENT_LAYER = "ds.components.global";
|
|
22
|
+
/**
|
|
23
|
+
* The second level of the tier tree, as pragma's order statement names it, and
|
|
24
|
+
* the package-name stems that map to each. `global` has no sub-tiers: a
|
|
25
|
+
* `ds-global-*` package is another slice of the global tier, not a product.
|
|
26
|
+
*/
|
|
27
|
+
const TIERS = [
|
|
28
|
+
{ tier: "global", stems: ["ds-global"], subTiers: false },
|
|
29
|
+
{ tier: "sites", stems: ["ds-sites", "ds-site"], subTiers: true },
|
|
30
|
+
{
|
|
31
|
+
tier: "documentation",
|
|
32
|
+
stems: ["ds-documentation", "ds-docs"],
|
|
33
|
+
subTiers: true,
|
|
34
|
+
},
|
|
35
|
+
{ tier: "stores", stems: ["ds-stores", "ds-store"], subTiers: true },
|
|
36
|
+
{ tier: "apps", stems: ["ds-apps", "ds-app"], subTiers: true },
|
|
37
|
+
];
|
|
38
|
+
/** Every second-level layer name, in the order pragma's statement names them. */
|
|
39
|
+
export const COMPONENT_TIER_LAYERS = TIERS.map(({ tier }) => `ds.components.${tier}`);
|
|
40
|
+
/**
|
|
41
|
+
* The layer for a package's component stylesheets, from its name.
|
|
42
|
+
*
|
|
43
|
+
* The stem may be the whole name after the scope and framework prefix
|
|
44
|
+
* (`@canonical/react-ds-app` → `ds.components.apps`) or carry a product suffix
|
|
45
|
+
* (`@canonical/react-ds-app-lxd` → `ds.components.apps-lxd`). A name that
|
|
46
|
+
* matches no tier is global, which is both the safe default and what the
|
|
47
|
+
* untiered packages are.
|
|
48
|
+
*
|
|
49
|
+
* Pure.
|
|
50
|
+
*/
|
|
51
|
+
export function componentLayerFor(packageName) {
|
|
52
|
+
if (!packageName)
|
|
53
|
+
return GLOBAL_COMPONENT_LAYER;
|
|
54
|
+
// The stem starts at the first `ds-`; anything before it is the scope and the
|
|
55
|
+
// framework (`@canonical/react-`, `@canonical/svelte-`).
|
|
56
|
+
const match = /(?:^|[@/-])(ds-[a-z0-9-]*)$/.exec(packageName);
|
|
57
|
+
if (!match)
|
|
58
|
+
return GLOBAL_COMPONENT_LAYER;
|
|
59
|
+
const stem = match[1];
|
|
60
|
+
for (const { tier, stems, subTiers } of TIERS) {
|
|
61
|
+
for (const s of stems) {
|
|
62
|
+
if (stem === s)
|
|
63
|
+
return `ds.components.${tier}`;
|
|
64
|
+
if (subTiers && stem.startsWith(`${s}-`)) {
|
|
65
|
+
return `ds.components.${tier}-${stem.slice(s.length + 1)}`;
|
|
66
|
+
}
|
|
67
|
+
// A tier without sub-tiers absorbs its suffixed packages: ds-global-form
|
|
68
|
+
// is more of the global tier, not a product of its own.
|
|
69
|
+
if (!subTiers && stem.startsWith(`${s}-`))
|
|
70
|
+
return `ds.components.${tier}`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return GLOBAL_COMPONENT_LAYER;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* True when the layer is a sub-tier — one product's own — rather than one of
|
|
77
|
+
* the five the styles package's order statement already names. A sub-tier
|
|
78
|
+
* package declares its own layer, first in its CSS entry, because no statement
|
|
79
|
+
* upstream of it can know the name.
|
|
80
|
+
*/
|
|
81
|
+
export function isSubTierLayer(layer) {
|
|
82
|
+
return !COMPONENT_TIER_LAYERS.includes(layer);
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=componentLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentLayer.js","sourceRoot":"","sources":["../../../src/layer/componentLayer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,KAAK,GAAG;IACZ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;IACzD,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;IACjE;QACE,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC;QACtC,QAAQ,EAAE,IAAI;KACf;IACD,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;IACpE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;CACtD,CAAC;AAEX,iFAAiF;AACjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,GAAG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ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,qBAAqB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
export type { AnyGenerator, ForbidReserved, GeneratorDefinition, GeneratorMeta, PromptDefinition, ReservedOption, StampConfig, } from "./types/index.js";
|
|
11
|
+
export { COMPONENT_TIER_LAYERS, componentLayerFor, GLOBAL_COMPONENT_LAYER, isSubTierLayer, } from "./layer/index.js";
|
|
11
12
|
export type { RunTaskWithStampOptions } from "./stamp/index.js";
|
|
12
13
|
export { applyStamp, createGeneratorStamp, createStampOnEffectStart, runTaskWithStamp, } from "./stamp/index.js";
|
|
13
14
|
export type { AnswerablePrompt, ExecuteContext, GeneratorResult, } from "./execute/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,YAAY,EACV,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAM1B,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAM1B,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAO5B,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,wBAAwB,EACxB,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,SAAS,EACT,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMlD,YAAY,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,YAAY,EACV,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAg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;AAC7B,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which cascade layer a package's component stylesheets sit in.
|
|
3
|
+
*
|
|
4
|
+
* `@canonical/styles` orders the component tiers in one statement, and the
|
|
5
|
+
* order follows the design system's own tier tree, flat: `ds.components.global`
|
|
6
|
+
* below `ds.components.sites`, `documentation`, `stores` and `apps`, and a
|
|
7
|
+
* sub-tier package — one product's own components — in a layer of its own named
|
|
8
|
+
* after it, `ds.components.apps-lxd`. Flat rather than nested because a nested
|
|
9
|
+
* layer sorts inside its parent, so `ds.components.apps.lxd` would sit below
|
|
10
|
+
* every rule written directly in `ds.components.apps`, which is the opposite of
|
|
11
|
+
* what a product tier needs.
|
|
12
|
+
*
|
|
13
|
+
* The mapping is by package name because that is the one identifier a generator
|
|
14
|
+
* always has, and because it is the name the tier tree is keyed on. Getting it
|
|
15
|
+
* from the package rather than from the author is the point: a wrong layer is
|
|
16
|
+
* silent, and reintroduces the source-order race the layers exist to end.
|
|
17
|
+
*
|
|
18
|
+
* Owner ruling 2026-09-06 (VC.31). `ds.components.app` is retired.
|
|
19
|
+
*/
|
|
20
|
+
/** The root of the component tiers; the layer a tierless package falls back to. */
|
|
21
|
+
export declare const GLOBAL_COMPONENT_LAYER = "ds.components.global";
|
|
22
|
+
/** Every second-level layer name, in the order pragma's statement names them. */
|
|
23
|
+
export declare const COMPONENT_TIER_LAYERS: string[];
|
|
24
|
+
/**
|
|
25
|
+
* The layer for a package's component stylesheets, from its name.
|
|
26
|
+
*
|
|
27
|
+
* The stem may be the whole name after the scope and framework prefix
|
|
28
|
+
* (`@canonical/react-ds-app` → `ds.components.apps`) or carry a product suffix
|
|
29
|
+
* (`@canonical/react-ds-app-lxd` → `ds.components.apps-lxd`). A name that
|
|
30
|
+
* matches no tier is global, which is both the safe default and what the
|
|
31
|
+
* untiered packages are.
|
|
32
|
+
*
|
|
33
|
+
* Pure.
|
|
34
|
+
*/
|
|
35
|
+
export declare function componentLayerFor(packageName: string | undefined): string;
|
|
36
|
+
/**
|
|
37
|
+
* True when the layer is a sub-tier — one product's own — rather than one of
|
|
38
|
+
* the five the styles package's order statement already names. A sub-tier
|
|
39
|
+
* package declares its own layer, first in its CSS entry, because no statement
|
|
40
|
+
* upstream of it can know the name.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isSubTierLayer(layer: string): boolean;
|
|
43
|
+
//# sourceMappingURL=componentLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentLayer.d.ts","sourceRoot":"","sources":["../../../src/layer/componentLayer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,mFAAmF;AACnF,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAmB7D,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,UAEjC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAmBzE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,qBAAqB,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.40.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"test:vitest:watch": "vitest"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@biomejs/biome": "2.
|
|
66
|
-
"@canonical/biome-config": "^0.
|
|
67
|
-
"@canonical/typescript-config": "^0.
|
|
68
|
-
"@canonical/webarchitect": "^0.
|
|
65
|
+
"@biomejs/biome": "2.5.13",
|
|
66
|
+
"@canonical/biome-config": "^0.40.0",
|
|
67
|
+
"@canonical/typescript-config": "^0.40.0",
|
|
68
|
+
"@canonical/webarchitect": "^0.40.0",
|
|
69
69
|
"@types/bun": "^1.3.10",
|
|
70
70
|
"@types/ejs": "^3.1.5",
|
|
71
71
|
"@types/node": "^26.0.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"vitest": "^4.0.18"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@canonical/task": "^0.
|
|
79
|
-
"@canonical/utils": "^0.
|
|
78
|
+
"@canonical/task": "^0.40.0",
|
|
79
|
+
"@canonical/utils": "^0.40.0",
|
|
80
80
|
"chalk": "^6.0.0",
|
|
81
81
|
"commander": "^15.0.0",
|
|
82
82
|
"ejs": "^5.0.0",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"engines": {
|
|
89
89
|
"node": ">=22.18 <23 || >=23.6"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "9136b71518260c5f33e7619da087198c931e4c13"
|
|
92
92
|
}
|