@astryxdesign/cli 0.7.4-canary.d329515 → 0.7.4-canary.d648470
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/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.d.mts +11 -1
- package/api/integration/validate-integration.mjs +68 -5
- package/api/integration/validate-integration.type.d.mts +71 -0
- package/api/integration/validate-integration.type.mjs +40 -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.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 +155 -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 +6 -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 +29 -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.mjs +3 -1
- package/foundation/response/response-types.doc.mjs +58 -1
- package/package.json +9 -9
|
@@ -104,6 +104,24 @@ export function callSources(project: Project | undefined, request?: {
|
|
|
104
104
|
timeoutMs?: number;
|
|
105
105
|
official?: OfficialList;
|
|
106
106
|
}): Promise<CatalogResult>;
|
|
107
|
+
/**
|
|
108
|
+
* The item kinds discover reads in the project at the working directory, or
|
|
109
|
+
* the stable kinds when it cannot be read.
|
|
110
|
+
* @returns {Promise<readonly string[]>}
|
|
111
|
+
*/
|
|
112
|
+
export function loadReadKinds(): Promise<readonly string[]>;
|
|
113
|
+
/**
|
|
114
|
+
* The item kinds discover reads in this project: every stable kind, and the
|
|
115
|
+
* experimental ones when the project opts in.
|
|
116
|
+
* @param {Project | undefined} project
|
|
117
|
+
* @returns {readonly string[]}
|
|
118
|
+
*/
|
|
119
|
+
export function readKinds(project: Project | undefined): readonly string[];
|
|
120
|
+
/**
|
|
121
|
+
* Whether the project opts into icon sets with `experimental.iconSet`.
|
|
122
|
+
* @param {Project | undefined} project
|
|
123
|
+
*/
|
|
124
|
+
export function optedIntoIconSets(project: Project | undefined): boolean;
|
|
107
125
|
/**
|
|
108
126
|
* Official packages first, in the official list's order; the rest keep theirs.
|
|
109
127
|
* @template T
|
|
@@ -192,8 +210,15 @@ export function loadValidatedDoc(result: ComponentResolution, { lang, zh }: {
|
|
|
192
210
|
export const OFFICIAL_SOURCE_NAME: "Astryx";
|
|
193
211
|
/** The official list, generated from the repository when the CLI is built. */
|
|
194
212
|
export const OFFICIAL_LIST_FILE: string;
|
|
213
|
+
/**
|
|
214
|
+
* The experimental item kinds a catalog may list (spec:AST-017 FR27):
|
|
215
|
+
* `icon-set`, read only in a project that sets `experimental.iconSet`.
|
|
216
|
+
*/
|
|
217
|
+
export const EXPERIMENTAL_KINDS: readonly ["icon-set"];
|
|
218
|
+
/** The item kinds every project reads: the catalog kinds, less experimental ones. */
|
|
219
|
+
export const STABLE_KINDS: ("component" | "theme" | "codemod" | "agent-doc" | "doc" | "template" | "icon-set")[];
|
|
195
220
|
/** The list and detail entry fields for each item kind, in display order. */
|
|
196
|
-
export const KIND_FIELDS: readonly [readonly ["component", "components"], readonly ["template", "templates"], readonly ["doc", "docs"], readonly ["theme", "themes"], readonly ["codemod", "codemods"], readonly ["agent-doc", "agentDocs"]];
|
|
221
|
+
export const KIND_FIELDS: readonly [readonly ["component", "components"], readonly ["template", "templates"], readonly ["doc", "docs"], readonly ["theme", "themes"], readonly ["codemod", "codemods"], readonly ["agent-doc", "agentDocs"], readonly ["icon-set", "iconSets"]];
|
|
197
222
|
export type ScannedPackage = import("./_package-scanner.mjs").ScannedPackage;
|
|
198
223
|
export type DiscoverPackage = import("../../authoring/discover/type").DiscoverPackage;
|
|
199
224
|
export type DiscoverSource = import("../../authoring/discover/type").DiscoverSource;
|
|
@@ -234,6 +259,29 @@ export type InstalledPackage = ScannedPackage & {
|
|
|
234
259
|
docs?: string[];
|
|
235
260
|
themes?: string[];
|
|
236
261
|
codemods?: string[];
|
|
262
|
+
iconSets?: string[];
|
|
263
|
+
iconSetDetails?: IconSetSummary[];
|
|
264
|
+
withdrawnIconSets?: Array<{
|
|
265
|
+
name: string;
|
|
266
|
+
reason: string;
|
|
267
|
+
}>;
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* What discover shows about one installed icon set (spec:AST-084 FR17).
|
|
271
|
+
*/
|
|
272
|
+
export type IconSetSummary = {
|
|
273
|
+
name: string;
|
|
274
|
+
displayName: string;
|
|
275
|
+
description: string;
|
|
276
|
+
license: string;
|
|
277
|
+
iconCount: number;
|
|
278
|
+
default?: {
|
|
279
|
+
variant?: string;
|
|
280
|
+
} | undefined;
|
|
281
|
+
/**
|
|
282
|
+
* the icon definitions its `map` covers
|
|
283
|
+
*/
|
|
284
|
+
definitions: string[];
|
|
237
285
|
};
|
|
238
286
|
/**
|
|
239
287
|
* What one source did on this run.
|
|
@@ -30,12 +30,16 @@ import {hostedRun} from '../../foundation/runtime/package-root.mjs';
|
|
|
30
30
|
import {scanAllPackages, findComponentInPackages} from './_package-scanner.mjs';
|
|
31
31
|
import {loadDocs} from '../../foundation/discovery/component-loader.mjs';
|
|
32
32
|
import {collectIdentities} from '../../foundation/integrations/contribution-inventory.mjs';
|
|
33
|
+
import {discoverIntegrationIconSets} from '../../foundation/discovery/icon-set-discovery.mjs';
|
|
33
34
|
import {detectPackageManager} from '../../foundation/env/package-manager.mjs';
|
|
34
35
|
import {isValidSemver, semverCompare} from '../../foundation/env/semver.mjs';
|
|
35
36
|
import {assertWithin} from '../../foundation/fs/path-safety.mjs';
|
|
36
37
|
import {userCacheDir} from '../../foundation/env/user-dirs.mjs';
|
|
37
38
|
import {CLI_ROOT, findInstalledPackage} from '../../foundation/fs/paths.mjs';
|
|
38
|
-
import {
|
|
39
|
+
import {
|
|
40
|
+
DISCOVER_KINDS,
|
|
41
|
+
parseDiscoverCatalog,
|
|
42
|
+
} from '../../authoring/discover/parse.mjs';
|
|
39
43
|
import {AstryxError} from '../error.mjs';
|
|
40
44
|
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
41
45
|
|
|
@@ -99,9 +103,24 @@ const DEPENDENCY_FIELDS = [
|
|
|
99
103
|
* docs?: string[],
|
|
100
104
|
* themes?: string[],
|
|
101
105
|
* codemods?: string[],
|
|
106
|
+
* iconSets?: string[],
|
|
107
|
+
* iconSetDetails?: IconSetSummary[],
|
|
108
|
+
* withdrawnIconSets?: Array<{name: string, reason: string}>,
|
|
102
109
|
* }} InstalledPackage
|
|
103
110
|
*/
|
|
104
111
|
|
|
112
|
+
/**
|
|
113
|
+
* What discover shows about one installed icon set (spec:AST-084 FR17).
|
|
114
|
+
* @typedef {object} IconSetSummary
|
|
115
|
+
* @property {string} name
|
|
116
|
+
* @property {string} displayName
|
|
117
|
+
* @property {string} description
|
|
118
|
+
* @property {string} license
|
|
119
|
+
* @property {number} iconCount
|
|
120
|
+
* @property {{variant?: string}} [default]
|
|
121
|
+
* @property {string[]} definitions the icon definitions its `map` covers
|
|
122
|
+
*/
|
|
123
|
+
|
|
105
124
|
/**
|
|
106
125
|
* What one source did on this run.
|
|
107
126
|
* @typedef {object} SourceState
|
|
@@ -218,16 +237,44 @@ export async function describeInstalled(project, scanned) {
|
|
|
218
237
|
);
|
|
219
238
|
// Components come from the scan above; loading every component doc again
|
|
220
239
|
// here would only slow the list down.
|
|
240
|
+
// Icon sets are read below, only with the opt-in.
|
|
221
241
|
const {identities} = await collectIdentities({
|
|
222
242
|
...integration,
|
|
223
243
|
components: undefined,
|
|
244
|
+
iconSets: undefined,
|
|
224
245
|
});
|
|
246
|
+
// Icon sets are listed the way every icon surface sees them: a set that
|
|
247
|
+
// is invalid or whose module does not resolve answers nothing (FR9).
|
|
248
|
+
// They are experimental (spec:AST-017 FR27), so discover lists them only
|
|
249
|
+
// in a project that opts in with `experimental.iconSet`.
|
|
250
|
+
const {sets, withdrawn} = optedIntoIconSets(project)
|
|
251
|
+
? discoverIntegrationIconSets(integration, {projectDir: project.cwd})
|
|
252
|
+
: {sets: [], withdrawn: []};
|
|
225
253
|
installed.push({
|
|
226
254
|
...base,
|
|
227
255
|
templates: identities.templates.map(t => t.id),
|
|
228
256
|
docs: identities.docs,
|
|
229
257
|
themes: identities.themes.map(t => t.slug),
|
|
230
258
|
codemods: identities.codemods.map(c => `${c.version}/${c.id}`),
|
|
259
|
+
iconSets: sets.map(set => set.name),
|
|
260
|
+
iconSetDetails: sets.map(set => ({
|
|
261
|
+
name: set.name,
|
|
262
|
+
displayName: set.displayName,
|
|
263
|
+
description: set.description,
|
|
264
|
+
license: set.license,
|
|
265
|
+
iconCount: set.data.icons.length,
|
|
266
|
+
...(set.data.default ? {default: set.data.default} : {}),
|
|
267
|
+
definitions: [...Object.keys(set.data.map ?? {})].sort(),
|
|
268
|
+
})),
|
|
269
|
+
// Never listed; named only to say why a lookup of one answers nothing.
|
|
270
|
+
...(withdrawn.length > 0
|
|
271
|
+
? {
|
|
272
|
+
withdrawnIconSets: withdrawn.map(each => ({
|
|
273
|
+
name: each.name,
|
|
274
|
+
reason: each.reason,
|
|
275
|
+
})),
|
|
276
|
+
}
|
|
277
|
+
: {}),
|
|
231
278
|
});
|
|
232
279
|
}
|
|
233
280
|
return installed;
|
|
@@ -505,13 +552,14 @@ function savedCopyPath(cacheDir, from, request) {
|
|
|
505
552
|
/**
|
|
506
553
|
* @param {string} file
|
|
507
554
|
* @param {string} label
|
|
555
|
+
* @param {boolean} iconSets the project opts into icon sets
|
|
508
556
|
*/
|
|
509
|
-
function readSavedCopy(file, label) {
|
|
557
|
+
function readSavedCopy(file, label, iconSets) {
|
|
510
558
|
try {
|
|
511
559
|
const saved = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
512
560
|
return {
|
|
513
561
|
savedAt: String(saved.savedAt),
|
|
514
|
-
catalog: parseDiscoverCatalog(saved.catalog, label),
|
|
562
|
+
catalog: parseDiscoverCatalog(saved.catalog, label, {iconSets}),
|
|
515
563
|
};
|
|
516
564
|
} catch {
|
|
517
565
|
return null;
|
|
@@ -541,8 +589,9 @@ function writeSavedCopy(file, catalog) {
|
|
|
541
589
|
* @param {{package?: string, version?: string}} request
|
|
542
590
|
* @param {string} label
|
|
543
591
|
* @param {number} timeoutMs
|
|
592
|
+
* @param {boolean} iconSets the project opts into icon sets
|
|
544
593
|
*/
|
|
545
|
-
async function callSource(source, request, label, timeoutMs) {
|
|
594
|
+
async function callSource(source, request, label, timeoutMs, iconSets) {
|
|
546
595
|
const controller = new AbortController();
|
|
547
596
|
/** @type {ReturnType<typeof setTimeout> | undefined} */
|
|
548
597
|
let timer;
|
|
@@ -561,7 +610,7 @@ async function callSource(source, request, label, timeoutMs) {
|
|
|
561
610
|
),
|
|
562
611
|
timedOut,
|
|
563
612
|
]);
|
|
564
|
-
return parseDiscoverCatalog(answer, label);
|
|
613
|
+
return parseDiscoverCatalog(answer, label, {iconSets});
|
|
565
614
|
} finally {
|
|
566
615
|
clearTimeout(timer);
|
|
567
616
|
}
|
|
@@ -586,6 +635,9 @@ async function callOwnSources(project, request = {}, options = {}) {
|
|
|
586
635
|
const result = {sources: [], packages: []};
|
|
587
636
|
const fromDoor = doorSources();
|
|
588
637
|
if (project == null && fromDoor.length === 0) return result;
|
|
638
|
+
// Without the opt-in, icon-set items and fields are unknown before the
|
|
639
|
+
// catalog is checked, so one cannot fail a source (spec:AST-051 FR7).
|
|
640
|
+
const iconSets = optedIntoIconSets(project);
|
|
589
641
|
|
|
590
642
|
/** @type {Array<{from: string, key?: string, source?: DiscoverSource, error?: string}>} */
|
|
591
643
|
const origins = [];
|
|
@@ -635,7 +687,7 @@ async function callOwnSources(project, request = {}, options = {}) {
|
|
|
635
687
|
/** @type {import('../../authoring/discover/type').DiscoverCatalog} */
|
|
636
688
|
let catalog;
|
|
637
689
|
try {
|
|
638
|
-
catalog = await callSource(source, ask, label, timeoutMs);
|
|
690
|
+
catalog = await callSource(source, ask, label, timeoutMs, iconSets);
|
|
639
691
|
writeSavedCopy(file, catalog);
|
|
640
692
|
result.sources.push({
|
|
641
693
|
name: catalog.source.name,
|
|
@@ -646,7 +698,7 @@ async function callOwnSources(project, request = {}, options = {}) {
|
|
|
646
698
|
});
|
|
647
699
|
} catch (err) {
|
|
648
700
|
const message = err instanceof Error ? err.message : String(err);
|
|
649
|
-
const saved = readSavedCopy(file, label);
|
|
701
|
+
const saved = readSavedCopy(file, label, iconSets);
|
|
650
702
|
if (saved == null) {
|
|
651
703
|
result.sources.push({
|
|
652
704
|
name: from,
|
|
@@ -724,10 +776,66 @@ export async function callSources(project, request = {}, options = {}) {
|
|
|
724
776
|
],
|
|
725
777
|
// Source order: the first entry per integration is the one discover
|
|
726
778
|
// keeps. Official packages are put first only where discover shows them.
|
|
727
|
-
|
|
779
|
+
// An experimental kind is a kind this project does not read unless it
|
|
780
|
+
// opts in, so its items are ignored like any unknown kind (FR7).
|
|
781
|
+
packages: withoutUnreadKinds(project, [...own.packages, ...added]),
|
|
728
782
|
};
|
|
729
783
|
}
|
|
730
784
|
|
|
785
|
+
/**
|
|
786
|
+
* The experimental item kinds a catalog may list (spec:AST-017 FR27):
|
|
787
|
+
* `icon-set`, read only in a project that sets `experimental.iconSet`.
|
|
788
|
+
*/
|
|
789
|
+
export const EXPERIMENTAL_KINDS = /** @type {const} */ (['icon-set']);
|
|
790
|
+
|
|
791
|
+
/** The item kinds every project reads: the catalog kinds, less experimental ones. */
|
|
792
|
+
export const STABLE_KINDS = DISCOVER_KINDS.filter(
|
|
793
|
+
kind =>
|
|
794
|
+
!(/** @type {readonly string[]} */ (EXPERIMENTAL_KINDS).includes(kind)),
|
|
795
|
+
);
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* The item kinds discover reads in the project at the working directory, or
|
|
799
|
+
* the stable kinds when it cannot be read.
|
|
800
|
+
* @returns {Promise<readonly string[]>}
|
|
801
|
+
*/
|
|
802
|
+
export async function loadReadKinds() {
|
|
803
|
+
return readKinds(await Project.load().catch(() => undefined));
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* The item kinds discover reads in this project: every stable kind, and the
|
|
808
|
+
* experimental ones when the project opts in.
|
|
809
|
+
* @param {Project | undefined} project
|
|
810
|
+
* @returns {readonly string[]}
|
|
811
|
+
*/
|
|
812
|
+
export function readKinds(project) {
|
|
813
|
+
return optedIntoIconSets(project) ? DISCOVER_KINDS : STABLE_KINDS;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Whether the project opts into icon sets with `experimental.iconSet`.
|
|
818
|
+
* @param {Project | undefined} project
|
|
819
|
+
*/
|
|
820
|
+
export function optedIntoIconSets(project) {
|
|
821
|
+
return Boolean(project?.config?.experimental?.iconSet);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* @template {{contributions: Array<{kind: string}>}} P
|
|
826
|
+
* @param {Project | undefined} project
|
|
827
|
+
* @param {P[]} packages
|
|
828
|
+
* @returns {P[]}
|
|
829
|
+
*/
|
|
830
|
+
function withoutUnreadKinds(project, packages) {
|
|
831
|
+
if (optedIntoIconSets(project)) return packages;
|
|
832
|
+
const kinds = readKinds(project);
|
|
833
|
+
return packages.map(pkg => ({
|
|
834
|
+
...pkg,
|
|
835
|
+
contributions: pkg.contributions.filter(c => kinds.includes(c.kind)),
|
|
836
|
+
}));
|
|
837
|
+
}
|
|
838
|
+
|
|
731
839
|
/**
|
|
732
840
|
* Official packages first, in the official list's order; the rest keep theirs.
|
|
733
841
|
* @template T
|
|
@@ -935,6 +1043,7 @@ export const KIND_FIELDS = /** @type {const} */ ([
|
|
|
935
1043
|
['theme', 'themes'],
|
|
936
1044
|
['codemod', 'codemods'],
|
|
937
1045
|
['agent-doc', 'agentDocs'],
|
|
1046
|
+
['icon-set', 'iconSets'],
|
|
938
1047
|
]);
|
|
939
1048
|
|
|
940
1049
|
/**
|
|
@@ -37,6 +37,30 @@ export function item(packages, packageName, itemName, options = {}) {
|
|
|
37
37
|
if (kind === 'component') continue;
|
|
38
38
|
const names = /** @type {Record<string, unknown>} */ (pkg)[field];
|
|
39
39
|
if (Array.isArray(names) && names.includes(itemName)) {
|
|
40
|
+
const set =
|
|
41
|
+
kind === 'icon-set'
|
|
42
|
+
? pkg.iconSetDetails?.find(entry => entry.name === itemName)
|
|
43
|
+
: undefined;
|
|
44
|
+
if (set) {
|
|
45
|
+
return {
|
|
46
|
+
type: 'discover.item',
|
|
47
|
+
package: packageName,
|
|
48
|
+
data: {
|
|
49
|
+
package: packageName,
|
|
50
|
+
...(pkg.version ? {version: pkg.version} : {}),
|
|
51
|
+
kind,
|
|
52
|
+
name: itemName,
|
|
53
|
+
title: set.displayName,
|
|
54
|
+
summary: set.description,
|
|
55
|
+
license: set.license,
|
|
56
|
+
iconCount: set.iconCount,
|
|
57
|
+
...(set.default ? {default: set.default} : {}),
|
|
58
|
+
definitions: set.definitions,
|
|
59
|
+
command: `astryx experimental icon <words> --set ${packageName}/${itemName}`,
|
|
60
|
+
installed: true,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
40
64
|
return {
|
|
41
65
|
type: 'discover.item',
|
|
42
66
|
package: packageName,
|
|
@@ -69,6 +93,13 @@ export function item(packages, packageName, itemName, options = {}) {
|
|
|
69
93
|
...(found.title ? {title: found.title} : {}),
|
|
70
94
|
...(found.summary ? {summary: found.summary} : {}),
|
|
71
95
|
...(found.keywords ? {keywords: found.keywords} : {}),
|
|
96
|
+
...(found.iconCount != null ? {iconCount: found.iconCount} : {}),
|
|
97
|
+
...(found.definitions ? {definitions: found.definitions} : {}),
|
|
98
|
+
...(found.kind === 'icon-set' && pkg != null
|
|
99
|
+
? {
|
|
100
|
+
command: `astryx experimental icon <words> --set ${packageName}/${found.name}`,
|
|
101
|
+
}
|
|
102
|
+
: {}),
|
|
72
103
|
installed: pkg != null,
|
|
73
104
|
...(pkg == null && installedAs ? {installedAs} : {}),
|
|
74
105
|
...(pkg == null && !installedAs && add
|
|
@@ -33,7 +33,9 @@ import {
|
|
|
33
33
|
discoverPackages,
|
|
34
34
|
findComponent,
|
|
35
35
|
hasSources,
|
|
36
|
+
loadReadKinds,
|
|
36
37
|
officialDeclarations,
|
|
38
|
+
STABLE_KINDS,
|
|
37
39
|
officialFirst,
|
|
38
40
|
officialList,
|
|
39
41
|
withDeclaredOfficial,
|
|
@@ -52,7 +54,6 @@ import {search} from './search/search.mjs';
|
|
|
52
54
|
import {AstryxError} from '../error.mjs';
|
|
53
55
|
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
54
56
|
import {levenshteinDistance} from '../../foundation/text/string-utils.mjs';
|
|
55
|
-
import {DISCOVER_KINDS} from '../../authoring/discover/parse.mjs';
|
|
56
57
|
|
|
57
58
|
const DEFAULT_LIMIT = 20;
|
|
58
59
|
|
|
@@ -88,15 +89,13 @@ function splitTarget(query) {
|
|
|
88
89
|
|
|
89
90
|
/**
|
|
90
91
|
* @param {{type?: unknown, installed?: boolean, available?: boolean, limit?: unknown}} options
|
|
92
|
+
* @param {readonly string[]} kinds the item kinds this project reads
|
|
91
93
|
*/
|
|
92
|
-
function checkOptions({type, installed, available, limit}) {
|
|
93
|
-
if (
|
|
94
|
-
type != null &&
|
|
95
|
-
!(/** @type {readonly unknown[]} */ (DISCOVER_KINDS).includes(type))
|
|
96
|
-
) {
|
|
94
|
+
function checkOptions({type, installed, available, limit}, kinds) {
|
|
95
|
+
if (type != null && !kinds.includes(/** @type {string} */ (type))) {
|
|
97
96
|
throw new AstryxError(
|
|
98
97
|
`Unknown --type "${String(type)}"`,
|
|
99
|
-
|
|
98
|
+
kinds.map(kind => ({name: kind, reason: 'item kind'})),
|
|
100
99
|
ERROR_CODES.ERR_INVALID_OPTION,
|
|
101
100
|
);
|
|
102
101
|
}
|
|
@@ -178,7 +177,14 @@ export function answersQueries(project) {
|
|
|
178
177
|
*/
|
|
179
178
|
export async function discover(query, options = {}) {
|
|
180
179
|
const {lang = null, zh = false, type, limit} = options;
|
|
181
|
-
|
|
180
|
+
// An experimental kind is read only in a project that opts in (spec:AST-017
|
|
181
|
+
// FR27); only then does `--type` take it, or an error name it.
|
|
182
|
+
const kinds =
|
|
183
|
+
options.type != null &&
|
|
184
|
+
!(/** @type {readonly unknown[]} */ (STABLE_KINDS).includes(options.type))
|
|
185
|
+
? await loadReadKinds()
|
|
186
|
+
: STABLE_KINDS;
|
|
187
|
+
checkOptions(options, kinds);
|
|
182
188
|
const only = options.installed
|
|
183
189
|
? /** @type {const} */ ('installed')
|
|
184
190
|
: options.available
|
|
@@ -308,6 +314,18 @@ export async function discover(query, options = {}) {
|
|
|
308
314
|
if (!target.item) return detail(packages, target.name, context);
|
|
309
315
|
const found = item(packages, target.name, target.item, context);
|
|
310
316
|
if (found) return found;
|
|
317
|
+
// An installed icon set that was withdrawn answers nothing; say why
|
|
318
|
+
// rather than that the package has no such item (spec:AST-084 FR17).
|
|
319
|
+
const gone = packages
|
|
320
|
+
.find(p => p.name === target.name)
|
|
321
|
+
?.withdrawnIconSets?.find(each => each.name === target.item);
|
|
322
|
+
if (gone) {
|
|
323
|
+
throw new AstryxError(
|
|
324
|
+
`Icon set "${target.item}" in ${target.name} is installed but withdrawn: ${gone.reason}`,
|
|
325
|
+
[],
|
|
326
|
+
ERROR_CODES.ERR_UNKNOWN_COMPONENT,
|
|
327
|
+
);
|
|
328
|
+
}
|
|
311
329
|
if (officialOnly) {
|
|
312
330
|
throw new AstryxError(
|
|
313
331
|
`"${target.item}" not found in ${target.name}`,
|
|
@@ -71,6 +71,10 @@ export type DiscoverListEntry = {
|
|
|
71
71
|
* Agent guidance, when a source lists any.
|
|
72
72
|
*/
|
|
73
73
|
agentDocs?: string[] | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Icon set names, when it adds any. Experimental: may change or be removed in a patch release.
|
|
76
|
+
*/
|
|
77
|
+
iconSets?: string[] | undefined;
|
|
74
78
|
/**
|
|
75
79
|
* The latest release a discover source knows.
|
|
76
80
|
*/
|
|
@@ -95,6 +99,10 @@ export type DiscoverAvailableEntry = {
|
|
|
95
99
|
themes?: string[] | undefined;
|
|
96
100
|
codemods?: string[] | undefined;
|
|
97
101
|
agentDocs?: string[] | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Icon set names, when it adds any. Experimental: may change or be removed in a patch release.
|
|
104
|
+
*/
|
|
105
|
+
iconSets?: string[] | undefined;
|
|
98
106
|
description?: string | undefined;
|
|
99
107
|
/**
|
|
100
108
|
* The integration's other package names.
|
|
@@ -177,6 +185,16 @@ export type DiscoverItemResponse = {
|
|
|
177
185
|
* The npm package that owns the item.
|
|
178
186
|
*/
|
|
179
187
|
package: string;
|
|
188
|
+
/**
|
|
189
|
+
* For an icon set, `title` and `summary` are its display name and
|
|
190
|
+
* description, and it carries `license`, `iconCount`, `default` (the variant
|
|
191
|
+
* an icon's own export draws, when the set names one), the shared icon names
|
|
192
|
+
* its `map` covers (`definitions`), and `command`, which searches the set's icons. A source's
|
|
193
|
+
* entry carries `iconCount` and `definitions` when the source lists them.
|
|
194
|
+
* The icon-set fields (`license`, `iconCount`, `default`, `definitions`,
|
|
195
|
+
* and `command`) are experimental: they may change or be removed in a patch
|
|
196
|
+
* release.
|
|
197
|
+
*/
|
|
180
198
|
data: {
|
|
181
199
|
package: string;
|
|
182
200
|
version?: string;
|
|
@@ -185,6 +203,13 @@ export type DiscoverItemResponse = {
|
|
|
185
203
|
title?: string;
|
|
186
204
|
summary?: string;
|
|
187
205
|
keywords?: string[];
|
|
206
|
+
license?: string;
|
|
207
|
+
iconCount?: number;
|
|
208
|
+
default?: {
|
|
209
|
+
variant?: string;
|
|
210
|
+
};
|
|
211
|
+
definitions?: string[];
|
|
212
|
+
command?: string;
|
|
188
213
|
installed: boolean;
|
|
189
214
|
installedAs?: string;
|
|
190
215
|
install?: string;
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
* @property {string[]} [themes] Theme slugs, when it adds any.
|
|
56
56
|
* @property {string[]} [codemods] `<version>/<id>`, when it adds any.
|
|
57
57
|
* @property {string[]} [agentDocs] Agent guidance, when a source lists any.
|
|
58
|
+
* @property {string[]} [iconSets] Icon set names, when it adds any. Experimental: may change or be removed in a patch release.
|
|
58
59
|
* @property {string} [latest] The latest release a discover source knows.
|
|
59
60
|
*/
|
|
60
61
|
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
* @property {string[]} [themes]
|
|
71
72
|
* @property {string[]} [codemods]
|
|
72
73
|
* @property {string[]} [agentDocs]
|
|
74
|
+
* @property {string[]} [iconSets] Icon set names, when it adds any. Experimental: may change or be removed in a patch release.
|
|
73
75
|
* @property {string} [description]
|
|
74
76
|
* @property {string[]} [aliases] The integration's other package names.
|
|
75
77
|
* @property {string} source The discover source that lists it; `Astryx` for
|
|
@@ -136,11 +138,23 @@
|
|
|
136
138
|
* title?: string,
|
|
137
139
|
* summary?: string,
|
|
138
140
|
* keywords?: string[],
|
|
141
|
+
* license?: string,
|
|
142
|
+
* iconCount?: number,
|
|
143
|
+
* default?: {variant?: string},
|
|
144
|
+
* definitions?: string[],
|
|
145
|
+
* command?: string,
|
|
139
146
|
* installed: boolean,
|
|
140
147
|
* installedAs?: string,
|
|
141
148
|
* install?: string,
|
|
142
149
|
* source?: string,
|
|
143
|
-
* }} data
|
|
150
|
+
* }} data For an icon set, `title` and `summary` are its display name and
|
|
151
|
+
* description, and it carries `license`, `iconCount`, `default` (the variant
|
|
152
|
+
* an icon's own export draws, when the set names one), the shared icon names
|
|
153
|
+
* its `map` covers (`definitions`), and `command`, which searches the set's icons. A source's
|
|
154
|
+
* entry carries `iconCount` and `definitions` when the source lists them.
|
|
155
|
+
* The icon-set fields (`license`, `iconCount`, `default`, `definitions`,
|
|
156
|
+
* and `command`) are experimental: they may change or be removed in a patch
|
|
157
|
+
* release.
|
|
144
158
|
*/
|
|
145
159
|
|
|
146
160
|
/**
|
package/api/docs/_adapter.mjs
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
} from '../../foundation/doc-compiler/read.mjs';
|
|
40
40
|
import {
|
|
41
41
|
buildDocsTree,
|
|
42
|
+
isExperimentalTreeNode,
|
|
42
43
|
loadTreeInputs,
|
|
43
44
|
} from '../../foundation/doc-compiler/tree.mjs';
|
|
44
45
|
import {sortDiagnostics} from '../../foundation/doc-compiler/diagnostics.mjs';
|
|
@@ -58,6 +59,8 @@ import {
|
|
|
58
59
|
} from '../../foundation/discovery/cli-self-docs.mjs';
|
|
59
60
|
import {
|
|
60
61
|
AUTHORING_REFERENCE_ROUTE,
|
|
62
|
+
EXPERIMENTAL_AUTHORING_ROUTE,
|
|
63
|
+
isExperimentalSelfDoc,
|
|
61
64
|
loadAuthoringSelfDocs,
|
|
62
65
|
schemaFieldTable,
|
|
63
66
|
selfDocSection,
|
|
@@ -672,14 +675,20 @@ function docFinderOver(catalog, tree, fromProvider, summaries = true) {
|
|
|
672
675
|
? await authoringDoc(parsed.kind, parsed.name)
|
|
673
676
|
: null;
|
|
674
677
|
if (authored) {
|
|
678
|
+
// An experimental schema is a section of its experimental route, not
|
|
679
|
+
// of the field reference (spec:AST-084 FR0).
|
|
680
|
+
const experimental = isExperimentalSelfDoc(authored);
|
|
681
|
+
const route = experimental
|
|
682
|
+
? EXPERIMENTAL_AUTHORING_ROUTE
|
|
683
|
+
: AUTHORING_REFERENCE_ROUTE;
|
|
675
684
|
return {
|
|
676
685
|
link: {
|
|
677
686
|
target,
|
|
678
687
|
id: createDocId(provider, authored.type, authored.name),
|
|
679
|
-
route
|
|
688
|
+
route,
|
|
680
689
|
title: authored.displayName ?? authored.name,
|
|
681
690
|
summary: renderTokens(authored.description ?? ''),
|
|
682
|
-
command: `astryx docs authoring ${authored.name}`,
|
|
691
|
+
command: `astryx docs ${experimental ? route : 'authoring'} ${authored.name}`,
|
|
683
692
|
},
|
|
684
693
|
kind: parsed.kind,
|
|
685
694
|
typed: {doc: authored, providerId: CLI_PROVIDER_ID, tree: false},
|
|
@@ -1668,9 +1677,20 @@ export function placeLinks(tree, node) {
|
|
|
1668
1677
|
up: node.parent == null ? 'astryx docs' : `astryx docs ${node.parent}`,
|
|
1669
1678
|
};
|
|
1670
1679
|
const parent = node.parent == null ? undefined : tree.get(node.parent);
|
|
1671
|
-
|
|
1680
|
+
// A stable node moves only to stable neighbors, so its links read as they
|
|
1681
|
+
// do without experimental features (spec:AST-017 FR27, spec:AST-084 FR0),
|
|
1682
|
+
// and an experimental node only to experimental ones, so each next read
|
|
1683
|
+
// still names this one as its previous.
|
|
1684
|
+
const experimental = isExperimentalTreeNode(tree, node);
|
|
1685
|
+
const siblings = (
|
|
1672
1686
|
parent?.slots.find(slot => slot.children.includes(node.route))?.children ??
|
|
1673
|
-
[]
|
|
1687
|
+
[]
|
|
1688
|
+
).filter(route => {
|
|
1689
|
+
const sibling = tree.get(route);
|
|
1690
|
+
return (
|
|
1691
|
+
sibling == null || isExperimentalTreeNode(tree, sibling) === experimental
|
|
1692
|
+
);
|
|
1693
|
+
});
|
|
1674
1694
|
const at = siblings.indexOf(node.route);
|
|
1675
1695
|
if (at > 0) links.previous = `astryx docs ${siblings[at - 1]}`;
|
|
1676
1696
|
if (at !== -1 && at < siblings.length - 1) {
|
package/api/docs/docs.type.d.mts
CHANGED
|
@@ -251,6 +251,11 @@ export type DocsNode = {
|
|
|
251
251
|
package: string;
|
|
252
252
|
title: string;
|
|
253
253
|
summary: string;
|
|
254
|
+
/**
|
|
255
|
+
* Present only when the node's doc is
|
|
256
|
+
* marked experimental: it may change or be removed in a patch release.
|
|
257
|
+
*/
|
|
258
|
+
stability?: "experimental" | undefined;
|
|
254
259
|
/**
|
|
255
260
|
* the namespaces above it, top first
|
|
256
261
|
*/
|
|
@@ -317,6 +322,11 @@ export type DocsNodeChild = {
|
|
|
317
322
|
kind: string;
|
|
318
323
|
title: string;
|
|
319
324
|
summary: string;
|
|
325
|
+
/**
|
|
326
|
+
* Present only when the child's doc is
|
|
327
|
+
* marked experimental: it may change or be removed in a patch release.
|
|
328
|
+
*/
|
|
329
|
+
stability?: "experimental" | undefined;
|
|
320
330
|
/**
|
|
321
331
|
* with a depth read, its own slots, while
|
|
322
332
|
* the read goes deeper
|
package/api/docs/docs.type.mjs
CHANGED
|
@@ -176,6 +176,8 @@
|
|
|
176
176
|
* @property {string} package the package that owns the node
|
|
177
177
|
* @property {string} title
|
|
178
178
|
* @property {string} summary
|
|
179
|
+
* @property {'experimental'} [stability] Present only when the node's doc is
|
|
180
|
+
* marked experimental: it may change or be removed in a patch release.
|
|
179
181
|
* @property {DocsNodeLink[]} breadcrumb the namespaces above it, top first
|
|
180
182
|
* @property {DocsNodeSlot[]} slots a namespace's slots that hold children, in
|
|
181
183
|
* order; empty for a typed doc, and for a depth read of 0
|
|
@@ -213,6 +215,8 @@
|
|
|
213
215
|
* @property {string} kind
|
|
214
216
|
* @property {string} title
|
|
215
217
|
* @property {string} summary
|
|
218
|
+
* @property {'experimental'} [stability] Present only when the child's doc is
|
|
219
|
+
* marked experimental: it may change or be removed in a patch release.
|
|
216
220
|
* @property {DocsNodeSlot[]} [slots] with a depth read, its own slots, while
|
|
217
221
|
* the read goes deeper
|
|
218
222
|
* @property {number} [childCount] with a depth read, how many docs sit right
|
package/api/docs/node/node.mjs
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import {detailView} from '../../../foundation/doc-compiler/lenses.mjs';
|
|
19
|
+
import {isExperimentalTreeNode} from '../../../foundation/doc-compiler/tree.mjs';
|
|
19
20
|
import {
|
|
20
21
|
compileTopic,
|
|
21
22
|
guideEntry,
|
|
@@ -62,6 +63,7 @@ export async function nodeView(catalog, tree, node, read) {
|
|
|
62
63
|
package: node.provider,
|
|
63
64
|
title: node.title,
|
|
64
65
|
summary: node.summary,
|
|
66
|
+
...stabilityOf(tree, node),
|
|
65
67
|
breadcrumb: tree
|
|
66
68
|
.ancestors(node)
|
|
67
69
|
.map(ancestor => ({route: ancestor.route, title: ancestor.title})),
|
|
@@ -70,7 +72,7 @@ export async function nodeView(catalog, tree, node, read) {
|
|
|
70
72
|
name: slot.name,
|
|
71
73
|
title: slot.title,
|
|
72
74
|
children: slot.children.map(route =>
|
|
73
|
-
childIdentity(/** @type {TreeNode} */ (tree.get(route))),
|
|
75
|
+
childIdentity(tree, /** @type {TreeNode} */ (tree.get(route))),
|
|
74
76
|
),
|
|
75
77
|
}))
|
|
76
78
|
: read.depth >= 1
|
|
@@ -85,12 +87,26 @@ export async function nodeView(catalog, tree, node, read) {
|
|
|
85
87
|
return view;
|
|
86
88
|
}
|
|
87
89
|
|
|
90
|
+
/**
|
|
91
|
+
* `stability: 'experimental'` for a node whose doc is marked experimental, or
|
|
92
|
+
* that sits under an experimental namespace (spec:AST-017 FR27), the way help
|
|
93
|
+
* marks an experimental command; nothing for a stable one, so stable entries
|
|
94
|
+
* read as they always have.
|
|
95
|
+
* @param {DocsTree} tree
|
|
96
|
+
* @param {TreeNode} node
|
|
97
|
+
* @returns {{stability?: 'experimental'}}
|
|
98
|
+
*/
|
|
99
|
+
function stabilityOf(tree, node) {
|
|
100
|
+
return isExperimentalTreeNode(tree, node) ? {stability: 'experimental'} : {};
|
|
101
|
+
}
|
|
102
|
+
|
|
88
103
|
/**
|
|
89
104
|
* The fields every child carries: what it is, and the route that opens it.
|
|
105
|
+
* @param {DocsTree} tree
|
|
90
106
|
* @param {TreeNode} child
|
|
91
107
|
* @returns {import('../docs.type.mjs').DocsNodeChild}
|
|
92
108
|
*/
|
|
93
|
-
function childIdentity(child) {
|
|
109
|
+
function childIdentity(tree, child) {
|
|
94
110
|
return {
|
|
95
111
|
route: child.route,
|
|
96
112
|
name: child.route.slice(child.route.lastIndexOf('/') + 1),
|
|
@@ -106,6 +122,7 @@ function childIdentity(child) {
|
|
|
106
122
|
kind: child.kind,
|
|
107
123
|
title: child.title,
|
|
108
124
|
summary: child.summary,
|
|
125
|
+
...stabilityOf(tree, child),
|
|
109
126
|
};
|
|
110
127
|
}
|
|
111
128
|
|
|
@@ -158,7 +175,7 @@ async function slotsBelow(catalog, tree, slots, level, read) {
|
|
|
158
175
|
* @returns {Promise<import('../docs.type.mjs').DocsNodeChild>}
|
|
159
176
|
*/
|
|
160
177
|
async function childBelow(catalog, tree, child, level, read) {
|
|
161
|
-
const view = childIdentity(child);
|
|
178
|
+
const view = childIdentity(tree, child);
|
|
162
179
|
if (read.detail !== 'brief') {
|
|
163
180
|
Object.assign(view, await childText(catalog, tree, child, read.lang));
|
|
164
181
|
}
|