@astryxdesign/cli 0.7.11 → 0.7.12-canary.0840fcc
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/api/build/blocks/blocks.d.mts +41 -0
- package/api/build/blocks/blocks.mjs +118 -68
- package/api/build/kit/rank.mjs +21 -4
- package/api/build/kit/words.d.mts +1 -0
- package/api/build/kit/words.mjs +1 -1
- package/api/component/__fixtures__/resolutions/modules.txt +5 -5
- package/api/docs/_adapter.d.mts +22 -0
- package/api/docs/_adapter.mjs +81 -3
- package/api/docs/docs.doc.mjs +5 -5
- package/api/docs/docs.type.d.mts +21 -0
- package/api/docs/docs.type.mjs +11 -0
- package/api/docs/list/list.d.mts +5 -1
- package/api/docs/list/list.mjs +72 -6
- package/api/docs/node/node.mjs +2 -40
- package/api/icon/_adapter.d.mts +3 -2
- package/api/icon/_adapter.mjs +8 -2
- package/api/icon/_authoring.d.mts +1 -0
- package/api/icon/_authoring.mjs +594 -67
- package/api/icon/_default-look.d.mts +155 -0
- package/api/icon/_default-look.mjs +474 -0
- package/api/icon/_records.d.mts +1 -1
- package/api/icon/_records.mjs +1 -0
- package/api/icon/add/add.mjs +269 -43
- package/api/icon/icon.type.d.mts +46 -2
- package/api/icon/icon.type.mjs +12 -2
- package/api/icon/iconAdd.doc.mjs +2 -2
- package/api/icon/iconNewDefinition.doc.mjs +3 -2
- package/api/icon/iconNewSet.doc.mjs +4 -4
- package/api/icon/map/map.mjs +11 -4
- package/api/icon/search/search.mjs +10 -9
- package/api/index.d.mts +1 -0
- package/api/index.mjs +1 -0
- package/api/integration/add-helpers.d.mts +15 -1
- package/api/integration/add-helpers.mjs +5 -2
- package/api/integration/authoring-checks.d.mts +0 -2
- package/api/integration/authoring-checks.mjs +1 -6
- package/api/logger.mjs +2 -1
- package/api/render/_adapter.mjs +9 -0
- package/api/render/render.doc.mjs +3 -3
- package/api/render/render.type.d.mts +1 -1
- package/api/render/render.type.mjs +1 -1
- package/api/search/ORDERING.md +3 -0
- package/api/search/_adapter.d.mts +32 -3
- package/api/search/_adapter.mjs +50 -22
- package/api/search/_fit-order.d.mts +47 -0
- package/api/search/_fit-order.mjs +257 -0
- package/api/search/_main-searcher.mjs +15 -5
- package/api/search/exportSearchIndex.doc.d.mts +10 -0
- package/api/search/exportSearchIndex.doc.mjs +58 -0
- package/api/search/rankSearchIndex.doc.d.mts +10 -0
- package/api/search/rankSearchIndex.doc.mjs +79 -0
- package/api/search/search-index.d.mts +44 -0
- package/api/search/search-index.mjs +270 -0
- package/api/search/search.type.d.mts +28 -0
- package/api/search/search.type.mjs +17 -0
- package/api/swizzle/_adapter.d.mts +1 -0
- package/api/swizzle/_adapter.mjs +4 -1
- package/api/swizzle/_moduleGraph.d.mts +178 -0
- package/api/swizzle/_moduleGraph.mjs +903 -0
- package/api/swizzle/copy/copy.d.mts +2 -43
- package/api/swizzle/copy/copy.mjs +287 -315
- package/api/swizzle/swizzle.d.mts +0 -2
- package/api/swizzle/swizzle.doc.mjs +13 -4
- package/api/swizzle/swizzle.mjs +3 -7
- package/api/swizzle/swizzle.type.d.mts +7 -1
- package/api/swizzle/swizzle.type.mjs +4 -2
- package/api/template/template.mjs +1 -0
- package/assets/discover/official-packages.json +36 -0
- package/assets/docs/browser-support.doc.mjs +2 -2
- package/assets/docs/styling-overview.doc.mjs +6 -2
- package/assets/docs/tree/icon-sets.doc.mjs +13 -7
- package/assets/docs/tree/render-pages.doc.mjs +3 -3
- package/assets/docs/tree/tailwind.doc.mjs +41 -1
- package/assets/docs/tree/type-scale.doc.mjs +19 -2
- package/assets/templates/blocks/components/Calendar/useCalendarConstraintsHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Calendar/useCalendarConstraintsHookUsage.tsx +146 -0
- package/assets/templates/blocks/components/Calendar/useCalendarNavigationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Calendar/useCalendarNavigationHookUsage.tsx +173 -0
- package/assets/templates/blocks/components/Hooks/useInputStatusIconHookUsage.tsx +1 -0
- package/assets/templates/blocks/components/Hooks/useInteractiveRoleHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Hooks/useInteractiveRoleHookUsage.tsx +56 -0
- package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.doc.mjs +2 -2
- package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.tsx +66 -10
- package/assets/templates/blocks/components/Link/useLinkifyHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Link/useLinkifyHookUsage.tsx +39 -0
- package/assets/templates/blocks/components/PowerSearch/usePowerSearchConfigHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/PowerSearch/usePowerSearchConfigHookUsage.tsx +83 -0
- package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.tsx +41 -0
- package/assets/templates/blocks/components/Table/TableRowIndexTable.doc.mjs +1 -1
- package/assets/templates/blocks/components/Table/TableRowIndexTable.tsx +2 -2
- package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.tsx +97 -0
- package/assets/templates/pages/course-detail/page.tsx +699 -0
- package/assets/templates/pages/course-detail/template.doc.mjs +37 -0
- package/assets/templates/pages/file-explorer/page.tsx +103 -79
- package/assets/templates/pages/table-filter/page.tsx +15 -23
- package/assets/templates/pages/table-grouped/page.tsx +160 -232
- package/assets/templates/pages/table-grouped/template.doc.mjs +0 -2
- package/assets/templates/pages/table-inbox/page.tsx +3 -6
- package/assets/templates/pages/theme-showcase/page.tsx +724 -792
- package/assets/templates/pages/theme-showcase/template.doc.mjs +4 -5
- package/assets/templates/themes/butter/butterTheme.ts +2 -2
- package/assets/templates/themes/gothic/gothicTheme.ts +16 -0
- package/assets/templates/themes/matcha/matchaTheme.ts +1 -1
- package/assets/templates/themes/neutral/neutralTheme.ts +6 -0
- package/assets/templates/themes/stone/stoneTheme.ts +1 -1
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/y2k/y2kTheme.ts +2 -2
- package/authoring/doctypes/template/type.ts +1 -0
- package/clients/cli/commands/docs.doc.mjs +5 -1
- package/clients/cli/commands/docs.mjs +30 -2
- package/clients/cli/commands/experimental/icon.mjs +56 -14
- package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +2 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +2 -2
- package/clients/cli/commands/experimental-render.doc.mjs +1 -1
- package/clients/cli/commands/swizzle.doc.mjs +12 -3
- package/clients/cli/commands/swizzle.mjs +33 -9
- package/clients/cli/lib/resolve-theme.mjs +16 -7
- package/foundation/discovery/component-loader.d.mts +1 -1
- package/foundation/discovery/doc-types.mjs +9 -2
- package/foundation/discovery/hook-discovery.mjs +31 -8
- package/foundation/discovery/icon-ranking.d.mts +27 -3
- package/foundation/discovery/icon-ranking.mjs +125 -8
- package/foundation/discovery/icon-set-checks.mjs +44 -35
- package/foundation/discovery/icon-set-discovery.d.mts +13 -0
- package/foundation/discovery/icon-set-discovery.mjs +25 -0
- package/foundation/discovery/icon-set-writer.d.mts +258 -20
- package/foundation/discovery/icon-set-writer.mjs +785 -87
- package/foundation/discovery/module-exports.d.mts +3 -2
- package/foundation/discovery/module-exports.mjs +167 -37
- package/foundation/doc-compiler/import.d.mts +5 -1
- package/foundation/doc-compiler/import.mjs +40 -6
- package/foundation/fs/import-url.d.mts +20 -0
- package/foundation/fs/import-url.mjs +22 -0
- package/foundation/fs/module-loader.d.mts +24 -3
- package/foundation/fs/module-loader.mjs +69 -47
- package/foundation/fs/paths.d.mts +2 -1
- package/foundation/fs/paths.mjs +3 -4
- package/foundation/render/charts.d.mts +59 -0
- package/foundation/render/charts.mjs +216 -0
- package/foundation/render/embedded-imports.d.mts +7 -7
- package/foundation/render/embedded-imports.mjs +63 -54
- package/foundation/render/page-host.d.mts +4 -0
- package/foundation/render/page-host.mjs +45 -0
- package/foundation/render/page-worker.mjs +350 -57
- package/foundation/render/render-page.d.mts +11 -6
- package/foundation/render/render-page.mjs +164 -54
- package/foundation/render/ts-paths.d.mts +63 -0
- package/foundation/render/ts-paths.mjs +138 -0
- package/foundation/response/error-codes.doc.mjs +3 -3
- package/foundation/response/error-codes.mjs +3 -2
- package/foundation/text/levenshtein.d.mts +6 -1
- package/foundation/text/levenshtein.mjs +25 -9
- package/foundation/text/shell-arg.d.mts +14 -0
- package/foundation/text/shell-arg.mjs +17 -0
- package/foundation/text/suggest-order.d.mts +8 -1
- package/foundation/text/suggest-order.mjs +72 -6
- package/package.json +7 -6
|
@@ -6,7 +6,8 @@ export const doc = {
|
|
|
6
6
|
name: 'Theme Showcase',
|
|
7
7
|
displayName: 'Theme Showcase',
|
|
8
8
|
description:
|
|
9
|
-
'
|
|
9
|
+
'Multi-surface comparison shell: preview palettes, typography, icons and control states across a storefront, checkout, chat and inventory on one responsive canvas. A theme preview and design-system showcase, with an embeddable content view for an existing app shell.',
|
|
10
|
+
category: 'Shell - Top Nav',
|
|
10
11
|
keywords: [
|
|
11
12
|
'theme',
|
|
12
13
|
'tokens',
|
|
@@ -16,10 +17,8 @@ export const doc = {
|
|
|
16
17
|
'design system preview',
|
|
17
18
|
],
|
|
18
19
|
isReady: true,
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
// No `category` — it's hidden from the overview gallery (the only consumer
|
|
22
|
-
// of `category`), and 'Showcase' isn't part of the TemplateCategory taxonomy.
|
|
20
|
+
// The standalone entry demonstrates an application shell; the named preview
|
|
21
|
+
// composes into its host without nesting AppShell. Keep it out of the gallery.
|
|
23
22
|
isHiddenFromOverview: true,
|
|
24
23
|
icons: {
|
|
25
24
|
Banknote: 'money',
|
|
@@ -260,7 +260,7 @@ export const butterTheme = defineTheme({
|
|
|
260
260
|
'--color-tint-hover': [neutral.light[0], neutral.dark[100]],
|
|
261
261
|
|
|
262
262
|
// Typography override
|
|
263
|
-
'--text-supporting-size': '
|
|
263
|
+
'--text-supporting-size': '0.75rem', // 12px at the default root size
|
|
264
264
|
|
|
265
265
|
// Element sizes — slightly taller defaults so the new input padding
|
|
266
266
|
// (--spacing-2 block) has room to breathe.
|
|
@@ -394,8 +394,8 @@ export const butterTheme = defineTheme({
|
|
|
394
394
|
// Radius intentionally not pinned, so buttons keep core's
|
|
395
395
|
// `var(--_button-radius, --radius-element)`: standalone buttons stay 8px,
|
|
396
396
|
// while the chat composer (which sets --_button-radius) rounds them fully.
|
|
397
|
+
// Inline padding only. Button sets its own block padding and height.
|
|
397
398
|
base: {
|
|
398
|
-
paddingBlock: 'var(--spacing-3)',
|
|
399
399
|
paddingInline: 'var(--spacing-4)',
|
|
400
400
|
},
|
|
401
401
|
'variant:secondary': SECONDARY_BUTTON,
|
|
@@ -395,6 +395,22 @@ export const gothicTheme = defineTheme({
|
|
|
395
395
|
},
|
|
396
396
|
},
|
|
397
397
|
|
|
398
|
+
// Gothic's accent text and icons are one light color. On a media surface
|
|
399
|
+
// they follow that surface's accent, so a dark surface inside a light one
|
|
400
|
+
// gets its light accent back.
|
|
401
|
+
onDark: {
|
|
402
|
+
tokens: {
|
|
403
|
+
'--color-text-accent': 'var(--color-accent)',
|
|
404
|
+
'--color-icon-accent': 'var(--color-accent)',
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
onLight: {
|
|
408
|
+
tokens: {
|
|
409
|
+
'--color-text-accent': 'var(--color-accent)',
|
|
410
|
+
'--color-icon-accent': 'var(--color-accent)',
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
|
|
398
414
|
icons: gothicIconRegistry,
|
|
399
415
|
});
|
|
400
416
|
|
|
@@ -97,7 +97,7 @@ export const matchaTheme = defineTheme({
|
|
|
97
97
|
|
|
98
98
|
// Text
|
|
99
99
|
'--color-text-primary': [neutral.light[20], neutral.dark[75]],
|
|
100
|
-
'--color-text-secondary': [neutral.light[
|
|
100
|
+
'--color-text-secondary': [neutral.light[30], neutral.dark[60]],
|
|
101
101
|
'--color-text-disabled': [neutral.light[75], neutral.dark[30]],
|
|
102
102
|
'--color-text-accent': [neutral.light[20], neutral.dark[75]],
|
|
103
103
|
'--color-on-dark': neutral.light[100],
|
|
@@ -361,7 +361,13 @@ export const neutralTheme = defineTheme({
|
|
|
361
361
|
padding: 'var(--spacing-1)',
|
|
362
362
|
},
|
|
363
363
|
},
|
|
364
|
+
// An unselected label sits on the translucent track, which lifts the
|
|
365
|
+
// page under it. In dark mode secondary text falls under 4.5:1 on the
|
|
366
|
+
// track over the surface, so it takes the same next stop.
|
|
364
367
|
'segmented-control-item': {
|
|
368
|
+
base: {
|
|
369
|
+
'--color-text-secondary': `light-dark(${neutral.light[30]}, ${neutral.dark[80]})`,
|
|
370
|
+
},
|
|
365
371
|
'size:sm': {
|
|
366
372
|
height: 'calc(var(--size-element-sm) - 8px)',
|
|
367
373
|
},
|
|
@@ -240,7 +240,7 @@ export const stoneTheme = defineTheme({
|
|
|
240
240
|
'--color-tint-hover': [neutral.light[0], neutral.dark[100]],
|
|
241
241
|
|
|
242
242
|
// Typography override
|
|
243
|
-
'--text-supporting-size': '
|
|
243
|
+
'--text-supporting-size': '0.75rem', // 12px at the default root size
|
|
244
244
|
|
|
245
245
|
// Categorical
|
|
246
246
|
// Light mode pairs pastel stop 90 surfaces with stop 30 foregrounds.
|
|
@@ -15,7 +15,7 @@ export const y2kPaletteRefs = {
|
|
|
15
15
|
dark: {20: '#2a3600', 65: '#95b041', 75: '#b5d263', 80: '#c5e17a'},
|
|
16
16
|
},
|
|
17
17
|
neutral: {
|
|
18
|
-
light: {15: '#2d241b', 20: '#382e24', 30: '#4f453b', 40: '#675d52', 80: '#d1c5b8', 85: '#dfd5c9', 90: '#f1e6db', 95: '#fff6ed', 100: '#ffffff'},
|
|
18
|
+
light: {15: '#2d241b', 20: '#382e24', 30: '#4f453b', 35: '#5a5146', 40: '#675d52', 80: '#d1c5b8', 85: '#dfd5c9', 90: '#f1e6db', 95: '#fff6ed', 100: '#ffffff'},
|
|
19
19
|
dark: {0: '#000000', 5: '#0e0f1a', 10: '#16182b', 20: '#1f2238', 25: '#2c3048', 35: '#4a4f6b', 45: '#636889', 70: '#a6acd6', 85: '#d0d4eb', 90: '#dfe2f3', 95: '#edeffc'},
|
|
20
20
|
},
|
|
21
21
|
orange: {
|
|
@@ -182,7 +182,7 @@ export const y2kTheme = defineTheme({
|
|
|
182
182
|
|
|
183
183
|
// Text
|
|
184
184
|
'--color-text-primary': [neutral.light[15], neutral.dark[95]],
|
|
185
|
-
'--color-text-secondary': [neutral.light[
|
|
185
|
+
'--color-text-secondary': [neutral.light[35], neutral.dark[70]],
|
|
186
186
|
'--color-text-disabled': [neutral.light[80], neutral.dark[35]],
|
|
187
187
|
'--color-text-accent': [neutral.light[15], neutral.dark[95]],
|
|
188
188
|
'--color-on-dark': neutral.light[100],
|
|
@@ -236,7 +236,7 @@ export const y2kTheme = defineTheme({
|
|
|
236
236
|
'--color-tint-hover': [neutral.light[15], neutral.dark[95]],
|
|
237
237
|
|
|
238
238
|
// Typography override
|
|
239
|
-
'--text-supporting-size': '
|
|
239
|
+
'--text-supporting-size': '0.75rem', // 12px at the default root size
|
|
240
240
|
|
|
241
241
|
// Categorical colors
|
|
242
242
|
'--color-background-green': [green.light[80], green.dark[80]],
|
|
@@ -186,6 +186,7 @@ export type TemplateCategory =
|
|
|
186
186
|
| 'Content - Order Detail'
|
|
187
187
|
| 'Content - Product Detail'
|
|
188
188
|
| 'Content - Work Item Detail'
|
|
189
|
+
| 'Content - Course Detail'
|
|
189
190
|
| 'Content - Product List'
|
|
190
191
|
| 'Content - Documentation Catalog'
|
|
191
192
|
| 'Content - Documentation Design'
|
|
@@ -46,7 +46,7 @@ export const doc = {
|
|
|
46
46
|
flag: '--depth <levels>',
|
|
47
47
|
param: 'options.depth',
|
|
48
48
|
description:
|
|
49
|
-
'How many levels of the docs tree to read below a namespace: 0 for the namespace alone, 1 for its children (what a read without --depth shows), all for everything below it. With it, --detail sets how much of each doc below shows: brief (one line each, the default), compact (with its sections), or full',
|
|
49
|
+
'How many levels of the docs tree to read below a namespace: 0 for the namespace alone, 1 for its children (what a read without --depth shows), all for everything below it. On the topic list, where a namespace otherwise lists alone, it names the docs below each one by the route that opens them, one line each. With it on a namespace read, --detail sets how much of each doc below shows: brief (one line each, the default), compact (with its sections), or full; the topic list is one line per doc whatever the detail',
|
|
50
50
|
},
|
|
51
51
|
],
|
|
52
52
|
examples: [
|
|
@@ -56,6 +56,10 @@ export const doc = {
|
|
|
56
56
|
{label: 'One section', cli: 'astryx docs theme quick-start'},
|
|
57
57
|
{label: 'The CLI docs tree', cli: 'astryx docs cli'},
|
|
58
58
|
{label: 'Every CLI doc, one line each', cli: 'astryx docs cli --depth all'},
|
|
59
|
+
{
|
|
60
|
+
label: 'Every route in the docs tree, one line each',
|
|
61
|
+
cli: 'astryx docs --depth all',
|
|
62
|
+
},
|
|
59
63
|
{
|
|
60
64
|
label: 'The integration guides as one read',
|
|
61
65
|
cli: 'astryx docs authoring --depth all --detail full',
|
|
@@ -615,6 +615,32 @@ function summarize(result) {
|
|
|
615
615
|
|
|
616
616
|
// ─── Command ─────────────────────────────────────────────────────────────────
|
|
617
617
|
|
|
618
|
+
/**
|
|
619
|
+
* Every namespace of the list and, where a `--depth` read carried them, the
|
|
620
|
+
* docs below it, in reading order and in one flat list: each row's `topic` is
|
|
621
|
+
* the route that opens it, so the depth of a row never changes how a reader
|
|
622
|
+
* uses it, and each names the package that owns it.
|
|
623
|
+
* @param {Array<import('../../../api/docs/docs.type.mjs').DocsListNamespace | import('../../../api/docs/docs.type.mjs').DocsListChild>} rows
|
|
624
|
+
* @returns {Array<{topic: string, description: string, package: string}>}
|
|
625
|
+
*/
|
|
626
|
+
function flattenNamespaces(rows) {
|
|
627
|
+
return rows.flatMap(row => [
|
|
628
|
+
{
|
|
629
|
+
topic: row.topic,
|
|
630
|
+
// An experimental doc is marked here as it is wherever else it is
|
|
631
|
+
// listed, so a reader cannot take a row of this list for a stable doc.
|
|
632
|
+
description:
|
|
633
|
+
'stability' in row &&
|
|
634
|
+
row.stability === 'experimental' &&
|
|
635
|
+
!/^experimental\b/iu.test(row.description)
|
|
636
|
+
? `[experimental] ${row.description}`
|
|
637
|
+
: row.description,
|
|
638
|
+
package: row.package,
|
|
639
|
+
},
|
|
640
|
+
...flattenNamespaces(row.children ?? []),
|
|
641
|
+
]);
|
|
642
|
+
}
|
|
643
|
+
|
|
618
644
|
/**
|
|
619
645
|
* @param {import('commander').Command} program
|
|
620
646
|
*/
|
|
@@ -703,8 +729,10 @@ export function registerDocs(program) {
|
|
|
703
729
|
// The text view mirrors the JSON list, with the docs tree's
|
|
704
730
|
// namespaces (`meta.namespaces`) first under their own heading: that
|
|
705
731
|
// is where the CLI's own docs start, and a namespace reads
|
|
706
|
-
// differently from a topic.
|
|
707
|
-
|
|
732
|
+
// differently from a topic. With --depth each branch is flattened
|
|
733
|
+
// into the same list, so every line is a route a reader can pass
|
|
734
|
+
// straight back to `docs`.
|
|
735
|
+
const namespaces = flattenNamespaces(result.meta?.namespaces ?? []);
|
|
708
736
|
const topics = result.data;
|
|
709
737
|
emit(
|
|
710
738
|
...(namespaces.length > 0
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
getCliInvocation,
|
|
21
21
|
} from '../../../../foundation/env/package-manager.mjs';
|
|
22
22
|
import {jsonOut} from '../../../../foundation/response/json.mjs';
|
|
23
|
+
import {logger} from '../../../../api/logger.mjs';
|
|
23
24
|
import {resultSet} from '../../../../foundation/debug/index.mjs';
|
|
24
25
|
import {
|
|
25
26
|
emit,
|
|
@@ -58,6 +59,20 @@ const defaultVariantText = value =>
|
|
|
58
59
|
/** @param {unknown} value */
|
|
59
60
|
const variantsText = value => (Array.isArray(value) ? value.join('/') : '');
|
|
60
61
|
|
|
62
|
+
/**
|
|
63
|
+
* The receipt line for a data file whose `module` the command rewrote after
|
|
64
|
+
* a package rename.
|
|
65
|
+
* @param {{moduleUpdate?: {previous: string, module: string}, dryRun?: boolean}} data
|
|
66
|
+
*/
|
|
67
|
+
const moduleUpdateLines = data =>
|
|
68
|
+
data.moduleUpdate
|
|
69
|
+
? [
|
|
70
|
+
text(
|
|
71
|
+
`${data.dryRun ? '[plan] Would update' : '[ok] Updated'} module to "${data.moduleUpdate.module}" (was "${data.moduleUpdate.previous}"), from the package name in package.json.`,
|
|
72
|
+
),
|
|
73
|
+
]
|
|
74
|
+
: [];
|
|
75
|
+
|
|
61
76
|
/**
|
|
62
77
|
* Register `icon` and its subcommands under the `experimental` group.
|
|
63
78
|
* @param {import('commander').Command} group the `experimental` command
|
|
@@ -140,7 +155,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
140
155
|
),
|
|
141
156
|
),
|
|
142
157
|
text(
|
|
143
|
-
`Built-in definitions are the ones every set maps. Map one: ${run} experimental icon map <definition> <icon id>`,
|
|
158
|
+
`Built-in definitions are the ones every set maps. Map one: ${run} experimental icon map <definition> <icon id> --set <set>`,
|
|
144
159
|
),
|
|
145
160
|
);
|
|
146
161
|
return answered;
|
|
@@ -157,7 +172,9 @@ export function registerExperimentalIcon(group, program) {
|
|
|
157
172
|
`${each.id}: ${each.words.join(', ')}${each.definitions.length > 0 ? ` = ${each.definitions.join(', ')}` : ''}`,
|
|
158
173
|
),
|
|
159
174
|
),
|
|
160
|
-
text(
|
|
175
|
+
text(
|
|
176
|
+
`Map one: ${run} experimental icon map <definition> <id> --set ${set}`,
|
|
177
|
+
),
|
|
161
178
|
);
|
|
162
179
|
return answered;
|
|
163
180
|
}
|
|
@@ -308,6 +325,9 @@ export function registerExperimentalIcon(group, program) {
|
|
|
308
325
|
* @param {(result: any) => void} print
|
|
309
326
|
*/
|
|
310
327
|
const run = async (call, print) => {
|
|
328
|
+
// Reading a large library reports its progress through the shared
|
|
329
|
+
// logger: on stderr in text mode, never under --json.
|
|
330
|
+
logger.setSilent(Boolean(program.opts().json));
|
|
311
331
|
let result;
|
|
312
332
|
try {
|
|
313
333
|
result = await call();
|
|
@@ -370,20 +390,24 @@ export function registerExperimentalIcon(group, program) {
|
|
|
370
390
|
(
|
|
371
391
|
/** @type {{definition: string, icon: string, previous: string | null}} */ each,
|
|
372
392
|
) =>
|
|
373
|
-
`${each.definition} = "${each.icon}"${each.previous
|
|
393
|
+
`${each.definition} = "${each.icon}"${each.previous === each.icon ? ' (unchanged)' : each.previous ? ` (was "${each.previous}")` : ' (was not mapped)'}`,
|
|
374
394
|
),
|
|
375
395
|
),
|
|
396
|
+
...moduleUpdateLines(data),
|
|
376
397
|
)
|
|
377
398
|
: emit(
|
|
399
|
+
// The entry line reads `previous` and `icon`: a write can
|
|
400
|
+
// come from a package rename alone.
|
|
378
401
|
text(
|
|
379
402
|
data.icon == null
|
|
380
|
-
? data.
|
|
403
|
+
? data.previous != null
|
|
381
404
|
? `[ok] Removed map.${data.definition} (was "${data.previous}") from ${data.file}.`
|
|
382
405
|
: `[ok] ${data.file} has no map.${data.definition}.`
|
|
383
|
-
: data.
|
|
406
|
+
: data.previous !== data.icon
|
|
384
407
|
? `[ok] map.${data.definition} = "${data.icon}" in ${data.file}${data.previous ? ` (was "${data.previous}")` : ''}.`
|
|
385
408
|
: `[ok] map.${data.definition} is already "${data.icon}".`,
|
|
386
409
|
),
|
|
410
|
+
...moduleUpdateLines(data),
|
|
387
411
|
),
|
|
388
412
|
),
|
|
389
413
|
});
|
|
@@ -424,6 +448,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
424
448
|
text(
|
|
425
449
|
`[ok] ${data.variant}: ${data.added} icons gained it${data.already > 0 ? `, ${data.already} already had it` : ''}, read from ${data.from}.`,
|
|
426
450
|
),
|
|
451
|
+
...moduleUpdateLines(data),
|
|
427
452
|
...(data.files.length > 0 ? [list(data.files)] : []),
|
|
428
453
|
...(data.missing.length > 0
|
|
429
454
|
? [
|
|
@@ -436,7 +461,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
436
461
|
return;
|
|
437
462
|
}
|
|
438
463
|
if (result.type === 'icon.definitionMatches') {
|
|
439
|
-
const {matches, newDefinition} = result.data;
|
|
464
|
+
const {matches, newDefinition, variant} = result.data;
|
|
440
465
|
emit(
|
|
441
466
|
section(
|
|
442
467
|
`Icon definitions for ${result.data.export} (${matches.length})`,
|
|
@@ -466,6 +491,13 @@ export function registerExperimentalIcon(group, program) {
|
|
|
466
491
|
),
|
|
467
492
|
]
|
|
468
493
|
: []),
|
|
494
|
+
...(variant
|
|
495
|
+
? [
|
|
496
|
+
text(
|
|
497
|
+
`The set already has this glyph in another look. Add this one as its variant: ${formatCliCommand(variant)}`,
|
|
498
|
+
),
|
|
499
|
+
]
|
|
500
|
+
: []),
|
|
469
501
|
text(
|
|
470
502
|
`All icon definitions: ${cli} docs cli/experimental/icon-definitions`,
|
|
471
503
|
),
|
|
@@ -475,10 +507,11 @@ export function registerExperimentalIcon(group, program) {
|
|
|
475
507
|
const {data} = result;
|
|
476
508
|
emit(
|
|
477
509
|
text(
|
|
478
|
-
data.
|
|
510
|
+
data.added
|
|
479
511
|
? `[ok] Added ${data.icon.export} as "${data.icon.id}"${data.variant ? ` (variant ${data.variant})` : ''}${data.definition ? `, map.${data.definition} = "${data.icon.id}"` : ''}.`
|
|
480
512
|
: `[ok] ${data.icon.export} is already "${data.icon.id}"${data.definition ? ` and map.${data.definition} names it` : ''}.`,
|
|
481
513
|
),
|
|
514
|
+
...moduleUpdateLines(data),
|
|
482
515
|
...(data.files.length > 0 ? [list(data.files)] : []),
|
|
483
516
|
...(data.note ? [text(`[next] ${data.note}`)] : []),
|
|
484
517
|
);
|
|
@@ -500,17 +533,25 @@ export function registerExperimentalIcon(group, program) {
|
|
|
500
533
|
const {root, manifest, files, written, dryRun} = data;
|
|
501
534
|
const state = dryRun ? 'plan' : written ? 'ok' : 'unchanged';
|
|
502
535
|
const refreshed = data.refreshed === true;
|
|
536
|
+
const updated = data.updated === true;
|
|
537
|
+
const What = `${what[0].toUpperCase()}${what.slice(1)}`;
|
|
503
538
|
emit(
|
|
504
539
|
section(
|
|
505
540
|
refreshed
|
|
506
541
|
? dryRun
|
|
507
542
|
? `Refresh ${what} plan`
|
|
508
|
-
: `${
|
|
509
|
-
:
|
|
510
|
-
?
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
543
|
+
: `${What} refreshed`
|
|
544
|
+
: updated
|
|
545
|
+
? dryRun
|
|
546
|
+
? `${What} update plan`
|
|
547
|
+
: written && files.length > 0
|
|
548
|
+
? `${What} updated`
|
|
549
|
+
: `${What} unchanged`
|
|
550
|
+
: dryRun
|
|
551
|
+
? `New ${what} plan`
|
|
552
|
+
: written
|
|
553
|
+
? `New ${what} added`
|
|
554
|
+
: `New ${what} unchanged`,
|
|
514
555
|
),
|
|
515
556
|
text(`[${state}] ${data.name}`),
|
|
516
557
|
// What the command did (or, in a dry run, would do): never a step
|
|
@@ -522,6 +563,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
522
563
|
: `The experimental.iconSets root ${root.path} in ${manifest} is unchanged.`
|
|
523
564
|
: `${dryRun ? 'Would update' : 'Updated'} ${manifest}.`,
|
|
524
565
|
),
|
|
566
|
+
...moduleUpdateLines(data),
|
|
525
567
|
...(files.length > 0 ? [list(files)] : []),
|
|
526
568
|
// What to do next comes before the long lists, so it never scrolls
|
|
527
569
|
// away.
|
|
@@ -542,7 +584,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
542
584
|
list(
|
|
543
585
|
data.suggestions.map(
|
|
544
586
|
each =>
|
|
545
|
-
`${each.definition} -> ${each.icon} (${each.word}): ${formatCliCommand(`astryx experimental icon map ${each.definition} ${each.icon}`)}`,
|
|
587
|
+
`${each.definition} -> ${each.icon} (${each.word}): ${formatCliCommand(`astryx experimental icon map ${each.definition} ${each.icon} --set ${data.name}`)}`,
|
|
546
588
|
),
|
|
547
589
|
),
|
|
548
590
|
]
|
|
@@ -30,7 +30,7 @@ export const doc = {
|
|
|
30
30
|
flag: '--new-definition <name>',
|
|
31
31
|
param: 'options.newDefinition',
|
|
32
32
|
description:
|
|
33
|
-
"Add your set's own definition, then map the icon to it; needs --description and --words",
|
|
33
|
+
"Add your set's own definition, named in camelCase (aiHelper) or kebab-case (ai-helper), then map the icon to it; needs --description and --words",
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
flag: '--description <text>',
|
|
@@ -18,7 +18,8 @@ export const doc = {
|
|
|
18
18
|
name: 'name',
|
|
19
19
|
param: 'name',
|
|
20
20
|
required: true,
|
|
21
|
-
description:
|
|
21
|
+
description:
|
|
22
|
+
'The definition name, in camelCase (rocketLaunch) or kebab-case (rocket-launch)',
|
|
22
23
|
},
|
|
23
24
|
],
|
|
24
25
|
options: [
|
|
@@ -11,7 +11,7 @@ export const doc = {
|
|
|
11
11
|
stability: 'experimental',
|
|
12
12
|
summary: 'Start an icon set in your integration package',
|
|
13
13
|
description:
|
|
14
|
-
"Run inside an integration package. Writes the set's folder with its descriptor, its data file, and its generated module, and declares the manifest's `experimental.iconSets` root on first use. With --from it wraps every icon component of a library, records the library and its version as the set's source, copies its license notice, and maps each Astryx icon definition whose name is an icon's id; definitions an icon only shares a word with are listed as suggestions, never written. Run it again to refresh. --variants and --default-variant declare the set's variants. Experimental: it may change or be removed in a patch release.",
|
|
14
|
+
"Run inside an integration package. Writes the set's folder with its descriptor, its data file, and its generated module, and declares the manifest's `experimental.iconSets` root on first use. With --from it wraps every icon component of a library, records the library and its version as the set's source, copies its license notice, and maps each Astryx icon definition whose name is an icon's id; definitions an icon only shares a word with are listed as suggestions, never written. A library whose export names end in looks (XOutline24WGHT500Icon) gives one icon per glyph, by its glyph id (x), in the look the default variant names, else the library's usual default. Run it again with --from to refresh. --variants and --default-variant declare the set's variants; over an existing set without --from, they, --display-name and --description update the set in place and leave its icons as they are; a set with icons changes its default variant only with --from, and only in a library whose export names encode looks. Experimental: it may change or be removed in a patch release.",
|
|
15
15
|
fn: 'iconNewSet',
|
|
16
16
|
args: [
|
|
17
17
|
{
|
|
@@ -49,7 +49,7 @@ export const doc = {
|
|
|
49
49
|
flag: '--default-variant <variant>',
|
|
50
50
|
param: 'options.defaultVariant',
|
|
51
51
|
description:
|
|
52
|
-
"With --variants: the variant each icon's own export draws (the first variant
|
|
52
|
+
"With --variants: the variant each icon's own export draws. When omitted: in a library whose export names encode looks, the look the icons draw (the library's usual default for a new set), which --variants must list; otherwise the set's current default, which --variants must list when the set has icons, else, on a set without icons, the first variant. A set with icons changes it only with --from, and only in a library whose export names encode looks",
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
flag: '--display-name <text>',
|
|
@@ -53,7 +53,7 @@ export const doc = {
|
|
|
53
53
|
{code: 0, when: 'the file was written (warnings included)'},
|
|
54
54
|
{
|
|
55
55
|
code: 1,
|
|
56
|
-
when: 'no file, a wrong extension, a missing file, a page that does not compile, has no default export, imports a package that is not installed, reads a browser API while rendering, throws, or takes over 60 seconds; a file to write outside the current folder; with --reverse, an existing output without --overwrite, a damaged embedded source, or HTML that is not an Astryx page',
|
|
56
|
+
when: 'no file, a wrong extension, a missing file, a page that does not compile, has no default export, imports a package that is not installed, reads a browser API while rendering, throws, crashes Node, or takes over 60 seconds; a file to write outside the current folder; with --reverse, an existing output without --overwrite, a damaged embedded source, or HTML that is not an Astryx page',
|
|
57
57
|
},
|
|
58
58
|
],
|
|
59
59
|
related: ['template', 'build'],
|
|
@@ -16,8 +16,17 @@ export const doc = {
|
|
|
16
16
|
summary: 'Copy component source for customization',
|
|
17
17
|
description:
|
|
18
18
|
"Ejects a component's source from the resolved @astryxdesign/core (or its owning " +
|
|
19
|
-
'integration) into your project for deep customization
|
|
20
|
-
'
|
|
19
|
+
'integration) into your project for deep customization. Every import in the copy ' +
|
|
20
|
+
'names a file the copy holds or a path the package exports: names the package ' +
|
|
21
|
+
'exports come from the package, and every internal module the component needs ' +
|
|
22
|
+
"is copied beside it in the package's folder layout. " +
|
|
23
|
+
'Tests, stories and docs are not copied. It lists the npm packages the copy imports, ' +
|
|
24
|
+
'with the ranges the owner package declares, to install if your project lacks them. ' +
|
|
25
|
+
'An output folder swizzle owns (one the copy ' +
|
|
26
|
+
'creates, an empty one, or one it marked before) gets an astryx-swizzle.json marker naming ' +
|
|
27
|
+
"each package its copies came from, so @astryxdesign/build's Babel, PostCSS and Vite " +
|
|
28
|
+
'integrations, and withAstryx() under webpack, compile the copy below your theme. ' +
|
|
29
|
+
'With no name it lists the swizzlable components. ' +
|
|
21
30
|
'An integration component that replaces a Core component is what that Core name ' +
|
|
22
31
|
'copies; --package @astryxdesign/core copies the original. --list lists Core ' +
|
|
23
32
|
'components, including one an integration replaces.',
|
|
@@ -46,7 +55,7 @@ export const doc = {
|
|
|
46
55
|
flag: '-f, --overwrite',
|
|
47
56
|
param: 'options.overwrite',
|
|
48
57
|
description:
|
|
49
|
-
|
|
58
|
+
"Replace the component's existing files. Without it, existing files fail the command with ERR_FILE_EXISTS and nothing is written. A helper an earlier swizzle wrote is reused when it is the same and is never replaced by a copy that carries it: a different one stays, and this copy writes its own under a version-suffixed name. Swizzling the component whose folder holds that helper counts it as one of that component's own files. A changed private attribute owner module, or a style module it imports, fails the command without --overwrite and is replaced with it",
|
|
50
59
|
},
|
|
51
60
|
],
|
|
52
61
|
examples: [
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file swizzle command — thin wrapper around api/swizzle.
|
|
5
5
|
*
|
|
6
|
-
* Copies a component's source into the consumer project for customization
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* commands for the caller's package manager.
|
|
6
|
+
* Copies a component's source into the consumer project for customization,
|
|
7
|
+
* with the internal modules it needs. All logic — owner resolution, the copy,
|
|
8
|
+
* StyleX detection, maintainer feedback — lives in api/swizzle; this file only
|
|
9
|
+
* parses flags, prints, and prefixes commands for the caller's package manager.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
import {jsonOut} from '../../../foundation/response/json.mjs';
|
|
@@ -85,18 +84,43 @@ export function registerSwizzle(program) {
|
|
|
85
84
|
text(`[ok] Copied ${filesCopied} files to ${outputDir}/`),
|
|
86
85
|
text(
|
|
87
86
|
[
|
|
88
|
-
`
|
|
87
|
+
`What ${ownerPackage} exports is imported from ${ownerPackage}; the internal modules the component needs are copied beside it.`,
|
|
89
88
|
'You can now customize the component source freely.',
|
|
90
89
|
].join('\n'),
|
|
91
90
|
),
|
|
92
91
|
];
|
|
93
|
-
// Files the copy wrote outside the component folder: the
|
|
94
|
-
//
|
|
92
|
+
// Files the copy wrote outside the component folder: the internal
|
|
93
|
+
// modules it needs, in the package's folder layout.
|
|
95
94
|
const shared = (result.data.files ?? []).filter(f => f.startsWith('../'));
|
|
96
95
|
if (shared.length > 0) {
|
|
97
96
|
out.push(
|
|
98
97
|
text(
|
|
99
|
-
`
|
|
98
|
+
`Copied beside it: ${shared.join(', ')} (in the package's folder layout; imported by relative path)`,
|
|
99
|
+
),
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// npm packages the copy imports, each range quoted so the list pastes
|
|
104
|
+
// safely after an install command.
|
|
105
|
+
const dependencies = Object.entries(result.data.dependencies ?? {});
|
|
106
|
+
if (dependencies.length > 0) {
|
|
107
|
+
out.push(
|
|
108
|
+
text(
|
|
109
|
+
`It imports these npm packages; install any your project lacks: ${dependencies
|
|
110
|
+
.map(([name, range]) => (range === '*' ? name : `${name}@"${range}"`))
|
|
111
|
+
.join(' ')}`,
|
|
112
|
+
),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const {marker} = result.data;
|
|
117
|
+
if (marker) {
|
|
118
|
+
const folder = marker.path.replace(/\/?astryx-swizzle\.json$/, '') || '.';
|
|
119
|
+
out.push(
|
|
120
|
+
text(
|
|
121
|
+
marker.written
|
|
122
|
+
? `Marked ${folder}/ with astryx-swizzle.json: with @astryxdesign/build's Babel, PostCSS and Vite integrations, or withAstryx() under webpack, every module under it compiles below your theme, so theme overrides reach the copy. Keep only swizzled copies there. Turbopack does not read the marker yet.`
|
|
123
|
+
: `Did not mark ${folder}/ with astryx-swizzle.json: it already holds ${(marker.found ?? []).join(', ')} and no astryx-swizzle.json. If it holds only swizzled copies, add ${marker.path} to mark it, so theme overrides reach them; keep the product's own components out of a marked folder.`,
|
|
100
124
|
),
|
|
101
125
|
);
|
|
102
126
|
}
|
|
@@ -73,11 +73,22 @@ function extractTheme(mod) {
|
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Print a theme warning as one inert line. The configured theme value and the
|
|
78
|
+
* generated record come from the checkout, so a newline, an escape sequence or
|
|
79
|
+
* a bidi override in them must not rewrite the terminal. Control and format
|
|
80
|
+
* characters print as U+FFFD.
|
|
81
|
+
* @param {string} message
|
|
82
|
+
*/
|
|
83
|
+
function warnTheme(message) {
|
|
84
|
+
console.warn(message.replace(/[\p{Cc}\p{Cf}]/gu, '\uFFFD'));
|
|
85
|
+
}
|
|
86
|
+
|
|
76
87
|
/** @param {unknown} mod @param {string} specifier */
|
|
77
88
|
function resolvedThemeData(mod, specifier) {
|
|
78
89
|
const theme = extractTheme(mod);
|
|
79
90
|
if (!theme) {
|
|
80
|
-
|
|
91
|
+
warnTheme(
|
|
81
92
|
`⚠ theme: loaded "${specifier}" but could not find a theme object`,
|
|
82
93
|
);
|
|
83
94
|
return null;
|
|
@@ -100,7 +111,7 @@ export async function resolveTheme(cwd = process.cwd()) {
|
|
|
100
111
|
const loaded = await resolveRecordedTheme(cwd);
|
|
101
112
|
if (loaded.configured) {
|
|
102
113
|
if (!loaded.module) {
|
|
103
|
-
|
|
114
|
+
warnTheme(
|
|
104
115
|
`⚠ theme: ${loaded.problem ?? `could not resolve the generated default theme (${loaded.specifier})`}`,
|
|
105
116
|
);
|
|
106
117
|
return null;
|
|
@@ -130,15 +141,13 @@ export async function resolveTheme(cwd = process.cwd()) {
|
|
|
130
141
|
if (specifier.startsWith('.') || specifier.startsWith('/')) {
|
|
131
142
|
mod = tryLoadLegacyModule(specifier, cwd);
|
|
132
143
|
if (!mod) {
|
|
133
|
-
|
|
134
|
-
`⚠ theme: could not resolve file "${specifier}" from ${cwd}`,
|
|
135
|
-
);
|
|
144
|
+
warnTheme(`⚠ theme: could not resolve file "${specifier}" from ${cwd}`);
|
|
136
145
|
return null;
|
|
137
146
|
}
|
|
138
147
|
} else if (specifier.startsWith('@')) {
|
|
139
148
|
mod = tryLoadLegacyModule(specifier, cwd);
|
|
140
149
|
if (!mod) {
|
|
141
|
-
|
|
150
|
+
warnTheme(`⚠ theme: could not resolve package "${specifier}"`);
|
|
142
151
|
return null;
|
|
143
152
|
}
|
|
144
153
|
} else {
|
|
@@ -147,7 +156,7 @@ export async function resolveTheme(cwd = process.cwd()) {
|
|
|
147
156
|
tryLoadLegacyModule(conventional, cwd) ??
|
|
148
157
|
tryLoadLegacyModule(specifier, cwd);
|
|
149
158
|
if (!mod) {
|
|
150
|
-
|
|
159
|
+
warnTheme(
|
|
151
160
|
`⚠ theme: could not resolve "${specifier}" (tried ${conventional} and ${specifier})`,
|
|
152
161
|
);
|
|
153
162
|
return null;
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
* none), and a `<topic>.doc.<lang>.mjs` overlay against
|
|
28
28
|
* `ReferenceTranslationDoc`;
|
|
29
29
|
* - themes root: `ThemeDoc`;
|
|
30
|
-
* - iconSets root: `IconSetDoc
|
|
30
|
+
* - iconSets root: `IconSetDoc`, and a set's own definition (stamped
|
|
31
|
+
* `type: 'icon-definition'`) `IconDefinitionDoc`.
|
|
31
32
|
* Every finding is a warning, names the field, and says how to fix it.
|
|
32
33
|
*
|
|
33
34
|
* @input Doc files with the root each was found in, the package root, and the
|
|
@@ -312,7 +313,13 @@ function expectedType(ts, root, exportName, node, core = false) {
|
|
|
312
313
|
return {typeExpr: authoring('ThemeDoc'), typeName: 'ThemeDoc'};
|
|
313
314
|
}
|
|
314
315
|
if (root === 'icon-sets') {
|
|
315
|
-
|
|
316
|
+
// A set's own definitions live in its folder too.
|
|
317
|
+
return shape?.stamp === 'icon-definition'
|
|
318
|
+
? {
|
|
319
|
+
typeExpr: authoring('IconDefinitionDoc'),
|
|
320
|
+
typeName: 'IconDefinitionDoc',
|
|
321
|
+
}
|
|
322
|
+
: {typeExpr: authoring('IconSetDoc'), typeName: 'IconSetDoc'};
|
|
316
323
|
}
|
|
317
324
|
if (translation) {
|
|
318
325
|
return {
|