@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
|
@@ -21,6 +21,31 @@ export const fontKey = family =>
|
|
|
21
21
|
.replace(/\s+/g, ' ')
|
|
22
22
|
.toLowerCase();
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* The families a font service URL requests in its `family` parameters, as
|
|
26
|
+
* Google Fonts URLs do (`family=Figtree:wght@400;700`, or
|
|
27
|
+
* `family=Roboto:400|Lato` in the older form), as family keys.
|
|
28
|
+
* @param {string} url
|
|
29
|
+
* @returns {Set<string>}
|
|
30
|
+
*/
|
|
31
|
+
export function fontServiceFamilies(url) {
|
|
32
|
+
/** @type {Set<string>} */
|
|
33
|
+
const out = new Set();
|
|
34
|
+
for (const m of url.matchAll(/family=([^&'")]+)/g)) {
|
|
35
|
+
let value;
|
|
36
|
+
try {
|
|
37
|
+
value = decodeURIComponent(m[1].replace(/\+/g, ' '));
|
|
38
|
+
} catch {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
for (const family of value.split('|')) {
|
|
42
|
+
const name = family.split(':')[0];
|
|
43
|
+
if (name.trim()) out.add(fontKey(name));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
|
|
24
49
|
/**
|
|
25
50
|
* The families a stylesheet `@import` specifier loads, read from `fromDir`:
|
|
26
51
|
* an `@fontsource` package by its name, a font service URL by the
|
|
@@ -42,8 +67,7 @@ export function importedFontFamilies(spec, fromDir, seen = new Set()) {
|
|
|
42
67
|
fontKey(`${pkg[2].replace(/-/g, ' ')}${pkg[1] ? ' Variable' : ''}`),
|
|
43
68
|
);
|
|
44
69
|
if (/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(spec)) {
|
|
45
|
-
for (const
|
|
46
|
-
out.add(fontKey(decodeURIComponent(m[1].replace(/\+/g, ' '))));
|
|
70
|
+
for (const family of fontServiceFamilies(spec)) out.add(family);
|
|
47
71
|
return out;
|
|
48
72
|
}
|
|
49
73
|
/** @type {string | null} */
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
* names (foundation/runtime/css-tree.mjs keptCssTreeAnswer), and by
|
|
36
36
|
* `theme build` for the JavaScript it compiles from a theme's local
|
|
37
37
|
* modules (api/theme/build/self-contained.mjs), each kept while every
|
|
38
|
-
* path it
|
|
39
|
-
*
|
|
38
|
+
* path it stamped but the CLI's own files (which its build id and the
|
|
39
|
+
* folder it runs from, both in every entry's key, stand for) is
|
|
40
40
|
* unchanged, in any command. The commands whose runs keep the other
|
|
41
41
|
* entries are `search`, `build`, `component`, `template`, `theme`,
|
|
42
42
|
* `discover`, `docs` and `doctor`. The first such run on a machine makes the
|
|
@@ -71,9 +71,9 @@ import * as fs from 'node:fs';
|
|
|
71
71
|
import * as nodeModule from 'node:module';
|
|
72
72
|
import * as os from 'node:os';
|
|
73
73
|
import * as path from 'node:path';
|
|
74
|
-
import {fileURLToPath} from 'node:url';
|
|
74
|
+
import {fileURLToPath, pathToFileURL} from 'node:url';
|
|
75
75
|
import {isDeepStrictEqual} from 'node:util';
|
|
76
|
-
import {CLI_ROOT, realDir} from './paths.mjs';
|
|
76
|
+
import {CLI_ROOT, isCliBuildFile, realDir} from './paths.mjs';
|
|
77
77
|
import {mayHaveIntegrations} from '../integrations/may-have-integrations.mjs';
|
|
78
78
|
import {currentUid, isPrivateDir} from '../env/private-dir.mjs';
|
|
79
79
|
import {userCacheDir} from '../env/user-dirs.mjs';
|
|
@@ -81,6 +81,7 @@ import {jitiCacheDir} from './jiti-cache.mjs';
|
|
|
81
81
|
import {hostedRun} from '../runtime/package-root.mjs';
|
|
82
82
|
import {cliDoor} from '../env/cli-command.mjs';
|
|
83
83
|
import {CACHE_LIMIT_BYTES, evictOldest} from './cache-eviction.mjs';
|
|
84
|
+
import {ownModuleHooks} from './own-modules.mjs';
|
|
84
85
|
import {
|
|
85
86
|
LISTED,
|
|
86
87
|
PRESENT,
|
|
@@ -375,6 +376,15 @@ export async function recordRun(fn, {armedThroughout = false} = {}) {
|
|
|
375
376
|
const realEnv = process.env;
|
|
376
377
|
/** @type {{deregister: () => void} | null} */
|
|
377
378
|
let hooks = null;
|
|
379
|
+
// An installed CLI resolves imports between its own modules by path while
|
|
380
|
+
// the recorder is armed (own-modules.mjs). Registered just before the
|
|
381
|
+
// recorder's hooks, so the recorder still sees each import and each load.
|
|
382
|
+
const own =
|
|
383
|
+
withoutRecording(buildId) == null
|
|
384
|
+
? null
|
|
385
|
+
: ownModuleHooks(`${pathToFileURL(CLI_ROOT).href}/`);
|
|
386
|
+
/** @type {{deregister: () => void} | null} */
|
|
387
|
+
let ownHooks = null;
|
|
378
388
|
/** @param {string | symbol} name */
|
|
379
389
|
const noteEnv = name => {
|
|
380
390
|
if (typeof name === 'string' && !env.has(name)) {
|
|
@@ -414,17 +424,22 @@ export async function recordRun(fn, {armedThroughout = false} = {}) {
|
|
|
414
424
|
},
|
|
415
425
|
});
|
|
416
426
|
const disarm = () => {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
427
|
+
for (const handle of [hooks, ownHooks]) {
|
|
428
|
+
try {
|
|
429
|
+
handle?.deregister();
|
|
430
|
+
} catch {
|
|
431
|
+
// A hook that cannot be removed is inert: it notes modules, or
|
|
432
|
+
// resolves the CLI's own as Node would.
|
|
433
|
+
}
|
|
421
434
|
}
|
|
422
435
|
hooks = null;
|
|
436
|
+
ownHooks = null;
|
|
423
437
|
if (process.env === proxy) process.env = realEnv;
|
|
424
438
|
};
|
|
425
439
|
const arm = () => {
|
|
426
440
|
if (hooks) return true;
|
|
427
441
|
try {
|
|
442
|
+
if (own) ownHooks = registerHooks(own);
|
|
428
443
|
hooks = registerHooks({
|
|
429
444
|
/**
|
|
430
445
|
* @param {string} url
|
|
@@ -586,6 +601,18 @@ function entryFile(dir, key, id) {
|
|
|
586
601
|
return path.join(dir, `gather-${hash}.json`);
|
|
587
602
|
}
|
|
588
603
|
|
|
604
|
+
/** @type {string | undefined} */
|
|
605
|
+
let cliFolderAnswer;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* The real path of the folder this CLI runs from, once per process: a copy
|
|
609
|
+
* installed in another folder (a patched one) keeps its own entries.
|
|
610
|
+
* @returns {string}
|
|
611
|
+
*/
|
|
612
|
+
function cliFolder() {
|
|
613
|
+
return (cliFolderAnswer ??= withoutRecording(() => realDir(CLI_ROOT)));
|
|
614
|
+
}
|
|
615
|
+
|
|
589
616
|
/**
|
|
590
617
|
* Everything an entry is for, as text: stored in the entry and compared on
|
|
591
618
|
* every read, so an entry copied under another entry's name is not used.
|
|
@@ -596,7 +623,8 @@ function entryFile(dir, key, id) {
|
|
|
596
623
|
function entryKey(key, id) {
|
|
597
624
|
return JSON.stringify([
|
|
598
625
|
FORMAT,
|
|
599
|
-
|
|
626
|
+
// The build and the folder it runs from stand for the CLI's own files.
|
|
627
|
+
[id, cliFolder()],
|
|
600
628
|
process.version,
|
|
601
629
|
process.platform,
|
|
602
630
|
process.arch,
|
|
@@ -646,6 +674,12 @@ function staleReason(stamps, env) {
|
|
|
646
674
|
}
|
|
647
675
|
}
|
|
648
676
|
for (const [file, state] of stamps) {
|
|
677
|
+
// The CLI's own files are the build id's and the CLI's folder's to stand
|
|
678
|
+
// for (both are in the entry's key), as for a summary (inCliBuild): they
|
|
679
|
+
// are kept for the code a derived value depends on, never checked one by
|
|
680
|
+
// one. A package in the node_modules folder inside the CLI's is not part
|
|
681
|
+
// of the build, and is checked as any other file.
|
|
682
|
+
if (inCliBuild(file)) continue;
|
|
649
683
|
if (!stillInState(file, state)) {
|
|
650
684
|
return 'a file or folder it read changed';
|
|
651
685
|
}
|
|
@@ -1247,10 +1281,7 @@ function summaryStampNow(at, stamp) {
|
|
|
1247
1281
|
* @returns {boolean}
|
|
1248
1282
|
*/
|
|
1249
1283
|
function inCliBuild(file) {
|
|
1250
|
-
|
|
1251
|
-
return (
|
|
1252
|
-
file.startsWith(root) && !file.startsWith(root + 'node_modules' + path.sep)
|
|
1253
|
-
);
|
|
1284
|
+
return isCliBuildFile(file, CLI_ROOT + path.sep, path.sep);
|
|
1254
1285
|
}
|
|
1255
1286
|
|
|
1256
1287
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
* The URL of the CLI module `specifier` names from `parent`, when both are
|
|
6
|
+
* the CLI's own; else null. A specifier with an escape, a query or a hash
|
|
7
|
+
* goes to Node, which checks it.
|
|
8
|
+
* @param {string} specifier
|
|
9
|
+
* @param {string | undefined} parent - the importing module's URL
|
|
10
|
+
* @param {string} root - the CLI folder's file URL, ending in `/`
|
|
11
|
+
* @returns {string | null}
|
|
12
|
+
*/
|
|
13
|
+
export function ownModuleUrl(specifier: string, parent: string | undefined, root: string): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Module hooks that resolve the CLI's imports of its own modules by path.
|
|
16
|
+
* Registered just before the recorder's hooks, they sit below them in the
|
|
17
|
+
* resolve chain, so the recorder still sees each import.
|
|
18
|
+
* @param {string} root - the CLI folder's file URL, ending in `/`
|
|
19
|
+
*/
|
|
20
|
+
export function ownModuleHooks(root: string): {
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} specifier
|
|
23
|
+
* @param {{parentURL?: string}} context
|
|
24
|
+
* @param {(specifier: string, context: any) => any} nextResolve
|
|
25
|
+
*/
|
|
26
|
+
resolve(specifier: string, context: {
|
|
27
|
+
parentURL?: string;
|
|
28
|
+
}, nextResolve: (specifier: string, context: any) => any): any;
|
|
29
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The installed CLI's imports of its own modules, resolved by their
|
|
5
|
+
* path in its folder.
|
|
6
|
+
*
|
|
7
|
+
* @input `ownModuleHooks(root)`, from the kept gathers' recorder
|
|
8
|
+
* (gather-cache.mjs), which registers them just before its own hooks.
|
|
9
|
+
* @output Module hooks whose resolve step answers a relative `.mjs` import
|
|
10
|
+
* between two of the CLI's own modules with that module's path in the
|
|
11
|
+
* CLI's folder; every other import goes on to the next resolver.
|
|
12
|
+
* @position The build id stands for the installed CLI's own files (AST-081
|
|
13
|
+
* FR7), so Node need not check that each one exists and where it really
|
|
14
|
+
* lives. Installed only where the recorder installs its hooks, never under
|
|
15
|
+
* Yarn Plug'n'Play.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {isCliBuildFile} from './paths.mjs';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The URL of the CLI module `specifier` names from `parent`, when both are
|
|
22
|
+
* the CLI's own; else null. A specifier with an escape, a query or a hash
|
|
23
|
+
* goes to Node, which checks it.
|
|
24
|
+
* @param {string} specifier
|
|
25
|
+
* @param {string | undefined} parent - the importing module's URL
|
|
26
|
+
* @param {string} root - the CLI folder's file URL, ending in `/`
|
|
27
|
+
* @returns {string | null}
|
|
28
|
+
*/
|
|
29
|
+
export function ownModuleUrl(specifier, parent, root) {
|
|
30
|
+
if (parent === undefined || !isCliBuildFile(parent, root, '/')) return null;
|
|
31
|
+
if (!specifier.startsWith('./') && !specifier.startsWith('../')) return null;
|
|
32
|
+
if (!specifier.endsWith('.mjs') || /[%?#]/.test(specifier)) return null;
|
|
33
|
+
const url = new URL(specifier, parent).href;
|
|
34
|
+
return isCliBuildFile(url, root, '/') ? url : null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Module hooks that resolve the CLI's imports of its own modules by path.
|
|
39
|
+
* Registered just before the recorder's hooks, they sit below them in the
|
|
40
|
+
* resolve chain, so the recorder still sees each import.
|
|
41
|
+
* @param {string} root - the CLI folder's file URL, ending in `/`
|
|
42
|
+
*/
|
|
43
|
+
export function ownModuleHooks(root) {
|
|
44
|
+
return {
|
|
45
|
+
/**
|
|
46
|
+
* @param {string} specifier
|
|
47
|
+
* @param {{parentURL?: string}} context
|
|
48
|
+
* @param {(specifier: string, context: any) => any} nextResolve
|
|
49
|
+
*/
|
|
50
|
+
resolve(specifier, context, nextResolve) {
|
|
51
|
+
const url = ownModuleUrl(specifier, context.parentURL, root);
|
|
52
|
+
return url === null
|
|
53
|
+
? nextResolve(specifier, context)
|
|
54
|
+
: {url, format: 'module', shortCircuit: true};
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -1,6 +1,16 @@
|
|
|
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
|
+
* Whether `target`, a path or a file URL, names one of the CLI's own files:
|
|
6
|
+
* one inside the CLI's folder, outside the node_modules folder inside it. In
|
|
7
|
+
* an installed CLI, its build id stands for exactly these files (AST-081 FR7).
|
|
8
|
+
* @param {string} target
|
|
9
|
+
* @param {string} root - the CLI's folder in the same form, ending in `sep`
|
|
10
|
+
* @param {string} sep - the separator of that form
|
|
11
|
+
* @returns {boolean}
|
|
12
|
+
*/
|
|
13
|
+
export function isCliBuildFile(target: string, root: string, sep: string): boolean;
|
|
4
14
|
/**
|
|
5
15
|
* The Core a command answers from: the project's (see
|
|
6
16
|
* {@link findProjectCoreDir}), else, when a copy other than the project's own
|
|
@@ -39,6 +49,16 @@ export function unavailableCoreMessage(found: {
|
|
|
39
49
|
* @returns {string}
|
|
40
50
|
*/
|
|
41
51
|
export function requireCoreDir(startDir?: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* The Core whose components, hooks, and docs this run reads: as
|
|
54
|
+
* {@link requireCoreDir} in a run on Core, and null in a run on another
|
|
55
|
+
* base, which reads no Core content. Each content reader treats null as no
|
|
56
|
+
* Core items and answers from the run's integrations alone.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} [startDir]
|
|
59
|
+
* @returns {string | null}
|
|
60
|
+
*/
|
|
61
|
+
export function coreContentDir(startDir?: string): string | null;
|
|
42
62
|
/**
|
|
43
63
|
* The carried Core alone, for a caller that already looked for the project's
|
|
44
64
|
* Core its own way: the folder, or null when the copy answering in `startDir`
|
|
@@ -60,6 +80,13 @@ export function findCarriedCoreDir(startDir: string, { fetch }?: {
|
|
|
60
80
|
* @returns {string | null}
|
|
61
81
|
*/
|
|
62
82
|
export function findProjectCoreDir(startDir?: string): string | null;
|
|
83
|
+
/**
|
|
84
|
+
* The project's installed @astryxdesign/core, whatever base the run reads:
|
|
85
|
+
* the lookup that decides the run's base.
|
|
86
|
+
* @param {string} [startDir]
|
|
87
|
+
* @returns {string | null}
|
|
88
|
+
*/
|
|
89
|
+
export function installedProjectCoreDir(startDir?: string): string | null;
|
|
63
90
|
/**
|
|
64
91
|
* `p` resolved through symlinks when it exists, so folders compare equal
|
|
65
92
|
* however they were reached.
|
|
@@ -236,9 +263,10 @@ export function discoverExternalPackages(startDir?: string): {
|
|
|
236
263
|
* List available component directories in packages/core/src.
|
|
237
264
|
* Component directories are capitalized (`Button`, `Dialog`); lowercase
|
|
238
265
|
* directories hold shared infrastructure and are never listed.
|
|
239
|
-
* @param {string} coreDir
|
|
266
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
267
|
+
* @returns {string[]}
|
|
240
268
|
*/
|
|
241
|
-
export function listComponents(coreDir: string): string[];
|
|
269
|
+
export function listComponents(coreDir: string | null): string[];
|
|
242
270
|
/**
|
|
243
271
|
* Does `targetPath` exist with EXACTLY this spelling?
|
|
244
272
|
*
|
package/foundation/fs/paths.mjs
CHANGED
|
@@ -24,12 +24,28 @@ import {ERROR_CODES} from '../response/error-codes.mjs';
|
|
|
24
24
|
import {carriedCore, runChoice} from '../release/run-context.mjs';
|
|
25
25
|
import {findDeclaringPackage} from '../release/project.mjs';
|
|
26
26
|
import {hostedRun, recordResolved} from '../runtime/package-root.mjs';
|
|
27
|
+
import {currentNonCoreBase} from '../bases/state.mjs';
|
|
27
28
|
|
|
28
29
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
29
30
|
|
|
30
31
|
/** Root of the @astryxdesign/cli package */
|
|
31
32
|
export const CLI_ROOT = path.resolve(__dirname, '..', '..');
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Whether `target`, a path or a file URL, names one of the CLI's own files:
|
|
36
|
+
* one inside the CLI's folder, outside the node_modules folder inside it. In
|
|
37
|
+
* an installed CLI, its build id stands for exactly these files (AST-081 FR7).
|
|
38
|
+
* @param {string} target
|
|
39
|
+
* @param {string} root - the CLI's folder in the same form, ending in `sep`
|
|
40
|
+
* @param {string} sep - the separator of that form
|
|
41
|
+
* @returns {boolean}
|
|
42
|
+
*/
|
|
43
|
+
export function isCliBuildFile(target, root, sep) {
|
|
44
|
+
return (
|
|
45
|
+
target.startsWith(root) && !target.startsWith(`${root}node_modules${sep}`)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
33
49
|
/** The package every Core lookup answers for. */
|
|
34
50
|
const CORE_PACKAGE = '@astryxdesign/core';
|
|
35
51
|
|
|
@@ -120,6 +136,19 @@ export function requireCoreDir(startDir = process.cwd()) {
|
|
|
120
136
|
);
|
|
121
137
|
}
|
|
122
138
|
|
|
139
|
+
/**
|
|
140
|
+
* The Core whose components, hooks, and docs this run reads: as
|
|
141
|
+
* {@link requireCoreDir} in a run on Core, and null in a run on another
|
|
142
|
+
* base, which reads no Core content. Each content reader treats null as no
|
|
143
|
+
* Core items and answers from the run's integrations alone.
|
|
144
|
+
*
|
|
145
|
+
* @param {string} [startDir]
|
|
146
|
+
* @returns {string | null}
|
|
147
|
+
*/
|
|
148
|
+
export function coreContentDir(startDir = process.cwd()) {
|
|
149
|
+
return currentNonCoreBase() ? null : requireCoreDir(startDir);
|
|
150
|
+
}
|
|
151
|
+
|
|
123
152
|
/**
|
|
124
153
|
* An Error carrying a stable error code, which the JSON envelope and every
|
|
125
154
|
* command's error output read the way they read an API error's.
|
|
@@ -151,6 +180,8 @@ export function findCarriedCoreDir(startDir, {fetch = false} = {}) {
|
|
|
151
180
|
* @returns {{dir: string | null, unavailable: string | null, version?: string, reason?: string}}
|
|
152
181
|
*/
|
|
153
182
|
function carriedCoreFor(startDir, fetch = false) {
|
|
183
|
+
// A run whose base is not Core never reads Core, so it never fetches one.
|
|
184
|
+
if (currentNonCoreBase()) return {dir: null, unavailable: null};
|
|
154
185
|
const carried = carriedCore({fetch: false});
|
|
155
186
|
if (!carried.dir && !fetch) return carried;
|
|
156
187
|
if (runChoice(startDir).copy === 'project') {
|
|
@@ -169,6 +200,18 @@ function carriedCoreFor(startDir, fetch = false) {
|
|
|
169
200
|
* @returns {string | null}
|
|
170
201
|
*/
|
|
171
202
|
export function findProjectCoreDir(startDir = process.cwd()) {
|
|
203
|
+
// A run whose base is not Core reads no Core, even one the project installs.
|
|
204
|
+
if (currentNonCoreBase()) return null;
|
|
205
|
+
return installedProjectCoreDir(startDir);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The project's installed @astryxdesign/core, whatever base the run reads:
|
|
210
|
+
* the lookup that decides the run's base.
|
|
211
|
+
* @param {string} [startDir]
|
|
212
|
+
* @returns {string | null}
|
|
213
|
+
*/
|
|
214
|
+
export function installedProjectCoreDir(startDir = process.cwd()) {
|
|
172
215
|
const near = findNearbyCoreDir(startDir);
|
|
173
216
|
if (near) return near;
|
|
174
217
|
// A folder deeper than that reach still belongs to the project the walk to
|
|
@@ -301,7 +344,9 @@ export function homeFolder() {
|
|
|
301
344
|
* @returns {boolean}
|
|
302
345
|
*/
|
|
303
346
|
export function climbsOut(rel) {
|
|
304
|
-
return
|
|
347
|
+
return (
|
|
348
|
+
rel === '..' || rel.startsWith('../') || rel.startsWith(`..${path.sep}`)
|
|
349
|
+
);
|
|
305
350
|
}
|
|
306
351
|
|
|
307
352
|
/**
|
|
@@ -945,9 +990,11 @@ export function discoverExternalPackages(startDir = process.cwd()) {
|
|
|
945
990
|
* List available component directories in packages/core/src.
|
|
946
991
|
* Component directories are capitalized (`Button`, `Dialog`); lowercase
|
|
947
992
|
* directories hold shared infrastructure and are never listed.
|
|
948
|
-
* @param {string} coreDir
|
|
993
|
+
* @param {string | null} coreDir null in a run that reads no Core
|
|
994
|
+
* @returns {string[]}
|
|
949
995
|
*/
|
|
950
996
|
export function listComponents(coreDir) {
|
|
997
|
+
if (coreDir == null) return [];
|
|
951
998
|
const srcDir = path.join(coreDir, 'src');
|
|
952
999
|
if (!fs.existsSync(srcDir)) return [];
|
|
953
1000
|
|
|
@@ -158,6 +158,10 @@ export type LoadedIntegration = {
|
|
|
158
158
|
light: string;
|
|
159
159
|
dark?: string;
|
|
160
160
|
} | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* present when the package is a base
|
|
163
|
+
*/
|
|
164
|
+
base?: import("../../authoring/integration/type").BaseDeclaration | undefined;
|
|
161
165
|
agentDocs?: {
|
|
162
166
|
append?: readonly string[];
|
|
163
167
|
} | undefined;
|
|
@@ -39,6 +39,7 @@ export {findManifestPaths, MANIFEST_BASENAMES};
|
|
|
39
39
|
import {parseGapReportHandler} from '../../authoring/gap-report/parse.mjs';
|
|
40
40
|
import {parseDiscoverSource} from '../../authoring/discover/parse.mjs';
|
|
41
41
|
import {resolveProviders} from './provider-resolution.mjs';
|
|
42
|
+
import {unknownCapabilityKeys} from '../bases/steps.mjs';
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
45
|
* A fully-resolved, loaded integration. Identity (`name`, `version`) comes from
|
|
@@ -63,6 +64,8 @@ import {resolveProviders} from './provider-resolution.mjs';
|
|
|
63
64
|
* @property {string} [issuesUrl]
|
|
64
65
|
* @property {{light: string, dark?: string}} [logo] the manifest's logo
|
|
65
66
|
* paths as written, relative to the package root
|
|
67
|
+
* @property {import('../../authoring/integration/type').BaseDeclaration} [base]
|
|
68
|
+
* present when the package is a base
|
|
66
69
|
* @property {{append?: readonly string[]}} [agentDocs]
|
|
67
70
|
* @property {string} [cliCommand] the command this package's users run the
|
|
68
71
|
* CLI with; read by the picker in foundation/env (see cli-command.mjs)
|
|
@@ -276,7 +279,7 @@ export async function loadManifest(
|
|
|
276
279
|
...(agentDocs == null ? {} : {agentDocs}),
|
|
277
280
|
...(cliCommand == null ? {} : {cliCommand}),
|
|
278
281
|
},
|
|
279
|
-
unknownKeys: unknownIntegrationKeys(raw),
|
|
282
|
+
unknownKeys: [...unknownIntegrationKeys(raw), ...unknownCapabilityKeys(raw)],
|
|
280
283
|
ignoredFields: ignoredIntegrationFields(raw),
|
|
281
284
|
declaredKeys:
|
|
282
285
|
raw != null && typeof raw === 'object' ? Object.keys(raw) : [],
|
|
@@ -517,6 +520,7 @@ export async function loadLocalIntegration(packageDir, {fresh = false} = {}) {
|
|
|
517
520
|
logo: manifest.logo,
|
|
518
521
|
agentDocs: manifest.agentDocs,
|
|
519
522
|
cliCommand: manifest.cliCommand,
|
|
523
|
+
base: manifest.base,
|
|
520
524
|
__cliCommandError: cliCommandError,
|
|
521
525
|
__agentDocsError: agentDocsError,
|
|
522
526
|
__unknownKeys: unknownKeys,
|
|
@@ -651,6 +655,7 @@ export async function loadIntegrations(
|
|
|
651
655
|
logo: manifest.logo,
|
|
652
656
|
agentDocs: manifest.agentDocs,
|
|
653
657
|
cliCommand: manifest.cliCommand,
|
|
658
|
+
base: manifest.base,
|
|
654
659
|
__cliCommandError: cliCommandError,
|
|
655
660
|
__agentDocsError: agentDocsError,
|
|
656
661
|
__unknownKeys: unknownKeys,
|
|
@@ -87,6 +87,13 @@ export function matchedVersionOf(facts: import("./project.mjs").ReleaseFacts): {
|
|
|
87
87
|
spec: string;
|
|
88
88
|
} | null;
|
|
89
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* The one version a declared dependency pins, such as `0.7.16`, `=0.7.16` or
|
|
92
|
+
* `v0.7.16`; null for a range or nothing.
|
|
93
|
+
* @param {string | null | undefined} spec
|
|
94
|
+
* @returns {string | null}
|
|
95
|
+
*/
|
|
96
|
+
export function pinnedVersion(spec: string | null | undefined): string | null;
|
|
90
97
|
/**
|
|
91
98
|
* Choose who answers a run started by `self` in `cwd`.
|
|
92
99
|
*
|
|
@@ -424,14 +424,28 @@ export function matchedVersionOf(facts) {
|
|
|
424
424
|
return {version: null, range: null};
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
+
/**
|
|
428
|
+
* The one version a declared dependency pins, such as `0.7.16`, `=0.7.16` or
|
|
429
|
+
* `v0.7.16`; null for a range or nothing.
|
|
430
|
+
* @param {string | null | undefined} spec
|
|
431
|
+
* @returns {string | null}
|
|
432
|
+
*/
|
|
433
|
+
export function pinnedVersion(spec) {
|
|
434
|
+
const trimmed = String(spec ?? '')
|
|
435
|
+
.trim()
|
|
436
|
+
.replace(/^=/, '')
|
|
437
|
+
.replace(/^v/, '');
|
|
438
|
+
return isReleaseVersion(trimmed) ? trimmed : null;
|
|
439
|
+
}
|
|
440
|
+
|
|
427
441
|
/**
|
|
428
442
|
* @param {string} name
|
|
429
443
|
* @param {string} spec
|
|
430
444
|
* @returns {{version: string | null, range: {name: string, spec: string} | null}}
|
|
431
445
|
*/
|
|
432
446
|
function exactOrRange(name, spec) {
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
447
|
+
const version = pinnedVersion(spec);
|
|
448
|
+
if (version) return {version, range: null};
|
|
435
449
|
return {version: null, range: {name, spec}};
|
|
436
450
|
}
|
|
437
451
|
|
|
@@ -91,6 +91,18 @@ export function globalBehind({ self, stateDir }: {
|
|
|
91
91
|
};
|
|
92
92
|
stateDir?: string;
|
|
93
93
|
}): GlobalBehind | null;
|
|
94
|
+
/**
|
|
95
|
+
* The command that adds Astryx packages at `version` to the project at
|
|
96
|
+
* `root`, with its package manager. A project that pins its Core (or, with no
|
|
97
|
+
* Core, its CLI) to one version, as a starter does, keeps its packages
|
|
98
|
+
* pinned: npm saves a version it adds as a range unless it is told to save it
|
|
99
|
+
* exactly, so the command carries that flag when `version` is one version. A
|
|
100
|
+
* range is saved as the range.
|
|
101
|
+
* @param {string} root
|
|
102
|
+
* @param {string | null} [version]
|
|
103
|
+
* @returns {string}
|
|
104
|
+
*/
|
|
105
|
+
export function addVerbFor(root: string, version?: string | null): string;
|
|
94
106
|
/**
|
|
95
107
|
* The command that adds a package to the project of a run in `cwd`, with the
|
|
96
108
|
* project's package manager (spec AST-081 FR12). Null when `cwd` belongs to
|
|
@@ -132,6 +144,20 @@ export function installFolder(cwd: string): {
|
|
|
132
144
|
dir: string;
|
|
133
145
|
moved: boolean;
|
|
134
146
|
} | null;
|
|
147
|
+
/**
|
|
148
|
+
* The command that installs the project's dependencies, when the project a
|
|
149
|
+
* run in `cwd` belongs to lists `name` among the packages its install gets:
|
|
150
|
+
* a `name` that is not installed then comes from that install, at the version
|
|
151
|
+
* the project lists, as in a fresh clone, and adding it again would replace
|
|
152
|
+
* that version. Null when the project lists no `name`, when `cwd` belongs to
|
|
153
|
+
* no project, and in a folder inside the project whose package.json is not
|
|
154
|
+
* the project's (see {@link installFolder}), where an install would install
|
|
155
|
+
* that folder's own packages.
|
|
156
|
+
* @param {string} cwd
|
|
157
|
+
* @param {string} name
|
|
158
|
+
* @returns {string | null}
|
|
159
|
+
*/
|
|
160
|
+
export function listedPackageInstall(cwd: string, name: string): string | null;
|
|
135
161
|
/**
|
|
136
162
|
* The release of the project at `dir`, for a command that runs in its folder
|
|
137
163
|
* from a folder below it: its own CLI's version when it installs one, else
|