@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,295 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Which base a run reads, and which integrations build on it.
|
|
5
|
+
* @input the requested `--base`, the project's loaded integrations, and
|
|
6
|
+
* whether the project installs Core
|
|
7
|
+
* @output the run's base resolution, and the integrations that contribute
|
|
8
|
+
* to it
|
|
9
|
+
* @position foundation/bases — read by Project.load, the requirement check,
|
|
10
|
+
* help, the manifest, and `meta.answeredBy`
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import * as fs from 'node:fs';
|
|
14
|
+
import * as path from 'node:path';
|
|
15
|
+
import {ERROR_CODES} from '../response/error-codes.mjs';
|
|
16
|
+
import {installedProjectCoreDir} from '../fs/paths.mjs';
|
|
17
|
+
import {resolveInstalledPackageDir} from '../integrations/installed-package.mjs';
|
|
18
|
+
import {CORE_BASE_NAME, coreBase} from './core.mjs';
|
|
19
|
+
import {BASE_CAPABILITIES} from './steps.mjs';
|
|
20
|
+
import {registerRunBaseResolver} from './state.mjs';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The one base a run reads.
|
|
24
|
+
* @typedef {object} ActiveBase
|
|
25
|
+
* @property {string} name the package name
|
|
26
|
+
* @property {boolean} core true for Core
|
|
27
|
+
* @property {string | null} dir the package folder; null for Core, whose
|
|
28
|
+
* steps the CLI performs itself
|
|
29
|
+
* @property {string | null} version the package version, when known
|
|
30
|
+
* @property {Record<string, string>} adapters capability to module path,
|
|
31
|
+
* relative to `dir`, for the capabilities this CLI knows
|
|
32
|
+
* @property {readonly string[]} steps the steps the base serves
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @typedef {{ok: true, base: ActiveBase}
|
|
37
|
+
* | {ok: false, code: string, message: string, base: null}} BaseResolution
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/** @typedef {import('../integrations/integrations.mjs').LoadedIntegration} LoadedIntegration */
|
|
41
|
+
|
|
42
|
+
/** @type {string | null} */
|
|
43
|
+
let requested = null;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Set the package `--base` names for this run; null when it names none.
|
|
47
|
+
* @param {string | null | undefined} name
|
|
48
|
+
*/
|
|
49
|
+
export function setRequestedBase(name) {
|
|
50
|
+
requested = typeof name === 'string' && name.length > 0 ? name : null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** @returns {string | null} */
|
|
54
|
+
export function requestedBase() {
|
|
55
|
+
return requested;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @type {Map<string, {integrations: LoadedIntegration[], failedToLoad: Array<{name: string, error: string}>}>} */
|
|
59
|
+
const candidatesByDir = new Map();
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Keep the integrations a project load found, before the base filter, so
|
|
63
|
+
* the requirement check and help resolve the base without loading the
|
|
64
|
+
* project again.
|
|
65
|
+
* @param {string} cwd
|
|
66
|
+
* @param {LoadedIntegration[]} integrations
|
|
67
|
+
* @param {Array<{name: string, error: string}>} [failedToLoad] packages that
|
|
68
|
+
* failed to load, with their load errors
|
|
69
|
+
*/
|
|
70
|
+
export function recordBaseCandidates(cwd, integrations, failedToLoad = []) {
|
|
71
|
+
candidatesByDir.set(path.resolve(cwd), {integrations, failedToLoad});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Forget every recorded project. For tests. */
|
|
75
|
+
export function _resetBases() {
|
|
76
|
+
candidatesByDir.clear();
|
|
77
|
+
requested = null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The base the run in `cwd` reads, from the integrations its last project
|
|
82
|
+
* load found, or from none when no project loaded there.
|
|
83
|
+
* @param {string} [cwd]
|
|
84
|
+
* @returns {BaseResolution}
|
|
85
|
+
*/
|
|
86
|
+
export function runBase(cwd = process.cwd()) {
|
|
87
|
+
const recorded = candidatesByDir.get(path.resolve(cwd));
|
|
88
|
+
return resolveBase({
|
|
89
|
+
cwd,
|
|
90
|
+
integrations: recorded?.integrations ?? [],
|
|
91
|
+
failedToLoad: recorded?.failedToLoad ?? [],
|
|
92
|
+
requested,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Does this loaded integration declare `base`?
|
|
98
|
+
* @param {LoadedIntegration} integration
|
|
99
|
+
* @returns {boolean}
|
|
100
|
+
*/
|
|
101
|
+
export function isBaseIntegration(integration) {
|
|
102
|
+
return integration.base != null && integration.__loadError == null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* A base integration as the run's base.
|
|
107
|
+
* @param {LoadedIntegration} integration
|
|
108
|
+
* @returns {ActiveBase}
|
|
109
|
+
*/
|
|
110
|
+
export function baseOf(integration) {
|
|
111
|
+
/** @type {Record<string, string>} */
|
|
112
|
+
const adapters = {};
|
|
113
|
+
for (const [capability, file] of Object.entries(
|
|
114
|
+
integration.base?.adapters ?? {},
|
|
115
|
+
)) {
|
|
116
|
+
if (
|
|
117
|
+
/** @type {readonly string[]} */ (BASE_CAPABILITIES).includes(capability)
|
|
118
|
+
) {
|
|
119
|
+
adapters[capability] = file;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
name: integration.name,
|
|
124
|
+
core: false,
|
|
125
|
+
dir: integration.__packageDir,
|
|
126
|
+
version: integration.version ?? null,
|
|
127
|
+
adapters,
|
|
128
|
+
// No command calls an adapter step, so a base other than Core serves no
|
|
129
|
+
// step, whatever its adapters declare. Help hides each command that needs
|
|
130
|
+
// one, and a run refuses it.
|
|
131
|
+
steps: [],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The bases an integration builds on: each base its package.json lists in
|
|
137
|
+
* `peerDependencies`; with none, a base builds on no base and any other
|
|
138
|
+
* integration builds on Core.
|
|
139
|
+
* @param {LoadedIntegration} integration
|
|
140
|
+
* @param {ReadonlySet<string>} baseNames every base the run knows, Core
|
|
141
|
+
* included
|
|
142
|
+
* @returns {string[]}
|
|
143
|
+
*/
|
|
144
|
+
export function buildsOn(integration, baseNames) {
|
|
145
|
+
let peers = {};
|
|
146
|
+
try {
|
|
147
|
+
peers =
|
|
148
|
+
JSON.parse(
|
|
149
|
+
fs.readFileSync(
|
|
150
|
+
path.join(integration.__packageDir, 'package.json'),
|
|
151
|
+
'utf8',
|
|
152
|
+
),
|
|
153
|
+
).peerDependencies ?? {};
|
|
154
|
+
} catch {
|
|
155
|
+
// A package.json that cannot be read lists no peers.
|
|
156
|
+
}
|
|
157
|
+
const on = Object.keys(peers).filter(
|
|
158
|
+
name => baseNames.has(name) && name !== integration.name,
|
|
159
|
+
);
|
|
160
|
+
if (on.length > 0) return on;
|
|
161
|
+
// A base that lists no other base builds on none: it contributes only to a
|
|
162
|
+
// run on itself.
|
|
163
|
+
return isBaseIntegration(integration) ? [] : [CORE_BASE_NAME];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @param {ActiveBase} base
|
|
168
|
+
* @returns {BaseResolution}
|
|
169
|
+
*/
|
|
170
|
+
function found(base) {
|
|
171
|
+
return {ok: true, base};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @param {string} code
|
|
176
|
+
* @param {string} message
|
|
177
|
+
* @returns {BaseResolution}
|
|
178
|
+
*/
|
|
179
|
+
function failed(code, message) {
|
|
180
|
+
return {ok: false, code, message, base: null};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @param {string[]} names
|
|
185
|
+
* @returns {BaseResolution}
|
|
186
|
+
*/
|
|
187
|
+
function ambiguous(names) {
|
|
188
|
+
return failed(
|
|
189
|
+
ERROR_CODES.ERR_BASE_AMBIGUOUS,
|
|
190
|
+
`This project installs more than one base and no Core: ${names.join(', ')}. Pick one with ${names.map(name => `--base ${name}`).join(' or ')}.`,
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Resolve the run's base: `--base`, then the base an integration package
|
|
196
|
+
* builds on, then the project's Core, then the project's one installed
|
|
197
|
+
* base, then Core.
|
|
198
|
+
* @param {{
|
|
199
|
+
* cwd: string,
|
|
200
|
+
* integrations: LoadedIntegration[],
|
|
201
|
+
* requested?: string | null,
|
|
202
|
+
* failedToLoad?: Array<{name: string, error: string}>,
|
|
203
|
+
* projectHasCore?: () => boolean,
|
|
204
|
+
* }} input
|
|
205
|
+
* @returns {BaseResolution}
|
|
206
|
+
*/
|
|
207
|
+
export function resolveBase({
|
|
208
|
+
cwd,
|
|
209
|
+
integrations,
|
|
210
|
+
requested: name = null,
|
|
211
|
+
failedToLoad = [],
|
|
212
|
+
projectHasCore = () => installedProjectCoreDir(cwd) != null,
|
|
213
|
+
}) {
|
|
214
|
+
const bases = integrations.filter(isBaseIntegration);
|
|
215
|
+
if (name != null) {
|
|
216
|
+
if (name === CORE_BASE_NAME) return found(coreBase());
|
|
217
|
+
const hit = bases.find(integration => integration.name === name);
|
|
218
|
+
if (hit) return found(baseOf(hit));
|
|
219
|
+
const broken =
|
|
220
|
+
integrations.find(
|
|
221
|
+
integration => integration.name === name && integration.__loadError != null,
|
|
222
|
+
)?.__loadError ?? failedToLoad.find(entry => entry.name === name)?.error;
|
|
223
|
+
if (broken != null) {
|
|
224
|
+
return failed(
|
|
225
|
+
ERROR_CODES.ERR_BASE_NOT_FOUND,
|
|
226
|
+
`--base ${name}: its integration manifest does not load: ${broken}`,
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
const installed =
|
|
230
|
+
integrations.some(integration => integration.name === name) ||
|
|
231
|
+
resolveInstalledPackageDir(name, cwd) != null;
|
|
232
|
+
return failed(
|
|
233
|
+
ERROR_CODES.ERR_BASE_NOT_FOUND,
|
|
234
|
+
installed
|
|
235
|
+
? `--base ${name}: the package is installed, but its integration manifest does not declare base.`
|
|
236
|
+
: `--base ${name}: the package is not installed in this project, in the package set that serves this run, or for this computer.`,
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
// With no base declared anywhere, Core answers, as it always has, and
|
|
240
|
+
// nothing more is read.
|
|
241
|
+
if (bases.length === 0) return found(coreBase());
|
|
242
|
+
|
|
243
|
+
const baseNames = new Set([CORE_BASE_NAME, ...bases.map(b => b.name)]);
|
|
244
|
+
const local = integrations.find(
|
|
245
|
+
integration => integration.__local && integration.__loadError == null,
|
|
246
|
+
);
|
|
247
|
+
if (local) {
|
|
248
|
+
if (isBaseIntegration(local)) return found(baseOf(local));
|
|
249
|
+
const on = buildsOn(local, baseNames);
|
|
250
|
+
if (on.includes(CORE_BASE_NAME)) return found(coreBase());
|
|
251
|
+
if (on.length === 1) {
|
|
252
|
+
const hit = bases.find(integration => integration.name === on[0]);
|
|
253
|
+
if (hit) return found(baseOf(hit));
|
|
254
|
+
}
|
|
255
|
+
if (on.length > 1) return ambiguous(on);
|
|
256
|
+
}
|
|
257
|
+
if (projectHasCore()) return found(coreBase());
|
|
258
|
+
const projectBases = bases.filter(integration => !integration.__computer);
|
|
259
|
+
if (projectBases.length === 1) return found(baseOf(projectBases[0]));
|
|
260
|
+
if (projectBases.length > 1) {
|
|
261
|
+
return ambiguous(projectBases.map(integration => integration.name));
|
|
262
|
+
}
|
|
263
|
+
return found(coreBase());
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Split the loaded integrations into the ones that contribute to a run on
|
|
268
|
+
* `base` and the ones left out: an integration contributes when it is that
|
|
269
|
+
* base or builds on it. With no base declared anywhere, every integration
|
|
270
|
+
* builds on Core and none is left out.
|
|
271
|
+
* @param {LoadedIntegration[]} integrations
|
|
272
|
+
* @param {ActiveBase} base
|
|
273
|
+
* @returns {{kept: LoadedIntegration[], leftOut: Array<{integration: LoadedIntegration, buildsOn: string[]}>}}
|
|
274
|
+
*/
|
|
275
|
+
export function splitForBase(integrations, base) {
|
|
276
|
+
const bases = integrations.filter(isBaseIntegration);
|
|
277
|
+
if (bases.length === 0 && base.core) return {kept: integrations, leftOut: []};
|
|
278
|
+
const baseNames = new Set([CORE_BASE_NAME, ...bases.map(b => b.name)]);
|
|
279
|
+
/** @type {LoadedIntegration[]} */
|
|
280
|
+
const kept = [];
|
|
281
|
+
/** @type {Array<{integration: LoadedIntegration, buildsOn: string[]}>} */
|
|
282
|
+
const leftOut = [];
|
|
283
|
+
for (const integration of integrations) {
|
|
284
|
+
if (integration.name === base.name) {
|
|
285
|
+
kept.push(integration);
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
const on = buildsOn(integration, baseNames);
|
|
289
|
+
if (on.includes(base.name)) kept.push(integration);
|
|
290
|
+
else leftOut.push({integration, buildsOn: on});
|
|
291
|
+
}
|
|
292
|
+
return {kept, leftOut};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
registerRunBaseResolver(() => runBase());
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
* Register the function that resolves the run's base.
|
|
6
|
+
* @param {() => {ok: boolean, base: {name: string, core: boolean, version: string | null} | null}} resolve
|
|
7
|
+
*/
|
|
8
|
+
export function registerRunBaseResolver(resolve: () => {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
base: {
|
|
11
|
+
name: string;
|
|
12
|
+
core: boolean;
|
|
13
|
+
version: string | null;
|
|
14
|
+
} | null;
|
|
15
|
+
}): void;
|
|
16
|
+
/**
|
|
17
|
+
* The run's base when it resolves to a base other than Core; null when the
|
|
18
|
+
* run reads Core or its base does not resolve.
|
|
19
|
+
* @returns {{name: string, version: string | null} | null}
|
|
20
|
+
*/
|
|
21
|
+
export function currentNonCoreBase(): {
|
|
22
|
+
name: string;
|
|
23
|
+
version: string | null;
|
|
24
|
+
} | null;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The run's base, readable by modules that load before the base
|
|
5
|
+
* resolver. It imports nothing, so the release modules the bin reads first
|
|
6
|
+
* can ask for the base and pay nothing for it.
|
|
7
|
+
* @input the resolver, which registers itself when it loads
|
|
8
|
+
* @output currentRunBase()
|
|
9
|
+
* @position foundation/bases — no resolver loaded means no project loaded,
|
|
10
|
+
* and Core answers
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** @type {(() => {ok: boolean, base: {name: string, core: boolean, version: string | null} | null}) | null} */
|
|
14
|
+
let resolver = null;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Register the function that resolves the run's base.
|
|
18
|
+
* @param {() => {ok: boolean, base: {name: string, core: boolean, version: string | null} | null}} resolve
|
|
19
|
+
*/
|
|
20
|
+
export function registerRunBaseResolver(resolve) {
|
|
21
|
+
resolver = resolve;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** True while the resolver runs, so a lookup it makes reads no base. */
|
|
25
|
+
let resolving = false;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The run's base when it resolves to a base other than Core; null when the
|
|
29
|
+
* run reads Core or its base does not resolve.
|
|
30
|
+
* @returns {{name: string, version: string | null} | null}
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
export function currentNonCoreBase() {
|
|
34
|
+
if (resolver == null || resolving) return null;
|
|
35
|
+
resolving = true;
|
|
36
|
+
try {
|
|
37
|
+
const run = resolver();
|
|
38
|
+
return run.ok && run.base && !run.base.core
|
|
39
|
+
? {name: run.base.name, version: run.base.version}
|
|
40
|
+
: null;
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
} finally {
|
|
44
|
+
resolving = false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 capability a step belongs to.
|
|
6
|
+
* @param {string} step
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
9
|
+
export function capabilityOf(step: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} value
|
|
12
|
+
* @returns {value is import('../../authoring/integration/type').BaseStep}
|
|
13
|
+
*/
|
|
14
|
+
export function isBaseStep(value: string): value is import("../../authoring/integration/type").BaseStep;
|
|
15
|
+
/**
|
|
16
|
+
* The function name an adapter module exports for a step.
|
|
17
|
+
* @param {string} step
|
|
18
|
+
* @returns {string}
|
|
19
|
+
*/
|
|
20
|
+
export function exportOf(step: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* The keys of a raw integration manifest's `base.adapters` that name no
|
|
23
|
+
* capability this CLI knows, as `base.adapters.<capability>`. Such an adapter
|
|
24
|
+
* is ignored, so a newer base still loads, and a typo is reported the way an
|
|
25
|
+
* unknown manifest key is.
|
|
26
|
+
* @param {unknown} manifest
|
|
27
|
+
* @returns {string[]}
|
|
28
|
+
*/
|
|
29
|
+
export function unknownCapabilityKeys(manifest: unknown): string[];
|
|
30
|
+
/**
|
|
31
|
+
* @file The closed, append-only list of platform steps a base can serve.
|
|
32
|
+
* @input nothing
|
|
33
|
+
* @output BASE_STEPS, BASE_CAPABILITIES, and helpers that read a step name
|
|
34
|
+
* or a manifest's adapters
|
|
35
|
+
* @position foundation/bases — the step vocabulary that base declarations,
|
|
36
|
+
* the requirement check, and help share. The authoring schemas check only
|
|
37
|
+
* a step's shape; a test holds every command declaration to this list.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Every step, as `<capability>.<step>`. A shipped step keeps its inputs,
|
|
41
|
+
* outputs, and meaning.
|
|
42
|
+
* @type {readonly ['themes.targets', ...import('../../authoring/integration/type').BaseStep[]]}
|
|
43
|
+
*/
|
|
44
|
+
export const BASE_STEPS: readonly ["themes.targets", ...import("../../authoring/integration/type").BaseStep[]];
|
|
45
|
+
/**
|
|
46
|
+
* The capabilities a base declares one adapter for, in list order.
|
|
47
|
+
* @type {readonly import('../../authoring/integration/type').BaseCapability[]}
|
|
48
|
+
*/
|
|
49
|
+
export const BASE_CAPABILITIES: readonly import("../../authoring/integration/type").BaseCapability[];
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The closed, append-only list of platform steps a base can serve.
|
|
5
|
+
* @input nothing
|
|
6
|
+
* @output BASE_STEPS, BASE_CAPABILITIES, and helpers that read a step name
|
|
7
|
+
* or a manifest's adapters
|
|
8
|
+
* @position foundation/bases — the step vocabulary that base declarations,
|
|
9
|
+
* the requirement check, and help share. The authoring schemas check only
|
|
10
|
+
* a step's shape; a test holds every command declaration to this list.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Every step, as `<capability>.<step>`. A shipped step keeps its inputs,
|
|
15
|
+
* outputs, and meaning.
|
|
16
|
+
* @type {readonly ['themes.targets', ...import('../../authoring/integration/type').BaseStep[]]}
|
|
17
|
+
*/
|
|
18
|
+
export const BASE_STEPS = Object.freeze([
|
|
19
|
+
'themes.targets',
|
|
20
|
+
'themes.compile',
|
|
21
|
+
'themes.appModule',
|
|
22
|
+
'themes.template',
|
|
23
|
+
'themes.scaffold',
|
|
24
|
+
'themes.checks',
|
|
25
|
+
'templates.skeleton',
|
|
26
|
+
'templates.standalonePage',
|
|
27
|
+
'render.page',
|
|
28
|
+
'render.reverse',
|
|
29
|
+
'icons.appModule',
|
|
30
|
+
'setup.guide',
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The capability a step belongs to.
|
|
35
|
+
* @param {string} step
|
|
36
|
+
* @returns {string}
|
|
37
|
+
*/
|
|
38
|
+
export function capabilityOf(step) {
|
|
39
|
+
return step.split('.')[0];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The capabilities a base declares one adapter for, in list order.
|
|
44
|
+
* @type {readonly import('../../authoring/integration/type').BaseCapability[]}
|
|
45
|
+
*/
|
|
46
|
+
export const BASE_CAPABILITIES = Object.freeze(
|
|
47
|
+
/** @type {import('../../authoring/integration/type').BaseCapability[]} */ ([
|
|
48
|
+
...new Set(BASE_STEPS.map(capabilityOf)),
|
|
49
|
+
]),
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @param {string} value
|
|
54
|
+
* @returns {value is import('../../authoring/integration/type').BaseStep}
|
|
55
|
+
*/
|
|
56
|
+
export function isBaseStep(value) {
|
|
57
|
+
return /** @type {readonly string[]} */ (BASE_STEPS).includes(value);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The function name an adapter module exports for a step.
|
|
62
|
+
* @param {string} step
|
|
63
|
+
* @returns {string}
|
|
64
|
+
*/
|
|
65
|
+
export function exportOf(step) {
|
|
66
|
+
return step.slice(step.indexOf('.') + 1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The keys of a raw integration manifest's `base.adapters` that name no
|
|
71
|
+
* capability this CLI knows, as `base.adapters.<capability>`. Such an adapter
|
|
72
|
+
* is ignored, so a newer base still loads, and a typo is reported the way an
|
|
73
|
+
* unknown manifest key is.
|
|
74
|
+
* @param {unknown} manifest
|
|
75
|
+
* @returns {string[]}
|
|
76
|
+
*/
|
|
77
|
+
export function unknownCapabilityKeys(manifest) {
|
|
78
|
+
if (manifest == null || typeof manifest !== 'object') return [];
|
|
79
|
+
const adapters = /** @type {{base?: {adapters?: unknown}}} */ (manifest).base
|
|
80
|
+
?.adapters;
|
|
81
|
+
if (adapters == null || typeof adapters !== 'object') return [];
|
|
82
|
+
return Object.keys(adapters)
|
|
83
|
+
.filter(
|
|
84
|
+
capability =>
|
|
85
|
+
!(/** @type {readonly string[]} */ (BASE_CAPABILITIES)).includes(capability),
|
|
86
|
+
)
|
|
87
|
+
.map(capability => `base.adapters.${capability}`);
|
|
88
|
+
}
|
|
@@ -107,6 +107,20 @@ export class Project {
|
|
|
107
107
|
* @returns {import('../integrations/integrations.mjs').LoadedIntegration[]}
|
|
108
108
|
*/
|
|
109
109
|
get loadedIntegrations(): import("../integrations/integrations.mjs").LoadedIntegration[];
|
|
110
|
+
/**
|
|
111
|
+
* The base this project's run reads, or the reason it does not resolve.
|
|
112
|
+
* @returns {import('../bases/resolve.mjs').BaseResolution}
|
|
113
|
+
*/
|
|
114
|
+
get base(): import("../bases/resolve.mjs").BaseResolution;
|
|
115
|
+
/**
|
|
116
|
+
* Installed integrations that do not build on the run's base, with the
|
|
117
|
+
* bases each builds on. They contribute nothing to the run.
|
|
118
|
+
* @returns {Array<{integration: import('../integrations/integrations.mjs').LoadedIntegration, buildsOn: string[]}>}
|
|
119
|
+
*/
|
|
120
|
+
get integrationsLeftOut(): Array<{
|
|
121
|
+
integration: import("../integrations/integrations.mjs").LoadedIntegration;
|
|
122
|
+
buildsOn: string[];
|
|
123
|
+
}>;
|
|
110
124
|
/** @returns {string} */
|
|
111
125
|
get cwd(): string;
|
|
112
126
|
/**
|
|
@@ -57,6 +57,13 @@ import {cliVersion} from '../release/run-context.mjs';
|
|
|
57
57
|
import {isGlobalCopy} from '../release/choose.mjs';
|
|
58
58
|
import {astryxCommandsOnSearchPath} from '../env/search-path.mjs';
|
|
59
59
|
import {resolveProviders} from '../integrations/provider-resolution.mjs';
|
|
60
|
+
import {
|
|
61
|
+
recordBaseCandidates,
|
|
62
|
+
requestedBase,
|
|
63
|
+
resolveBase,
|
|
64
|
+
splitForBase,
|
|
65
|
+
} from '../bases/resolve.mjs';
|
|
66
|
+
import {coreBase} from '../bases/core.mjs';
|
|
60
67
|
import {
|
|
61
68
|
setProject as setDebugProject,
|
|
62
69
|
setEventHandler as setDebugEventHandler,
|
|
@@ -114,6 +121,7 @@ import {
|
|
|
114
121
|
cacheKey,
|
|
115
122
|
configContentHash,
|
|
116
123
|
} from './config-cache.mjs';
|
|
124
|
+
import {currentNonCoreBase} from '../bases/state.mjs';
|
|
117
125
|
|
|
118
126
|
/** Issues are plain records, kept as they are. */
|
|
119
127
|
const ISSUES_CODEC = {
|
|
@@ -401,6 +409,12 @@ function inheritsIntegrationDebug(projectDir) {
|
|
|
401
409
|
*/
|
|
402
410
|
const PROVIDER_LEDGERS = new WeakMap();
|
|
403
411
|
|
|
412
|
+
/**
|
|
413
|
+
* The base each project load resolved, and the integrations it left out.
|
|
414
|
+
* @type {WeakMap<Project, {resolution: import('../bases/resolve.mjs').BaseResolution, leftOut: Array<{integration: import('../integrations/integrations.mjs').LoadedIntegration, buildsOn: string[]}>}>}
|
|
415
|
+
*/
|
|
416
|
+
const BASES = new WeakMap();
|
|
417
|
+
|
|
404
418
|
/**
|
|
405
419
|
* The provider ledger a Project resolved at load: one outcome for every
|
|
406
420
|
* package directory configured, autolinked, or authored. Internal: upgrade
|
|
@@ -603,6 +617,38 @@ export class Project {
|
|
|
603
617
|
: []),
|
|
604
618
|
]);
|
|
605
619
|
loadedIntegrations = resolution.integrations;
|
|
620
|
+
// The run reads one base. Only the integrations that are that base or
|
|
621
|
+
// build on it contribute; the rest are kept aside for the commands that
|
|
622
|
+
// list them.
|
|
623
|
+
// A package that failed to load is no base, but `--base` naming it says
|
|
624
|
+
// why: the ledger keeps its load error.
|
|
625
|
+
// Each is named both as the project reached it and by its own package
|
|
626
|
+
// name, which differ for an npm alias.
|
|
627
|
+
const failedToLoad = [...resolution.ledger.values()].flatMap(entry => {
|
|
628
|
+
if (entry.outcome !== 'load-failed' || entry.error == null) return [];
|
|
629
|
+
const error = entry.error;
|
|
630
|
+
const names = new Set([
|
|
631
|
+
entry.candidate.spec ?? entry.label,
|
|
632
|
+
readPackageJson(entry.key)?.name,
|
|
633
|
+
]);
|
|
634
|
+
return [...names].flatMap(name =>
|
|
635
|
+
typeof name === 'string' ? [{name, error}] : [],
|
|
636
|
+
);
|
|
637
|
+
});
|
|
638
|
+
recordBaseCandidates(cwd, loadedIntegrations, failedToLoad);
|
|
639
|
+
const base = resolveBase({
|
|
640
|
+
cwd,
|
|
641
|
+
integrations: loadedIntegrations,
|
|
642
|
+
requested: requestedBase(),
|
|
643
|
+
failedToLoad,
|
|
644
|
+
});
|
|
645
|
+
/** @type {Array<{integration: import('../integrations/integrations.mjs').LoadedIntegration, buildsOn: string[]}>} */
|
|
646
|
+
let leftOut = [];
|
|
647
|
+
if (base.ok) {
|
|
648
|
+
const split = splitForBase(loadedIntegrations, base.base);
|
|
649
|
+
loadedIntegrations = split.kept;
|
|
650
|
+
leftOut = split.leftOut;
|
|
651
|
+
}
|
|
606
652
|
// A hosted run returns each package it resolved (cli-surface INV30).
|
|
607
653
|
recordResolvedIntegrations(loadedIntegrations);
|
|
608
654
|
// The picker (getCliInvocation) is synchronous, so the commands these
|
|
@@ -650,6 +696,7 @@ export class Project {
|
|
|
650
696
|
});
|
|
651
697
|
PROVIDER_LEDGERS.set(project, resolution.ledger);
|
|
652
698
|
LAST_LOADED.set(path.resolve(cwd), {project, run: hostedRun()});
|
|
699
|
+
BASES.set(project, {resolution: base, leftOut});
|
|
653
700
|
return project;
|
|
654
701
|
}
|
|
655
702
|
|
|
@@ -694,6 +741,23 @@ export class Project {
|
|
|
694
741
|
return this.#loadedIntegrations;
|
|
695
742
|
}
|
|
696
743
|
|
|
744
|
+
/**
|
|
745
|
+
* The base this project's run reads, or the reason it does not resolve.
|
|
746
|
+
* @returns {import('../bases/resolve.mjs').BaseResolution}
|
|
747
|
+
*/
|
|
748
|
+
get base() {
|
|
749
|
+
return BASES.get(this)?.resolution ?? {ok: true, base: coreBase()};
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Installed integrations that do not build on the run's base, with the
|
|
754
|
+
* bases each builds on. They contribute nothing to the run.
|
|
755
|
+
* @returns {Array<{integration: import('../integrations/integrations.mjs').LoadedIntegration, buildsOn: string[]}>}
|
|
756
|
+
*/
|
|
757
|
+
get integrationsLeftOut() {
|
|
758
|
+
return BASES.get(this)?.leftOut ?? [];
|
|
759
|
+
}
|
|
760
|
+
|
|
697
761
|
/** @returns {string} */
|
|
698
762
|
get cwd() {
|
|
699
763
|
return this.#cwd;
|
|
@@ -1274,7 +1338,10 @@ export class Project {
|
|
|
1274
1338
|
*/
|
|
1275
1339
|
async codemods(fromVersion, toVersion) {
|
|
1276
1340
|
return this.#memo(`codemods:${fromVersion}..${toVersion}`, async () => {
|
|
1277
|
-
|
|
1341
|
+
// Core's codemods ship in the CLI for Core: none in a run on another base.
|
|
1342
|
+
const core = currentNonCoreBase()
|
|
1343
|
+
? []
|
|
1344
|
+
: await getTransformsBetween(fromVersion, toVersion);
|
|
1278
1345
|
|
|
1279
1346
|
// Discover integration codemods per integration so a single broken
|
|
1280
1347
|
// integration is skipped (issue collected) without losing the others.
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
oversizedDocSections,
|
|
28
28
|
} from './docs-output-budget.mjs';
|
|
29
29
|
import {routeSegment} from './docs-section-key.mjs';
|
|
30
|
+
import {publishedSummary} from './command-pointers.mjs';
|
|
30
31
|
import {formatCliCommand} from '../env/package-manager.mjs';
|
|
31
32
|
|
|
32
33
|
/** The doc kinds that declare a namespace. */
|
|
@@ -97,7 +98,14 @@ export async function loadCliSelfDocs(
|
|
|
97
98
|
if (typeof doc.name !== 'string' || doc.name === '') {
|
|
98
99
|
throw new Error('exports no doc with a name');
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
+
// The docs and search read a command's summary with its pointers.
|
|
102
|
+
loaded.push({
|
|
103
|
+
source,
|
|
104
|
+
doc:
|
|
105
|
+
doc.type === 'command' && doc.pointers?.length
|
|
106
|
+
? {...doc, summary: publishedSummary(doc)}
|
|
107
|
+
: doc,
|
|
108
|
+
});
|
|
101
109
|
} catch (error) {
|
|
102
110
|
failed.push({
|
|
103
111
|
source,
|