@astryxdesign/cli 0.7.4-canary.626f01e → 0.7.4-canary.720bb10
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 +81 -80
- package/api/discover/_adapter.d.mts +49 -1
- package/api/discover/_adapter.mjs +117 -8
- package/api/discover/detail/item/item.mjs +31 -0
- package/api/discover/discover.mjs +26 -8
- package/api/discover/discover.type.d.mts +25 -0
- package/api/discover/discover.type.mjs +15 -1
- package/api/docs/_adapter.mjs +24 -4
- package/api/docs/docs.type.d.mts +10 -0
- package/api/docs/docs.type.mjs +4 -0
- package/api/docs/node/node.mjs +20 -3
- package/api/doctor/doctor.d.mts +34 -2
- package/api/doctor/doctor.mjs +109 -11
- package/api/doctor/doctor.test.mjs +7 -3
- package/api/doctor/icon-sets.test.mjs +111 -0
- package/api/icon/_adapter.d.mts +54 -0
- package/api/icon/_adapter.mjs +173 -0
- package/api/icon/_authoring.d.mts +42 -0
- package/api/icon/_authoring.mjs +628 -0
- package/api/icon/_options.d.mts +15 -0
- package/api/icon/_options.mjs +41 -0
- package/api/icon/_records.d.mts +47 -0
- package/api/icon/_records.mjs +69 -0
- package/api/icon/add/add.d.mts +14 -0
- package/api/icon/add/add.mjs +416 -0
- package/api/icon/detail/detail.d.mts +12 -0
- package/api/icon/detail/detail.mjs +88 -0
- package/api/icon/error-codes.test.mjs +334 -0
- package/api/icon/experimental-markers.test.mjs +93 -0
- package/api/icon/icon.d.mts +16 -0
- package/api/icon/icon.doc.d.mts +9 -0
- package/api/icon/icon.doc.mjs +91 -0
- package/api/icon/icon.mjs +96 -0
- package/api/icon/icon.test.mjs +374 -0
- package/api/icon/icon.type.d.mts +430 -0
- package/api/icon/icon.type.mjs +290 -0
- package/api/icon/iconAdd.doc.d.mts +6 -0
- package/api/icon/iconAdd.doc.mjs +146 -0
- package/api/icon/iconMap.doc.d.mts +6 -0
- package/api/icon/iconMap.doc.mjs +92 -0
- package/api/icon/iconNewDefinition.doc.d.mts +5 -0
- package/api/icon/iconNewDefinition.doc.mjs +101 -0
- package/api/icon/iconNewSet.doc.d.mts +5 -0
- package/api/icon/iconNewSet.doc.mjs +103 -0
- package/api/icon/iconUse.doc.d.mts +6 -0
- package/api/icon/iconUse.doc.mjs +70 -0
- package/api/icon/list/list.d.mts +11 -0
- package/api/icon/list/list.mjs +64 -0
- package/api/icon/map/map.d.mts +14 -0
- package/api/icon/map/map.mjs +122 -0
- package/api/icon/new-definition/new-definition.d.mts +12 -0
- package/api/icon/new-definition/new-definition.mjs +32 -0
- package/api/icon/new-definition/new-definition.undo.test.mjs +97 -0
- package/api/icon/new-set/new-set.d.mts +12 -0
- package/api/icon/new-set/new-set.mjs +32 -0
- package/api/icon/new-set/new-set.test.mjs +348 -0
- package/api/icon/search/search.d.mts +14 -0
- package/api/icon/search/search.mjs +50 -0
- package/api/icon/use/use.d.mts +15 -0
- package/api/icon/use/use.mjs +101 -0
- package/api/index.d.mts +6 -0
- package/api/index.mjs +6 -0
- package/api/integration/_adapter.d.mts +9 -0
- package/api/integration/_adapter.mjs +18 -0
- package/api/integration/add-contribution.d.mts +3 -12
- package/api/integration/add-contribution.mjs +7 -97
- package/api/integration/add-contribution.test.mjs +14 -10
- package/api/integration/add-helpers.d.mts +46 -0
- package/api/integration/add-helpers.mjs +106 -4
- package/api/integration/doc-stability.test.mjs +216 -0
- package/api/integration/example-checks.no-npm.test.mjs +140 -0
- package/api/integration/example-checks.test.mjs +776 -0
- package/api/integration/integration-authoring.type.d.mts +1 -0
- package/api/integration/integration-authoring.type.mjs +1 -0
- package/api/integration/pack-check.mjs +3 -0
- package/api/integration/pack-check.type.d.mts +9 -1
- package/api/integration/pack-check.type.mjs +4 -1
- package/api/integration/validate-installed-icon-sets.test.mjs +67 -0
- package/api/integration/validate-integration-case-disk.test.mjs +12 -2
- package/api/integration/validate-integration-gaps.test.mjs +36 -15
- package/api/integration/validate-integration.d.mts +11 -1
- package/api/integration/validate-integration.mjs +84 -5
- package/api/integration/validate-integration.type.d.mts +84 -0
- package/api/integration/validate-integration.type.mjs +44 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/search/ORDERING.md +1 -1
- package/api/search/_gather-docs.mjs +40 -1
- package/api/search/_order.d.mts +1 -1
- package/api/search/_order.mjs +75 -6
- package/api/search/search.tie-order.test.mjs +39 -0
- package/api/template/_adapter.d.mts +13 -0
- package/api/template/_adapter.mjs +36 -0
- package/api/template/copy/copy.d.mts +5 -2
- package/api/template/copy/copy.mjs +19 -3
- package/api/template/show/show.d.mts +6 -1
- package/api/template/show/show.mjs +11 -2
- package/api/template/template-suffix.test.mjs +26 -0
- package/api/template/template.mjs +6 -2
- package/api/template/template.type.d.mts +53 -0
- package/api/template/template.type.mjs +15 -0
- package/api/upgrade/_adapter.d.mts +10 -2
- package/api/upgrade/_adapter.mjs +23 -4
- package/api/upgrade/run/run.mjs +4 -1
- package/assets/docs/tree/experimental.doc.mjs +31 -0
- package/assets/docs/tree/icon-definitions.doc.mjs +48 -0
- package/assets/docs/tree/icon-set-files.doc.mjs +33 -0
- package/assets/docs/tree/icon-sets.doc.mjs +377 -0
- package/assets/icons/definitions/activity.doc.mjs +9 -0
- package/assets/icons/definitions/add.doc.mjs +9 -0
- package/assets/icons/definitions/adjustments.doc.mjs +9 -0
- package/assets/icons/definitions/announcement.doc.mjs +9 -0
- package/assets/icons/definitions/apps.doc.mjs +9 -0
- package/assets/icons/definitions/archive.doc.mjs +9 -0
- package/assets/icons/definitions/arrowDown.doc.mjs +10 -0
- package/assets/icons/definitions/arrowLeft.doc.mjs +9 -0
- package/assets/icons/definitions/arrowRight.doc.mjs +9 -0
- package/assets/icons/definitions/arrowUp.doc.mjs +10 -0
- package/assets/icons/definitions/arrowsUpDown.doc.mjs +10 -0
- package/assets/icons/definitions/attach.doc.mjs +9 -0
- package/assets/icons/definitions/audio.doc.mjs +9 -0
- package/assets/icons/definitions/bank.doc.mjs +9 -0
- package/assets/icons/definitions/bold.doc.mjs +9 -0
- package/assets/icons/definitions/bolt.doc.mjs +9 -0
- package/assets/icons/definitions/book.doc.mjs +9 -0
- package/assets/icons/definitions/bookmark.doc.mjs +9 -0
- package/assets/icons/definitions/bug.doc.mjs +9 -0
- package/assets/icons/definitions/building.doc.mjs +9 -0
- package/assets/icons/definitions/calendar.doc.mjs +10 -0
- package/assets/icons/definitions/cart.doc.mjs +9 -0
- package/assets/icons/definitions/chart.doc.mjs +9 -0
- package/assets/icons/definitions/check.doc.mjs +10 -0
- package/assets/icons/definitions/checkDouble.doc.mjs +10 -0
- package/assets/icons/definitions/chevronDown.doc.mjs +10 -0
- package/assets/icons/definitions/chevronLeft.doc.mjs +10 -0
- package/assets/icons/definitions/chevronRight.doc.mjs +10 -0
- package/assets/icons/definitions/chevronUp.doc.mjs +9 -0
- package/assets/icons/definitions/chevronsLeft.doc.mjs +10 -0
- package/assets/icons/definitions/chevronsRight.doc.mjs +10 -0
- package/assets/icons/definitions/click.doc.mjs +9 -0
- package/assets/icons/definitions/clipboard.doc.mjs +10 -0
- package/assets/icons/definitions/clock.doc.mjs +10 -0
- package/assets/icons/definitions/close.doc.mjs +10 -0
- package/assets/icons/definitions/code.doc.mjs +9 -0
- package/assets/icons/definitions/collapse.doc.mjs +9 -0
- package/assets/icons/definitions/compose.doc.mjs +9 -0
- package/assets/icons/definitions/conversation.doc.mjs +9 -0
- package/assets/icons/definitions/copy.doc.mjs +10 -0
- package/assets/icons/definitions/creditCard.doc.mjs +9 -0
- package/assets/icons/definitions/database.doc.mjs +9 -0
- package/assets/icons/definitions/delete.doc.mjs +9 -0
- package/assets/icons/definitions/desktop.doc.mjs +9 -0
- package/assets/icons/definitions/discount.doc.mjs +9 -0
- package/assets/icons/definitions/document.doc.mjs +9 -0
- package/assets/icons/definitions/download.doc.mjs +9 -0
- package/assets/icons/definitions/drag.doc.mjs +9 -0
- package/assets/icons/definitions/edit.doc.mjs +9 -0
- package/assets/icons/definitions/emoji.doc.mjs +9 -0
- package/assets/icons/definitions/error.doc.mjs +10 -0
- package/assets/icons/definitions/expand.doc.mjs +9 -0
- package/assets/icons/definitions/experiment.doc.mjs +9 -0
- package/assets/icons/definitions/externalLink.doc.mjs +10 -0
- package/assets/icons/definitions/eye.doc.mjs +9 -0
- package/assets/icons/definitions/eyeSlash.doc.mjs +10 -0
- package/assets/icons/definitions/file.doc.mjs +9 -0
- package/assets/icons/definitions/flag.doc.mjs +9 -0
- package/assets/icons/definitions/folder.doc.mjs +9 -0
- package/assets/icons/definitions/folderAdd.doc.mjs +9 -0
- package/assets/icons/definitions/funnel.doc.mjs +10 -0
- package/assets/icons/definitions/globe.doc.mjs +9 -0
- package/assets/icons/definitions/gridView.doc.mjs +9 -0
- package/assets/icons/definitions/heart.doc.mjs +9 -0
- package/assets/icons/definitions/home.doc.mjs +9 -0
- package/assets/icons/definitions/image.doc.mjs +9 -0
- package/assets/icons/definitions/inbox.doc.mjs +9 -0
- package/assets/icons/definitions/info.doc.mjs +10 -0
- package/assets/icons/definitions/italic.doc.mjs +9 -0
- package/assets/icons/definitions/key.doc.mjs +9 -0
- package/assets/icons/definitions/language.doc.mjs +9 -0
- package/assets/icons/definitions/lightbulb.doc.mjs +9 -0
- package/assets/icons/definitions/link.doc.mjs +9 -0
- package/assets/icons/definitions/list.doc.mjs +9 -0
- package/assets/icons/definitions/location.doc.mjs +9 -0
- package/assets/icons/definitions/lock.doc.mjs +9 -0
- package/assets/icons/definitions/mail.doc.mjs +9 -0
- package/assets/icons/definitions/mention.doc.mjs +9 -0
- package/assets/icons/definitions/menu.doc.mjs +10 -0
- package/assets/icons/definitions/message.doc.mjs +9 -0
- package/assets/icons/definitions/microphone.doc.mjs +10 -0
- package/assets/icons/definitions/mobile.doc.mjs +9 -0
- package/assets/icons/definitions/money.doc.mjs +9 -0
- package/assets/icons/definitions/moon.doc.mjs +9 -0
- package/assets/icons/definitions/moreHorizontal.doc.mjs +10 -0
- package/assets/icons/definitions/notification.doc.mjs +9 -0
- package/assets/icons/definitions/notificationActive.doc.mjs +9 -0
- package/assets/icons/definitions/notificationOff.doc.mjs +9 -0
- package/assets/icons/definitions/package.doc.mjs +9 -0
- package/assets/icons/definitions/pause.doc.mjs +9 -0
- package/assets/icons/definitions/pin.doc.mjs +9 -0
- package/assets/icons/definitions/play.doc.mjs +9 -0
- package/assets/icons/definitions/raiseHand.doc.mjs +9 -0
- package/assets/icons/definitions/redo.doc.mjs +9 -0
- package/assets/icons/definitions/refresh.doc.mjs +9 -0
- package/assets/icons/definitions/remove.doc.mjs +9 -0
- package/assets/icons/definitions/rocket.doc.mjs +9 -0
- package/assets/icons/definitions/save.doc.mjs +9 -0
- package/assets/icons/definitions/search.doc.mjs +10 -0
- package/assets/icons/definitions/send.doc.mjs +9 -0
- package/assets/icons/definitions/server.doc.mjs +9 -0
- package/assets/icons/definitions/settings.doc.mjs +9 -0
- package/assets/icons/definitions/share.doc.mjs +9 -0
- package/assets/icons/definitions/shield.doc.mjs +9 -0
- package/assets/icons/definitions/shipping.doc.mjs +9 -0
- package/assets/icons/definitions/shoppingBag.doc.mjs +9 -0
- package/assets/icons/definitions/sparkles.doc.mjs +9 -0
- package/assets/icons/definitions/star.doc.mjs +9 -0
- package/assets/icons/definitions/stop.doc.mjs +10 -0
- package/assets/icons/definitions/strikethrough.doc.mjs +9 -0
- package/assets/icons/definitions/success.doc.mjs +10 -0
- package/assets/icons/definitions/sun.doc.mjs +9 -0
- package/assets/icons/definitions/swatch.doc.mjs +9 -0
- package/assets/icons/definitions/table.doc.mjs +9 -0
- package/assets/icons/definitions/tag.doc.mjs +9 -0
- package/assets/icons/definitions/thumbsDown.doc.mjs +9 -0
- package/assets/icons/definitions/thumbsUp.doc.mjs +9 -0
- package/assets/icons/definitions/trendDown.doc.mjs +9 -0
- package/assets/icons/definitions/trendUp.doc.mjs +9 -0
- package/assets/icons/definitions/underline.doc.mjs +9 -0
- package/assets/icons/definitions/undo.doc.mjs +9 -0
- package/assets/icons/definitions/unlock.doc.mjs +9 -0
- package/assets/icons/definitions/upload.doc.mjs +10 -0
- package/assets/icons/definitions/user.doc.mjs +9 -0
- package/assets/icons/definitions/userAdd.doc.mjs +9 -0
- package/assets/icons/definitions/userCircle.doc.mjs +9 -0
- package/assets/icons/definitions/users.doc.mjs +9 -0
- package/assets/icons/definitions/video.doc.mjs +9 -0
- package/assets/icons/definitions/viewColumns.doc.mjs +10 -0
- package/assets/icons/definitions/warning.doc.mjs +10 -0
- package/assets/icons/definitions/work.doc.mjs +9 -0
- package/assets/icons/definitions/wrench.doc.mjs +10 -0
- package/assets/templates/blocks/components/AppShell/AppShellShowcase.doc.mjs +16 -3
- package/assets/templates/blocks/components/AppShell/AppShellSideNavOnly.doc.mjs +16 -1
- package/assets/templates/blocks/components/AppShell/AppShellTopNavOnly.doc.mjs +9 -1
- package/assets/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.doc.mjs +17 -1
- package/assets/templates/blocks/components/AppShell/AppShellWithBanner.doc.mjs +18 -1
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.doc.mjs +1 -0
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.doc.mjs +8 -0
- package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.doc.mjs +1 -0
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsDeepHierarchy.doc.mjs +1 -0
- package/assets/templates/blocks/components/Breadcrumbs/BreadcrumbsWithIcons.doc.mjs +1 -0
- package/assets/templates/blocks/components/Button/ButtonFloating.doc.mjs +1 -0
- package/assets/templates/blocks/components/Button/ButtonWithIcon.doc.mjs +6 -0
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.doc.mjs +5 -0
- package/assets/templates/blocks/components/Center/CenterHorizontal.doc.mjs +8 -0
- package/assets/templates/blocks/components/Center/CenterInsideACard.doc.mjs +1 -0
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFlat.doc.mjs +5 -0
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFooterActions.doc.mjs +13 -1
- package/assets/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.doc.mjs +17 -1
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.doc.mjs +1 -0
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.doc.mjs +1 -0
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataFooter.doc.mjs +15 -1
- package/assets/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.doc.mjs +15 -1
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonCustomIcon.doc.mjs +6 -0
- package/assets/templates/blocks/components/ChatSendButton/ChatSendButtonShowcase.doc.mjs +1 -0
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageStatusUpdates.doc.mjs +1 -0
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageWithIcon.doc.mjs +6 -0
- package/assets/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.doc.mjs +3 -2
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.doc.mjs +6 -0
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuBottomSheet.doc.mjs +6 -0
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuNoChevron.doc.mjs +1 -0
- package/assets/templates/blocks/components/EmptyState/EmptyStateActions.doc.mjs +1 -0
- package/assets/templates/blocks/components/EmptyState/EmptyStateCompact.doc.mjs +1 -0
- package/assets/templates/blocks/components/EmptyState/EmptyStateContainer.doc.mjs +1 -0
- package/assets/templates/blocks/components/EmptyState/EmptyStateShowcase.doc.mjs +1 -0
- package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.doc.mjs +1 -0
- package/assets/templates/blocks/components/Hooks/useKeyboardHintHookUsage.doc.mjs +10 -1
- package/assets/templates/blocks/components/HoverCard/HoverCardInteractiveContent.doc.mjs +1 -0
- package/assets/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.doc.mjs +1 -0
- package/assets/templates/blocks/components/IconButton/IconButtonFloating.doc.mjs +1 -0
- package/assets/templates/blocks/components/Item/ItemDocumentTabs.doc.mjs +1 -0
- package/assets/templates/blocks/components/Item/ItemShowcase.doc.mjs +1 -0
- package/assets/templates/blocks/components/Item/ItemWithMetadata.doc.mjs +1 -1
- package/assets/templates/blocks/components/MetadataListItem/MetadataListItemBasic.doc.mjs +1 -1
- package/assets/templates/blocks/components/MobileNav/MobileNavBasicMobileNav.doc.mjs +7 -0
- package/assets/templates/blocks/components/MobileNav/MobileNavEndSideMobileNav.doc.mjs +1 -0
- package/assets/templates/blocks/components/MobileNav/MobileNavWithoutTitleMobileNav.doc.mjs +1 -0
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.doc.mjs +6 -0
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithDividers.doc.mjs +5 -0
- package/assets/templates/blocks/components/MoreMenu/MoreMenuWithSections.doc.mjs +5 -0
- package/assets/templates/blocks/components/Pagination/PaginationDotsCarousel.doc.mjs +1 -0
- package/assets/templates/blocks/components/Popover/PopoverBottomSheetAlternative.doc.mjs +1 -0
- package/assets/templates/blocks/components/Section/SectionWashHighlight.doc.mjs +1 -0
- package/assets/templates/blocks/components/SegmentedControlItem/SegmentedControlItemBasic.doc.mjs +1 -1
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.doc.mjs +8 -1
- package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.doc.mjs +1 -0
- package/assets/templates/blocks/components/TextArea/TextAreaWithIcon.doc.mjs +1 -0
- package/assets/templates/blocks/components/TextInput/TextInputIcon.doc.mjs +1 -0
- package/assets/templates/blocks/components/TextInput/TextInputSearch.doc.mjs +1 -0
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonColor.doc.mjs +11 -0
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonGroup.doc.mjs +16 -1
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonIconSwap.doc.mjs +6 -0
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonLabel.doc.mjs +13 -1
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonShowcase.doc.mjs +6 -0
- package/assets/templates/blocks/components/ToggleButton/ToggleButtonStates.doc.mjs +1 -0
- package/assets/templates/blocks/components/Token/TokenIcon.doc.mjs +6 -0
- package/assets/templates/blocks/components/Token/TokenShowcase.doc.mjs +1 -0
- package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.doc.mjs +1 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarBulkActions.doc.mjs +1 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.doc.mjs +1 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.doc.mjs +1 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.doc.mjs +1 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.doc.mjs +1 -0
- package/assets/templates/blocks/components/Toolbar/ToolbarWithTabs.doc.mjs +1 -0
- package/assets/templates/blocks/components/TopNav/TopNavCenteredNavigation.doc.mjs +1 -0
- package/assets/templates/blocks/components/TopNav/TopNavEnterpriseDashboard.doc.mjs +6 -0
- package/assets/templates/blocks/components/TopNav/TopNavHoverMenu.doc.mjs +8 -0
- package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.doc.mjs +8 -0
- package/assets/templates/blocks/components/TopNav/TopNavMultipleDropdowns.doc.mjs +5 -0
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.doc.mjs +5 -0
- package/assets/templates/blocks/components/TopNav/TopNavWithLogo.doc.mjs +1 -0
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.doc.mjs +1 -0
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.doc.mjs +13 -1
- package/assets/templates/blocks/components/TopNavMegaMenuItem/TopNavMegaMenuItemBasic.doc.mjs +1 -0
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuBasic.doc.mjs +1 -0
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.doc.mjs +6 -0
- package/assets/templates/blocks/components/TreeList/TreeListFileTreeWithIcons.doc.mjs +1 -0
- package/assets/templates/blocks/components/TreeList/TreeListInteractiveSettings.doc.mjs +1 -0
- package/assets/templates/blocks/components/Typeahead/TypeaheadSearchField.doc.mjs +1 -0
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenShowcase.doc.mjs +15 -1
- package/assets/templates/blocks/components/VisuallyHidden/VisuallyHiddenSupplementaryContext.doc.mjs +10 -2
- package/assets/templates/pages/ai-chat/template.doc.mjs +9 -0
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +11 -0
- package/assets/templates/pages/canvas-editor/template.doc.mjs +17 -0
- package/assets/templates/pages/centered-hero/template.doc.mjs +1 -0
- package/assets/templates/pages/checkout-wizard/template.doc.mjs +7 -0
- package/assets/templates/pages/contact-form/template.doc.mjs +5 -0
- package/assets/templates/pages/dashboard/template.doc.mjs +6 -0
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +8 -0
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +7 -0
- package/assets/templates/pages/dashboard-comparison/template.doc.mjs +8 -0
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +1 -0
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +7 -0
- package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +7 -0
- package/assets/templates/pages/detail-page/template.doc.mjs +10 -0
- package/assets/templates/pages/documentation-design/template.doc.mjs +6 -1
- package/assets/templates/pages/documentation-technical/template.doc.mjs +5 -0
- package/assets/templates/pages/editor/template.doc.mjs +25 -0
- package/assets/templates/pages/file-explorer/template.doc.mjs +15 -0
- package/assets/templates/pages/form-wizard-inline/template.doc.mjs +1 -0
- package/assets/templates/pages/form-wizard-vertical/template.doc.mjs +12 -0
- package/assets/templates/pages/gallery-hero/template.doc.mjs +1 -0
- package/assets/templates/pages/ide/template.doc.mjs +5 -0
- package/assets/templates/pages/incident-console/template.doc.mjs +1 -0
- package/assets/templates/pages/kanban-board/template.doc.mjs +11 -0
- package/assets/templates/pages/library/template.doc.mjs +1 -0
- package/assets/templates/pages/login/template.doc.mjs +1 -0
- package/assets/templates/pages/login-card/template.doc.mjs +1 -0
- package/assets/templates/pages/login-split/template.doc.mjs +1 -0
- package/assets/templates/pages/login-sso/template.doc.mjs +1 -0
- package/assets/templates/pages/messaging-shell/template.doc.mjs +13 -0
- package/assets/templates/pages/payment-form/template.doc.mjs +6 -0
- package/assets/templates/pages/product-detail/template.doc.mjs +1 -0
- package/assets/templates/pages/product-gallery/template.doc.mjs +1 -0
- package/assets/templates/pages/settings/template.doc.mjs +1 -0
- package/assets/templates/pages/settings-dialog/template.doc.mjs +49 -0
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +16 -0
- package/assets/templates/pages/shell-nav/template.doc.mjs +6 -0
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +11 -0
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +16 -0
- package/assets/templates/pages/table-collapsible/template.doc.mjs +5 -0
- package/assets/templates/pages/table-comparison/template.doc.mjs +12 -0
- package/assets/templates/pages/table-filter/template.doc.mjs +19 -0
- package/assets/templates/pages/table-grouped/template.doc.mjs +13 -0
- package/assets/templates/pages/table-inbox/template.doc.mjs +17 -0
- package/assets/templates/pages/table-page/template.doc.mjs +1 -0
- package/assets/templates/pages/table-tree/template.doc.mjs +12 -0
- package/assets/templates/pages/theme-showcase/template.doc.mjs +19 -0
- package/assets/templates/pages/work-item-detail/template.doc.mjs +13 -0
- package/authoring/config/config.doc.mjs +8 -0
- package/authoring/config/parse.d.mts +1 -0
- package/authoring/config/parse.mjs +1 -0
- package/authoring/config/type.ts +8 -0
- package/authoring/discover/parse.d.mts +13 -3
- package/authoring/discover/parse.mjs +57 -4
- package/authoring/discover/parse.test.mjs +34 -0
- package/authoring/discover/type.ts +22 -2
- package/authoring/doctypes/_schema.d.mts +19 -0
- package/authoring/doctypes/_schema.mjs +5 -0
- package/authoring/doctypes/base/graph-fields.doc.mjs +7 -1
- package/authoring/doctypes/base/type.ts +10 -1
- package/authoring/doctypes/doc-stability-types.test.mjs +91 -0
- package/authoring/doctypes/enum/type.ts +4 -0
- package/authoring/doctypes/icon-definition/icon-definition.doc.d.mts +9 -0
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +89 -0
- package/authoring/doctypes/icon-definition/parse.d.mts +40 -0
- package/authoring/doctypes/icon-definition/parse.mjs +89 -0
- package/authoring/doctypes/icon-definition/parse.test.mjs +78 -0
- package/authoring/doctypes/icon-definition/type.ts +55 -0
- package/authoring/doctypes/icon-set/icon-names.d.mts +14 -0
- package/authoring/doctypes/icon-set/icon-names.mjs +44 -0
- package/authoring/doctypes/icon-set/icon-names.test.mjs +26 -0
- package/authoring/doctypes/icon-set/icon-set-data.doc.d.mts +10 -0
- package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +169 -0
- package/authoring/doctypes/icon-set/icon-set.doc.d.mts +9 -0
- package/authoring/doctypes/icon-set/icon-set.doc.mjs +90 -0
- package/authoring/doctypes/icon-set/parse.d.mts +105 -0
- package/authoring/doctypes/icon-set/parse.mjs +322 -0
- package/authoring/doctypes/icon-set/parse.test.mjs +179 -0
- package/authoring/doctypes/icon-set/type.ts +182 -0
- package/authoring/doctypes/load-contract.test.mjs +17 -4
- package/authoring/doctypes/namespace/namespace.doc.mjs +7 -0
- package/authoring/doctypes/namespace/type.ts +7 -0
- package/authoring/doctypes/parse.d.mts +6 -2
- package/authoring/doctypes/parse.mjs +10 -2
- package/authoring/doctypes/schema/type.ts +4 -0
- package/authoring/doctypes/template/parse.d.mts +4 -0
- package/authoring/doctypes/template/parse.mjs +11 -0
- package/authoring/doctypes/template/template.doc.mjs +7 -0
- package/authoring/doctypes/template/type.ts +10 -0
- package/authoring/doctypes/types.ts +3 -1
- package/authoring/identity/type.ts +11 -3
- package/authoring/index.d.mts +2 -0
- package/authoring/index.d.ts +15 -0
- package/authoring/index.mjs +5 -1
- package/authoring/integration/integration.doc.mjs +17 -0
- package/authoring/integration/schema.d.mts +6 -0
- package/authoring/integration/schema.mjs +4 -0
- package/authoring/integration/type.ts +8 -0
- package/clients/cli/commands/discover.icon-sets.test.mjs +133 -0
- package/clients/cli/commands/discover.mjs +3 -0
- package/clients/cli/commands/docs.mjs +23 -6
- package/clients/cli/commands/doctor-integration.test.mjs +38 -0
- package/clients/cli/commands/doctor.mjs +165 -16
- package/clients/cli/commands/experimental/icon.mjs +462 -0
- package/clients/cli/commands/experimental/index.mjs +43 -0
- package/clients/cli/commands/experimental-icon-add.doc.mjs +105 -0
- package/clients/cli/commands/experimental-icon-map.doc.mjs +57 -0
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +72 -0
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +76 -0
- package/clients/cli/commands/experimental-icon-use.doc.mjs +42 -0
- package/clients/cli/commands/experimental-icon.doc.mjs +68 -0
- package/clients/cli/commands/experimental.doc.mjs +28 -0
- package/clients/cli/commands/icon-authoring.test.mjs +1035 -0
- package/clients/cli/commands/icon-sets-guide.test.mjs +186 -0
- package/clients/cli/commands/icon.test.mjs +96 -0
- package/clients/cli/commands/integration.mjs +23 -1
- package/clients/cli/commands/template.icons.test.mjs +132 -0
- package/clients/cli/commands/template.mjs +36 -2
- package/clients/cli/commands/text-json-parity.test.mjs +51 -0
- package/clients/cli/formatters/index.mjs +8 -1
- package/clients/cli/formatters/index.test.mjs +15 -0
- package/clients/cli/index.mjs +13 -0
- package/clients/cli/lib/define-command.mjs +4 -0
- package/foundation/config/config-writer.d.mts +27 -0
- package/foundation/config/config-writer.mjs +202 -0
- package/foundation/config/config-writer.test.mjs +84 -0
- package/foundation/config/project.d.mts +24 -0
- package/foundation/config/project.mjs +105 -3
- package/foundation/discovery/authoring-self-docs.d.mts +22 -1
- package/foundation/discovery/authoring-self-docs.mjs +69 -19
- package/foundation/discovery/authoring-self-docs.test.mjs +19 -3
- package/foundation/discovery/authoring-surface.mjs +13 -6
- package/foundation/discovery/cli-self-docs.d.mts +6 -0
- package/foundation/discovery/cli-self-docs.mjs +58 -6
- package/foundation/discovery/component-discovery.export-names.test.mjs +31 -0
- package/foundation/discovery/doc-stability.d.mts +32 -0
- package/foundation/discovery/doc-stability.mjs +100 -0
- package/foundation/discovery/doc-types.d.mts +2 -2
- package/foundation/discovery/doc-types.mjs +8 -3
- package/foundation/discovery/doc-types.test.mjs +30 -0
- package/foundation/discovery/icon-definition-discovery.d.mts +59 -0
- package/foundation/discovery/icon-definition-discovery.mjs +117 -0
- package/foundation/discovery/icon-ranking.d.mts +113 -0
- package/foundation/discovery/icon-ranking.mjs +305 -0
- package/foundation/discovery/icon-set-checks.d.mts +142 -0
- package/foundation/discovery/icon-set-checks.mjs +742 -0
- package/foundation/discovery/icon-set-checks.test.mjs +905 -0
- package/foundation/discovery/icon-set-discovery.d.mts +229 -0
- package/foundation/discovery/icon-set-discovery.mjs +464 -0
- package/foundation/discovery/icon-set-discovery.test.mjs +320 -0
- package/foundation/discovery/icon-set-writer.d.mts +323 -0
- package/foundation/discovery/icon-set-writer.mjs +1181 -0
- package/foundation/discovery/integration-doc-files.mjs +17 -2
- package/foundation/discovery/integration-doc-files.test.mjs +29 -0
- package/foundation/discovery/module-exports.d.mts +122 -0
- package/foundation/discovery/module-exports.mjs +682 -11
- package/foundation/discovery/runner-commands.test.mjs +4 -1
- package/foundation/discovery/template-adapter.d.mts +5 -0
- package/foundation/discovery/template-adapter.mjs +17 -0
- package/foundation/discovery/template-icon-notes.d.mts +15 -0
- package/foundation/discovery/template-icon-notes.mjs +66 -0
- package/foundation/discovery/template-icons.d.mts +156 -0
- package/foundation/discovery/template-icons.mjs +712 -0
- package/foundation/discovery/template-icons.test.mjs +457 -0
- package/foundation/discovery/theme-discovery.d.mts +15 -0
- package/foundation/discovery/theme-discovery.mjs +137 -61
- package/foundation/doc-compiler/bundle.mjs +14 -0
- package/foundation/doc-compiler/compile.d.mts +1 -1
- package/foundation/doc-compiler/compile.mjs +10 -2
- package/foundation/doc-compiler/doc-loads.test.mjs +33 -0
- package/foundation/doc-compiler/inputs.d.mts +2 -2
- package/foundation/doc-compiler/inputs.mjs +17 -1
- package/foundation/doc-compiler/inputs.test.mjs +1 -0
- package/foundation/doc-compiler/lower-doc.test.mjs +1 -1
- package/foundation/doc-compiler/read.d.mts +2 -2
- package/foundation/doc-compiler/read.mjs +4 -4
- package/foundation/doc-compiler/tree.d.mts +21 -0
- package/foundation/doc-compiler/tree.mjs +71 -4
- package/foundation/doc-compiler/tree.test.mjs +34 -0
- package/foundation/fs/paths.d.mts +3 -1
- package/foundation/fs/paths.mjs +8 -2
- package/foundation/identity/provider-identity.mjs +2 -0
- package/foundation/integrations/cli-requirement.d.mts +55 -0
- package/foundation/integrations/cli-requirement.mjs +92 -1
- package/foundation/integrations/cli-requirement.test.mjs +9 -0
- package/foundation/integrations/contribution-inventory.d.mts +12 -5
- package/foundation/integrations/contribution-inventory.mjs +66 -3
- package/foundation/integrations/integrations.d.mts +5 -0
- package/foundation/integrations/integrations.mjs +6 -2
- package/foundation/integrations/manifest-writer.d.mts +3 -0
- package/foundation/integrations/manifest-writer.mjs +51 -5
- package/foundation/integrations/manifest-writer.test.mjs +42 -0
- package/foundation/integrations/validate-contributions.d.mts +53 -0
- package/foundation/integrations/validate-contributions.mjs +791 -1
- package/foundation/response/response-types.doc.mjs +58 -1
- package/package.json +9 -9
|
@@ -39,12 +39,18 @@
|
|
|
39
39
|
* "healthy" — the two are otherwise byte-identical.
|
|
40
40
|
* @typedef {object} ValidateIntegrationResponse
|
|
41
41
|
* @property {'integration.validate'} type
|
|
42
|
-
* @property {{validated: boolean, name: string | null, version: string | null, issues: import('../../foundation/integrations/issue').AstryxIntegrationIssue[], notes?: Array<{code: string, message: string, next?: boolean}>, docTypes?: DocTypesReport, docNames?: DocNamesReport, blockComponents?: BlockComponentsReport, publicImports?: PublicImportsReport}} data
|
|
42
|
+
* @property {{validated: boolean, name: string | null, version: string | null, issues: import('../../foundation/integrations/issue').AstryxIntegrationIssue[], notes?: Array<{code: string, message: string, next?: boolean}>, docTypes?: DocTypesReport, docNames?: DocNamesReport, blockComponents?: BlockComponentsReport, exampleAssets?: {status: 'checked', findings: [], unchecked: Array<{file: string, asset: string, reason: string}>}, publicImports?: PublicImportsReport, iconSets?: IconSetCoverage[], olderCliNotes?: OlderCliNote[]}} data
|
|
43
|
+
* `iconSets` is experimental: it may change or be removed in a patch
|
|
44
|
+
* release.
|
|
43
45
|
* `notes`: information beside the issues. A note fails nothing by default;
|
|
44
46
|
* one with `next: true` counts as a warning under `integration check
|
|
45
47
|
* --next`, fails `integration check --strict --next`, and fails `--strict`
|
|
46
48
|
* from the next minor release. Notes include `invalid_cli_command`, a
|
|
47
49
|
* `cliCommand` that was ignored as malformed;
|
|
50
|
+
* `component_without_example`, `template_category`,
|
|
51
|
+
* `showcase_not_standalone` and `template_asset_not_packed`, what a
|
|
52
|
+
* package's examples need (next minor; a block's `alsoShowcaseFor` names
|
|
53
|
+
* count as shown);
|
|
48
54
|
* `cli_peer_version`, the running CLI outside the package's
|
|
49
55
|
* `@astryxdesign/cli` peer range; and
|
|
50
56
|
* the package layout findings added after the last minor release, each with
|
|
@@ -106,6 +112,43 @@
|
|
|
106
112
|
* @typedef {{status: 'checked', findings: [], unchecked: Array<{file: string, name: string, reason: string}>}} BlockComponentsReport
|
|
107
113
|
*/
|
|
108
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Experimental (spec:AST-084 FR15): for a package that declares
|
|
117
|
+
* `experimental.iconSets`, which icon definitions each valid set leaves
|
|
118
|
+
* unmapped, and what the checks could not judge. Listed beside the issues and
|
|
119
|
+
* never counted: mapping an optional definition is optional, an item not
|
|
120
|
+
* checked is not a failure, and nothing here fails a check, even under
|
|
121
|
+
* `--strict`.
|
|
122
|
+
* @experimental May change or be removed in a patch release.
|
|
123
|
+
* @typedef {object} IconSetCoverage
|
|
124
|
+
* @property {string} set The set's name.
|
|
125
|
+
* @property {Array<{name: string, description: string, words: string[]}>} unmappedDefinitions
|
|
126
|
+
* Astryx's optional (not built-in) definitions the set's `map` does not
|
|
127
|
+
* name. An unmapped built-in definition is an error issue instead.
|
|
128
|
+
* @property {Array<{definition: string, icon: string}>} suggestions For each
|
|
129
|
+
* unmapped definition (built-in, optional, or the set's own), the icon
|
|
130
|
+
* whose whole id is the definition's name or one of its words, when one is.
|
|
131
|
+
* @property {Array<{icon?: string, adapter?: string, entry?: string, reason: string}>} unchecked
|
|
132
|
+
* What the checks could not judge, each with the reason: an icon export
|
|
133
|
+
* whose module is an `exports` target not built yet, or that the reader
|
|
134
|
+
* cannot prove either way (`icon`); an adapter export it cannot prove
|
|
135
|
+
* (`adapter`); and a theme map or theme-map entry it cannot read
|
|
136
|
+
* (`entry`).
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A descriptor an older CLI drops: a page or block template, or a namespace
|
|
141
|
+
* doc, that sets `stability`, or a template that declares `icons`, while the
|
|
142
|
+
* package's `@astryxdesign/cli` peer range admits a release before 0.7.4.
|
|
143
|
+
* Listed beside the issues for the package being authored, and never counted
|
|
144
|
+
* or failing a check.
|
|
145
|
+
* @typedef {object} OlderCliNote
|
|
146
|
+
* @property {string} file The descriptor, relative to the package.
|
|
147
|
+
* @property {'template' | 'namespace'} kind
|
|
148
|
+
* @property {'stability' | 'icons'} field The field an older CLI refuses.
|
|
149
|
+
* @property {string} message What an older CLI does with it, and the fix.
|
|
150
|
+
*/
|
|
151
|
+
|
|
109
152
|
export {};
|
|
110
153
|
|
|
111
154
|
/**
|
|
@@ -62,7 +62,7 @@ export const doc = {
|
|
|
62
62
|
{
|
|
63
63
|
type: 'integration.validate',
|
|
64
64
|
description:
|
|
65
|
-
"The result envelope: `data.validated`, false when nothing was validated — with no `package.json` at all, `data.issues` carries one `no_package` error-severity issue so the command exits 1; with a `package.json` but no integration manifest, `data.issues` is empty, which means \"not looked at\", not \"healthy\"; `data.name` and `data.version` of the validated package (both null when `data.validated` is false; `data.name` is `(local package)` when the local package.json has no readable name), plus `data.issues`, an AstryxIntegrationIssue[] of {code, severity: `warning` | `error`, message, fix?, file?, line?}: `fix` is the change that resolves the issue, and `file` and `line` where it is, relative to the package, when the check knows them; and `data.notes` when there are any: {code, message, next?} information beside the issues; a note fails nothing by default, and one with `next: true` counts as a warning under `integration check --next`, fails `integration check --strict --next`, and fails `--strict` from the next minor release. Notes include `invalid_cli_command` for a `cliCommand` that was ignored as malformed and `cli_peer_version` when the running CLI is outside the `@astryxdesign/cli` peer range of the package, and the package layout findings added after the last minor release, each with its fix in the message: `duplicate_component_doc`, `symlinked_root`, `unreadable_file`, `invalid_package_json` (no `name` or `version`), `no_provider_id`, and `source_without_component_doc` for a doc whose file name differs from its source only in letter case where the two still pair; and `doc_name_mismatch` and `unknown_block_component` (see `docNames` and `blockComponents`); they become warnings in the next minor release. For the commands a topic writes, `runner_command` (written with a package runner), `plain_command` (written bare), `package_manager_command` (written for one package manager) and `doc_token` (a token that does not parse) notes each give the file, line and the token to write. A `doc_target_not_found` note names a doc whose `replaces` or `extends` names no topic and no guide of the CLI's docs or the package's own (such as a namespace, with the guides below it), so it changes nothing unless an app also installs a package that provides it, and a `doc_section_unplaced` note a section whose `before` or `after` names no section of the topic or guide it extends, so it is added at the end, and a `duplicate_guide_replacement` note two docs of the package that replace one guide, of which only the last is read; they become warnings in the next minor release. When the manifest loads, `data.docTypes` holds the doc type check: `status` (`checked` | `skipped`), `reason` when skipped, `typescript`, `docs` (doc values checked), `findings` ({doc, line, export, type, field, problem: `unknown_field` | `missing_field` | `wrong_type`, severity: `warning`, message, fix}), `unchecked` ({doc, reason}: a doc that could not be fully checked, or a root its reader cannot read), and `fixtures` when the components or docs root holds test fixture docs under `__tests__`: how many, none of them checked. When the manifest loads, `data.docNames` lists the component doc names it could not judge: `status` (`checked`), `findings` (always empty; a doc name the module its import names provably does not export is a `doc_name_mismatch` note, with its fix in the message) and `unchecked` ({file, name, reason}: a doc whose `name` differs from the name it is listed under and whose source exports cannot all be read, such as a re-export from another package). When the manifest loads, `data.blockComponents` lists the component names templates give in `exampleFor` or `componentsUsed` that could not be judged: `status` (`checked`), `findings` (always empty; a name neither the package nor Core has, and the template does not import, is an `unknown_block_component` note, with its fix in the message) and `unchecked` ({file, name, reason}: a name the template may reach through anything other than named imports and re-exports from Core, React, StyleX, local helpers or the entry of the package itself, such as an import from another package, a default or namespace import, an alias of or member read off an imported binding, require() or a dynamic import(), or a local module that cannot be read, or any name Core would have to resolve when Core is not installed). Since 0.7.3 each import apps cannot use is a note in `data.notes`, its fix inside the message, listed only: it does not fail this command or `integration check --strict`, and fails `--strict` from the next minor release. The codes are `component_import_not_exported`, `component_import_other_package`, `component_import_missing_name`, `example_import_not_exported`, `example_import_missing_name`, `template_import_not_exported`, `template_import_outside_root`, `template_private_import`, `template_import_missing_name` and `template_no_default_export`. When the manifest loads, `data.publicImports` is `{status: 'checked', findings: [], unchecked}`: `unchecked` lists each import the check could not judge, as {file, specifier, reason}, the reason starting `example <label>:` for an import in a component example: an `exports` target not built yet; a module whose export list cannot be read in full (CommonJS, or a declaration file it cannot read); a root import in a package with no `exports` (the root module `main` names is not read); every name an import (other than a component doc's own component) names that its module does not export, while a TypeScript file in the package has a `declare module` block for a relative path or the package's own name or a subpath of it, which can add names to that module (a `declare module` in a comment, `declare global`, a wildcard such as `'*.css'`, and another package's name do not count; a file whose text has `declare module` but that cannot be parsed counts); the same for every such name when the package has more than 5,000 files to search for that block; a deep path into build output not built yet in a package with no `exports`; a template import of Core when `@astryxdesign/core` is not installed beside the package (a `packages/core` of the workspace under another name does not count); every import of the package's own name when package.json has no `name` or a `name` that is not a bare package name; one entry for the whole check when package.json cannot be read; and an import of a subpath whose `exports` entry has only a `types` target, unless it is `import type`, every binding is an inline `type`, or every name it imports is a type its types file declares: a value import of a name that file does not declare as a type, a namespace or side-effect import, or any import when the types file cannot be read (it may be build output). `integration check` counts the unchecked as not compared; they never fail it.",
|
|
65
|
+
"The result envelope: `data.validated`, false when nothing was validated — with no `package.json` at all, `data.issues` carries one `no_package` error-severity issue so the command exits 1; with a `package.json` but no integration manifest, `data.issues` is empty, which means \"not looked at\", not \"healthy\"; `data.name` and `data.version` of the validated package (both null when `data.validated` is false; `data.name` is `(local package)` when the local package.json has no readable name), plus `data.issues`, an AstryxIntegrationIssue[] of {code, severity: `warning` | `error`, message, fix?, file?, line?}: `fix` is the change that resolves the issue, and `file` and `line` where it is, relative to the package, when the check knows them; and `data.notes` when there are any: {code, message, next?} information beside the issues; a note fails nothing by default, and one with `next: true` counts as a warning under `integration check --next`, fails `integration check --strict --next`, and fails `--strict` from the next minor release. Notes include `invalid_cli_command` for a `cliCommand` that was ignored as malformed and `cli_peer_version` when the running CLI is outside the `@astryxdesign/cli` peer range of the package, and the package layout findings added after the last minor release, each with its fix in the message: `duplicate_component_doc`, `symlinked_root`, `unreadable_file`, `invalid_package_json` (no `name` or `version`), `no_provider_id`, and `source_without_component_doc` for a doc whose file name differs from its source only in letter case where the two still pair; and `doc_name_mismatch` and `unknown_block_component` (see `docNames` and `blockComponents`); they become warnings in the next minor release. For the commands a topic writes, `runner_command` (written with a package runner), `plain_command` (written bare), `package_manager_command` (written for one package manager) and `doc_token` (a token that does not parse) notes each give the file, line and the token to write. A `doc_target_not_found` note names a doc whose `replaces` or `extends` names no topic and no guide of the CLI's docs or the package's own (such as a namespace, with the guides below it), so it changes nothing unless an app also installs a package that provides it, and a `doc_section_unplaced` note a section whose `before` or `after` names no section of the topic or guide it extends, so it is added at the end, and a `duplicate_guide_replacement` note two docs of the package that replace one guide, of which only the last is read; they become warnings in the next minor release. When the manifest loads, `data.docTypes` holds the doc type check: `status` (`checked` | `skipped`), `reason` when skipped, `typescript`, `docs` (doc values checked), `findings` ({doc, line, export, type, field, problem: `unknown_field` | `missing_field` | `wrong_type`, severity: `warning`, message, fix}), `unchecked` ({doc, reason}: a doc that could not be fully checked, or a root its reader cannot read), and `fixtures` when the components or docs root holds test fixture docs under `__tests__`: how many, none of them checked. When the manifest loads, `data.docNames` lists the component doc names it could not judge: `status` (`checked`), `findings` (always empty; a doc name the module its import names provably does not export is a `doc_name_mismatch` note, with its fix in the message) and `unchecked` ({file, name, reason}: a doc whose `name` differs from the name it is listed under and whose source exports cannot all be read, such as a re-export from another package). When the manifest loads, `data.blockComponents` lists the component names templates give in `exampleFor` or `componentsUsed` that could not be judged: `status` (`checked`), `findings` (always empty; a name neither the package nor Core has, and the template does not import, is an `unknown_block_component` note, with its fix in the message) and `unchecked` ({file, name, reason}: a name the template may reach through anything other than named imports and re-exports from Core, React, StyleX, local helpers or the entry of the package itself, such as an import from another package, a default or namespace import, an alias of or member read off an imported binding, require() or a dynamic import(), or a local module that cannot be read, or any name Core would have to resolve when Core is not installed). Since 0.7.3 each import apps cannot use is a note in `data.notes`, its fix inside the message, listed only: it does not fail this command or `integration check --strict`, and fails `--strict` from the next minor release. The codes are `component_import_not_exported`, `component_import_other_package`, `component_import_missing_name`, `example_import_not_exported`, `example_import_missing_name`, `template_import_not_exported`, `template_import_outside_root`, `template_private_import`, `template_import_missing_name` and `template_no_default_export`. Since 0.7.4 the examples a package ships are checked the same way: `component_without_example` (a published component no block template shows with `exampleFor` and `isShowcase: true`, or names in `alsoShowcaseFor`), `template_category` (a template category written as a path, such as `components/X`), `showcase_not_standalone` (a showcase that imports server-only code or reads `process.env` past `NODE_ENV`) and `template_asset_not_packed` (a `new URL(…, import.meta.url)` asset that is missing, or that `npm pack --dry-run` leaves out of the package). When npm cannot list the package's files, an asset no `files` entry can reach is still a note, and any other is listed in `data.exampleAssets` (`{status: 'checked', findings: [], unchecked}`, present only when it lists any) as {file, asset, reason}; `integration check` counts them as not compared. When the manifest loads, `data.publicImports` is `{status: 'checked', findings: [], unchecked}`: `unchecked` lists each import the check could not judge, as {file, specifier, reason}, the reason starting `example <label>:` for an import in a component example: an `exports` target not built yet; a module whose export list cannot be read in full (CommonJS, or a declaration file it cannot read); a root import in a package with no `exports` (the root module `main` names is not read); every name an import (other than a component doc's own component) names that its module does not export, while a TypeScript file in the package has a `declare module` block for a relative path or the package's own name or a subpath of it, which can add names to that module (a `declare module` in a comment, `declare global`, a wildcard such as `'*.css'`, and another package's name do not count; a file whose text has `declare module` but that cannot be parsed counts); the same for every such name when the package has more than 5,000 files to search for that block; a deep path into build output not built yet in a package with no `exports`; a template import of Core when `@astryxdesign/core` is not installed beside the package (a `packages/core` of the workspace under another name does not count); every import of the package's own name when package.json has no `name` or a `name` that is not a bare package name; one entry for the whole check when package.json cannot be read; and an import of a subpath whose `exports` entry has only a `types` target, unless it is `import type`, every binding is an inline `type`, or every name it imports is a type its types file declares: a value import of a name that file does not declare as a type, a namespace or side-effect import, or any import when the types file cannot be read (it may be build output). `integration check` counts the unchecked as not compared; they never fail it. `data.olderCliNotes` ({file, kind: `template` | `namespace`, field, message}), for the local package, lists each descriptor field a release before 0.7.4 refuses while the package's CLI peer range admits one, such as `stability` on a template or namespace doc; it is present only when it has entries, is never counted, and never fails a check.",
|
|
66
66
|
},
|
|
67
67
|
],
|
|
68
68
|
examples: [
|
package/api/search/ORDERING.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Rule
|
|
6
6
|
|
|
7
|
-
`spec:AST-083` owns search's result order; this file describes the data that implements it. Inside one score band, a searcher's static weights decide the order. Matches with the same score move together as one block,
|
|
7
|
+
`spec:AST-083` owns search's result order; this file describes the data that implements it. Inside one score band, a searcher's static weights decide the order. Matches with the same score move together as one block, placed by the learned position of the block's first match: moving each one on its own breaks search's existing rules for tied matches. Inside a block, the lexical ranker's order holds, except below the first result: there a block of one domain puts a part of the first result first (its name words start with the first result's; at most two parts lead across an answer), then the match whose matched words are rarer in the catalog. Matches never cross bands or kinds. There is no model runtime: every number is a plain static value read at load time.
|
|
8
8
|
|
|
9
9
|
## Files
|
|
10
10
|
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
sectionSummary,
|
|
20
20
|
} from '../../foundation/discovery/docs-section-key.mjs';
|
|
21
21
|
import {sectionProse, codeTerms, headings, plain} from './_doc-text.mjs';
|
|
22
|
+
import {loadAuthoringSelfDocs} from '../../foundation/discovery/authoring-self-docs.mjs';
|
|
22
23
|
|
|
23
24
|
/** @typedef {import('./_lexical.mjs').Candidate} Candidate */
|
|
24
25
|
|
|
@@ -39,6 +40,13 @@ import {sectionProse, codeTerms, headings, plain} from './_doc-text.mjs';
|
|
|
39
40
|
export async function gatherDocs(cwd) {
|
|
40
41
|
/** @type {Candidate[]} */
|
|
41
42
|
const candidates = [];
|
|
43
|
+
// Experimental docs (spec:AST-017 FR27) are never search results: they are
|
|
44
|
+
// read on their own routes, so search answers as it would without them.
|
|
45
|
+
const hidden = new Set(
|
|
46
|
+
(await loadAuthoringSelfDocs()).loaded
|
|
47
|
+
.filter(({doc}) => isExperimentalDoc(doc))
|
|
48
|
+
.map(({doc}) => doc.name),
|
|
49
|
+
);
|
|
42
50
|
let catalog;
|
|
43
51
|
try {
|
|
44
52
|
catalog = await loadDocsCatalog(cwd);
|
|
@@ -63,7 +71,17 @@ export async function gatherDocs(cwd) {
|
|
|
63
71
|
// A topic that cannot be loaded is reported by the commands that own
|
|
64
72
|
// integration issues; search just cannot index it.
|
|
65
73
|
}
|
|
66
|
-
const
|
|
74
|
+
const read = lowered?.doc ?? null;
|
|
75
|
+
if (isExperimentalDoc(read)) continue;
|
|
76
|
+
const doc =
|
|
77
|
+
read && hidden.size > 0 && Array.isArray(read.sections)
|
|
78
|
+
? {
|
|
79
|
+
...read,
|
|
80
|
+
sections: read.sections.filter(
|
|
81
|
+
(/** @type {any} */ section) => !hidden.has(section.id),
|
|
82
|
+
),
|
|
83
|
+
}
|
|
84
|
+
: read;
|
|
67
85
|
// A flat topic lives in its topic level; its hits say so, and name
|
|
68
86
|
// the package each section came from.
|
|
69
87
|
const home = tree?.get(entry.name);
|
|
@@ -102,6 +120,7 @@ export async function gatherDocs(cwd) {
|
|
|
102
120
|
for (const node of tree.nodes.values()) {
|
|
103
121
|
// A flat topic is indexed above, as a topic.
|
|
104
122
|
if (node.ref?.flatTopic) continue;
|
|
123
|
+
if (isExperimentalNode(tree, node)) continue;
|
|
105
124
|
// A tree hit names where it lives: its ancestors' titles, then its own.
|
|
106
125
|
const path = [...tree.ancestors(node).map(a => a.title), node.title];
|
|
107
126
|
if (node.kind === 'generic') {
|
|
@@ -175,6 +194,26 @@ export async function gatherDocs(cwd) {
|
|
|
175
194
|
return candidates;
|
|
176
195
|
}
|
|
177
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Is this doc an experimental surface's (spec:AST-017 FR21)?
|
|
199
|
+
* @param {any} doc
|
|
200
|
+
*/
|
|
201
|
+
function isExperimentalDoc(doc) {
|
|
202
|
+
return doc?.stability === 'experimental';
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Does this tree node document an experimental surface: a typed doc marked
|
|
207
|
+
* experimental, or anything under an experimental namespace?
|
|
208
|
+
* @param {any} tree
|
|
209
|
+
* @param {any} node
|
|
210
|
+
*/
|
|
211
|
+
function isExperimentalNode(tree, node) {
|
|
212
|
+
return [...tree.ancestors(node), node].some((/** @type {any} */ each) =>
|
|
213
|
+
isExperimentalDoc(each.ref?.selfDoc),
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
178
217
|
/**
|
|
179
218
|
* The candidates one topic yields: the topic itself, and one per section when
|
|
180
219
|
* it has more than one. A topic's command lists its sections, and a section's
|
package/api/search/_order.d.mts
CHANGED
|
@@ -23,10 +23,10 @@ export function orderMatches(table: EntryTable, order: number[], lexical: import
|
|
|
23
23
|
*/
|
|
24
24
|
export function integrationTies(items: Item[]): Item[];
|
|
25
25
|
export function bandOf(score: number): number;
|
|
26
|
+
export type EntryTable = import("./_entries.mjs").EntryTable;
|
|
26
27
|
export type Item = {
|
|
27
28
|
res: any;
|
|
28
29
|
i: number;
|
|
29
30
|
band: number;
|
|
30
31
|
learned: number;
|
|
31
32
|
};
|
|
32
|
-
export type EntryTable = import("./_entries.mjs").EntryTable;
|
package/api/search/_order.mjs
CHANGED
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
* and a synonym name match can score under 55, so inside a band a weaker match
|
|
10
10
|
* can lead a stronger one when the weights favor it. Inside such a
|
|
11
11
|
* run the learned order places the matches, with these exceptions: matches
|
|
12
|
-
* that scored the same
|
|
13
|
-
* query
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* that scored the same move as one block; an entry the query names leads; in a
|
|
13
|
+
* query of one or two words, the matches on every word keep their lexical
|
|
14
|
+
* order; and an integration's matches that scored the same keep theirs.
|
|
15
|
+
* Below the first result, a block of one domain is ordered by fit (tiesByFit): a part of the first result, then rarer matched
|
|
16
|
+
* words, then the lexical order.
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
19
|
import {entryOf} from './_entries.mjs';
|
|
19
|
-
import {words} from './_query-words.mjs';
|
|
20
|
+
import {fold, nameWords, words} from './_query-words.mjs';
|
|
20
21
|
import {searchedComponentsOf} from './_result.mjs';
|
|
21
22
|
|
|
22
23
|
/** @typedef {import('./_entries.mjs').EntryTable} EntryTable */
|
|
@@ -104,9 +105,12 @@ export function orderMatches(table, order, lexical, query, limit) {
|
|
|
104
105
|
ranked = keepLexical(ranked, it => (it.res.score ?? 0) >= FULL_COVERAGE);
|
|
105
106
|
}
|
|
106
107
|
ranked = integrationTies(ranked);
|
|
108
|
+
// Each whole tie is ordered by fit before the limit, so every limit shows
|
|
109
|
+
// the top of one answer.
|
|
110
|
+
const shown = tiesByFit(ranked, table, blockOf).slice(0, limit);
|
|
107
111
|
const response = {
|
|
108
112
|
...lexical,
|
|
109
|
-
data: {...lexical.data, results:
|
|
113
|
+
data: {...lexical.data, results: shown.map(it => it.res)},
|
|
110
114
|
};
|
|
111
115
|
const searched = searchedComponentsOf.get(lexical);
|
|
112
116
|
if (searched) searchedComponentsOf.set(response, searched);
|
|
@@ -117,6 +121,71 @@ export function orderMatches(table, order, lexical, query, limit) {
|
|
|
117
121
|
* @typedef {{res: any, i: number, band: number, learned: number}} Item
|
|
118
122
|
*/
|
|
119
123
|
|
|
124
|
+
/** How many parts of the first result lead their ties, across an answer. */
|
|
125
|
+
const PARTS_FIRST = 2;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Below the first result, matches the lexical ranker scored the same keep
|
|
129
|
+
* their block but are no longer in name order inside it: a part or sibling of
|
|
130
|
+
* the first result leads (TableRow after Table), then the match whose matched
|
|
131
|
+
* words are rarer in the catalog, so a match on a common word alone sits
|
|
132
|
+
* below one on the query's telling words. Nothing crosses a block.
|
|
133
|
+
* @param {Item[]} ranked
|
|
134
|
+
* @param {EntryTable} table
|
|
135
|
+
* @param {(item: Item) => string} blockOf
|
|
136
|
+
* @returns {Item[]}
|
|
137
|
+
*/
|
|
138
|
+
function tiesByFit(ranked, table, blockOf) {
|
|
139
|
+
if (ranked.length < 3) return ranked;
|
|
140
|
+
const first = nameWords(String(ranked[0].res.name ?? '')).map(fold);
|
|
141
|
+
const idf = table.fields.desc.idf;
|
|
142
|
+
const rarest = Math.max(0, ...idf.values());
|
|
143
|
+
/** @param {Item} it */
|
|
144
|
+
const related = it => {
|
|
145
|
+
// A part's name words start with the first result's whole name words:
|
|
146
|
+
// TableRow is a part of Table, Table is no part of Tab.
|
|
147
|
+
const name = nameWords(String(it.res.name ?? '')).map(fold);
|
|
148
|
+
return (
|
|
149
|
+
(first.length > 0 &&
|
|
150
|
+
name.length > first.length &&
|
|
151
|
+
first.every((w, n) => name[n] === w)) ||
|
|
152
|
+
/^member of /.test(it.res.reason ?? '')
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
/** @param {Item} it */
|
|
156
|
+
const rarity = it => {
|
|
157
|
+
const m = /^matches \d+\/\d+ terms: (.*)$/.exec(it.res.reason ?? '');
|
|
158
|
+
if (!m) return 0;
|
|
159
|
+
let sum = 0;
|
|
160
|
+
// A matched term counts by its alphanumeric parts (`three-dot`), and a
|
|
161
|
+
// part the catalog never uses is as rare as a word can be.
|
|
162
|
+
for (const t of m[1].split(', '))
|
|
163
|
+
for (const part of words(t)) sum += idf.get(fold(part)) ?? rarest;
|
|
164
|
+
return sum;
|
|
165
|
+
};
|
|
166
|
+
const out = [ranked[0]];
|
|
167
|
+
let parts = 0;
|
|
168
|
+
for (let i = 1; i < ranked.length;) {
|
|
169
|
+
let j = i;
|
|
170
|
+
const at = (/** @type {Item} */ it) => `${blockOf(it)}:${it.res.domain}`;
|
|
171
|
+
while (j < ranked.length && at(ranked[j]) === at(ranked[i])) j++;
|
|
172
|
+
const run = ranked.slice(i, j);
|
|
173
|
+
if (run.length > 1) {
|
|
174
|
+
const keyed = run.map((it, n) => {
|
|
175
|
+
// At most PARTS_FIRST parts lead, across the answer, so a family
|
|
176
|
+
// with many parts does not crowd out what else the query matched.
|
|
177
|
+
const r = parts < PARTS_FIRST && related(it);
|
|
178
|
+
if (r) parts++;
|
|
179
|
+
return {it, n, r, f: rarity(it)};
|
|
180
|
+
});
|
|
181
|
+
keyed.sort((a, b) => Number(b.r) - Number(a.r) || b.f - a.f || a.n - b.n);
|
|
182
|
+
out.push(...keyed.map(k => k.it));
|
|
183
|
+
} else out.push(...run);
|
|
184
|
+
i = j;
|
|
185
|
+
}
|
|
186
|
+
return out;
|
|
187
|
+
}
|
|
188
|
+
|
|
120
189
|
/**
|
|
121
190
|
* The matches `pick` selects keep the places they hold, filled in lexical
|
|
122
191
|
* order.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Below the first result, matches the lexical ranker scored the same
|
|
5
|
+
* are ordered by fit, not by name: a part of the first result leads its tie,
|
|
6
|
+
* then the match on the query's rarer words. Scores, reasons and the set of
|
|
7
|
+
* results stay the lexical ranker's (see _order.test.mjs).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {describe, expect, it} from 'vitest';
|
|
11
|
+
import {search} from './search.mjs';
|
|
12
|
+
|
|
13
|
+
describe('ties below the first result', () => {
|
|
14
|
+
it('a part of the first result leads its tie', async () => {
|
|
15
|
+
const results = (await search('progress bar with percent')).data.results;
|
|
16
|
+
expect(results[0]).toMatchObject({name: 'ProgressBar'});
|
|
17
|
+
expect(results[1]?.name).toMatch(/^ProgressBar./);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('shows the top of one answer at every limit', async () => {
|
|
21
|
+
const query = 'progress bar with percent';
|
|
22
|
+
const all = (await search(query)).data.results.map(r => r.name);
|
|
23
|
+
const three = (await search(query, {limit: 3})).data.results.map(
|
|
24
|
+
r => r.name,
|
|
25
|
+
);
|
|
26
|
+
expect(three).toEqual(all.slice(0, 3));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('reads a punctuated query word by its parts', async () => {
|
|
30
|
+
const results = (await search('three-dot menu with actions')).data.results;
|
|
31
|
+
expect(results.slice(0, 3).map(r => r.name)).toContain('MoreMenu');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('lets few parts lead, so a big family keeps the rest in view', async () => {
|
|
35
|
+
const results = (await search('chat')).data.results.map(r => r.name);
|
|
36
|
+
expect(results).toContain('ai-chat');
|
|
37
|
+
expect(results).toContain('ai-chat-landing');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The installed icon sets and the project's choice. A project the CLI cannot
|
|
6
|
+
* read has no icon set, so templates are written unchanged.
|
|
7
|
+
* @param {string} cwd
|
|
8
|
+
* @returns {Promise<{sets: import('../../foundation/discovery/icon-set-discovery.mjs').DiscoveredIconSet[], choice: import('../../foundation/discovery/icon-set-discovery.mjs').IconSetChoice}>}
|
|
9
|
+
*/
|
|
10
|
+
export function loadTemplateIconSets(cwd: string): Promise<{
|
|
11
|
+
sets: import("../../foundation/discovery/icon-set-discovery.mjs").DiscoveredIconSet[];
|
|
12
|
+
choice: import("../../foundation/discovery/icon-set-discovery.mjs").IconSetChoice;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The `template` subject's adapter for icon mapping (AST-084 FR9):
|
|
5
|
+
* reads the project's icon sets through the `Project` seam.
|
|
6
|
+
*
|
|
7
|
+
* @position api/template — adapter read by the template dispatcher
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {Project} from '../../foundation/config/project.mjs';
|
|
11
|
+
import {NO_ICON_SETS} from '../../foundation/discovery/template-icons.mjs';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The installed icon sets and the project's choice. A project the CLI cannot
|
|
15
|
+
* read has no icon set, so templates are written unchanged.
|
|
16
|
+
* @param {string} cwd
|
|
17
|
+
* @returns {Promise<{sets: import('../../foundation/discovery/icon-set-discovery.mjs').DiscoveredIconSet[], choice: import('../../foundation/discovery/icon-set-discovery.mjs').IconSetChoice}>}
|
|
18
|
+
*/
|
|
19
|
+
export async function loadTemplateIconSets(cwd) {
|
|
20
|
+
try {
|
|
21
|
+
const project = await Project.load(cwd);
|
|
22
|
+
const {sets, choice} = await project.iconSets();
|
|
23
|
+
// Icon sets are experimental (spec:AST-017 FR27): a copied template
|
|
24
|
+
// follows one only when the project opts in with `experimental.iconSet`.
|
|
25
|
+
if (!choice.configured) return NO_ICON_SETS;
|
|
26
|
+
return {sets, choice};
|
|
27
|
+
} catch (error) {
|
|
28
|
+
return {
|
|
29
|
+
sets: [],
|
|
30
|
+
choice: {
|
|
31
|
+
status: 'none',
|
|
32
|
+
reason: `The project could not be read, so no icon set applies: ${error instanceof Error ? error.message : String(error)}`,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
* Scaffold an already-resolved template to `targetPath` (relative to `cwd`) and
|
|
6
6
|
* return the `template.copy` receipt.
|
|
7
7
|
* @param {import('../../../foundation/discovery/template-adapter.mjs').DiscoveredTemplate} match
|
|
8
|
-
* @param {{targetPath: string, cwd: string, overwrite?: boolean}} ctx
|
|
8
|
+
* @param {{targetPath: string, cwd: string, overwrite?: boolean, iconSets?: Parameters<typeof mapTemplateIcons>[1]}} ctx
|
|
9
|
+
* `iconSets`: the project's icon sets; without them the icons are unchanged
|
|
9
10
|
* @returns {import('../template.type.mjs').TemplateCopyResponse}
|
|
10
11
|
*/
|
|
11
|
-
export function templateCopy(match: import("../../../foundation/discovery/template-adapter.mjs").DiscoveredTemplate, { targetPath, cwd, overwrite }: {
|
|
12
|
+
export function templateCopy(match: import("../../../foundation/discovery/template-adapter.mjs").DiscoveredTemplate, { targetPath, cwd, overwrite, iconSets }: {
|
|
12
13
|
targetPath: string;
|
|
13
14
|
cwd: string;
|
|
14
15
|
overwrite?: boolean;
|
|
16
|
+
iconSets?: Parameters<typeof mapTemplateIcons>[1];
|
|
15
17
|
}): import("../template.type.mjs").TemplateCopyResponse;
|
|
18
|
+
import { mapTemplateIcons } from '../../../foundation/discovery/template-icons.mjs';
|
|
@@ -20,15 +20,23 @@ import {AstryxError, writeFailed} from '../../error.mjs';
|
|
|
20
20
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
21
21
|
import {pkgOf, replaceDemoMedia} from '../../../foundation/discovery/template-adapter.mjs';
|
|
22
22
|
import {analyzeTemplateNeeds} from '../../../foundation/discovery/template-needs.mjs';
|
|
23
|
+
import {
|
|
24
|
+
NO_ICON_SETS,
|
|
25
|
+
mapTemplateIcons,
|
|
26
|
+
} from '../../../foundation/discovery/template-icons.mjs';
|
|
23
27
|
|
|
24
28
|
/**
|
|
25
29
|
* Scaffold an already-resolved template to `targetPath` (relative to `cwd`) and
|
|
26
30
|
* return the `template.copy` receipt.
|
|
27
31
|
* @param {import('../../../foundation/discovery/template-adapter.mjs').DiscoveredTemplate} match
|
|
28
|
-
* @param {{targetPath: string, cwd: string, overwrite?: boolean}} ctx
|
|
32
|
+
* @param {{targetPath: string, cwd: string, overwrite?: boolean, iconSets?: Parameters<typeof mapTemplateIcons>[1]}} ctx
|
|
33
|
+
* `iconSets`: the project's icon sets; without them the icons are unchanged
|
|
29
34
|
* @returns {import('../template.type.mjs').TemplateCopyResponse}
|
|
30
35
|
*/
|
|
31
|
-
export function templateCopy(
|
|
36
|
+
export function templateCopy(
|
|
37
|
+
match,
|
|
38
|
+
{targetPath, cwd, overwrite = false, iconSets = NO_ICON_SETS},
|
|
39
|
+
) {
|
|
32
40
|
if (!fs.existsSync(match.filePath)) {
|
|
33
41
|
throw new AstryxError(
|
|
34
42
|
`No source file found for template "${match.dirName}"`,
|
|
@@ -84,9 +92,16 @@ export function templateCopy(match, {targetPath, cwd, overwrite = false}) {
|
|
|
84
92
|
// Strip demo image references so the scaffolded file renders without a
|
|
85
93
|
// Meta-only network dependency. Read before any write, so a failure below
|
|
86
94
|
// leaves nothing behind.
|
|
87
|
-
const {source:
|
|
95
|
+
const {source: withMedia, demoMediaReplaced} = replaceDemoMedia(
|
|
88
96
|
fs.readFileSync(match.filePath, 'utf-8'),
|
|
89
97
|
);
|
|
98
|
+
// Icons follow the project's icon set (AST-084 FR9). An icon with no match
|
|
99
|
+
// keeps its import, so its library stays a needed dependency below.
|
|
100
|
+
const {source: outputSource, icons} = mapTemplateIcons(
|
|
101
|
+
withMedia,
|
|
102
|
+
iconSets,
|
|
103
|
+
match.icons,
|
|
104
|
+
);
|
|
90
105
|
try {
|
|
91
106
|
fs.mkdirSync(outputDir, {recursive: true});
|
|
92
107
|
fs.writeFileSync(outputFilePath, outputSource);
|
|
@@ -115,6 +130,7 @@ export function templateCopy(match, {targetPath, cwd, overwrite = false}) {
|
|
|
115
130
|
notes,
|
|
116
131
|
missingPackages: missing,
|
|
117
132
|
installCommand,
|
|
133
|
+
...(icons ? {icons} : {}),
|
|
118
134
|
},
|
|
119
135
|
};
|
|
120
136
|
}
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Build the `template.show` envelope for an already-resolved template.
|
|
6
6
|
* @param {import('../../../foundation/discovery/template-adapter.mjs').DiscoveredTemplate} match
|
|
7
|
+
* @param {{iconSets?: Parameters<typeof mapTemplateIcons>[1]}} [options]
|
|
8
|
+
* the project's icon sets; without them the template's icons are unchanged
|
|
7
9
|
* @returns {import('../template.type.mjs').TemplateShowResponse}
|
|
8
10
|
*/
|
|
9
|
-
export function templateShow(match: import("../../../foundation/discovery/template-adapter.mjs").DiscoveredTemplate
|
|
11
|
+
export function templateShow(match: import("../../../foundation/discovery/template-adapter.mjs").DiscoveredTemplate, { iconSets }?: {
|
|
12
|
+
iconSets?: Parameters<typeof mapTemplateIcons>[1];
|
|
13
|
+
}): import("../template.type.mjs").TemplateShowResponse;
|
|
14
|
+
import { mapTemplateIcons } from '../../../foundation/discovery/template-icons.mjs';
|
|
@@ -16,13 +16,19 @@ import {
|
|
|
16
16
|
pkgOf,
|
|
17
17
|
replaceDemoMedia,
|
|
18
18
|
} from '../../../foundation/discovery/template-adapter.mjs';
|
|
19
|
+
import {
|
|
20
|
+
NO_ICON_SETS,
|
|
21
|
+
mapTemplateIcons,
|
|
22
|
+
} from '../../../foundation/discovery/template-icons.mjs';
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* Build the `template.show` envelope for an already-resolved template.
|
|
22
26
|
* @param {import('../../../foundation/discovery/template-adapter.mjs').DiscoveredTemplate} match
|
|
27
|
+
* @param {{iconSets?: Parameters<typeof mapTemplateIcons>[1]}} [options]
|
|
28
|
+
* the project's icon sets; without them the template's icons are unchanged
|
|
23
29
|
* @returns {import('../template.type.mjs').TemplateShowResponse}
|
|
24
30
|
*/
|
|
25
|
-
export function templateShow(match) {
|
|
31
|
+
export function templateShow(match, {iconSets = NO_ICON_SETS} = {}) {
|
|
26
32
|
if (!fs.existsSync(match.filePath)) {
|
|
27
33
|
throw new AstryxError(
|
|
28
34
|
`No source file found for template "${match.dirName}"`,
|
|
@@ -34,9 +40,11 @@ export function templateShow(match) {
|
|
|
34
40
|
// The source template.copy writes (spec:AST-028 FR7): a template printed and
|
|
35
41
|
// pasted must not keep a media path only Astryx's previews serve, and the
|
|
36
42
|
// caller is told how many it replaced, the way the copy receipt tells it.
|
|
37
|
-
const {source, demoMediaReplaced} = replaceDemoMedia(
|
|
43
|
+
const {source: withMedia, demoMediaReplaced} = replaceDemoMedia(
|
|
38
44
|
fs.readFileSync(match.filePath, 'utf-8'),
|
|
39
45
|
);
|
|
46
|
+
// Icons follow the project's icon set, as template.copy writes them.
|
|
47
|
+
const {source, icons} = mapTemplateIcons(withMedia, iconSets, match.icons);
|
|
40
48
|
|
|
41
49
|
return {
|
|
42
50
|
type: 'template.show',
|
|
@@ -48,6 +56,7 @@ export function templateShow(match) {
|
|
|
48
56
|
components: extractComponents(match.filePath),
|
|
49
57
|
source,
|
|
50
58
|
demoMediaReplaced,
|
|
59
|
+
...(icons ? {icons} : {}),
|
|
51
60
|
},
|
|
52
61
|
};
|
|
53
62
|
}
|
|
@@ -250,6 +250,32 @@ describe('external showcase blocks: canonical .doc.* plus released .template.* c
|
|
|
250
250
|
expect(result.name).toBe('Bar — Showcase');
|
|
251
251
|
});
|
|
252
252
|
|
|
253
|
+
it('findShowcase prefers the showcase that names the component in exampleFor', async () => {
|
|
254
|
+
makeShowcaseFixture();
|
|
255
|
+
// Bar's showcase also uses Chip; Chip's own showcase sits in a folder
|
|
256
|
+
// that does not carry its name and says so only through exampleFor.
|
|
257
|
+
const dir = path.join(
|
|
258
|
+
tmpDir,
|
|
259
|
+
'node_modules',
|
|
260
|
+
'@test',
|
|
261
|
+
'ext',
|
|
262
|
+
'blocks',
|
|
263
|
+
'components',
|
|
264
|
+
'Gallery',
|
|
265
|
+
);
|
|
266
|
+
fs.mkdirSync(dir, {recursive: true});
|
|
267
|
+
fs.writeFileSync(
|
|
268
|
+
path.join(dir, 'ChipCard.doc.mjs'),
|
|
269
|
+
"export default {type: 'block', name: 'Chip — Card', description: 'Chip showcase.', category: 'Test - Showcases', exampleFor: 'Chip', isShowcase: true, componentsUsed: ['Chip']};\n",
|
|
270
|
+
);
|
|
271
|
+
fs.writeFileSync(
|
|
272
|
+
path.join(dir, 'ChipCard.tsx'),
|
|
273
|
+
"'use client';\nexport default function ChipCard() { return <div>Chip</div>; }",
|
|
274
|
+
);
|
|
275
|
+
const result = await findShowcase('Chip', tmpDir);
|
|
276
|
+
expect(result?.name).toBe('Chip — Card');
|
|
277
|
+
});
|
|
278
|
+
|
|
253
279
|
it('findRelatedBlocks finds both suffix families', async () => {
|
|
254
280
|
makeShowcaseFixture();
|
|
255
281
|
const foo = await findRelatedBlocks('Foo', tmpDir);
|
|
@@ -30,6 +30,7 @@ import {templateShow} from './show/show.mjs';
|
|
|
30
30
|
import {templateSkeleton} from './skeleton/skeleton.mjs';
|
|
31
31
|
import {templateCopy} from './copy/copy.mjs';
|
|
32
32
|
import {templateCdn} from './cdn/cdn.mjs';
|
|
33
|
+
import {loadTemplateIconSets} from './_adapter.mjs';
|
|
33
34
|
|
|
34
35
|
// Re-export the shared discovery/IO + cross-command helpers so this module
|
|
35
36
|
// stays the single import surface for the template family (same exports as
|
|
@@ -212,9 +213,12 @@ export async function template(name, options = {}) {
|
|
|
212
213
|
return templateSkeleton(match, templates);
|
|
213
214
|
}
|
|
214
215
|
|
|
216
|
+
// The project's icon set decides how the template's icons are written
|
|
217
|
+
// (AST-084 FR9): both the printed source and the copied file follow it.
|
|
218
|
+
const iconSets = await loadTemplateIconSets(cwd);
|
|
215
219
|
if (show || !targetPath) {
|
|
216
|
-
return templateShow(match);
|
|
220
|
+
return templateShow(match, {iconSets});
|
|
217
221
|
}
|
|
218
222
|
|
|
219
|
-
return templateCopy(match, {targetPath, cwd, overwrite});
|
|
223
|
+
return templateCopy(match, {targetPath, cwd, overwrite, iconSets});
|
|
220
224
|
}
|
|
@@ -72,6 +72,7 @@ export type TemplateShowResponse = {
|
|
|
72
72
|
components: string[];
|
|
73
73
|
source: string;
|
|
74
74
|
demoMediaReplaced: number;
|
|
75
|
+
icons?: TemplateIconsReport | undefined;
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
78
|
/**
|
|
@@ -108,8 +109,60 @@ export type TemplateCopyResponse = {
|
|
|
108
109
|
notes: string[];
|
|
109
110
|
missingPackages: string[];
|
|
110
111
|
installCommand: string | null;
|
|
112
|
+
icons?: TemplateIconsReport | undefined;
|
|
111
113
|
};
|
|
112
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* How a template's icons follow the project's icon set (AST-084 FR10).
|
|
117
|
+
* Without a project icon set (`status` `none`, `ambiguous`, or `missing`)
|
|
118
|
+
* the source is unchanged and both lists are empty.
|
|
119
|
+
*/
|
|
120
|
+
export type TemplateIconsReport = {
|
|
121
|
+
/**
|
|
122
|
+
* The project's icon-set state.
|
|
123
|
+
*/
|
|
124
|
+
status: "selected" | "none" | "ambiguous" | "missing" | "withdrawn";
|
|
125
|
+
/**
|
|
126
|
+
* The project's icon set as `<package>/<set>`, when selected.
|
|
127
|
+
*/
|
|
128
|
+
set: string | null;
|
|
129
|
+
/**
|
|
130
|
+
* Why the project has that set, or none.
|
|
131
|
+
*/
|
|
132
|
+
reason: string;
|
|
133
|
+
/**
|
|
134
|
+
* Icons rewritten to the project's set, and the rule that chose each one: a reviewed `exact` or `strong` match, or the icon the set's `map` names for the icon definition the template declares.
|
|
135
|
+
*/
|
|
136
|
+
mapped: Array<{
|
|
137
|
+
source: {
|
|
138
|
+
module: string;
|
|
139
|
+
export: string;
|
|
140
|
+
};
|
|
141
|
+
target: {
|
|
142
|
+
set: string;
|
|
143
|
+
package: string;
|
|
144
|
+
id: string;
|
|
145
|
+
module: string;
|
|
146
|
+
export: string;
|
|
147
|
+
};
|
|
148
|
+
by: "match" | "definition";
|
|
149
|
+
}>;
|
|
150
|
+
/**
|
|
151
|
+
* Icons left as the template wrote them, with why, and a `likely` reviewed match as a suggestion when the project set has one. Every declared key is mapped or kept; `module` is null for a key the template does not import, and `export` is `default` for a default import and `*` for a namespace import.
|
|
152
|
+
*/
|
|
153
|
+
kept: Array<{
|
|
154
|
+
module: string | null;
|
|
155
|
+
export: string;
|
|
156
|
+
reason: string;
|
|
157
|
+
suggestion?: {
|
|
158
|
+
set: string;
|
|
159
|
+
id: string;
|
|
160
|
+
module: string;
|
|
161
|
+
export: string;
|
|
162
|
+
confidence: "likely";
|
|
163
|
+
};
|
|
164
|
+
}>;
|
|
165
|
+
};
|
|
113
166
|
/**
|
|
114
167
|
* astryx --json template --cdn [path]
|
|
115
168
|
* `written: false` with `reason: 'exists'` is a success: the command is safe to
|