@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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file How a command doc's pointers to other commands join its summary.
|
|
6
|
+
* @input a CommandDoc's `summary` and `pointers`
|
|
7
|
+
* @output pointerClause() and publishedSummary()
|
|
8
|
+
* @position foundation/discovery — shared by help, which can leave a pointer
|
|
9
|
+
* out, and the docs and search, which read the whole summary
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The clause a pointer adds after a command's summary.
|
|
13
|
+
* @param {string} text
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
export function pointerClause(text: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* A command doc's summary as `astryx docs` and search read it: the summary,
|
|
19
|
+
* then the clause of each pointer.
|
|
20
|
+
* @param {{summary?: string, pointers?: {text: string}[]}} doc
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
export function publishedSummary(doc: {
|
|
24
|
+
summary?: string;
|
|
25
|
+
pointers?: {
|
|
26
|
+
text: string;
|
|
27
|
+
}[];
|
|
28
|
+
}): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file How a command doc's pointers to other commands join its summary.
|
|
5
|
+
* @input a CommandDoc's `summary` and `pointers`
|
|
6
|
+
* @output pointerClause() and publishedSummary()
|
|
7
|
+
* @position foundation/discovery — shared by help, which can leave a pointer
|
|
8
|
+
* out, and the docs and search, which read the whole summary
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The clause a pointer adds after a command's summary.
|
|
13
|
+
* @param {string} text
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
export function pointerClause(text) {
|
|
17
|
+
return ` (${text})`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A command doc's summary as `astryx docs` and search read it: the summary,
|
|
22
|
+
* then the clause of each pointer.
|
|
23
|
+
* @param {{summary?: string, pointers?: {text: string}[]}} doc
|
|
24
|
+
* @returns {string}
|
|
25
|
+
*/
|
|
26
|
+
export function publishedSummary(doc) {
|
|
27
|
+
return (
|
|
28
|
+
(doc.summary ?? '') +
|
|
29
|
+
(doc.pointers ?? []).map(pointer => pointerClause(pointer.text)).join('')
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -29,10 +29,10 @@ export function familyMember(docs: any, name: string): any;
|
|
|
29
29
|
*
|
|
30
30
|
* Keys are sorted alphabetically (groups and ungrouped components interleaved).
|
|
31
31
|
* Components within each group are also sorted alphabetically.
|
|
32
|
-
* @param {string} coreDir
|
|
32
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
33
33
|
* @returns {Record<string, string[]>}
|
|
34
34
|
*/
|
|
35
|
-
export function discoverComponents(coreDir: string): Record<string, string[]>;
|
|
35
|
+
export function discoverComponents(coreDir: string | null): Record<string, string[]>;
|
|
36
36
|
/**
|
|
37
37
|
* The Core component names `keep` accepts, in discovery order. Each name is
|
|
38
38
|
* listed exactly when {@link discoverComponents} lists it, but no doc is read
|
|
@@ -48,11 +48,11 @@ export function discoverComponentNamesWhere(coreDir: string, keep: (name: string
|
|
|
48
48
|
* Find the .doc.mjs file for a component.
|
|
49
49
|
* For sub-components (e.g. StackItem), returns the parent's .doc.mjs
|
|
50
50
|
* if the sub-component is documented there.
|
|
51
|
-
* @param {string} coreDir
|
|
51
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
52
52
|
* @param {string} name
|
|
53
53
|
* @returns {string | null}
|
|
54
54
|
*/
|
|
55
|
-
export function findComponentReadme(coreDir: string, name: string): string | null;
|
|
55
|
+
export function findComponentReadme(coreDir: string | null, name: string): string | null;
|
|
56
56
|
/**
|
|
57
57
|
* Find the main source file for a component (Astryx*.tsx, excluding tests).
|
|
58
58
|
* For "Button" finds src/Button/XDSButton.tsx
|
|
@@ -63,19 +63,20 @@ export function findComponentReadme(coreDir: string, name: string): string | nul
|
|
|
63
63
|
* `useResizable.ts`), so `.ts` candidates are searched alongside `.tsx`. Without
|
|
64
64
|
* this, deriving the import path for a `.ts`-authored function falls back to the
|
|
65
65
|
* bare `@astryxdesign/core` root instead of its tree-shakeable subpath.
|
|
66
|
-
* @param {string} coreDir
|
|
66
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
67
67
|
* @param {string} name
|
|
68
68
|
* @returns {string | null}
|
|
69
69
|
*/
|
|
70
|
-
export function findComponentSource(coreDir: string, name: string): string | null;
|
|
70
|
+
export function findComponentSource(coreDir: string | null, name: string): string | null;
|
|
71
71
|
/**
|
|
72
72
|
* Compute the Levenshtein (edit) distance between two strings.
|
|
73
73
|
* Used for fuzzy-matching component names. Dependency-free.
|
|
74
|
-
* @param {string} coreDir
|
|
74
|
+
* @param {string | null} coreDir null in a run that reads no Core: every
|
|
75
|
+
* name then imports from the package root
|
|
75
76
|
* @param {string} componentName
|
|
76
77
|
* @returns {string}
|
|
77
78
|
*/
|
|
78
|
-
export function resolveImportPath(coreDir: string, componentName: string): string;
|
|
79
|
+
export function resolveImportPath(coreDir: string | null, componentName: string): string;
|
|
79
80
|
/**
|
|
80
81
|
* Resolve the specifier an integration component is imported from. An authored
|
|
81
82
|
* doc import is canonical; otherwise resolve against the owning package's
|
|
@@ -371,10 +371,11 @@ export function familyMember(docs, name) {
|
|
|
371
371
|
*
|
|
372
372
|
* Keys are sorted alphabetically (groups and ungrouped components interleaved).
|
|
373
373
|
* Components within each group are also sorted alphabetically.
|
|
374
|
-
* @param {string} coreDir
|
|
374
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
375
375
|
* @returns {Record<string, string[]>}
|
|
376
376
|
*/
|
|
377
377
|
export function discoverComponents(coreDir) {
|
|
378
|
+
if (coreDir == null) return {};
|
|
378
379
|
// The component matcher calls this for each name it resolves, so one
|
|
379
380
|
// operation reads the docs once. Each caller gets its own copy to change.
|
|
380
381
|
// The Core the CLI was published with, unchanged, has its list stored.
|
|
@@ -601,11 +602,12 @@ function foldersHolding(srcDir, entries, names) {
|
|
|
601
602
|
* Find the .doc.mjs file for a component.
|
|
602
603
|
* For sub-components (e.g. StackItem), returns the parent's .doc.mjs
|
|
603
604
|
* if the sub-component is documented there.
|
|
604
|
-
* @param {string} coreDir
|
|
605
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
605
606
|
* @param {string} name
|
|
606
607
|
* @returns {string | null}
|
|
607
608
|
*/
|
|
608
609
|
export function findComponentReadme(coreDir, name) {
|
|
610
|
+
if (coreDir == null) return null;
|
|
609
611
|
const srcDir = path.join(coreDir, 'src');
|
|
610
612
|
const exactDoc = `${name}.doc.mjs`;
|
|
611
613
|
const xdsDoc = `XDS${name}.doc.mjs`;
|
|
@@ -664,11 +666,12 @@ export function findComponentReadme(coreDir, name) {
|
|
|
664
666
|
* `useResizable.ts`), so `.ts` candidates are searched alongside `.tsx`. Without
|
|
665
667
|
* this, deriving the import path for a `.ts`-authored function falls back to the
|
|
666
668
|
* bare `@astryxdesign/core` root instead of its tree-shakeable subpath.
|
|
667
|
-
* @param {string} coreDir
|
|
669
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
668
670
|
* @param {string} name
|
|
669
671
|
* @returns {string | null}
|
|
670
672
|
*/
|
|
671
673
|
export function findComponentSource(coreDir, name) {
|
|
674
|
+
if (coreDir == null) return null;
|
|
672
675
|
const found = ownSourceFile(coreDir, name);
|
|
673
676
|
if (found == null) return null;
|
|
674
677
|
// A component's exact name in another case (`tokenizer` for Tokenizer) is
|
|
@@ -810,11 +813,13 @@ function caseSpelledComponentSource(srcDir, name) {
|
|
|
810
813
|
/**
|
|
811
814
|
* Compute the Levenshtein (edit) distance between two strings.
|
|
812
815
|
* Used for fuzzy-matching component names. Dependency-free.
|
|
813
|
-
* @param {string} coreDir
|
|
816
|
+
* @param {string | null} coreDir null in a run that reads no Core: every
|
|
817
|
+
* name then imports from the package root
|
|
814
818
|
* @param {string} componentName
|
|
815
819
|
* @returns {string}
|
|
816
820
|
*/
|
|
817
821
|
export function resolveImportPath(coreDir, componentName) {
|
|
822
|
+
if (coreDir == null) return '@astryxdesign/core';
|
|
818
823
|
const stored = checkedComponentList(coreDir)?.imports;
|
|
819
824
|
if (stored && Object.hasOwn(stored, componentName)) {
|
|
820
825
|
return stored[componentName];
|
|
@@ -66,17 +66,25 @@ export function isGuideRoute(target: unknown): target is string;
|
|
|
66
66
|
*/
|
|
67
67
|
export function discoverBuiltinTopics(): Record<string, string>;
|
|
68
68
|
/**
|
|
69
|
-
* The
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
* The CLI's own topics as a run on Core reads them, whatever the run's base.
|
|
70
|
+
* @returns {Record<string, string>} topic name → absolute doc path
|
|
71
|
+
*/
|
|
72
|
+
export function builtinTopicsForCore(): Record<string, string>;
|
|
73
|
+
/**
|
|
74
|
+
* The name an integration doc declares, whether it is placed (has
|
|
75
|
+
* `placement`, so it is no topic or root namespace), and the generated level
|
|
76
|
+
* its category puts it in when it is a flat topic (null for a placed doc or
|
|
77
|
+
* a namespace, which sit in no level), as docs discovery reads the doc; null when
|
|
78
|
+
* the doc does not load or parse, or names nothing. A doc of exported
|
|
79
|
+
* literals is read as data ({@link readDocAsData}).
|
|
73
80
|
*
|
|
74
81
|
* @param {string} file an integration doc file
|
|
75
|
-
* @returns {Promise<{name: string, placed: boolean} | null>}
|
|
82
|
+
* @returns {Promise<{name: string, placed: boolean, level: string | null} | null>}
|
|
76
83
|
*/
|
|
77
84
|
export function integrationDocDeclaration(file: string): Promise<{
|
|
78
85
|
name: string;
|
|
79
86
|
placed: boolean;
|
|
87
|
+
level: string | null;
|
|
80
88
|
} | null>;
|
|
81
89
|
/**
|
|
82
90
|
* The CLI's own guide files: every flat topic and every doc in its docs tree,
|
|
@@ -43,6 +43,8 @@ import {
|
|
|
43
43
|
sourceTitle,
|
|
44
44
|
withSourceTitle,
|
|
45
45
|
} from './docs-section-key.mjs';
|
|
46
|
+
import {currentNonCoreBase} from '../bases/state.mjs';
|
|
47
|
+
import {topicLevel} from '../doc-compiler/generated-levels.mjs';
|
|
46
48
|
|
|
47
49
|
export {withSourceTitle};
|
|
48
50
|
|
|
@@ -129,6 +131,16 @@ export function isGuideRoute(target) {
|
|
|
129
131
|
* @returns {Record<string, string>} topic name → absolute doc path
|
|
130
132
|
*/
|
|
131
133
|
export function discoverBuiltinTopics() {
|
|
134
|
+
// These topics describe Core; they show only in a run whose base is Core.
|
|
135
|
+
if (currentNonCoreBase()) return Object.create(null);
|
|
136
|
+
return builtinTopicsForCore();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The CLI's own topics as a run on Core reads them, whatever the run's base.
|
|
141
|
+
* @returns {Record<string, string>} topic name → absolute doc path
|
|
142
|
+
*/
|
|
143
|
+
export function builtinTopicsForCore() {
|
|
132
144
|
/** @type {Record<string, string>} */
|
|
133
145
|
const topics = Object.create(null);
|
|
134
146
|
if (!fs.existsSync(BUILTIN_DOCS_DIR)) return topics;
|
|
@@ -140,13 +152,15 @@ export function discoverBuiltinTopics() {
|
|
|
140
152
|
}
|
|
141
153
|
|
|
142
154
|
/**
|
|
143
|
-
* The name an integration doc declares,
|
|
144
|
-
* `placement`, so it is no topic or root namespace),
|
|
145
|
-
*
|
|
146
|
-
*
|
|
155
|
+
* The name an integration doc declares, whether it is placed (has
|
|
156
|
+
* `placement`, so it is no topic or root namespace), and the generated level
|
|
157
|
+
* its category puts it in when it is a flat topic (null for a placed doc or
|
|
158
|
+
* a namespace, which sit in no level), as docs discovery reads the doc; null when
|
|
159
|
+
* the doc does not load or parse, or names nothing. A doc of exported
|
|
160
|
+
* literals is read as data ({@link readDocAsData}).
|
|
147
161
|
*
|
|
148
162
|
* @param {string} file an integration doc file
|
|
149
|
-
* @returns {Promise<{name: string, placed: boolean} | null>}
|
|
163
|
+
* @returns {Promise<{name: string, placed: boolean, level: string | null} | null>}
|
|
150
164
|
*/
|
|
151
165
|
export async function integrationDocDeclaration(file) {
|
|
152
166
|
let doc;
|
|
@@ -158,7 +172,12 @@ export async function integrationDocDeclaration(file) {
|
|
|
158
172
|
return null;
|
|
159
173
|
}
|
|
160
174
|
if (typeof doc?.name !== 'string') return null;
|
|
161
|
-
|
|
175
|
+
const placed = doc.placement != null;
|
|
176
|
+
return {
|
|
177
|
+
name: doc.name,
|
|
178
|
+
placed,
|
|
179
|
+
level: placed || doc.type === 'namespace' ? null : topicLevel(doc.category),
|
|
180
|
+
};
|
|
162
181
|
}
|
|
163
182
|
|
|
164
183
|
/**
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* Returns Record<category, hookName[]> similar to discoverComponents.
|
|
7
7
|
* Categories from HookDoc.category: focus, layout, animation, interaction, data, media, streaming
|
|
8
8
|
* Hooks without a category go in 'Other'.
|
|
9
|
-
* @param {string} coreDir
|
|
9
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
10
10
|
* @param {(name: string) => boolean} [keep] the hooks to read; the others are
|
|
11
11
|
* left out, and their docs are not read
|
|
12
12
|
* @param {Set<string>} [tops] the top folders of `src` outside `hooks` to
|
|
13
13
|
* read, when only these can hold a hook `keep` accepts
|
|
14
14
|
* @returns {Record<string, string[]>}
|
|
15
15
|
*/
|
|
16
|
-
export function discoverHooks(coreDir: string, keep?: (name: string) => boolean, tops?: Set<string>): Record<string, string[]>;
|
|
16
|
+
export function discoverHooks(coreDir: string | null, keep?: (name: string) => boolean, tops?: Set<string>): Record<string, string[]>;
|
|
17
17
|
/**
|
|
18
18
|
* Each hook with the keywords its doc declares, in name order. The docs are
|
|
19
19
|
* read as text, not imported.
|
|
@@ -29,16 +29,16 @@ export function discoverHookKeywords(coreDir: string): Array<{
|
|
|
29
29
|
* Searches hooks/ directory and component directories.
|
|
30
30
|
* Matches both exact name and with 'use' prefix stripped.
|
|
31
31
|
*
|
|
32
|
-
* @param {string} coreDir
|
|
32
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
33
33
|
* @param {string} name - Hook name (e.g. 'useMediaQuery', 'MediaQuery', 'mediaquery')
|
|
34
34
|
* @returns {string|null} Path to the .doc.mjs file, or null
|
|
35
35
|
*/
|
|
36
|
-
export function findHookDoc(coreDir: string, name: string): string | null;
|
|
36
|
+
export function findHookDoc(coreDir: string | null, name: string): string | null;
|
|
37
37
|
/**
|
|
38
38
|
* Get all discovered hook names as a flat array (for fuzzy matching).
|
|
39
|
-
* @param {string} coreDir
|
|
39
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
40
40
|
* @param {(name: string) => boolean} [keep] as for {@link discoverHooks}
|
|
41
41
|
* @param {Set<string>} [tops] as for {@link discoverHooks}
|
|
42
42
|
* @returns {string[]}
|
|
43
43
|
*/
|
|
44
|
-
export function getAllHookNames(coreDir: string, keep?: (name: string) => boolean, tops?: Set<string>): string[];
|
|
44
|
+
export function getAllHookNames(coreDir: string | null, keep?: (name: string) => boolean, tops?: Set<string>): string[];
|
|
@@ -80,7 +80,7 @@ function hookNameFromFile(fileName) {
|
|
|
80
80
|
* Returns Record<category, hookName[]> similar to discoverComponents.
|
|
81
81
|
* Categories from HookDoc.category: focus, layout, animation, interaction, data, media, streaming
|
|
82
82
|
* Hooks without a category go in 'Other'.
|
|
83
|
-
* @param {string} coreDir
|
|
83
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
84
84
|
* @param {(name: string) => boolean} [keep] the hooks to read; the others are
|
|
85
85
|
* left out, and their docs are not read
|
|
86
86
|
* @param {Set<string>} [tops] the top folders of `src` outside `hooks` to
|
|
@@ -121,12 +121,13 @@ export function discoverHooks(coreDir, keep = () => true, tops) {
|
|
|
121
121
|
/**
|
|
122
122
|
* Each hook's doc, by hook name: the `*.doc.mjs` files in src/hooks/, then
|
|
123
123
|
* the hook docs in the other folders of src/.
|
|
124
|
-
* @param {string} coreDir
|
|
124
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
125
125
|
* @param {(name: string) => boolean} keep the hooks to list
|
|
126
126
|
* @param {Set<string>} [tops] as for {@link discoverHooks}
|
|
127
127
|
* @returns {Map<string, string>} hook name → doc path
|
|
128
128
|
*/
|
|
129
129
|
function hookDocs(coreDir, keep, tops) {
|
|
130
|
+
if (coreDir == null) return new Map();
|
|
130
131
|
const srcDir = path.join(coreDir, 'src');
|
|
131
132
|
const hooksDir = path.join(srcDir, 'hooks');
|
|
132
133
|
/** @type {Map<string, string>} */
|
|
@@ -212,11 +213,12 @@ function readHookKeywords(docPath) {
|
|
|
212
213
|
* Searches hooks/ directory and component directories.
|
|
213
214
|
* Matches both exact name and with 'use' prefix stripped.
|
|
214
215
|
*
|
|
215
|
-
* @param {string} coreDir
|
|
216
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
216
217
|
* @param {string} name - Hook name (e.g. 'useMediaQuery', 'MediaQuery', 'mediaquery')
|
|
217
218
|
* @returns {string|null} Path to the .doc.mjs file, or null
|
|
218
219
|
*/
|
|
219
220
|
export function findHookDoc(coreDir, name) {
|
|
221
|
+
if (coreDir == null) return null;
|
|
220
222
|
const srcDir = path.join(coreDir, 'src');
|
|
221
223
|
const hooksDir = path.join(srcDir, 'hooks');
|
|
222
224
|
|
|
@@ -306,7 +308,7 @@ function searchDirForHookDoc(dirPath, candidates) {
|
|
|
306
308
|
|
|
307
309
|
/**
|
|
308
310
|
* Get all discovered hook names as a flat array (for fuzzy matching).
|
|
309
|
-
* @param {string} coreDir
|
|
311
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
310
312
|
* @param {(name: string) => boolean} [keep] as for {@link discoverHooks}
|
|
311
313
|
* @param {Set<string>} [tops] as for {@link discoverHooks}
|
|
312
314
|
* @returns {string[]}
|
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
import {EXACT_CODEC} from '../fs/exact-codec.mjs';
|
|
54
54
|
import {babelParser} from '../runtime/lazy-dependencies.mjs';
|
|
55
55
|
import {compareText} from '../text/compare-text.mjs';
|
|
56
|
+
import {currentNonCoreBase} from '../bases/state.mjs';
|
|
56
57
|
|
|
57
58
|
export {
|
|
58
59
|
coreTemplateIds,
|
|
@@ -1147,6 +1148,8 @@ export function findPageDocFile(dirPath) {
|
|
|
1147
1148
|
}
|
|
1148
1149
|
|
|
1149
1150
|
async function discoverPages() {
|
|
1151
|
+
// Core's content shows only in a run whose base is Core.
|
|
1152
|
+
if (currentNonCoreBase()) return [];
|
|
1150
1153
|
if (!fs.existsSync(PAGES_DIR)) return [];
|
|
1151
1154
|
const dirs = listDirEntries(PAGES_DIR).filter(e => e.isDirectory());
|
|
1152
1155
|
|
|
@@ -1176,6 +1179,8 @@ async function discoverPages() {
|
|
|
1176
1179
|
}
|
|
1177
1180
|
|
|
1178
1181
|
async function discoverBlocks() {
|
|
1182
|
+
// Core's content shows only in a run whose base is Core.
|
|
1183
|
+
if (currentNonCoreBase()) return [];
|
|
1179
1184
|
const docFiles = findDocFiles(BLOCKS_DIR, TEMPLATE_SUFFIX_RE);
|
|
1180
1185
|
/** @type {DiscoveredTemplate[]} */
|
|
1181
1186
|
const blocks = [];
|
|
@@ -19,7 +19,7 @@ export function listTemplates(): string[];
|
|
|
19
19
|
* The ids of Core's templates that `keep` accepts, read from file names: each
|
|
20
20
|
* page folder, and each block doc that has its same-stem source. Discovery
|
|
21
21
|
* gives Core's templates exactly these ids. Only a kept block's source is
|
|
22
|
-
* looked for.
|
|
22
|
+
* looked for. None in a run whose base is not Core.
|
|
23
23
|
* @param {(id: string) => boolean} [keep]
|
|
24
24
|
* @returns {string[]}
|
|
25
25
|
*/
|
|
@@ -21,6 +21,7 @@ import {nameLines} from '../fs/kept-tree.mjs';
|
|
|
21
21
|
import {listDirEntries} from '../fs/listing-cache.mjs';
|
|
22
22
|
import {BLOCKS_DIR, PAGES_DIR} from './name-roots.mjs';
|
|
23
23
|
import {foldEntryName} from './entry-name-files.mjs';
|
|
24
|
+
import {currentNonCoreBase} from '../bases/state.mjs';
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Released compatibility suffixes, in precedence order. Stable 0.6.0
|
|
@@ -69,6 +70,8 @@ export {BLOCKS_DIR, PAGES_DIR};
|
|
|
69
70
|
export function listTemplates() {
|
|
70
71
|
/** @type {string[]} */
|
|
71
72
|
const all = [];
|
|
73
|
+
// Core's templates show only in a run whose base is Core.
|
|
74
|
+
if (currentNonCoreBase()) return all;
|
|
72
75
|
if (fs.existsSync(PAGES_DIR)) {
|
|
73
76
|
all.push(
|
|
74
77
|
...listDirEntries(PAGES_DIR)
|
|
@@ -83,11 +86,12 @@ export function listTemplates() {
|
|
|
83
86
|
* The ids of Core's templates that `keep` accepts, read from file names: each
|
|
84
87
|
* page folder, and each block doc that has its same-stem source. Discovery
|
|
85
88
|
* gives Core's templates exactly these ids. Only a kept block's source is
|
|
86
|
-
* looked for.
|
|
89
|
+
* looked for. None in a run whose base is not Core.
|
|
87
90
|
* @param {(id: string) => boolean} [keep]
|
|
88
91
|
* @returns {string[]}
|
|
89
92
|
*/
|
|
90
93
|
export function coreTemplateIds(keep = () => true) {
|
|
94
|
+
if (currentNonCoreBase()) return [];
|
|
91
95
|
const ids = listTemplates().filter(keep);
|
|
92
96
|
/** @param {string} dir */
|
|
93
97
|
const walk = dir => {
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
STORED_DOCS_FILE,
|
|
37
37
|
} from '../doc-compiler/stored-docs.mjs';
|
|
38
38
|
import {compareText} from '../text/compare-text.mjs';
|
|
39
|
+
import {currentNonCoreBase} from '../bases/state.mjs';
|
|
39
40
|
|
|
40
41
|
export const BUNDLED_THEME_PACKAGE = '@astryxdesign/cli';
|
|
41
42
|
export const THEMES_DIR = path.join(CLI_ROOT, 'assets', 'templates', 'themes');
|
|
@@ -1752,6 +1753,8 @@ let bundledThemeCache = null;
|
|
|
1752
1753
|
|
|
1753
1754
|
/** @returns {DiscoveredTheme[]} */
|
|
1754
1755
|
export function discoverBundledThemes() {
|
|
1756
|
+
// Core's content shows only in a run whose base is Core.
|
|
1757
|
+
if (currentNonCoreBase()) return [];
|
|
1755
1758
|
bundledThemeCache ??= discoverThemeDirectory(
|
|
1756
1759
|
THEMES_DIR,
|
|
1757
1760
|
BUNDLED_THEME_PACKAGE,
|
|
@@ -20,6 +20,7 @@ import {inspectPackageExport} from './package-exports.mjs';
|
|
|
20
20
|
import {themeImportPackage} from './theme-discovery.mjs';
|
|
21
21
|
import {isLocalThemeOwner, projectPath} from '../config/theme-state.mjs';
|
|
22
22
|
import {formatCliCommand} from '../env/package-manager.mjs';
|
|
23
|
+
import {listedPackageInstall} from '../release/notices.mjs';
|
|
23
24
|
import {installCommandFor} from './template-needs.mjs';
|
|
24
25
|
|
|
25
26
|
export class ThemeImportError extends Error {
|
|
@@ -163,10 +164,27 @@ function resolvePackageTheme(theme, cwd, ownerThemeCount) {
|
|
|
163
164
|
const importPackage = themeImportPackage(theme);
|
|
164
165
|
const packageDir = themePackageDir(theme, cwd);
|
|
165
166
|
if (!packageDir) {
|
|
167
|
+
const add = formatCliCommand(`theme add ${theme.slug}`, cwd);
|
|
168
|
+
// A package the app lists but has not installed, as in a fresh clone,
|
|
169
|
+
// comes from installing the app's dependencies, at the version it lists.
|
|
170
|
+
const listed = listedPackageInstall(cwd, importPackage);
|
|
171
|
+
if (listed) {
|
|
172
|
+
throw new ThemeImportError(
|
|
173
|
+
`Theme package "${importPackage}" is not installed, though this project lists it: install the project's dependencies with \`${listed}\`.`,
|
|
174
|
+
{
|
|
175
|
+
suggestions: [
|
|
176
|
+
{
|
|
177
|
+
name: listed,
|
|
178
|
+
reason: `install the packages the project lists, ${importPackage} among them`,
|
|
179
|
+
},
|
|
180
|
+
{name: add, reason: 'add the theme once it is installed'},
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
);
|
|
184
|
+
}
|
|
166
185
|
// The app imports a theme from its package, bundled themes included, so
|
|
167
186
|
// the package is installed in the app before the theme is added.
|
|
168
187
|
const {installCommand} = installCommandFor([importPackage], cwd);
|
|
169
|
-
const add = formatCliCommand(`theme add ${theme.slug}`, cwd);
|
|
170
188
|
const install = installCommand ?? `npm install ${importPackage}`;
|
|
171
189
|
throw new ThemeImportError(
|
|
172
190
|
`Theme package "${importPackage}" is not installed. The app imports ${theme.slug} from it, so install it, then add the theme: \`${install}\`, then \`${add}\`.`,
|
|
@@ -41,12 +41,14 @@ export function cliRootNamespaceNames(dir?: string): string[];
|
|
|
41
41
|
* assets/docs/tree, and, unless left out, every typed self-doc with its
|
|
42
42
|
* `namespace` group. A file that fails to load or parse is a diagnostic, never
|
|
43
43
|
* a thrown error.
|
|
44
|
-
* @param {{selfDocs?: boolean, dir?: string}} [options]
|
|
44
|
+
* @param {{selfDocs?: boolean, dir?: string, allRoots?: boolean}} [options]
|
|
45
|
+
* `allRoots`: every root, as a run on Core reads them, whatever the base
|
|
45
46
|
* @returns {Promise<{namespaces: TreeNamespaceInput[], docs: TreeDocInput[], diagnostics: CompilerDiagnostic[]}>}
|
|
46
47
|
*/
|
|
47
|
-
export function loadTreeInputs({ selfDocs, dir, }?: {
|
|
48
|
+
export function loadTreeInputs({ selfDocs, dir, allRoots, }?: {
|
|
48
49
|
selfDocs?: boolean;
|
|
49
50
|
dir?: string;
|
|
51
|
+
allRoots?: boolean;
|
|
50
52
|
}): Promise<{
|
|
51
53
|
namespaces: TreeNamespaceInput[];
|
|
52
54
|
docs: TreeDocInput[];
|
|
@@ -32,6 +32,7 @@ import {renderTokens} from './links.mjs';
|
|
|
32
32
|
import {createDocId} from '../identity/provider-identity.mjs';
|
|
33
33
|
import {CLI_PROVIDER_ID} from '../identity/providers.mjs';
|
|
34
34
|
import {KIND_GROUPS, TOPIC_LEVELS, topicLevel} from './generated-levels.mjs';
|
|
35
|
+
import {currentNonCoreBase} from '../bases/state.mjs';
|
|
35
36
|
|
|
36
37
|
export {routeSegment};
|
|
37
38
|
|
|
@@ -793,12 +794,14 @@ export function cliRootNamespaceNames(dir = TREE_DOCS_DIR) {
|
|
|
793
794
|
* assets/docs/tree, and, unless left out, every typed self-doc with its
|
|
794
795
|
* `namespace` group. A file that fails to load or parse is a diagnostic, never
|
|
795
796
|
* a thrown error.
|
|
796
|
-
* @param {{selfDocs?: boolean, dir?: string}} [options]
|
|
797
|
+
* @param {{selfDocs?: boolean, dir?: string, allRoots?: boolean}} [options]
|
|
798
|
+
* `allRoots`: every root, as a run on Core reads them, whatever the base
|
|
797
799
|
* @returns {Promise<{namespaces: TreeNamespaceInput[], docs: TreeDocInput[], diagnostics: CompilerDiagnostic[]}>}
|
|
798
800
|
*/
|
|
799
801
|
export async function loadTreeInputs({
|
|
800
802
|
selfDocs = true,
|
|
801
803
|
dir = TREE_DOCS_DIR,
|
|
804
|
+
allRoots = false,
|
|
802
805
|
} = {}) {
|
|
803
806
|
/** @type {TreeNamespaceInput[]} */
|
|
804
807
|
const namespaces = [];
|
|
@@ -911,9 +914,51 @@ export async function loadTreeInputs({
|
|
|
911
914
|
});
|
|
912
915
|
}
|
|
913
916
|
}
|
|
917
|
+
if (dir === TREE_DOCS_DIR && !allRoots && currentNonCoreBase()) {
|
|
918
|
+
return {...onlyCliRoots(namespaces, docs), diagnostics};
|
|
919
|
+
}
|
|
914
920
|
return {namespaces, docs, diagnostics};
|
|
915
921
|
}
|
|
916
922
|
|
|
923
|
+
/**
|
|
924
|
+
* The tree inputs under a root namespace that describes the CLI itself
|
|
925
|
+
* (`describes: 'cli'`). Every other root describes Core, so its namespaces
|
|
926
|
+
* and guides show only in a run whose base is Core. A doc that names no
|
|
927
|
+
* parent is a CLI self-doc that a namespace adopts by its group, and stays.
|
|
928
|
+
* @param {TreeNamespaceInput[]} namespaces
|
|
929
|
+
* @param {TreeDocInput[]} docs
|
|
930
|
+
* @returns {{namespaces: TreeNamespaceInput[], docs: TreeDocInput[]}}
|
|
931
|
+
*/
|
|
932
|
+
function onlyCliRoots(namespaces, docs) {
|
|
933
|
+
/** @param {DocPlacement | undefined} placement */
|
|
934
|
+
const parentOf = placement =>
|
|
935
|
+
typeof placement?.parent === 'string' &&
|
|
936
|
+
placement.parent.startsWith('namespace:')
|
|
937
|
+
? placement.parent.slice('namespace:'.length)
|
|
938
|
+
: undefined;
|
|
939
|
+
/** @type {Map<string, TreeNamespaceInput['doc']>} */
|
|
940
|
+
const byName = new Map(namespaces.map(ns => [ns.doc.name, ns.doc]));
|
|
941
|
+
/** @param {string} name */
|
|
942
|
+
const describesCli = name => {
|
|
943
|
+
const seen = new Set();
|
|
944
|
+
let current = byName.get(name);
|
|
945
|
+
while (current != null && !seen.has(current.name)) {
|
|
946
|
+
seen.add(current.name);
|
|
947
|
+
const parent = parentOf(current.placement);
|
|
948
|
+
if (parent == null) return current.describes === 'cli';
|
|
949
|
+
current = byName.get(parent);
|
|
950
|
+
}
|
|
951
|
+
return false;
|
|
952
|
+
};
|
|
953
|
+
return {
|
|
954
|
+
namespaces: namespaces.filter(ns => describesCli(ns.doc.name)),
|
|
955
|
+
docs: docs.filter(doc => {
|
|
956
|
+
const parent = parentOf(doc.placement);
|
|
957
|
+
return parent == null || describesCli(parent);
|
|
958
|
+
}),
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
|
|
917
962
|
/** The discovery group every icon definition doc belongs to. */
|
|
918
963
|
export const ICON_DEFINITIONS_GROUP = 'icon-definitions';
|
|
919
964
|
|
|
@@ -85,6 +85,13 @@ export function detectPackageManager(targetDir?: string): DetectedPackageManager
|
|
|
85
85
|
* @returns {string} e.g. 'npx', 'yarn', 'pnpm exec', 'bunx'
|
|
86
86
|
*/
|
|
87
87
|
export function getRunPrefix(targetDir?: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* The command that installs the dependencies of the project at `targetDir`,
|
|
90
|
+
* with its package manager; npm's when none is detected.
|
|
91
|
+
* @param {string} [targetDir=process.cwd()]
|
|
92
|
+
* @returns {string}
|
|
93
|
+
*/
|
|
94
|
+
export function installDependenciesCommand(targetDir?: string): string;
|
|
88
95
|
/**
|
|
89
96
|
* Get the one-off ("dlx") runner for the detected package manager.
|
|
90
97
|
*
|
|
@@ -328,6 +328,27 @@ export function getRunPrefix(targetDir) {
|
|
|
328
328
|
/** The published CLI package name — used for one-off (uninstalled) invocations. */
|
|
329
329
|
export const CLI_PACKAGE = '@astryxdesign/cli';
|
|
330
330
|
|
|
331
|
+
/** The command that installs a project's dependencies, by package manager. */
|
|
332
|
+
const INSTALL_DEPENDENCIES = /** @type {Record<string, string>} */ ({
|
|
333
|
+
npm: 'npm install',
|
|
334
|
+
pnpm: 'pnpm install',
|
|
335
|
+
yarn: 'yarn install',
|
|
336
|
+
bun: 'bun install',
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* The command that installs the dependencies of the project at `targetDir`,
|
|
341
|
+
* with its package manager; npm's when none is detected.
|
|
342
|
+
* @param {string} [targetDir=process.cwd()]
|
|
343
|
+
* @returns {string}
|
|
344
|
+
*/
|
|
345
|
+
export function installDependenciesCommand(targetDir = process.cwd()) {
|
|
346
|
+
return (
|
|
347
|
+
INSTALL_DEPENDENCIES[detectPackageManager(targetDir)] ??
|
|
348
|
+
INSTALL_DEPENDENCIES.npm
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
331
352
|
/** The CLI binary name — only resolves once the CLI is installed (or run via CLI_PACKAGE). */
|
|
332
353
|
export const CLI_BIN = 'astryx';
|
|
333
354
|
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* The families a font service URL requests in its `family` parameters, as
|
|
6
|
+
* Google Fonts URLs do (`family=Figtree:wght@400;700`, or
|
|
7
|
+
* `family=Roboto:400|Lato` in the older form), as family keys.
|
|
8
|
+
* @param {string} url
|
|
9
|
+
* @returns {Set<string>}
|
|
10
|
+
*/
|
|
11
|
+
export function fontServiceFamilies(url: string): Set<string>;
|
|
4
12
|
/**
|
|
5
13
|
* The families a stylesheet `@import` specifier loads, read from `fromDir`:
|
|
6
14
|
* an `@fontsource` package by its name, a font service URL by the
|