@apollo-design/ui-resolver 0.0.0-stage → 0.1.9

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 CHANGED
@@ -1,3 +1,49 @@
1
- # Temporary Holding Version
1
+ # @apollo-design/ui-resolver
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Official build-time component resolver for [unplugin-vue-components](https://github.com/unplugin/unplugin-vue-components). It imports Apollo components from their public JavaScript subpaths. It does not load the UI runtime in Node, register components globally, or select a theme.
4
+
5
+ ## Install and configure
6
+
7
+ Install `@apollo-design/ui` >=0.1.8 and Vue as application dependencies, and `@apollo-design/ui-resolver`, `unplugin-vue-components` as development dependencies. Use Node >=22.12 and an ESM Vite configuration. This implementation is tested with unplugin-vue-components 32.1.0, Vue 3.5.42, Vite 8.3.0 and TypeScript 5.9.3.
8
+
9
+ ```ts
10
+ import { defineConfig } from 'vite';
11
+ import vue from '@vitejs/plugin-vue';
12
+ import Components from 'unplugin-vue-components/vite';
13
+ import { ApolloResolver } from '@apollo-design/ui-resolver';
14
+
15
+ export default defineConfig({
16
+ plugins: [vue(), Components({ resolvers: [ApolloResolver()], dts: 'src/components.d.ts' })],
17
+ });
18
+ ```
19
+
20
+ ```vue
21
+ <template>
22
+ <AButton type="primary">Save</AButton>
23
+ <AInputSearch placeholder="Search" />
24
+ </template>
25
+ ```
26
+
27
+ Include the generated components declaration in the application's TypeScript project. PascalCase and kebab-case template tags are normalized by unplugin-vue-components: `<AButton>` and `<a-button>` both use the same public Button import. Unknown names are left for other resolvers or local components.
28
+
29
+ ## API
30
+
31
+ `ApolloResolver({ importStyle?: boolean })` returns a component resolver. Automatic structural styles are enabled by default; `ApolloResolver({ importStyle: false })` imports only JavaScript and leaves all CSS loading to the application. There are no theme, runtime registration, arbitrary prefix, fallback or global-CSS options.
32
+
33
+ Compound components use explicit flat template names, including AInputSearch, AInputPassword, AInputOtp, ASelectOption, ASelectOptGroup, AFormItem, AFormList, ASpaceCompact, ALayoutSider, ASkeletonButton, ATableSummary, ATableSummaryRow and ATableSummaryCell. Typography children accept AText/ATitle/AParagraph/ALink and ATypographyText/ATypographyTitle/ATypographyParagraph/ATypographyLink. AAutoComplete uses Select structure; ATimePicker and ATimeRangePicker use DatePicker structure rather than nonexistent CSS paths. Parent member expressions in JavaScript remain normal explicit component imports.
34
+
35
+ ## Styles and themes
36
+
37
+ The resolver reads the public `@apollo-design/ui/style-manifest.json` metadata. For each component it imports the manifest's ordered resource list: neutral `base.css`, required shared resources, and component `structure.css` files. Repeated resource paths are deduplicated by the bundler; the resolver has no per-file import state or second dependency graph. This requires the UI 0.1.8 structural style exports. Existing `style.css` entries remain available for manual use.
38
+
39
+ The resolver never imports a theme preset, theme registry or aggregate UI stylesheet. The application loads its public theme entry first, component structure CSS next, and application overrides last. Turning off automatic styles means the application must import the required component CSS itself. Manual JavaScript imports may coexist with resolved template components. Manual CSS imports can reuse the same public `base.css` and component `structure.css` paths to retain module deduplication.
40
+
41
+ Legacy component `style.css` files and aggregate UI CSS contain their existing dependency closures. Importing them alongside new structure entries repeats overlapping CSS text. Applications already loading those styles should use `ApolloResolver({ importStyle: false })`; the resolver still handles component JavaScript imports.
42
+
43
+ Theme-independent import checks and the complete preset/custom-theme acceptance are separate: the latter is integrated with the public theme contract from issue #80. Import success alone does not establish theme correctness.
44
+
45
+ ## Maintenance
46
+
47
+ Source unit tests check component name mappings and options without built UI files. The published consumer checks special CSS families, order-independent styles and the complete shipped name table against installed UI declarations, public exports and structural CSS metadata. Update the table and consumer regression whenever those public contracts change. Do not infer every component path with a kebab-case conversion, resolve service objects as components, import the UI package at resolver runtime, or use whole-library CSS as a fallback.
48
+
49
+ The repository consumer regression reads already built packages: `node packages/ui-resolver/tests/consumer.mjs [uiPackageRoot] [freshOutputDirectory] [--themes]`. It packs and installs once, then checks Vite, SSR, generated declarations and browser behavior. `--themes` additionally uses that same installation for the three import methods × four preset/custom values × two appearances matrix; it may appear before or after the optional paths. With no flag, the command keeps the focused resolver checks. A prepared installation can also run `node packages/ui-resolver/tests/theme-matrix.mjs <installedConsumerDirectory> [freshOutputDirectory]` without packing or installing again. These scripts build consumer applications, never package distribution files.
@@ -0,0 +1,202 @@
1
+ const componentImports = /* @__PURE__ */ new Map([
2
+ ["AAffix", { name: "Affix", path: "affix", style: "affix" }],
3
+ ["AAffixDefault", { name: "default", path: "affix", style: "affix" }],
4
+ ["AAlert", { name: "Alert", path: "alert", style: "alert" }],
5
+ ["AAlertErrorBoundary", { name: "AlertErrorBoundary", path: "alert", style: "alert" }],
6
+ ["AAnchor", { name: "Anchor", path: "anchor", style: "anchor" }],
7
+ ["AAnchorLink", { name: "AnchorLink", path: "anchor", style: "anchor" }],
8
+ ["AAnchorWithLink", { name: "AnchorWithLink", path: "anchor", style: "anchor" }],
9
+ ["AApp", { name: "App", path: "app", style: "app" }],
10
+ ["AAutoComplete", { name: "AutoComplete", path: "auto-complete", style: "select" }],
11
+ ["AAutoCompleteOption", { name: "AutoCompleteOption", path: "auto-complete", style: "select" }],
12
+ ["AAvatar", { name: "Avatar", path: "avatar", style: "avatar" }],
13
+ ["AAvatarGroup", { name: "AvatarGroup", path: "avatar", style: "avatar" }],
14
+ ["ABackTop", { name: "BackTop", path: "back-top", style: "back-top" }],
15
+ ["ABadge", { name: "Badge", path: "badge", style: "badge" }],
16
+ ["ABadgeRibbon", { name: "Ribbon", path: "badge", style: "badge" }],
17
+ ["ABorderBeam", { name: "BorderBeam", path: "border-beam", style: "border-beam" }],
18
+ ["ABreadcrumb", { name: "Breadcrumb", path: "breadcrumb", style: "breadcrumb" }],
19
+ ["ABreadcrumbItem", { name: "BreadcrumbItem", path: "breadcrumb", style: "breadcrumb" }],
20
+ [
21
+ "ABreadcrumbSeparator",
22
+ { name: "BreadcrumbSeparator", path: "breadcrumb", style: "breadcrumb" }
23
+ ],
24
+ ["ABreadcrumbWithSub", { name: "BreadcrumbWithSub", path: "breadcrumb", style: "breadcrumb" }],
25
+ ["AButton", { name: "Button", path: "button", style: "button" }],
26
+ ["ACalendar", { name: "Calendar", path: "calendar", style: "calendar" }],
27
+ ["ACard", { name: "Card", path: "card", style: "card" }],
28
+ ["ACardGrid", { name: "CardGrid", path: "card", style: "card" }],
29
+ ["ACardMeta", { name: "CardMeta", path: "card", style: "card" }],
30
+ ["ACarousel", { name: "Carousel", path: "carousel", style: "carousel" }],
31
+ ["ACascader", { name: "Cascader", path: "cascader", style: "cascader" }],
32
+ ["ACascaderPanel", { name: "CascaderPanel", path: "cascader", style: "cascader" }],
33
+ ["ACheckableTag", { name: "CheckableTag", path: "tag", style: "tag" }],
34
+ ["ACheckableTagGroup", { name: "CheckableTagGroup", path: "tag", style: "tag" }],
35
+ ["ACheckbox", { name: "Checkbox", path: "checkbox", style: "checkbox" }],
36
+ ["ACheckboxGroup", { name: "CheckboxGroup", path: "checkbox", style: "checkbox" }],
37
+ ["ACol", { name: "Col", path: "grid", style: "grid" }],
38
+ ["ACollapse", { name: "Collapse", path: "collapse", style: "collapse" }],
39
+ ["ACollapsePanel", { name: "CollapsePanel", path: "collapse", style: "collapse" }],
40
+ ["AColorPicker", { name: "ColorPicker", path: "color-picker", style: "color-picker" }],
41
+ ["AColorPickerPanel", { name: "ColorPickerPanel", path: "color-picker", style: "color-picker" }],
42
+ [
43
+ "AColorPickerPurePanel",
44
+ { name: "ColorPickerPurePanel", path: "color-picker", style: "color-picker" }
45
+ ],
46
+ ["ACompactItem", { name: "CompactItem", path: "space", style: "space" }],
47
+ ["AConfigProvider", { name: "ConfigProvider", path: "config-provider" }],
48
+ ["ACountdown", { name: "StatisticCountdown", path: "statistic", style: "statistic" }],
49
+ ["ADatePicker", { name: "DatePicker", path: "date-picker", style: "date-picker" }],
50
+ ["ADatePickerRangePicker", { name: "RangePicker", path: "date-picker", style: "date-picker" }],
51
+ [
52
+ "ADatePickerWithRange",
53
+ { name: "DatePickerWithRange", path: "date-picker", style: "date-picker" }
54
+ ],
55
+ ["ADefaultRenderEmpty", { name: "DefaultRenderEmpty", path: "config-provider", style: "empty" }],
56
+ ["ADescriptions", { name: "Descriptions", path: "descriptions", style: "descriptions" }],
57
+ ["ADescriptionsItem", { name: "DescriptionsItem", path: "descriptions", style: "descriptions" }],
58
+ ["ADirectoryTree", { name: "DirectoryTree", path: "tree", style: "tree" }],
59
+ ["ADivider", { name: "Divider", path: "divider", style: "divider" }],
60
+ ["ADrawer", { name: "Drawer", path: "drawer", style: "drawer" }],
61
+ ["ADrawerPurePanel", { name: "DrawerPurePanel", path: "drawer", style: "drawer" }],
62
+ ["ADropdown", { name: "Dropdown", path: "dropdown", style: "dropdown" }],
63
+ ["ADropdownButton", { name: "DropdownButton", path: "dropdown", style: "dropdown" }],
64
+ ["ADropdownPurePanel", { name: "DropdownPurePanel", path: "dropdown", style: "dropdown" }],
65
+ ["AEmpty", { name: "Empty", path: "empty", style: "empty" }],
66
+ ["AFlex", { name: "Flex", path: "flex", style: "flex" }],
67
+ ["AFlexDefault", { name: "default", path: "flex", style: "flex" }],
68
+ ["AFloatButton", { name: "FloatButton", path: "float-button", style: "float-button" }],
69
+ [
70
+ "AFloatButtonBackTop",
71
+ { name: "FloatButtonBackTop", path: "float-button", style: "float-button" }
72
+ ],
73
+ ["AFloatButtonGroup", { name: "FloatButtonGroup", path: "float-button", style: "float-button" }],
74
+ [
75
+ "AFloatButtonPurePanel",
76
+ { name: "FloatButtonPurePanel", path: "float-button", style: "float-button" }
77
+ ],
78
+ ["AForm", { name: "Form", path: "form", style: "form" }],
79
+ ["AFormErrorList", { name: "ErrorListComponent", path: "form", style: "form" }],
80
+ ["AFormItem", { name: "FormItem", path: "form", style: "form" }],
81
+ ["AFormList", { name: "FormList", path: "form", style: "form" }],
82
+ ["AGridDefault", { name: "default", path: "grid", style: "grid" }],
83
+ ["AImage", { name: "Image", path: "image", style: "image" }],
84
+ ["AImagePreviewGroup", { name: "ImagePreviewGroup", path: "image", style: "image" }],
85
+ ["AInput", { name: "Input", path: "input", style: "input" }],
86
+ ["AInputGroup", { name: "InputGroup", path: "input", style: "input" }],
87
+ ["AInputNumber", { name: "InputNumber", path: "input-number", style: "input-number" }],
88
+ ["AInputOtp", { name: "InputOTP", path: "input", style: "input" }],
89
+ ["AInputOTP", { name: "InputOTP", path: "input", style: "input" }],
90
+ ["AInputPassword", { name: "InputPassword", path: "input", style: "input" }],
91
+ ["AInputSearch", { name: "InputSearch", path: "input", style: "input" }],
92
+ ["AInputTextarea", { name: "TextArea", path: "input", style: "input" }],
93
+ ["AInputTextArea", { name: "TextArea", path: "input", style: "input" }],
94
+ ["ALayout", { name: "Layout", path: "layout", style: "layout" }],
95
+ ["ALayoutContent", { name: "LayoutContent", path: "layout", style: "layout" }],
96
+ ["ALayoutFooter", { name: "LayoutFooter", path: "layout", style: "layout" }],
97
+ ["ALayoutHeader", { name: "LayoutHeader", path: "layout", style: "layout" }],
98
+ ["ALayoutSider", { name: "LayoutSider", path: "layout", style: "layout-sider" }],
99
+ ["ALink", { name: "Link", path: "typography", style: "typography" }],
100
+ ["AList", { name: "List", path: "list", style: "list" }],
101
+ ["AListItem", { name: "ListItem", path: "list", style: "list" }],
102
+ ["AListItemMeta", { name: "ListItemMeta", path: "list", style: "list" }],
103
+ ["AListy", { name: "Listy", path: "listy", style: "listy" }],
104
+ ["AMasonry", { name: "Masonry", path: "masonry", style: "masonry" }],
105
+ ["AMentions", { name: "Mentions", path: "mentions", style: "mentions" }],
106
+ ["AMentionsOption", { name: "MentionsOption", path: "mentions", style: "mentions" }],
107
+ ["AMenu", { name: "Menu", path: "menu", style: "menu" }],
108
+ ["AMenuDivider", { name: "MenuDivider", path: "menu", style: "menu" }],
109
+ ["AMenuItem", { name: "MenuItem", path: "menu", style: "menu" }],
110
+ ["AMenuItemGroup", { name: "MenuItemGroup", path: "menu", style: "menu" }],
111
+ ["AMenuSubMenu", { name: "MenuSubMenu", path: "menu", style: "menu" }],
112
+ ["AModal", { name: "default", path: "modal", style: "modal" }],
113
+ ["AModalPurePanel", { name: "ModalPurePanel", path: "modal", style: "modal" }],
114
+ ["ANoCompactStyle", { name: "NoCompactStyle", path: "space", style: "space" }],
115
+ ["APagination", { name: "Pagination", path: "pagination", style: "pagination" }],
116
+ ["AParagraph", { name: "Paragraph", path: "typography", style: "typography" }],
117
+ ["APopconfirm", { name: "Popconfirm", path: "popconfirm", style: "popconfirm" }],
118
+ [
119
+ "APopconfirmPurePanel",
120
+ { name: "PopconfirmPurePanel", path: "popconfirm", style: "popconfirm" }
121
+ ],
122
+ ["APopover", { name: "Popover", path: "popover", style: "popover" }],
123
+ ["APopoverPurePanel", { name: "PopoverPurePanel", path: "popover", style: "popover" }],
124
+ ["AProgress", { name: "Progress", path: "progress", style: "progress" }],
125
+ ["AQrCode", { name: "QrCode", path: "qr-code", style: "qr-code" }],
126
+ ["ARadio", { name: "Radio", path: "radio", style: "radio" }],
127
+ ["ARadioButton", { name: "RadioButton", path: "radio", style: "radio" }],
128
+ ["ARadioGroup", { name: "RadioGroup", path: "radio", style: "radio" }],
129
+ ["ARangePicker", { name: "RangePicker", path: "date-picker", style: "date-picker" }],
130
+ ["ARate", { name: "Rate", path: "rate", style: "rate" }],
131
+ ["AResult", { name: "Result", path: "result", style: "result" }],
132
+ ["ARibbon", { name: "Ribbon", path: "badge", style: "badge" }],
133
+ ["ARow", { name: "Row", path: "grid", style: "grid" }],
134
+ ["ASegmented", { name: "Segmented", path: "segmented", style: "segmented" }],
135
+ ["ASelect", { name: "default", path: "select", style: "select" }],
136
+ ["ASelectOptGroup", { name: "SelectOptGroup", path: "select", style: "select" }],
137
+ ["ASelectOption", { name: "SelectOption", path: "select", style: "select" }],
138
+ ["ASelectPurePanel", { name: "SelectPurePanel", path: "select", style: "select" }],
139
+ ["ASkeleton", { name: "Skeleton", path: "skeleton", style: "skeleton" }],
140
+ ["ASkeletonAvatar", { name: "SkeletonAvatar", path: "skeleton", style: "skeleton" }],
141
+ ["ASkeletonButton", { name: "SkeletonButton", path: "skeleton", style: "skeleton" }],
142
+ ["ASkeletonImage", { name: "SkeletonImage", path: "skeleton", style: "skeleton" }],
143
+ ["ASkeletonInput", { name: "SkeletonInput", path: "skeleton", style: "skeleton" }],
144
+ ["ASkeletonNode", { name: "SkeletonNode", path: "skeleton", style: "skeleton" }],
145
+ ["ASlider", { name: "Slider", path: "slider", style: "slider" }],
146
+ ["ASpace", { name: "Space", path: "space", style: "space" }],
147
+ ["ASpaceAddon", { name: "SpaceAddon", path: "space", style: "space" }],
148
+ ["ASpaceCompact", { name: "SpaceCompact", path: "space", style: "space" }],
149
+ ["ASpin", { name: "Spin", path: "spin", style: "spin" }],
150
+ ["ASplitter", { name: "Splitter", path: "splitter", style: "splitter" }],
151
+ ["ASplitterPanel", { name: "SplitterPanel", path: "splitter", style: "splitter" }],
152
+ ["AStatistic", { name: "Statistic", path: "statistic", style: "statistic" }],
153
+ ["AStatisticCountdown", { name: "StatisticCountdown", path: "statistic", style: "statistic" }],
154
+ ["AStatisticTimer", { name: "StatisticTimer", path: "statistic", style: "statistic" }],
155
+ ["ASteps", { name: "Steps", path: "steps", style: "steps" }],
156
+ ["ASummary", { name: "Summary", path: "table", style: "table" }],
157
+ ["ASwitch", { name: "Switch", path: "switch", style: "switch" }],
158
+ ["ATable", { name: "Table", path: "table", style: "table" }],
159
+ ["ATableSummary", { name: "Summary", path: "table", style: "table" }],
160
+ ["ATableSummaryCell", { name: "TableSummaryCell", path: "table", style: "table" }],
161
+ ["ATableSummaryRow", { name: "TableSummaryRow", path: "table", style: "table" }],
162
+ ["ATabs", { name: "Tabs", path: "tabs", style: "tabs" }],
163
+ ["ATag", { name: "Tag", path: "tag", style: "tag" }],
164
+ ["ATagCheckableTag", { name: "CheckableTag", path: "tag", style: "tag" }],
165
+ ["ATagCheckableTagGroup", { name: "CheckableTagGroup", path: "tag", style: "tag" }],
166
+ ["AText", { name: "Text", path: "typography", style: "typography" }],
167
+ ["ATextarea", { name: "TextArea", path: "input", style: "input" }],
168
+ ["ATextArea", { name: "TextArea", path: "input", style: "input" }],
169
+ ["ATimeline", { name: "Timeline", path: "timeline", style: "timeline" }],
170
+ ["ATimePicker", { name: "TimePicker", path: "time-picker", style: "date-picker" }],
171
+ [
172
+ "ATimePickerRangePicker",
173
+ { name: "TimeRangePicker", path: "time-picker", style: "date-picker" }
174
+ ],
175
+ [
176
+ "ATimePickerWithRange",
177
+ { name: "TimePickerWithRange", path: "time-picker", style: "date-picker" }
178
+ ],
179
+ ["ATimeRangePicker", { name: "TimeRangePicker", path: "time-picker", style: "date-picker" }],
180
+ ["ATitle", { name: "Title", path: "typography", style: "typography" }],
181
+ ["ATooltip", { name: "Tooltip", path: "tooltip", style: "tooltip" }],
182
+ ["ATooltipPurePanel", { name: "TooltipPurePanel", path: "tooltip", style: "tooltip" }],
183
+ ["ATour", { name: "Tour", path: "tour", style: "tour" }],
184
+ ["ATourPurePanel", { name: "TourPurePanel", path: "tour", style: "tour" }],
185
+ ["ATransfer", { name: "Transfer", path: "transfer", style: "transfer" }],
186
+ ["ATransferList", { name: "TransferList", path: "transfer", style: "transfer" }],
187
+ ["ATransferOperation", { name: "TransferOperation", path: "transfer", style: "transfer" }],
188
+ ["ATransferSearch", { name: "TransferSearch", path: "transfer", style: "transfer" }],
189
+ ["ATree", { name: "Tree", path: "tree", style: "tree" }],
190
+ ["ATreeDirectoryTree", { name: "DirectoryTree", path: "tree", style: "tree" }],
191
+ ["ATreeSelect", { name: "TreeSelect", path: "tree-select", style: "tree-select" }],
192
+ ["ATypography", { name: "Typography", path: "typography", style: "typography" }],
193
+ ["ATypographyLink", { name: "Link", path: "typography", style: "typography" }],
194
+ ["ATypographyParagraph", { name: "Paragraph", path: "typography", style: "typography" }],
195
+ ["ATypographyText", { name: "Text", path: "typography", style: "typography" }],
196
+ ["ATypographyTitle", { name: "Title", path: "typography", style: "typography" }],
197
+ ["AUpload", { name: "Upload", path: "upload", style: "upload" }],
198
+ ["AUploadDragger", { name: "UploadDragger", path: "upload", style: "upload" }],
199
+ ["AWatermark", { name: "Watermark", path: "watermark" }]
200
+ ]);
201
+
202
+ export { componentImports };
@@ -0,0 +1,11 @@
1
+ import { ComponentResolverObject } from 'unplugin-vue-components';
2
+
3
+ interface ApolloResolverOptions {
4
+ /** Import structural component CSS. Applications load their theme explicitly. @default true */
5
+ importStyle?: boolean;
6
+ }
7
+ /** Resolve Apollo's explicit A-prefixed public component names at build time. */
8
+ declare function ApolloResolver(options?: ApolloResolverOptions): ComponentResolverObject;
9
+
10
+ export { ApolloResolver };
11
+ export type { ApolloResolverOptions };
@@ -0,0 +1,11 @@
1
+ import { ComponentResolverObject } from 'unplugin-vue-components';
2
+
3
+ interface ApolloResolverOptions {
4
+ /** Import structural component CSS. Applications load their theme explicitly. @default true */
5
+ importStyle?: boolean;
6
+ }
7
+ /** Resolve Apollo's explicit A-prefixed public component names at build time. */
8
+ declare function ApolloResolver(options?: ApolloResolverOptions): ComponentResolverObject;
9
+
10
+ export { ApolloResolver };
11
+ export type { ApolloResolverOptions };
package/dist/index.mjs ADDED
@@ -0,0 +1,19 @@
1
+ import { componentImports } from './component-imports.mjs';
2
+ import { componentStyles } from './style-manifest.mjs';
3
+
4
+ function ApolloResolver(options = {}) {
5
+ return {
6
+ type: "component",
7
+ resolve(name) {
8
+ const component = componentImports.get(name);
9
+ if (!component) return;
10
+ return {
11
+ name: component.name,
12
+ from: `@apollo-design/ui/${component.path}`,
13
+ sideEffects: options.importStyle === false || !component.style ? void 0 : componentStyles(component.style)
14
+ };
15
+ }
16
+ };
17
+ }
18
+
19
+ export { ApolloResolver };
@@ -0,0 +1,20 @@
1
+ import { createRequire } from 'node:module';
2
+
3
+ const require$1 = createRequire(import.meta.url);
4
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
5
+ const isStyles = (value) => Array.isArray(value) && value.every((entry) => typeof entry === "string");
6
+ function componentStyles(family) {
7
+ const manifest = require$1("@apollo-design/ui/style-manifest.json");
8
+ if (!isRecord(manifest) || manifest.schemaVersion !== 1 || !isRecord(manifest.components)) {
9
+ throw new Error("[ApolloResolver] Unsupported UI style manifest; schemaVersion 1 is required.");
10
+ }
11
+ const component = manifest.components[family];
12
+ if (!isRecord(component) || !isStyles(component.styles)) {
13
+ throw new Error(
14
+ `[ApolloResolver] Missing structural styles for UI component family "${family}".`
15
+ );
16
+ }
17
+ return [...component.styles];
18
+ }
19
+
20
+ export { componentStyles };
package/package.json CHANGED
@@ -1,6 +1,37 @@
1
1
  {
2
2
  "name": "@apollo-design/ui-resolver",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.9",
4
+ "description": "Build-time Vue component and structural CSS imports for Apollo Design.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/index.mjs",
9
+ "module": "./dist/index.mjs",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.mjs"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "engines": {
22
+ "node": ">=22.12.0"
23
+ },
24
+ "peerDependencies": {
25
+ "@apollo-design/ui": ">=0.1.8 <0.2.0",
26
+ "unplugin-vue-components": "^32.1.0"
27
+ },
28
+ "devDependencies": {
29
+ "@apollo-design/ui": "0.1.9",
30
+ "unplugin-vue-components": "^32.1.0"
31
+ },
32
+ "scripts": {
33
+ "build": "unbuild --config ../../scripts/unbuild-preserve-modules.mjs",
34
+ "test": "vitest run --root ../.. --project unit packages/ui-resolver/src",
35
+ "lint": "vue-tsc --noEmit -p tsconfig.json"
36
+ }
6
37
  }