@astryxdesign/cli 0.7.17-canary.g49a475f → 0.7.17-canary.g5a3fd39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -9
- package/api/build/_adapter.d.mts +33 -4
- package/api/build/_adapter.mjs +43 -8
- package/api/build/blocks/blocks.d.mts +1 -0
- package/api/build/blocks/blocks.mjs +2 -1
- package/api/build/blocks/blocks.weights.json +1 -1
- package/api/build/build.doc.mjs +2 -2
- package/api/build/build.type.d.mts +13 -1
- package/api/build/build.type.mjs +6 -3
- package/api/build/kit/kind.d.mts +6 -0
- package/api/build/kit/kind.mjs +1 -1
- package/api/build/kit/kit.mjs +3 -3
- package/api/build/kit/rank.d.mts +9 -3
- package/api/build/kit/rank.mjs +21 -8
- package/api/build/kit/signals.d.mts +7 -1
- package/api/build/kit/signals.mjs +124 -41
- package/api/build/kit/start.d.mts +20 -5
- package/api/build/kit/start.mjs +103 -23
- package/api/build/kit/weights.d.mts +20 -4
- package/api/build/kit/weights.json +1 -1
- package/api/build/kit/weights.mjs +68 -18
- package/api/build/kit/words.d.mts +44 -2
- package/api/build/kit/words.mjs +159 -4
- package/api/build/tree.mjs +1 -1
- package/api/component/__fixtures__/resolutions/modules.txt +4 -4
- package/api/component/_adapter.d.mts +51 -20
- package/api/component/_adapter.mjs +198 -29
- package/api/component/component.mjs +18 -5
- package/api/component/component.type.d.mts +4 -0
- package/api/component/component.type.mjs +1 -0
- package/api/component/detail/blocks/blocks.mjs +1 -0
- package/api/component/detail/detail.d.mts +2 -2
- package/api/component/detail/detail.mjs +1 -1
- package/api/component/list/list.d.mts +2 -2
- package/api/component/list/list.mjs +4 -4
- package/api/discover/_adapter.d.mts +10 -0
- package/api/discover/_adapter.mjs +110 -16
- package/api/discover/detail/item/item.mjs +5 -0
- package/api/discover/discover.mjs +12 -3
- package/api/discover/discover.type.d.mts +16 -3
- package/api/discover/discover.type.mjs +13 -3
- package/api/docs/_adapter.d.mts +74 -30
- package/api/docs/_adapter.mjs +488 -234
- package/api/docs/_entry-names-lazily.d.mts +22 -0
- package/api/docs/_entry-names-lazily.mjs +25 -0
- package/api/docs/_entry-names.d.mts +23 -0
- package/api/docs/_entry-names.mjs +105 -0
- package/api/doctor/_adapter.d.mts +63 -2
- package/api/doctor/_adapter.mjs +141 -5
- package/api/doctor/doctor.d.mts +11 -0
- package/api/doctor/doctor.doc.mjs +1 -1
- package/api/doctor/doctor.mjs +81 -30
- package/api/doctor/theme-checks.d.mts +35 -3
- package/api/doctor/theme-checks.mjs +449 -99
- package/api/error.d.mts +4 -3
- package/api/error.mjs +3 -2
- package/api/hook/_adapter.d.mts +14 -7
- package/api/hook/_adapter.mjs +46 -9
- package/api/hook/detail/detail.mjs +5 -2
- package/api/hook/detail/params/params.mjs +10 -3
- package/api/icon/_options.d.mts +17 -0
- package/api/icon/_options.mjs +54 -0
- package/api/icon/exportIconIndex.doc.d.mts +10 -0
- package/api/icon/exportIconIndex.doc.mjs +59 -0
- package/api/icon/icon.mjs +11 -34
- package/api/icon/icon.type.d.mts +49 -0
- package/api/icon/icon.type.mjs +24 -0
- package/api/icon/rankIconIndex.doc.d.mts +10 -0
- package/api/icon/rankIconIndex.doc.mjs +79 -0
- package/api/icon/search/icon-index.d.mts +41 -0
- package/api/icon/search/icon-index.mjs +139 -0
- package/api/icon/search/search.d.mts +18 -0
- package/api/icon/search/search.mjs +13 -0
- package/api/index.d.mts +1 -0
- package/api/index.mjs +1 -0
- package/api/integration/add-helpers.mjs +10 -0
- package/api/integration/authoring-checks.mjs +5 -2
- package/api/integration/check/check.mjs +6 -1
- package/api/integration/pack-check.mjs +50 -3
- package/api/integration/validate-integration.d.mts +18 -6
- package/api/integration/validate-integration.mjs +110 -14
- package/api/integration/validate-integration.type.d.mts +13 -0
- package/api/integration/validate-integration.type.mjs +2 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/render.type.d.mts +1 -1
- package/api/render/render.type.mjs +1 -1
- package/api/search/ORDERING.md +1 -1
- package/api/search/_adapter.d.mts +8 -5
- package/api/search/_adapter.mjs +14 -10
- package/api/search/_candidate-score.d.mts +9 -4
- package/api/search/_candidate-score.mjs +82 -14
- package/api/search/_gather-components.d.mts +4 -4
- package/api/search/_gather-components.mjs +4 -3
- package/api/search/_gather-hooks.d.mts +2 -2
- package/api/search/_gather-hooks.mjs +1 -1
- package/api/search/_gather-templates.mjs +1 -0
- package/api/search/_lexical.d.mts +16 -0
- package/api/search/_lexical.mjs +98 -10
- package/api/search/_priority.d.mts +10 -2
- package/api/search/_priority.mjs +37 -7
- package/api/search/_result.d.mts +1 -0
- package/api/search/_result.mjs +1 -0
- package/api/search/_score.d.mts +12 -3
- package/api/search/_score.mjs +6 -3
- package/api/search/_words.mjs +12 -3
- package/api/search/search.d.mts +7 -1
- package/api/search/search.doc.mjs +1 -1
- package/api/search/search.mjs +37 -4
- package/api/search/search.type.d.mts +4 -0
- package/api/search/search.type.mjs +1 -0
- package/api/swizzle/_adapter.d.mts +7 -5
- package/api/swizzle/_adapter.mjs +22 -6
- package/api/swizzle/copy/copy.mjs +5 -4
- package/api/template/_adapter.d.mts +16 -0
- package/api/template/_adapter.mjs +39 -2
- package/api/template/cdn/cdn.mjs +37 -8
- package/api/template/copy/copy.d.mts +6 -3
- package/api/template/copy/copy.mjs +83 -8
- package/api/template/show/show.mjs +1 -0
- package/api/template/skeleton/skeleton.mjs +1 -0
- package/api/template/template.doc.mjs +5 -5
- package/api/template/template.mjs +63 -11
- package/api/template/template.type.d.mts +4 -0
- package/api/template/template.type.mjs +5 -1
- package/api/theme/_adapter.d.mts +20 -1
- package/api/theme/_adapter.mjs +149 -12
- package/api/theme/_app-provider.d.mts +31 -0
- package/api/theme/_app-provider.mjs +135 -0
- package/api/theme/add/add.mjs +3 -1
- package/api/theme/build/build.d.mts +127 -11
- package/api/theme/build/build.mjs +2047 -352
- package/api/theme/build/core-interception.d.mts +10 -0
- package/api/theme/build/core-interception.mjs +10 -0
- package/api/theme/build/family.mjs +61 -21
- package/api/theme/build/font-warning.d.mts +99 -5
- package/api/theme/build/font-warning.mjs +379 -61
- package/api/theme/build/icon-imports.mjs +83 -15
- package/api/theme/build/input-fields.d.mts +110 -0
- package/api/theme/build/input-fields.mjs +667 -0
- package/api/theme/build/null-values.d.mts +42 -0
- package/api/theme/build/null-values.mjs +283 -0
- package/api/theme/build/self-contained.d.mts +90 -0
- package/api/theme/build/self-contained.mjs +380 -0
- package/api/theme/build/source-syntax.d.mts +11 -0
- package/api/theme/build/source-syntax.mjs +28 -0
- package/api/theme/build/style-keys.d.mts +72 -0
- package/api/theme/build/style-keys.mjs +589 -0
- package/api/theme/build/typography-values.d.mts +61 -0
- package/api/theme/build/typography-values.mjs +408 -0
- package/api/theme/build/written-values.d.mts +78 -0
- package/api/theme/build/written-values.mjs +482 -0
- package/api/theme/generateTonalPalette.doc.mjs +1 -1
- package/api/theme/list/list.mjs +17 -1
- package/api/theme/palette/generate/generator.d.mts +14 -2
- package/api/theme/palette/generate/generator.mjs +94 -8
- package/api/theme/remove/remove.d.mts +2 -1
- package/api/theme/remove/remove.mjs +7 -3
- package/api/theme/theme.type.d.mts +89 -5
- package/api/theme/theme.type.mjs +46 -7
- package/api/theme/themeAdd.doc.mjs +1 -1
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themeListAvailable.doc.mjs +1 -1
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme/themeRemove.doc.mjs +8 -5
- package/api/theme/themeTemplate.doc.mjs +18 -3
- package/api/theme-edit/_adapter.d.mts +57 -4
- package/api/theme-edit/_adapter.mjs +380 -73
- package/api/theme-edit/_catalog.d.mts +82 -4
- package/api/theme-edit/_catalog.mjs +397 -24
- package/api/theme-edit/_check.d.mts +153 -2
- package/api/theme-edit/_check.mjs +3028 -563
- package/api/theme-edit/_color.d.mts +27 -2
- package/api/theme-edit/_color.mjs +66 -8
- package/api/theme-edit/_compiler.d.mts +7 -2
- package/api/theme-edit/_compiler.mjs +335 -21
- package/api/theme-edit/_context.d.mts +192 -7
- package/api/theme-edit/_context.mjs +750 -70
- package/api/theme-edit/_css.d.mts +32 -0
- package/api/theme-edit/_css.mjs +121 -34
- package/api/theme-edit/_edit.d.mts +68 -5
- package/api/theme-edit/_edit.mjs +5119 -667
- package/api/theme-edit/_how-commands.d.mts +28 -1
- package/api/theme-edit/_how-commands.mjs +621 -17
- package/api/theme-edit/_how-question.d.mts +101 -9
- package/api/theme-edit/_how-question.mjs +13901 -1282
- package/api/theme-edit/_how.d.mts +13 -2
- package/api/theme-edit/_how.mjs +389 -32
- package/api/theme-edit/_importers.d.mts +38 -0
- package/api/theme-edit/_importers.mjs +188 -0
- package/api/theme-edit/_missed.d.mts +54 -0
- package/api/theme-edit/_missed.mjs +917 -0
- package/api/theme-edit/_normal.d.mts +110 -21
- package/api/theme-edit/_normal.mjs +700 -105
- package/api/theme-edit/_palette.d.mts +77 -0
- package/api/theme-edit/_palette.mjs +364 -73
- package/api/theme-edit/_part-words.d.mts +39 -0
- package/api/theme-edit/_part-words.mjs +191 -0
- package/api/theme-edit/_parts.d.mts +74 -4
- package/api/theme-edit/_parts.mjs +677 -73
- package/api/theme-edit/_preview-app.d.mts +8 -13
- package/api/theme-edit/_preview-app.mjs +1189 -559
- package/api/theme-edit/_preview.d.mts +151 -10
- package/api/theme-edit/_preview.mjs +785 -98
- package/api/theme-edit/_project.d.mts +38 -3
- package/api/theme-edit/_project.mjs +135 -8
- package/api/theme-edit/_settings.d.mts +678 -83
- package/api/theme-edit/_settings.mjs +6037 -1051
- package/api/theme-edit/_tables.d.mts +43 -3
- package/api/theme-edit/_tables.mjs +244 -59
- package/api/theme-edit/_vet.d.mts +14 -1
- package/api/theme-edit/_vet.mjs +86 -12
- package/api/theme-edit/theme-edit.type.d.mts +53 -3
- package/api/theme-edit/theme-edit.type.mjs +23 -5
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
- package/api/upgrade/_adapter.mjs +13 -2
- package/api/upgrade/upgrade.mjs +16 -1
- package/assets/codemods/integration-runner.mjs +1 -1
- package/assets/codemods/jscodeshift.d.ts +1 -1
- package/assets/codemods/parse.mjs +2 -2
- package/assets/codemods/run-codemod.mjs +71 -18
- package/assets/codemods/runner.mjs +1 -4
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/author-a-theme.doc.mjs +1 -0
- package/assets/docs/theme.doc.dense.mjs +86 -7
- package/assets/docs/theme.doc.mjs +76 -2
- package/assets/docs/theme.doc.zh.mjs +61 -1
- package/assets/docs/tree/authoring.doc.mjs +1 -0
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/cli.doc.mjs +1 -0
- package/assets/docs/tree/computer-agent-guide.doc.mjs +1 -1
- package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/font-setup.doc.mjs +1 -1
- package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
- package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
- package/assets/docs/tree/global.doc.mjs +1 -0
- package/assets/docs/tree/install-once.doc.mjs +1 -1
- package/assets/docs/tree/problems.doc.mjs +1 -1
- package/assets/docs/tree/render-pages.doc.mjs +2 -2
- package/assets/docs/tree/share-a-page.doc.mjs +162 -0
- package/assets/docs/tree/single-component.doc.mjs +40 -2
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/who-answers.doc.mjs +3 -3
- package/assets/docs/tree/write-good-templates.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +1 -1
- package/assets/docs-routes.generated.json +1 -0
- package/assets/docs.generated.json +2 -2
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -1
- package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +4 -4
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsCustomSeparator.tsx +1 -0
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsSupportingVariant.tsx +2 -2
- package/assets/templates/blocks/components/Card/CardElevations.tsx +1 -1
- package/assets/templates/blocks/components/Card/CardWithInnerLayout.tsx +19 -3
- package/assets/templates/blocks/components/Card/ClickableCardWithNestedButton.tsx +11 -1
- package/assets/templates/blocks/components/Card/SelectableCardElevated.tsx +1 -1
- package/assets/templates/blocks/components/Card/SelectableCardMulti.tsx +1 -1
- package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +1 -1
- package/assets/templates/blocks/components/Center/CenterInsideACard.tsx +1 -1
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx +8 -0
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx +8 -2
- package/assets/templates/blocks/components/ChatComposerInput/useChatPasteAsTokenHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useChatPasteAsTokenHookUsage.tsx +32 -0
- package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useSpeechRecognitionHookUsage.tsx +43 -0
- package/assets/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +1 -0
- package/assets/templates/blocks/components/ChatLayout/ChatLayoutShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleCustomContent.tsx +9 -1
- package/assets/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +12 -2
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.tsx +28 -7
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +35 -7
- package/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx +1 -1
- package/assets/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupBasic.tsx +20 -4
- package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +15 -3
- package/assets/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +29 -6
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +2 -2
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +1 -1
- package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +2 -2
- package/assets/templates/blocks/components/Divider/DividerFullBleed.tsx +1 -1
- package/assets/templates/blocks/components/Divider/DividerShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Divider/DividerVariants.tsx +1 -1
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +23 -4
- package/assets/templates/blocks/components/EmptyState/EmptyStateActions.tsx +18 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.tsx +20 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.tsx +16 -2
- package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.tsx +11 -1
- package/assets/templates/blocks/components/Heading/HeadingTruncation.tsx +12 -2
- package/assets/templates/blocks/components/InternationalizationProvider/useDirectionHookUsage.tsx +1 -1
- package/assets/templates/blocks/components/LayoutContent/LayoutContentBasic.tsx +1 -1
- package/assets/templates/blocks/components/LayoutContent/LayoutContentShowcase.tsx +1 -1
- package/assets/templates/blocks/components/LayoutFooter/LayoutFooterActions.tsx +17 -3
- package/assets/templates/blocks/components/LayoutFooter/LayoutFooterShowcase.tsx +17 -3
- package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderShowcase.tsx +15 -3
- package/assets/templates/blocks/components/LayoutHeader/LayoutHeaderWithActions.tsx +9 -2
- package/assets/templates/blocks/components/LayoutPanel/LayoutPanelNavigation.tsx +1 -1
- package/assets/templates/blocks/components/LayoutPanel/LayoutPanelShowcase.tsx +1 -1
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +1 -1
- package/assets/templates/blocks/components/MultiSelector/MultiSelectorGhostToolbar.tsx +14 -2
- package/assets/templates/blocks/components/Outline/OutlineDensity.tsx +2 -0
- package/assets/templates/blocks/components/OverflowList/OverflowListShowcase.tsx +6 -1
- package/assets/templates/blocks/components/Pagination/PaginationVariants.tsx +4 -0
- package/assets/templates/blocks/components/Popover/PopoverHookUsage.tsx +17 -2
- package/assets/templates/blocks/components/SegmentedControl/SegmentedControlFillLayout.tsx +1 -1
- package/assets/templates/blocks/components/Selector/SelectorGhostToolbar.tsx +14 -2
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +8 -1
- package/assets/templates/blocks/components/SideNav/SideNavWithHeaderMenu.tsx +2 -2
- package/assets/templates/blocks/components/SideNavHeading/SideNavHeadingShowcase.tsx +2 -0
- package/assets/templates/blocks/components/Switch/SwitchWithStatus.tsx +1 -1
- package/assets/templates/blocks/components/TabList/TabListTabsFillLayout.tsx +1 -1
- package/assets/templates/blocks/components/TabList/TabListTabsWithActions.tsx +12 -1
- package/assets/templates/blocks/components/Table/TableBulkActionsTable.tsx +11 -1
- package/assets/templates/blocks/components/Table/TableInCard.tsx +2 -2
- package/assets/templates/blocks/components/Text/TextTruncation.tsx +1 -1
- package/assets/templates/blocks/components/Text/TextWordBreak.tsx +12 -2
- package/assets/templates/blocks/components/Text/TextWrap.tsx +19 -4
- package/assets/templates/blocks/components/TextArea/TextAreaCharacterCount.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaValidation.tsx +1 -1
- package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.tsx +1 -1
- package/assets/templates/blocks/components/TextInput/TextInputStatusVariant.tsx +2 -2
- package/assets/templates/blocks/components/Timestamp/TimestampAutoFormat.tsx +15 -1
- package/assets/templates/blocks/components/Timestamp/TimestampRelativeFormat.tsx +15 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +8 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +12 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +18 -3
- package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.tsx +6 -0
- package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.tsx +7 -1
- package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +2 -2
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +9 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +102 -6
- package/assets/templates/pages/ai-chat-landing/page.tsx +31 -4
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +3 -0
- package/assets/templates/pages/canvas-editor/page.tsx +73 -2
- package/assets/templates/pages/centered-hero/page.tsx +10 -4
- package/assets/templates/pages/course-detail/page.tsx +46 -2
- package/assets/templates/pages/dashboard/page.tsx +45 -16
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +1 -1
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +32 -21
- package/assets/templates/pages/dashboard-comparison/page.tsx +11 -2
- package/assets/templates/pages/dashboard-composition/page.tsx +22 -9
- package/assets/templates/pages/dashboard-progress/page.tsx +28 -16
- package/assets/templates/pages/dashboard-scorecard/page.tsx +9 -0
- package/assets/templates/pages/detail-page/page.tsx +157 -76
- package/assets/templates/pages/documentation/page.tsx +15 -2
- package/assets/templates/pages/documentation-design/page.tsx +7 -34
- package/assets/templates/pages/documentation-technical/page.tsx +122 -65
- package/assets/templates/pages/editor/page.tsx +41 -24
- package/assets/templates/pages/file-explorer/page.tsx +44 -1
- package/assets/templates/pages/form-two-column/page.tsx +2 -3
- package/assets/templates/pages/form-wizard/page.tsx +31 -3
- package/assets/templates/pages/form-wizard-vertical/page.tsx +55 -6
- package/assets/templates/pages/gallery-hero/page.tsx +2 -1
- package/assets/templates/pages/ide/page.tsx +23 -0
- package/assets/templates/pages/ide/template.doc.mjs +1 -1
- package/assets/templates/pages/incident-console/page.tsx +130 -30
- package/assets/templates/pages/incident-console/template.doc.mjs +2 -2
- package/assets/templates/pages/kanban-board/page.tsx +50 -3
- package/assets/templates/pages/login-card/page.tsx +16 -0
- package/assets/templates/pages/login-split/page.tsx +19 -6
- package/assets/templates/pages/messaging-shell/page.tsx +409 -419
- package/assets/templates/pages/messaging-shell/template.doc.mjs +6 -6
- package/assets/templates/pages/payment-form/page.tsx +107 -43
- package/assets/templates/pages/product-detail/page.tsx +26 -2
- package/assets/templates/pages/product-gallery/page.tsx +16 -14
- package/assets/templates/pages/settings/page.tsx +35 -3
- package/assets/templates/pages/settings-dialog/page.tsx +196 -17
- package/assets/templates/pages/settings-sidebar/page.tsx +23 -3
- package/assets/templates/pages/shell-nav/page.tsx +28 -12
- package/assets/templates/pages/shell-side-nav/page.tsx +27 -4
- package/assets/templates/pages/shell-top-nav/page.tsx +27 -1
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table/page.tsx +575 -61
- package/assets/templates/pages/table/template.doc.mjs +11 -1
- package/assets/templates/pages/table-collapsible/page.tsx +1 -1
- package/assets/templates/pages/table-comparison/page.tsx +1 -1
- package/assets/templates/pages/table-filter/page.tsx +17 -1
- package/assets/templates/pages/table-grouped/page.tsx +171 -133
- package/assets/templates/pages/table-inbox/page.tsx +60 -1
- package/assets/templates/pages/table-page/page.tsx +23 -2
- package/assets/templates/pages/table-tree/page.tsx +95 -13
- package/assets/templates/pages/theme-showcase/page.tsx +107 -11
- package/assets/templates/pages/work-item-detail/page.tsx +134 -80
- package/assets/templates/pages/work-item-detail/template.doc.mjs +0 -1
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/gothic/gothicTheme.ts +5 -0
- package/assets/templates/themes/neutral/neutralTheme.ts +1 -1
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
- package/assets/theme.template.ts +3 -2
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/doctypes/_schema.d.mts +28 -14
- package/authoring/doctypes/_schema.mjs +31 -0
- package/authoring/doctypes/command/command.doc.mjs +24 -0
- package/authoring/doctypes/command/type.ts +31 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/component/type.ts +8 -5
- package/authoring/doctypes/namespace/namespace.doc.mjs +6 -0
- package/authoring/doctypes/namespace/type.ts +4 -0
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +1 -1
- package/authoring/index.d.ts +6 -1
- package/authoring/integration/integration.doc.mjs +15 -0
- package/authoring/integration/schema.d.mts +30 -1
- package/authoring/integration/schema.mjs +129 -4
- package/authoring/integration/type.ts +48 -0
- package/clients/cli/bin/astryx.mjs +9 -3
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.mjs +17 -5
- package/clients/cli/commands/component.doc.mjs +1 -0
- package/clients/cli/commands/component.mjs +107 -42
- package/clients/cli/commands/discover.mjs +70 -3
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +41 -5
- package/clients/cli/commands/doctor.mjs +52 -2
- package/clients/cli/commands/experimental/index.mjs +4 -1
- package/clients/cli/commands/experimental/theme.mjs +1504 -186
- package/clients/cli/commands/experimental-render.doc.mjs +18 -5
- package/clients/cli/commands/experimental-theme-add.doc.mjs +2 -0
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +4 -3
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +5 -4
- package/clients/cli/commands/experimental-theme-eject.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +3 -2
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +6 -4
- package/clients/cli/commands/experimental-theme-targets.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-template.doc.mjs +1 -0
- package/clients/cli/commands/experimental-theme-use.doc.mjs +2 -0
- package/clients/cli/commands/gap-report.doc.mjs +1 -0
- package/clients/cli/commands/hook.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +1 -1
- package/clients/cli/commands/init.mjs +14 -6
- package/clients/cli/commands/integration-add.doc.mjs +1 -0
- package/clients/cli/commands/manifest.mjs +10 -3
- package/clients/cli/commands/search.mjs +13 -1
- package/clients/cli/commands/swizzle.doc.mjs +9 -2
- package/clients/cli/commands/swizzle.mjs +13 -6
- package/clients/cli/commands/template.doc.mjs +4 -1
- package/clients/cli/commands/template.mjs +34 -7
- package/clients/cli/commands/theme-add.doc.mjs +3 -2
- package/clients/cli/commands/theme-build.doc.mjs +11 -2
- package/clients/cli/commands/theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/theme-list.doc.mjs +1 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
- package/clients/cli/commands/theme-remove.doc.mjs +15 -6
- package/clients/cli/commands/theme-targets.doc.mjs +1 -0
- package/clients/cli/commands/theme-template.doc.mjs +1 -0
- package/clients/cli/commands/theme-use.doc.mjs +2 -1
- package/clients/cli/commands/theme.doc.mjs +7 -2
- package/clients/cli/commands/theme.mjs +824 -576
- package/clients/cli/commands/upgrade.mjs +7 -3
- package/clients/cli/index.mjs +177 -78
- package/clients/cli/lib/base-gate.mjs +522 -0
- package/clients/cli/lib/cli-error.mjs +21 -0
- package/clients/cli/lib/command-path.mjs +26 -0
- package/clients/cli/lib/define-command.mjs +161 -12
- package/clients/cli/lib/json-shim.mjs +679 -40
- package/clients/cli/lib/manifest.d.ts +14 -0
- package/clients/cli/lib/manifest.mjs +78 -22
- package/clients/cli/lib/not-ready.mjs +22 -0
- package/clients/cli/lib/root-args.mjs +79 -0
- package/clients/cli/lib/stray-option.mjs +491 -0
- package/clients/cli/lib/unknown-command.mjs +374 -0
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +39 -3
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/agent-docs/computer-agent-text.mjs +1 -1
- package/foundation/bases/core-docs.d.mts +10 -0
- package/foundation/bases/core-docs.mjs +42 -0
- package/foundation/bases/core.d.mts +11 -0
- package/foundation/bases/core.mjs +32 -0
- package/foundation/bases/requirements.d.mts +128 -0
- package/foundation/bases/requirements.mjs +193 -0
- package/foundation/bases/resolve.d.mts +134 -0
- package/foundation/bases/resolve.mjs +295 -0
- package/foundation/bases/state.d.mts +24 -0
- package/foundation/bases/state.mjs +46 -0
- package/foundation/bases/steps.d.mts +49 -0
- package/foundation/bases/steps.mjs +88 -0
- package/foundation/config/project.d.mts +22 -0
- package/foundation/config/project.mjs +94 -30
- package/foundation/config/theme-build-header.d.mts +14 -0
- package/foundation/config/theme-build-header.mjs +14 -0
- package/foundation/config/theme-private-vars.d.mts +26 -2
- package/foundation/config/theme-private-vars.mjs +65 -5
- package/foundation/config/theme-state.d.mts +19 -2
- package/foundation/config/theme-state.mjs +93 -1
- package/foundation/debug/event.d.mts +8 -2
- package/foundation/debug/event.mjs +6 -7
- package/foundation/debug/recorder.d.mts +8 -1
- package/foundation/debug/recorder.mjs +8 -2
- package/foundation/discovery/cli-self-doc-names.d.mts +13 -0
- package/foundation/discovery/cli-self-doc-names.mjs +51 -0
- package/foundation/discovery/cli-self-docs.d.mts +0 -2
- package/foundation/discovery/cli-self-docs.mjs +11 -16
- package/foundation/discovery/command-pointers.d.mts +28 -0
- package/foundation/discovery/command-pointers.mjs +31 -0
- package/foundation/discovery/component-discovery.d.mts +9 -8
- package/foundation/discovery/component-discovery.mjs +12 -6
- package/foundation/discovery/core-component-docs.d.mts +29 -0
- package/foundation/discovery/core-component-docs.mjs +83 -0
- package/foundation/discovery/core-theme-facts.d.mts +70 -0
- package/foundation/discovery/core-theme-facts.mjs +384 -0
- package/foundation/discovery/docs-discovery.d.mts +84 -9
- package/foundation/discovery/docs-discovery.mjs +151 -60
- package/foundation/discovery/entry-name-files.d.mts +72 -9
- package/foundation/discovery/entry-name-files.mjs +193 -103
- package/foundation/discovery/hook-discovery.d.mts +16 -6
- package/foundation/discovery/hook-discovery.mjs +82 -43
- package/foundation/discovery/integration-component-views.d.mts +15 -0
- package/foundation/discovery/integration-component-views.mjs +91 -0
- package/foundation/discovery/module-exports.d.mts +26 -1
- package/foundation/discovery/module-exports.mjs +114 -40
- package/foundation/discovery/name-roots.d.mts +38 -0
- package/foundation/discovery/name-roots.mjs +108 -0
- package/foundation/discovery/next-routes.d.mts +48 -0
- package/foundation/discovery/next-routes.mjs +197 -0
- package/foundation/discovery/stored-self-audit.mjs +2 -0
- package/foundation/discovery/template-adapter.d.mts +31 -63
- package/foundation/discovery/template-adapter.mjs +38 -207
- package/foundation/discovery/template-destination.d.mts +28 -0
- package/foundation/discovery/template-destination.mjs +106 -0
- package/foundation/discovery/template-ids.d.mts +69 -0
- package/foundation/discovery/template-ids.mjs +203 -0
- package/foundation/discovery/template-needs.mjs +3 -1
- package/foundation/discovery/theme-discovery.d.mts +12 -0
- package/foundation/discovery/theme-discovery.mjs +34 -2
- package/foundation/discovery/theme-imports.d.mts +10 -0
- package/foundation/discovery/theme-imports.mjs +37 -4
- package/foundation/discovery/theming-targets.d.mts +13 -5
- package/foundation/discovery/theming-targets.mjs +38 -45
- package/foundation/doc-compiler/generated-levels.d.mts +43 -0
- package/foundation/doc-compiler/generated-levels.mjs +72 -0
- package/foundation/doc-compiler/literal-doc.d.mts +12 -0
- package/foundation/doc-compiler/literal-doc.mjs +322 -0
- package/foundation/doc-compiler/stored-docs.d.mts +7 -0
- package/foundation/doc-compiler/stored-docs.mjs +14 -1
- package/foundation/doc-compiler/tree.d.mts +18 -87
- package/foundation/doc-compiler/tree.mjs +57 -64
- package/foundation/env/intl-defaults.d.mts +39 -0
- package/foundation/env/intl-defaults.mjs +150 -0
- package/foundation/env/intl-now.d.mts +21 -0
- package/foundation/env/intl-now.mjs +25 -0
- package/foundation/env/package-manager.d.mts +11 -2
- package/foundation/env/package-manager.mjs +28 -4
- package/foundation/fonts/font-stylesheet.d.mts +38 -0
- package/foundation/fonts/font-stylesheet.mjs +128 -12
- package/foundation/fs/cache-eviction.d.mts +3 -1
- package/foundation/fs/cache-eviction.mjs +7 -1
- package/foundation/fs/exact-codec.d.mts +12 -2
- package/foundation/fs/exact-codec.mjs +23 -6
- package/foundation/fs/file-protection.mjs +12 -2
- package/foundation/fs/gather-cache.d.mts +81 -2
- package/foundation/fs/gather-cache.mjs +615 -97
- package/foundation/fs/glob.d.mts +16 -0
- package/foundation/fs/glob.mjs +105 -0
- package/foundation/fs/jiti-cache.mjs +14 -6
- package/foundation/fs/kept-tree.d.mts +39 -15
- package/foundation/fs/kept-tree.mjs +155 -46
- package/foundation/fs/loaded-files.d.mts +30 -0
- package/foundation/fs/loaded-files.mjs +148 -0
- package/foundation/fs/module-loader.d.mts +53 -8
- package/foundation/fs/module-loader.mjs +559 -39
- package/foundation/fs/own-modules.d.mts +29 -0
- package/foundation/fs/own-modules.mjs +57 -0
- package/foundation/fs/path-safety.d.mts +34 -2
- package/foundation/fs/path-safety.mjs +170 -18
- package/foundation/fs/paths.d.mts +41 -2
- package/foundation/fs/paths.mjs +95 -5
- package/foundation/fs/read-record.d.mts +84 -7
- package/foundation/fs/read-record.mjs +333 -56
- package/foundation/fs/regular-file.d.mts +29 -0
- package/foundation/fs/regular-file.mjs +77 -0
- package/foundation/fs/stop-cleanup.d.mts +12 -0
- package/foundation/fs/stop-cleanup.mjs +66 -0
- package/foundation/fs/stylesheet-file.d.mts +37 -0
- package/foundation/fs/stylesheet-file.mjs +48 -0
- package/foundation/fs/theme-module-rejections.d.mts +32 -0
- package/foundation/fs/theme-module-rejections.mjs +82 -0
- package/foundation/integrations/integrations.d.mts +27 -1
- package/foundation/integrations/integrations.mjs +24 -2
- package/foundation/integrations/pack-state.d.mts +85 -0
- package/foundation/integrations/pack-state.mjs +509 -0
- package/foundation/integrations/shipped-imports.d.mts +125 -0
- package/foundation/integrations/shipped-imports.mjs +530 -0
- package/foundation/integrations/validate-contributions.d.mts +0 -17
- package/foundation/integrations/validate-contributions.mjs +81 -290
- package/foundation/release/choose.d.mts +7 -0
- package/foundation/release/choose.mjs +16 -2
- package/foundation/release/handoff.mjs +68 -13
- package/foundation/release/notices.d.mts +46 -9
- package/foundation/release/notices.mjs +78 -20
- package/foundation/release/pnp-runtime.d.mts +66 -0
- package/foundation/release/pnp-runtime.mjs +139 -0
- package/foundation/release/project.d.mts +11 -0
- package/foundation/release/project.mjs +23 -7
- package/foundation/release/run-context.d.mts +7 -2
- package/foundation/release/run-context.mjs +6 -2
- package/foundation/render/assets.mjs +52 -7
- package/foundation/render/charts.d.mts +78 -27
- package/foundation/render/charts.mjs +319 -90
- package/foundation/render/css-cut.d.mts +14 -1
- package/foundation/render/css-cut.mjs +117 -4
- package/foundation/render/cut-short.d.mts +35 -0
- package/foundation/render/cut-short.mjs +124 -0
- package/foundation/render/embedded-imports.d.mts +31 -0
- package/foundation/render/embedded-imports.mjs +169 -39
- package/foundation/render/font-probe.d.mts +27 -0
- package/foundation/render/font-probe.mjs +77 -0
- package/foundation/render/layers.d.mts +49 -0
- package/foundation/render/layers.mjs +347 -0
- package/foundation/render/offline.d.mts +32 -0
- package/foundation/render/offline.mjs +56 -0
- package/foundation/render/page-worker.mjs +374 -15
- package/foundation/render/picture-chrome.mjs +46 -4
- package/foundation/render/picture-playwright.mjs +41 -5
- package/foundation/render/picture-window.d.mts +32 -0
- package/foundation/render/picture-window.mjs +146 -0
- package/foundation/render/render-page.d.mts +46 -4
- package/foundation/render/render-page.mjs +453 -98
- package/foundation/response/base.d.ts +25 -0
- package/foundation/response/error-codes.d.mts +4 -1
- package/foundation/response/error-codes.d.ts +4 -1
- package/foundation/response/error-codes.doc.mjs +17 -0
- package/foundation/response/error-codes.mjs +21 -0
- package/foundation/response/json.d.mts +3 -1
- package/foundation/response/json.mjs +7 -2
- package/foundation/response/response-types.doc.mjs +12 -12
- package/foundation/runtime/css-tree.d.mts +24 -0
- package/foundation/runtime/css-tree.mjs +103 -0
- package/foundation/runtime/lazy-dependencies.d.mts +3 -1
- package/foundation/runtime/lazy-dependencies.mjs +20 -5
- package/foundation/suggest/name-index.d.mts +149 -0
- package/foundation/suggest/name-index.mjs +317 -0
- package/foundation/suggest/other-command.d.mts +146 -0
- package/foundation/suggest/other-command.mjs +783 -0
- package/foundation/text/css-escape.d.mts +18 -0
- package/foundation/text/css-escape.mjs +35 -0
- package/foundation/text/entry-names.d.mts +14 -0
- package/foundation/text/entry-names.mjs +14 -0
- package/foundation/text/string-utils.d.mts +49 -5
- package/foundation/text/string-utils.mjs +124 -26
- package/foundation/text/suggest-order.d.mts +75 -4
- package/foundation/text/suggest-order.mjs +285 -9
- package/foundation/text/written-string.d.mts +17 -0
- package/foundation/text/written-string.mjs +22 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +8 -7
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
import {writeThemeTemplate} from '../theme/template/template.mjs';
|
|
35
35
|
import {
|
|
36
|
+
blankOptionProblem,
|
|
36
37
|
buildInputProblem,
|
|
37
38
|
buildSuggestion,
|
|
38
39
|
realLocation,
|
|
@@ -40,16 +41,26 @@ import {
|
|
|
40
41
|
} from '../theme/build/build.mjs';
|
|
41
42
|
import {createHash} from 'node:crypto';
|
|
42
43
|
import * as fs from 'node:fs';
|
|
43
|
-
import {createRequire} from 'node:module';
|
|
44
44
|
import * as path from 'node:path';
|
|
45
45
|
import * as edit from './_edit.mjs';
|
|
46
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
baseInstalled,
|
|
48
|
+
installLine,
|
|
49
|
+
packageInstalled,
|
|
50
|
+
themeCacheRoot,
|
|
51
|
+
} from './_project.mjs';
|
|
47
52
|
import * as preview from './_preview-app.mjs';
|
|
48
53
|
import {AstryxError} from '../error.mjs';
|
|
49
54
|
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
50
55
|
import {findPackageRoot} from '../../foundation/fs/paths.mjs';
|
|
51
|
-
import {
|
|
56
|
+
import {
|
|
57
|
+
baseWeightNotes,
|
|
58
|
+
context,
|
|
59
|
+
coreApp,
|
|
60
|
+
loneFamilyNotes,
|
|
61
|
+
} from './_context.mjs';
|
|
52
62
|
import {APP_COPY_MARK} from './_marks.mjs';
|
|
63
|
+
import {irregularFileKind} from '../../foundation/fs/regular-file.mjs';
|
|
53
64
|
import {
|
|
54
65
|
fontKey,
|
|
55
66
|
importedFontFamilies,
|
|
@@ -65,6 +76,7 @@ import {LIKE, P} from './_tables.mjs';
|
|
|
65
76
|
/** The preview command, as a person runs it. */
|
|
66
77
|
const PREVIEW_WORDS = P.replace(/ editor$/, ' preview');
|
|
67
78
|
import {setLine} from './_check.mjs';
|
|
79
|
+
export {modeDialValue} from './_check.mjs';
|
|
68
80
|
import {followLine, splitCommand} from './_vet.mjs';
|
|
69
81
|
import {
|
|
70
82
|
SHOWCASE_GROUPS,
|
|
@@ -80,11 +92,13 @@ import {
|
|
|
80
92
|
buildColorModes,
|
|
81
93
|
camel,
|
|
82
94
|
folderIsEmpty,
|
|
95
|
+
editorMadeFolder,
|
|
83
96
|
loadTheme,
|
|
84
97
|
setAfterBuild,
|
|
85
98
|
editedThemes,
|
|
86
99
|
themeFiles,
|
|
87
100
|
fontsourcePackageOf,
|
|
101
|
+
fontsourceSuggestion,
|
|
88
102
|
themeSourceRefusal,
|
|
89
103
|
typedThemeName,
|
|
90
104
|
} from './_settings.mjs';
|
|
@@ -94,7 +108,13 @@ setAfterBuild(writeAppCopy);
|
|
|
94
108
|
import {LOCAL_THEME_ROOT} from '../../foundation/config/theme-state.mjs';
|
|
95
109
|
|
|
96
110
|
export {parsePoints} from './_how.mjs';
|
|
97
|
-
export {
|
|
111
|
+
export {
|
|
112
|
+
newFlagList,
|
|
113
|
+
checkedChangeLine as editorCheckedLine,
|
|
114
|
+
checkedNewLines as editorCheckedNewLines,
|
|
115
|
+
checkedShowLines as editorCheckedShowLines,
|
|
116
|
+
} from './_edit.mjs';
|
|
117
|
+
export {splitCommand} from './_vet.mjs';
|
|
98
118
|
import {themeEditHow as howAt} from './_how.mjs';
|
|
99
119
|
|
|
100
120
|
/**
|
|
@@ -145,7 +165,19 @@ export const editorBaseIn = (slug, cwd) =>
|
|
|
145
165
|
/** The sections `show --section` takes. */
|
|
146
166
|
export const showSections = () => [...SHOWCASE_GROUPS];
|
|
147
167
|
|
|
148
|
-
|
|
168
|
+
/**
|
|
169
|
+
* A free folder for a new starter app here, the one `preview app`'s own
|
|
170
|
+
* refusals offer.
|
|
171
|
+
* @param {string} cwd
|
|
172
|
+
*/
|
|
173
|
+
export const editorFreeAppFolder = cwd => preview.freeAppFolder(cwd);
|
|
174
|
+
|
|
175
|
+
export {
|
|
176
|
+
dialTakesText,
|
|
177
|
+
dialValueFits,
|
|
178
|
+
slugOk as editorNameOk,
|
|
179
|
+
usableNewName as editorFreeName,
|
|
180
|
+
} from './_settings.mjs';
|
|
149
181
|
|
|
150
182
|
/**
|
|
151
183
|
* The project a command acts on: the Astryx project at or above `cwd`, found
|
|
@@ -419,14 +451,14 @@ function absolute(result, root, from) {
|
|
|
419
451
|
/^themes\/\S*$/.test(v) && !(key && PROSE.has(key))
|
|
420
452
|
? path.join(root, v)
|
|
421
453
|
: key && PROSE.has(key)
|
|
422
|
-
? v.replace(
|
|
454
|
+
? previewCommandsFrom(v, root, from).replace(
|
|
423
455
|
/(^|[\s(,])((?:themes|src|app)\/[^\s,;)]*)/g,
|
|
424
456
|
(all, before, file) =>
|
|
425
457
|
/^themes\//.test(file) || inRoot(file)
|
|
426
458
|
? `${before}${path.join(root, file)}`
|
|
427
459
|
: all,
|
|
428
460
|
)
|
|
429
|
-
: v
|
|
461
|
+
: previewCommandsFrom(v, root, from)
|
|
430
462
|
: Array.isArray(v)
|
|
431
463
|
? v.map(x => map(x, key))
|
|
432
464
|
: v && typeof v === 'object'
|
|
@@ -481,6 +513,23 @@ async function inProject(options, lock, fn, bestEffort = false, again = null) {
|
|
|
481
513
|
*/
|
|
482
514
|
function fromCaller(e, root, from) {
|
|
483
515
|
if (path.resolve(from) === root || !Array.isArray(e?.suggestions)) return e;
|
|
516
|
+
for (const s of e.suggestions)
|
|
517
|
+
if (typeof s?.name === 'string')
|
|
518
|
+
s.name = previewCommandsFrom(s.name, root, from);
|
|
519
|
+
return e;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* The preview commands in a line, rebased from the project root onto the
|
|
524
|
+
* folder the command ran in: each `--path` and each `preview app` folder,
|
|
525
|
+
* so a pointer works where it is printed (in a refusal, a `see` line, a
|
|
526
|
+
* note). A folder that comes out starting with `-` goes after `--`.
|
|
527
|
+
* @param {string} line
|
|
528
|
+
* @param {string} root
|
|
529
|
+
* @param {string} from
|
|
530
|
+
*/
|
|
531
|
+
export function previewCommandsFrom(line, root, from) {
|
|
532
|
+
if (path.resolve(from) === root) return line;
|
|
484
533
|
const ARG = String.raw`('(?:[^']|'\\'')*'|"[^"]*"|[^\s'"]+)`;
|
|
485
534
|
/** @param {string} v */
|
|
486
535
|
const unquote = v =>
|
|
@@ -493,32 +542,40 @@ function fromCaller(e, root, from) {
|
|
|
493
542
|
const rel = v =>
|
|
494
543
|
/^<.*>$/.test(v)
|
|
495
544
|
? v
|
|
496
|
-
:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
545
|
+
: path.relative(path.resolve(from), path.resolve(root, unquote(v))) ||
|
|
546
|
+
'.';
|
|
547
|
+
const CMD = 'astryx experimental theme preview ';
|
|
548
|
+
const parts = line.split(CMD);
|
|
549
|
+
return parts
|
|
550
|
+
.map((part, i) => {
|
|
551
|
+
// A command after a `cd … &&` runs in the folder it names: as given.
|
|
552
|
+
if (i === 0 || /\bcd [^&]*&& (?:npx \S+ )?$/.test(parts[i - 1]))
|
|
553
|
+
return part;
|
|
554
|
+
let out = part.replace(
|
|
505
555
|
new RegExp(`(--path )${ARG}`, 'g'),
|
|
506
556
|
(
|
|
507
557
|
/** @type {string} */ _m,
|
|
508
558
|
/** @type {string} */ flag,
|
|
509
559
|
/** @type {string} */ v,
|
|
510
|
-
) => flag + rel(v),
|
|
511
|
-
)
|
|
512
|
-
.replace(
|
|
513
|
-
new RegExp(`^(
|
|
560
|
+
) => flag + quoteCommandArgument(rel(v)),
|
|
561
|
+
);
|
|
562
|
+
out = out.replace(
|
|
563
|
+
new RegExp(`^app ((?:--theme ${ARG} )?)(-- )?${ARG}`),
|
|
514
564
|
(
|
|
515
|
-
/** @type {string} */
|
|
516
|
-
/** @type {string} */
|
|
565
|
+
/** @type {string} */ m,
|
|
566
|
+
/** @type {string} */ flags,
|
|
567
|
+
/** @type {string} */ _t,
|
|
568
|
+
/** @type {string | undefined} */ dash,
|
|
517
569
|
/** @type {string} */ v,
|
|
518
|
-
) =>
|
|
570
|
+
) => {
|
|
571
|
+
if (!dash && v.startsWith('-')) return m;
|
|
572
|
+
const r = rel(v);
|
|
573
|
+
return `app ${flags}${r.startsWith('-') ? '-- ' : ''}${quoteCommandArgument(r)}`;
|
|
574
|
+
},
|
|
519
575
|
);
|
|
520
|
-
|
|
521
|
-
|
|
576
|
+
return out;
|
|
577
|
+
})
|
|
578
|
+
.join(CMD);
|
|
522
579
|
}
|
|
523
580
|
|
|
524
581
|
/**
|
|
@@ -620,7 +677,8 @@ export const themeEditPreviewAdd = (description, options = {}) =>
|
|
|
620
677
|
* saying where the change stands (a change stopped part way is finished by
|
|
621
678
|
* the next preview command), never an ok with exit 0.
|
|
622
679
|
* @template T
|
|
623
|
-
* @param {string} where where the change stands, and what
|
|
680
|
+
* @param {string | (() => string)} where where the change stands, and what
|
|
681
|
+
* finishes it; a function is asked when the stop lands, so it can look
|
|
624
682
|
* @param {() => Promise<T>} fn
|
|
625
683
|
* @returns {Promise<T>}
|
|
626
684
|
*/
|
|
@@ -628,7 +686,9 @@ async function stopTold(where, fn) {
|
|
|
628
686
|
const on = (/** @type {NodeJS.Signals} */ sig) => {
|
|
629
687
|
process.removeListener('SIGINT', on);
|
|
630
688
|
process.removeListener('SIGTERM', on);
|
|
631
|
-
process.stderr.write(
|
|
689
|
+
process.stderr.write(
|
|
690
|
+
`Stopped: ${typeof where === 'function' ? where() : where}.\n`,
|
|
691
|
+
);
|
|
632
692
|
// With no other listener (a lock's, which ends the process itself),
|
|
633
693
|
// the stop ends it here.
|
|
634
694
|
if (process.listenerCount(sig) === 0) process.kill(process.pid, sig);
|
|
@@ -657,9 +717,23 @@ async function stopTold(where, fn) {
|
|
|
657
717
|
*/
|
|
658
718
|
export const themeEditPreviewApp = async (dir, options = {}) => {
|
|
659
719
|
const from = options.cwd ?? process.cwd();
|
|
720
|
+
// The app is written into a temp folder and moved into place in one step,
|
|
721
|
+
// with no pause on the way: when a stop lands, the folder holds the whole
|
|
722
|
+
// app or is as it was. Which one is told.
|
|
723
|
+
const target =
|
|
724
|
+
typeof dir === 'string' && dir.trim() ? path.resolve(from, dir) : null;
|
|
725
|
+
/** @param {string} d */
|
|
726
|
+
const holdsApp = d => fs.existsSync(path.join(d, 'package.json'));
|
|
727
|
+
const hadApp = target != null && holdsApp(target);
|
|
728
|
+
const shownTarget = target
|
|
729
|
+
? path.relative(from, target).split(path.sep).join('/') || '.'
|
|
730
|
+
: null;
|
|
660
731
|
return fromHere(
|
|
661
732
|
await stopTold(
|
|
662
|
-
|
|
733
|
+
() =>
|
|
734
|
+
target && !hadApp && holdsApp(target)
|
|
735
|
+
? `the new app in ${shownTarget}/ is written whole (it is moved into place in one step); cd ${quoteCommandArgument(shownTarget?.startsWith('-') ? `./${shownTarget}` : (shownTarget ?? '.'))} && npm install && npm run dev opens it`
|
|
736
|
+
: `nothing was written${shownTarget ? ` (${shownTarget}/ is as it was)` : ''}; run the same command again`,
|
|
663
737
|
() =>
|
|
664
738
|
inProject(
|
|
665
739
|
options,
|
|
@@ -727,11 +801,15 @@ export const themeEditPreviewRemove = (page, options = {}) =>
|
|
|
727
801
|
* does not).
|
|
728
802
|
* @param {string} root
|
|
729
803
|
* @param {string} word a path or a name
|
|
804
|
+
* @param {{made?: boolean}} [options] `made`: a folder the editor made that
|
|
805
|
+
* lost its settings counts too (the editor commands refuse it, and so
|
|
806
|
+
* does compile)
|
|
730
807
|
* @returns {{root: string, slug: string} | null}
|
|
731
808
|
*/
|
|
732
|
-
function editorThemeAt(root, word) {
|
|
809
|
+
function editorThemeAt(root, word, {made = false} = {}) {
|
|
733
810
|
const has = (/** @type {string} */ r, /** @type {string} */ slug) =>
|
|
734
|
-
fs.existsSync(path.join(r, 'themes', slug, `${slug}.settings.json`))
|
|
811
|
+
fs.existsSync(path.join(r, 'themes', slug, `${slug}.settings.json`)) ||
|
|
812
|
+
(made && editorMadeFolder(r, slug));
|
|
735
813
|
if (/^[a-z][a-z0-9-]*$/.test(word))
|
|
736
814
|
return has(root, word) ? {root, slug: word} : null;
|
|
737
815
|
// Through a link, the real path decides (a linked theme folder is the
|
|
@@ -893,7 +971,9 @@ export function editorThemeRefusal(err, cwd) {
|
|
|
893
971
|
}
|
|
894
972
|
|
|
895
973
|
/** The shared typo rule, for a typed subcommand. */
|
|
896
|
-
export {typoOf} from './_normal.mjs';
|
|
974
|
+
export {booleanWord, typoNear, typoOf} from './_normal.mjs';
|
|
975
|
+
// How a setting is named in a result: one wording for the API and the CLI.
|
|
976
|
+
export {describe, namesSetting, needsPart} from './_settings.mjs';
|
|
897
977
|
|
|
898
978
|
/**
|
|
899
979
|
* The editor themes of the app the folder `cwd` is in, by name; none when
|
|
@@ -1015,6 +1095,32 @@ export async function editorCompileProblem(
|
|
|
1015
1095
|
) {
|
|
1016
1096
|
const cwdRoot = projectRoot(cwd);
|
|
1017
1097
|
const COMPILE = {group: 'experimental theme', build: 'compile'};
|
|
1098
|
+
// An empty or blank --out or --icons-specifier names nothing: refused
|
|
1099
|
+
// before anything is built, with the compile without it.
|
|
1100
|
+
const blank =
|
|
1101
|
+
blankOptionProblem(
|
|
1102
|
+
'--out',
|
|
1103
|
+
out,
|
|
1104
|
+
'name a file or folder, or leave out --out to write beside the source',
|
|
1105
|
+
buildSuggestion(
|
|
1106
|
+
files.length === 1 ? files[0] : files,
|
|
1107
|
+
{check, iconsSpecifier},
|
|
1108
|
+
cwd,
|
|
1109
|
+
COMPILE,
|
|
1110
|
+
),
|
|
1111
|
+
) ??
|
|
1112
|
+
blankOptionProblem(
|
|
1113
|
+
'--icons-specifier',
|
|
1114
|
+
iconsSpecifier,
|
|
1115
|
+
"name the registry module, or leave out --icons-specifier to keep the theme source's own import",
|
|
1116
|
+
buildSuggestion(
|
|
1117
|
+
files.length === 1 ? files[0] : files,
|
|
1118
|
+
{check, out},
|
|
1119
|
+
cwd,
|
|
1120
|
+
COMPILE,
|
|
1121
|
+
),
|
|
1122
|
+
);
|
|
1123
|
+
if (blank) return blank;
|
|
1018
1124
|
/**
|
|
1019
1125
|
* The compile of `source` (from `from`) with the caller's mode: a check
|
|
1020
1126
|
* stays a check, and --out names the same file from there.
|
|
@@ -1065,16 +1171,17 @@ export async function editorCompileProblem(
|
|
|
1065
1171
|
// built (the module rewritten, the stylesheet not) and the copy made from
|
|
1066
1172
|
// it.
|
|
1067
1173
|
if (out) {
|
|
1068
|
-
// Any --out in the copy folder, the folder itself too,
|
|
1069
|
-
//
|
|
1174
|
+
// Any --out in the copy folder, the folder itself too, written with
|
|
1175
|
+
// backslashes, through a link or (on a case-insensitive disk) in
|
|
1176
|
+
// another case, as the build reads it: real paths name the folder as
|
|
1177
|
+
// the disk does.
|
|
1070
1178
|
const rel = path
|
|
1071
1179
|
.relative(
|
|
1072
1180
|
realLocation(cwdRoot),
|
|
1073
1181
|
realLocation(path.resolve(cwd, slashed(out))),
|
|
1074
1182
|
)
|
|
1075
1183
|
.split(path.sep)
|
|
1076
|
-
.filter(Boolean)
|
|
1077
|
-
.map(x => x.toLowerCase());
|
|
1184
|
+
.filter(Boolean);
|
|
1078
1185
|
const inCopy =
|
|
1079
1186
|
rel[0] === 'src' &&
|
|
1080
1187
|
rel[1] === 'themes' &&
|
|
@@ -1171,11 +1278,22 @@ export async function editorCompileProblem(
|
|
|
1171
1278
|
);
|
|
1172
1279
|
}
|
|
1173
1280
|
// Its source too: a compile of the copy builds neither the theme
|
|
1174
|
-
// nor a current copy.
|
|
1281
|
+
// nor a current copy. The compile offered is the one this check
|
|
1282
|
+
// takes (an --out in the theme's own folder is refused there, and its
|
|
1283
|
+
// refusal's line is offered instead).
|
|
1284
|
+
const ownRefused = await editorCompileProblem([own], {
|
|
1285
|
+
cwd,
|
|
1286
|
+
check,
|
|
1287
|
+
family,
|
|
1288
|
+
iconsSpecifier,
|
|
1289
|
+
out,
|
|
1290
|
+
});
|
|
1175
1291
|
return new AstryxError(
|
|
1176
1292
|
`${file} is ${relParts.length === 3 ? '' : 'part of '}${t}'s app copy, which the editor writes from themes/${t}/ after every build; compile the theme itself.`,
|
|
1177
1293
|
[
|
|
1178
|
-
|
|
1294
|
+
...(ownRefused?.suggestions?.length
|
|
1295
|
+
? ownRefused.suggestions
|
|
1296
|
+
: [{name: compileLine(own, cwd), reason: 'do this instead'}]),
|
|
1179
1297
|
{
|
|
1180
1298
|
name: runLine(cwdRoot, `experimental theme editor show ${t}`),
|
|
1181
1299
|
reason: 'writes the app copy again from the theme',
|
|
@@ -1184,9 +1302,21 @@ export async function editorCompileProblem(
|
|
|
1184
1302
|
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
1185
1303
|
);
|
|
1186
1304
|
}
|
|
1187
|
-
const at = editorThemeAt(cwdRoot, abs);
|
|
1305
|
+
const at = editorThemeAt(cwdRoot, abs, {made: true});
|
|
1188
1306
|
if (!at || !editorOwnFile(at.slug, file)) continue;
|
|
1189
1307
|
const {root, slug} = at;
|
|
1308
|
+
// An editor theme that lost its settings is refused as every editor
|
|
1309
|
+
// command refuses it, with the line that makes it again: a plain build
|
|
1310
|
+
// of it would drop the editor's settings and app copy.
|
|
1311
|
+
if (
|
|
1312
|
+
!fs.existsSync(path.join(root, 'themes', slug, `${slug}.settings.json`))
|
|
1313
|
+
)
|
|
1314
|
+
try {
|
|
1315
|
+
loadTheme(root, slug);
|
|
1316
|
+
} catch (e) {
|
|
1317
|
+
if (e instanceof AstryxError) return e;
|
|
1318
|
+
throw e;
|
|
1319
|
+
}
|
|
1190
1320
|
const source = `themes/${slug}/${slug}.theme.ts`;
|
|
1191
1321
|
// An editor theme is built from its project's root, as every editor
|
|
1192
1322
|
// command runs there: from a subfolder the build would write outside
|
|
@@ -1250,8 +1380,9 @@ export async function editorCompileProblem(
|
|
|
1250
1380
|
);
|
|
1251
1381
|
} catch (e) {
|
|
1252
1382
|
// A settings file damaged by hand is refused like any refusal,
|
|
1253
|
-
// never as a raw error.
|
|
1254
|
-
if (e instanceof AstryxError)
|
|
1383
|
+
// never as a raw error, with the lines every command gives it.
|
|
1384
|
+
if (e instanceof AstryxError)
|
|
1385
|
+
return edit.editorSavedRefusal(e, root, slug);
|
|
1255
1386
|
throw e;
|
|
1256
1387
|
}
|
|
1257
1388
|
// An own change to the theme source is what compile builds (and what
|
|
@@ -1263,12 +1394,10 @@ export async function editorCompileProblem(
|
|
|
1263
1394
|
)
|
|
1264
1395
|
)
|
|
1265
1396
|
why = null;
|
|
1266
|
-
// A missing built output is one compile writes itself
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
/^[^/]+\.(css|js|d\.ts|css\.d\.ts) was missing$/.test(why)
|
|
1271
|
-
)
|
|
1397
|
+
// A missing built output is one compile writes itself, and one a
|
|
1398
|
+
// check names in its own result (the stale outputs, upToDate false):
|
|
1399
|
+
// never a reason to refuse either.
|
|
1400
|
+
if (why && /^[^/]+\.(css|js|d\.ts|css\.d\.ts) was missing$/.test(why))
|
|
1272
1401
|
why = null;
|
|
1273
1402
|
// Saved settings the editor no longer accepts: show refuses them too,
|
|
1274
1403
|
// so the refusal names the undo that removes each.
|
|
@@ -1315,6 +1444,36 @@ const COMPILE_HELD = new Set();
|
|
|
1315
1444
|
/** @type {((refused?: boolean) => Promise<void>) | null} The release of the running compile's hold; `refused`: it wrote nothing, so no app copy either. */
|
|
1316
1445
|
let releaseCompileHold = null;
|
|
1317
1446
|
|
|
1447
|
+
/** @type {Array<{root: string, slug: string, copy: (refused: boolean) => boolean, report: () => Record<string, unknown> | null}>} The running compile's held themes. */
|
|
1448
|
+
let compileHoldItems = [];
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* For `compile`, once its outputs are written: write each held editor
|
|
1452
|
+
* theme's app copy now, and say per file what the write did (`appCopy` on
|
|
1453
|
+
* a first write, `appCopyStale` when something keeps the copy behind), so
|
|
1454
|
+
* the JSON result carries what the text says.
|
|
1455
|
+
* @param {string[]} files
|
|
1456
|
+
* @param {string} cwd
|
|
1457
|
+
* @returns {Promise<Record<string, Record<string, unknown>>>}
|
|
1458
|
+
*/
|
|
1459
|
+
export async function editorAfterBuild(files, cwd) {
|
|
1460
|
+
const root = projectRoot(cwd);
|
|
1461
|
+
/** @type {Record<string, Record<string, unknown>>} */
|
|
1462
|
+
const out = {};
|
|
1463
|
+
for (const item of compileHoldItems) {
|
|
1464
|
+
item.copy(false);
|
|
1465
|
+
const report = item.report();
|
|
1466
|
+
if (!report) continue;
|
|
1467
|
+
for (const file of files) {
|
|
1468
|
+
const abs = path.resolve(cwd, file);
|
|
1469
|
+
const own = editorThemeAt(root, abs);
|
|
1470
|
+
if (own?.slug === item.slug && editorOwnFile(own.slug, file))
|
|
1471
|
+
out[file] = report;
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
return out;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1318
1477
|
/**
|
|
1319
1478
|
* Hold the theme lock of every editor theme among the files while
|
|
1320
1479
|
* `compile` builds or checks them, so it never reads a change half
|
|
@@ -1339,8 +1498,9 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
|
|
|
1339
1498
|
if (copy) found.set(`${copy.root}\0${copy.slug}`, copy);
|
|
1340
1499
|
}
|
|
1341
1500
|
const themes = [...found.keys()].sort().map(k => found.get(k));
|
|
1342
|
-
/** @type {Array<{copy: (refused: boolean) => boolean, finish: (later: boolean) => Promise<void>}>} */
|
|
1501
|
+
/** @type {Array<{root: string, slug: string, copy: (refused: boolean) => boolean, report: () => Record<string, unknown> | null, finish: (later: boolean) => Promise<void>}>} */
|
|
1343
1502
|
const releases = [];
|
|
1503
|
+
compileHoldItems = releases;
|
|
1344
1504
|
// Every theme's copy is written first, at once (a refusal ends the run
|
|
1345
1505
|
// without waiting), then each lock goes.
|
|
1346
1506
|
const releaseAll = async (refused = false) => {
|
|
@@ -1373,6 +1533,11 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
|
|
|
1373
1533
|
// An --out elsewhere builds neither themes/<theme>/ nor its copy.
|
|
1374
1534
|
const skipped = outSkipsCopy(root, slug, cwd, {check, out});
|
|
1375
1535
|
let ran = false;
|
|
1536
|
+
let copied = false;
|
|
1537
|
+
/** @type {string[] | null} */
|
|
1538
|
+
let firstWrite = null;
|
|
1539
|
+
/** @type {string | null} */
|
|
1540
|
+
let keptBack = null;
|
|
1376
1541
|
/** @type {any} */
|
|
1377
1542
|
let copyCtx = null;
|
|
1378
1543
|
try {
|
|
@@ -1402,7 +1567,13 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
|
|
|
1402
1567
|
// a later theme did; one that was refused or failed keeps its copy.
|
|
1403
1568
|
// True when the copy still needs its font stylesheet from the
|
|
1404
1569
|
// theme's settings (written in finish).
|
|
1570
|
+
root,
|
|
1571
|
+
slug,
|
|
1405
1572
|
copy: (/** @type {boolean} */ refused) => {
|
|
1573
|
+
// Once per run: after the build's writes when the command asks
|
|
1574
|
+
// (its result then says what the copy write did), else at release.
|
|
1575
|
+
if (copied) return false;
|
|
1576
|
+
copied = true;
|
|
1406
1577
|
ran = !refused && (process.exitCode ?? 0) === 0;
|
|
1407
1578
|
if (check || skipped) return false;
|
|
1408
1579
|
// This run built the theme: its module and stylesheet, one unit,
|
|
@@ -1430,25 +1601,33 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
|
|
|
1430
1601
|
// A theme that does not load keeps its copy as it was.
|
|
1431
1602
|
}
|
|
1432
1603
|
}
|
|
1604
|
+
// What the write did, for the result and the text alike: the
|
|
1605
|
+
// files of a first write, or what keeps the copy behind.
|
|
1606
|
+
firstWrite = takeFirstAppCopy(root, slug);
|
|
1607
|
+
keptBack = appCopyStale(root, slug).appCopyStale ?? null;
|
|
1433
1608
|
return false;
|
|
1434
1609
|
},
|
|
1610
|
+
report: () =>
|
|
1611
|
+
firstWrite || keptBack
|
|
1612
|
+
? {
|
|
1613
|
+
...(firstWrite ? {appCopy: {wrote: firstWrite}} : {}),
|
|
1614
|
+
...(keptBack ? {appCopyStale: keptBack} : {}),
|
|
1615
|
+
}
|
|
1616
|
+
: null,
|
|
1435
1617
|
finish: async () => {
|
|
1436
1618
|
// Said only after a build or check that ran: a refused one wrote
|
|
1437
1619
|
// and checked nothing.
|
|
1438
1620
|
if (skipped) {
|
|
1439
1621
|
if (ran) humanWarn(skipped);
|
|
1440
1622
|
} else if (!check) {
|
|
1441
|
-
// The first write of the app copy is named once
|
|
1442
|
-
|
|
1443
|
-
const wrote = takeFirstAppCopy(root, slug);
|
|
1444
|
-
if (wrote)
|
|
1623
|
+
// The first write of the app copy is named once.
|
|
1624
|
+
if (firstWrite)
|
|
1445
1625
|
humanWarn(
|
|
1446
|
-
`wrote ${slug}'s app copy, a local theme \`theme add ${slug}\` takes, written again after every build: ${
|
|
1626
|
+
`wrote ${slug}'s app copy, a local theme \`theme add ${slug}\` takes, written again after every build: ${firstWrite.join(', ')}`,
|
|
1447
1627
|
);
|
|
1448
1628
|
// A copy a file or a link keeps behind, or one that could not be
|
|
1449
1629
|
// written, is said, as set and show say it.
|
|
1450
|
-
|
|
1451
|
-
if (stale) humanWarn(stale);
|
|
1630
|
+
if (keptBack) humanWarn(keptBack);
|
|
1452
1631
|
}
|
|
1453
1632
|
release();
|
|
1454
1633
|
await done;
|
|
@@ -1458,13 +1637,98 @@ export async function editorThemeHold(files, {cwd, check = false, out}) {
|
|
|
1458
1637
|
return releaseAll;
|
|
1459
1638
|
}
|
|
1460
1639
|
|
|
1640
|
+
/**
|
|
1641
|
+
* For `compile` of an editor theme's own source: how the app takes the
|
|
1642
|
+
* theme, in place of importing the build's own outputs. The app takes its
|
|
1643
|
+
* app copy (src/themes/<t>/, written after every build, with the font
|
|
1644
|
+
* stylesheet that loads the theme's fonts), which `theme add` wires in.
|
|
1645
|
+
* Null for any other file.
|
|
1646
|
+
* @param {string} file the path as given
|
|
1647
|
+
* @param {string} cwd
|
|
1648
|
+
* @returns {string | null}
|
|
1649
|
+
*/
|
|
1650
|
+
export function editorInstall(file, cwd) {
|
|
1651
|
+
const root = projectRoot(cwd);
|
|
1652
|
+
const at = editorThemeAt(root, path.resolve(cwd, file));
|
|
1653
|
+
if (!at || path.basename(file) !== `${at.slug}.theme.ts`) return null;
|
|
1654
|
+
return `Install in your app: the editor writes ${at.slug}'s app copy in src/themes/${at.slug}/ after every build (its module, stylesheet and font stylesheet), and the app takes that copy, not themes/${at.slug}/. Wire it in once:
|
|
1655
|
+
|
|
1656
|
+
${runLine(root, `theme add ${at.slug}`)}`;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* For `compile` of an editor theme's own source: how to load a family the
|
|
1661
|
+
* build names, as the editor says it (the app copy imports a family's
|
|
1662
|
+
* installed Fontsource package); null for any other file.
|
|
1663
|
+
* @param {string} file the path as given
|
|
1664
|
+
* @param {string} cwd
|
|
1665
|
+
* @returns {import('../theme/build/build.mjs').FontHelp | null}
|
|
1666
|
+
*/
|
|
1667
|
+
export function editorFontHelp(file, cwd) {
|
|
1668
|
+
const root = projectRoot(cwd);
|
|
1669
|
+
const at = editorThemeAt(root, path.resolve(cwd, file));
|
|
1670
|
+
if (!at || path.basename(file) !== `${at.slug}.theme.ts`) return null;
|
|
1671
|
+
const copy = `src/themes/${at.slug}/${at.slug}.fonts.css`;
|
|
1672
|
+
/** @param {string} family */
|
|
1673
|
+
const notice = family => {
|
|
1674
|
+
const s = fontsourceSuggestion(family);
|
|
1675
|
+
return s
|
|
1676
|
+
? `Font "${family}" is named by this theme but not loaded; ${s.known ? '' : 'if Fontsource publishes it, '}${installLine(root, [s.pkg])} installs its package, which ${copy} then imports`
|
|
1677
|
+
: `Font "${family}" is named by this theme but not loaded, and no font package is named for it: the app must load it, or it falls back`;
|
|
1678
|
+
};
|
|
1679
|
+
return {
|
|
1680
|
+
notice,
|
|
1681
|
+
recipe: families => {
|
|
1682
|
+
const all = families.map(fontsourceSuggestion).filter(s => s !== null);
|
|
1683
|
+
// Packages the editor knows Fontsource publishes go on one install
|
|
1684
|
+
// line; a name it cannot vouch for gets its own, so one that does
|
|
1685
|
+
// not exist never stops the others installing.
|
|
1686
|
+
const known = all.filter(s => s.known).map(s => s.pkg);
|
|
1687
|
+
const guessed = all.filter(s => !s.known).map(s => s.pkg);
|
|
1688
|
+
const lines = [
|
|
1689
|
+
...(known.length ? [installLine(root, known)] : []),
|
|
1690
|
+
...guessed.map(
|
|
1691
|
+
pkg => `${installLine(root, [pkg])} (if Fontsource publishes it)`,
|
|
1692
|
+
),
|
|
1693
|
+
];
|
|
1694
|
+
return ` The built CSS only sets font-family. ${at.slug}'s app copy loads a family
|
|
1695
|
+
once its package is installed, importing it in ${copy} on the next
|
|
1696
|
+
compile, set or show:
|
|
1697
|
+
${lines.length ? `\n${lines.map(l => ` ${l}`).join('\n')}\n` : '\n (no Fontsource package is named for these families: load them in your app)\n'}
|
|
1698
|
+
Recipe and fallback-stack guidance: ${runLine(root, 'docs typography')}
|
|
1699
|
+
`;
|
|
1700
|
+
},
|
|
1701
|
+
};
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* For `compile`: the path an editor theme's own file builds under when it
|
|
1706
|
+
* was named through a link (its real path, which every output's header
|
|
1707
|
+
* names and `--check` compares); null for any other file.
|
|
1708
|
+
* @param {string} file the path as given
|
|
1709
|
+
* @param {string} cwd
|
|
1710
|
+
* @returns {string | null}
|
|
1711
|
+
*/
|
|
1712
|
+
export function editorSourcePath(file, cwd) {
|
|
1713
|
+
const abs = path.resolve(cwd, slashed(file));
|
|
1714
|
+
const realCwd = realLocation(cwd);
|
|
1715
|
+
const real = realLocation(abs);
|
|
1716
|
+
if (real === path.join(realCwd, path.relative(cwd, abs))) return null;
|
|
1717
|
+
const at = editorThemeAt(projectRoot(cwd), real);
|
|
1718
|
+
if (!at || !editorOwnFile(at.slug, real)) return null;
|
|
1719
|
+
return path.relative(realCwd, real) || null;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1461
1722
|
/** @param {string} p a path as typed, with Windows separators read as `/` */
|
|
1462
1723
|
const slashed = p => String(p).replace(/\\/g, '/');
|
|
1463
1724
|
|
|
1464
1725
|
/**
|
|
1465
|
-
* Whether --out names an editor theme's default output
|
|
1466
|
-
* its
|
|
1467
|
-
*
|
|
1726
|
+
* Whether --out names an editor theme's default output, where the build
|
|
1727
|
+
* writes without --out: its folder, or its stylesheet file there (the same
|
|
1728
|
+
* file, as the file system tells files apart: a name that differs only in
|
|
1729
|
+
* case is another file on a case-sensitive disk). A folder form (a
|
|
1730
|
+
* trailing slash) names a folder, so it is the default only as the theme's
|
|
1731
|
+
* folder. No --out counts.
|
|
1468
1732
|
* @param {string} root the app root
|
|
1469
1733
|
* @param {string} slug
|
|
1470
1734
|
* @param {string} cwd
|
|
@@ -1472,12 +1736,27 @@ const slashed = p => String(p).replace(/\\/g, '/');
|
|
|
1472
1736
|
*/
|
|
1473
1737
|
function outIsDefault(root, slug, cwd, out) {
|
|
1474
1738
|
if (!out) return true;
|
|
1475
|
-
const
|
|
1476
|
-
const
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1739
|
+
const typed = slashed(out);
|
|
1740
|
+
const at = path.resolve(cwd, typed);
|
|
1741
|
+
const f = themeFiles(root, slug);
|
|
1742
|
+
if (sameFile(at, f.dir)) return true;
|
|
1743
|
+
return !typed.endsWith('/') && sameFile(at, f.css);
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
/**
|
|
1747
|
+
* Whether two paths name one file: the same file on disk when both are
|
|
1748
|
+
* there, else the same real path.
|
|
1749
|
+
* @param {string} a
|
|
1750
|
+
* @param {string} b
|
|
1751
|
+
*/
|
|
1752
|
+
function sameFile(a, b) {
|
|
1753
|
+
try {
|
|
1754
|
+
const x = fs.statSync(a);
|
|
1755
|
+
const y = fs.statSync(b);
|
|
1756
|
+
return x.dev === y.dev && x.ino === y.ino;
|
|
1757
|
+
} catch {
|
|
1758
|
+
return realLocation(a) === realLocation(b);
|
|
1759
|
+
}
|
|
1481
1760
|
}
|
|
1482
1761
|
|
|
1483
1762
|
/**
|
|
@@ -1501,6 +1780,9 @@ function outSkipsCopy(root, slug, cwd, {check, out}) {
|
|
|
1501
1780
|
* @param {string} file
|
|
1502
1781
|
*/
|
|
1503
1782
|
function isCopyFile(file) {
|
|
1783
|
+
// A pipe or a device there is never opened: it stands where the copy's
|
|
1784
|
+
// file goes.
|
|
1785
|
+
if (irregularFileKind(file)) return true;
|
|
1504
1786
|
try {
|
|
1505
1787
|
const head = fs.readFileSync(file, 'utf8').slice(0, 600);
|
|
1506
1788
|
return (
|
|
@@ -1536,7 +1818,7 @@ function appCopyTheme(root, file) {
|
|
|
1536
1818
|
* copy.
|
|
1537
1819
|
* @param {string} file the path as given
|
|
1538
1820
|
* @param {string} cwd
|
|
1539
|
-
* @param {{check: boolean, upToDate?: boolean, out?: string}} opts
|
|
1821
|
+
* @param {{check: boolean, upToDate?: boolean, out?: string, iconsSpecifier?: string}} opts
|
|
1540
1822
|
* `upToDate`: the check's own verdict on the theme's outputs
|
|
1541
1823
|
* @returns {Promise<Record<string, unknown> | null>}
|
|
1542
1824
|
*/
|
|
@@ -1552,6 +1834,36 @@ export async function editorBuildExtra(file, cwd, opts) {
|
|
|
1552
1834
|
const skipped = outSkipsCopy(root, slug, cwd, opts);
|
|
1553
1835
|
if (skipped) return {appCopySkipped: skipped};
|
|
1554
1836
|
}
|
|
1837
|
+
if (!opts.check) {
|
|
1838
|
+
// Every set and show builds the theme again from its source, without
|
|
1839
|
+
// --icons-specifier: said, with the change that keeps it.
|
|
1840
|
+
const warnings = opts.iconsSpecifier
|
|
1841
|
+
? [
|
|
1842
|
+
`${slug} is a theme the editor made: every set and show builds it again from themes/${slug}/${slug}.theme.ts without --icons-specifier, which puts the theme's own import of the registry back. To keep this one, import the registry from its package in ${slug}.theme.ts.`,
|
|
1843
|
+
]
|
|
1844
|
+
: [];
|
|
1845
|
+
// What show says of the source's own type on phones, said by the
|
|
1846
|
+
// compile that builds the app copy from it too.
|
|
1847
|
+
/** @type {string[]} */
|
|
1848
|
+
let notices;
|
|
1849
|
+
try {
|
|
1850
|
+
const data = loadTheme(root, slug);
|
|
1851
|
+
notices = [
|
|
1852
|
+
...edit.ownPhoneNotes(root, slug, data),
|
|
1853
|
+
// A weight the base theme's font stylesheet does not load.
|
|
1854
|
+
...baseWeightNotes(await context(root), data),
|
|
1855
|
+
// A font role built as one family with no fallback.
|
|
1856
|
+
...loneFamilyNotes(await context(root), data),
|
|
1857
|
+
];
|
|
1858
|
+
} catch {
|
|
1859
|
+
notices = [];
|
|
1860
|
+
}
|
|
1861
|
+
if (warnings.length || notices.length)
|
|
1862
|
+
return {
|
|
1863
|
+
...(warnings.length ? {warnings} : {}),
|
|
1864
|
+
...(notices.length ? {notices} : {}),
|
|
1865
|
+
};
|
|
1866
|
+
}
|
|
1555
1867
|
if (opts.check) {
|
|
1556
1868
|
// A theme output that is stale is the check's own finding (it names
|
|
1557
1869
|
// the file); the copy is compared only with a current build.
|
|
@@ -1576,8 +1888,8 @@ export async function editorBuildExtra(file, cwd, opts) {
|
|
|
1576
1888
|
}
|
|
1577
1889
|
: null;
|
|
1578
1890
|
}
|
|
1579
|
-
|
|
1580
|
-
return
|
|
1891
|
+
// A build's copy write is reported once it has run (editorAfterBuild).
|
|
1892
|
+
return null;
|
|
1581
1893
|
}
|
|
1582
1894
|
|
|
1583
1895
|
/**
|
|
@@ -1635,15 +1947,10 @@ export async function editorLoadedFonts(file, cwd) {
|
|
|
1635
1947
|
for (const f of importedFontFamilies(spec, from)) loaded.add(f);
|
|
1636
1948
|
// A family the build names whose @fontsource package is installed: the
|
|
1637
1949
|
// copy written after this build imports that package (copyFontsCss).
|
|
1638
|
-
const req = createRequire(path.join(root, 'package.json'));
|
|
1639
1950
|
/** @param {string} family */
|
|
1640
1951
|
const installed = family => {
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
return true;
|
|
1644
|
-
} catch {
|
|
1645
|
-
return false;
|
|
1646
|
-
}
|
|
1952
|
+
const pkg = fontsourcePackageOf(family);
|
|
1953
|
+
return pkg !== null && packageInstalled(root, pkg);
|
|
1647
1954
|
};
|
|
1648
1955
|
return family => loaded.has(fontKey(family)) || installed(family);
|
|
1649
1956
|
}
|