@adea-ai/ui 0.152.1 → 0.152.3
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/dist/components/composites/about-dialog/about-dialog.js +2 -2
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
- package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +3 -3
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +3 -0
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
- package/dist/components/composites/settings/settings-layout.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/suggestion/suggestion.js.map +1 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/terminal.js +1 -1
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +3 -3
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +3 -3
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/components/conversation/atomic/chat-composer.js.map +1 -1
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/chat-composer.js.map +1 -1
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +1 -1
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
- package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -1
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
- package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js.map +1 -1
- package/dist/components/layout/pixel-pane/pixel-pane.js.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
- package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +1 -1
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
- package/dist/components/motion/presence.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +1 -1
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/theme-mode-toggle.js.map +1 -1
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider.js.map +1 -1
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/accordion/accordion.js.map +1 -1
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
- package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/ui/attachment/attachment.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/collapsible/collapsible.js.map +1 -1
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/combobox/value-combobox.js.map +1 -1
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input/input-control.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-group/secret-input-group.js.map +1 -1
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/separator/separator.js.map +1 -1
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/text-link.js.map +1 -1
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/r/about-dialog.json +1 -1
- package/dist/r/accordion.json +1 -1
- package/dist/r/account-menu.json +1 -1
- package/dist/r/alert.json +1 -1
- package/dist/r/appearance-editor.json +1 -1
- package/dist/r/attachment.json +1 -1
- package/dist/r/breadcrumb.json +1 -1
- package/dist/r/calendar.json +1 -1
- package/dist/r/carousel.json +1 -1
- package/dist/r/catalog-browser.json +1 -1
- package/dist/r/chain-of-thought.json +1 -1
- package/dist/r/chat.json +1 -1
- package/dist/r/checkbox.json +1 -1
- package/dist/r/checkpoint.json +1 -1
- package/dist/r/code-block.json +1 -1
- package/dist/r/combobox.json +1 -1
- package/dist/r/command.json +1 -1
- package/dist/r/confirmation.json +1 -1
- package/dist/r/context.json +1 -1
- package/dist/r/conversation.json +1 -1
- package/dist/r/detail-panel.json +1 -1
- package/dist/r/dialog.json +1 -1
- package/dist/r/dropdown-menu.json +1 -1
- package/dist/r/empty.json +1 -1
- package/dist/r/file-tree.json +1 -1
- package/dist/r/floating-preview.json +1 -1
- package/dist/r/help-center.json +1 -1
- package/dist/r/icon-picker.json +1 -1
- package/dist/r/inline-citation.json +1 -1
- package/dist/r/lib.json +1 -1
- package/dist/r/message-scroller.json +1 -1
- package/dist/r/model-selector.json +1 -1
- package/dist/r/native-select.json +1 -1
- package/dist/r/navigation-menu.json +1 -1
- package/dist/r/pagination.json +1 -1
- package/dist/r/pixel-resize-handle.json +1 -1
- package/dist/r/plan.json +1 -1
- package/dist/r/questionnaire.json +1 -1
- package/dist/r/queue.json +1 -1
- package/dist/r/radio-group.json +1 -1
- package/dist/r/reasoning.json +1 -1
- package/dist/r/registry.json +65 -65
- package/dist/r/resizable.json +1 -1
- package/dist/r/scene-controls.json +1 -1
- package/dist/r/select.json +1 -1
- package/dist/r/settings.json +1 -1
- package/dist/r/sheet.json +1 -1
- package/dist/r/shell-rail.json +1 -1
- package/dist/r/sidebar-nav.json +1 -1
- package/dist/r/sources.json +1 -1
- package/dist/r/spinner.json +1 -1
- package/dist/r/split-layout.json +1 -1
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +2 -2
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +4 -1
- package/dist/r/src/components/composites/terminal/terminal.tsx +2 -2
- package/dist/r/src/components/composites/update-dialog/channel-control.tsx +3 -3
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +3 -5
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
- package/dist/r/src/components/conversation/message-composer.tsx +1 -2
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +1 -1
- package/dist/r/src/components/theme/appearance-panel.tsx +2 -4
- package/dist/r/stack-trace.json +1 -1
- package/dist/r/stat.json +1 -1
- package/dist/r/subagent.json +1 -1
- package/dist/r/task.json +1 -1
- package/dist/r/terminal.json +1 -1
- package/dist/r/test-results.json +1 -1
- package/dist/r/theming.json +1 -1
- package/dist/r/toast.json +1 -1
- package/dist/r/tool.json +1 -1
- package/dist/r/top-bar.json +1 -1
- package/dist/r/trace.json +1 -1
- package/dist/r/tree.json +1 -1
- package/dist/r/update-dialog.json +1 -1
- package/dist/r/workspace-switcher.json +1 -1
- package/dist/vite/tailwind-sources.d.ts.map +1 -1
- package/dist/vite/tailwind-sources.js +49 -9
- package/dist/vite/tailwind-sources.js.map +1 -1
- package/package.json +11 -11
- package/registry.json +65 -65
- package/src/components/composites/about-dialog/about-dialog.tsx +2 -2
- package/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
- package/src/components/composites/model-selector/model-selector.tsx +4 -1
- package/src/components/composites/terminal/terminal.tsx +2 -2
- package/src/components/composites/update-dialog/channel-control.tsx +3 -3
- package/src/components/composites/update-dialog/update-dialog.tsx +3 -5
- package/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
- package/src/components/conversation/message-composer.tsx +1 -2
- package/src/components/layout/split-layout/split-layout.tsx +1 -1
- package/src/components/theme/appearance-panel.tsx +2 -4
- package/src/vite/tailwind-sources.ts +67 -7
|
@@ -110,8 +110,7 @@ export function MessageComposer(props: MessageComposerProps) {
|
|
|
110
110
|
])
|
|
111
111
|
|
|
112
112
|
const composer = createComposerCore({
|
|
113
|
-
failureMessage:
|
|
114
|
-
'Message not sent. Your draft is still here; retry when the connection recovers.',
|
|
113
|
+
failureMessage: 'Message not sent. Your draft is kept.',
|
|
115
114
|
})
|
|
116
115
|
const sending = composer.pending
|
|
117
116
|
const descriptionId = `message-composer-help-${createUniqueId()}`
|
|
@@ -579,7 +579,7 @@ export function SplitLayout<L extends SplitLayoutLeaf>(props: SplitLayoutProps<L
|
|
|
579
579
|
{dropLabel() ||
|
|
580
580
|
(resizeController() === 'error'
|
|
581
581
|
? reloadRequired()
|
|
582
|
-
? 'Resize controls
|
|
582
|
+
? 'Resize controls didn’t load. Reloading may lose unsaved pane content.'
|
|
583
583
|
: 'Resize controls did not load.'
|
|
584
584
|
: '')}
|
|
585
585
|
</span>
|
|
@@ -66,8 +66,7 @@ export function AppearancePanel(props: AppearancePanelProps) {
|
|
|
66
66
|
Appearance
|
|
67
67
|
</Heading>
|
|
68
68
|
<p class="max-w-prose text-sm text-muted-foreground">
|
|
69
|
-
Follow the system, or pin one.
|
|
70
|
-
sunset does not make you choose again.
|
|
69
|
+
Follow the system, or pin one. Each appearance keeps its own theme.
|
|
71
70
|
</p>
|
|
72
71
|
</header>
|
|
73
72
|
<RadioGroup
|
|
@@ -140,8 +139,7 @@ export function AppearancePanel(props: AppearancePanelProps) {
|
|
|
140
139
|
Fonts
|
|
141
140
|
</Heading>
|
|
142
141
|
<p class="max-w-prose text-sm text-muted-foreground">
|
|
143
|
-
|
|
144
|
-
come from the shared catalogue and are self-hosted.
|
|
142
|
+
Interface, reading and code fonts.
|
|
145
143
|
</p>
|
|
146
144
|
</header>
|
|
147
145
|
<AppearanceFontSettingsGroup
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks'
|
|
1
2
|
import {
|
|
2
3
|
existsSync,
|
|
3
4
|
mkdirSync,
|
|
@@ -63,14 +64,38 @@ export interface SourceDirectiveOptions {
|
|
|
63
64
|
|
|
64
65
|
const defaultLabel = 'ui-tailwind-sources'
|
|
65
66
|
|
|
67
|
+
/**
|
|
68
|
+
* One walk's memo: the same files are reached, resolved and parsed many times in a walk, and the
|
|
69
|
+
* checks the plugin runs walk the same graph again. It lives in the walk's async context, so a
|
|
70
|
+
* nested walk (the check inside a generation) shares it, while an independent walk that overlaps
|
|
71
|
+
* it (a hot update, or a second call after a file changed) starts with its own, and a later walk
|
|
72
|
+
* never reads an earlier answer.
|
|
73
|
+
*/
|
|
74
|
+
interface WalkMemo {
|
|
75
|
+
realpaths: Map<string, string>
|
|
76
|
+
modules: Map<string, ParsedModule>
|
|
77
|
+
}
|
|
78
|
+
const walkMemoStore = new AsyncLocalStorage<WalkMemo>()
|
|
79
|
+
const currentWalkMemo = (): WalkMemo | undefined => walkMemoStore.getStore()
|
|
80
|
+
|
|
81
|
+
function withWalkMemo<T>(walk: () => Promise<T>): Promise<T> {
|
|
82
|
+
if (currentWalkMemo()) return walk()
|
|
83
|
+
return walkMemoStore.run({ realpaths: new Map(), modules: new Map() }, walk)
|
|
84
|
+
}
|
|
85
|
+
|
|
66
86
|
function modulePath(id: string): string {
|
|
67
87
|
const withoutQuery = id.split('?')[0] ?? id
|
|
68
88
|
const absolute = resolve(withoutQuery)
|
|
89
|
+
const known = currentWalkMemo()?.realpaths.get(absolute)
|
|
90
|
+
if (known) return known
|
|
91
|
+
let file = absolute
|
|
69
92
|
try {
|
|
70
|
-
|
|
93
|
+
file = realpathSync(absolute)
|
|
71
94
|
} catch {
|
|
72
|
-
|
|
95
|
+
// A path that does not exist (yet) stands for itself.
|
|
73
96
|
}
|
|
97
|
+
currentWalkMemo()?.realpaths.set(absolute, file)
|
|
98
|
+
return file
|
|
74
99
|
}
|
|
75
100
|
|
|
76
101
|
function inside(path: string, root: string): boolean {
|
|
@@ -110,7 +135,19 @@ function readModule(path: string, cache: Map<string, ParsedModule>): ParsedModul
|
|
|
110
135
|
return parsed
|
|
111
136
|
}
|
|
112
137
|
|
|
138
|
+
// A module's runtime imports depend only on its parsed source, and a walk asks for them each time
|
|
139
|
+
// it reaches the module with another selection.
|
|
140
|
+
const runtimeImportsByModule = new WeakMap<ParsedModule, RuntimeImport[]>()
|
|
141
|
+
|
|
113
142
|
function runtimeImports(parsed: ParsedModule, label: string): RuntimeImport[] {
|
|
143
|
+
const known = runtimeImportsByModule.get(parsed)
|
|
144
|
+
if (known) return known
|
|
145
|
+
const imports = moduleRuntimeImports(parsed, label)
|
|
146
|
+
runtimeImportsByModule.set(parsed, imports)
|
|
147
|
+
return imports
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function moduleRuntimeImports(parsed: ParsedModule, label: string): RuntimeImport[] {
|
|
114
151
|
const imports: RuntimeImport[] = []
|
|
115
152
|
|
|
116
153
|
for (const entry of staticRuntimeImports(parsed.syntax)) {
|
|
@@ -170,7 +207,11 @@ function modifierExport(file: string, name: string, cache: Map<string, ParsedMod
|
|
|
170
207
|
return directRuntimeExports(readModule(file, cache).syntax).includes(name)
|
|
171
208
|
}
|
|
172
209
|
|
|
173
|
-
export
|
|
210
|
+
export function collectUiSourceFiles(options: SourceDiscoveryOptions): Promise<string[]> {
|
|
211
|
+
return withWalkMemo(() => walkUiSourceFiles(options))
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async function walkUiSourceFiles(options: SourceDiscoveryOptions): Promise<string[]> {
|
|
174
215
|
const label = options.label ?? defaultLabel
|
|
175
216
|
const repositoryRoot = realpathSync(options.repositoryRoot)
|
|
176
217
|
const uiSourceRoot = realpathSync(options.uiSourceRoot)
|
|
@@ -178,7 +219,7 @@ export async function collectUiSourceFiles(options: SourceDiscoveryOptions): Pro
|
|
|
178
219
|
const entrypoints = (
|
|
179
220
|
Array.isArray(options.entrypoint) ? options.entrypoint : [options.entrypoint]
|
|
180
221
|
).map((entrypoint) => realpathSync(entrypoint))
|
|
181
|
-
const cache = new Map<string, ParsedModule>()
|
|
222
|
+
const cache = currentWalkMemo()?.modules ?? new Map<string, ParsedModule>()
|
|
182
223
|
const visited = new Set<string>()
|
|
183
224
|
const files = new Set<string>()
|
|
184
225
|
const publishedUiResolutions: string[] = []
|
|
@@ -517,7 +558,11 @@ export interface LinkedImportOptions {
|
|
|
517
558
|
* imports are included without executing them, so a lazy feature cannot fail
|
|
518
559
|
* later on an import the check never saw.
|
|
519
560
|
*/
|
|
520
|
-
export
|
|
561
|
+
export function collectLinkedImports(options: LinkedImportOptions): Promise<LinkedImport[]> {
|
|
562
|
+
return withWalkMemo(() => walkLinkedImports(options))
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
async function walkLinkedImports(options: LinkedImportOptions): Promise<LinkedImport[]> {
|
|
521
566
|
const label = options.label ?? defaultLabel
|
|
522
567
|
const repositoryRoot = realpathSync(options.repositoryRoot)
|
|
523
568
|
const uiSourceRoot = realpathSync(options.uiSourceRoot)
|
|
@@ -525,7 +570,7 @@ export async function collectLinkedImports(options: LinkedImportOptions): Promis
|
|
|
525
570
|
const entrypoints = (
|
|
526
571
|
Array.isArray(options.entrypoint) ? options.entrypoint : [options.entrypoint]
|
|
527
572
|
).map((entrypoint) => realpathSync(entrypoint))
|
|
528
|
-
const cache = new Map<string, ParsedModule>()
|
|
573
|
+
const cache = currentWalkMemo()?.modules ?? new Map<string, ParsedModule>()
|
|
529
574
|
const visited = new Set<string>()
|
|
530
575
|
const linked: LinkedImport[] = []
|
|
531
576
|
const reached = (file: string) =>
|
|
@@ -640,7 +685,22 @@ export function tailwindSources(options: TailwindSourcesOptions): Plugin {
|
|
|
640
685
|
let repositoryRoot = ''
|
|
641
686
|
let generatedFiles: string[] = []
|
|
642
687
|
|
|
643
|
-
|
|
688
|
+
// The discovery walk and the consumer's check share one memo, and each (specifier, importer)
|
|
689
|
+
// pair is resolved once per generation.
|
|
690
|
+
const generate = (uncachedResolveId: Resolver, config: ResolvedConfig): Promise<string[]> => {
|
|
691
|
+
const resolutions = new Map<string, Promise<string | undefined>>()
|
|
692
|
+
const resolveId: Resolver = (specifier, importer) => {
|
|
693
|
+
const key = `${specifier}\0${importer}`
|
|
694
|
+
let resolved = resolutions.get(key)
|
|
695
|
+
if (!resolved) {
|
|
696
|
+
resolved = uncachedResolveId(specifier, importer)
|
|
697
|
+
resolutions.set(key, resolved)
|
|
698
|
+
}
|
|
699
|
+
return resolved
|
|
700
|
+
}
|
|
701
|
+
return withWalkMemo(() => generateWith(resolveId, config))
|
|
702
|
+
}
|
|
703
|
+
const generateWith = async (resolveId: Resolver, config: ResolvedConfig): Promise<string[]> => {
|
|
644
704
|
const files = await collectUiSourceFiles({
|
|
645
705
|
entrypoint: paths.entrypoints,
|
|
646
706
|
repositoryRoot,
|