@bettercms-ai/nuxt 0.0.0-stage → 0.3.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.
- package/README.md +107 -2
- package/dist/index.d.ts +74 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -4
package/README.md
CHANGED
|
@@ -1,3 +1,108 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @bettercms-ai/nuxt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
BetterCMS for Nuxt. Your own components stay your own: they bind a few attributes onto their elements, and every element becomes editable in the BetterCMS visual editor. Pages stay current when content is published.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i @bettercms-ai/nuxt
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
// server/utils/bcms.ts
|
|
11
|
+
export const bcms = createBcms({ env: process.env });
|
|
12
|
+
|
|
13
|
+
// server/plugins/bcms.ts: <html data-bcms-draft> in drafts, <meta name="generator">
|
|
14
|
+
export default defineNitroPlugin(bcmsNitroPlugin(bcms));
|
|
15
|
+
|
|
16
|
+
// plugins/bcms.client.ts: a publish, and the editor's re-render request, refetch the page's data
|
|
17
|
+
export default defineNuxtPlugin(() => {
|
|
18
|
+
startBcmsLive({ refresh: () => refreshNuxtData(), src: useRuntimeConfig().public.bcmsLiveUrl });
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// server/routes/api/draft.get.ts: the path the editor's "Preview on site" opens
|
|
22
|
+
export default defineEventHandler((e) => bcms.draftEnable(toWebRequest(e)));
|
|
23
|
+
|
|
24
|
+
// server/api/post/[slug].get.ts: drafts while the editor previews
|
|
25
|
+
export default defineEventHandler(async (e) => (await bcms.client(toWebRequest(e))).getEntry(getRouterParam(e, "slug")!));
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<!-- your own markup, bound to its content -->
|
|
30
|
+
<script setup>
|
|
31
|
+
import { entryAttrs, entryField, imageAttrs, rich } from "@bettercms-ai/nuxt";
|
|
32
|
+
const { data: post } = await useFetch("/api/post/hello-world");
|
|
33
|
+
</script>
|
|
34
|
+
<template>
|
|
35
|
+
<article v-bind="entryAttrs(post)">
|
|
36
|
+
<h1 v-bind="entryField(post, 'title')">{{ post.data.title }}</h1>
|
|
37
|
+
<img v-bind="{ ...imageAttrs(post.data.cover, { sizes: '100vw' }), ...entryField(post, 'cover') }" class="cover" />
|
|
38
|
+
<div v-bind="entryField(post, 'body')" v-html="rich(post.data.body)" />
|
|
39
|
+
</article>
|
|
40
|
+
</template>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Helper | What it binds |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `fieldAttrs(path, page.fieldStyles)` | A page field. It also applies the field's stored style, which turns on the editor's Align, Size and Weight controls. |
|
|
46
|
+
| `entryAttrs(entry)` | A collection entry's card. |
|
|
47
|
+
| `entryField(entry, path)` | A field of that entry. |
|
|
48
|
+
| `sectionRootAttrs(block)` | A section root (its spacing and design). |
|
|
49
|
+
| `sectionColumnAttrs(block)` | The section's content column. |
|
|
50
|
+
| `imageAttrs(value, { path, sizes })` | An optimized `<img>` with a srcset, alt text, the focal point and the field binding. |
|
|
51
|
+
| `rich(value)`, `lines(value)`, `plain(value)` | Rich text as HTML, a one-line value, or plain text for attributes. |
|
|
52
|
+
|
|
53
|
+
## Sections
|
|
54
|
+
|
|
55
|
+
A page built from sections in BetterCMS renders as the hosted renderer draws it, so forms, sliders and tabs work exactly as they do on a BetterCMS-hosted site. Pass the request and the editor's session gets the draft, with every section and value clickable:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
// server/api/sections/[slug].get.ts
|
|
59
|
+
export default defineEventHandler((e) => bcms.sections(getRouterParam(e, "slug")!, undefined, toWebRequest(e)));
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```vue
|
|
63
|
+
<div v-bcms-sections v-html="sectionsMarkup(sections)" />
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Your own sections in the CMS order
|
|
67
|
+
|
|
68
|
+
A page that draws its own sections can let BetterCMS order them, and draw sections added in the editor between them: name the page's sections (`slots`, in source order) and loop over `sectionItems`. `npx @bettercms-ai/convert --sections` writes this for you.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
// server/api/bcms-sections/[slug].get.ts
|
|
72
|
+
export default defineEventHandler((e) =>
|
|
73
|
+
bcms.sections(getRouterParam(e, "slug")!, undefined, toWebRequest(e), { slots: String(getQuery(e).slots ?? "").split(",").filter(Boolean) }));
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<script setup>
|
|
78
|
+
import { sectionItems, vBcmsSections } from "@bettercms-ai/nuxt";
|
|
79
|
+
const bcmsSlots = ["hero", "code:features"];
|
|
80
|
+
const { data } = await useFetch("/api/bcms-sections/home", { query: { slots: bcmsSlots.join(",") } });
|
|
81
|
+
const bcmsSections = computed(() => sectionItems(data.value, bcmsSlots, "home"));
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<template v-for="item in bcmsSections" :key="item.key">
|
|
86
|
+
<template v-if="item.slot === 'hero'"><section class="hero" v-bind="item.root">…</section></template>
|
|
87
|
+
<template v-else-if="item.slot === 'code:features'"><div v-bind="item.box"><Features /></div></template>
|
|
88
|
+
<div v-else-if="item.slot === null" data-bcms-rendered="platform" v-bcms-sections v-html="item.html" />
|
|
89
|
+
</template>
|
|
90
|
+
</template>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`root` goes on a section's own root element (its placement's `data-bcms-block` and style); `box` on a wrapper when the section is a component. With no answer, every slot renders in source order.
|
|
94
|
+
|
|
95
|
+
## Settings
|
|
96
|
+
|
|
97
|
+
Options are read first, then `NUXT_PUBLIC_BCMS_*`, then `BCMS_*`, the same precedence as every adapter:
|
|
98
|
+
|
|
99
|
+
| Variable | Purpose |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `NUXT_PUBLIC_BCMS_API_URL` | The API to read from. |
|
|
102
|
+
| `NUXT_PUBLIC_BCMS_WORKSPACE` | Your workspace. |
|
|
103
|
+
| `NUXT_PUBLIC_BCMS_PROJECT_ID` | Your project. |
|
|
104
|
+
| `BCMS_DRAFT_SECRET` | Signs the draft cookie. |
|
|
105
|
+
|
|
106
|
+
Don't put a page that a draft session can render behind a shared `routeRules` cache (`swr`, `isr`). The draft marker would be cached and served to visitors.
|
|
107
|
+
|
|
108
|
+
The sections run small inline scripts (forms, sliders and tabs), so a Content-Security-Policy must allow inline scripts.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { BcmsSite } from '@bettercms-ai/sdk/sections';
|
|
2
|
+
export { BcmsSite, SectionItem, SectionsFragment, SectionsFragmentItem, sectionItems, sectionsMarkup } from '@bettercms-ai/sdk/sections';
|
|
3
|
+
import { BcmsSiteOptions } from '@bettercms-ai/sdk/config';
|
|
4
|
+
export * from '@bettercms-ai/sdk/bindings';
|
|
5
|
+
export { BcmsChangeEvent, StartBcmsLiveOptions, inEditor, liveSrc, onContentApplied, startBcmsLive } from '@bettercms-ai/sdk/live';
|
|
6
|
+
export { lines, plain, rich } from '@bettercms-ai/sdk/read';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @bettercms-ai/nuxt — BetterCMS for Nuxt: the site's own markup bound to its content, so every
|
|
10
|
+
* element is editable in the BetterCMS visual editor, and the site stays live on publish.
|
|
11
|
+
*
|
|
12
|
+
* // server/utils/bcms.ts
|
|
13
|
+
* export const bcms = createBcms({ env: process.env });
|
|
14
|
+
*
|
|
15
|
+
* // server/plugins/bcms.ts — `<html data-bcms-draft>` in drafts, `<meta name="generator">`
|
|
16
|
+
* export default defineNitroPlugin(bcmsNitroPlugin(bcms));
|
|
17
|
+
*
|
|
18
|
+
* // plugins/bcms.client.ts — a publish, and the editor's re-render request, refetch the data
|
|
19
|
+
* export default defineNuxtPlugin(() => { startBcmsLive({ refresh: () => refreshNuxtData() }) });
|
|
20
|
+
*
|
|
21
|
+
* // server/api/page/[slug].get.ts — drafts while the editor previews
|
|
22
|
+
* export default defineEventHandler(async (e) => (await bcms.client(toWebRequest(e))).getPage(getRouterParam(e, "slug")!));
|
|
23
|
+
*
|
|
24
|
+
* // pages/index.vue — the site's OWN markup, bound to its fields
|
|
25
|
+
* const { data: page } = await useFetch("/api/page/home");
|
|
26
|
+
* <h1 v-bind="fieldAttrs('hero-title', page.fieldStyles)">{{ page.data["hero-title"] }}</h1>
|
|
27
|
+
* <img v-bind="imageAttrs(page.data.cover, { path: 'cover', sizes: '100vw' })" class="cover" />
|
|
28
|
+
* <div v-bind="fieldAttrs('body')" v-html="rich(page.data.body)" />
|
|
29
|
+
*
|
|
30
|
+
* // or a page's sections as the hosted renderer draws them
|
|
31
|
+
* <div v-bcms-sections v-html="sectionsMarkup(sections)" />
|
|
32
|
+
*
|
|
33
|
+
* // server/routes/api/draft.get.ts — the path the editor's "Preview on site" opens
|
|
34
|
+
* export default defineEventHandler((e) => bcms.draftEnable(toWebRequest(e)));
|
|
35
|
+
*
|
|
36
|
+
* Settings: options, then `NUXT_PUBLIC_BCMS_*`, then `BCMS_*` (the same precedence as every adapter).
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/** Build the site's BetterCMS access from its settings (pass `process.env` on the server). */
|
|
40
|
+
declare function createBcms(options?: BcmsSiteOptions & {
|
|
41
|
+
env?: Record<string, string | undefined>;
|
|
42
|
+
draftSecret?: string;
|
|
43
|
+
}): BcmsSite;
|
|
44
|
+
/** The least of Nitro this needs, so the package carries no nitropack types. */
|
|
45
|
+
interface NitroLike {
|
|
46
|
+
hooks: {
|
|
47
|
+
hook(name: "render:html", fn: (html: {
|
|
48
|
+
htmlAttrs: string[];
|
|
49
|
+
head: string[];
|
|
50
|
+
}, ctx: {
|
|
51
|
+
event: {
|
|
52
|
+
headers?: Headers;
|
|
53
|
+
node?: {
|
|
54
|
+
req?: {
|
|
55
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}) => unknown): unknown;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The Nitro plugin: every server-rendered page names BetterCMS in its `<head>` and, while the
|
|
64
|
+
* request previews drafts, carries `<html data-bcms-draft="1">`, the canvas's proof that the
|
|
65
|
+
* frame renders drafts (and what `startBcmsLive` reads to load the click-to-edit overlay).
|
|
66
|
+
*/
|
|
67
|
+
declare function bcmsNitroPlugin(bcms: BcmsSite): (nitroApp: NitroLike) => void;
|
|
68
|
+
/** Vue directive for the element holding `v-html="sectionsMarkup(…)"`: its scripts run on every page. */
|
|
69
|
+
declare const vBcmsSections: {
|
|
70
|
+
mounted: (el: Element) => void;
|
|
71
|
+
updated: (el: Element) => void;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { bcmsNitroPlugin, createBcms, vBcmsSections };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { createBcmsSite, runSectionScripts } from "@bettercms-ai/sdk/sections";
|
|
3
|
+
import { GENERATOR_META } from "@bettercms-ai/sdk/live";
|
|
4
|
+
import { sectionsMarkup, sectionItems } from "@bettercms-ai/sdk/sections";
|
|
5
|
+
export * from "@bettercms-ai/sdk/bindings";
|
|
6
|
+
import { startBcmsLive, liveSrc, inEditor, onContentApplied } from "@bettercms-ai/sdk/live";
|
|
7
|
+
import { plain, rich, lines } from "@bettercms-ai/sdk/read";
|
|
8
|
+
function createBcms(options = {}) {
|
|
9
|
+
return createBcmsSite({ ...options, prefixes: ["NUXT_PUBLIC_"], adapter: "@bettercms-ai/nuxt" });
|
|
10
|
+
}
|
|
11
|
+
function bcmsNitroPlugin(bcms) {
|
|
12
|
+
return (nitroApp) => {
|
|
13
|
+
nitroApp.hooks.hook("render:html", async (html, { event }) => {
|
|
14
|
+
html.head.push(GENERATOR_META);
|
|
15
|
+
const raw = event.headers?.get("cookie") ?? event.node?.req?.headers?.cookie;
|
|
16
|
+
const cookie = Array.isArray(raw) ? raw.join("; ") : raw;
|
|
17
|
+
if (cookie && await bcms.isDraft(new Request("http://bcms.local/", { headers: { cookie } }))) html.htmlAttrs.push('data-bcms-draft="1"');
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
var vBcmsSections = {
|
|
22
|
+
mounted: (el) => runSectionScripts(el),
|
|
23
|
+
updated: (el) => runSectionScripts(el)
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
bcmsNitroPlugin,
|
|
27
|
+
createBcms,
|
|
28
|
+
inEditor,
|
|
29
|
+
lines,
|
|
30
|
+
liveSrc,
|
|
31
|
+
onContentApplied,
|
|
32
|
+
plain,
|
|
33
|
+
rich,
|
|
34
|
+
sectionItems,
|
|
35
|
+
sectionsMarkup,
|
|
36
|
+
startBcmsLive,
|
|
37
|
+
vBcmsSections
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/// <reference lib=\"dom\" />\n/**\n * @bettercms-ai/nuxt — BetterCMS for Nuxt: the site's own markup bound to its content, so every\n * element is editable in the BetterCMS visual editor, and the site stays live on publish.\n *\n * // server/utils/bcms.ts\n * export const bcms = createBcms({ env: process.env });\n *\n * // server/plugins/bcms.ts — `<html data-bcms-draft>` in drafts, `<meta name=\"generator\">`\n * export default defineNitroPlugin(bcmsNitroPlugin(bcms));\n *\n * // plugins/bcms.client.ts — a publish, and the editor's re-render request, refetch the data\n * export default defineNuxtPlugin(() => { startBcmsLive({ refresh: () => refreshNuxtData() }) });\n *\n * // server/api/page/[slug].get.ts — drafts while the editor previews\n * export default defineEventHandler(async (e) => (await bcms.client(toWebRequest(e))).getPage(getRouterParam(e, \"slug\")!));\n *\n * // pages/index.vue — the site's OWN markup, bound to its fields\n * const { data: page } = await useFetch(\"/api/page/home\");\n * <h1 v-bind=\"fieldAttrs('hero-title', page.fieldStyles)\">{{ page.data[\"hero-title\"] }}</h1>\n * <img v-bind=\"imageAttrs(page.data.cover, { path: 'cover', sizes: '100vw' })\" class=\"cover\" />\n * <div v-bind=\"fieldAttrs('body')\" v-html=\"rich(page.data.body)\" />\n *\n * // or a page's sections as the hosted renderer draws them\n * <div v-bcms-sections v-html=\"sectionsMarkup(sections)\" />\n *\n * // server/routes/api/draft.get.ts — the path the editor's \"Preview on site\" opens\n * export default defineEventHandler((e) => bcms.draftEnable(toWebRequest(e)));\n *\n * Settings: options, then `NUXT_PUBLIC_BCMS_*`, then `BCMS_*` (the same precedence as every adapter).\n */\nimport { createBcmsSite, runSectionScripts, type BcmsSite } from \"@bettercms-ai/sdk/sections\";\nimport type { BcmsSiteOptions } from \"@bettercms-ai/sdk/config\";\nimport { GENERATOR_META } from \"@bettercms-ai/sdk/live\";\n\nexport { sectionsMarkup, sectionItems, type SectionsFragment, type SectionsFragmentItem, type SectionItem, type BcmsSite } from \"@bettercms-ai/sdk/sections\";\nexport * from \"@bettercms-ai/sdk/bindings\";\nexport { startBcmsLive, liveSrc, inEditor, onContentApplied, type BcmsChangeEvent, type StartBcmsLiveOptions } from \"@bettercms-ai/sdk/live\";\nexport { plain, rich, lines } from \"@bettercms-ai/sdk/read\";\n\n/** Build the site's BetterCMS access from its settings (pass `process.env` on the server). */\nexport function createBcms(options: BcmsSiteOptions & { env?: Record<string, string | undefined>; draftSecret?: string } = {}): BcmsSite {\n return createBcmsSite({ ...options, prefixes: [\"NUXT_PUBLIC_\"], adapter: \"@bettercms-ai/nuxt\" });\n}\n\n/** The least of Nitro this needs, so the package carries no nitropack types. */\ninterface NitroLike {\n hooks: {\n hook(\n name: \"render:html\",\n fn: (html: { htmlAttrs: string[]; head: string[] }, ctx: { event: { headers?: Headers; node?: { req?: { headers?: Record<string, string | string[] | undefined> } } } }) => unknown,\n ): unknown;\n };\n}\n\n/**\n * The Nitro plugin: every server-rendered page names BetterCMS in its `<head>` and, while the\n * request previews drafts, carries `<html data-bcms-draft=\"1\">`, the canvas's proof that the\n * frame renders drafts (and what `startBcmsLive` reads to load the click-to-edit overlay).\n */\nexport function bcmsNitroPlugin(bcms: BcmsSite) {\n return (nitroApp: NitroLike): void => {\n nitroApp.hooks.hook(\"render:html\", async (html, { event }) => {\n html.head.push(GENERATOR_META);\n const raw = event.headers?.get(\"cookie\") ?? event.node?.req?.headers?.cookie;\n const cookie = Array.isArray(raw) ? raw.join(\"; \") : raw;\n if (cookie && (await bcms.isDraft(new Request(\"http://bcms.local/\", { headers: { cookie } })))) html.htmlAttrs.push('data-bcms-draft=\"1\"');\n });\n };\n}\n\n/** Vue directive for the element holding `v-html=\"sectionsMarkup(…)\"`: its scripts run on every page. */\nexport const vBcmsSections = {\n mounted: (el: Element) => runSectionScripts(el),\n updated: (el: Element) => runSectionScripts(el),\n};\n"],"mappings":";AA+BA,SAAS,gBAAgB,yBAAwC;AAEjE,SAAS,sBAAsB;AAE/B,SAAS,gBAAgB,oBAAuG;AAChI,cAAc;AACd,SAAS,eAAe,SAAS,UAAU,wBAAyE;AACpH,SAAS,OAAO,MAAM,aAAa;AAG5B,SAAS,WAAW,UAAgG,CAAC,GAAa;AACvI,SAAO,eAAe,EAAE,GAAG,SAAS,UAAU,CAAC,cAAc,GAAG,SAAS,qBAAqB,CAAC;AACjG;AAiBO,SAAS,gBAAgB,MAAgB;AAC9C,SAAO,CAAC,aAA8B;AACpC,aAAS,MAAM,KAAK,eAAe,OAAO,MAAM,EAAE,MAAM,MAAM;AAC5D,WAAK,KAAK,KAAK,cAAc;AAC7B,YAAM,MAAM,MAAM,SAAS,IAAI,QAAQ,KAAK,MAAM,MAAM,KAAK,SAAS;AACtE,YAAM,SAAS,MAAM,QAAQ,GAAG,IAAI,IAAI,KAAK,IAAI,IAAI;AACrD,UAAI,UAAW,MAAM,KAAK,QAAQ,IAAI,QAAQ,sBAAsB,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,EAAI,MAAK,UAAU,KAAK,qBAAqB;AAAA,IAC3I,CAAC;AAAA,EACH;AACF;AAGO,IAAM,gBAAgB;AAAA,EAC3B,SAAS,CAAC,OAAgB,kBAAkB,EAAE;AAAA,EAC9C,SAAS,CAAC,OAAgB,kBAAkB,EAAE;AAChD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bettercms-ai/nuxt",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "BetterCMS for Nuxt: settings from NUXT_PUBLIC_BCMS_*, the read client per request with draft mode, the editor's draft routes, and the page sections server-rendered by BetterCMS.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@bettercms-ai/sdk": "^1.40.0"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"vue": ">=3"
|
|
26
|
+
},
|
|
27
|
+
"peerDependenciesMeta": {
|
|
28
|
+
"vue": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"typecheck": "tsc --noEmit",
|
|
34
|
+
"build": "tsup",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"prepublishOnly": "bun run build"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/node": "^20",
|
|
40
|
+
"tsup": "^8.5.1",
|
|
41
|
+
"typescript": "^5",
|
|
42
|
+
"vitest": "^4.1.4"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public",
|
|
46
|
+
"registry": "https://registry.npmjs.org/"
|
|
47
|
+
}
|
|
48
|
+
}
|