@astryxdesign/cli 0.7.17-canary.gffd1fc0 → 0.7.17
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/CHANGELOG.md +1877 -0
- package/README.md +90 -84
- package/api/build/_adapter.d.mts +51 -0
- package/api/build/_adapter.mjs +133 -7
- package/api/build/build.doc.mjs +3 -3
- package/api/build/build.mjs +23 -14
- package/api/build/build.type.d.mts +1 -1
- package/api/build/build.type.mjs +2 -2
- package/api/build/help/help.d.mts +15 -14
- package/api/build/help/help.mjs +65 -6
- package/api/build/kit/kit.mjs +1 -1
- package/api/build/kit/start.mjs +1 -1
- package/api/component/_adapter.d.mts +28 -4
- package/api/component/_adapter.mjs +79 -45
- package/api/component/component.d.mts +1 -1
- package/api/component/component.mjs +18 -7
- package/api/component/detail/showcase/showcase.mjs +19 -8
- package/api/discover/_adapter.d.mts +71 -8
- package/api/discover/_adapter.mjs +320 -69
- package/api/discover/_catalog-view.d.mts +22 -0
- package/api/discover/_catalog-view.mjs +30 -1
- package/api/discover/_icon-set-coverage.d.mts +22 -0
- package/api/discover/_icon-set-coverage.mjs +32 -0
- package/api/discover/detail/detail.d.mts +6 -3
- package/api/discover/detail/detail.mjs +14 -6
- package/api/discover/detail/doc/doc.mjs +1 -1
- package/api/discover/detail/item/item.d.mts +11 -1
- package/api/discover/detail/item/item.mjs +29 -8
- package/api/discover/discover.d.mts +36 -0
- package/api/discover/discover.doc.mjs +1 -1
- package/api/discover/discover.mjs +206 -29
- package/api/discover/discover.type.d.mts +33 -7
- package/api/discover/discover.type.mjs +21 -7
- package/api/discover/search/search.d.mts +22 -0
- package/api/discover/search/search.mjs +293 -70
- package/api/docs/_adapter.d.mts +92 -1
- package/api/docs/_adapter.mjs +264 -14
- package/api/docs/_entry-names.mjs +4 -3
- package/api/docs/docs.d.mts +4 -2
- package/api/docs/docs.doc.mjs +10 -0
- package/api/docs/docs.mjs +25 -5
- package/api/docs/docs.type.d.mts +48 -0
- package/api/docs/docs.type.mjs +26 -0
- package/api/docs/skills/skills.d.mts +51 -0
- package/api/docs/skills/skills.mjs +216 -0
- package/api/doctor/_adapter.d.mts +256 -10
- package/api/doctor/_adapter.mjs +1233 -51
- package/api/doctor/built-checks.d.mts +39 -3
- package/api/doctor/built-checks.mjs +203 -7
- package/api/doctor/doctor.d.mts +222 -10
- package/api/doctor/doctor.doc.mjs +4 -4
- package/api/doctor/doctor.mjs +1005 -43
- package/api/doctor/doctor.type.d.mts +6 -1
- package/api/doctor/doctor.type.mjs +3 -1
- package/api/doctor/theme-checks.d.mts +20 -1
- package/api/doctor/theme-checks.mjs +307 -7
- package/api/error.d.mts +12 -1
- package/api/error.mjs +18 -6
- package/api/icon/_adapter.d.mts +13 -2
- package/api/icon/_adapter.mjs +32 -16
- package/api/icon/_authoring.mjs +21 -7
- package/api/icon/_records.d.mts +3 -1
- package/api/icon/_records.mjs +30 -3
- package/api/icon/add/add.mjs +1 -1
- package/api/icon/definitions/definitions.mjs +19 -8
- package/api/icon/exportIconIndex.doc.mjs +1 -1
- package/api/icon/icon.doc.mjs +4 -4
- package/api/icon/icon.type.d.mts +80 -2
- package/api/icon/icon.type.mjs +40 -5
- package/api/icon/iconMap.doc.mjs +2 -2
- package/api/icon/list/list.mjs +7 -5
- package/api/icon/map/map.mjs +13 -4
- package/api/icon/rankIconIndex.doc.mjs +1 -1
- package/api/icon/search/icon-index.mjs +22 -9
- package/api/icon/search/search.d.mts +47 -3
- package/api/icon/search/search.mjs +306 -9
- package/api/init/_adapter.d.mts +97 -0
- package/api/init/_adapter.mjs +284 -15
- package/api/init/init.d.mts +3 -3
- package/api/init/init.doc.mjs +30 -6
- package/api/init/init.mjs +150 -11
- package/api/init/init.type.d.mts +102 -8
- package/api/init/init.type.mjs +44 -3
- package/api/init/remove/remove.d.mts +7 -4
- package/api/init/remove/remove.mjs +124 -26
- package/api/init/run/run.d.mts +48 -3
- package/api/init/run/run.mjs +444 -37
- package/api/integration/_adapter.d.mts +21 -4
- package/api/integration/_adapter.mjs +52 -6
- package/api/integration/integrationCheck.doc.mjs +1 -1
- package/api/integration/pack-check.d.mts +2 -1
- package/api/integration/pack-check.mjs +10 -18
- package/api/integration/validate-integration.d.mts +6 -3
- package/api/integration/validate-integration.mjs +86 -15
- package/api/integration/validate-integration.type.d.mts +12 -5
- package/api/integration/validate-integration.type.mjs +12 -5
- package/api/integration/validateIntegration.doc.mjs +4 -2
- package/api/render/_adapter.d.mts +6 -2
- package/api/render/_adapter.mjs +301 -51
- package/api/render/render.doc.d.mts +1 -1
- package/api/render/render.doc.mjs +20 -10
- package/api/render/render.mjs +16 -13
- package/api/render/render.type.d.mts +57 -10
- package/api/render/render.type.mjs +26 -13
- package/api/search/ORDERING.md +3 -3
- package/api/search/_adapter.d.mts +31 -0
- package/api/search/_adapter.mjs +107 -15
- package/api/search/_candidate-score.d.mts +12 -4
- package/api/search/_candidate-score.mjs +94 -16
- package/api/search/_cards.json +4 -1
- package/api/search/_entries.d.mts +8 -3
- package/api/search/_entries.mjs +109 -12
- package/api/search/_fit-order.d.mts +8 -4
- package/api/search/_fit-order.mjs +35 -7
- package/api/search/_gather-docs.mjs +85 -15
- package/api/search/_gather-templates.mjs +6 -0
- package/api/search/_icons.d.mts +50 -0
- package/api/search/_icons.mjs +85 -0
- package/api/search/_lexical.d.mts +14 -1
- package/api/search/_lexical.mjs +240 -12
- package/api/search/_main-searcher.mjs +13 -0
- package/api/search/_named-keywords.d.mts +6 -3
- package/api/search/_named-keywords.mjs +70 -19
- package/api/search/_order.d.mts +34 -1
- package/api/search/_order.mjs +156 -13
- package/api/search/_result.d.mts +30 -0
- package/api/search/_result.mjs +38 -0
- package/api/search/_score.d.mts +20 -6
- package/api/search/_score.mjs +96 -16
- package/api/search/_titles.d.mts +14 -0
- package/api/search/_titles.mjs +16 -3
- package/api/search/_words.d.mts +8 -0
- package/api/search/_words.mjs +26 -1
- package/api/search/search-index.mjs +23 -12
- package/api/search/search.d.mts +3 -1
- package/api/search/search.doc.mjs +5 -4
- package/api/search/search.mjs +69 -26
- package/api/search/search.type.d.mts +55 -1
- package/api/search/search.type.mjs +35 -1
- package/api/swizzle/_adapter.d.mts +1 -1
- package/api/swizzle/_adapter.mjs +1 -5
- package/api/swizzle/_moduleGraph.d.mts +0 -6
- package/api/swizzle/_moduleGraph.mjs +0 -12
- package/api/swizzle/copy/copy.mjs +1 -1
- package/api/template/_adapter.d.mts +46 -0
- package/api/template/_adapter.mjs +198 -2
- package/api/template/cdn/cdn.mjs +5 -3
- package/api/template/copy/copy.d.mts +12 -2
- package/api/template/copy/copy.mjs +95 -21
- package/api/template/show/show.d.mts +10 -3
- package/api/template/show/show.mjs +16 -4
- package/api/template/template.doc.mjs +3 -3
- package/api/template/template.mjs +55 -7
- package/api/template/template.type.d.mts +3 -0
- package/api/template/template.type.mjs +5 -2
- package/api/theme/_adapter.d.mts +28 -2
- package/api/theme/_adapter.mjs +675 -17
- package/api/theme/_app-provider.d.mts +42 -0
- package/api/theme/_app-provider.mjs +61 -27
- package/api/theme/_shared-source.d.mts +33 -0
- package/api/theme/_shared-source.mjs +348 -0
- package/api/theme/add/add.d.mts +3 -0
- package/api/theme/add/add.mjs +21 -4
- package/api/theme/build/build.d.mts +61 -30
- package/api/theme/build/build.mjs +552 -489
- package/api/theme/build/core-interception.d.mts +10 -0
- package/api/theme/build/core-interception.mjs +24 -0
- package/api/theme/build/family.mjs +4 -2
- package/api/theme/build/import-specifier.d.mts +14 -0
- package/api/theme/build/import-specifier.mjs +36 -0
- package/api/theme/build/input-fields.d.mts +9 -0
- package/api/theme/build/input-fields.mjs +155 -16
- package/api/theme/build/null-values.d.mts +22 -0
- package/api/theme/build/null-values.mjs +110 -21
- package/api/theme/build/radius-values.d.mts +18 -0
- package/api/theme/build/radius-values.mjs +76 -0
- package/api/theme/build/self-contained.mjs +32 -11
- package/api/theme/build/setting-effects.d.mts +254 -0
- package/api/theme/build/setting-effects.mjs +1065 -0
- package/api/theme/build/style-keys.d.mts +33 -0
- package/api/theme/build/style-keys.mjs +154 -0
- package/api/theme/build/theme-object.d.mts +47 -0
- package/api/theme/build/theme-object.mjs +144 -0
- package/api/theme/build/typography-values.mjs +7 -23
- package/api/theme/build/written-values.d.mts +18 -0
- package/api/theme/build/written-values.mjs +107 -31
- package/api/theme/eject/eject.mjs +6 -1
- package/api/theme/palette/generate/color.d.mts +41 -9
- package/api/theme/palette/generate/color.mjs +108 -39
- package/api/theme/palette/generate/generate.mjs +10 -0
- package/api/theme/palette/generate/generator.d.mts +45 -27
- package/api/theme/palette/generate/generator.mjs +347 -149
- package/api/theme/palette/generate/mapping.d.mts +456 -0
- package/api/theme/palette/generate/mapping.mjs +1903 -0
- package/api/theme/palette/generate/newer-recipe.d.mts +28 -0
- package/api/theme/palette/generate/newer-recipe.mjs +87 -0
- package/api/theme/palette/generate/types.d.mts +270 -0
- package/api/theme/palette/generate/types.mjs +123 -0
- package/api/theme/theme.d.mts +25 -4
- package/api/theme/theme.mjs +55 -5
- package/api/theme/theme.type.d.mts +71 -2
- package/api/theme/theme.type.mjs +37 -5
- package/api/theme/themeAdd.doc.mjs +3 -2
- package/api/theme/themeBuild.doc.mjs +4 -4
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme/themeRemove.doc.mjs +1 -1
- package/api/theme/themeTargets.doc.mjs +1 -1
- package/api/theme-edit/_catalog.d.mts +40 -0
- package/api/theme-edit/_catalog.mjs +101 -23
- package/api/theme-edit/_check.mjs +333 -79
- package/api/theme-edit/_color.d.mts +2 -60
- package/api/theme-edit/_color.mjs +33 -847
- package/api/theme-edit/_compiler.mjs +52 -0
- package/api/theme-edit/_context.d.mts +23 -3
- package/api/theme-edit/_context.mjs +173 -32
- package/api/theme-edit/_css.d.mts +4 -35
- package/api/theme-edit/_css.mjs +10 -91
- package/api/theme-edit/_edit.mjs +667 -87
- package/api/theme-edit/_how-question.d.mts +15 -0
- package/api/theme-edit/_how-question.mjs +2729 -179
- package/api/theme-edit/_how.mjs +62 -3
- package/api/theme-edit/_missed.d.mts +2 -1
- package/api/theme-edit/_missed.mjs +128 -29
- package/api/theme-edit/_normal.d.mts +22 -5
- package/api/theme-edit/_normal.mjs +95 -4
- package/api/theme-edit/_palette.d.mts +34 -74
- package/api/theme-edit/_palette.mjs +261 -1278
- package/api/theme-edit/_part-words.mjs +29 -6
- package/api/theme-edit/_parts.d.mts +16 -2
- package/api/theme-edit/_parts.mjs +161 -41
- package/api/theme-edit/_png.d.mts +24 -0
- package/api/theme-edit/_png.mjs +99 -0
- package/api/theme-edit/_preview-app.d.mts +16 -0
- package/api/theme-edit/_preview-app.mjs +52 -18
- package/api/theme-edit/_preview.d.mts +44 -26
- package/api/theme-edit/_preview.mjs +304 -89
- package/api/theme-edit/_project.d.mts +18 -2
- package/api/theme-edit/_project.mjs +27 -3
- package/api/theme-edit/_settings.d.mts +118 -1
- package/api/theme-edit/_settings.mjs +1336 -76
- package/api/theme-edit/_tables.d.mts +19 -11
- package/api/theme-edit/_tables.mjs +55 -37
- package/api/theme-edit/theme-edit.type.d.mts +20 -2
- package/api/theme-edit/theme-edit.type.mjs +9 -6
- package/api/upgrade/_adapter.d.mts +43 -4
- package/api/upgrade/_adapter.mjs +281 -8
- package/api/upgrade/run/run.mjs +4 -0
- package/api/upgrade/upgrade.mjs +1 -1
- package/api/upgrade/upgrade.type.d.mts +46 -7
- package/api/upgrade/upgrade.type.mjs +24 -9
- package/assets/codemods/registry.mjs +1 -0
- package/assets/codemods/transforms/next/index.mjs +1 -11
- package/assets/codemods/transforms/v0.7.17/index.mjs +28 -0
- package/assets/codemods/transforms/v0.7.17/migrate-item-swipe-actions-to-swipe.mjs +2160 -0
- package/assets/codemods/transforms/v0.7.17/preserve-chat-radius.mjs +515 -0
- package/assets/component-list.generated.json +1 -1
- package/assets/discover/official-packages.json +72 -0
- package/assets/docs/author-a-theme.doc.mjs +7 -4
- package/assets/docs/getting-started.doc.mjs +1 -1
- package/assets/docs/principles.doc.dense.mjs +1 -1
- package/assets/docs/principles.doc.mjs +1 -1
- package/assets/docs/principles.doc.zh.mjs +1 -1
- package/assets/docs/styling-overview.doc.mjs +5 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +34 -3
- package/assets/docs/tree/check-the-props.doc.mjs +1 -1
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/computer-integrations.doc.mjs +1 -1
- package/assets/docs/tree/doc-syntax.doc.mjs +1 -1
- package/assets/docs/tree/export-pages.doc.mjs +164 -0
- package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
- package/assets/docs/tree/host-entry.doc.mjs +4 -0
- package/assets/docs/tree/i18n-library-integration.doc.mjs +7 -3
- package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
- package/assets/docs/tree/icon-sets.doc.mjs +87 -11
- package/assets/docs/tree/layout.doc.mjs +16 -5
- package/assets/docs/tree/problems.doc.mjs +2 -2
- package/assets/docs/tree/responsive.doc.mjs +2 -2
- package/assets/docs/tree/scaffold.doc.mjs +1 -0
- package/assets/docs/tree/share-a-page.doc.mjs +14 -16
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/skill-places.doc.mjs +91 -0
- package/assets/docs/tree/styling.doc.mjs +41 -3
- package/assets/docs/tree/template-grading-rubric.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
- package/assets/docs/tree/tokens-and-setup.doc.mjs +2 -4
- package/assets/docs/tree/tokens-color.doc.mjs +2 -2
- package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
- package/assets/docs/tree/tokens.doc.mjs +32 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +8 -0
- package/assets/docs/tree/typography.doc.mjs +31 -2
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/versioning.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +4 -0
- package/assets/docs/working-with-ai.doc.mjs +44 -9
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/definitions/alert.doc.mjs +9 -0
- package/assets/icons/definitions/alignBottom.doc.mjs +1 -0
- package/assets/icons/definitions/alignCenter.doc.mjs +1 -0
- package/assets/icons/definitions/alignEnd.doc.mjs +1 -0
- package/assets/icons/definitions/alignJustify.doc.mjs +1 -0
- package/assets/icons/definitions/alignMiddle.doc.mjs +1 -0
- package/assets/icons/definitions/alignStart.doc.mjs +1 -0
- package/assets/icons/definitions/alignTop.doc.mjs +1 -0
- package/assets/icons/definitions/arrowDown.doc.mjs +1 -0
- package/assets/icons/definitions/arrowLeft.doc.mjs +1 -0
- package/assets/icons/definitions/arrowRight.doc.mjs +1 -0
- package/assets/icons/definitions/arrowUp.doc.mjs +1 -0
- package/assets/icons/definitions/arrowsUpDown.doc.mjs +1 -0
- package/assets/icons/definitions/bank.doc.mjs +1 -0
- package/assets/icons/definitions/block.doc.mjs +9 -0
- package/assets/icons/definitions/bold.doc.mjs +1 -0
- package/assets/icons/definitions/bookmark.doc.mjs +1 -0
- package/assets/icons/definitions/bookmarkAdd.doc.mjs +1 -0
- package/assets/icons/definitions/cart.doc.mjs +1 -0
- package/assets/icons/definitions/channel.doc.mjs +9 -0
- package/assets/icons/definitions/check.doc.mjs +1 -0
- package/assets/icons/definitions/checkDouble.doc.mjs +1 -0
- package/assets/icons/definitions/checklist.doc.mjs +9 -0
- package/assets/icons/definitions/chevronDown.doc.mjs +1 -0
- package/assets/icons/definitions/chevronLeft.doc.mjs +1 -0
- package/assets/icons/definitions/chevronRight.doc.mjs +1 -0
- package/assets/icons/definitions/chevronUp.doc.mjs +1 -0
- package/assets/icons/definitions/chevronsLeft.doc.mjs +1 -0
- package/assets/icons/definitions/chevronsRight.doc.mjs +1 -0
- package/assets/icons/definitions/clipboard.doc.mjs +1 -0
- package/assets/icons/definitions/cloud.doc.mjs +1 -1
- package/assets/icons/definitions/collapse.doc.mjs +1 -0
- package/assets/icons/definitions/columnSettings.doc.mjs +9 -0
- package/assets/icons/definitions/compose.doc.mjs +1 -0
- package/assets/icons/definitions/conversation.doc.mjs +1 -0
- package/assets/icons/definitions/copy.doc.mjs +1 -0
- package/assets/icons/definitions/copyText.doc.mjs +9 -0
- package/assets/icons/definitions/cornerRadius.doc.mjs +1 -0
- package/assets/icons/definitions/create.doc.mjs +9 -0
- package/assets/icons/definitions/creditCard.doc.mjs +1 -0
- package/assets/icons/definitions/currency.doc.mjs +9 -0
- package/assets/icons/definitions/cut.doc.mjs +1 -0
- package/assets/icons/definitions/desktop.doc.mjs +1 -0
- package/assets/icons/definitions/discount.doc.mjs +1 -0
- package/assets/icons/definitions/document.doc.mjs +1 -0
- package/assets/icons/definitions/documentSearch.doc.mjs +1 -0
- package/assets/icons/definitions/download.doc.mjs +1 -0
- package/assets/icons/definitions/error.doc.mjs +1 -0
- package/assets/icons/definitions/exitFullScreen.doc.mjs +16 -0
- package/assets/icons/definitions/expand.doc.mjs +1 -0
- package/assets/icons/definitions/eye.doc.mjs +1 -0
- package/assets/icons/definitions/eyeSlash.doc.mjs +1 -0
- package/assets/icons/definitions/file.doc.mjs +1 -0
- package/assets/icons/definitions/flipHorizontal.doc.mjs +1 -0
- package/assets/icons/definitions/flipVertical.doc.mjs +1 -0
- package/assets/icons/definitions/folder.doc.mjs +1 -0
- package/assets/icons/definitions/folderAdd.doc.mjs +1 -0
- package/assets/icons/definitions/fullScreen.doc.mjs +16 -0
- package/assets/icons/definitions/globe.doc.mjs +1 -1
- package/assets/icons/definitions/groupRows.doc.mjs +9 -0
- package/assets/icons/definitions/halftone.doc.mjs +9 -0
- package/assets/icons/definitions/help.doc.mjs +9 -0
- package/assets/icons/definitions/house.doc.mjs +9 -0
- package/assets/icons/definitions/info.doc.mjs +1 -0
- package/assets/icons/definitions/italic.doc.mjs +1 -0
- package/assets/icons/definitions/listView.doc.mjs +9 -0
- package/assets/icons/definitions/lock.doc.mjs +1 -0
- package/assets/icons/definitions/lowercase.doc.mjs +1 -0
- package/assets/icons/definitions/mail.doc.mjs +1 -1
- package/assets/icons/definitions/media.doc.mjs +9 -0
- package/assets/icons/definitions/message.doc.mjs +2 -1
- package/assets/icons/definitions/mobile.doc.mjs +1 -0
- package/assets/icons/definitions/money.doc.mjs +1 -0
- package/assets/icons/definitions/moon.doc.mjs +1 -0
- package/assets/icons/definitions/moveToFolder.doc.mjs +9 -0
- package/assets/icons/definitions/notification.doc.mjs +1 -0
- package/assets/icons/definitions/notificationActive.doc.mjs +1 -0
- package/assets/icons/definitions/notificationOff.doc.mjs +1 -0
- package/assets/icons/definitions/paddingHorizontal.doc.mjs +1 -0
- package/assets/icons/definitions/paddingPerSide.doc.mjs +1 -0
- package/assets/icons/definitions/paddingVertical.doc.mjs +1 -0
- package/assets/icons/definitions/panelBottom.doc.mjs +1 -0
- package/assets/icons/definitions/panelLeft.doc.mjs +1 -0
- package/assets/icons/definitions/panelRight.doc.mjs +1 -0
- package/assets/icons/definitions/paste.doc.mjs +9 -0
- package/assets/icons/definitions/pause.doc.mjs +1 -0
- package/assets/icons/definitions/play.doc.mjs +1 -0
- package/assets/icons/definitions/radiusPerCorner.doc.mjs +1 -0
- package/assets/icons/definitions/redo.doc.mjs +1 -0
- package/assets/icons/definitions/review.doc.mjs +9 -0
- package/assets/icons/definitions/rotate.doc.mjs +1 -0
- package/assets/icons/definitions/rotateCounterclockwise.doc.mjs +1 -0
- package/assets/icons/definitions/scale.doc.mjs +1 -2
- package/assets/icons/definitions/schedule.doc.mjs +9 -0
- package/assets/icons/definitions/search.doc.mjs +1 -0
- package/assets/icons/definitions/send.doc.mjs +1 -0
- package/assets/icons/definitions/shoppingBag.doc.mjs +1 -0
- package/assets/icons/definitions/signal.doc.mjs +9 -0
- package/assets/icons/definitions/stop.doc.mjs +1 -0
- package/assets/icons/definitions/strikethrough.doc.mjs +1 -0
- package/assets/icons/definitions/success.doc.mjs +1 -0
- package/assets/icons/definitions/sun.doc.mjs +1 -0
- package/assets/icons/definitions/tablet.doc.mjs +1 -0
- package/assets/icons/definitions/team.doc.mjs +9 -0
- package/assets/icons/definitions/textCase.doc.mjs +2 -1
- package/assets/icons/definitions/textRegular.doc.mjs +1 -0
- package/assets/icons/definitions/thumbsDown.doc.mjs +1 -0
- package/assets/icons/definitions/thumbsUp.doc.mjs +1 -0
- package/assets/icons/definitions/transfer.doc.mjs +1 -0
- package/assets/icons/definitions/trendDown.doc.mjs +1 -0
- package/assets/icons/definitions/trendUp.doc.mjs +1 -0
- package/assets/icons/definitions/underline.doc.mjs +1 -0
- package/assets/icons/definitions/undo.doc.mjs +1 -0
- package/assets/icons/definitions/unlock.doc.mjs +1 -0
- package/assets/icons/definitions/upload.doc.mjs +1 -0
- package/assets/icons/definitions/uppercase.doc.mjs +1 -0
- package/assets/icons/definitions/user.doc.mjs +1 -0
- package/assets/icons/definitions/userAdd.doc.mjs +1 -0
- package/assets/icons/definitions/userCircle.doc.mjs +1 -0
- package/assets/icons/definitions/userRemove.doc.mjs +1 -0
- package/assets/icons/definitions/users.doc.mjs +1 -0
- package/assets/icons/definitions/verified.doc.mjs +9 -0
- package/assets/icons/definitions/wallet.doc.mjs +1 -0
- package/assets/icons/definitions/warning.doc.mjs +1 -0
- package/assets/icons/definitions/wrench.doc.mjs +1 -1
- package/assets/icons/installed-icon-set.doc.mjs +30 -0
- package/assets/icons/template-icons.json +661 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/AppShell/AppShellShowcase.doc.mjs +0 -7
- package/assets/templates/blocks/components/AppShell/AppShellShowcase.tsx +8 -10
- package/assets/templates/blocks/components/AppShell/AppShellSideNavOnly.doc.mjs +0 -8
- package/assets/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx +10 -8
- package/assets/templates/blocks/components/AppShell/AppShellTopNavOnly.doc.mjs +0 -1
- package/assets/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx +4 -2
- package/assets/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.doc.mjs +0 -8
- package/assets/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx +10 -8
- package/assets/templates/blocks/components/AppShell/AppShellWithBanner.doc.mjs +0 -8
- package/assets/templates/blocks/components/AppShell/AppShellWithBanner.tsx +10 -8
- package/assets/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioWidescreen.tsx +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioWithSkeleton.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
- package/assets/templates/blocks/components/Avatar/AvatarShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarTooltip.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarWithStatus.tsx +1 -1
- package/assets/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx +1 -1
- package/assets/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +1 -1
- package/assets/templates/blocks/components/Badge/BadgeShowcase.tsx +2 -2
- package/assets/templates/blocks/components/Banner/BannerCollapsibleContent.tsx +14 -1
- package/assets/templates/blocks/components/Banner/BannerSectionVariant.tsx +10 -1
- package/assets/templates/blocks/components/Banner/BannerWithActionButton.tsx +25 -3
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.doc.mjs +0 -1
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.tsx +2 -2
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadMenu.doc.mjs +0 -1
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadMenu.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.doc.mjs +0 -8
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.tsx +5 -5
- package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsDeepHierarchy.doc.mjs +0 -1
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsDeepHierarchy.tsx +1 -1
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsWithIcons.doc.mjs +0 -1
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsWithIcons.tsx +2 -2
- package/assets/templates/blocks/components/Button/ButtonFloating.doc.mjs +0 -1
- package/assets/templates/blocks/components/Button/ButtonFloating.tsx +25 -2
- package/assets/templates/blocks/components/Button/ButtonShowcase.tsx +42 -4
- package/assets/templates/blocks/components/Button/ButtonSizeVariants.tsx +24 -2
- package/assets/templates/blocks/components/Button/ButtonVariants.tsx +28 -1
- package/assets/templates/blocks/components/Button/ButtonWithEndSlot.tsx +9 -0
- package/assets/templates/blocks/components/Button/ButtonWithIcon.doc.mjs +0 -6
- package/assets/templates/blocks/components/Button/ButtonWithIcon.tsx +35 -9
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupBasic.tsx +20 -3
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupFloating.tsx +16 -3
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.tsx +37 -8
- package/assets/templates/blocks/components/Center/CenterHorizontal.doc.mjs +0 -8
- package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +23 -5
- package/assets/templates/blocks/components/Center/CenterInsideACard.doc.mjs +0 -1
- package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFlat.doc.mjs +0 -5
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx +8 -3
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFooterActions.doc.mjs +0 -5
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFooterActions.tsx +8 -3
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.doc.mjs +0 -7
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +10 -7
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx +2 -2
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.doc.mjs +0 -1
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +3 -3
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.doc.mjs +0 -6
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +9 -9
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +10 -10
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonCustomIcon.doc.mjs +0 -6
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonCustomIcon.tsx +8 -5
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageStatusUpdates.doc.mjs +0 -5
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageStatusUpdates.tsx +7 -7
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageWithIcon.doc.mjs +0 -6
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageWithIcon.tsx +7 -7
- package/assets/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.doc.mjs +0 -6
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +7 -7
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuBottomSheet.doc.mjs +0 -6
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuBottomSheet.tsx +7 -7
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuNoChevron.doc.mjs +0 -1
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuNoChevron.tsx +2 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateActions.doc.mjs +0 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +2 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.doc.mjs +0 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +1 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.doc.mjs +0 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +2 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +2 -2
- package/assets/templates/blocks/components/Grid/GridShowcase.tsx +1 -1
- package/assets/templates/blocks/components/GridSpan/GridSpanColumns.tsx +1 -1
- package/assets/templates/blocks/components/GridSpan/GridSpanShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +3 -2
- package/assets/templates/blocks/components/Hooks/useClipboardHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.tsx +38 -19
- package/assets/templates/blocks/components/Hooks/useGridFocusHookUsage.tsx +6 -6
- package/assets/templates/blocks/components/Hooks/useHotkeysHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Hooks/useInputContainerHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/Hooks/useInputContainerHookUsage.tsx +2 -2
- package/assets/templates/blocks/components/Hooks/useKeyboardHintHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/Hooks/useKeyboardHintHookUsage.tsx +2 -2
- package/assets/templates/blocks/components/Hooks/useListFocusHookUsage.tsx +8 -1
- package/assets/templates/blocks/components/Hooks/useOverflowHookUsage.tsx +17 -6
- package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/Hooks/useTreeFocusHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/Hooks/useTreeFocusHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardInteractiveContent.doc.mjs +0 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardInteractiveContent.tsx +1 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.doc.mjs +0 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.tsx +1 -1
- package/assets/templates/blocks/components/Icon/useIconHookUsage.doc.mjs +0 -5
- package/assets/templates/blocks/components/Icon/useIconHookUsage.tsx +7 -7
- package/assets/templates/blocks/components/IconButton/IconButtonActionBar.tsx +11 -0
- package/assets/templates/blocks/components/IconButton/IconButtonFloating.doc.mjs +0 -1
- package/assets/templates/blocks/components/IconButton/IconButtonFloating.tsx +25 -2
- package/assets/templates/blocks/components/IconButton/IconButtonShowcase.tsx +3 -0
- package/assets/templates/blocks/components/IconButton/IconButtonTooltipIconButton.tsx +5 -0
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +3 -3
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +36 -13
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.doc.mjs +0 -1
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.tsx +4 -4
- package/assets/templates/blocks/components/Item/ItemShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/Item/ItemShowcase.tsx +7 -3
- package/assets/templates/blocks/components/Layout/LayoutBasicCardLayout.tsx +14 -2
- package/assets/templates/blocks/components/Layout/LayoutContentWidth.tsx +14 -2
- package/assets/templates/blocks/components/Layout/LayoutFullBleedContent.tsx +8 -1
- package/assets/templates/blocks/components/Layout/LayoutShowcase.tsx +8 -1
- package/assets/templates/blocks/components/Layout/LayoutSidebarLayout.tsx +14 -2
- package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
- package/assets/templates/blocks/components/Markdown/MarkdownShowcase.tsx +1 -1
- package/assets/templates/blocks/components/MediaTheme/MediaThemeImageOverlay.tsx +18 -4
- package/assets/templates/blocks/components/MediaTheme/MediaThemeLightScrim.tsx +11 -3
- package/assets/templates/blocks/components/MediaTheme/MediaThemeShowcase.tsx +27 -5
- package/assets/templates/blocks/components/MobileNav/MobileNavBasicMobileNav.doc.mjs +0 -7
- package/assets/templates/blocks/components/MobileNav/MobileNavBasicMobileNav.tsx +5 -9
- package/assets/templates/blocks/components/MobileNav/MobileNavEndSideMobileNav.doc.mjs +0 -1
- package/assets/templates/blocks/components/MobileNav/MobileNavEndSideMobileNav.tsx +2 -2
- package/assets/templates/blocks/components/MobileNav/MobileNavWithoutTitleMobileNav.doc.mjs +0 -1
- package/assets/templates/blocks/components/MobileNav/MobileNavWithoutTitleMobileNav.tsx +1 -1
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.doc.mjs +0 -6
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +15 -15
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithDividers.doc.mjs +0 -5
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithDividers.tsx +4 -8
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithSections.doc.mjs +0 -5
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithSections.tsx +4 -8
- package/assets/templates/blocks/components/MultiSelector/useMultiComboboxHookUsage.doc.mjs +0 -1
- package/assets/templates/blocks/components/MultiSelector/useMultiComboboxHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/OverflowList/OverflowListCappedToolbar.tsx +38 -2
- package/assets/templates/blocks/components/OverflowList/OverflowListCollapseFromStartList.tsx +17 -5
- package/assets/templates/blocks/components/OverflowList/OverflowListOverflowDropdownActions.tsx +46 -7
- package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +45 -5
- package/assets/templates/blocks/components/Overlay/OverlayHoverReveal.tsx +14 -1
- package/assets/templates/blocks/components/Overlay/OverlayShowcase.tsx +10 -1
- package/assets/templates/blocks/components/Overlay/useOverlayHookUsage.tsx +12 -1
- package/assets/templates/blocks/components/Pagination/PaginationDotsCarousel.doc.mjs +0 -1
- package/assets/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +1 -1
- package/assets/templates/blocks/components/Popover/PopoverBottomSheetAlternative.doc.mjs +0 -1
- package/assets/templates/blocks/components/Popover/PopoverBottomSheetAlternative.tsx +1 -1
- package/assets/templates/blocks/components/Resizable/ResizableShowcase.tsx +12 -2
- package/assets/templates/blocks/components/Resizable/ResizableSidebar.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.tsx +1 -1
- package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.tsx +1 -1
- package/assets/templates/blocks/components/Section/SectionWashHighlight.doc.mjs +0 -1
- package/assets/templates/blocks/components/Section/SectionWashHighlight.tsx +10 -2
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.doc.mjs +0 -1
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +3 -3
- package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Stack/StackAlignment.tsx +50 -6
- package/assets/templates/blocks/components/Stack/StackDirections.tsx +1 -1
- package/assets/templates/blocks/components/Stack/StackFillItem.tsx +10 -1
- package/assets/templates/blocks/components/Step/StepContent.tsx +13 -4
- package/assets/templates/blocks/components/Step/StepIndicator.tsx +3 -2
- package/assets/templates/blocks/components/Step/StepShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Step/StepStates.tsx +3 -2
- package/assets/templates/blocks/components/Stepper/StepperCustomContent.tsx +18 -14
- package/assets/templates/blocks/components/Stepper/StepperOnTrackHorizontal.tsx +1 -1
- package/assets/templates/blocks/components/Table/TableInCard.tsx +1 -1
- package/assets/templates/blocks/components/Table/TableShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.doc.mjs +0 -1
- package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +2 -2
- package/assets/templates/blocks/components/TextInput/TextInputIcon.doc.mjs +0 -1
- package/assets/templates/blocks/components/TextInput/TextInputIcon.tsx +3 -7
- package/assets/templates/blocks/components/TextInput/TextInputSearch.doc.mjs +0 -1
- package/assets/templates/blocks/components/TextInput/TextInputSearch.tsx +3 -3
- package/assets/templates/blocks/components/Theme/ThemeApply.tsx +8 -1
- package/assets/templates/blocks/components/Theme/ThemeNested.tsx +11 -1
- package/assets/templates/blocks/components/Theme/ThemeShowcase.tsx +26 -3
- package/assets/templates/blocks/components/Theme/ThemeSwitcher.tsx +8 -1
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonColor.doc.mjs +0 -11
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonColor.tsx +5 -5
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonGroup.doc.mjs +0 -9
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonGroup.tsx +5 -9
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonIconSwap.doc.mjs +0 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonIconSwap.tsx +6 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonLabel.doc.mjs +0 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonLabel.tsx +3 -3
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonShowcase.tsx +6 -6
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonStates.doc.mjs +0 -1
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonStates.tsx +2 -2
- package/assets/templates/blocks/components/Token/TokenIcon.doc.mjs +0 -6
- package/assets/templates/blocks/components/Token/TokenIcon.tsx +3 -3
- package/assets/templates/blocks/components/Token/TokenShowcase.doc.mjs +0 -1
- package/assets/templates/blocks/components/Token/TokenShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +14 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.doc.mjs +0 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +2 -2
- package/assets/templates/blocks/components/Toolbar/ToolbarBulkActions.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarBulkActions.tsx +36 -3
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +4 -3
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +3 -3
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +8 -3
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +6 -2
- package/assets/templates/blocks/components/Toolbar/ToolbarWithTabs.doc.mjs +0 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx +11 -2
- package/assets/templates/blocks/components/Tooltip/TooltipActionBarTooltips.tsx +33 -3
- package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +2 -2
- package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.doc.mjs +0 -6
- package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -7
- package/assets/templates/blocks/components/TopNav/TopNavHoverMenu.doc.mjs +0 -8
- package/assets/templates/blocks/components/TopNav/TopNavHoverMenu.tsx +14 -9
- package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.doc.mjs +0 -8
- package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +11 -11
- package/assets/templates/blocks/components/TopNav/TopNavMultipleDropdowns.doc.mjs +0 -5
- package/assets/templates/blocks/components/TopNav/TopNavMultipleDropdowns.tsx +4 -8
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.doc.mjs +0 -5
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +8 -4
- package/assets/templates/blocks/components/TopNav/TopNavWithLogo.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNav/TopNavWithLogo.tsx +7 -2
- package/assets/templates/blocks/components/TopNavItem/TopNavItemShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.tsx +4 -4
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.doc.mjs +0 -7
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.tsx +12 -12
- package/assets/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.tsx +2 -2
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuBasic.doc.mjs +0 -1
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuBasic.tsx +4 -4
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.tsx +11 -8
- package/assets/templates/blocks/components/TreeList/TreeListFileTreeWithIcons.doc.mjs +0 -1
- package/assets/templates/blocks/components/TreeList/TreeListFileTreeWithIcons.tsx +4 -4
- package/assets/templates/blocks/components/TreeList/TreeListInteractiveSettings.doc.mjs +0 -1
- package/assets/templates/blocks/components/TreeList/TreeListInteractiveSettings.tsx +6 -3
- package/assets/templates/blocks/components/Typeahead/TypeaheadSearchField.doc.mjs +0 -1
- package/assets/templates/blocks/components/Typeahead/TypeaheadSearchField.tsx +2 -2
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenShowcase.doc.mjs +0 -6
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenShowcase.tsx +30 -7
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenSupplementaryContext.doc.mjs +0 -1
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenSupplementaryContext.tsx +4 -1
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +19 -15
- package/assets/templates/pages/ai-chat/template.doc.mjs +0 -9
- package/assets/templates/pages/ai-chat-landing/page.tsx +16 -16
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +0 -11
- package/assets/templates/pages/blank/page.tsx +4 -2
- package/assets/templates/pages/canvas-editor/page.tsx +200 -110
- package/assets/templates/pages/canvas-editor/template.doc.mjs +0 -46
- package/assets/templates/pages/centered-hero/page.tsx +2 -2
- package/assets/templates/pages/centered-hero/template.doc.mjs +0 -1
- package/assets/templates/pages/checkout-wizard/page.tsx +31 -18
- package/assets/templates/pages/checkout-wizard/template.doc.mjs +0 -7
- package/assets/templates/pages/classic-gallery/page.tsx +1 -1
- package/assets/templates/pages/contact-form/page.tsx +15 -10
- package/assets/templates/pages/contact-form/template.doc.mjs +0 -5
- package/assets/templates/pages/course-detail/page.tsx +10 -10
- package/assets/templates/pages/course-detail/template.doc.mjs +0 -11
- package/assets/templates/pages/dashboard/page.tsx +37 -19
- package/assets/templates/pages/dashboard/template.doc.mjs +0 -6
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +16 -14
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +0 -8
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +14 -16
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +0 -7
- package/assets/templates/pages/dashboard-comparison/page.tsx +17 -12
- package/assets/templates/pages/dashboard-comparison/template.doc.mjs +0 -8
- package/assets/templates/pages/dashboard-composition/page.tsx +40 -23
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +0 -1
- package/assets/templates/pages/dashboard-progress/page.tsx +105 -109
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +0 -7
- package/assets/templates/pages/dashboard-scorecard/page.tsx +74 -37
- package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +0 -7
- package/assets/templates/pages/detail-page/page.tsx +28 -11
- package/assets/templates/pages/detail-page/template.doc.mjs +0 -10
- package/assets/templates/pages/documentation/page.tsx +11 -4
- package/assets/templates/pages/documentation-design/page.tsx +39 -12
- package/assets/templates/pages/documentation-design/template.doc.mjs +0 -5
- package/assets/templates/pages/documentation-technical/page.tsx +8 -6
- package/assets/templates/pages/documentation-technical/template.doc.mjs +0 -5
- package/assets/templates/pages/editor/page.tsx +70 -48
- package/assets/templates/pages/editor/template.doc.mjs +0 -26
- package/assets/templates/pages/file-explorer/page.tsx +19 -19
- package/assets/templates/pages/file-explorer/template.doc.mjs +0 -15
- package/assets/templates/pages/form-two-column/page.tsx +1 -1
- package/assets/templates/pages/form-wizard/page.tsx +12 -5
- package/assets/templates/pages/form-wizard-dialog/page.tsx +6 -2
- package/assets/templates/pages/form-wizard-inline/page.tsx +16 -12
- package/assets/templates/pages/form-wizard-inline/template.doc.mjs +0 -6
- package/assets/templates/pages/form-wizard-vertical/page.tsx +21 -24
- package/assets/templates/pages/form-wizard-vertical/template.doc.mjs +0 -13
- package/assets/templates/pages/gallery-hero/page.tsx +2 -2
- package/assets/templates/pages/gallery-hero/template.doc.mjs +0 -1
- package/assets/templates/pages/ide/page.tsx +12 -7
- package/assets/templates/pages/ide/template.doc.mjs +0 -5
- package/assets/templates/pages/incident-console/page.tsx +4 -4
- package/assets/templates/pages/incident-console/template.doc.mjs +0 -1
- package/assets/templates/pages/kanban-board/page.tsx +128 -47
- package/assets/templates/pages/kanban-board/template.doc.mjs +0 -11
- package/assets/templates/pages/library/page.tsx +34 -64
- package/assets/templates/pages/library/template.doc.mjs +0 -1
- package/assets/templates/pages/login/page.tsx +6 -4
- package/assets/templates/pages/login/template.doc.mjs +0 -1
- package/assets/templates/pages/login-card/page.tsx +6 -4
- package/assets/templates/pages/login-card/template.doc.mjs +0 -1
- package/assets/templates/pages/login-split/page.tsx +6 -5
- package/assets/templates/pages/login-split/template.doc.mjs +0 -1
- package/assets/templates/pages/login-sso/page.tsx +6 -6
- package/assets/templates/pages/login-sso/template.doc.mjs +0 -1
- package/assets/templates/pages/messaging-shell/page.tsx +14 -14
- package/assets/templates/pages/messaging-shell/template.doc.mjs +0 -9
- package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
- package/assets/templates/pages/payment-form/page.tsx +50 -29
- package/assets/templates/pages/payment-form/template.doc.mjs +0 -6
- package/assets/templates/pages/product-detail/page.tsx +21 -9
- package/assets/templates/pages/product-detail/template.doc.mjs +0 -1
- package/assets/templates/pages/product-gallery/page.tsx +3 -3
- package/assets/templates/pages/product-gallery/template.doc.mjs +0 -1
- package/assets/templates/pages/settings/page.tsx +35 -14
- package/assets/templates/pages/settings/template.doc.mjs +0 -1
- package/assets/templates/pages/settings-dialog/page.tsx +96 -93
- package/assets/templates/pages/settings-dialog/template.doc.mjs +0 -53
- package/assets/templates/pages/settings-sidebar/page.tsx +74 -36
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +0 -16
- package/assets/templates/pages/shell-nav/page.tsx +32 -20
- package/assets/templates/pages/shell-nav/template.doc.mjs +0 -6
- package/assets/templates/pages/shell-side-nav/page.tsx +23 -22
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +0 -11
- package/assets/templates/pages/shell-top-nav/page.tsx +13 -13
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +0 -19
- package/assets/templates/pages/side-gallery/page.tsx +5 -2
- package/assets/templates/pages/table/page.tsx +21 -21
- package/assets/templates/pages/table/template.doc.mjs +0 -10
- package/assets/templates/pages/table-collapsible/page.tsx +8 -8
- package/assets/templates/pages/table-collapsible/template.doc.mjs +0 -6
- package/assets/templates/pages/table-comparison/page.tsx +23 -23
- package/assets/templates/pages/table-comparison/template.doc.mjs +0 -14
- package/assets/templates/pages/table-filter/page.tsx +75 -47
- package/assets/templates/pages/table-filter/template.doc.mjs +0 -19
- package/assets/templates/pages/table-grouped/page.tsx +39 -17
- package/assets/templates/pages/table-grouped/template.doc.mjs +0 -11
- package/assets/templates/pages/table-inbox/page.tsx +147 -65
- package/assets/templates/pages/table-inbox/template.doc.mjs +0 -17
- package/assets/templates/pages/table-page/page.tsx +3 -6
- package/assets/templates/pages/table-page/template.doc.mjs +0 -1
- package/assets/templates/pages/table-tree/page.tsx +35 -35
- package/assets/templates/pages/table-tree/template.doc.mjs +0 -15
- package/assets/templates/pages/theme-showcase/page.tsx +48 -43
- package/assets/templates/pages/theme-showcase/template.doc.mjs +0 -19
- package/assets/templates/pages/work-item-detail/page.tsx +60 -33
- package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -12
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
- package/assets/templates/themes/butter/butterTheme.ts +244 -10
- package/assets/templates/themes/chocolate/chocolateTheme.ts +81 -10
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
- package/assets/templates/themes/gothic/gothicTheme.ts +126 -4
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
- package/assets/templates/themes/matcha/matchaTheme.ts +58 -14
- package/assets/templates/themes/neutral/neutralTheme.ts +45 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +3 -3
- package/assets/templates/themes/stone/stoneTheme.ts +101 -10
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
- package/assets/templates/themes/y2k/y2kTheme.ts +257 -14
- package/assets/theme.template.ts +17 -7
- package/authoring/config/config.doc.mjs +8 -1
- package/authoring/config/parse.mjs +15 -0
- package/authoring/config/skill-places.d.mts +23 -0
- package/authoring/config/skill-places.mjs +35 -0
- package/authoring/config/type.ts +20 -3
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/debug/type.ts +4 -0
- package/authoring/discover/parse.d.mts +4 -3
- package/authoring/discover/parse.mjs +76 -41
- package/authoring/discover/type.ts +9 -1
- package/authoring/doctypes/_schema.d.mts +36 -16
- package/authoring/doctypes/_schema.mjs +29 -0
- package/authoring/doctypes/base/type.ts +19 -0
- package/authoring/doctypes/command/command.doc.mjs +6 -0
- package/authoring/doctypes/command/type.ts +7 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +17 -1
- package/authoring/doctypes/icon-definition/parse.mjs +12 -0
- package/authoring/doctypes/icon-definition/type.ts +18 -0
- package/authoring/doctypes/reference/reference.doc.mjs +13 -0
- package/authoring/doctypes/reference/skill.d.mts +29 -0
- package/authoring/doctypes/reference/skill.mjs +56 -0
- package/authoring/doctypes/reference/type.ts +19 -0
- package/authoring/gap-report/parse.d.mts +1 -1
- package/authoring/integration/integration.doc.mjs +8 -0
- package/authoring/integration/schema.d.mts +21 -3
- package/authoring/integration/schema.mjs +25 -5
- package/authoring/integration/type.ts +14 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.doc.mjs +1 -1
- package/clients/cli/commands/build.mjs +20 -14
- package/clients/cli/commands/component.doc.mjs +3 -1
- package/clients/cli/commands/component.mjs +21 -6
- package/clients/cli/commands/discover.doc.mjs +2 -2
- package/clients/cli/commands/discover.mjs +112 -9
- package/clients/cli/commands/docs.doc.mjs +17 -10
- package/clients/cli/commands/docs.mjs +112 -191
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +4 -2
- package/clients/cli/commands/doctor.doc.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +16 -3
- package/clients/cli/commands/experimental/export.mjs +64 -0
- package/clients/cli/commands/experimental/icon.mjs +387 -229
- package/clients/cli/commands/experimental/import.mjs +70 -0
- package/clients/cli/commands/experimental/index.mjs +152 -13
- package/clients/cli/commands/experimental/render-output.mjs +242 -0
- package/clients/cli/commands/experimental/theme.mjs +69 -23
- package/clients/cli/commands/experimental-export.doc.mjs +73 -0
- package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
- package/clients/cli/commands/experimental-import.doc.mjs +53 -0
- package/clients/cli/commands/experimental-theme-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +7 -2
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme.doc.mjs +1 -1
- package/clients/cli/commands/experimental.doc.mjs +4 -4
- package/clients/cli/commands/init.doc.mjs +63 -31
- package/clients/cli/commands/integration-check.doc.mjs +1 -1
- package/clients/cli/commands/mcp.doc.mjs +57 -0
- package/clients/cli/commands/mcp.mjs +51 -0
- package/clients/cli/commands/search.mjs +78 -9
- package/clients/cli/commands/template.doc.mjs +14 -5
- package/clients/cli/commands/template.mjs +21 -2
- package/clients/cli/commands/theme-add.doc.mjs +6 -2
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme-remove.doc.mjs +1 -1
- package/clients/cli/commands/theme-targets.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +86 -5
- package/clients/cli/commands/upgrade.doc.mjs +2 -1
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +52 -6
- package/clients/cli/index.mjs +44 -37
- package/clients/cli/lib/cli-error.mjs +20 -10
- package/clients/cli/lib/component-format.mjs +167 -74
- package/clients/cli/lib/define-command.mjs +92 -4
- package/clients/cli/lib/hook-format.mjs +28 -24
- package/clients/cli/lib/json-shim.mjs +61 -4
- package/clients/cli/lib/manifest.mjs +9 -1
- package/clients/cli/lib/mcp-server.mjs +286 -0
- package/clients/cli/lib/mcp-tools.mjs +405 -0
- package/clients/cli/lib/other-cli-words.mjs +99 -0
- package/clients/cli/lib/renamed-commands.mjs +21 -0
- package/clients/cli/lib/root-args.mjs +10 -3
- package/clients/cli/lib/stray-option.mjs +79 -1
- package/clients/cli/lib/unknown-command.mjs +406 -13
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +27 -0
- package/foundation/agent-docs/agent-doc-state.d.mts +20 -2
- package/foundation/agent-docs/agent-doc-state.mjs +71 -4
- package/foundation/agent-docs/agent-docs.d.mts +79 -5
- package/foundation/agent-docs/agent-docs.mjs +137 -10
- package/foundation/agent-docs/computer-agent-text.d.mts +28 -14
- package/foundation/agent-docs/computer-agent-text.mjs +85 -172
- package/foundation/agent-docs/folder-scope.d.mts +51 -0
- package/foundation/agent-docs/folder-scope.mjs +86 -0
- package/foundation/agent-docs/managed-skill-file.d.mts +115 -0
- package/foundation/agent-docs/managed-skill-file.mjs +224 -0
- package/foundation/agent-docs/skill-place-files.d.mts +119 -0
- package/foundation/agent-docs/skill-place-files.mjs +374 -0
- package/foundation/agent-docs/skill-places.d.mts +139 -0
- package/foundation/agent-docs/skill-places.mjs +321 -0
- package/foundation/color/css-color.d.mts +150 -0
- package/foundation/color/css-color.mjs +960 -0
- package/foundation/config/config-path.d.mts +2 -2
- package/foundation/config/config-path.mjs +5 -6
- package/foundation/config/config-writer.d.mts +5 -1
- package/foundation/config/config-writer.mjs +20 -4
- package/foundation/config/project.d.mts +8 -5
- package/foundation/config/project.mjs +35 -17
- package/foundation/config/theme-state.d.mts +13 -0
- package/foundation/config/theme-state.mjs +28 -0
- package/foundation/debug/event.d.mts +2 -1
- package/foundation/debug/event.mjs +2 -1
- package/foundation/discovery/button-actions.d.mts +220 -0
- package/foundation/discovery/button-actions.mjs +1527 -0
- package/foundation/discovery/cli-self-docs.d.mts +7 -0
- package/foundation/discovery/cli-self-docs.mjs +67 -6
- package/foundation/discovery/color-modes.d.mts +14 -0
- package/foundation/discovery/color-modes.mjs +53 -0
- package/foundation/discovery/command-pointers.d.mts +21 -4
- package/foundation/discovery/command-pointers.mjs +25 -4
- package/foundation/discovery/component-discovery.d.mts +10 -0
- package/foundation/discovery/component-discovery.mjs +99 -43
- package/foundation/discovery/component-replacement.d.mts +8 -0
- package/foundation/discovery/component-replacement.mjs +13 -0
- package/foundation/discovery/core-augmentation-points.d.mts +90 -0
- package/foundation/discovery/core-augmentation-points.mjs +1030 -0
- package/foundation/discovery/core-component-views.d.mts +15 -0
- package/foundation/discovery/core-component-views.mjs +176 -0
- package/foundation/discovery/core-elements.d.mts +29 -0
- package/foundation/discovery/core-elements.mjs +57 -0
- package/foundation/discovery/core-prop-types.d.mts +65 -0
- package/foundation/discovery/core-prop-types.mjs +221 -0
- package/foundation/discovery/core-props.d.mts +33 -0
- package/foundation/discovery/core-props.mjs +64 -0
- package/foundation/discovery/doc-types.d.mts +10 -42
- package/foundation/discovery/doc-types.mjs +26 -7
- package/foundation/discovery/docs-discovery.d.mts +33 -2
- package/foundation/discovery/docs-discovery.mjs +149 -72
- package/foundation/discovery/docs-section-key.d.mts +21 -1
- package/foundation/discovery/docs-section-key.mjs +57 -19
- package/foundation/discovery/hook-discovery.d.mts +2 -0
- package/foundation/discovery/hook-discovery.mjs +6 -5
- package/foundation/discovery/icon-definition-discovery.d.mts +155 -3
- package/foundation/discovery/icon-definition-discovery.mjs +197 -5
- package/foundation/discovery/icon-imports.d.mts +66 -0
- package/foundation/discovery/icon-imports.mjs +225 -0
- package/foundation/discovery/icon-ranking.d.mts +118 -4
- package/foundation/discovery/icon-ranking.mjs +453 -59
- package/foundation/discovery/icon-set-checks.d.mts +2 -0
- package/foundation/discovery/icon-set-checks.mjs +16 -2
- package/foundation/discovery/icon-set-discovery.d.mts +68 -2
- package/foundation/discovery/icon-set-discovery.mjs +124 -23
- package/foundation/discovery/icon-set-writer.d.mts +9 -13
- package/foundation/discovery/icon-set-writer.mjs +89 -36
- package/foundation/discovery/integration-skills.d.mts +62 -0
- package/foundation/discovery/integration-skills.mjs +116 -0
- package/foundation/discovery/module-exports.d.mts +8 -0
- package/foundation/discovery/module-exports.mjs +20 -21
- package/foundation/discovery/name-roots.d.mts +5 -0
- package/foundation/discovery/name-roots.mjs +11 -0
- package/foundation/discovery/package-exports.d.mts +22 -0
- package/foundation/discovery/package-exports.mjs +44 -3
- package/foundation/discovery/project-typescript.d.mts +5 -1
- package/foundation/discovery/project-typescript.mjs +8 -2
- package/foundation/discovery/prop-drift.d.mts +16 -0
- package/foundation/discovery/prop-drift.mjs +154 -3
- package/foundation/discovery/replacement-aliases.d.mts +51 -0
- package/foundation/discovery/replacement-aliases.mjs +95 -0
- package/foundation/discovery/runner-allowlist.d.mts +2 -1
- package/foundation/discovery/runner-allowlist.mjs +3 -1
- package/foundation/discovery/runner-commands.mjs +1 -0
- package/foundation/discovery/stored-component-list.mjs +34 -2
- package/foundation/discovery/template-adapter.d.mts +27 -1
- package/foundation/discovery/template-adapter.mjs +221 -10
- package/foundation/discovery/template-destination.d.mts +14 -6
- package/foundation/discovery/template-destination.mjs +42 -8
- package/foundation/discovery/template-icon-meanings.d.mts +7 -2
- package/foundation/discovery/template-icon-meanings.mjs +52 -12
- package/foundation/discovery/template-icons.d.mts +46 -3
- package/foundation/discovery/template-icons.mjs +72 -109
- package/foundation/discovery/template-needs.d.mts +34 -5
- package/foundation/discovery/template-needs.mjs +164 -22
- package/foundation/discovery/template-placeholders.d.mts +149 -0
- package/foundation/discovery/template-placeholders.mjs +463 -0
- package/foundation/discovery/template-source-tree.d.mts +6 -3
- package/foundation/discovery/template-source-tree.mjs +8 -5
- package/foundation/discovery/theme-discovery.d.mts +8 -0
- package/foundation/discovery/theme-discovery.mjs +23 -6
- package/foundation/discovery/theme-imports.d.mts +1 -3
- package/foundation/discovery/theme-imports.mjs +5 -30
- package/foundation/doc-compiler/compile.mjs +6 -8
- package/foundation/doc-compiler/doc-syntax.d.mts +25 -1
- package/foundation/doc-compiler/doc-syntax.mjs +85 -10
- package/foundation/doc-compiler/doc-text.d.mts +52 -0
- package/foundation/doc-compiler/doc-text.mjs +176 -0
- package/foundation/doc-compiler/links.d.mts +8 -2
- package/foundation/doc-compiler/links.mjs +27 -6
- package/foundation/doc-compiler/read.d.mts +1 -1
- package/foundation/doc-compiler/stored-docs.d.mts +14 -3
- package/foundation/doc-compiler/stored-docs.mjs +12 -6
- package/foundation/env/cli-command.d.mts +68 -10
- package/foundation/env/cli-command.mjs +116 -22
- package/foundation/env/package-manager.d.mts +33 -2
- package/foundation/env/package-manager.mjs +68 -6
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +28 -2
- package/foundation/env/user-dirs.d.mts +14 -0
- package/foundation/env/user-dirs.mjs +34 -1
- package/foundation/env/user-settings.d.mts +15 -0
- package/foundation/env/user-settings.mjs +56 -2
- package/foundation/fonts/font-stylesheet.d.mts +11 -0
- package/foundation/fonts/font-stylesheet.mjs +62 -7
- package/foundation/fs/cache-eviction.d.mts +7 -5
- package/foundation/fs/cache-eviction.mjs +20 -13
- package/foundation/fs/empty-folder.d.mts +12 -0
- package/foundation/fs/empty-folder.mjs +30 -0
- package/foundation/fs/file-protection.d.mts +11 -0
- package/foundation/fs/file-protection.mjs +49 -3
- package/foundation/fs/gather-cache.d.mts +14 -7
- package/foundation/fs/gather-cache.mjs +163 -67
- package/foundation/fs/import-url.d.mts +7 -5
- package/foundation/fs/import-url.mjs +7 -5
- package/foundation/fs/jiti-cache.d.mts +47 -26
- package/foundation/fs/jiti-cache.mjs +222 -130
- package/foundation/fs/loaded-files.d.mts +15 -1
- package/foundation/fs/loaded-files.mjs +40 -3
- package/foundation/fs/module-loader.d.mts +3 -1
- package/foundation/fs/module-loader.mjs +85 -5
- package/foundation/fs/path-safety.d.mts +1 -0
- package/foundation/fs/path-safety.mjs +2 -0
- package/foundation/fs/read-record.mjs +9 -5
- package/foundation/fs/relative-specifier.d.mts +10 -0
- package/foundation/fs/relative-specifier.mjs +28 -0
- package/foundation/integrations/computer-integrations.mjs +11 -10
- package/foundation/integrations/icon-features.d.mts +63 -0
- package/foundation/integrations/icon-features.mjs +54 -0
- package/foundation/integrations/integration-warnings.d.mts +10 -0
- package/foundation/integrations/integration-warnings.mjs +12 -3
- package/foundation/integrations/integrations.d.mts +16 -2
- package/foundation/integrations/integrations.mjs +50 -8
- package/foundation/integrations/may-have-integrations.mjs +7 -6
- package/foundation/integrations/provider-resolution.mjs +19 -2
- package/foundation/integrations/validate-contributions.d.mts +13 -3
- package/foundation/integrations/validate-contributions.mjs +64 -13
- package/foundation/release/agent-text-worker.mjs +33 -1
- package/foundation/release/cache.d.mts +48 -3
- package/foundation/release/cache.mjs +196 -20
- package/foundation/release/choose.d.mts +5 -2
- package/foundation/release/choose.mjs +54 -4
- package/foundation/release/global-state.mjs +10 -2
- package/foundation/release/handoff.mjs +7 -1
- package/foundation/release/notices.d.mts +97 -9
- package/foundation/release/notices.mjs +421 -59
- package/foundation/release/project.d.mts +21 -4
- package/foundation/release/project.mjs +74 -42
- package/foundation/release/run-context.d.mts +6 -0
- package/foundation/release/run-context.mjs +9 -0
- package/foundation/render/assets.d.mts +7 -0
- package/foundation/render/assets.mjs +30 -17
- package/foundation/render/charts.d.mts +11 -10
- package/foundation/render/charts.mjs +112 -1
- package/foundation/render/class-alias.d.mts +23 -0
- package/foundation/render/class-alias.mjs +333 -0
- package/foundation/render/client-bundle.d.mts +183 -0
- package/foundation/render/client-bundle.mjs +1026 -0
- package/foundation/render/component-map.mjs +1 -1
- package/foundation/render/css-cut.d.mts +26 -0
- package/foundation/render/css-cut.mjs +344 -2
- package/foundation/render/cut-short.d.mts +7 -1
- package/foundation/render/cut-short.mjs +46 -6
- package/foundation/render/dropped-text.d.mts +43 -0
- package/foundation/render/dropped-text.mjs +90 -0
- package/foundation/render/embedded-files.d.mts +24 -1
- package/foundation/render/embedded-files.mjs +41 -4
- package/foundation/render/embedded-imports.d.mts +72 -12
- package/foundation/render/embedded-imports.mjs +206 -70
- package/foundation/render/esbuild-dependency.d.mts +14 -0
- package/foundation/render/esbuild-dependency.mjs +41 -0
- package/foundation/render/file-header.d.mts +7 -2
- package/foundation/render/file-header.mjs +19 -10
- package/foundation/render/html-reader.d.mts +36 -17
- package/foundation/render/html-reader.mjs +239 -32
- package/foundation/render/image-attributes.d.mts +25 -0
- package/foundation/render/image-attributes.mjs +33 -0
- package/foundation/render/markup-edits.mjs +1 -1
- package/foundation/render/package-resolve-hooks.d.mts +54 -0
- package/foundation/render/package-resolve-hooks.mjs +144 -0
- package/foundation/render/page-host.mjs +1 -1
- package/foundation/render/page-worker.mjs +1307 -107
- package/foundation/render/picture-chrome.mjs +54 -29
- package/foundation/render/picture-playwright.mjs +78 -42
- package/foundation/render/picture-window.d.mts +44 -5
- package/foundation/render/picture-window.mjs +265 -19
- package/foundation/render/rebuild.mjs +2 -2
- package/foundation/render/remote-images.d.mts +83 -0
- package/foundation/render/remote-images.mjs +384 -0
- package/foundation/render/render-page.d.mts +219 -8
- package/foundation/render/render-page.mjs +1702 -165
- package/foundation/render/restore-folder.d.mts +13 -0
- package/foundation/render/restore-folder.mjs +30 -0
- package/foundation/render/served-packages.d.mts +14 -1
- package/foundation/render/served-packages.mjs +50 -6
- package/foundation/render/share-checks.d.mts +35 -0
- package/foundation/render/share-checks.mjs +95 -0
- package/foundation/render/source-block.d.mts +14 -3
- package/foundation/render/source-block.mjs +44 -9
- package/foundation/render/srcset.d.mts +32 -0
- package/foundation/render/srcset.mjs +64 -0
- package/foundation/render/ts-paths.d.mts +52 -1
- package/foundation/render/ts-paths.mjs +114 -4
- package/foundation/render/value-uses.d.mts +43 -0
- package/foundation/render/value-uses.mjs +110 -0
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.doc.mjs +16 -10
- package/foundation/response/error-codes.mjs +19 -8
- package/foundation/response/json.d.mts +0 -15
- package/foundation/response/json.mjs +1 -51
- package/foundation/response/response-types.doc.mjs +28 -17
- package/foundation/runtime/css-tree.d.mts +16 -0
- package/foundation/runtime/css-tree.mjs +46 -3
- package/foundation/runtime/lazy-dependencies.d.mts +7 -0
- package/foundation/runtime/lazy-dependencies.mjs +25 -3
- package/foundation/runtime/locked-versions.d.mts +4 -2
- package/foundation/runtime/locked-versions.mjs +18 -10
- package/foundation/runtime/package-root.d.mts +25 -0
- package/foundation/runtime/package-root.mjs +48 -0
- package/foundation/runtime/word-table.d.mts +18 -0
- package/foundation/runtime/word-table.mjs +33 -0
- package/foundation/suggest/other-command.d.mts +23 -0
- package/foundation/suggest/other-command.mjs +49 -5
- package/foundation/text/default-variant.d.mts +20 -0
- package/foundation/text/default-variant.mjs +24 -0
- package/foundation/text/definition-coverage.d.mts +21 -0
- package/foundation/text/definition-coverage.mjs +20 -0
- package/foundation/text/icon-id.d.mts +20 -0
- package/foundation/text/icon-id.mjs +40 -0
- package/foundation/text/icon-set-next.d.mts +26 -0
- package/foundation/text/icon-set-next.mjs +37 -0
- package/foundation/text/string-utils.mjs +14 -41
- package/foundation/text/suggest-order.d.mts +10 -4
- package/foundation/text/suggest-order.mjs +20 -13
- package/package.json +8 -6
- package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +0 -394
- package/assets/docs/tree/render-pages.doc.mjs +0 -135
- package/clients/cli/commands/experimental/render.mjs +0 -154
- package/clients/cli/commands/experimental-render.doc.mjs +0 -73
|
@@ -49,7 +49,9 @@
|
|
|
49
49
|
*
|
|
50
50
|
* With `{check: true}`, it compiles the same outputs in memory but writes
|
|
51
51
|
* nothing: it compares each generated file against what is on disk (ignoring
|
|
52
|
-
*
|
|
52
|
+
* the `@generated` header's volatile `Command:` line, the release its `CLI:`
|
|
53
|
+
* line names, and the command a built module's built-by line names) and
|
|
54
|
+
* returns a
|
|
53
55
|
* `theme.build.check` receipt listing any stale or missing outputs. This is
|
|
54
56
|
* the CI guard for committed, generated theme CSS: the source of truth is
|
|
55
57
|
* `<theme>.ts`, and `theme build --check` fails when the committed
|
|
@@ -63,6 +65,7 @@ import * as os from 'node:os';
|
|
|
63
65
|
import * as path from 'node:path';
|
|
64
66
|
import {createRequire, isBuiltin} from 'node:module';
|
|
65
67
|
import {moduleImports} from '../../../foundation/render/embedded-imports.mjs';
|
|
68
|
+
import {projectMapsImport} from '../../../foundation/render/ts-paths.mjs';
|
|
66
69
|
import {STYLESHEET_FILE} from '../../../foundation/fs/stylesheet-file.mjs';
|
|
67
70
|
import {fileURLToPath, pathToFileURL} from 'node:url';
|
|
68
71
|
import {babelParse as parse} from '../../../foundation/runtime/lazy-dependencies.mjs';
|
|
@@ -72,6 +75,10 @@ import {
|
|
|
72
75
|
getCliInvocation,
|
|
73
76
|
quoteCommandArgument,
|
|
74
77
|
} from '../../../foundation/env/package-manager.mjs';
|
|
78
|
+
import {
|
|
79
|
+
componentHasAugmentableInterface as componentDeclaresInterface,
|
|
80
|
+
resolveAugmentationTarget as resolveCoreAugmentationTarget,
|
|
81
|
+
} from '../../../foundation/discovery/core-augmentation-points.mjs';
|
|
75
82
|
import {
|
|
76
83
|
CLI_ROOT,
|
|
77
84
|
findCoreDir,
|
|
@@ -109,32 +116,56 @@ import {
|
|
|
109
116
|
formatBatchFontLoadingHelp,
|
|
110
117
|
formatFontLoadingHelp,
|
|
111
118
|
} from './font-warning.mjs';
|
|
112
|
-
import {interceptCore} from './core-interception.mjs';
|
|
119
|
+
import {interceptCore, withVirtualModules} from './core-interception.mjs';
|
|
113
120
|
import {irregularFileKind} from '../../../foundation/fs/regular-file.mjs';
|
|
114
|
-
import {
|
|
121
|
+
import {extendsOf, moduleBindings, themeObjectOf} from './theme-object.mjs';
|
|
122
|
+
import {generatedSource} from '../../../foundation/fs/file-protection.mjs';
|
|
123
|
+
import {
|
|
124
|
+
keyPathIndex,
|
|
125
|
+
keyPathLine,
|
|
126
|
+
keyValueLine,
|
|
127
|
+
nullThemeValues,
|
|
128
|
+
} from './null-values.mjs';
|
|
115
129
|
import {typographyInputProblems} from './typography-values.mjs';
|
|
130
|
+
import {radiusInputProblems} from './radius-values.mjs';
|
|
116
131
|
import {sourcePlugins} from './source-syntax.mjs';
|
|
117
132
|
import {
|
|
118
133
|
INPUT_DECLARATION_FILES,
|
|
119
134
|
inputFieldsFrom,
|
|
120
135
|
sourceFieldProblems,
|
|
121
136
|
inputFieldProblems,
|
|
137
|
+
sourceInputField,
|
|
122
138
|
sourceTypography,
|
|
123
139
|
} from './input-fields.mjs';
|
|
124
|
-
import {
|
|
140
|
+
import {
|
|
141
|
+
holdsOnlyVariantMaps,
|
|
142
|
+
styleKeyProblems,
|
|
143
|
+
withoutVariantMaps,
|
|
144
|
+
} from './style-keys.mjs';
|
|
125
145
|
import {
|
|
126
146
|
bigIntAsText,
|
|
127
147
|
writtenPrimitives,
|
|
128
148
|
writtenValueProblems,
|
|
129
149
|
} from './written-values.mjs';
|
|
150
|
+
import {
|
|
151
|
+
settingEffectIssues,
|
|
152
|
+
settingIssueEntries,
|
|
153
|
+
blockPaths,
|
|
154
|
+
declarationPaths,
|
|
155
|
+
settingIssueLocation,
|
|
156
|
+
splitGeneratedIssues,
|
|
157
|
+
generatedNotesByFile,
|
|
158
|
+
} from './setting-effects.mjs';
|
|
130
159
|
import {levenshteinDistance} from '../../../foundation/text/levenshtein.mjs';
|
|
131
160
|
import {
|
|
132
161
|
installCommandFor,
|
|
162
|
+
installStepFor,
|
|
133
163
|
parsedSpecifiers,
|
|
134
164
|
} from '../../../foundation/discovery/template-needs.mjs';
|
|
135
165
|
import {generateFamilyCSS, resolveThemeFamily} from './family.mjs';
|
|
136
166
|
import {resolveIconImports} from './icon-imports.mjs';
|
|
137
167
|
import {selfContainedImports} from './self-contained.mjs';
|
|
168
|
+
import {importSpecifier} from './import-specifier.mjs';
|
|
138
169
|
import {THEME_BUILD_MARKER} from '../../../foundation/config/theme-build-header.mjs';
|
|
139
170
|
import {generatedMark} from '../../theme-edit/_marks.mjs';
|
|
140
171
|
|
|
@@ -605,6 +636,15 @@ function inAstryxRepository(cwd) {
|
|
|
605
636
|
return false;
|
|
606
637
|
}
|
|
607
638
|
|
|
639
|
+
/**
|
|
640
|
+
* The step that installs Core in the project at `cwd`, as message text.
|
|
641
|
+
* @param {string} cwd
|
|
642
|
+
*/
|
|
643
|
+
function coreInstallText(cwd) {
|
|
644
|
+
const {line, note} = installStepFor(['@astryxdesign/core'], cwd);
|
|
645
|
+
return note ? `\`${line}\` (${note})` : `\`${line}\``;
|
|
646
|
+
}
|
|
647
|
+
|
|
608
648
|
/**
|
|
609
649
|
* Why `theme build` has no Core to generate with, and the fix for where it
|
|
610
650
|
* ran: the Astryx repository builds Core, an app installs it, and an installed
|
|
@@ -632,7 +672,7 @@ export function coreUnavailableMessage(cwd, importError) {
|
|
|
632
672
|
}
|
|
633
673
|
return (
|
|
634
674
|
`This project does not have @astryxdesign/core installed: ${why}. Install ` +
|
|
635
|
-
`it:
|
|
675
|
+
`it: ${coreInstallText(cwd)}.${detail}`
|
|
636
676
|
);
|
|
637
677
|
}
|
|
638
678
|
|
|
@@ -657,8 +697,9 @@ function readPkgVersion(dir) {
|
|
|
657
697
|
/**
|
|
658
698
|
* Resolve the CLI and core package versions recorded in generated headers.
|
|
659
699
|
* These are stable (unlike a timestamp): identical inputs produce byte-identical
|
|
660
|
-
* output, so rebuilds don't churn git
|
|
661
|
-
* content-drift signal
|
|
700
|
+
* output, so rebuilds don't churn git. `theme build --check` ignores the CLI
|
|
701
|
+
* version (normalizeThemeBuildForCompare), so it stays a content-drift signal
|
|
702
|
+
* whichever CLI release answers.
|
|
662
703
|
* @param {string} cwd - Consumer cwd, used to locate the installed core.
|
|
663
704
|
* @returns {{cli: string, core: string}}
|
|
664
705
|
*/
|
|
@@ -690,6 +731,56 @@ function headerRoot(outDir, cwd) {
|
|
|
690
731
|
return findPackageRoot(outDir) ?? path.resolve(cwd);
|
|
691
732
|
}
|
|
692
733
|
|
|
734
|
+
/**
|
|
735
|
+
* Whether a file is an output of some released `theme build`: its header has
|
|
736
|
+
* the build's mark, or, with `legacy`, a mark or shape of the CLI before it
|
|
737
|
+
* was named Astryx: its header's mark, or for its releases that wrote no
|
|
738
|
+
* header, the shape they wrote: a stylesheet in the `xds.theme`,
|
|
739
|
+
* `xds-theme` or `reset` layer scoped to `[data-xds-theme=…]`, a module
|
|
740
|
+
* that says it was built by `xds theme build` (`xds build-theme` at first),
|
|
741
|
+
* declarations of a built theme with their import, or variant declarations
|
|
742
|
+
* that open with `// Generated by xds theme build`.
|
|
743
|
+
* @param {string} file
|
|
744
|
+
* @param {{legacy?: boolean}} [options]
|
|
745
|
+
*/
|
|
746
|
+
function isBuildOutput(file, {legacy = false} = {}) {
|
|
747
|
+
const head = fileHead(file);
|
|
748
|
+
if (head.includes(GENERATED_MARKER)) return true;
|
|
749
|
+
if (!legacy) return false;
|
|
750
|
+
if (head.includes(LEGACY_BUILD_MARKER)) return true;
|
|
751
|
+
const text = head.trimStart();
|
|
752
|
+
if (/\.css$/i.test(file))
|
|
753
|
+
return (
|
|
754
|
+
/^@layer (?:xds\.theme|xds-theme|reset) \{/.test(text) &&
|
|
755
|
+
text.includes('[data-xds-theme=')
|
|
756
|
+
);
|
|
757
|
+
if (/\.d\.ts$/i.test(file)) {
|
|
758
|
+
// A theme's variant declarations (`<theme>.variants.d.ts`) opened with
|
|
759
|
+
// this line in those releases.
|
|
760
|
+
if (text.startsWith('// Generated by xds theme build')) return true;
|
|
761
|
+
const lines = text
|
|
762
|
+
.split('\n')
|
|
763
|
+
.map(line => line.trim())
|
|
764
|
+
.filter(Boolean);
|
|
765
|
+
return (
|
|
766
|
+
lines.includes(
|
|
767
|
+
"import type { XDSDefinedTheme } from '@xds/core/theme';",
|
|
768
|
+
) &&
|
|
769
|
+
lines.every(line =>
|
|
770
|
+
/^(?:import type \{[^}]*\} from '@xds\/core[^']*';|export declare const [A-Za-z_$][\w$]*: [A-Za-z_$][\w$]*;)$/.test(
|
|
771
|
+
line,
|
|
772
|
+
),
|
|
773
|
+
)
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
if (/\.js$/i.test(file))
|
|
777
|
+
return /theme — built by `[^`]*xds (?:theme build|build-theme)`/.test(head);
|
|
778
|
+
return false;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/** The mark headers of the CLI carried before it was named Astryx. */
|
|
782
|
+
const LEGACY_BUILD_MARKER = '@generated by `xds theme build`';
|
|
783
|
+
|
|
693
784
|
/**
|
|
694
785
|
* Whether a build refuses to replace, at a path `--out` names, the output of
|
|
695
786
|
* another theme source that still exists. False makes it warn and replace.
|
|
@@ -772,29 +863,103 @@ function generatedHeader(sourceFile, lang = 'js', command, versions) {
|
|
|
772
863
|
}
|
|
773
864
|
|
|
774
865
|
/**
|
|
775
|
-
*
|
|
776
|
-
*
|
|
777
|
-
*
|
|
778
|
-
*
|
|
779
|
-
* `--check`: a differing command must NOT report a file as stale, but any real
|
|
780
|
-
* content drift must. The `CLI:`/`Core:` provenance lines are deterministic
|
|
781
|
-
* for a given toolchain, so they compare verbatim like real content. CRLF
|
|
782
|
-
* line endings read as LF.
|
|
866
|
+
* Generated file content without the volatile `Command:` line of the
|
|
867
|
+
* `@generated` header (it embeds the invocation, e.g. an explicit --out).
|
|
868
|
+
* CRLF line endings read as LF, since a checkout may turn line endings into
|
|
869
|
+
* CRLF.
|
|
783
870
|
* @param {string} content
|
|
784
871
|
* @returns {string}
|
|
785
872
|
*/
|
|
786
|
-
export function
|
|
787
|
-
// A checkout may turn line endings into CRLF; the text is the same.
|
|
873
|
+
export function withoutBuildCommandLine(content) {
|
|
788
874
|
return content
|
|
789
875
|
.replace(/\r\n/g, '\n')
|
|
790
876
|
.split('\n')
|
|
791
|
-
.filter(line =>
|
|
792
|
-
const t = line.replace(/^\s*\*?\s?/, '');
|
|
793
|
-
return !t.startsWith('Command:');
|
|
794
|
-
})
|
|
877
|
+
.filter(line => !headerText(line).startsWith('Command:'))
|
|
795
878
|
.join('\n');
|
|
796
879
|
}
|
|
797
880
|
|
|
881
|
+
/** @param {string} line */
|
|
882
|
+
function headerText(line) {
|
|
883
|
+
return line.replace(/^\s*\*?\s?/, '');
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* The line of a built module's doc comment that names the command that built
|
|
888
|
+
* it (`<name> theme — built by \`<command> theme build\``). The command
|
|
889
|
+
* depends on how the CLI was started: the package manager, or a tool that
|
|
890
|
+
* runs the CLI for its users.
|
|
891
|
+
*/
|
|
892
|
+
export const BUILT_BY_LINE =
|
|
893
|
+
/^( \* \S(?:.*\S)? theme — built by `)(\S(?:.*\S)?)( theme build`)(\s*)$/u;
|
|
894
|
+
|
|
895
|
+
/** The `@generated` header's line that names the CLI release that built it. */
|
|
896
|
+
export const CLI_VERSION_LINE = /^( \* CLI: @astryxdesign\/cli@)(\S+)(\s*)$/u;
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* `lines` with the command in a built module's built-by line as
|
|
900
|
+
* `<command>`, when exactly one line is a built-by line; otherwise unchanged,
|
|
901
|
+
* so a second or a malformed line stays significant.
|
|
902
|
+
* @param {string[]} lines
|
|
903
|
+
* @returns {string[]}
|
|
904
|
+
*/
|
|
905
|
+
export function withBuiltByCommandPlaceholder(lines) {
|
|
906
|
+
if (lines.filter(line => BUILT_BY_LINE.test(line)).length !== 1) return lines;
|
|
907
|
+
return lines.map(line => line.replace(BUILT_BY_LINE, '$1<command>$3$4'));
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* The index of the line that closes a file's first comment, the header a
|
|
912
|
+
* build writes, or -1 when the file does not start with a comment.
|
|
913
|
+
* @param {string[]} lines
|
|
914
|
+
* @returns {number}
|
|
915
|
+
*/
|
|
916
|
+
export function generatedHeaderEnd(lines) {
|
|
917
|
+
if (lines[0] !== '/*' && lines[0] !== '/**') return -1;
|
|
918
|
+
return lines.indexOf(' */', 1);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* `lines` with the release in the header's `CLI:` line as `<version>`, when
|
|
923
|
+
* the header ({@link generatedHeaderEnd}) holds exactly one; otherwise
|
|
924
|
+
* unchanged, so a missing or second line, or one outside the header, stays
|
|
925
|
+
* significant.
|
|
926
|
+
* @param {string[]} lines
|
|
927
|
+
* @returns {string[]}
|
|
928
|
+
*/
|
|
929
|
+
export function withCliReleasePlaceholder(lines) {
|
|
930
|
+
const close = generatedHeaderEnd(lines);
|
|
931
|
+
if (close === -1) return lines;
|
|
932
|
+
const header = lines.slice(1, close);
|
|
933
|
+
if (header.filter(line => CLI_VERSION_LINE.test(line)).length !== 1) {
|
|
934
|
+
return lines;
|
|
935
|
+
}
|
|
936
|
+
return lines.map((line, index) =>
|
|
937
|
+
index < close ? line.replace(CLI_VERSION_LINE, '$1<version>$3') : line,
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* Normalize generated file content for staleness comparison: without the
|
|
943
|
+
* header's `Command:` line ({@link withoutBuildCommandLine}), with the release
|
|
944
|
+
* that the header's one `CLI:` line names as `<version>`
|
|
945
|
+
* ({@link withCliReleasePlaceholder}), and with the command in a built
|
|
946
|
+
* module's one {@link BUILT_BY_LINE} as `<command>`. Which release
|
|
947
|
+
* answers, and the command that starts it, depend on how the CLI was started
|
|
948
|
+
* (a global install, a tool that runs it, or the project's own copy) and
|
|
949
|
+
* change with each update, so the same outputs built another way are not
|
|
950
|
+
* stale. A header with no `CLI:` line or with two stays significant.
|
|
951
|
+
* Everything else, the `Core:` line and all real content included, is compared
|
|
952
|
+
* verbatim. Used only by `--check`: any real content drift reports a file as
|
|
953
|
+
* stale.
|
|
954
|
+
* @param {string} content
|
|
955
|
+
* @returns {string}
|
|
956
|
+
*/
|
|
957
|
+
export function normalizeThemeBuildForCompare(content) {
|
|
958
|
+
return withCliReleasePlaceholder(
|
|
959
|
+
withBuiltByCommandPlaceholder(withoutBuildCommandLine(content).split('\n')),
|
|
960
|
+
).join('\n');
|
|
961
|
+
}
|
|
962
|
+
|
|
798
963
|
/**
|
|
799
964
|
* The outputs that are missing or differ from what the build would write. A
|
|
800
965
|
* missing `.css.d.ts` stylesheet type stub (a write marked `warnWhenMissing`)
|
|
@@ -1319,7 +1484,10 @@ function assertThemeSourceFile(filePath, cwd, mode = {}) {
|
|
|
1319
1484
|
* `familyInterception` make the build a family member's plan.
|
|
1320
1485
|
* `colorModes` is the one color mode a calling command knows the theme has
|
|
1321
1486
|
* (the theme editor, from its settings), written into the built module.
|
|
1322
|
-
*
|
|
1487
|
+
* `ownsOutputs` says the caller made the folder the outputs go into and owns
|
|
1488
|
+
* every file there named like one (the theme editor's theme folder), so a
|
|
1489
|
+
* damaged or half-written output is replaced, never refused.
|
|
1490
|
+
* @typedef {{ownsOutputs?: boolean, prepareFamily?: boolean, familyLoader?: any, familyInterception?: any, writeRoot?: string, claimedOutputs?: Map<string, string>, deferredWrites?: Array<Array<{dest: string, content: string}>>, commandWords?: {group: string, build: string}, colorModes?: ['light'] | ['dark'] | null, fontHelp?: FontHelp | null, loadedFonts?: ((family: string) => boolean) | null, install?: string | null}} ThemeBuildHandOff
|
|
1323
1491
|
*/
|
|
1324
1492
|
|
|
1325
1493
|
/**
|
|
@@ -1449,17 +1617,20 @@ export function buildSuggestion(source, mode, cwd, words, shape = {}) {
|
|
|
1449
1617
|
/**
|
|
1450
1618
|
* Refuse a build that would replace a file it does not own. A build never
|
|
1451
1619
|
* writes over its input, two of its own outputs at one path, or an output
|
|
1452
|
-
* another theme in the same run already wrote. With `refuseUnmarked` (
|
|
1453
|
-
*
|
|
1454
|
-
*
|
|
1455
|
-
*
|
|
1620
|
+
* another theme in the same run already wrote. With `refuseUnmarked` (every
|
|
1621
|
+
* build but one whose caller owns the output folder), it also replaces only
|
|
1622
|
+
* outputs of a release of the build (isBuildOutput) and empty files, never
|
|
1623
|
+
* another file such as the user's own stylesheet, `package.json` or app
|
|
1624
|
+
* source.
|
|
1456
1625
|
* @param {Array<{dest: string}>} writes
|
|
1457
1626
|
* @param {string} filePath the theme source
|
|
1458
1627
|
* @param {string} cwd
|
|
1459
|
-
* @param {{claimed?: Map<string, string>, rerun?: (out: string | null) => string, refuseUnmarked?: boolean, warnUnmarked?: boolean, elsewhere?: string, onEditorFolder?: (warning: string) => void, onWarning?: (message: string) => void}} [options]
|
|
1628
|
+
* @param {{claimed?: Map<string, string>, rerun?: (out: string | null) => string, refuseUnmarked?: boolean, warnUnmarked?: boolean, acceptLegacy?: boolean, elsewhere?: string, onEditorFolder?: (warning: string) => void, onWarning?: (message: string) => void}} [options]
|
|
1460
1629
|
* `claimed`: outputs written earlier in this run, by the source that wrote
|
|
1461
1630
|
* them; `rerun`: this build's command with another --out, or without one;
|
|
1462
|
-
* `
|
|
1631
|
+
* `acceptLegacy`: an output of the CLI before it was named Astryx counts
|
|
1632
|
+
* as the build's own (the default paths, where the build always replaced
|
|
1633
|
+
* them); `warnUnmarked` (with `refuseUnmarked`): a header-less file is replaced
|
|
1463
1634
|
* with a warning naming it, as a family build has always replaced one;
|
|
1464
1635
|
* `elsewhere`: the option that moves the outputs; `onEditorFolder`: takes
|
|
1465
1636
|
* the editor-folder warning instead of the logger (a watcher prints it
|
|
@@ -1474,6 +1645,7 @@ function assertOutputsReplaceable(
|
|
|
1474
1645
|
rerun,
|
|
1475
1646
|
refuseUnmarked = false,
|
|
1476
1647
|
warnUnmarked = false,
|
|
1648
|
+
acceptLegacy = false,
|
|
1477
1649
|
elsewhere = '--out',
|
|
1478
1650
|
onEditorFolder,
|
|
1479
1651
|
onWarning,
|
|
@@ -1553,8 +1725,6 @@ function assertOutputsReplaceable(
|
|
|
1553
1725
|
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
1554
1726
|
);
|
|
1555
1727
|
}
|
|
1556
|
-
// Only a path --out names is checked: at the default paths beside the
|
|
1557
|
-
// source, a build replaces what is there, as it always has.
|
|
1558
1728
|
const otherSource = refuseUnmarked
|
|
1559
1729
|
? builtFromOtherSource(write.dest, owner, cwd)
|
|
1560
1730
|
: null;
|
|
@@ -1571,33 +1741,29 @@ function assertOutputsReplaceable(
|
|
|
1571
1741
|
ERROR_CODES.ERR_FILE_EXISTS,
|
|
1572
1742
|
);
|
|
1573
1743
|
}
|
|
1574
|
-
//
|
|
1575
|
-
//
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
) {
|
|
1744
|
+
// A file no release of the build wrote is the user's or another
|
|
1745
|
+
// tool's: only the user can say it may go.
|
|
1746
|
+
// A family build keeps its released rule: a file without the current
|
|
1747
|
+
// mark is replaced with a warning naming it.
|
|
1748
|
+
const ours = isBuildOutput(write.dest, {legacy: acceptLegacy});
|
|
1749
|
+
if (refuseUnmarked && stat.size > 0 && !ours) {
|
|
1581
1750
|
if (warnUnmarked) {
|
|
1582
1751
|
unmarkedReplaced.push(rel(write.dest));
|
|
1583
1752
|
continue;
|
|
1584
1753
|
}
|
|
1585
|
-
//
|
|
1586
|
-
//
|
|
1754
|
+
// A path that takes every output, where nothing is replaced; never
|
|
1755
|
+
// the same paths again.
|
|
1587
1756
|
const free = freeOutPath(writes);
|
|
1588
1757
|
throw new AstryxError(
|
|
1589
|
-
`${rel(write.dest)} is a file this build did not write (it has no build header: your own file
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
: []),
|
|
1599
|
-
beside,
|
|
1600
|
-
],
|
|
1758
|
+
`${rel(write.dest)} is a file this build did not write (it has no build header: your own file or another tool's), so the build does not replace it. Build to another place with ${elsewhere}, or move or rename ${rel(write.dest)} and build again.`,
|
|
1759
|
+
free && rerun
|
|
1760
|
+
? [
|
|
1761
|
+
{
|
|
1762
|
+
name: rerun(rel(free)),
|
|
1763
|
+
reason: 'a path where no output of this build exists yet',
|
|
1764
|
+
},
|
|
1765
|
+
]
|
|
1766
|
+
: [],
|
|
1601
1767
|
ERROR_CODES.ERR_FILE_EXISTS,
|
|
1602
1768
|
);
|
|
1603
1769
|
}
|
|
@@ -1609,7 +1775,7 @@ function assertOutputsReplaceable(
|
|
|
1609
1775
|
onWarning?.(warnedOtherSource);
|
|
1610
1776
|
}
|
|
1611
1777
|
if (unmarkedReplaced.length) {
|
|
1612
|
-
const message = `${unmarkedReplaced.join(', ')} ${unmarkedReplaced.length > 1 ? 'have' : 'has'} no build header (an output
|
|
1778
|
+
const message = `${unmarkedReplaced.join(', ')} ${unmarkedReplaced.length > 1 ? 'have' : 'has'} no build header (an output of an earlier build, or a file of your own or another tool's), and this build of ${rel(filePath)} replaces ${unmarkedReplaced.length > 1 ? 'them' : 'it'}; to keep a file of your own there, build with another ${elsewhere}.`;
|
|
1613
1779
|
logger.warn(`Warning: ${message}`);
|
|
1614
1780
|
onWarning?.(message);
|
|
1615
1781
|
}
|
|
@@ -1774,54 +1940,19 @@ function toIdentifier(name) {
|
|
|
1774
1940
|
}
|
|
1775
1941
|
|
|
1776
1942
|
/**
|
|
1777
|
-
*
|
|
1778
|
-
*
|
|
1779
|
-
* to; callers pass the output folder from the outputs' project root): an output
|
|
1780
|
-
* under src/ is `./themes/gothic/gothic`, one beside src/ is
|
|
1781
|
-
* `../themes/gothic/gothic`.
|
|
1782
|
-
* @param {string} relDir the output folder, relative to the outputs' project root
|
|
1783
|
-
* @param {string} base
|
|
1784
|
-
* @returns {string}
|
|
1785
|
-
*/
|
|
1786
|
-
export function importSpecifier(relDir, base) {
|
|
1787
|
-
// An import specifier always uses `/`. On Windows the cwd-relative dir comes
|
|
1788
|
-
// from path.relative with `\`, which would print `./\themes\ocean/ocean`.
|
|
1789
|
-
const normalized = relDir === '.' ? '.' : relDir.split(path.sep).join('/');
|
|
1790
|
-
const fromSrc = path.posix.relative('src', normalized.replace(/\/+$/, ''));
|
|
1791
|
-
if (!fromSrc) return `./${base}`;
|
|
1792
|
-
// Only a parent step (`..` or `../…`), never a folder named like `..cache`.
|
|
1793
|
-
return fromSrc === '..' || fromSrc.startsWith('../')
|
|
1794
|
-
? `${fromSrc}/${base}`
|
|
1795
|
-
: `./${fromSrc}/${base}`;
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
/**
|
|
1799
|
-
* Convert a kebab-case component name to PascalCase.
|
|
1800
|
-
* e.g. 'button' → 'Button', 'progress-bar' → 'ProgressBar', 'avatar-status-dot' → 'AvatarStatusDot'
|
|
1801
|
-
* @param {string} name
|
|
1802
|
-
* @returns {string}
|
|
1943
|
+
* The known values index of each Core `src` folder.
|
|
1944
|
+
* @type {Map<string | null, Promise<Record<string, Record<string, string[]>>>>}
|
|
1803
1945
|
*/
|
|
1804
|
-
|
|
1805
|
-
return name
|
|
1806
|
-
.split('-')
|
|
1807
|
-
.map(
|
|
1808
|
-
(/** @type {string} */ part) =>
|
|
1809
|
-
part.charAt(0).toUpperCase() + part.slice(1),
|
|
1810
|
-
)
|
|
1811
|
-
.join('');
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
/** @type {Promise<Record<string, Record<string, string[]>>> | null} */
|
|
1815
|
-
let _knownValuesIndexPromise = null;
|
|
1946
|
+
const _knownValuesIndexes = new Map();
|
|
1816
1947
|
|
|
1817
1948
|
/**
|
|
1818
1949
|
* Build one target-keyed index of built-in visual-prop values from every core
|
|
1819
1950
|
* component doc. A rendered target often lives in a sibling doc (for example,
|
|
1820
1951
|
* `astryx-heading` is documented by Text/Heading.doc.mjs), so directory-name
|
|
1821
1952
|
* guessing is not a valid lookup strategy.
|
|
1953
|
+
* @param {string | null} coreSrc
|
|
1822
1954
|
*/
|
|
1823
|
-
async function loadKnownValuesIndex() {
|
|
1824
|
-
const coreSrc = coreSrcPath();
|
|
1955
|
+
async function loadKnownValuesIndex(coreSrc) {
|
|
1825
1956
|
if (!coreSrc || !fs.existsSync(coreSrc)) return {};
|
|
1826
1957
|
return (await coreThemeValues(coreSrc)).knownValues;
|
|
1827
1958
|
}
|
|
@@ -1831,255 +1962,94 @@ async function loadKnownValuesIndex() {
|
|
|
1831
1962
|
* @returns {Promise<Record<string, string[]>>}
|
|
1832
1963
|
*/
|
|
1833
1964
|
async function getKnownValues(componentName) {
|
|
1834
|
-
|
|
1835
|
-
|
|
1965
|
+
const coreSrc = coreSrcPath();
|
|
1966
|
+
let pending = _knownValuesIndexes.get(coreSrc);
|
|
1967
|
+
if (!pending) {
|
|
1968
|
+
pending = loadKnownValuesIndex(coreSrc);
|
|
1969
|
+
_knownValuesIndexes.set(coreSrc, pending);
|
|
1970
|
+
}
|
|
1971
|
+
const index = await pending;
|
|
1836
1972
|
return index[componentName] ?? {};
|
|
1837
1973
|
}
|
|
1838
1974
|
|
|
1839
1975
|
/**
|
|
1840
|
-
*
|
|
1841
|
-
*
|
|
1842
|
-
*
|
|
1843
|
-
*
|
|
1976
|
+
* The package root of the Core whose component docs and types the build reads:
|
|
1977
|
+
* the Core the build selected ({@link selectCore}), else the Core beside the
|
|
1978
|
+
* CLI. A copy installed for the computer has no Core beside it, so it reads
|
|
1979
|
+
* the project's Core once the build selects it, as the build itself does.
|
|
1980
|
+
* Returns null if neither can be found.
|
|
1981
|
+
* @returns {string | null}
|
|
1844
1982
|
*/
|
|
1845
1983
|
function resolveCoreRoot() {
|
|
1984
|
+
const selected = _coreThemeFile ? corePackageRoot(_coreThemeFile) : null;
|
|
1985
|
+
if (selected) return selected;
|
|
1986
|
+
// Core and the CLI ship as siblings, so `../../../../core` from
|
|
1987
|
+
// `api/theme/build/` reaches Core whether installed from npm or run inside
|
|
1988
|
+
// the monorepo.
|
|
1846
1989
|
const cliDir = path.dirname(fileURLToPath(import.meta.url));
|
|
1847
1990
|
const coreRoot = path.resolve(cliDir, '../../../../core');
|
|
1848
1991
|
return fs.existsSync(coreRoot) ? coreRoot : null;
|
|
1849
1992
|
}
|
|
1850
1993
|
|
|
1851
1994
|
/**
|
|
1852
|
-
* The
|
|
1853
|
-
* null
|
|
1995
|
+
* The folder at or above `file` whose package.json names `@astryxdesign/core`,
|
|
1996
|
+
* or null.
|
|
1997
|
+
* @param {string} file
|
|
1854
1998
|
* @returns {string | null}
|
|
1855
1999
|
*/
|
|
1856
|
-
function
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
* Read the type declarations `@astryxdesign/core/<Component>` exposes so we can
|
|
1863
|
-
* check whether a given augmentation-target interface actually exists before
|
|
1864
|
-
* generating a module augmentation against it.
|
|
1865
|
-
*
|
|
1866
|
-
* Reads the shipped `dist/<Component>/index.d.ts` (what a consumer's TypeScript
|
|
1867
|
-
* actually sees), falling back to the `src/<Component>/index.ts` in the
|
|
1868
|
-
* monorepo. Returns the file contents, or '' if nothing is found.
|
|
1869
|
-
*/
|
|
1870
|
-
/** @type {Map<string, string>} */
|
|
1871
|
-
const _componentDeclCache = new Map();
|
|
1872
|
-
/**
|
|
1873
|
-
* @param {string} pascalName
|
|
1874
|
-
* @param {{includeTypes?: boolean}} [options]
|
|
1875
|
-
* @returns {string}
|
|
1876
|
-
*/
|
|
1877
|
-
function readComponentDeclarations(pascalName, options = {}) {
|
|
1878
|
-
const includeTypes = options.includeTypes === true;
|
|
1879
|
-
const cacheKey = `${pascalName}:${includeTypes ? 'with-types' : 'index-only'}`;
|
|
1880
|
-
if (_componentDeclCache.has(cacheKey)) {
|
|
1881
|
-
return _componentDeclCache.get(cacheKey) ?? '';
|
|
1882
|
-
}
|
|
1883
|
-
let contents = '';
|
|
1884
|
-
const coreRoot = resolveCoreRoot();
|
|
1885
|
-
if (coreRoot) {
|
|
1886
|
-
const candidateSets = [
|
|
1887
|
-
[path.join(coreRoot, 'dist', pascalName, 'index.d.ts')],
|
|
1888
|
-
[path.join(coreRoot, 'src', pascalName, 'index.ts')],
|
|
1889
|
-
];
|
|
1890
|
-
if (includeTypes) {
|
|
1891
|
-
candidateSets[0].push(
|
|
1892
|
-
path.join(coreRoot, 'dist', pascalName, 'types.d.ts'),
|
|
2000
|
+
function corePackageRoot(file) {
|
|
2001
|
+
let dir = path.dirname(file);
|
|
2002
|
+
for (;;) {
|
|
2003
|
+
try {
|
|
2004
|
+
const pkg = JSON.parse(
|
|
2005
|
+
fs.readFileSync(path.join(dir, 'package.json'), 'utf-8'),
|
|
1893
2006
|
);
|
|
1894
|
-
|
|
1895
|
-
}
|
|
1896
|
-
|
|
1897
|
-
if (fs.existsSync(files[0])) {
|
|
1898
|
-
for (const file of files) {
|
|
1899
|
-
try {
|
|
1900
|
-
if (fs.existsSync(file)) {
|
|
1901
|
-
contents += fs.readFileSync(file, 'utf-8') + '\n';
|
|
1902
|
-
}
|
|
1903
|
-
} catch {
|
|
1904
|
-
// ignore
|
|
1905
|
-
}
|
|
1906
|
-
}
|
|
1907
|
-
if (contents) break;
|
|
1908
|
-
}
|
|
2007
|
+
if (pkg?.name === '@astryxdesign/core') return dir;
|
|
2008
|
+
} catch {
|
|
2009
|
+
// No readable package.json here; keep walking up.
|
|
1909
2010
|
}
|
|
2011
|
+
const parent = path.dirname(dir);
|
|
2012
|
+
if (parent === dir) return null;
|
|
2013
|
+
dir = parent;
|
|
1910
2014
|
}
|
|
1911
|
-
_componentDeclCache.set(cacheKey, contents);
|
|
1912
|
-
return contents;
|
|
1913
2015
|
}
|
|
1914
2016
|
|
|
1915
|
-
/** @type {Map<string, Array<{moduleName: string, interfacePrefix: string}>>} */
|
|
1916
|
-
const _augmentationTargetCache = new Map();
|
|
1917
|
-
|
|
1918
2017
|
/**
|
|
1919
|
-
*
|
|
1920
|
-
*
|
|
1921
|
-
*
|
|
1922
|
-
* (`avatar-status-dot` augments `@astryxdesign/core/Avatar`). Component docs are
|
|
1923
|
-
* the source of truth for the target token → owning component relationship.
|
|
1924
|
-
*
|
|
1925
|
-
* @param {string} componentName
|
|
1926
|
-
* @returns {Promise<Array<{moduleName: string, interfacePrefix: string}>>}
|
|
2018
|
+
* The `src` folder of the Core the build reads ({@link resolveCoreRoot}), or
|
|
2019
|
+
* null when there is none.
|
|
2020
|
+
* @returns {string | null}
|
|
1927
2021
|
*/
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
_augmentationTargetCache.get(componentName)
|
|
1932
|
-
);
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
const fallback = [
|
|
1936
|
-
{
|
|
1937
|
-
moduleName: toPascalCase(componentName),
|
|
1938
|
-
interfacePrefix: toPascalCase(componentName),
|
|
1939
|
-
},
|
|
1940
|
-
];
|
|
1941
|
-
|
|
1942
|
-
const coreSrc = coreSrcPath();
|
|
1943
|
-
if (!coreSrc || !fs.existsSync(coreSrc)) {
|
|
1944
|
-
_augmentationTargetCache.set(componentName, fallback);
|
|
1945
|
-
return fallback;
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
/** @type {Array<{moduleName: string, interfacePrefix: string}>} */
|
|
1949
|
-
const matches = [];
|
|
1950
|
-
/** @type {Set<string>} */
|
|
1951
|
-
const seen = new Set();
|
|
1952
|
-
|
|
1953
|
-
/**
|
|
1954
|
-
* @param {string} moduleName
|
|
1955
|
-
* @param {string} interfacePrefix
|
|
1956
|
-
*/
|
|
1957
|
-
function addCandidate(moduleName, interfacePrefix) {
|
|
1958
|
-
const key = `${moduleName}:${interfacePrefix}`;
|
|
1959
|
-
if (seen.has(key)) return;
|
|
1960
|
-
seen.add(key);
|
|
1961
|
-
matches.push({moduleName, interfacePrefix});
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
const {owners} = await coreThemeValues(coreSrc);
|
|
1965
|
-
for (const {moduleName, components} of Object.hasOwn(owners, componentName)
|
|
1966
|
-
? owners[componentName]
|
|
1967
|
-
: []) {
|
|
1968
|
-
// Try the exact rendered token first for documented subtargets such as
|
|
1969
|
-
// avatar-status-dot → AvatarStatusDotVariantMap, then the owning public
|
|
1970
|
-
// component name (for example, ProgressBar for progress-bar-fill).
|
|
1971
|
-
addCandidate(moduleName, toPascalCase(componentName));
|
|
1972
|
-
addCandidate(moduleName, moduleName);
|
|
1973
|
-
for (const name of components) addCandidate(moduleName, name);
|
|
1974
|
-
}
|
|
1975
|
-
// A target documented by a parent component may also have its own public
|
|
1976
|
-
// subpath and augmentation interface (Heading is documented under Text but
|
|
1977
|
-
// owns @astryxdesign/core/Heading). Keep the direct-name candidate after
|
|
1978
|
-
// discovered owners so both shapes are reachable without guessing which one
|
|
1979
|
-
// the source tree uses.
|
|
1980
|
-
for (const candidate of fallback) {
|
|
1981
|
-
addCandidate(candidate.moduleName, candidate.interfacePrefix);
|
|
1982
|
-
}
|
|
1983
|
-
const resolved = matches;
|
|
1984
|
-
_augmentationTargetCache.set(componentName, resolved);
|
|
1985
|
-
return resolved;
|
|
2022
|
+
function coreSrcPath() {
|
|
2023
|
+
const coreRoot = resolveCoreRoot();
|
|
2024
|
+
return coreRoot ? path.join(coreRoot, 'src') : null;
|
|
1986
2025
|
}
|
|
1987
2026
|
|
|
1988
2027
|
/**
|
|
1989
|
-
*
|
|
1990
|
-
*
|
|
1991
|
-
*
|
|
1992
|
-
* Only interfaces are extension points — closed literal-union types (e.g.
|
|
1993
|
-
* `HeadingType`, `ButtonSize`) are NOT augmentable, so a generated augmentation
|
|
1994
|
-
* against them is dead code. We check that the name is exported (directly or
|
|
1995
|
-
* re-exported) as a type/interface.
|
|
2028
|
+
* Whether the Core the build reads declares `interfaceName` in
|
|
2029
|
+
* `@astryxdesign/core/<Component>` ({@link componentDeclaresInterface}).
|
|
1996
2030
|
* @param {string} pascalName
|
|
1997
2031
|
* @param {string} interfaceName
|
|
1998
2032
|
* @param {{includeTypes?: boolean}} [options]
|
|
1999
2033
|
* @returns {boolean}
|
|
2000
2034
|
*/
|
|
2001
2035
|
function componentHasAugmentableInterface(pascalName, interfaceName, options) {
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
// the type (e.g. Field re-exporting FieldStatusVariantMap) creates a dead
|
|
2008
|
-
// sibling interface for consumers of the real FieldStatus subpath.
|
|
2009
|
-
const re = new RegExp(String.raw`\binterface\s+${interfaceName}\b`);
|
|
2010
|
-
return re.test(decl);
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
/**
|
|
2014
|
-
* Public augmentable maps whose axis requests artwork instead of styling.
|
|
2015
|
-
* `Icon.variant` selects a theme's icon artwork, so it has no component styling
|
|
2016
|
-
* map (architecture:component-theming-surface INV14): a `components` key on it
|
|
2017
|
-
* never enrolls a value or generates an augmentation of its map.
|
|
2018
|
-
*/
|
|
2019
|
-
const ARTWORK_REQUEST_MAPS = new Set(['IconVariantMap']);
|
|
2020
|
-
|
|
2021
|
-
/**
|
|
2022
|
-
* Whether a theme's component styling keys may enroll values in `interfaceName`
|
|
2023
|
-
* on `@astryxdesign/core/<Component>`.
|
|
2024
|
-
* @param {string} pascalName
|
|
2025
|
-
* @param {string} interfaceName
|
|
2026
|
-
* @returns {boolean}
|
|
2027
|
-
*/
|
|
2028
|
-
function isComponentValueAugmentationPoint(pascalName, interfaceName) {
|
|
2029
|
-
return (
|
|
2030
|
-
!ARTWORK_REQUEST_MAPS.has(interfaceName) &&
|
|
2031
|
-
componentHasAugmentableInterface(pascalName, interfaceName)
|
|
2036
|
+
return componentDeclaresInterface(
|
|
2037
|
+
resolveCoreRoot(),
|
|
2038
|
+
pascalName,
|
|
2039
|
+
interfaceName,
|
|
2040
|
+
options,
|
|
2032
2041
|
);
|
|
2033
2042
|
}
|
|
2034
2043
|
|
|
2035
2044
|
/**
|
|
2036
|
-
*
|
|
2037
|
-
*
|
|
2038
|
-
* theme module, so both classification and declaration emission must resolve
|
|
2039
|
-
* this same public augmentation point.
|
|
2040
|
-
*
|
|
2041
|
-
* @type {Record<string, {moduleName: string, interfaceName: string, includeTypes?: boolean}>}
|
|
2042
|
-
*/
|
|
2043
|
-
const AUGMENTATION_OVERRIDES = {
|
|
2044
|
-
'text.type': {
|
|
2045
|
-
moduleName: 'theme',
|
|
2046
|
-
interfaceName: 'CustomTextTypes',
|
|
2047
|
-
includeTypes: true,
|
|
2048
|
-
},
|
|
2049
|
-
};
|
|
2050
|
-
|
|
2051
|
-
/**
|
|
2052
|
-
* Resolve the public module/interface that can widen a component prop value.
|
|
2045
|
+
* The public module/interface that can widen a component prop value, in the
|
|
2046
|
+
* Core the build reads ({@link resolveCoreAugmentationTarget}).
|
|
2053
2047
|
* @param {string} component
|
|
2054
2048
|
* @param {string} prop
|
|
2055
2049
|
* @returns {Promise<{moduleName: string, interfaceName: string}|null>}
|
|
2056
2050
|
*/
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
if (override) {
|
|
2060
|
-
return componentHasAugmentableInterface(
|
|
2061
|
-
override.moduleName,
|
|
2062
|
-
override.interfaceName,
|
|
2063
|
-
{includeTypes: override.includeTypes},
|
|
2064
|
-
)
|
|
2065
|
-
? {moduleName: override.moduleName, interfaceName: override.interfaceName}
|
|
2066
|
-
: null;
|
|
2067
|
-
}
|
|
2068
|
-
|
|
2069
|
-
const propPascal = prop.charAt(0).toUpperCase() + prop.slice(1);
|
|
2070
|
-
const target = (await resolveAugmentationTargetCandidates(component)).find(
|
|
2071
|
-
candidate =>
|
|
2072
|
-
isComponentValueAugmentationPoint(
|
|
2073
|
-
candidate.moduleName,
|
|
2074
|
-
`${candidate.interfacePrefix}${propPascal}Map`,
|
|
2075
|
-
),
|
|
2076
|
-
);
|
|
2077
|
-
return target
|
|
2078
|
-
? {
|
|
2079
|
-
moduleName: target.moduleName,
|
|
2080
|
-
interfaceName: `${target.interfacePrefix}${propPascal}Map`,
|
|
2081
|
-
}
|
|
2082
|
-
: null;
|
|
2051
|
+
function resolveAugmentationTarget(component, prop) {
|
|
2052
|
+
return resolveCoreAugmentationTarget(resolveCoreRoot(), component, prop);
|
|
2083
2053
|
}
|
|
2084
2054
|
|
|
2085
2055
|
/**
|
|
@@ -2736,13 +2706,14 @@ function resolveThemeModule(specifier, fromFile) {
|
|
|
2736
2706
|
* The sources of the themes a theme source extends, nearest first: the
|
|
2737
2707
|
* module each `extends: name` imports `name` from, when it is a relative
|
|
2738
2708
|
* import, then the one that module extends, a few hops at most. Empty when
|
|
2739
|
-
* the source extends nothing it imports.
|
|
2709
|
+
* the source extends nothing it imports. Each with the export of that
|
|
2710
|
+
* module the theme is built from (the name it is imported by).
|
|
2740
2711
|
* @param {string} filePath
|
|
2741
2712
|
* @param {string} source
|
|
2742
|
-
* @returns {Array<{file: string, source: string}>}
|
|
2713
|
+
* @returns {Array<{file: string, source: string, exportName: string}>}
|
|
2743
2714
|
*/
|
|
2744
2715
|
function extendedThemeSources(filePath, source) {
|
|
2745
|
-
/** @type {Array<{file: string, source: string}>} */
|
|
2716
|
+
/** @type {Array<{file: string, source: string, exportName: string}>} */
|
|
2746
2717
|
const chain = [];
|
|
2747
2718
|
let file = filePath;
|
|
2748
2719
|
let text = source;
|
|
@@ -2785,13 +2756,21 @@ function extendedThemeSources(filePath, source) {
|
|
|
2785
2756
|
st.specifiers.some((/** @type {any} */ x) => x.local?.name === base),
|
|
2786
2757
|
);
|
|
2787
2758
|
if (!from) return chain;
|
|
2759
|
+
// The name the file is imported by: the export it builds the base from.
|
|
2760
|
+
const spec = from.specifiers.find(
|
|
2761
|
+
(/** @type {any} */ x) => x.local?.name === base,
|
|
2762
|
+
);
|
|
2763
|
+
const exportName =
|
|
2764
|
+
spec?.type === 'ImportSpecifier'
|
|
2765
|
+
? (spec.imported.name ?? spec.imported.value)
|
|
2766
|
+
: 'default';
|
|
2788
2767
|
try {
|
|
2789
2768
|
file = resolveThemeModule(String(from.source.value), file);
|
|
2790
2769
|
text = fs.readFileSync(file, 'utf8');
|
|
2791
2770
|
} catch {
|
|
2792
2771
|
return chain;
|
|
2793
2772
|
}
|
|
2794
|
-
chain.push({file, source: text});
|
|
2773
|
+
chain.push({file, source: text, exportName});
|
|
2795
2774
|
}
|
|
2796
2775
|
return chain;
|
|
2797
2776
|
}
|
|
@@ -3101,16 +3080,20 @@ function isPlainObject(value) {
|
|
|
3101
3080
|
|
|
3102
3081
|
/**
|
|
3103
3082
|
* @param {any} value
|
|
3083
|
+
* @param {Set<any>} [seen] the themes already met on the way up its bases
|
|
3104
3084
|
* @returns {boolean}
|
|
3105
3085
|
*/
|
|
3106
|
-
function isThemeObject(value) {
|
|
3086
|
+
function isThemeObject(value, seen = new Set()) {
|
|
3087
|
+
if (seen.has(value)) return false;
|
|
3088
|
+
seen.add(value);
|
|
3107
3089
|
return Boolean(
|
|
3108
3090
|
value &&
|
|
3109
3091
|
typeof value === 'object' &&
|
|
3110
3092
|
typeof value.name === 'string' &&
|
|
3111
3093
|
((value.tokens && typeof value.tokens === 'object') ||
|
|
3112
|
-
// A theme with no tokens of its own over a base it extends
|
|
3113
|
-
|
|
3094
|
+
// A theme with no tokens of its own over a base it extends (a base
|
|
3095
|
+
// that reaches back to it is no theme: `extends` cycles).
|
|
3096
|
+
isThemeObject(value.extends, seen)),
|
|
3114
3097
|
);
|
|
3115
3098
|
}
|
|
3116
3099
|
|
|
@@ -3228,15 +3211,12 @@ export async function loadThemeExport(file, {cwd = process.cwd(), base} = {}) {
|
|
|
3228
3211
|
base.exportName,
|
|
3229
3212
|
)
|
|
3230
3213
|
).theme;
|
|
3231
|
-
const withBase =
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
),
|
|
3238
|
-
},
|
|
3239
|
-
};
|
|
3214
|
+
const withBase = withVirtualModules(
|
|
3215
|
+
recorder,
|
|
3216
|
+
Object.fromEntries(
|
|
3217
|
+
base.specifiers.map(s => [s, {[base.exportName]: shared}]),
|
|
3218
|
+
),
|
|
3219
|
+
);
|
|
3240
3220
|
const again = await extractThemeDefinition(
|
|
3241
3221
|
filePath,
|
|
3242
3222
|
withBase,
|
|
@@ -3458,14 +3438,15 @@ function themeLoadSuggestions(error, shown, cwd, mode = {}) {
|
|
|
3458
3438
|
];
|
|
3459
3439
|
const missing = missingThemePackage(error.cause ?? error);
|
|
3460
3440
|
if (missing) {
|
|
3461
|
-
const {installCommand} = installCommandFor(
|
|
3441
|
+
const {installCommand, installGuidance} = installCommandFor(
|
|
3462
3442
|
[missing],
|
|
3463
3443
|
findPackageRoot(cwd) ?? cwd,
|
|
3464
3444
|
);
|
|
3465
|
-
|
|
3445
|
+
const install = installGuidance ?? installCommand;
|
|
3446
|
+
if (install) {
|
|
3466
3447
|
return [
|
|
3467
3448
|
{
|
|
3468
|
-
name:
|
|
3449
|
+
name: install,
|
|
3469
3450
|
reason: `install ${missing}, which the theme imports`,
|
|
3470
3451
|
},
|
|
3471
3452
|
];
|
|
@@ -3522,70 +3503,6 @@ function importerOf(message) {
|
|
|
3522
3503
|
}
|
|
3523
3504
|
}
|
|
3524
3505
|
|
|
3525
|
-
/**
|
|
3526
|
-
* Whether the project that holds `from` maps `specifier` itself: the nearest
|
|
3527
|
-
* tsconfig.json or jsconfig.json names it in `compilerOptions.paths` (`@app/*`
|
|
3528
|
-
* maps `@app/c`), or its `baseUrl` holds the file (`lib/c`). The theme loader
|
|
3529
|
-
* maps neither, so such an import is a path alias, never a package.
|
|
3530
|
-
* @param {string} specifier
|
|
3531
|
-
* @param {string | null} from the importing module
|
|
3532
|
-
* @returns {boolean}
|
|
3533
|
-
*/
|
|
3534
|
-
export function projectMapsImport(specifier, from) {
|
|
3535
|
-
if (!from) return false;
|
|
3536
|
-
for (let dir = path.dirname(from); ; dir = path.dirname(dir)) {
|
|
3537
|
-
for (const name of ['tsconfig.json', 'jsconfig.json']) {
|
|
3538
|
-
const file = path.join(dir, name);
|
|
3539
|
-
/** @type {any} */
|
|
3540
|
-
let config;
|
|
3541
|
-
try {
|
|
3542
|
-
// JSON with comments and trailing commas, as TypeScript reads it.
|
|
3543
|
-
config = JSON.parse(
|
|
3544
|
-
fs
|
|
3545
|
-
.readFileSync(file, 'utf8')
|
|
3546
|
-
.replace(
|
|
3547
|
-
/("(?:[^"\\]|\\.)*")|\/\/[^\n]*|\/\*[\s\S]*?\*\//g,
|
|
3548
|
-
(m, str) => str ?? '',
|
|
3549
|
-
)
|
|
3550
|
-
.replace(/,(\s*[}\]])/g, '$1'),
|
|
3551
|
-
);
|
|
3552
|
-
} catch {
|
|
3553
|
-
continue;
|
|
3554
|
-
}
|
|
3555
|
-
const options = config?.compilerOptions ?? {};
|
|
3556
|
-
const paths = Object.keys(
|
|
3557
|
-
options.paths && typeof options.paths === 'object' ? options.paths : {},
|
|
3558
|
-
);
|
|
3559
|
-
if (
|
|
3560
|
-
paths.some(pattern =>
|
|
3561
|
-
pattern.endsWith('*')
|
|
3562
|
-
? specifier.startsWith(pattern.slice(0, -1))
|
|
3563
|
-
: specifier === pattern,
|
|
3564
|
-
)
|
|
3565
|
-
)
|
|
3566
|
-
return true;
|
|
3567
|
-
if (typeof options.baseUrl === 'string') {
|
|
3568
|
-
const base = path.resolve(dir, options.baseUrl, specifier);
|
|
3569
|
-
if (
|
|
3570
|
-
['', ...THEME_MODULE_EXTENSIONS].some(ext => {
|
|
3571
|
-
try {
|
|
3572
|
-
return fs.statSync(base + ext).isFile();
|
|
3573
|
-
} catch {
|
|
3574
|
-
return false;
|
|
3575
|
-
}
|
|
3576
|
-
}) ||
|
|
3577
|
-
THEME_MODULE_EXTENSIONS.some(ext =>
|
|
3578
|
-
fs.existsSync(path.join(base, `index${ext}`)),
|
|
3579
|
-
)
|
|
3580
|
-
)
|
|
3581
|
-
return true;
|
|
3582
|
-
}
|
|
3583
|
-
return false;
|
|
3584
|
-
}
|
|
3585
|
-
if (path.dirname(dir) === dir) return false;
|
|
3586
|
-
}
|
|
3587
|
-
}
|
|
3588
|
-
|
|
3589
3506
|
/**
|
|
3590
3507
|
* The package an import specifier names, or undefined when it names none:
|
|
3591
3508
|
* a relative or absolute path, a `#` subpath import, or a path alias such
|
|
@@ -4007,17 +3924,32 @@ function isDefinedTheme(theme) {
|
|
|
4007
3924
|
* @param {Set<any>} [seen] the bases already met, for one that extends itself
|
|
4008
3925
|
* @returns {any}
|
|
4009
3926
|
*/
|
|
4010
|
-
function defineThemeInput(theme, seen = new Set()) {
|
|
3927
|
+
function defineThemeInput(theme, seen = new Set([theme])) {
|
|
3928
|
+
// Each value as the build writes it (a BigInt as its digits, a boxed
|
|
3929
|
+
// primitive as itself), so defineTheme reads what is written, as the
|
|
3930
|
+
// value judge does.
|
|
4011
3931
|
const input = Object.fromEntries(
|
|
4012
|
-
Object.entries(theme)
|
|
3932
|
+
Object.entries(theme)
|
|
3933
|
+
.filter(([, value]) => value !== undefined)
|
|
3934
|
+
.map(([key, value]) => [
|
|
3935
|
+
key,
|
|
3936
|
+
key === 'extends' ? value : writtenPrimitives(value),
|
|
3937
|
+
]),
|
|
4013
3938
|
);
|
|
4014
3939
|
const base = input.extends;
|
|
4015
|
-
if (
|
|
4016
|
-
base
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
3940
|
+
if (base && typeof base === 'object' && !isDefinedTheme(base)) {
|
|
3941
|
+
// A plain base that reaches back to a theme already on the way (`a`
|
|
3942
|
+
// extends `b`, `b` extends `a`) has no base to build from.
|
|
3943
|
+
if (seen.has(base)) {
|
|
3944
|
+
const names = [...seen, base].map(t =>
|
|
3945
|
+
typeof t?.name === 'string' ? `"${t.name}"` : 'a theme with no name',
|
|
3946
|
+
);
|
|
3947
|
+
throw new AstryxError(
|
|
3948
|
+
`The themes extend each other in a cycle (${names.join(' extends ')}), so none has a base to build from. Give the cycle a theme that extends nothing.`,
|
|
3949
|
+
undefined,
|
|
3950
|
+
ERROR_CODES.ERR_THEME_INVALID,
|
|
3951
|
+
);
|
|
3952
|
+
}
|
|
4021
3953
|
seen.add(base);
|
|
4022
3954
|
input.extends = _defineTheme(defineThemeInput(base, seen));
|
|
4023
3955
|
}
|
|
@@ -4341,7 +4273,7 @@ function generateBuiltModule(
|
|
|
4341
4273
|
: serializeField('componentIcons', componentIconValues, true));
|
|
4342
4274
|
|
|
4343
4275
|
return `${iconImport}${componentIconPrelude}${iconDeclaration}${iconNodesDeclaration}/**
|
|
4344
|
-
* ${themeDef.name} theme — built by
|
|
4276
|
+
* ${themeDef.name} theme — built by \`astryx theme build\`
|
|
4345
4277
|
* Import the CSS file alongside this module:
|
|
4346
4278
|
*
|
|
4347
4279
|
* import { ${themeBinding} } from './${artifactBaseName}';
|
|
@@ -4444,17 +4376,21 @@ async function loadKnownComponents() {
|
|
|
4444
4376
|
return Object.keys(propsByKey).length > 0 ? {propsByKey} : null;
|
|
4445
4377
|
}
|
|
4446
4378
|
|
|
4447
|
-
/**
|
|
4448
|
-
|
|
4379
|
+
/**
|
|
4380
|
+
* The known components of each Core `src` folder.
|
|
4381
|
+
* @type {Map<string | null, {propsByKey: Record<string, string[]>} | null>}
|
|
4382
|
+
*/
|
|
4383
|
+
const knownComponentsCache = new Map();
|
|
4449
4384
|
|
|
4450
4385
|
/**
|
|
4451
4386
|
* @returns {Promise<{propsByKey: Record<string, string[]>} | null>}
|
|
4452
4387
|
*/
|
|
4453
4388
|
async function getKnownComponents() {
|
|
4454
|
-
|
|
4455
|
-
|
|
4389
|
+
const coreSrc = coreSrcPath();
|
|
4390
|
+
if (!knownComponentsCache.has(coreSrc)) {
|
|
4391
|
+
knownComponentsCache.set(coreSrc, await loadKnownComponents());
|
|
4456
4392
|
}
|
|
4457
|
-
return knownComponentsCache;
|
|
4393
|
+
return knownComponentsCache.get(coreSrc) ?? null;
|
|
4458
4394
|
}
|
|
4459
4395
|
|
|
4460
4396
|
/**
|
|
@@ -4462,11 +4398,13 @@ async function getKnownComponents() {
|
|
|
4462
4398
|
*
|
|
4463
4399
|
* @param {{components?: Record<string, Record<string, unknown>>, onDark?: {components?: Record<string, Record<string, unknown>>}, onLight?: {components?: Record<string, Record<string, unknown>>}, __onDark?: {components?: Record<string, Record<string, unknown>>}, __onLight?: {components?: Record<string, Record<string, unknown>>}}} themeDef
|
|
4464
4400
|
* @param {{propsByKey: Record<string, string[]>}} knownComponents
|
|
4401
|
+
* @param {Set<string>} [deadKeys] takes each `<part>\u0000<style key>` the warnings say builds a selector nothing matches
|
|
4465
4402
|
* @returns {string[]}
|
|
4466
4403
|
*/
|
|
4467
4404
|
export function validateComponentOverridesAgainstRegistry(
|
|
4468
4405
|
themeDef,
|
|
4469
4406
|
knownComponents,
|
|
4407
|
+
deadKeys = new Set(),
|
|
4470
4408
|
) {
|
|
4471
4409
|
/** @type {string[]} */
|
|
4472
4410
|
const warnings = [];
|
|
@@ -4517,11 +4455,15 @@ export function validateComponentOverridesAgainstRegistry(
|
|
|
4517
4455
|
const knownProps = knownComponents.propsByKey[component];
|
|
4518
4456
|
for (const key of Object.keys(rules)) {
|
|
4519
4457
|
if (key === 'base') continue;
|
|
4458
|
+
// A wrapper of variant maps (`variants: {variant: {…}}`): the
|
|
4459
|
+
// warning on each map names the keys that write it.
|
|
4460
|
+
if (holdsOnlyVariantMaps(rules[key])) continue;
|
|
4520
4461
|
|
|
4521
4462
|
const pairs = key.split('+');
|
|
4522
4463
|
for (const pair of pairs) {
|
|
4523
4464
|
const [prop] = pair.split(':');
|
|
4524
4465
|
if (prop && !knownProps.includes(prop)) {
|
|
4466
|
+
deadKeys.add(`${component}\u0000${key}`);
|
|
4525
4467
|
const hint =
|
|
4526
4468
|
knownProps.length > 0
|
|
4527
4469
|
? ` Known props/states: ${knownProps.join(', ')}`
|
|
@@ -4543,14 +4485,16 @@ export function validateComponentOverridesAgainstRegistry(
|
|
|
4543
4485
|
* Warns on unknown component and prop names.
|
|
4544
4486
|
*
|
|
4545
4487
|
* @param {{components?: Record<string, Record<string, unknown>>, onDark?: {components?: Record<string, Record<string, unknown>>}, onLight?: {components?: Record<string, Record<string, unknown>>}, __onDark?: {components?: Record<string, Record<string, unknown>>}, __onLight?: {components?: Record<string, Record<string, unknown>>}}} themeDef
|
|
4488
|
+
* @param {Set<string>} [deadKeys] takes each `<part>\u0000<style key>` that builds a selector nothing matches
|
|
4546
4489
|
* @returns {Promise<string[]>}
|
|
4547
4490
|
*/
|
|
4548
|
-
async function validateComponentOverrides(themeDef) {
|
|
4491
|
+
async function validateComponentOverrides(themeDef, deadKeys = new Set()) {
|
|
4549
4492
|
const knownComponents = await getKnownComponents();
|
|
4550
4493
|
if (knownComponents == null) return [];
|
|
4551
4494
|
const warnings = validateComponentOverridesAgainstRegistry(
|
|
4552
4495
|
themeDef,
|
|
4553
4496
|
knownComponents,
|
|
4497
|
+
deadKeys,
|
|
4554
4498
|
);
|
|
4555
4499
|
// Style keys no element can carry: a pseudo-class or pseudo-element
|
|
4556
4500
|
// written as a style key (`':hover'` builds `[data-="hover"]`), and a
|
|
@@ -4569,6 +4513,7 @@ async function validateComponentOverrides(themeDef) {
|
|
|
4569
4513
|
for (const key of Object.keys(rules))
|
|
4570
4514
|
for (const {prop, value} of componentValuePairs(key)) {
|
|
4571
4515
|
if (!prop) {
|
|
4516
|
+
deadKeys.add(`${component}\u0000${key}`);
|
|
4572
4517
|
warnings.push(
|
|
4573
4518
|
`Style key "${key}" on component "${component}" is no prop or state: a pseudo-class or pseudo-element goes inside a style key, such as base: {'${key}': {…}}. As written it builds a selector nothing matches.`,
|
|
4574
4519
|
);
|
|
@@ -4580,10 +4525,12 @@ async function validateComponentOverrides(themeDef) {
|
|
|
4580
4525
|
values.length > 0 &&
|
|
4581
4526
|
(await classifyComponentValue(component, prop, value)) ===
|
|
4582
4527
|
'unresolved'
|
|
4583
|
-
)
|
|
4528
|
+
) {
|
|
4529
|
+
deadKeys.add(`${component}\u0000${key}`);
|
|
4584
4530
|
warnings.push(
|
|
4585
4531
|
`Style key "${key}" on component "${component}": ${prop} takes ${values.join(', ')}, and a theme cannot add a value to it, so "${value}" builds a selector nothing matches.`,
|
|
4586
4532
|
);
|
|
4533
|
+
}
|
|
4587
4534
|
}
|
|
4588
4535
|
}
|
|
4589
4536
|
return [...new Set(warnings)];
|
|
@@ -4865,7 +4812,12 @@ async function themeBuildInternal(
|
|
|
4865
4812
|
|
|
4866
4813
|
// Core's facts first, before the build reads the theme: kept facts then do
|
|
4867
4814
|
// not depend on it, and a build after an edit to the theme reads them back.
|
|
4868
|
-
|
|
4815
|
+
{
|
|
4816
|
+
const installed = findInstalledPackage(cwd, '@astryxdesign/core');
|
|
4817
|
+
await keepCoreThemeFacts(
|
|
4818
|
+
installed ? path.join(installed, 'src') : coreSrcPath(),
|
|
4819
|
+
);
|
|
4820
|
+
}
|
|
4869
4821
|
|
|
4870
4822
|
{
|
|
4871
4823
|
const problem = buildInputProblem(file, options, cwd);
|
|
@@ -5189,11 +5141,18 @@ async function themeBuildInternal(
|
|
|
5189
5141
|
from = {file: path.relative(cwd, base.file) || base.file, line: at};
|
|
5190
5142
|
break;
|
|
5191
5143
|
}
|
|
5144
|
+
// From the theme it extends only when that theme holds this very
|
|
5145
|
+
// value: a resolved base holds every token, so holding the path alone
|
|
5146
|
+
// says nothing.
|
|
5192
5147
|
const inherited =
|
|
5193
5148
|
line == null &&
|
|
5194
5149
|
(from != null ||
|
|
5195
5150
|
(parentTheme != null &&
|
|
5196
|
-
valueAt(parentTheme, item.path) !== undefined
|
|
5151
|
+
valueAt(parentTheme, item.path) !== undefined &&
|
|
5152
|
+
Object.is(
|
|
5153
|
+
valueAt(parentTheme, item.path),
|
|
5154
|
+
valueAt(themeDef, item.path),
|
|
5155
|
+
)));
|
|
5197
5156
|
return inherited && handOff.prepareFamily
|
|
5198
5157
|
? []
|
|
5199
5158
|
: [{...item, line, inherited, elsewhere: line == null, from}];
|
|
@@ -5201,7 +5160,7 @@ async function themeBuildInternal(
|
|
|
5201
5160
|
const nulls = placed(nullThemeValues(themeDef));
|
|
5202
5161
|
/** @param {{path: string[], why: string, line: number | null, inherited?: boolean, elsewhere?: boolean, from?: {file: string, line: number} | null, at?: {file: string, line: number} | null}} n */
|
|
5203
5162
|
const nullLine = n =>
|
|
5204
|
-
`${n.path.join('.')}${n.line != null ? ` (line ${n.line})` : n.at ? ` (in ${n.at.file}, line ${n.at.line})` : n.from ? ` (in ${n.from.file}, line ${n.from.line}, the theme it extends)` : n.inherited ? ' (from the theme it extends)' : n.elsewhere ?
|
|
5163
|
+
`${n.path.join('.')}${n.line != null ? ` (line ${n.line})` : n.at ? ` (in ${n.at.file}, line ${n.at.line})` : n.from ? ` (in ${n.from.file}, line ${n.from.line}, the theme it extends)` : n.inherited ? ' (from the theme it extends)' : n.elsewhere ? ` (not written in this file as it is: computed in it, or from ${parentTheme != null ? '' : 'the theme it extends or '}a module it imports)` : ''}: ${n.why}`;
|
|
5205
5164
|
const unbuildable = nulls.filter(n => n.unbuildable);
|
|
5206
5165
|
if (unbuildable.length > 0) {
|
|
5207
5166
|
const first = unbuildable.find(n => n.line != null);
|
|
@@ -5348,11 +5307,34 @@ async function themeBuildInternal(
|
|
|
5348
5307
|
return {...t, line, inherited: false, elsewhere: line == null, from: null};
|
|
5349
5308
|
});
|
|
5350
5309
|
|
|
5310
|
+
// A radius scale missing a field builds every scaled corner as NaNpx:
|
|
5311
|
+
// warned at its line, as the editor refuses it.
|
|
5312
|
+
const radiusInput =
|
|
5313
|
+
interception?.inputOf(themeDef)?.radius ??
|
|
5314
|
+
// A plain-object theme is its own input.
|
|
5315
|
+
(isDefinedTheme(themeDef) ? undefined : themeDef.radius) ??
|
|
5316
|
+
sourceInputField(themeSource, filePath, 'radius');
|
|
5317
|
+
const badRadius = radiusInputProblems(radiusInput).map(t => {
|
|
5318
|
+
const line =
|
|
5319
|
+
keyPathLine(themeSource, t.path, filePath) ??
|
|
5320
|
+
keyPathLine(themeSource, ['radius'], filePath);
|
|
5321
|
+
return {...t, line, inherited: false, elsewhere: line == null, from: null};
|
|
5322
|
+
});
|
|
5323
|
+
|
|
5351
5324
|
// Validate component overrides
|
|
5352
|
-
|
|
5325
|
+
// The style keys that build a selector nothing matches (warned below):
|
|
5326
|
+
// no setting of theirs, and none they hold, takes part in which shows.
|
|
5327
|
+
/** @type {Set<string>} */
|
|
5328
|
+
const deadKeys = new Set();
|
|
5329
|
+
const warnings = await validateComponentOverrides(themeDef, deadKeys);
|
|
5330
|
+
/** @type {string[]} */
|
|
5353
5331
|
const warningMessages = [];
|
|
5354
5332
|
/** Advisories about a correct theme — see the `notices` note on the receipt. */
|
|
5355
5333
|
const noticeMessages = [];
|
|
5334
|
+
/** @type {Array<import('./setting-effects.mjs').SettingIssueEntry & {line: number | null}>} */
|
|
5335
|
+
const settingIssues = [];
|
|
5336
|
+
/** The notes that stand in for a generated file's setting issues. @type {import('./setting-effects.mjs').GeneratedSettingNote[]} */
|
|
5337
|
+
const settingNotices = [];
|
|
5356
5338
|
const blankSpecifier = handOff.prepareFamily
|
|
5357
5339
|
? null
|
|
5358
5340
|
: blankSpecifierWarning(options.iconsSpecifier);
|
|
@@ -5374,8 +5356,11 @@ async function themeBuildInternal(
|
|
|
5374
5356
|
...badKeys.map(nullLine),
|
|
5375
5357
|
...badValueLines.map(nullLine),
|
|
5376
5358
|
...badTypography.map(nullLine),
|
|
5359
|
+
...badRadius.map(nullLine),
|
|
5377
5360
|
...badFields.map(nullLine),
|
|
5378
5361
|
]) {
|
|
5362
|
+
// The source reader and the loaded value can name one field alike.
|
|
5363
|
+
if (warningMessages.includes(w)) continue;
|
|
5379
5364
|
warningMessages.push(w);
|
|
5380
5365
|
logger.warn(` [warn] ${source}${w}`);
|
|
5381
5366
|
}
|
|
@@ -5611,6 +5596,9 @@ async function themeBuildInternal(
|
|
|
5611
5596
|
// too. A boxed primitive in a part would be written as JSON text (with
|
|
5612
5597
|
// its quotes), where a token writes its text: it gets its primitive.
|
|
5613
5598
|
resolvedTheme = writtenPrimitives(resolvedTheme);
|
|
5599
|
+
// A map of values to blocks in a style block is warned at its line with
|
|
5600
|
+
// the keys that write it; Core would only drop it again.
|
|
5601
|
+
resolvedTheme = withoutVariantMaps(resolvedTheme);
|
|
5614
5602
|
|
|
5615
5603
|
const scopeSelector = themeScopeStart(themeDef.name);
|
|
5616
5604
|
const scopeTo = THEME_SCOPE_TO;
|
|
@@ -5629,6 +5617,94 @@ async function themeBuildInternal(
|
|
|
5629
5617
|
throw new AstryxError(message, undefined, ERROR_CODES.ERR_THEME_INVALID);
|
|
5630
5618
|
}
|
|
5631
5619
|
const {component, prose} = themeRules;
|
|
5620
|
+
// A setting the browser never shows as written: another rule of the
|
|
5621
|
+
// theme layer reaching the same element sets the same property and
|
|
5622
|
+
// wins there (a shorthand after the setting, a more specific rule of
|
|
5623
|
+
// the theme it extends, two situations whose order decides). Read from
|
|
5624
|
+
// the rules just generated; a declaration is the theme's when its
|
|
5625
|
+
// source, or a local theme it extends, writes it. Warned at its line,
|
|
5626
|
+
// with the change that makes it show; the output is the same.
|
|
5627
|
+
// Where a setting is written, nearest first: the theme's own objects in
|
|
5628
|
+
// its file (never a base theme it extends that the file also defines),
|
|
5629
|
+
// then such a base, then each local theme it extends in its own file.
|
|
5630
|
+
// Each key path is read from the root of the object.
|
|
5631
|
+
// Each file read twice: at its theme's own objects, then at the themes
|
|
5632
|
+
// that theme extends inside the file; each with whether a tool
|
|
5633
|
+
// generates the file.
|
|
5634
|
+
const writtenIn = [
|
|
5635
|
+
{file: filePath, source: themeSource, exportName: themeExportName},
|
|
5636
|
+
...extendedSources,
|
|
5637
|
+
].flatMap(s => {
|
|
5638
|
+
const index = keyPathIndex(s.source, s.file, {exportName: s.exportName});
|
|
5639
|
+
const generated = generatedSource(s.source, s.file);
|
|
5640
|
+
return [false, true].map(bases => ({
|
|
5641
|
+
file: s.file,
|
|
5642
|
+
lineOf: (/** @type {string[]} */ k) =>
|
|
5643
|
+
index(k, {fromRoot: true, bases}),
|
|
5644
|
+
generated,
|
|
5645
|
+
}));
|
|
5646
|
+
});
|
|
5647
|
+
const blocks = blockPaths(
|
|
5648
|
+
resolvedTheme.components,
|
|
5649
|
+
components =>
|
|
5650
|
+
_generateThemeRulesSplit(
|
|
5651
|
+
_defineTheme({name: resolvedTheme.name, components}),
|
|
5652
|
+
[],
|
|
5653
|
+
).component,
|
|
5654
|
+
);
|
|
5655
|
+
for (const entry of settingIssueEntries(
|
|
5656
|
+
settingEffectIssues(
|
|
5657
|
+
component,
|
|
5658
|
+
at => {
|
|
5659
|
+
for (const [layer, {lineOf}] of writtenIn.entries())
|
|
5660
|
+
for (const keys of declarationPaths(at, blocks))
|
|
5661
|
+
if (lineOf(keys) != null)
|
|
5662
|
+
return {path: keys, layer};
|
|
5663
|
+
return null;
|
|
5664
|
+
},
|
|
5665
|
+
{
|
|
5666
|
+
skip: at =>
|
|
5667
|
+
declarationPaths(at, blocks).some(p =>
|
|
5668
|
+
deadKeys.has(`${p[1]}\u0000${p[2]}`),
|
|
5669
|
+
),
|
|
5670
|
+
},
|
|
5671
|
+
),
|
|
5672
|
+
)) {
|
|
5673
|
+
// At its line in the theme's file, or in the local theme it extends
|
|
5674
|
+
// that writes it (a family member's included).
|
|
5675
|
+
const writer = writtenIn.find(
|
|
5676
|
+
w => w.lineOf(entry.path) != null,
|
|
5677
|
+
);
|
|
5678
|
+
const line = writer?.lineOf(entry.path) ?? null;
|
|
5679
|
+
const file =
|
|
5680
|
+
writer && writer.file !== filePath
|
|
5681
|
+
? path.relative(cwd, writer.file) || writer.file
|
|
5682
|
+
: null;
|
|
5683
|
+
settingIssues.push({...entry, line, ...(file ? {file} : {})});
|
|
5684
|
+
}
|
|
5685
|
+
// A generated file is not where the fix of its settings goes, its
|
|
5686
|
+
// generator is: one notice per such file, and a warning for each other.
|
|
5687
|
+
const {listed, notes: generatedNotes} = splitGeneratedIssues(
|
|
5688
|
+
settingIssues,
|
|
5689
|
+
file =>
|
|
5690
|
+
writtenIn.find(
|
|
5691
|
+
w =>
|
|
5692
|
+
(file ? path.relative(cwd, w.file) || w.file : w.file) ===
|
|
5693
|
+
(file ?? filePath),
|
|
5694
|
+
)?.generated ?? null,
|
|
5695
|
+
file => file ?? (path.relative(cwd, filePath) || filePath),
|
|
5696
|
+
);
|
|
5697
|
+
for (const entry of listed) {
|
|
5698
|
+
const w = `${entry.message}${settingIssueLocation(entry)}. Fix: ${entry.fix}.`;
|
|
5699
|
+
warningMessages.push(w);
|
|
5700
|
+
logger.warn(` [warn] ${source}${w}`);
|
|
5701
|
+
}
|
|
5702
|
+
for (const note of generatedNotes) {
|
|
5703
|
+
noticeMessages.push(note.text);
|
|
5704
|
+
settingNotices.push(note);
|
|
5705
|
+
// A family prints the notes of all its members once, merged.
|
|
5706
|
+
if (!handOff.prepareFamily) logger.log(` [note] ${source}${note.text}`);
|
|
5707
|
+
}
|
|
5632
5708
|
const cssParts = [];
|
|
5633
5709
|
// Prose element defaults always ship — the `<Theme>` runtime
|
|
5634
5710
|
// (generateThemeCSS) always emits them, so the build must too, or the
|
|
@@ -5660,9 +5736,10 @@ async function themeBuildInternal(
|
|
|
5660
5736
|
? `@scope (${scopeSelector}) to (${scopeTo}) {\n${componentInner}\n}`
|
|
5661
5737
|
: '';
|
|
5662
5738
|
|
|
5663
|
-
//
|
|
5664
|
-
//
|
|
5665
|
-
//
|
|
5739
|
+
// A theme with light-dark() values pins the scheme where html forces a
|
|
5740
|
+
// mode (a Theme's mode, or the host's data-theme). Inspect root and
|
|
5741
|
+
// rule-owned values, not generated CSS, which also carries
|
|
5742
|
+
// theme-independent data-token defaults with light-dark().
|
|
5666
5743
|
const themeOwnValues = JSON.stringify(
|
|
5667
5744
|
[
|
|
5668
5745
|
resolvedTheme.tokens ?? {},
|
|
@@ -5680,10 +5757,14 @@ async function themeBuildInternal(
|
|
|
5680
5757
|
],
|
|
5681
5758
|
bigIntAsText,
|
|
5682
5759
|
);
|
|
5760
|
+
// A theme follows the page's scheme: it pins the scheme only where the
|
|
5761
|
+
// page or the Theme provider forces a mode (`data-theme` on html).
|
|
5762
|
+
// Following the reader's device is the page's own choice, made by
|
|
5763
|
+
// reset.css or the app's own `color-scheme` on html, never by a theme.
|
|
5683
5764
|
const colorSchemeDecl =
|
|
5684
5765
|
themeOwnValues.includes('light-dark(') ||
|
|
5685
5766
|
adaptationCss.component.includes('light-dark(')
|
|
5686
|
-
? '
|
|
5767
|
+
? ' html[data-theme="light"] { color-scheme: light; }\n html[data-theme="dark"] { color-scheme: dark; }\n\n'
|
|
5687
5768
|
: '';
|
|
5688
5769
|
if (colorSchemeDecl || componentScope) {
|
|
5689
5770
|
cssParts.push(
|
|
@@ -5981,8 +6062,8 @@ async function themeBuildInternal(
|
|
|
5981
6062
|
cssFileName: path.basename(outPath),
|
|
5982
6063
|
},
|
|
5983
6064
|
) +
|
|
5984
|
-
// The one color mode, beside the theme export
|
|
5985
|
-
//
|
|
6065
|
+
// The one color mode, beside the theme export. A two-mode theme's
|
|
6066
|
+
// ['light', 'dark'] is not written, so its module is unchanged.
|
|
5986
6067
|
(colorModes
|
|
5987
6068
|
? `export const colorModes = [${JSON.stringify(colorModes[0])}];\n`
|
|
5988
6069
|
: '');
|
|
@@ -6057,6 +6138,8 @@ async function themeBuildInternal(
|
|
|
6057
6138
|
tokenCount,
|
|
6058
6139
|
componentCount,
|
|
6059
6140
|
warnings: warningMessages,
|
|
6141
|
+
settingIssues,
|
|
6142
|
+
settingNotices,
|
|
6060
6143
|
unloadedFonts,
|
|
6061
6144
|
unbuiltStylesheets,
|
|
6062
6145
|
};
|
|
@@ -6102,13 +6185,17 @@ async function themeBuildInternal(
|
|
|
6102
6185
|
{iconsSpecifier: options.iconsSpecifier, out: out ?? undefined},
|
|
6103
6186
|
cwd,
|
|
6104
6187
|
);
|
|
6105
|
-
//
|
|
6106
|
-
//
|
|
6107
|
-
//
|
|
6188
|
+
// Beside the source or at a path --out names, only build outputs are
|
|
6189
|
+
// replaced: a file of the user's own of the same name is kept. A caller
|
|
6190
|
+
// that owns the output folder (the theme editor) repairs it instead.
|
|
6108
6191
|
assertOutputsReplaceable(writes, filePath, cwd, {
|
|
6109
6192
|
claimed: handOff.claimedOutputs,
|
|
6110
6193
|
rerun,
|
|
6111
|
-
refuseUnmarked:
|
|
6194
|
+
refuseUnmarked: !handOff.ownsOutputs,
|
|
6195
|
+
// At the default paths the build always replaced what was there, so an
|
|
6196
|
+
// output of the CLI before it was named Astryx is still its own; a path
|
|
6197
|
+
// --out names keeps its released rule (the current mark only).
|
|
6198
|
+
acceptLegacy: !options.out,
|
|
6112
6199
|
onEditorFolder: editorFolderListener ?? undefined,
|
|
6113
6200
|
// The result's warnings carry what text prints.
|
|
6114
6201
|
onWarning: message => warningMessages.push(message),
|
|
@@ -6117,7 +6204,8 @@ async function themeBuildInternal(
|
|
|
6117
6204
|
|
|
6118
6205
|
// Check mode: compare generated content against what's on disk instead of
|
|
6119
6206
|
// writing. A file is "stale" if it's missing or its content differs once the
|
|
6120
|
-
//
|
|
6207
|
+
// @generated header's `Command:` line, the release its `CLI:` line names, and
|
|
6208
|
+
// the command a built module's built-by line names are ignored. Returns a
|
|
6121
6209
|
// receipt listing stale/missing outputs so callers (CI) can fail on drift.
|
|
6122
6210
|
if (options.check) {
|
|
6123
6211
|
const stale = staleBuildOutputs(writes, cwd);
|
|
@@ -6154,6 +6242,12 @@ async function themeBuildInternal(
|
|
|
6154
6242
|
checked: checkedBuildOutputs(writes, cwd),
|
|
6155
6243
|
// The code a stale check exits 1 with, for --json callers.
|
|
6156
6244
|
...(upToDate ? {} : {code: ERROR_CODES.ERR_THEME_STALE}),
|
|
6245
|
+
// A check reads the settings a build would warn about, so a check
|
|
6246
|
+
// (`astryx doctor`, an editor) can say them without writing.
|
|
6247
|
+
...(settingIssues.length ? {settingIssues} : {}),
|
|
6248
|
+
...(settingNotices.length
|
|
6249
|
+
? {notices: settingNotices.map(note => note.text)}
|
|
6250
|
+
: {}),
|
|
6157
6251
|
},
|
|
6158
6252
|
});
|
|
6159
6253
|
}
|
|
@@ -6250,6 +6344,7 @@ async function themeBuildInternal(
|
|
|
6250
6344
|
},
|
|
6251
6345
|
warnings: warningMessages,
|
|
6252
6346
|
notices: noticeMessages,
|
|
6347
|
+
settingIssues,
|
|
6253
6348
|
},
|
|
6254
6349
|
};
|
|
6255
6350
|
}
|
|
@@ -6995,6 +7090,30 @@ async function buildFamily(
|
|
|
6995
7090
|
onWarning: message => outputWarnings.push(message),
|
|
6996
7091
|
});
|
|
6997
7092
|
}
|
|
7093
|
+
// Each member's settings that do not show as written, at the member's
|
|
7094
|
+
// file when the member's own source writes them.
|
|
7095
|
+
// (A member that extends another reports the other's setting too: once.)
|
|
7096
|
+
const familySettingIssues = [
|
|
7097
|
+
...new Map(
|
|
7098
|
+
members
|
|
7099
|
+
.flatMap(member =>
|
|
7100
|
+
(member.settingIssues ?? []).map((/** @type {any} */ issue) => ({
|
|
7101
|
+
...issue,
|
|
7102
|
+
file: issue.file ?? path.relative(cwd, member.filePath),
|
|
7103
|
+
})),
|
|
7104
|
+
)
|
|
7105
|
+
.map(issue => [
|
|
7106
|
+
JSON.stringify([issue.file, issue.path, issue.by.path, issue.by.key]),
|
|
7107
|
+
issue,
|
|
7108
|
+
]),
|
|
7109
|
+
).values(),
|
|
7110
|
+
];
|
|
7111
|
+
// One note per generated file the members read: a member that extends a
|
|
7112
|
+
// generated one reports that file's settings too.
|
|
7113
|
+
const familySettingNotices = generatedNotesByFile(
|
|
7114
|
+
members.map(member => ({notes: member.settingNotices ?? []})),
|
|
7115
|
+
).map(note => note.text);
|
|
7116
|
+
for (const text of familySettingNotices) logger.log(` [note] ${text}`);
|
|
6998
7117
|
if (options.check) {
|
|
6999
7118
|
const stale = staleBuildOutputs(writes, cwd);
|
|
7000
7119
|
const upToDate = stale.length === 0;
|
|
@@ -7032,6 +7151,10 @@ async function buildFamily(
|
|
|
7032
7151
|
checked: checkedBuildOutputs(writes, cwd),
|
|
7033
7152
|
// The code a stale check exits 1 with, for --json callers.
|
|
7034
7153
|
...(upToDate ? {} : {code: ERROR_CODES.ERR_THEME_STALE}),
|
|
7154
|
+
...(familySettingIssues.length
|
|
7155
|
+
? {settingIssues: familySettingIssues}
|
|
7156
|
+
: {}),
|
|
7157
|
+
...(familySettingNotices.length ? {notices: familySettingNotices} : {}),
|
|
7035
7158
|
},
|
|
7036
7159
|
});
|
|
7037
7160
|
}
|
|
@@ -7084,9 +7207,12 @@ Or load the same stylesheet natively:
|
|
|
7084
7207
|
`Font "${family}" is named by this theme family but not loaded; add a <link> or @font-face in your app (recipe: ${recipe})`;
|
|
7085
7208
|
// The result names the command bare; the printed note as this project
|
|
7086
7209
|
// runs the CLI.
|
|
7087
|
-
const notices =
|
|
7088
|
-
|
|
7089
|
-
|
|
7210
|
+
const notices = [
|
|
7211
|
+
...familySettingNotices,
|
|
7212
|
+
...unloadedFonts.map(family =>
|
|
7213
|
+
familyNotice(family, 'astryx docs typography'),
|
|
7214
|
+
),
|
|
7215
|
+
];
|
|
7090
7216
|
for (const family of unloadedFonts)
|
|
7091
7217
|
logger.log(
|
|
7092
7218
|
` note: ${familyNotice(family, formatCliCommand('docs typography', cwd))}`,
|
|
@@ -7104,6 +7230,9 @@ Or load the same stylesheet natively:
|
|
|
7104
7230
|
outputs,
|
|
7105
7231
|
warnings,
|
|
7106
7232
|
notices,
|
|
7233
|
+
// Each member's settings that do not show as written, at the member's
|
|
7234
|
+
// file when its own source writes them.
|
|
7235
|
+
settingIssues: familySettingIssues,
|
|
7107
7236
|
// The base the family's root extends that the family does not select:
|
|
7108
7237
|
// a requirement of the outputs (an installed package the app keeps).
|
|
7109
7238
|
...(familyBase ? {base: familyBase} : {}),
|
|
@@ -7133,76 +7262,10 @@ function themeBaseBinding(filePath, exportName) {
|
|
|
7133
7262
|
} catch {
|
|
7134
7263
|
return null;
|
|
7135
7264
|
}
|
|
7136
|
-
|
|
7137
|
-
const
|
|
7138
|
-
|
|
7139
|
-
const consts = new Map();
|
|
7140
|
-
/** @type {Map<string, any>} the node each export gives */
|
|
7141
|
-
const exported = new Map();
|
|
7142
|
-
/** @param {any} declaration */
|
|
7143
|
-
const addDeclaration = declaration => {
|
|
7144
|
-
if (declaration?.type !== 'VariableDeclaration') return;
|
|
7145
|
-
for (const d of declaration.declarations)
|
|
7146
|
-
if (d.id?.type === 'Identifier' && d.init) consts.set(d.id.name, d.init);
|
|
7147
|
-
};
|
|
7148
|
-
for (const node of ast.program.body) {
|
|
7149
|
-
if (node.type === 'ImportDeclaration' && node.importKind !== 'type')
|
|
7150
|
-
for (const spec of node.specifiers)
|
|
7151
|
-
if (spec.type === 'ImportSpecifier')
|
|
7152
|
-
imports.set(spec.local.name, {
|
|
7153
|
-
source: node.source.value,
|
|
7154
|
-
imported: spec.imported.name ?? spec.imported.value,
|
|
7155
|
-
});
|
|
7156
|
-
else if (spec.type === 'ImportDefaultSpecifier')
|
|
7157
|
-
imports.set(spec.local.name, {
|
|
7158
|
-
source: node.source.value,
|
|
7159
|
-
imported: 'default',
|
|
7160
|
-
});
|
|
7161
|
-
addDeclaration(node);
|
|
7162
|
-
if (node.type === 'ExportNamedDeclaration') {
|
|
7163
|
-
addDeclaration(node.declaration);
|
|
7164
|
-
if (node.declaration?.type === 'VariableDeclaration')
|
|
7165
|
-
for (const d of node.declaration.declarations)
|
|
7166
|
-
if (d.id?.type === 'Identifier') exported.set(d.id.name, d.id);
|
|
7167
|
-
if (!node.source)
|
|
7168
|
-
for (const spec of node.specifiers ?? [])
|
|
7169
|
-
if (spec.type === 'ExportSpecifier')
|
|
7170
|
-
exported.set(spec.exported.name ?? spec.exported.value, spec.local);
|
|
7171
|
-
}
|
|
7172
|
-
if (node.type === 'ExportDefaultDeclaration')
|
|
7173
|
-
exported.set('default', node.declaration);
|
|
7174
|
-
}
|
|
7175
|
-
/** @param {any} node @returns {any} */
|
|
7176
|
-
const unwrap = node => {
|
|
7177
|
-
while (
|
|
7178
|
-
node &&
|
|
7179
|
-
/^(?:TSAsExpression|TSSatisfiesExpression|TSNonNullExpression|TSTypeAssertion|ParenthesizedExpression)$/.test(
|
|
7180
|
-
node.type,
|
|
7181
|
-
)
|
|
7182
|
-
)
|
|
7183
|
-
node = node.expression;
|
|
7184
|
-
return node;
|
|
7185
|
-
};
|
|
7186
|
-
/** @param {any} node @param {number} depth @returns {any} the theme object literal */
|
|
7187
|
-
const themeObject = (node, depth = 0) => {
|
|
7188
|
-
node = unwrap(node);
|
|
7189
|
-
if (!node || depth > 8) return null;
|
|
7190
|
-
if (node.type === 'Identifier')
|
|
7191
|
-
return consts.has(node.name)
|
|
7192
|
-
? themeObject(consts.get(node.name), depth + 1)
|
|
7193
|
-
: null;
|
|
7194
|
-
if (node.type === 'CallExpression')
|
|
7195
|
-
return themeObject(node.arguments?.[0], depth + 1);
|
|
7196
|
-
return node.type === 'ObjectExpression' ? node : null;
|
|
7197
|
-
};
|
|
7198
|
-
const object = themeObject(exported.get(exportName ?? 'default'));
|
|
7199
|
-
const field = object?.properties.find(
|
|
7200
|
-
(/** @type {any} */ p) =>
|
|
7201
|
-
p.type === 'ObjectProperty' &&
|
|
7202
|
-
!p.computed &&
|
|
7203
|
-
(p.key.name ?? p.key.value) === 'extends',
|
|
7265
|
+
const {imports, consts, exported} = moduleBindings(ast);
|
|
7266
|
+
const value = extendsOf(
|
|
7267
|
+
themeObjectOf(exported.get(exportName ?? 'default'), consts),
|
|
7204
7268
|
);
|
|
7205
|
-
const value = unwrap(field?.value);
|
|
7206
7269
|
if (value?.type !== 'Identifier') return null;
|
|
7207
7270
|
const imported = imports.get(value.name);
|
|
7208
7271
|
if (imported)
|