@uxfront/layer-docs 0.8.3 → 0.9.0

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.
@@ -0,0 +1,407 @@
1
+ /**
2
+ * The pure side of framework URLs, shared by the module, the app and the server
3
+ * routes: the URL shape, which frameworks a page covers, and the page data for
4
+ * one framework. Nothing here touches Nuxt, so the tests call it directly.
5
+ */
6
+
7
+ /** The name of the route that serves `/docs/<framework>/<page>`. */
8
+ export const FRAMEWORK_ROUTE_NAME = "docs-framework";
9
+
10
+ /** A node of a page body in Nuxt Content's minimark format: text, or `[tag, props, ...children]`. */
11
+ export type MinimarkNode = string | MinimarkElement;
12
+ export type MinimarkElement = [string, Record<string, unknown>, ...MinimarkNode[]];
13
+
14
+ /** A page body, as Nuxt Content stores it. */
15
+ export interface MinimarkBody {
16
+ type?: string;
17
+ value?: MinimarkNode[];
18
+ toc?: Toc;
19
+ [key: string]: unknown;
20
+ }
21
+
22
+ interface TocLink {
23
+ id: string;
24
+ children?: TocLink[];
25
+ [key: string]: unknown;
26
+ }
27
+
28
+ interface Toc {
29
+ links?: TocLink[];
30
+ [key: string]: unknown;
31
+ }
32
+
33
+ /** A navigation item, as Nuxt Content builds them. */
34
+ export interface NavigationItem {
35
+ title: string;
36
+ path: string;
37
+ stem?: string;
38
+ children?: NavigationItem[];
39
+ [key: string]: unknown;
40
+ }
41
+
42
+ const SWITCHER_TAGS = new Set(["framework-switcher", "FrameworkSwitcher"]);
43
+ const LINK_PROPS = ["href", "to"];
44
+
45
+ /** The route path the layer registers: only the framework values match the segment. */
46
+ export function frameworkRoutePath(frameworks: readonly string[]): string {
47
+ const values = frameworks.map((value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
48
+ return `/docs/:framework(${values.join("|")})/:slug(.*)*`;
49
+ }
50
+
51
+ /** The content path a framework route renders: `/docs/<page>`. */
52
+ export function contentPathOf(slug: string | readonly string[] | undefined): string {
53
+ const segments = (Array.isArray(slug) ? slug : [slug]).filter(Boolean);
54
+ return segments.length ? `/docs/${segments.join("/")}` : "/docs";
55
+ }
56
+
57
+ /** The framework URL of a content path: `/docs/<page>` becomes `/docs/<framework>/<page>`. */
58
+ export function frameworkPathOf(contentPath: string, framework: string): string {
59
+ if (contentPath === "/docs") return `/docs/${framework}`;
60
+ return `/docs/${framework}${contentPath.slice("/docs".length)}`;
61
+ }
62
+
63
+ /**
64
+ * Puts the framework into a same-site link to a docs page: `/docs/<page>`
65
+ * becomes `/docs/<framework>/<page>`, with its query and hash. A link that
66
+ * already has a framework prefix, `/docs` itself, and any other link stay as
67
+ * they are.
68
+ */
69
+ export function prefixDocsPath<T>(link: T, framework: string, frameworks: readonly string[]): T {
70
+ if (typeof link !== "string" || !link.startsWith("/docs/")) return link;
71
+ const rest = link.slice("/docs/".length);
72
+ const first = rest.split(/[/?#]/, 1)[0] ?? "";
73
+ if (!first || frameworks.includes(first)) return link;
74
+ return `/docs/${framework}/${rest}` as T;
75
+ }
76
+
77
+ /** The same, for every path in a navigation tree. */
78
+ export function prefixNavigation<T extends NavigationItem>(
79
+ items: readonly T[] | null | undefined,
80
+ framework: string,
81
+ frameworks: readonly string[],
82
+ ): T[] {
83
+ return (items ?? []).map((item) => ({
84
+ ...item,
85
+ path: prefixDocsPath(item.path, framework, frameworks),
86
+ ...(item.children && {
87
+ children: prefixNavigation(item.children, framework, frameworks),
88
+ }),
89
+ }));
90
+ }
91
+
92
+ /**
93
+ * Whether the prerenderer should leave a path out: an unprefixed docs page
94
+ * like `/docs/<page>` or its payload, which a site with framework URLs serves
95
+ * only under a framework.
96
+ */
97
+ export function isUnprefixedDocsPath(path: string, frameworks: readonly string[]): boolean {
98
+ if (!path.startsWith("/docs/")) return false;
99
+ const first = path.slice("/docs/".length).split(/[/?#]/, 1)[0] ?? "";
100
+ return !frameworks.includes(first);
101
+ }
102
+
103
+ /**
104
+ * The path of the markdown Nuxt Content serves for a framework path:
105
+ * `/raw/docs/react/a.md` becomes `/raw/docs/a.md`, and `/raw/docs/react.md`
106
+ * `/raw/docs.md`. Any other path gives `undefined`.
107
+ */
108
+ export function rawContentPath(url: string, frameworks: readonly string[]): string | undefined {
109
+ if (!url.startsWith("/raw/docs/")) return undefined;
110
+ const rest = url.slice("/raw/docs/".length);
111
+ const framework = rest.split(/[/.?#]/, 1)[0] ?? "";
112
+ if (!frameworks.includes(framework)) return undefined;
113
+ const after = rest.slice(framework.length);
114
+ const [path = ""] = after.split(/[?#]/, 1);
115
+ if (!path.endsWith(".md") || !(path.startsWith("/") || path === ".md")) return undefined;
116
+ return `/raw/docs${after}`;
117
+ }
118
+
119
+ function isElement(node: MinimarkNode | undefined): node is MinimarkElement {
120
+ return Array.isArray(node) && typeof node[0] === "string";
121
+ }
122
+
123
+ /** The slot a `<template>` child of a switcher fills, as `react` for `#react`. */
124
+ function slotOf(node: MinimarkNode): string | undefined {
125
+ if (!isElement(node) || node[0] !== "template") return undefined;
126
+ for (const key of Object.keys(node[1] ?? {})) {
127
+ if (key.startsWith("v-slot:")) return key.slice("v-slot:".length);
128
+ if (key.startsWith("#")) return key.slice(1);
129
+ }
130
+ return undefined;
131
+ }
132
+
133
+ function childrenOf(node: MinimarkElement): MinimarkNode[] {
134
+ return node.slice(2) as MinimarkNode[];
135
+ }
136
+
137
+ function switchersIn(nodes: readonly MinimarkNode[] | undefined): MinimarkElement[] {
138
+ const found: MinimarkElement[] = [];
139
+ const visit = (node: MinimarkNode) => {
140
+ if (!isElement(node)) return;
141
+ if (SWITCHER_TAGS.has(node[0])) found.push(node);
142
+ childrenOf(node).forEach(visit);
143
+ };
144
+ (nodes ?? []).forEach(visit);
145
+ return found;
146
+ }
147
+
148
+ /**
149
+ * The frameworks a page covers, in the order of `frameworks`: those that every
150
+ * `::framework-switcher` on it has a slot for. A page with no switcher covers
151
+ * them all.
152
+ */
153
+ export function pageFrameworks(
154
+ body: MinimarkBody | null | undefined,
155
+ frameworks: readonly string[],
156
+ ): string[] {
157
+ const switchers = switchersIn(body?.value);
158
+ return frameworks.filter((framework) =>
159
+ switchers.every((switcher) =>
160
+ childrenOf(switcher).some((child) => slotOf(child) === framework),
161
+ ),
162
+ );
163
+ }
164
+
165
+ /**
166
+ * The slot `FrameworkSwitcher` shows for a framework: its own, or the first
167
+ * one the switcher has, in the order of `frameworks`.
168
+ */
169
+ function shownSlot(
170
+ switcher: MinimarkElement,
171
+ framework: string,
172
+ frameworks: readonly string[],
173
+ ): string | undefined {
174
+ const slots = new Set(childrenOf(switcher).map(slotOf));
175
+ if (slots.has(framework)) return framework;
176
+ return frameworks.find((value) => slots.has(value));
177
+ }
178
+
179
+ function trimNode(
180
+ node: MinimarkNode,
181
+ framework: string,
182
+ frameworks: readonly string[],
183
+ trimSlots = true,
184
+ ): MinimarkNode | undefined {
185
+ if (!isElement(node)) return node;
186
+ const [tag, props, ...children] = node;
187
+
188
+ let kept = children;
189
+ if (trimSlots && SWITCHER_TAGS.has(tag)) {
190
+ const shown = shownSlot(node, framework, frameworks);
191
+ kept = children.filter((child) => {
192
+ const slot = slotOf(child);
193
+ return slot === undefined || slot === shown;
194
+ });
195
+ }
196
+
197
+ const nextProps = { ...props };
198
+ for (const key of LINK_PROPS) {
199
+ if (key in nextProps) nextProps[key] = prefixDocsPath(nextProps[key], framework, frameworks);
200
+ }
201
+
202
+ const nextChildren = kept
203
+ .map((child) => trimNode(child, framework, frameworks, trimSlots))
204
+ .filter((child): child is MinimarkNode => child !== undefined);
205
+ return [tag, nextProps, ...nextChildren];
206
+ }
207
+
208
+ function idsIn(nodes: readonly MinimarkNode[]): Set<string> {
209
+ const ids = new Set<string>();
210
+ const visit = (node: MinimarkNode) => {
211
+ if (!isElement(node)) return;
212
+ const id = node[1]?.id;
213
+ if (typeof id === "string") ids.add(id);
214
+ childrenOf(node).forEach(visit);
215
+ };
216
+ nodes.forEach(visit);
217
+ return ids;
218
+ }
219
+
220
+ function filterToc(links: readonly TocLink[], ids: Set<string>): TocLink[] {
221
+ return links
222
+ .filter((link) => ids.has(link.id))
223
+ .map((link) => (link.children ? { ...link, children: filterToc(link.children, ids) } : link));
224
+ }
225
+
226
+ /**
227
+ * A page body for one framework: each `::framework-switcher` keeps only the
228
+ * slot `FrameworkSwitcher` shows, same-site links to docs pages get the
229
+ * framework's prefix, and the table of contents drops the headings that went
230
+ * with the other slots.
231
+ */
232
+ export function trimPageBody<T extends MinimarkBody | null | undefined>(
233
+ body: T,
234
+ framework: string,
235
+ frameworks: readonly string[],
236
+ ): T {
237
+ if (!body || !Array.isArray(body.value)) return body;
238
+ const value = body.value
239
+ .map((node) => trimNode(node, framework, frameworks))
240
+ .filter((node): node is MinimarkNode => node !== undefined);
241
+ const next: MinimarkBody = { ...body, value };
242
+ if (body.toc?.links) {
243
+ next.toc = { ...body.toc, links: filterToc(body.toc.links, idsIn(value)) };
244
+ }
245
+ return next as T;
246
+ }
247
+
248
+ /**
249
+ * A page body with its same-site links to docs pages under `framework`, and
250
+ * its switchers left whole, for a page outside the docs, like Docus's landing
251
+ * page, which links to the docs under the first framework.
252
+ */
253
+ export function prefixBodyLinks<T extends MinimarkBody | null | undefined>(
254
+ body: T,
255
+ framework: string,
256
+ frameworks: readonly string[],
257
+ ): T {
258
+ if (!body || !Array.isArray(body.value)) return body;
259
+ const value = body.value
260
+ .map((node) => trimNode(node, framework, frameworks, false))
261
+ .filter((node): node is MinimarkNode => node !== undefined);
262
+ return { ...body, value } as T;
263
+ }
264
+
265
+ /** A page's frontmatter `links`, with each `to` under `framework`. */
266
+ export function prefixPageLinks<T extends { to?: unknown }>(
267
+ links: readonly T[] | null | undefined,
268
+ framework: string,
269
+ frameworks: readonly string[],
270
+ ): T[] | undefined {
271
+ return links?.map((link) => ({ ...link, to: prefixDocsPath(link.to, framework, frameworks) }));
272
+ }
273
+
274
+ /**
275
+ * The title of the section a page sits in, as Nuxt Content's
276
+ * `findPageHeadline` finds it, for the headline above the page's title.
277
+ */
278
+ export function findHeadline(
279
+ navigation: readonly NavigationItem[] | null | undefined,
280
+ path: string,
281
+ ): string | undefined {
282
+ for (const link of navigation ?? []) {
283
+ if (!link.children) continue;
284
+ if (link.children.some((child) => child.path === path && !child.stem?.endsWith("/index"))) {
285
+ return link.title;
286
+ }
287
+ const headline = findHeadline(link.children, path);
288
+ if (headline) return headline;
289
+ }
290
+ return undefined;
291
+ }
292
+
293
+ /** An absolute URL on the site, or the path itself when the site has no URL. */
294
+ export function absoluteUrl(siteUrl: string | undefined, path: string): string {
295
+ return siteUrl ? `${siteUrl.replace(/\/+$/, "")}${path}` : path;
296
+ }
297
+
298
+ /** A Nuxt Content path that only holds navigation settings, like `/docs/.navigation`. */
299
+ export function isNavigationPath(path: string): boolean {
300
+ return path.endsWith(".navigation") || path.includes("/.navigation/");
301
+ }
302
+
303
+ /** A docs page, with the fields the sitemap reads. */
304
+ export interface SitemapPage {
305
+ path?: string;
306
+ body?: MinimarkBody | null;
307
+ meta?: Record<string, unknown> | null;
308
+ sitemap?: unknown;
309
+ modifiedAt?: unknown;
310
+ }
311
+
312
+ /** One `<url>` of the sitemap: a path on the site, not an absolute URL. */
313
+ export interface DocsSitemapEntry {
314
+ /** The page's URL path, as `/docs/react/components/button`. */
315
+ loc: string;
316
+ /** The date part of the page's `modifiedAt`, as `2026-11-19`, when it has one. */
317
+ lastmod?: string;
318
+ /** The page's content path, as `/docs/components/button`. */
319
+ path: string;
320
+ }
321
+
322
+ /**
323
+ * The sitemap's entries for a list of pages, by Docus's rules: a page with
324
+ * `sitemap: false` or a navigation-only path is left out, and `modifiedAt`
325
+ * sets `lastmod`. With framework URLs on, each docs page comes once for each
326
+ * framework it covers. Without them, `frameworks` is empty, and each page
327
+ * comes once at its own path.
328
+ */
329
+ export function sitemapEntries(
330
+ pages: readonly SitemapPage[],
331
+ frameworks: readonly string[],
332
+ ): DocsSitemapEntry[] {
333
+ const entries: DocsSitemapEntry[] = [];
334
+ for (const page of pages) {
335
+ const path = page.path || "/";
336
+ const meta = page.meta ?? {};
337
+ if ((meta.sitemap ?? page.sitemap) === false || isNavigationPath(path)) continue;
338
+ const modifiedAt = meta.modifiedAt ?? page.modifiedAt;
339
+ const lastmod = typeof modifiedAt === "string" ? modifiedAt.split("T")[0] : undefined;
340
+ const isDocsPage = path === "/docs" || path.startsWith("/docs/");
341
+ const locs =
342
+ frameworks.length && isDocsPage
343
+ ? pageFrameworks(page.body, frameworks).map((framework) => frameworkPathOf(path, framework))
344
+ : [path];
345
+ for (const loc of locs) entries.push({ loc, path, ...(lastmod && { lastmod }) });
346
+ }
347
+ return entries;
348
+ }
349
+
350
+ const XML_ENTITIES: Record<string, string> = {
351
+ "&": "&amp;",
352
+ "<": "&lt;",
353
+ ">": "&gt;",
354
+ '"': "&quot;",
355
+ "'": "&apos;",
356
+ };
357
+
358
+ function escapeXml(value: string): string {
359
+ return value.replace(/[&<>"']/g, (char) => XML_ENTITIES[char] ?? char);
360
+ }
361
+
362
+ /** The sitemap XML for a list of entries, as Docus writes it. */
363
+ export function sitemapXml(
364
+ entries: readonly DocsSitemapEntry[],
365
+ siteUrl: string | undefined,
366
+ ): string {
367
+ const urls = entries.map(({ loc, lastmod }) =>
368
+ [
369
+ " <url>",
370
+ ` <loc>${escapeXml(absoluteUrl(siteUrl, loc))}</loc>`,
371
+ ...(lastmod ? [` <lastmod>${escapeXml(lastmod)}</lastmod>`] : []),
372
+ " </url>",
373
+ ].join("\n"),
374
+ );
375
+ return [
376
+ '<?xml version="1.0" encoding="UTF-8"?>',
377
+ '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
378
+ ...urls,
379
+ "</urlset>",
380
+ ].join("\n");
381
+ }
382
+
383
+ /** A server handler Nitro found in a `server/routes/` directory. */
384
+ export interface ScannedHandler {
385
+ route?: string;
386
+ handler: string;
387
+ }
388
+
389
+ /**
390
+ * Whether the layer's `/sitemap.xml` should stay: only when no scanned route
391
+ * serves that path outside the Docus package, since a site's own route wins.
392
+ * Docus's own route doesn't count, as the layer's replaces it. `realpath`
393
+ * resolves symlinks, since pnpm can reach Docus through `node_modules/docus`
394
+ * or `node_modules/.pnpm/docus@…`.
395
+ */
396
+ export function keepsLayerSitemap(
397
+ scanned: readonly ScannedHandler[],
398
+ docusDir: string,
399
+ realpath: (path: string) => string,
400
+ ): boolean {
401
+ const docus = realpath(docusDir).replace(/[\\/]+$/, "");
402
+ return !scanned.some((handler) => {
403
+ if (handler.route !== "/sitemap.xml") return false;
404
+ const file = realpath(handler.handler);
405
+ return !(file === docus || file.startsWith(`${docus}/`) || file.startsWith(`${docus}\\`));
406
+ });
407
+ }
@@ -0,0 +1,34 @@
1
+ import { defineNuxtModule } from "@nuxt/kit";
2
+
3
+ /**
4
+ * Takes `onServerPrefetch` off the list of composables Nuxt removes from the
5
+ * client build, so the browser registers the same hooks the server does.
6
+ */
7
+ export function keepServerPrefetch(composables: Record<string, string[]>) {
8
+ for (const [source, names] of Object.entries(composables)) {
9
+ composables[source] = names.filter((name) => name !== "onServerPrefetch");
10
+ }
11
+ return composables;
12
+ }
13
+
14
+ /**
15
+ * Keeps the ids `useId` makes the same on the server and in the browser.
16
+ *
17
+ * Vue builds each id from the async boundaries above the component: every
18
+ * component with an async setup or an `onServerPrefetch` hook starts a new one.
19
+ * Nuxt removes `onServerPrefetch` calls from production client builds, since the
20
+ * browser never runs them, so a component that registers one, like the icons
21
+ * `@nuxt/icon` renders in CSS mode, is a boundary on the server and not in the
22
+ * browser. Every id after the docs header's first icon then changes as the page
23
+ * hydrates, and the Framework select, the sidebar's accordions and a page's tabs
24
+ * lose the elements their `aria-labelledby` and `aria-controls` point to.
25
+ * Development builds keep the calls, which is why only the built site shows it.
26
+ *
27
+ * It runs before Nuxt reads the list, when every module is set up.
28
+ */
29
+ export default defineNuxtModule({
30
+ meta: { name: "hydration-ids" },
31
+ setup(_, nuxt) {
32
+ keepServerPrefetch(nuxt.options.optimization.treeShake.composables.client);
33
+ },
34
+ });
package/nuxt.config.ts CHANGED
@@ -1,3 +1,7 @@
1
+ import { createResolver } from "@nuxt/kit";
2
+
3
+ const resolver = createResolver(import.meta.url);
4
+
1
5
  /**
2
6
  * `@uxfront/layer-docs`: the Nuxt side of UXFront's documentation sites.
3
7
  *
@@ -8,20 +12,53 @@
8
12
  * which shows the reader's pick. The app lists its frameworks in
9
13
  * `docsTheme.frameworks` in its `app.config.ts`. It can also set the header's
10
14
  * site name as a wordmark, signed "by UXFront" (`docsTheme.wordmark` and
11
- * `docsTheme.byline`).
15
+ * `docsTheme.byline`). It names Docus's mobile menu toggle, and highlights code
16
+ * in GitHub's high-contrast themes, whose every colour reaches 4.5:1 on the code
17
+ * blocks' background. Its `hydration-ids` module keeps the ids `useId()` makes
18
+ * the same on the server and in the browser, so the select's label and the
19
+ * sidebar's accordions still find their elements once the prerendered page
20
+ * hydrates.
21
+ *
22
+ * Its `framework-urls` module, off unless the app sets
23
+ * `frameworkUrls: { enabled: true }`, serves every docs page at
24
+ * `/docs/<framework>/<page>` and builds it once per framework, with only that
25
+ * framework's examples in it. There the route decides the framework, the select
26
+ * goes to the same page under the new one, links keep it, a page a framework
27
+ * doesn't cover is `noindex` with its canonical on the first that does, and the
28
+ * layer serves `/sitemap.xml` unless the app has its own. `docsPath()` gives the
29
+ * URL of a docs page for links outside the Docus shell, and the auto-imported
30
+ * server helpers `getDocsSitemapEntries` and `docsPageFrameworks` give a site's
31
+ * own sitemap the same pages.
12
32
  *
13
33
  * https://nuxt.com/docs/getting-started/layers
14
34
  */
15
35
  export default defineNuxtConfig({
16
36
  extends: ["docus"],
17
37
 
18
- // The languages of the per-framework examples, on top of the ones Docus
19
- // highlights (Vue, TypeScript, HTML, CSS, …). Nuxt merges these with the app's.
38
+ modules: [
39
+ resolver.resolve("./modules/hydration-ids"),
40
+ resolver.resolve("./modules/framework-urls"),
41
+ ],
42
+
20
43
  content: {
21
44
  build: {
22
45
  markdown: {
23
46
  highlight: {
47
+ // The languages of the per-framework examples, on top of the ones Docus
48
+ // highlights (Vue, TypeScript, HTML, CSS, …). Nuxt merges these with the app's.
24
49
  langs: ["tsx", "svelte", "angular-html", "angular-ts", "astro"],
50
+ // GitHub's high-contrast themes, since every token colour in them reaches
51
+ // 4.5:1 on the code blocks' background (Nuxt UI's neutral 50 and 800) for
52
+ // every neutral Nuxt UI offers: at least 4.81:1 in light mode and 6.89:1
53
+ // in dark mode (WCAG 1.4.3). The Material themes Nuxt UI sets otherwise
54
+ // go as low as 2.18:1. All three keys are set, since Shiki emits a `.light`
55
+ // rule that outranks `default`, so leaving `light` out would keep the old
56
+ // palette in light mode.
57
+ theme: {
58
+ default: "github-light-high-contrast",
59
+ light: "github-light-high-contrast",
60
+ dark: "github-dark-high-contrast",
61
+ },
25
62
  },
26
63
  },
27
64
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxfront/layer-docs",
3
- "version": "0.8.3",
3
+ "version": "0.9.0",
4
4
  "description": "Nuxt layer for UXFront documentation sites: Docus, plus a framework switcher that shows every reader the examples for their framework, and the UXFront header wordmark.",
5
5
  "keywords": [
6
6
  "docs",
@@ -9,7 +9,7 @@
9
9
  "nuxt",
10
10
  "nuxt-layer"
11
11
  ],
12
- "homepage": "https://github.com/uxfront-com/uxfront/tree/main/packages/layer-docs#readme",
12
+ "homepage": "https://uxfront.com",
13
13
  "bugs": "https://github.com/uxfront-com/uxfront/issues",
14
14
  "license": "MIT",
15
15
  "repository": {
@@ -19,6 +19,7 @@
19
19
  },
20
20
  "files": [
21
21
  "app",
22
+ "modules",
22
23
  "nuxt.config.ts",
23
24
  "README.md"
24
25
  ],
@@ -36,16 +37,23 @@
36
37
  "access": "public"
37
38
  },
38
39
  "dependencies": {
39
- "@uxfront/ui": "^0.9.0",
40
+ "@nuxt/kit": "^4.5.2",
41
+ "@uxfront/ui": "^0.9.1",
40
42
  "@vueuse/core": "^14.4.0",
41
- "docus": "^5.13.0"
43
+ "docus": "^5.13.0",
44
+ "jiti": "^2.7.0"
42
45
  },
43
46
  "devDependencies": {
44
47
  "nuxt": "^4.5.2",
48
+ "vitest": "^5.0.1",
45
49
  "vue": "^3.5.43"
46
50
  },
47
51
  "peerDependencies": {
48
52
  "nuxt": "^4.5.0",
49
53
  "vue": "^3.5.0"
54
+ },
55
+ "scripts": {
56
+ "test": "vitest run",
57
+ "test:build": "vitest run --config vitest.build.config.ts"
50
58
  }
51
59
  }