@astryxdesign/cli 0.7.17-canary.g4ea41ce → 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 +7 -2
- package/api/build/_adapter.d.mts +7 -6
- package/api/build/_adapter.mjs +18 -11
- package/api/build/build.type.mjs +1 -1
- package/api/build/kit/kind.d.mts +6 -0
- package/api/build/kit/kind.mjs +1 -1
- package/api/build/kit/rank.d.mts +7 -1
- package/api/build/kit/rank.mjs +15 -5
- package/api/build/kit/signals.mjs +58 -57
- package/api/build/kit/start.d.mts +2 -1
- package/api/build/kit/start.mjs +62 -9
- package/api/build/kit/words.d.mts +6 -2
- package/api/build/kit/words.mjs +7 -3
- package/api/component/__fixtures__/resolutions/modules.txt +2 -2
- package/api/component/_adapter.d.mts +30 -24
- package/api/component/_adapter.mjs +72 -31
- package/api/component/component.mjs +4 -4
- 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.mjs +15 -15
- package/api/docs/_adapter.d.mts +13 -5
- package/api/docs/_adapter.mjs +37 -10
- package/api/doctor/_adapter.d.mts +32 -0
- package/api/doctor/_adapter.mjs +56 -1
- package/api/doctor/doctor.mjs +28 -5
- package/api/doctor/theme-checks.mjs +165 -83
- package/api/error.d.mts +4 -3
- package/api/error.mjs +3 -2
- package/api/hook/_adapter.d.mts +5 -4
- package/api/hook/_adapter.mjs +6 -5
- 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/search/_adapter.d.mts +8 -5
- package/api/search/_adapter.mjs +14 -10
- 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/_lexical.mjs +12 -2
- package/api/search/_priority.d.mts +10 -2
- package/api/search/_priority.mjs +37 -7
- 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.mjs +37 -4
- package/api/swizzle/_adapter.d.mts +7 -5
- package/api/swizzle/_adapter.mjs +7 -3
- package/api/swizzle/copy/copy.mjs +5 -4
- package/api/theme/build/build.d.mts +5 -0
- package/api/theme/build/build.mjs +400 -21
- package/api/theme/build/family.mjs +18 -7
- package/api/theme/build/font-warning.mjs +5 -4
- package/api/theme/build/input-fields.d.mts +21 -6
- package/api/theme/build/input-fields.mjs +104 -13
- package/api/theme/build/typography-values.d.mts +22 -0
- package/api/theme/build/typography-values.mjs +172 -22
- package/api/theme/build/written-values.d.mts +7 -0
- package/api/theme/build/written-values.mjs +57 -8
- package/api/theme/generateTonalPalette.doc.mjs +1 -1
- package/api/theme/palette/generate/generator.d.mts +14 -2
- package/api/theme/palette/generate/generator.mjs +94 -8
- package/api/theme/theme.type.d.mts +21 -4
- package/api/theme/theme.type.mjs +14 -5
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme/themeTemplate.doc.mjs +18 -3
- package/api/theme-edit/_adapter.d.mts +1 -1
- package/api/theme-edit/_adapter.mjs +1 -1
- package/api/theme-edit/_catalog.d.mts +10 -4
- package/api/theme-edit/_catalog.mjs +81 -22
- package/api/theme-edit/_check.mjs +402 -88
- package/api/theme-edit/_color.d.mts +11 -2
- package/api/theme-edit/_color.mjs +23 -7
- package/api/theme-edit/_compiler.mjs +11 -3
- package/api/theme-edit/_context.d.mts +87 -6
- package/api/theme-edit/_context.mjs +224 -17
- package/api/theme-edit/_css.mjs +4 -0
- package/api/theme-edit/_edit.mjs +331 -58
- package/api/theme-edit/_how-question.d.mts +11 -0
- package/api/theme-edit/_how-question.mjs +2514 -234
- package/api/theme-edit/_how.mjs +79 -14
- package/api/theme-edit/_missed.mjs +294 -32
- package/api/theme-edit/_normal.d.mts +3 -1
- package/api/theme-edit/_normal.mjs +4 -1
- package/api/theme-edit/_palette.mjs +36 -5
- package/api/theme-edit/_part-words.mjs +20 -2
- package/api/theme-edit/_parts.d.mts +12 -1
- package/api/theme-edit/_parts.mjs +116 -11
- package/api/theme-edit/_preview-app.mjs +40 -2
- package/api/theme-edit/_preview.d.mts +45 -5
- package/api/theme-edit/_preview.mjs +173 -21
- package/api/theme-edit/_settings.d.mts +20 -0
- package/api/theme-edit/_settings.mjs +1033 -94
- package/api/theme-edit/_tables.mjs +2 -2
- package/api/theme-edit/theme-edit.type.d.mts +6 -5
- package/api/theme-edit/theme-edit.type.mjs +8 -8
- package/api/upgrade/_adapter.mjs +13 -2
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/tree/authoring.doc.mjs +1 -0
- package/assets/docs/tree/cli.doc.mjs +1 -0
- package/assets/docs/tree/computer-agent-guide.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/single-component.doc.mjs +40 -2
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/who-answers.doc.mjs +2 -2
- package/assets/docs-routes.generated.json +1 -1
- 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/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/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-cohort-funnel/page.tsx +31 -20
- package/assets/templates/pages/dashboard-comparison/page.tsx +9 -0
- package/assets/templates/pages/dashboard-composition/page.tsx +22 -9
- package/assets/templates/pages/dashboard-progress/page.tsx +27 -15
- package/assets/templates/pages/dashboard-scorecard/page.tsx +9 -0
- package/assets/templates/pages/detail-page/page.tsx +105 -77
- 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 +76 -12
- package/assets/templates/pages/editor/page.tsx +26 -21
- package/assets/templates/pages/file-explorer/page.tsx +35 -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 +32 -3
- package/assets/templates/pages/gallery-hero/page.tsx +2 -1
- package/assets/templates/pages/ide/page.tsx +15 -1
- package/assets/templates/pages/incident-console/page.tsx +2 -1
- package/assets/templates/pages/incident-console/template.doc.mjs +1 -1
- package/assets/templates/pages/kanban-board/page.tsx +39 -2
- package/assets/templates/pages/payment-form/page.tsx +77 -39
- 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 +34 -5
- 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 +16 -1
- 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 +2 -1
- package/assets/templates/pages/table/template.doc.mjs +1 -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 +9 -2
- package/assets/templates/pages/table-grouped/page.tsx +16 -6
- package/assets/templates/pages/table-inbox/page.tsx +60 -1
- package/assets/templates/pages/table-page/page.tsx +10 -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 +88 -74
- 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/authoring/debug/parse.d.mts +1 -1
- package/authoring/doctypes/_schema.d.mts +22 -8
- 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/type.ts +0 -7
- package/authoring/index.d.ts +6 -1
- package/authoring/integration/integration.doc.mjs +7 -0
- package/authoring/integration/schema.d.mts +6 -0
- package/authoring/integration/schema.mjs +3 -0
- package/authoring/integration/type.ts +34 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/component.doc.mjs +1 -0
- package/clients/cli/commands/component.mjs +5 -1
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/experimental/index.mjs +4 -1
- package/clients/cli/commands/experimental/theme.mjs +139 -64
- package/clients/cli/commands/experimental-render.doc.mjs +2 -0
- package/clients/cli/commands/experimental-theme-add.doc.mjs +2 -0
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -0
- 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 +3 -2
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +3 -2
- 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 +1 -0
- package/clients/cli/commands/experimental-theme-remove.doc.mjs +2 -0
- 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/integration-add.doc.mjs +1 -0
- package/clients/cli/commands/manifest.mjs +10 -3
- package/clients/cli/commands/swizzle.doc.mjs +8 -1
- package/clients/cli/commands/swizzle.mjs +13 -6
- package/clients/cli/commands/template.doc.mjs +3 -0
- package/clients/cli/commands/theme-add.doc.mjs +2 -1
- package/clients/cli/commands/theme-build.doc.mjs +2 -1
- package/clients/cli/commands/theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
- package/clients/cli/commands/theme-remove.doc.mjs +2 -1
- 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 +21 -5
- package/clients/cli/index.mjs +167 -59
- package/clients/cli/lib/base-gate.mjs +522 -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 +34 -31
- package/clients/cli/lib/manifest.d.ts +14 -0
- package/clients/cli/lib/manifest.mjs +78 -22
- package/clients/cli/lib/root-args.mjs +79 -0
- package/clients/cli/lib/stray-option.mjs +21 -8
- package/clients/cli/lib/unknown-command.mjs +27 -6
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +13 -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 +14 -0
- package/foundation/config/project.mjs +68 -1
- package/foundation/discovery/cli-self-docs.mjs +9 -1
- 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 +9 -4
- package/foundation/discovery/docs-discovery.d.mts +13 -5
- package/foundation/discovery/docs-discovery.mjs +25 -6
- package/foundation/discovery/hook-discovery.d.mts +6 -6
- package/foundation/discovery/hook-discovery.mjs +6 -4
- package/foundation/discovery/template-adapter.mjs +5 -0
- package/foundation/discovery/template-ids.d.mts +1 -1
- package/foundation/discovery/template-ids.mjs +5 -1
- package/foundation/discovery/theme-discovery.mjs +3 -0
- package/foundation/discovery/theme-imports.mjs +19 -1
- package/foundation/doc-compiler/tree.d.mts +4 -2
- package/foundation/doc-compiler/tree.mjs +46 -1
- package/foundation/env/package-manager.d.mts +7 -0
- package/foundation/env/package-manager.mjs +21 -0
- package/foundation/fonts/font-stylesheet.d.mts +8 -0
- package/foundation/fonts/font-stylesheet.mjs +26 -2
- package/foundation/fs/gather-cache.mjs +44 -13
- package/foundation/fs/own-modules.d.mts +29 -0
- package/foundation/fs/own-modules.mjs +57 -0
- package/foundation/fs/paths.d.mts +30 -2
- package/foundation/fs/paths.mjs +49 -2
- package/foundation/integrations/integrations.d.mts +4 -0
- package/foundation/integrations/integrations.mjs +6 -1
- package/foundation/release/choose.d.mts +7 -0
- package/foundation/release/choose.mjs +16 -2
- package/foundation/release/notices.d.mts +26 -0
- package/foundation/release/notices.mjs +48 -19
- package/foundation/release/project.d.mts +3 -2
- package/foundation/release/project.mjs +4 -5
- package/foundation/release/run-context.d.mts +7 -2
- package/foundation/release/run-context.mjs +6 -2
- package/foundation/render/css-cut.mjs +86 -6
- package/foundation/render/cut-short.d.mts +35 -0
- package/foundation/render/cut-short.mjs +124 -0
- package/foundation/render/font-probe.d.mts +27 -0
- package/foundation/render/font-probe.mjs +77 -0
- package/foundation/render/layers.d.mts +1 -9
- package/foundation/render/layers.mjs +2 -111
- package/foundation/render/page-worker.mjs +83 -6
- package/foundation/render/picture-chrome.mjs +24 -2
- package/foundation/render/picture-playwright.mjs +22 -2
- package/foundation/render/picture-window.d.mts +20 -4
- package/foundation/render/picture-window.mjs +137 -4
- 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 +2 -2
- package/foundation/suggest/name-index.d.mts +2 -1
- package/foundation/suggest/name-index.mjs +1 -1
- package/foundation/suggest/other-command.d.mts +4 -1
- package/foundation/suggest/other-command.mjs +23 -6
- package/foundation/text/string-utils.d.mts +7 -2
- package/foundation/text/string-utils.mjs +24 -10
- package/package.json +6 -6
- package/assets/templates/pages/access-denied/page.tsx +0 -101
- package/assets/templates/pages/access-denied/template.doc.mjs +0 -24
- package/assets/templates/pages/error-page/page.tsx +0 -130
- package/assets/templates/pages/error-page/template.doc.mjs +0 -22
- package/assets/templates/pages/not-found/page.tsx +0 -124
- package/assets/templates/pages/not-found/template.doc.mjs +0 -30
- package/assets/templates/pages/review-workspace/page.tsx +0 -551
- package/assets/templates/pages/review-workspace/template.doc.mjs +0 -31
- package/assets/templates/pages/run-console/page.tsx +0 -945
- package/assets/templates/pages/run-console/template.doc.mjs +0 -27
- package/assets/templates/pages/welcome-portal/page.tsx +0 -538
- package/assets/templates/pages/welcome-portal/template.doc.mjs +0 -38
package/api/doctor/_adapter.mjs
CHANGED
|
@@ -10,9 +10,11 @@ import {
|
|
|
10
10
|
stateLockHolder,
|
|
11
11
|
} from '../../foundation/release/global-state.mjs';
|
|
12
12
|
import {
|
|
13
|
+
addVerbFor,
|
|
13
14
|
alignCliAndCore,
|
|
14
15
|
cliInstallAdvice,
|
|
15
16
|
installFolder,
|
|
17
|
+
listedPackageInstall,
|
|
16
18
|
projectAddCommand,
|
|
17
19
|
globalBehind,
|
|
18
20
|
globalUpgradeCommand,
|
|
@@ -51,7 +53,7 @@ import {
|
|
|
51
53
|
rendersElement,
|
|
52
54
|
} from '../../foundation/discovery/module-exports.mjs';
|
|
53
55
|
import {cssImports} from '../../foundation/render/embedded-imports.mjs';
|
|
54
|
-
import {satisfiesRange} from '../../foundation/env/semver.mjs';
|
|
56
|
+
import {isValidSemver, satisfiesRange} from '../../foundation/env/semver.mjs';
|
|
55
57
|
import * as path from 'node:path';
|
|
56
58
|
import {
|
|
57
59
|
persistedGather,
|
|
@@ -93,6 +95,7 @@ export {
|
|
|
93
95
|
validateThemePrivateInputs,
|
|
94
96
|
} from '../theme/build/build.mjs';
|
|
95
97
|
export {installCommandFor as packageInstallCommand} from '../../foundation/discovery/template-needs.mjs';
|
|
98
|
+
export {fontServiceFamilies} from '../../foundation/fonts/font-stylesheet.mjs';
|
|
96
99
|
export {resolveRecordedTheme} from '../theme/theme.mjs';
|
|
97
100
|
export {themeIdentifier} from '../theme/_fork.mjs';
|
|
98
101
|
export {collectUnloadedFonts} from '../theme/build/font-warning.mjs';
|
|
@@ -721,6 +724,31 @@ export function installCommandFor(cwd) {
|
|
|
721
724
|
return projectAddCommand(cwd);
|
|
722
725
|
}
|
|
723
726
|
|
|
727
|
+
/**
|
|
728
|
+
* The command that installs the project's dependencies, when the project
|
|
729
|
+
* `cwd` belongs to lists `name`, so a `name` that is not installed comes from
|
|
730
|
+
* installing them; null otherwise (see `listedPackageInstall`).
|
|
731
|
+
* @param {string} cwd
|
|
732
|
+
* @param {string} name
|
|
733
|
+
* @returns {string | null}
|
|
734
|
+
*/
|
|
735
|
+
export function dependencyInstallFor(cwd, name) {
|
|
736
|
+
return listedPackageInstall(cwd, name);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* The command that installs the Core a theme's peer range accepts, with the
|
|
741
|
+
* project's package manager; one version is saved exactly in a project that
|
|
742
|
+
* pins its Core (see `addVerbFor`), and a range is quoted for the shell.
|
|
743
|
+
* @param {string} projectDir
|
|
744
|
+
* @param {string} range
|
|
745
|
+
* @returns {string}
|
|
746
|
+
*/
|
|
747
|
+
export function coreAddCommand(projectDir, range) {
|
|
748
|
+
const spec = `@astryxdesign/core@${range}`;
|
|
749
|
+
return `${addVerbFor(projectDir, range)} ${isValidSemver(range) ? spec : `'${spec}'`}`;
|
|
750
|
+
}
|
|
751
|
+
|
|
724
752
|
/**
|
|
725
753
|
* Whether `cwd` is inside a project whose package.json is not the project's,
|
|
726
754
|
* so advice points at the project's folder (see `installFolder`).
|
|
@@ -928,3 +956,30 @@ export function builtIntegrationPackages(target, cwd) {
|
|
|
928
956
|
if (path.dirname(at) === at) return [];
|
|
929
957
|
}
|
|
930
958
|
}
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* The install line for the font families a known package loads (an open
|
|
962
|
+
* font the editor's table names), in the project's package manager, and
|
|
963
|
+
* whether it loads every family given. A family no known package loads (a
|
|
964
|
+
* self-hosted face) gets none: its package name would be a guess.
|
|
965
|
+
* @param {string} projectDir
|
|
966
|
+
* @param {string[]} families
|
|
967
|
+
* @returns {Promise<{line: string | null, coversAll: boolean}>}
|
|
968
|
+
*/
|
|
969
|
+
export async function fontPackagesInstallLine(projectDir, families) {
|
|
970
|
+
const {fontsourceSuggestion} = await import('../theme-edit/_settings.mjs');
|
|
971
|
+
const {installLine} = await import('../theme-edit/_project.mjs');
|
|
972
|
+
const known = families.map(family => {
|
|
973
|
+
const s = fontsourceSuggestion(family);
|
|
974
|
+
return s?.known ? s.pkg : null;
|
|
975
|
+
});
|
|
976
|
+
const packages = [
|
|
977
|
+
...new Set(
|
|
978
|
+
known.filter(/** @returns {pkg is string} */ pkg => Boolean(pkg)),
|
|
979
|
+
),
|
|
980
|
+
];
|
|
981
|
+
return {
|
|
982
|
+
line: packages.length ? installLine(projectDir, packages) : null,
|
|
983
|
+
coversAll: known.every(Boolean),
|
|
984
|
+
};
|
|
985
|
+
}
|
package/api/doctor/doctor.mjs
CHANGED
|
@@ -105,6 +105,7 @@ import {
|
|
|
105
105
|
THEME_WIRING_CODEC,
|
|
106
106
|
alignCommand,
|
|
107
107
|
addCliCommandFor,
|
|
108
|
+
dependencyInstallFor,
|
|
108
109
|
computerAgentTextState,
|
|
109
110
|
installCommandFor,
|
|
110
111
|
insideProjectElsewhere,
|
|
@@ -127,6 +128,11 @@ import {
|
|
|
127
128
|
builtTargetOf,
|
|
128
129
|
} from './_adapter.mjs';
|
|
129
130
|
import {checkBuilt} from './built-checks.mjs';
|
|
131
|
+
import {coreOnlyDocNames} from '../../foundation/bases/core-docs.mjs';
|
|
132
|
+
import {
|
|
133
|
+
CLI_PROVIDER_ID,
|
|
134
|
+
CORE_PROVIDER_ID,
|
|
135
|
+
} from '../../foundation/identity/providers.mjs';
|
|
130
136
|
|
|
131
137
|
/**
|
|
132
138
|
* @typedef {'pass'|'warn'|'fail'|'info'} DoctorStatus
|
|
@@ -327,6 +333,12 @@ export function checkNodeVersion(ctx) {
|
|
|
327
333
|
export function checkCoreInstalled(ctx) {
|
|
328
334
|
const found = Boolean(ctx.coreDir);
|
|
329
335
|
const version = pkgVersion(ctx.coreDir);
|
|
336
|
+
// A project that lists Core but has not installed its dependencies, as a
|
|
337
|
+
// fresh clone, gets Core by installing them: adding Core would install
|
|
338
|
+
// another release and replace the version the project lists.
|
|
339
|
+
const install = found
|
|
340
|
+
? null
|
|
341
|
+
: dependencyInstallFor(ctx.cwd, '@astryxdesign/core');
|
|
330
342
|
return {
|
|
331
343
|
id: 'core-installed',
|
|
332
344
|
label: '@astryxdesign/core installed',
|
|
@@ -337,7 +349,9 @@ export function checkCoreInstalled(ctx) {
|
|
|
337
349
|
...(found
|
|
338
350
|
? {}
|
|
339
351
|
: {
|
|
340
|
-
fix:
|
|
352
|
+
fix: install
|
|
353
|
+
? `Install the project's dependencies: \`${install}\`.`
|
|
354
|
+
: 'Install the design system: `npm install @astryxdesign/core` (or yarn/pnpm/bun).',
|
|
341
355
|
}),
|
|
342
356
|
};
|
|
343
357
|
}
|
|
@@ -1639,6 +1653,10 @@ export async function checkCliDocs(_ctx, options = {}) {
|
|
|
1639
1653
|
}
|
|
1640
1654
|
}
|
|
1641
1655
|
|
|
1656
|
+
/** The providers whose docs a run on another base leaves out. */
|
|
1657
|
+
/** @type {Set<string>} */
|
|
1658
|
+
const CORE_DOC_PROVIDERS = new Set([CORE_PROVIDER_ID, CLI_PROVIDER_ID]);
|
|
1659
|
+
|
|
1642
1660
|
/**
|
|
1643
1661
|
* The docs tree builds with no error, and every CLI typed doc in a `cli/...`
|
|
1644
1662
|
* group has a route in it (spec:AST-046): each placement names a namespace of
|
|
@@ -1678,15 +1696,20 @@ export async function checkDocsTree(_ctx, options = {}) {
|
|
|
1678
1696
|
}
|
|
1679
1697
|
// Every link between docs names a doc that exists (spec:AST-047 FR9):
|
|
1680
1698
|
// typed fields, reference and workflow blocks, and inline links. A
|
|
1681
|
-
// reference block also includes all it names.
|
|
1699
|
+
// reference block also includes all it names. A run whose base is not
|
|
1700
|
+
// Core leaves Core's docs out; a link to one of them is not a problem.
|
|
1682
1701
|
for (const node of tree.nodes.values()) {
|
|
1683
1702
|
for (const edge of typedEdges(tree, node).unresolved) {
|
|
1684
1703
|
problems.push(`${node.route}: ${edge}`);
|
|
1685
1704
|
}
|
|
1686
1705
|
}
|
|
1687
|
-
|
|
1706
|
+
const coreDocs = await coreOnlyDocNames();
|
|
1707
|
+
/** @param {{provider: string, name: string}} target */
|
|
1708
|
+
const absent = target =>
|
|
1709
|
+
CORE_DOC_PROVIDERS.has(target.provider) && coreDocs.has(target.name);
|
|
1710
|
+
problems.push(...(await docsLinkProblems(catalog, tree, {absent})));
|
|
1688
1711
|
problems.push(
|
|
1689
|
-
...(await docsLinkProblems(catalog, tree, {references: true})),
|
|
1712
|
+
...(await docsLinkProblems(catalog, tree, {references: true, absent})),
|
|
1690
1713
|
);
|
|
1691
1714
|
}
|
|
1692
1715
|
// New findings warn: a project that passed before keeps passing
|
|
@@ -2343,7 +2366,7 @@ export function checkGatherCache() {
|
|
|
2343
2366
|
id: 'gather-cache',
|
|
2344
2367
|
label: 'Kept catalog cache',
|
|
2345
2368
|
status: 'info',
|
|
2346
|
-
message: `search, build, component, template, theme, discover, docs and doctor keep what they gather (search's catalogs, each integration's check results, template discovery's records, the component list, integrations' theme records, what theme build checks a theme against in Core's component docs, the JavaScript theme build compiles from a theme's local TypeScript or JSX modules, what theme build finds when it checks a theme's pseudo-class keys and token names, the lookup commands' not-found hint's name summaries, npm's list of the files an integration package packs, the CLI's own docs tree, and doctor's docs checks and theme-wiring scan) in ${summary.dir} (${summary.entries} ${summary.entries === 1 ? 'entry' : 'entries'}, ${size})${summary.pnp ? ", but not in a run under Yarn Plug'n'Play's loader, such as `yarn astryx`, which gathers every time" : ''}; each is used only while nothing it read has changed, the installed CLI's own files judged by its build id (an upgrade
|
|
2369
|
+
message: `search, build, component, template, theme, discover, docs and doctor keep what they gather (search's catalogs, each integration's check results, template discovery's records, the component list, integrations' theme records, what theme build checks a theme against in Core's component docs, the JavaScript theme build compiles from a theme's local TypeScript or JSX modules, what theme build finds when it checks a theme's pseudo-class keys and token names, the lookup commands' not-found hint's name summaries, npm's list of the files an integration package packs, the CLI's own docs tree, and doctor's docs checks and theme-wiring scan) in ${summary.dir} (${summary.entries} ${summary.entries === 1 ? 'entry' : 'entries'}, ${size})${summary.pnp ? ", but not in a run under Yarn Plug'n'Play's loader, such as `yarn astryx`, which gathers every time" : ''}; each is used only while nothing it read has changed, the installed CLI's own files judged by its build id and folder (an upgrade, a reinstall or a copy in another folder changes them; in-place edits aren't supported), and deleting the folder clears it. A lookup command's not-found path may also create the folder, for its name index, and so may an integration package's \`integration check\` of itself, for npm's list. On Linux, when a debug handler is set, runs also keep the locale and time zone here. The folder holds at most ${summary.limitBytes / (1024 * 1024)} MB, dropping oldest entries first, as does the transpile cache in ${summary.jitiDir}, which keeps every copy written, or read where the file system records reads, in the last day.`,
|
|
2347
2370
|
};
|
|
2348
2371
|
}
|
|
2349
2372
|
|
|
@@ -12,6 +12,7 @@ import {babelParse as parse} from '../../foundation/runtime/lazy-dependencies.mj
|
|
|
12
12
|
import {postcss} from '../../foundation/runtime/lazy-dependencies.mjs';
|
|
13
13
|
import {
|
|
14
14
|
collectUnloadedFonts,
|
|
15
|
+
fontPackagesInstallLine,
|
|
15
16
|
discoverDoctorThemes,
|
|
16
17
|
themeIdentifier,
|
|
17
18
|
discoverDoctorUnmigratedCopies,
|
|
@@ -21,6 +22,7 @@ import {
|
|
|
21
22
|
doctorRendersElement,
|
|
22
23
|
doctorStylesheetImports,
|
|
23
24
|
findDoctorInstalledPackage,
|
|
25
|
+
fontServiceFamilies,
|
|
24
26
|
realDoctorFile,
|
|
25
27
|
isLocalThemeOwner,
|
|
26
28
|
listDoctorThemePackages,
|
|
@@ -39,6 +41,8 @@ import {
|
|
|
39
41
|
generatedSourceCommand,
|
|
40
42
|
isPrivateVarRefusal,
|
|
41
43
|
missingThemePackage,
|
|
44
|
+
dependencyInstallFor,
|
|
45
|
+
coreAddCommand,
|
|
42
46
|
packageInstallCommand,
|
|
43
47
|
themeBuild,
|
|
44
48
|
themeRecordOwner,
|
|
@@ -115,6 +119,13 @@ function refreshThemeCommand(projectDir, run, available, slug, owner) {
|
|
|
115
119
|
candidate.slug === slug && themeRecordOwner(candidate) === owner,
|
|
116
120
|
);
|
|
117
121
|
if (!isLocalThemeOwner(owner)) {
|
|
122
|
+
// A theme package the project lists but has not installed, as in a fresh
|
|
123
|
+
// clone, comes from installing the project's dependencies, at the version
|
|
124
|
+
// it lists; its theme is added already.
|
|
125
|
+
const install = findDoctorInstalledPackage(projectDir, owner)
|
|
126
|
+
? null
|
|
127
|
+
: dependencyInstallFor(projectDir, owner);
|
|
128
|
+
if (install) return install;
|
|
118
129
|
const selector = theme?.package ?? owner;
|
|
119
130
|
return `npm install ${owner}@latest; ${run} theme add ${slug} --package ${selector}`;
|
|
120
131
|
}
|
|
@@ -456,8 +467,9 @@ function namedThemeFonts(files) {
|
|
|
456
467
|
/**
|
|
457
468
|
* The families a font stylesheet loads with `@font-face`, following its
|
|
458
469
|
* local `@import`s (a relative file, or a package's stylesheet such as
|
|
459
|
-
* `@fontsource/inter/index.css`)
|
|
460
|
-
*
|
|
470
|
+
* `@fontsource/inter/index.css`), and the families the `family` parameters
|
|
471
|
+
* of a font service URL it imports name; `external` when it imports a URL
|
|
472
|
+
* (http, https, `//`), which may load families doctor cannot read.
|
|
461
473
|
* @param {string} css
|
|
462
474
|
* @param {string} [file] the stylesheet's path, to resolve local imports
|
|
463
475
|
* @param {Set<string>} [seen]
|
|
@@ -471,6 +483,11 @@ function fontStylesheetEvidence(css, file, seen = new Set()) {
|
|
|
471
483
|
if (atRule.name.toLowerCase() === 'import') {
|
|
472
484
|
const spec = [...doctorStylesheetImports(`@import ${atRule.params};`)][0];
|
|
473
485
|
if (!spec || /^(?:https?:)?\/\//i.test(spec)) {
|
|
486
|
+
// A family the request names counts as loaded, as an @font-face rule
|
|
487
|
+
// does: the stylesheet asks the service for it.
|
|
488
|
+
for (const family of fontServiceFamilies(spec ?? '')) {
|
|
489
|
+
loaded.add(family);
|
|
490
|
+
}
|
|
474
491
|
external = true;
|
|
475
492
|
return;
|
|
476
493
|
}
|
|
@@ -1405,34 +1422,40 @@ export async function checkAppThemes(cwd) {
|
|
|
1405
1422
|
id: 'theme-owners',
|
|
1406
1423
|
label: 'Theme owners and built imports',
|
|
1407
1424
|
status: 'fail',
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
.map(problem =>
|
|
1427
|
-
refreshThemeCommand(
|
|
1428
|
-
state.projectDir,
|
|
1429
|
-
run,
|
|
1430
|
-
available,
|
|
1431
|
-
problem.slug,
|
|
1432
|
-
problem.owner,
|
|
1425
|
+
// Themes that one step fixes, such as installing the project's
|
|
1426
|
+
// dependencies, say it once.
|
|
1427
|
+
message: [
|
|
1428
|
+
...new Set(
|
|
1429
|
+
resolutionProblems.map(problem =>
|
|
1430
|
+
// A theme another command generates is not rebuilt with `theme
|
|
1431
|
+
// build`: its fix names that command, so its message does not.
|
|
1432
|
+
refreshThemeCommand(
|
|
1433
|
+
state.projectDir,
|
|
1434
|
+
run,
|
|
1435
|
+
available,
|
|
1436
|
+
problem.slug,
|
|
1437
|
+
problem.owner,
|
|
1438
|
+
).includes(' theme build ')
|
|
1439
|
+
? problem.message
|
|
1440
|
+
: problem.message
|
|
1441
|
+
.replace(/\s*Run `[^`]*theme build[^`]*` and try again\./, '')
|
|
1442
|
+
.replace(/\s*Rebuild it with `[^`]*theme build[^`]*`\.?/, ''),
|
|
1433
1443
|
),
|
|
1434
|
-
)
|
|
1435
|
-
|
|
1444
|
+
),
|
|
1445
|
+
].join(' '),
|
|
1446
|
+
fix: [
|
|
1447
|
+
...new Set(
|
|
1448
|
+
resolutionProblems.map(problem =>
|
|
1449
|
+
refreshThemeCommand(
|
|
1450
|
+
state.projectDir,
|
|
1451
|
+
run,
|
|
1452
|
+
available,
|
|
1453
|
+
problem.slug,
|
|
1454
|
+
problem.owner,
|
|
1455
|
+
),
|
|
1456
|
+
),
|
|
1457
|
+
),
|
|
1458
|
+
].join('; '),
|
|
1436
1459
|
});
|
|
1437
1460
|
} else if (unshippedImports.length > 0) {
|
|
1438
1461
|
checks.push({
|
|
@@ -1687,8 +1710,14 @@ export async function checkAppThemes(cwd) {
|
|
|
1687
1710
|
);
|
|
1688
1711
|
}
|
|
1689
1712
|
|
|
1713
|
+
// The inputs load with Core, and doctor reads only the Core the project
|
|
1714
|
+
// installed, never the one the answering copy carries.
|
|
1715
|
+
const privateCoreMissing =
|
|
1716
|
+
!incompleteResolution &&
|
|
1717
|
+
resolved.length > 0 &&
|
|
1718
|
+
!findDoctorCoreDir(state.projectDir);
|
|
1690
1719
|
const privateProblems = [];
|
|
1691
|
-
for (const theme of resolved) {
|
|
1720
|
+
for (const theme of privateCoreMissing ? [] : resolved) {
|
|
1692
1721
|
const availableTheme = available.find(
|
|
1693
1722
|
candidate =>
|
|
1694
1723
|
candidate.slug === theme.slug &&
|
|
@@ -1719,33 +1748,41 @@ export async function checkAppThemes(cwd) {
|
|
|
1719
1748
|
message:
|
|
1720
1749
|
'Could not inspect every theme input until built imports resolve.',
|
|
1721
1750
|
}
|
|
1722
|
-
:
|
|
1751
|
+
: privateCoreMissing
|
|
1723
1752
|
? {
|
|
1724
1753
|
id: 'theme-private-variables',
|
|
1725
1754
|
label: 'Private theme variables',
|
|
1726
|
-
status: '
|
|
1727
|
-
message: `Added theme inputs set private --_* variables directly (${privateProblems
|
|
1728
|
-
.map(problem => `${problem.theme.slug}: ${problem.message}`)
|
|
1729
|
-
.join('; ')}).`,
|
|
1730
|
-
fix: `Remove the direct private input keys, then ${privateProblems
|
|
1731
|
-
.map(problem =>
|
|
1732
|
-
refreshThemeCommand(
|
|
1733
|
-
state.projectDir,
|
|
1734
|
-
run,
|
|
1735
|
-
available,
|
|
1736
|
-
problem.theme.slug,
|
|
1737
|
-
problem.theme.owner,
|
|
1738
|
-
),
|
|
1739
|
-
)
|
|
1740
|
-
.join(' ')}`,
|
|
1741
|
-
}
|
|
1742
|
-
: {
|
|
1743
|
-
id: 'theme-private-variables',
|
|
1744
|
-
label: 'Private theme variables',
|
|
1745
|
-
status: 'pass',
|
|
1755
|
+
status: 'info',
|
|
1746
1756
|
message:
|
|
1747
|
-
'
|
|
1748
|
-
}
|
|
1757
|
+
"The project's Core isn't installed, so theme inputs were not checked for private variables. Install the project's dependencies, then run doctor again.",
|
|
1758
|
+
}
|
|
1759
|
+
: privateProblems.length > 0
|
|
1760
|
+
? {
|
|
1761
|
+
id: 'theme-private-variables',
|
|
1762
|
+
label: 'Private theme variables',
|
|
1763
|
+
status: 'fail',
|
|
1764
|
+
message: `Added theme inputs set private --_* variables directly (${privateProblems
|
|
1765
|
+
.map(problem => `${problem.theme.slug}: ${problem.message}`)
|
|
1766
|
+
.join('; ')}).`,
|
|
1767
|
+
fix: `Remove the direct private input keys, then ${privateProblems
|
|
1768
|
+
.map(problem =>
|
|
1769
|
+
refreshThemeCommand(
|
|
1770
|
+
state.projectDir,
|
|
1771
|
+
run,
|
|
1772
|
+
available,
|
|
1773
|
+
problem.theme.slug,
|
|
1774
|
+
problem.theme.owner,
|
|
1775
|
+
),
|
|
1776
|
+
)
|
|
1777
|
+
.join(' ')}`,
|
|
1778
|
+
}
|
|
1779
|
+
: {
|
|
1780
|
+
id: 'theme-private-variables',
|
|
1781
|
+
label: 'Private theme variables',
|
|
1782
|
+
status: 'pass',
|
|
1783
|
+
message:
|
|
1784
|
+
'No added theme input sets a private --_* variable directly.',
|
|
1785
|
+
},
|
|
1749
1786
|
);
|
|
1750
1787
|
|
|
1751
1788
|
const coreDir = findDoctorCoreDir(state.projectDir);
|
|
@@ -1787,7 +1824,7 @@ export async function checkAppThemes(cwd) {
|
|
|
1787
1824
|
fix: peerProblems
|
|
1788
1825
|
.map(problem =>
|
|
1789
1826
|
problem.range
|
|
1790
|
-
?
|
|
1827
|
+
? `${coreAddCommand(state.projectDir, problem.range)}; ${run} doctor`
|
|
1791
1828
|
: refreshThemeCommand(
|
|
1792
1829
|
state.projectDir,
|
|
1793
1830
|
run,
|
|
@@ -1841,6 +1878,34 @@ export async function checkAppThemes(cwd) {
|
|
|
1841
1878
|
// The generated-module check owns the parse failure. This check stays
|
|
1842
1879
|
// evidence-driven and refuses to pass without readable imports.
|
|
1843
1880
|
}
|
|
1881
|
+
/** @param {(typeof resolved)[number]} theme */
|
|
1882
|
+
const importedEntry = theme =>
|
|
1883
|
+
prepared?.entries.find(entry => entry.slug === theme.slug) ?? theme;
|
|
1884
|
+
// A family that any font stylesheet the module imports loads is loaded for
|
|
1885
|
+
// every added theme: a theme that extends another, such as a local fork of
|
|
1886
|
+
// neutral, names the families its parent's stylesheet loads.
|
|
1887
|
+
const moduleLoaded = new Set();
|
|
1888
|
+
/**
|
|
1889
|
+
* What each imported font stylesheet loads, by its theme; null for one that
|
|
1890
|
+
* cannot be parsed, which the theme's own pass below reports.
|
|
1891
|
+
* @type {Map<(typeof resolved)[number], ReturnType<typeof fontStylesheetEvidence> | null>}
|
|
1892
|
+
*/
|
|
1893
|
+
const importedEvidence = new Map();
|
|
1894
|
+
for (const theme of resolved) {
|
|
1895
|
+
const {fontStylesheet} = importedEntry(theme);
|
|
1896
|
+
if (!theme.fontStylesheetFile || !fontStylesheet) continue;
|
|
1897
|
+
if (!generatedImports?.has(fontStylesheet)) continue;
|
|
1898
|
+
try {
|
|
1899
|
+
const evidence = fontStylesheetEvidence(
|
|
1900
|
+
readTextFile(theme.fontStylesheetFile),
|
|
1901
|
+
theme.fontStylesheetFile,
|
|
1902
|
+
);
|
|
1903
|
+
importedEvidence.set(theme, evidence);
|
|
1904
|
+
for (const family of evidence.loaded) moduleLoaded.add(family);
|
|
1905
|
+
} catch {
|
|
1906
|
+
importedEvidence.set(theme, null);
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1844
1909
|
for (const theme of resolved) {
|
|
1845
1910
|
const availableTheme = available.find(
|
|
1846
1911
|
candidate =>
|
|
@@ -1851,14 +1916,24 @@ export async function checkAppThemes(cwd) {
|
|
|
1851
1916
|
if (availableTheme) {
|
|
1852
1917
|
files.push(path.join(availableTheme.sourceDir, availableTheme.entry));
|
|
1853
1918
|
}
|
|
1854
|
-
const
|
|
1855
|
-
if (
|
|
1856
|
-
|
|
1857
|
-
|
|
1919
|
+
const named = namedThemeFonts(files);
|
|
1920
|
+
if (named.size === 0) continue;
|
|
1921
|
+
if (importedEvidence.get(theme) === null) {
|
|
1922
|
+
fontFailures.push({
|
|
1923
|
+
theme,
|
|
1924
|
+
message: 'font stylesheet could not be parsed',
|
|
1925
|
+
});
|
|
1926
|
+
continue;
|
|
1927
|
+
}
|
|
1928
|
+
const names = [...named].filter(
|
|
1929
|
+
name => !moduleLoaded.has(name.toLowerCase()),
|
|
1930
|
+
);
|
|
1931
|
+
if (names.length === 0) continue;
|
|
1932
|
+
const importedTheme = importedEntry(theme);
|
|
1858
1933
|
if (!theme.fontStylesheetFile || !importedTheme.fontStylesheet) {
|
|
1859
1934
|
const problem = {
|
|
1860
1935
|
theme,
|
|
1861
|
-
message: `${
|
|
1936
|
+
message: `${names.join(', ')} (font stylesheet is not imported)`,
|
|
1862
1937
|
};
|
|
1863
1938
|
missingFontWarnings.push(problem);
|
|
1864
1939
|
continue;
|
|
@@ -1866,31 +1941,22 @@ export async function checkAppThemes(cwd) {
|
|
|
1866
1941
|
if (!generatedImports?.has(importedTheme.fontStylesheet)) {
|
|
1867
1942
|
fontFailures.push({
|
|
1868
1943
|
theme,
|
|
1869
|
-
message: `${
|
|
1944
|
+
message: `${names.join(', ')} (font stylesheet is not imported)`,
|
|
1870
1945
|
});
|
|
1871
1946
|
continue;
|
|
1872
1947
|
}
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
);
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
unreadFontWarnings.push(`${theme.slug}: ${missing.join(', ')}`);
|
|
1886
|
-
} else {
|
|
1887
|
-
fontFailures.push({theme, message: missing.join(', ')});
|
|
1888
|
-
}
|
|
1889
|
-
} catch {
|
|
1890
|
-
fontFailures.push({
|
|
1891
|
-
theme,
|
|
1892
|
-
message: 'font stylesheet could not be parsed',
|
|
1893
|
-
});
|
|
1948
|
+
const evidence = importedEvidence.get(theme);
|
|
1949
|
+
if (!evidence) continue;
|
|
1950
|
+
const missing = names.filter(
|
|
1951
|
+
name => !evidence.loaded.has(name.toLowerCase()),
|
|
1952
|
+
);
|
|
1953
|
+
if (missing.length === 0) continue;
|
|
1954
|
+
if (evidence.external) {
|
|
1955
|
+
externalFontWarnings.push(`${theme.slug}: ${missing.join(', ')}`);
|
|
1956
|
+
} else if (evidence.unread) {
|
|
1957
|
+
unreadFontWarnings.push(`${theme.slug}: ${missing.join(', ')}`);
|
|
1958
|
+
} else {
|
|
1959
|
+
fontFailures.push({theme, message: missing.join(', '), missing});
|
|
1894
1960
|
}
|
|
1895
1961
|
}
|
|
1896
1962
|
const fontWarningMessages = [];
|
|
@@ -1933,6 +1999,16 @@ export async function checkAppThemes(cwd) {
|
|
|
1933
1999
|
'Confirm the font service stylesheet loads each named family.',
|
|
1934
2000
|
);
|
|
1935
2001
|
}
|
|
2002
|
+
// A family with no loader in a stylesheet the app imports loads once
|
|
2003
|
+
// the package that loads it is installed and the theme's stylesheet is
|
|
2004
|
+
// written again, so the fix names that package when a known one loads
|
|
2005
|
+
// it; a self-hosted family keeps the stylesheet step.
|
|
2006
|
+
const fontInstall = fontFailures.some(f => f.missing)
|
|
2007
|
+
? await fontPackagesInstallLine(
|
|
2008
|
+
state.projectDir,
|
|
2009
|
+
fontFailures.flatMap(f => f.missing ?? []),
|
|
2010
|
+
)
|
|
2011
|
+
: {line: null, coversAll: false};
|
|
1936
2012
|
checks.push(
|
|
1937
2013
|
incompleteResolution
|
|
1938
2014
|
? {
|
|
@@ -1950,7 +2026,13 @@ export async function checkAppThemes(cwd) {
|
|
|
1950
2026
|
message: `Named font families have no proven loader (${fontFailures
|
|
1951
2027
|
.map(problem => `${problem.theme.slug}: ${problem.message}`)
|
|
1952
2028
|
.join('; ')}).`,
|
|
1953
|
-
fix:
|
|
2029
|
+
fix: `${
|
|
2030
|
+
fontInstall.line &&
|
|
2031
|
+
fontInstall.coversAll &&
|
|
2032
|
+
fontFailures.every(f => f.missing)
|
|
2033
|
+
? `Install the packages that load them (${fontInstall.line})`
|
|
2034
|
+
: `Add the missing font stylesheet export or local <slug>.fonts.css${fontInstall.line ? ` (${fontInstall.line} installs the packages that load the open fonts among them)` : ''}`
|
|
2035
|
+
}, then ${fontFailures
|
|
1954
2036
|
.map(problem =>
|
|
1955
2037
|
refreshThemeCommand(
|
|
1956
2038
|
state.projectDir,
|
|
@@ -1975,7 +2057,7 @@ export async function checkAppThemes(cwd) {
|
|
|
1975
2057
|
label: 'Theme font loading',
|
|
1976
2058
|
status: 'pass',
|
|
1977
2059
|
message:
|
|
1978
|
-
'Every named non-system font
|
|
2060
|
+
'Every named non-system font is loaded by an @font-face rule or a font service URL that names it.',
|
|
1979
2061
|
},
|
|
1980
2062
|
);
|
|
1981
2063
|
|
package/api/error.d.mts
CHANGED
|
@@ -28,11 +28,12 @@ export function writeFailed(target: string, cwd: string, cause: unknown, unresto
|
|
|
28
28
|
* foundation/fs/paths.mjs), raising its coded failure as an AstryxError:
|
|
29
29
|
* ERR_CORE_NOT_FOUND with no Core to answer from, ERR_VERSIONS_UNAVAILABLE
|
|
30
30
|
* when the carried Core is needed and cannot be installed.
|
|
31
|
-
* @
|
|
31
|
+
* @template {string | null} T
|
|
32
|
+
* @param {(cwd: string) => T} lookup the foundation lookup
|
|
32
33
|
* @param {string} cwd
|
|
33
|
-
* @returns {
|
|
34
|
+
* @returns {T}
|
|
34
35
|
*/
|
|
35
|
-
export function coreDirOrThrow(lookup: (cwd: string) =>
|
|
36
|
+
export function coreDirOrThrow<T extends string | null>(lookup: (cwd: string) => T, cwd: string): T;
|
|
36
37
|
export class AstryxError extends Error {
|
|
37
38
|
/**
|
|
38
39
|
* @param {string} message
|
package/api/error.mjs
CHANGED
|
@@ -84,9 +84,10 @@ export function writeFailed(target, cwd, cause, unrestored = []) {
|
|
|
84
84
|
* foundation/fs/paths.mjs), raising its coded failure as an AstryxError:
|
|
85
85
|
* ERR_CORE_NOT_FOUND with no Core to answer from, ERR_VERSIONS_UNAVAILABLE
|
|
86
86
|
* when the carried Core is needed and cannot be installed.
|
|
87
|
-
* @
|
|
87
|
+
* @template {string | null} T
|
|
88
|
+
* @param {(cwd: string) => T} lookup the foundation lookup
|
|
88
89
|
* @param {string} cwd
|
|
89
|
-
* @returns {
|
|
90
|
+
* @returns {T}
|
|
90
91
|
*/
|
|
91
92
|
export function coreDirOrThrow(lookup, cwd) {
|
|
92
93
|
try {
|
package/api/hook/_adapter.d.mts
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* Locate the @astryxdesign/core package directory, or throw the same
|
|
6
6
|
* ERR_CORE_NOT_FOUND envelope the flat command threw. Shared by every hook leaf.
|
|
7
7
|
* @param {string} cwd
|
|
8
|
-
* @returns {string} Absolute path to the core package directory
|
|
8
|
+
* @returns {string | null} Absolute path to the core package directory; null
|
|
9
|
+
* in a run whose base is not Core, which has no Core hooks.
|
|
9
10
|
*/
|
|
10
|
-
export function resolveCoreDir(cwd: string): string;
|
|
11
|
+
export function resolveCoreDir(cwd: string): string | null;
|
|
11
12
|
/**
|
|
12
13
|
* Resolve a single hook's authored doc by name, or throw ERR_UNKNOWN_HOOK with
|
|
13
14
|
* fuzzy (levenshtein) suggestions. When the name matches a component,
|
|
@@ -17,12 +18,12 @@ export function resolveCoreDir(cwd: string): string;
|
|
|
17
18
|
* (foundation/suggest/other-command.mjs withOtherCommand), the list keeping
|
|
18
19
|
* its length. Shared by the detail and detail.params leaves, which both start
|
|
19
20
|
* from a resolved hook doc.
|
|
20
|
-
* @param {string} coreDir
|
|
21
|
+
* @param {string | null} coreDir
|
|
21
22
|
* @param {string} name
|
|
22
23
|
* @param {{zh?: boolean, lang?: string|null, cwd?: string}} [opts]
|
|
23
24
|
* @returns {Promise<import('./hook.type.mjs').HookDoc>}
|
|
24
25
|
*/
|
|
25
|
-
export function resolveHookDoc(coreDir: string, name: string, { zh, lang, cwd }?: {
|
|
26
|
+
export function resolveHookDoc(coreDir: string | null, name: string, { zh, lang, cwd }?: {
|
|
26
27
|
zh?: boolean;
|
|
27
28
|
lang?: string | null;
|
|
28
29
|
cwd?: string;
|
package/api/hook/_adapter.mjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @position api/hook/_adapter.mjs — shared by ./list, ./detail, ./detail/params
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {coreContentDir} from '../../foundation/fs/paths.mjs';
|
|
18
18
|
import {
|
|
19
19
|
findHookDoc,
|
|
20
20
|
getAllHookNames,
|
|
@@ -31,10 +31,11 @@ export {CORE_PROVIDER_ID as CORE_PACKAGE} from '../../foundation/identity/provid
|
|
|
31
31
|
* Locate the @astryxdesign/core package directory, or throw the same
|
|
32
32
|
* ERR_CORE_NOT_FOUND envelope the flat command threw. Shared by every hook leaf.
|
|
33
33
|
* @param {string} cwd
|
|
34
|
-
* @returns {string} Absolute path to the core package directory
|
|
34
|
+
* @returns {string | null} Absolute path to the core package directory; null
|
|
35
|
+
* in a run whose base is not Core, which has no Core hooks.
|
|
35
36
|
*/
|
|
36
37
|
export function resolveCoreDir(cwd) {
|
|
37
|
-
return coreDirOrThrow(
|
|
38
|
+
return coreDirOrThrow(coreContentDir, cwd);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -46,7 +47,7 @@ export function resolveCoreDir(cwd) {
|
|
|
46
47
|
* (foundation/suggest/other-command.mjs withOtherCommand), the list keeping
|
|
47
48
|
* its length. Shared by the detail and detail.params leaves, which both start
|
|
48
49
|
* from a resolved hook doc.
|
|
49
|
-
* @param {string} coreDir
|
|
50
|
+
* @param {string | null} coreDir
|
|
50
51
|
* @param {string} name
|
|
51
52
|
* @param {{zh?: boolean, lang?: string|null, cwd?: string}} [opts]
|
|
52
53
|
* @returns {Promise<import('./hook.type.mjs').HookDoc>}
|
|
@@ -94,7 +95,7 @@ export async function resolveHookDoc(
|
|
|
94
95
|
* only on this path.
|
|
95
96
|
* @param {string} name
|
|
96
97
|
* @param {import('../../foundation/response/base').Suggestion[]} suggestions
|
|
97
|
-
* @param {{coreDir: string, cwd: string}} context
|
|
98
|
+
* @param {{coreDir: string | null, cwd: string}} context
|
|
98
99
|
* @returns {Promise<import('../../foundation/response/base').Suggestion[] | undefined>}
|
|
99
100
|
*/
|
|
100
101
|
async function withOtherCommandHint(name, suggestions, {coreDir, cwd}) {
|