@astryxdesign/cli 0.7.4 → 0.7.5-canary.031a639
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/README.md +20 -20
- package/api/component/_adapter.mjs +16 -1
- package/api/component/component.test.mjs +31 -0
- package/api/discover/_adapter.d.mts +1 -1
- package/api/docs/_adapter.d.mts +5 -2
- package/api/docs/_adapter.mjs +24 -16
- package/api/docs/docs.test.mjs +18 -0
- package/api/docs/integrationDocs.test.mjs +2 -2
- package/api/experimental.d.mts +5 -0
- package/api/experimental.mjs +15 -0
- package/api/hook/list/list.d.mts +1 -1
- package/api/icon/_adapter.d.mts +3 -2
- package/api/icon/_adapter.mjs +16 -3
- package/api/icon/_authoring.d.mts +5 -1
- package/api/icon/_authoring.mjs +478 -63
- package/api/icon/_options.d.mts +11 -0
- package/api/icon/_options.mjs +39 -4
- package/api/icon/_records.d.mts +19 -0
- package/api/icon/_records.mjs +25 -0
- package/api/icon/add/add.d.mts +3 -3
- package/api/icon/add/add.mjs +227 -14
- package/api/icon/all-or-nothing.test.mjs +283 -0
- package/api/icon/detail/detail.mjs +2 -13
- package/api/icon/error-codes.test.mjs +14 -7
- package/api/icon/icon.d.mts +2 -2
- package/api/icon/icon.doc.mjs +30 -2
- package/api/icon/icon.mjs +57 -8
- package/api/icon/icon.test.mjs +133 -1
- package/api/icon/icon.type.d.mts +126 -1
- package/api/icon/icon.type.mjs +67 -3
- package/api/icon/iconAdd.doc.mjs +22 -6
- package/api/icon/iconMap.doc.mjs +24 -8
- package/api/icon/iconNewDefinition.doc.mjs +2 -2
- package/api/icon/iconNewSet.doc.mjs +30 -2
- package/api/icon/iconUse.doc.mjs +4 -1
- package/api/icon/map/map.d.mts +4 -4
- package/api/icon/map/map.mjs +134 -9
- package/api/icon/new-definition/new-definition.mjs +6 -2
- package/api/icon/new-set/new-set.mjs +2 -2
- package/api/icon/new-set/new-set.test.mjs +60 -10
- package/api/icon/option-pairs.test.mjs +368 -0
- package/api/icon/search/search.d.mts +10 -0
- package/api/icon/search/search.mjs +55 -14
- package/api/icon/use/use.mjs +2 -13
- package/api/integration/add-helpers.d.mts +15 -1
- package/api/integration/add-helpers.mjs +1 -1
- package/api/integration/pack-check.lifecycle-output.test.mjs +24 -1
- package/api/integration/pack-check.mjs +10 -4
- package/api/integration/pack-check.test.mjs +5 -1
- package/api/integration/validate-integration.type.d.mts +3 -2
- package/api/integration/validate-integration.type.mjs +3 -2
- package/api/render/_adapter.d.mts +28 -0
- package/api/render/_adapter.mjs +540 -0
- package/api/render/render.d.mts +15 -0
- package/api/render/render.doc.d.mts +9 -0
- package/api/render/render.doc.mjs +112 -0
- package/api/render/render.mjs +113 -0
- package/api/render/render.test.mjs +1155 -0
- package/api/render/render.type.d.mts +74 -0
- package/api/render/render.type.mjs +64 -0
- package/api/search/_adapter.test.mjs +21 -2
- package/api/search/_result.d.mts +5 -5
- package/api/search/search.d.mts +1 -1
- package/api/template/template.mjs +3 -1
- package/api/template/template.type.d.mts +2 -1
- package/api/template/template.type.mjs +1 -1
- package/api/template/tokenizer-showcase.test.mjs +47 -0
- package/api/template/unknown-name.test.mjs +63 -0
- package/api/theme/build/build.adaptation-enrollment.test.mjs +4 -0
- package/api/theme/build/build.icon-entry-variants.test.mjs +134 -0
- package/api/theme/build/build.icon-variants.test.mjs +105 -0
- package/api/theme/build/build.mjs +134 -75
- package/api/theme/build/build.test.mjs +77 -0
- package/api/upgrade/_adapter.d.mts +47 -2
- package/api/upgrade/_adapter.mjs +58 -2
- package/api/upgrade/run/failure-receipt.test.mjs +212 -0
- package/api/upgrade/run/outcomes.test.mjs +646 -0
- package/api/upgrade/run/run.d.mts +36 -0
- package/api/upgrade/run/run.mjs +670 -44
- package/api/upgrade/upgrade.doc.mjs +4 -4
- package/api/upgrade/upgrade.mjs +19 -4
- package/api/upgrade/upgrade.type.d.mts +36 -1
- package/api/upgrade/upgrade.type.mjs +29 -4
- package/assets/codemods/__tests__/runner.symlinks.test.mjs +205 -0
- package/assets/codemods/__tests__/runner.unparseable.test.mjs +457 -0
- package/assets/codemods/integration-runner.mjs +8 -2
- package/assets/codemods/integration-runner.protection.test.mjs +53 -0
- package/assets/codemods/outcome.mjs +79 -0
- package/assets/codemods/outcome.test.mjs +40 -0
- package/assets/codemods/parse.mjs +94 -0
- package/assets/codemods/run-codemod.mjs +109 -5
- package/assets/codemods/runner.mjs +119 -13
- package/assets/codemods/transform-prop.mjs +99 -49
- package/assets/codemods/transform-prop.test.mjs +36 -1
- package/assets/codemods/transforms/next/__tests__/migrate-codeblock-tokenizer-to-language.test.mjs +130 -0
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/migrate-codeblock-tokenizer-to-language.mjs +315 -0
- package/assets/codemods/transforms/v0.1.3/__tests__/migrate-layout-components-to-experimental.test.mjs +216 -2
- package/assets/codemods/transforms/v0.1.3/migrate-layout-components-to-experimental.mjs +88 -6
- package/assets/codemods/transforms/v0.6.0/migrate-astryx-theme-selectors-to-data-attrs.mjs +4 -3
- package/assets/codemods/transforms/v0.7.0/__tests__/migrate-deprecated-theme-surface.test.mjs +207 -6
- package/assets/codemods/transforms/v0.7.0/__tests__/validate-data-token-ownership.test.mjs +143 -70
- package/assets/codemods/transforms/v0.7.0/migrate-deprecated-theme-surface-v0.6-data.mjs +6 -1
- package/assets/codemods/transforms/v0.7.0/migrate-deprecated-theme-surface.mjs +244 -42
- package/assets/codemods/transforms/v0.7.0/validate-data-token-ownership.mjs +23 -78
- package/assets/discover/official-packages.json +4 -0
- package/assets/docs/author-a-theme.doc.mjs +3 -1
- package/assets/docs/icons.doc.mjs +82 -1
- package/assets/docs/theme.doc.dense.mjs +8 -0
- package/assets/docs/theme.doc.mjs +16 -0
- package/assets/docs/theme.doc.zh.mjs +11 -0
- package/assets/docs/tree/icon-definitions.doc.mjs +2 -2
- package/assets/docs/tree/icon-set-files.doc.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +50 -20
- package/assets/docs/tree/render-pages.doc.mjs +94 -0
- package/assets/docs/tree/styling-advanced.doc.mjs +1 -1
- package/assets/docs/tree/template-styles.doc.mjs +1 -1
- package/assets/docs/tree/tokens-color.doc.mjs +145 -1
- package/assets/docs/tree/tokens.doc.mjs +1 -1
- package/assets/icons/definitions/activity.doc.mjs +1 -1
- package/assets/icons/definitions/alignCenter.doc.mjs +9 -0
- package/assets/icons/definitions/alignEnd.doc.mjs +10 -0
- package/assets/icons/definitions/alignStart.doc.mjs +10 -0
- package/assets/icons/definitions/archive.doc.mjs +1 -1
- package/assets/icons/definitions/arrowsUpDown.doc.mjs +1 -1
- package/assets/icons/definitions/attach.doc.mjs +1 -1
- package/assets/icons/definitions/audio.doc.mjs +1 -1
- package/assets/icons/definitions/cart.doc.mjs +1 -1
- package/assets/icons/definitions/checkDouble.doc.mjs +1 -1
- package/assets/icons/definitions/chevronsLeft.doc.mjs +1 -1
- package/assets/icons/definitions/chevronsRight.doc.mjs +1 -1
- package/assets/icons/definitions/close.doc.mjs +1 -1
- package/assets/icons/definitions/collapse.doc.mjs +1 -1
- package/assets/icons/definitions/compose.doc.mjs +1 -1
- package/assets/icons/definitions/conversation.doc.mjs +1 -1
- package/assets/icons/definitions/copy.doc.mjs +1 -1
- package/assets/icons/definitions/cpu.doc.mjs +9 -0
- package/assets/icons/definitions/database.doc.mjs +1 -1
- package/assets/icons/definitions/desktop.doc.mjs +1 -1
- package/assets/icons/definitions/discount.doc.mjs +1 -1
- package/assets/icons/definitions/download.doc.mjs +1 -1
- package/assets/icons/definitions/emoji.doc.mjs +1 -1
- package/assets/icons/definitions/error.doc.mjs +1 -1
- package/assets/icons/definitions/expand.doc.mjs +1 -1
- package/assets/icons/definitions/experiment.doc.mjs +1 -1
- package/assets/icons/definitions/externalLink.doc.mjs +7 -1
- package/assets/icons/definitions/eyeSlash.doc.mjs +1 -1
- package/assets/icons/definitions/flipHorizontal.doc.mjs +9 -0
- package/assets/icons/definitions/flipVertical.doc.mjs +9 -0
- package/assets/icons/definitions/folderAdd.doc.mjs +1 -1
- package/assets/icons/definitions/gitBranch.doc.mjs +9 -0
- package/assets/icons/definitions/gitFork.doc.mjs +9 -0
- package/assets/icons/definitions/info.doc.mjs +1 -1
- package/assets/icons/definitions/location.doc.mjs +1 -1
- package/assets/icons/definitions/mention.doc.mjs +1 -1
- package/assets/icons/definitions/menu.doc.mjs +1 -1
- package/assets/icons/definitions/microphone.doc.mjs +1 -1
- package/assets/icons/definitions/mobile.doc.mjs +1 -1
- package/assets/icons/definitions/money.doc.mjs +1 -1
- package/assets/icons/definitions/moreHorizontal.doc.mjs +1 -1
- package/assets/icons/definitions/notificationActive.doc.mjs +1 -1
- package/assets/icons/definitions/notificationOff.doc.mjs +1 -1
- package/assets/icons/definitions/panelLeft.doc.mjs +10 -0
- package/assets/icons/definitions/panelRight.doc.mjs +10 -0
- package/assets/icons/definitions/raiseHand.doc.mjs +1 -1
- package/assets/icons/definitions/redo.doc.mjs +1 -1
- package/assets/icons/definitions/refresh.doc.mjs +1 -1
- package/assets/icons/definitions/rotate.doc.mjs +9 -0
- package/assets/icons/definitions/scale.doc.mjs +10 -0
- package/assets/icons/definitions/search.doc.mjs +1 -1
- package/assets/icons/definitions/send.doc.mjs +1 -1
- package/assets/icons/definitions/settings.doc.mjs +1 -1
- package/assets/icons/definitions/star.doc.mjs +1 -1
- package/assets/icons/definitions/stop.doc.mjs +1 -1
- package/assets/icons/definitions/success.doc.mjs +1 -1
- package/assets/icons/definitions/textCase.doc.mjs +9 -0
- package/assets/icons/definitions/thumbsDown.doc.mjs +1 -1
- package/assets/icons/definitions/thumbsUp.doc.mjs +1 -1
- package/assets/icons/definitions/trendDown.doc.mjs +7 -1
- package/assets/icons/definitions/trendUp.doc.mjs +1 -1
- package/assets/icons/definitions/undo.doc.mjs +1 -1
- package/assets/icons/definitions/upload.doc.mjs +1 -1
- package/assets/icons/definitions/userAdd.doc.mjs +1 -1
- package/assets/icons/definitions/warning.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.doc.mjs +6 -4
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.tsx +61 -55
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs +6 -4
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.tsx +68 -37
- package/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.doc.mjs +1 -1
- package/assets/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx +10 -2
- package/assets/templates/blocks/components/Thumbnail/ThumbnailDisabled.doc.mjs +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +15 -14
- package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +30 -30
- package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +15 -14
- package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +15 -14
- package/assets/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +17 -16
- package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +29 -29
- package/assets/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +22 -14
- package/assets/templates/blocks/components/Tokenizer/TokenizerStates.tsx +39 -41
- package/assets/templates/pages/canvas-editor/template.doc.mjs +9 -0
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +3 -3
- package/assets/templates/pages/form-wizard-inline/template.doc.mjs +6 -1
- package/assets/templates/pages/library/page.tsx +1 -2
- package/assets/templates/pages/table-comparison/page.tsx +12 -3
- package/assets/templates/pages/table-comparison/template.doc.mjs +1 -0
- package/assets/templates/pages/table-tree/template.doc.mjs +3 -0
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +3 -2
- package/assets/templates/themes/butter/butterTheme.ts +47 -44
- package/assets/templates/themes/chocolate/chocolateTheme.ts +15 -2
- package/assets/templates/themes/gothic/gothicTheme.ts +21 -16
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/matcha/matchaTheme.ts +15 -2
- package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +4 -4
- package/assets/templates/themes/neutral/neutralTheme.ts +24 -119
- package/assets/templates/themes/stone/stoneTheme.ts +46 -21
- package/assets/templates/themes/y2k/y2kTheme.ts +20 -16
- package/assets/theme.template.ts +18 -5
- package/authoring/codemod/type.ts +10 -0
- package/authoring/debug/parse.d.mts +2 -2
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +4 -4
- package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +6 -0
- package/authoring/doctypes/icon-set/parse.d.mts +1 -0
- package/authoring/doctypes/icon-set/parse.mjs +1 -0
- package/authoring/doctypes/icon-set/type.ts +5 -0
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +2 -1
- package/clients/cli/commands/build-theme.adaptations.test.mjs +110 -0
- package/clients/cli/commands/build-theme.outside-project.test.mjs +140 -0
- package/clients/cli/commands/doctor.mjs +16 -17
- package/clients/cli/commands/experimental/icon.mjs +167 -35
- package/clients/cli/commands/experimental/index.mjs +2 -0
- package/clients/cli/commands/experimental/render.mjs +113 -0
- package/clients/cli/commands/experimental-icon-add.doc.mjs +14 -4
- package/clients/cli/commands/experimental-icon-map.doc.mjs +12 -2
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +28 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +18 -2
- package/clients/cli/commands/experimental-render.doc.mjs +60 -0
- package/clients/cli/commands/experimental.doc.mjs +4 -2
- package/clients/cli/commands/icon-authoring.test.mjs +1823 -13
- package/clients/cli/commands/icon-options-wiring.test.mjs +158 -0
- package/clients/cli/commands/icon.test.mjs +1 -1
- package/clients/cli/commands/template.mjs +4 -1
- package/clients/cli/commands/text-json-parity.test.mjs +46 -0
- package/clients/cli/commands/upgrade.doc.mjs +47 -2
- package/clients/cli/commands/upgrade.file-protection.test.mjs +175 -0
- package/clients/cli/commands/upgrade.flag-help.test.mjs +37 -0
- package/clients/cli/commands/upgrade.integration-policy.test.mjs +103 -0
- package/clients/cli/commands/upgrade.mjs +9 -2
- package/clients/cli/commands/upgrade.outcomes.test.mjs +350 -0
- package/clients/cli/index.mjs +1 -0
- package/foundation/agent-docs/agent-docs.mjs +1 -0
- package/foundation/agent-docs/agent-docs.test.mjs +5 -0
- package/foundation/discovery/component-discovery.d.mts +2 -1
- package/foundation/discovery/component-discovery.export-names.test.mjs +41 -0
- package/foundation/discovery/component-discovery.mjs +13 -7
- package/foundation/discovery/icon-set-checks.d.mts +43 -9
- package/foundation/discovery/icon-set-checks.mjs +296 -21
- package/foundation/discovery/icon-set-checks.test.mjs +125 -12
- package/foundation/discovery/icon-set-writer.d.mts +192 -3
- package/foundation/discovery/icon-set-writer.mjs +608 -34
- package/foundation/discovery/icon-set-writer.test.mjs +26 -0
- package/foundation/discovery/module-exports.mjs +82 -25
- package/foundation/discovery/module-exports.test.mjs +38 -1
- package/foundation/discovery/package-exports.d.mts +13 -0
- package/foundation/discovery/package-exports.mjs +40 -1
- package/foundation/discovery/template-icons.d.mts +6 -0
- package/foundation/discovery/template-icons.mjs +98 -10
- package/foundation/discovery/template-icons.test.mjs +103 -0
- package/foundation/doc-compiler/doc-loads.test.mjs +22 -11
- package/foundation/doc-compiler/import.mjs +81 -8
- package/foundation/doc-compiler/read.d.mts +4 -3
- package/foundation/doc-compiler/read.mjs +15 -10
- package/foundation/doc-compiler/read.test.mjs +59 -1
- package/foundation/doc-compiler/tree.mjs +3 -1
- package/foundation/fs/module-loader.d.mts +3 -2
- package/foundation/fs/module-loader.mjs +3 -2
- package/foundation/fs/publish-file-eperm-mutation.test.mjs +2 -0
- package/foundation/fs/read-record.d.mts +27 -0
- package/foundation/fs/read-record.mjs +83 -15
- package/foundation/fs/read-record.test.mjs +88 -1
- package/foundation/render/assets.d.mts +31 -0
- package/foundation/render/assets.mjs +102 -0
- package/foundation/render/component-map.d.mts +52 -0
- package/foundation/render/component-map.mjs +141 -0
- package/foundation/render/css-cut.d.mts +29 -0
- package/foundation/render/css-cut.mjs +144 -0
- package/foundation/render/embedded-files.d.mts +28 -0
- package/foundation/render/embedded-files.mjs +108 -0
- package/foundation/render/embedded-imports.d.mts +61 -0
- package/foundation/render/embedded-imports.mjs +315 -0
- package/foundation/render/html-reader.d.mts +37 -0
- package/foundation/render/html-reader.mjs +121 -0
- package/foundation/render/page-worker.d.mts +7 -0
- package/foundation/render/page-worker.mjs +519 -0
- package/foundation/render/rebuild.d.mts +19 -0
- package/foundation/render/rebuild.mjs +269 -0
- package/foundation/render/render-page.d.mts +85 -0
- package/foundation/render/render-page.mjs +612 -0
- package/foundation/render/render.test.mjs +117 -0
- package/foundation/render/source-block.d.mts +52 -0
- package/foundation/render/source-block.mjs +106 -0
- package/foundation/response/base.d.ts +7 -0
- package/foundation/response/error-codes.d.mts +10 -1
- package/foundation/response/error-codes.doc.mjs +59 -2
- package/foundation/response/error-codes.mjs +62 -1
- package/foundation/response/json.d.mts +10 -3
- package/foundation/response/json.mjs +16 -4
- package/foundation/response/response-types.doc.mjs +39 -2
- package/foundation/text/string-utils.mjs +33 -0
- package/foundation/text/string-utils.test.mjs +17 -0
- package/foundation/text/suggest-order.d.mts +17 -3
- package/foundation/text/suggest-order.mjs +58 -13
- package/foundation/text/suggest-order.test.mjs +53 -0
- package/package.json +15 -9
|
@@ -192,6 +192,18 @@ export const y2kTheme = defineTheme({
|
|
|
192
192
|
'--color-on-error': [red.light[30], red.dark[20]],
|
|
193
193
|
'--color-on-warning': [yellow.light[30], yellow.dark[20]],
|
|
194
194
|
|
|
195
|
+
'--color-info': [blue.light[40], blue.dark[75]],
|
|
196
|
+
'--color-info-muted': 'var(--color-background-blue)',
|
|
197
|
+
|
|
198
|
+
'--color-text-info': [blue.light[20], blue.dark[75]],
|
|
199
|
+
'--color-text-success': [green.light[30], green.dark[75]],
|
|
200
|
+
'--color-text-warning': [yellow.light[30], yellow.dark[85]],
|
|
201
|
+
'--color-text-error': [red.light[30], red.dark[75]],
|
|
202
|
+
'--color-on-info-muted': 'var(--color-text-blue)',
|
|
203
|
+
'--color-on-success-muted': 'var(--color-text-green)',
|
|
204
|
+
'--color-on-warning-muted': 'var(--color-text-yellow)',
|
|
205
|
+
'--color-on-error-muted': 'var(--color-text-red)',
|
|
206
|
+
|
|
195
207
|
// Icon
|
|
196
208
|
'--color-icon-accent': [neutral.light[15], neutral.dark[95]],
|
|
197
209
|
'--color-icon-primary': [neutral.light[15], neutral.dark[95]],
|
|
@@ -393,28 +405,20 @@ export const y2kTheme = defineTheme({
|
|
|
393
405
|
borderRadius: '0px',
|
|
394
406
|
},
|
|
395
407
|
'status:info': {
|
|
396
|
-
|
|
397
|
-
'--color-
|
|
398
|
-
'--color-text-secondary': 'var(--color-text-blue)',
|
|
399
|
-
'--color-accent': 'var(--color-text-blue)',
|
|
408
|
+
'--color-info-muted': 'var(--color-background-blue)',
|
|
409
|
+
'--color-on-info-muted': 'var(--color-text-blue)',
|
|
400
410
|
},
|
|
401
411
|
'status:success': {
|
|
402
|
-
|
|
403
|
-
'--color-
|
|
404
|
-
'--color-text-secondary': 'var(--color-text-green)',
|
|
405
|
-
'--color-success': 'var(--color-text-green)',
|
|
412
|
+
'--color-success-muted': 'var(--color-background-green)',
|
|
413
|
+
'--color-on-success-muted': 'var(--color-text-green)',
|
|
406
414
|
},
|
|
407
415
|
'status:warning': {
|
|
408
|
-
|
|
409
|
-
'--color-
|
|
410
|
-
'--color-text-secondary': 'var(--color-text-yellow)',
|
|
411
|
-
'--color-warning': 'var(--color-text-yellow)',
|
|
416
|
+
'--color-warning-muted': 'var(--color-background-yellow)',
|
|
417
|
+
'--color-on-warning-muted': 'var(--color-text-yellow)',
|
|
412
418
|
},
|
|
413
419
|
'status:error': {
|
|
414
|
-
|
|
415
|
-
'--color-
|
|
416
|
-
'--color-text-secondary': 'var(--color-text-red)',
|
|
417
|
-
'--color-error': 'var(--color-text-red)',
|
|
420
|
+
'--color-error-muted': 'var(--color-background-red)',
|
|
421
|
+
'--color-on-error-muted': 'var(--color-text-red)',
|
|
418
422
|
},
|
|
419
423
|
},
|
|
420
424
|
|
package/assets/theme.template.ts
CHANGED
|
@@ -91,9 +91,11 @@ export const myTheme = defineTheme({
|
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* Start from another theme instead of the defaults. Tokens are copied then
|
|
94
|
-
* overridden, `components` deep-merge, `icons` shallow-merge — but the
|
|
95
|
-
* configs below REPLACE the base's rather
|
|
96
|
-
* inputs to a generator, not values.
|
|
94
|
+
* overridden, `components` deep-merge, `icons` shallow-merge — but the
|
|
95
|
+
* typography, radius and color scale configs below REPLACE the base's rather
|
|
96
|
+
* than merging, because they are inputs to a generator, not values. `motion`
|
|
97
|
+
* inherits field by field: `fast`, `medium` and `ratio` regenerate the fast
|
|
98
|
+
* and medium durations, and a `slow` or `easing` left unset keeps the base's.
|
|
97
99
|
*
|
|
98
100
|
* Reference: `astryx theme list` (themes you can install and extend).
|
|
99
101
|
*/
|
|
@@ -312,10 +314,21 @@ export const myTheme = defineTheme({
|
|
|
312
314
|
|
|
313
315
|
/**
|
|
314
316
|
* Swap the artwork behind semantic icon names — every component that asks
|
|
315
|
-
* for `check`, `close`, `chevron-down` gets yours.
|
|
317
|
+
* for `check`, `close`, `chevron-down` gets yours. An entry may also be a
|
|
318
|
+
* pure function of `{size, variant}` that picks artwork for the size Icon
|
|
319
|
+
* renders at.
|
|
316
320
|
* Reference: `astryx docs icons` lists the names.
|
|
317
321
|
*/
|
|
318
|
-
// icons: {check: <MyCheck />,
|
|
322
|
+
// icons: {check: <MyCheck />, info: ({size}) => <MyInfo bold={size === 'sm'} />},
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* The icon variant names this theme supports, listed once for the whole
|
|
326
|
+
* theme. An icon entry function receives `variant` typed as these names.
|
|
327
|
+
* A theme that sets the list replaces the one it would inherit; omit it to
|
|
328
|
+
* inherit the base's list.
|
|
329
|
+
* Reference: `astryx docs icons`.
|
|
330
|
+
*/
|
|
331
|
+
// iconVariants: ['outline', 'filled'],
|
|
319
332
|
|
|
320
333
|
/**
|
|
321
334
|
* Replace the small components that DRAW control state — the checkbox box,
|
|
@@ -141,6 +141,16 @@ export interface CodemodRunResult {
|
|
|
141
141
|
generated: boolean;
|
|
142
142
|
command?: string;
|
|
143
143
|
}>;
|
|
144
|
+
/**
|
|
145
|
+
* Protected files left for manual review because their own source does not
|
|
146
|
+
* parse, so no change can be proven in them. They do not fail the run.
|
|
147
|
+
*/
|
|
148
|
+
declinedCandidates?: Array<{
|
|
149
|
+
file: string;
|
|
150
|
+
codemod: string;
|
|
151
|
+
location?: string;
|
|
152
|
+
reason: string;
|
|
153
|
+
}>;
|
|
144
154
|
errors: Array<{file: string; codemod: string; error: string}>;
|
|
145
155
|
}
|
|
146
156
|
|
|
@@ -44,9 +44,9 @@ declare const eventSchema: z.ZodObject<{
|
|
|
44
44
|
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
45
45
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
46
46
|
optionSources: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
47
|
+
default: "default";
|
|
47
48
|
cli: "cli";
|
|
48
49
|
env: "env";
|
|
49
|
-
default: "default";
|
|
50
50
|
config: "config";
|
|
51
51
|
implied: "implied";
|
|
52
52
|
}>>;
|
|
@@ -75,12 +75,12 @@ declare const eventSchema: z.ZodObject<{
|
|
|
75
75
|
resultCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
76
76
|
emptyResult: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
|
|
77
77
|
resultKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
78
|
+
template: "template";
|
|
78
79
|
command: "command";
|
|
79
80
|
component: "component";
|
|
80
81
|
hook: "hook";
|
|
81
82
|
theme: "theme";
|
|
82
83
|
doc: "doc";
|
|
83
|
-
template: "template";
|
|
84
84
|
integration: "integration";
|
|
85
85
|
migration: "migration";
|
|
86
86
|
mixed: "mixed";
|
|
@@ -62,13 +62,13 @@ export const doc = {
|
|
|
62
62
|
examples: [
|
|
63
63
|
{
|
|
64
64
|
label:
|
|
65
|
-
"A set's own definition at icon-sets/outline/definitions/
|
|
65
|
+
"A set's own definition at icon-sets/outline/definitions/random.doc.mjs",
|
|
66
66
|
code: `/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
67
67
|
export default {
|
|
68
68
|
type: 'icon-definition',
|
|
69
|
-
name: '
|
|
70
|
-
description: '
|
|
71
|
-
words: ['
|
|
69
|
+
name: 'random',
|
|
70
|
+
description: 'Pick something at random.',
|
|
71
|
+
words: ['dice', 'shuffle', 'chance'],
|
|
72
72
|
};`,
|
|
73
73
|
},
|
|
74
74
|
],
|
|
@@ -37,6 +37,12 @@ export const doc = {
|
|
|
37
37
|
description:
|
|
38
38
|
'The upstream library and version the file was generated from. Omit it for a set with no upstream.',
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
name: 'exclude',
|
|
42
|
+
type: 'string[]',
|
|
43
|
+
description:
|
|
44
|
+
'Library exports that are not icons. `experimental icon new-set --from` leaves them out every time it wraps or refreshes the set; `--exclude` adds to the list. A CLI whose reference does not list this key withdraws a set that sets it, naming the key; leave it out for a set those CLIs must read.',
|
|
45
|
+
},
|
|
40
46
|
{
|
|
41
47
|
name: 'generated',
|
|
42
48
|
type: 'string',
|
|
@@ -69,6 +69,7 @@ declare const dataSchema: z.ZodObject<{
|
|
|
69
69
|
package: z.ZodString;
|
|
70
70
|
version: z.ZodString;
|
|
71
71
|
}, z.core.$strict>>;
|
|
72
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
73
|
variants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
74
|
default: z.ZodOptional<z.ZodObject<{
|
|
74
75
|
variant: z.ZodOptional<z.ZodString>;
|
|
@@ -146,6 +146,11 @@ export interface IconSetData {
|
|
|
146
146
|
module: string;
|
|
147
147
|
/** The upstream library, absent for a set with no upstream. */
|
|
148
148
|
source?: IconSetSource;
|
|
149
|
+
/**
|
|
150
|
+
* Library exports that are not icons, left out every time
|
|
151
|
+
* `astryx experimental icon new-set --from` wraps or refreshes the set.
|
|
152
|
+
*/
|
|
153
|
+
exclude?: string[];
|
|
149
154
|
/**
|
|
150
155
|
* The variants the set supplies, lower-kebab names such as `outline` and
|
|
151
156
|
* `solid`; absent when it has one look. A variant is a named look the set
|
|
@@ -69,7 +69,7 @@ export const doc = {
|
|
|
69
69
|
type: 'Record<string, string>',
|
|
70
70
|
stability: 'experimental',
|
|
71
71
|
description:
|
|
72
|
-
"The icon definition each icon the source imports draws, such as `{TrashIcon: 'delete'}`: a named import is keyed by the name it imports (`{Trash as TrashIcon}` is `Trash`), a default import by its local name (`import DeleteIcon from …` is `DeleteIcon`). When the project sets `experimental.iconSet`, `astryx template` (shown or copied) replaces each declared icon with the set's icon for that definition (`astryx docs cli/experimental/icon-definitions`) and reports every key as mapped or kept; an undeclared import is left alone.",
|
|
72
|
+
"The icon definition each icon the source imports draws, such as `{TrashIcon: 'delete'}`: a named import is keyed by the name it imports (`{Trash as TrashIcon}` is `Trash`), a default import by its local name (`import DeleteIcon from …` is `DeleteIcon`). When the project sets `experimental.iconSet`, `astryx template` (shown or copied) replaces each declared icon with the set's icon for that definition (`astryx docs cli/experimental/icon-definitions`) and reports every key as mapped or kept; an undeclared import is left alone. A name imported from two modules (`TrashIcon` from an outline and a solid module) needs one key, and each import keeps its variant when its module belongs to an installed set.",
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
name: 'isReady',
|
|
@@ -57,7 +57,8 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
|
|
|
57
57
|
* (`import DeleteIcon from …` is `DeleteIcon`). When the project has an
|
|
58
58
|
* icon set, each declared icon is replaced by the set's icon for that
|
|
59
59
|
* definition (`astryx docs cli/experimental/icon-definitions`), and every
|
|
60
|
-
* key is reported as mapped or kept.
|
|
60
|
+
* key is reported as mapped or kept. A name imported from two modules
|
|
61
|
+
* (`TrashIcon` from an outline and a solid module) needs one key.
|
|
61
62
|
* @experimental May change or be removed in a patch release. */
|
|
62
63
|
icons?: Record<string, string>;
|
|
63
64
|
|
|
@@ -95,6 +95,116 @@ describe('theme build adaptations', () => {
|
|
|
95
95
|
);
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
+
it('emits scoped status aliases in built CSS and preserves child extension parity', async () => {
|
|
99
|
+
const {defineTheme, generateThemeCSS} =
|
|
100
|
+
await import('@astryxdesign/core/theme');
|
|
101
|
+
const project = path.join(tmpDir, 'project');
|
|
102
|
+
const themesDir = path.join(project, 'themes');
|
|
103
|
+
const input = {
|
|
104
|
+
name: 'status-aliases',
|
|
105
|
+
tokens: {
|
|
106
|
+
'--color-info': '#225bff',
|
|
107
|
+
'--color-text-blue': '#203a6c',
|
|
108
|
+
},
|
|
109
|
+
adaptations: {
|
|
110
|
+
rules: [
|
|
111
|
+
{
|
|
112
|
+
when: {contrast: 'more'},
|
|
113
|
+
value: {
|
|
114
|
+
tokens: {'--color-text-success': '#123456'},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
when: {pointer: 'coarse'},
|
|
119
|
+
value: {tokens: {'--color-text-green': '#abcdef'}},
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
onDark: {
|
|
124
|
+
tokens: {'--color-text-blue': '#fefefe'},
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
const themeFile = writeTheme(themesDir, input.name, JSON.stringify(input));
|
|
128
|
+
|
|
129
|
+
const result = await build(project, themeFile);
|
|
130
|
+
expect(result.code, result.stderr).toBe(0);
|
|
131
|
+
|
|
132
|
+
const css = fs.readFileSync(
|
|
133
|
+
path.join(themesDir, 'status-aliases.css'),
|
|
134
|
+
'utf8',
|
|
135
|
+
);
|
|
136
|
+
const mediaAlias = '--color-text-info: var(--color-text-blue);';
|
|
137
|
+
const adaptationAlias = '--color-text-success: var(--color-text-green);';
|
|
138
|
+
const authoredRole = '--color-text-success: #123456;';
|
|
139
|
+
// The authored Info fill is a concrete hue, so theme generation derives
|
|
140
|
+
// its content, text, and pale-fill content (theme-compilation INV17).
|
|
141
|
+
for (const role of ['on-info', 'text-info', 'on-info-muted']) {
|
|
142
|
+
expect(css).toMatch(
|
|
143
|
+
new RegExp(
|
|
144
|
+
`--color-${role}: light-dark\\(#[0-9A-F]{6}, #[0-9A-F]{6}\\);`,
|
|
145
|
+
),
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
// The dark media surface that sets the hue rebinds the text alias.
|
|
149
|
+
expect(css).toContain(mediaAlias);
|
|
150
|
+
expect(css).toContain(adaptationAlias);
|
|
151
|
+
expect(css.split(authoredRole).length - 1).toBeGreaterThanOrEqual(2);
|
|
152
|
+
expect(css.lastIndexOf(authoredRole)).toBeGreaterThan(
|
|
153
|
+
css.lastIndexOf(adaptationAlias),
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const {statusAliasesTheme: builtTheme} = await import(
|
|
157
|
+
pathToFileURL(path.join(themesDir, 'status-aliases.js')).href
|
|
158
|
+
);
|
|
159
|
+
const source = defineTheme(input);
|
|
160
|
+
const childInput = {
|
|
161
|
+
name: 'status-alias-child',
|
|
162
|
+
tokens: {'--color-text-blue': '#345678'},
|
|
163
|
+
};
|
|
164
|
+
const fromSource = defineTheme({...childInput, extends: source});
|
|
165
|
+
const fromBuilt = defineTheme({...childInput, extends: builtTheme});
|
|
166
|
+
expect(generateThemeCSS(fromBuilt)).toEqual(generateThemeCSS(fromSource));
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('derives a complete status set for a minimal theme in built CSS (INV17)', async () => {
|
|
170
|
+
const {defineTheme, generateThemeCSS} =
|
|
171
|
+
await import('@astryxdesign/core/theme');
|
|
172
|
+
const project = path.join(tmpDir, 'project');
|
|
173
|
+
const themesDir = path.join(project, 'themes');
|
|
174
|
+
const input = {
|
|
175
|
+
name: 'status-minimal',
|
|
176
|
+
tokens: {
|
|
177
|
+
'--color-success': '#3FB950',
|
|
178
|
+
'--color-warning': '#D29922',
|
|
179
|
+
'--color-error': '#F85149',
|
|
180
|
+
'--color-info': '#6E40C9',
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
const themeFile = writeTheme(themesDir, input.name, JSON.stringify(input));
|
|
184
|
+
const result = await build(project, themeFile);
|
|
185
|
+
expect(result.code, result.stderr).toBe(0);
|
|
186
|
+
|
|
187
|
+
const css = fs.readFileSync(
|
|
188
|
+
path.join(themesDir, 'status-minimal.css'),
|
|
189
|
+
'utf8',
|
|
190
|
+
);
|
|
191
|
+
for (const status of ['success', 'warning', 'error', 'info']) {
|
|
192
|
+
expect(css).toMatch(
|
|
193
|
+
new RegExp(
|
|
194
|
+
`--color-text-${status}: light-dark\\(#[0-9A-F]{6}, #[0-9A-F]{6}\\);`,
|
|
195
|
+
),
|
|
196
|
+
);
|
|
197
|
+
expect(css).toContain(
|
|
198
|
+
`--color-icon-${status}: var(--color-text-${status});`,
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
// Built and runtime output derive the same values.
|
|
202
|
+
const runtime = generateThemeCSS(defineTheme(input));
|
|
203
|
+
const derived = css.match(/--color-text-warning: [^;]+;/)?.[0];
|
|
204
|
+
expect(derived).toBeDefined();
|
|
205
|
+
expect(JSON.stringify(runtime)).toContain(derived);
|
|
206
|
+
});
|
|
207
|
+
|
|
98
208
|
it.each([
|
|
99
209
|
['defined', writeTheme],
|
|
100
210
|
['plain', writePlainTheme],
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx theme build` outside any project, as a separate process.
|
|
5
|
+
*
|
|
6
|
+
* A theme in a folder with no Core installed (an empty folder, a fresh clone)
|
|
7
|
+
* imports `defineTheme` from Core all the same: the build hands its imports
|
|
8
|
+
* the Core the CLI answers with, as a new project with that Core would build
|
|
9
|
+
* it (spec AST-081 FR3). The CLI runs as its own process, without the
|
|
10
|
+
* `NODE_PATH` a pnpm script sets (it reaches the repository's packages): in
|
|
11
|
+
* the test runner, or with that path, the theme's import would find the
|
|
12
|
+
* repository's Core, which a real run outside a project cannot.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import {afterEach, beforeAll, beforeEach, describe, expect, it} from 'vitest';
|
|
16
|
+
import * as fs from 'node:fs';
|
|
17
|
+
import * as os from 'node:os';
|
|
18
|
+
import * as path from 'node:path';
|
|
19
|
+
import {spawnSync} from 'node:child_process';
|
|
20
|
+
import {fileURLToPath} from 'node:url';
|
|
21
|
+
import {ensureCoreBuilt} from './ensure-core-built.mjs';
|
|
22
|
+
|
|
23
|
+
const CLI_BIN = fileURLToPath(new URL('../bin/astryx.mjs', import.meta.url));
|
|
24
|
+
const CORE_DIR = fileURLToPath(new URL('../../../../core', import.meta.url));
|
|
25
|
+
|
|
26
|
+
/** @param {string[]} args @param {string} cwd */
|
|
27
|
+
function runCliProcess(args, cwd) {
|
|
28
|
+
const {NODE_PATH: _repositoryPackages, ...env} = process.env;
|
|
29
|
+
const result = spawnSync(process.execPath, [CLI_BIN, ...args], {
|
|
30
|
+
cwd,
|
|
31
|
+
encoding: 'utf-8',
|
|
32
|
+
timeout: 60_000,
|
|
33
|
+
env,
|
|
34
|
+
});
|
|
35
|
+
if (result.error) throw result.error;
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
beforeAll(() => {
|
|
40
|
+
ensureCoreBuilt();
|
|
41
|
+
}, 200_000);
|
|
42
|
+
|
|
43
|
+
let tmpDir;
|
|
44
|
+
beforeEach(() => {
|
|
45
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-theme-outside-'));
|
|
46
|
+
});
|
|
47
|
+
afterEach(() => {
|
|
48
|
+
fs.rmSync(tmpDir, {recursive: true, force: true});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A project beside the empty folder: its own package.json and Core (this
|
|
53
|
+
* repository's, linked), so the same theme builds there through the
|
|
54
|
+
* project's own resolution.
|
|
55
|
+
* @param {string} dir
|
|
56
|
+
*/
|
|
57
|
+
function makeProject(dir) {
|
|
58
|
+
fs.mkdirSync(path.join(dir, 'node_modules', '@astryxdesign'), {
|
|
59
|
+
recursive: true,
|
|
60
|
+
});
|
|
61
|
+
fs.writeFileSync(
|
|
62
|
+
path.join(dir, 'package.json'),
|
|
63
|
+
'{"name": "theme-project", "private": true, "dependencies": {"@astryxdesign/core": "*"}}\n',
|
|
64
|
+
);
|
|
65
|
+
fs.symlinkSync(
|
|
66
|
+
CORE_DIR,
|
|
67
|
+
path.join(dir, 'node_modules', '@astryxdesign', 'core'),
|
|
68
|
+
'junction',
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
describe('theme build outside any project builds a plain-object theme as a project does', () => {
|
|
73
|
+
const themes = {
|
|
74
|
+
typography: `export default {
|
|
75
|
+
name: 'plain-type',
|
|
76
|
+
tokens: {'--color-background': '#123456'},
|
|
77
|
+
typography: {body: {family: 'Helvetica', fallbacks: 'Arial, sans-serif'}},
|
|
78
|
+
};\n`,
|
|
79
|
+
'local tokens and media surfaces': `export default {
|
|
80
|
+
name: 'plain-local',
|
|
81
|
+
tokens: {'--color-background': '#123456'},
|
|
82
|
+
localTokens: {'--ac-selection-ink': ['#0077b6', '#48cae4']},
|
|
83
|
+
components: {badge: {'variant:info': {backgroundColor: 'var(--ac-selection-ink)'}}},
|
|
84
|
+
onDark: {components: {badge: {'variant:info': {color: 'var(--ac-selection-ink)'}}}},
|
|
85
|
+
};\n`,
|
|
86
|
+
};
|
|
87
|
+
for (const [what, source] of Object.entries(themes)) {
|
|
88
|
+
for (const ext of ['mjs', 'ts']) {
|
|
89
|
+
it(`with ${what}, in a .${ext} file`, () => {
|
|
90
|
+
const name = /name: '([^']+)'/.exec(source)[1];
|
|
91
|
+
const project = path.join(tmpDir, 'project');
|
|
92
|
+
makeProject(project);
|
|
93
|
+
const outside = path.join(tmpDir, 'outside');
|
|
94
|
+
fs.mkdirSync(outside);
|
|
95
|
+
for (const dir of [project, outside]) {
|
|
96
|
+
fs.writeFileSync(path.join(dir, `theme.${ext}`), source);
|
|
97
|
+
const result = runCliProcess(['theme', 'build', `theme.${ext}`], dir);
|
|
98
|
+
expect(result.status, result.stderr + result.stdout).toBe(0);
|
|
99
|
+
}
|
|
100
|
+
expect(fs.readFileSync(path.join(outside, `${name}.css`), 'utf8')).toBe(
|
|
101
|
+
fs.readFileSync(path.join(project, `${name}.css`), 'utf8'),
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe('theme build outside any project', () => {
|
|
109
|
+
for (const ext of ['mjs', 'ts']) {
|
|
110
|
+
it(`builds a .${ext} theme that imports defineTheme from Core, with the Core the CLI answers with`, () => {
|
|
111
|
+
fs.writeFileSync(
|
|
112
|
+
path.join(tmpDir, `outside.${ext}`),
|
|
113
|
+
"import {defineTheme} from '@astryxdesign/core/theme';\n" +
|
|
114
|
+
"export default defineTheme({name: 'outside', tokens: {'--color-background': '#123456'}});\n",
|
|
115
|
+
);
|
|
116
|
+
const result = runCliProcess(
|
|
117
|
+
['theme', 'build', `outside.${ext}`],
|
|
118
|
+
tmpDir,
|
|
119
|
+
);
|
|
120
|
+
expect(result.status, result.stderr + result.stdout).toBe(0);
|
|
121
|
+
expect(
|
|
122
|
+
fs.readFileSync(path.join(tmpDir, 'outside.css'), 'utf8'),
|
|
123
|
+
).toContain('#123456');
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
for (const ext of ['mjs', 'ts']) {
|
|
128
|
+
it(`still fails a .${ext} module that defines no theme`, () => {
|
|
129
|
+
fs.writeFileSync(
|
|
130
|
+
path.join(tmpDir, `none.${ext}`),
|
|
131
|
+
'export const notATheme = 42;\n',
|
|
132
|
+
);
|
|
133
|
+
const result = runCliProcess(['theme', 'build', `none.${ext}`], tmpDir);
|
|
134
|
+
expect(result.status).toBe(1);
|
|
135
|
+
expect(result.stderr + result.stdout).toMatch(
|
|
136
|
+
/Could not find a defineTheme\(\) result/,
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
@@ -355,26 +355,25 @@ function unmappedBlocks(listed) {
|
|
|
355
355
|
listed.map(each => ({
|
|
356
356
|
set: each.set,
|
|
357
357
|
unmapped: each.unmappedDefinitions.length,
|
|
358
|
-
definitions: each.unmappedDefinitions
|
|
359
|
-
.map(definition => definition.name)
|
|
360
|
-
.join(', '),
|
|
361
358
|
})),
|
|
362
|
-
{fields: ['set', 'unmapped'
|
|
363
|
-
),
|
|
364
|
-
...listed.flatMap(each =>
|
|
365
|
-
each.suggestions.length > 0
|
|
366
|
-
? [
|
|
367
|
-
list(
|
|
368
|
-
each.suggestions.map(
|
|
369
|
-
({definition, icon}) =>
|
|
370
|
-
`astryx experimental icon map ${definition} ${icon}${listed.length === 1 ? '' : ` --set ${each.set}`}`,
|
|
371
|
-
),
|
|
372
|
-
),
|
|
373
|
-
]
|
|
374
|
-
: [],
|
|
359
|
+
{fields: ['set', 'unmapped']},
|
|
375
360
|
),
|
|
361
|
+
// One line per definition: what it means and its words, so an author
|
|
362
|
+
// can pick from the text alone; a suggested icon when one fits.
|
|
363
|
+
...listed.map(each => {
|
|
364
|
+
const suggested = new Map(
|
|
365
|
+
each.suggestions.map(({definition, icon}) => [definition, icon]),
|
|
366
|
+
);
|
|
367
|
+
const setFlag = listed.length === 1 ? '' : ` --set ${each.set}`;
|
|
368
|
+
return list(
|
|
369
|
+
each.unmappedDefinitions.map(
|
|
370
|
+
definition =>
|
|
371
|
+
`${definition.name}: ${definition.description} Words: ${definition.words.join(', ')}.${suggested.has(definition.name) ? ` Suggested: astryx experimental icon map ${definition.name} ${suggested.get(definition.name)}${setFlag}` : ''}`,
|
|
372
|
+
),
|
|
373
|
+
);
|
|
374
|
+
}),
|
|
376
375
|
text(
|
|
377
|
-
'Mapping these is optional and never fails a check. --
|
|
376
|
+
'Mapping these is optional and never fails a check. Map one with `astryx experimental icon map <definition> <icon id>`; list your icons with `astryx experimental icon --set <set> --all-icons`; see how many definitions each set maps with `astryx experimental icon --list`.',
|
|
378
377
|
),
|
|
379
378
|
];
|
|
380
379
|
}
|