unhead 2.0.0-beta.2 → 2.0.0-rc.10

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.
Files changed (40) hide show
  1. package/README.md +13 -13
  2. package/client.d.ts +1 -1
  3. package/dist/client.d.mts +1 -1
  4. package/dist/client.d.ts +1 -1
  5. package/dist/client.mjs +21 -16
  6. package/dist/index.d.mts +3 -3
  7. package/dist/index.d.ts +3 -3
  8. package/dist/index.mjs +3 -3
  9. package/dist/legacy.d.mts +3 -3
  10. package/dist/legacy.d.ts +3 -3
  11. package/dist/legacy.mjs +3 -3
  12. package/dist/plugins.d.mts +1 -1
  13. package/dist/plugins.d.ts +1 -1
  14. package/dist/scripts.d.mts +3 -3
  15. package/dist/scripts.d.ts +3 -3
  16. package/dist/scripts.mjs +1 -1
  17. package/dist/server.d.mts +1 -1
  18. package/dist/server.d.ts +1 -1
  19. package/dist/server.mjs +4 -3
  20. package/dist/shared/{unhead.CydFxwlU.mjs → unhead.B52g_5xR.mjs} +16 -8
  21. package/dist/shared/{unhead.Cqz1mYhY.mjs → unhead.B578PsDV.mjs} +3 -3
  22. package/dist/shared/{unhead.H7cI6Gl6.d.mts → unhead.BPGZqmZq.d.mts} +3 -2
  23. package/dist/shared/{unhead.H7cI6Gl6.d.ts → unhead.BPGZqmZq.d.ts} +3 -2
  24. package/dist/shared/{unhead.xsi8MZXD.mjs → unhead.BaPU1zLf.mjs} +15 -15
  25. package/dist/shared/{unhead.3Owfjv3i.d.ts → unhead.CBYQCMZ_.d.ts} +1 -1
  26. package/dist/shared/{unhead.CkcjMbbj.d.mts → unhead.DaEqG59d.d.mts} +1 -1
  27. package/dist/shared/{unhead.BgkNfCFO.d.mts → unhead.DhdHYdZH.d.mts} +1 -1
  28. package/dist/shared/{unhead.1ztrDOLw.d.ts → unhead.nqPOI-gJ.d.ts} +1 -1
  29. package/dist/types.d.mts +4 -4
  30. package/dist/types.d.ts +4 -4
  31. package/dist/utils.d.mts +1 -1
  32. package/dist/utils.d.ts +1 -1
  33. package/dist/utils.mjs +1 -1
  34. package/legacy.d.ts +1 -1
  35. package/package.json +13 -18
  36. package/plugins.d.ts +1 -1
  37. package/scripts.d.ts +1 -1
  38. package/server.d.ts +1 -1
  39. package/types.d.ts +1 -1
  40. package/utils.d.ts +1 -1
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # `unhead`
2
-
3
- Visit the [documentation site](https://unhead.unjs.io/) for guides and API references.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm i unhead
9
- ```
10
-
11
- ## License
12
-
13
- MIT License © 2022-PRESENT [Harlan Wilton](https://github.com/harlan-zw)
1
+ # `unhead`
2
+
3
+ Visit the [documentation site](https://unhead.unjs.io/) for guides and API references.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i unhead
9
+ ```
10
+
11
+ ## License
12
+
13
+ MIT License © 2022-PRESENT [Harlan Wilton](https://github.com/harlan-zw)
package/client.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/client'
1
+ export * from './dist/client.mjs'
package/dist/client.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as ResolvableHead, q as CreateClientHeadOptions, U as Unhead, G as RenderDomHeadOptions } from './shared/unhead.H7cI6Gl6.mjs';
1
+ import { R as ResolvableHead, q as CreateClientHeadOptions, U as Unhead, G as RenderDomHeadOptions } from './shared/unhead.BPGZqmZq.mjs';
2
2
  import 'hookable';
3
3
 
4
4
  declare function createHead<T = ResolvableHead>(options?: CreateClientHeadOptions): Unhead<T>;
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as ResolvableHead, q as CreateClientHeadOptions, U as Unhead, G as RenderDomHeadOptions } from './shared/unhead.H7cI6Gl6.js';
1
+ import { R as ResolvableHead, q as CreateClientHeadOptions, U as Unhead, G as RenderDomHeadOptions } from './shared/unhead.BPGZqmZq.js';
2
2
  import 'hookable';
3
3
 
4
4
  declare function createHead<T = ResolvableHead>(options?: CreateClientHeadOptions): Unhead<T>;
package/dist/client.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { a as createUnhead } from './shared/unhead.CydFxwlU.mjs';
1
+ import { a as createUnhead } from './shared/unhead.B52g_5xR.mjs';
2
2
  import { H as HasElementTags } from './shared/unhead.yem5I2v_.mjs';
3
- import { h as hashTag, i as isMetaArrayDupeKey, a as normalizeProps, d as dedupeKey } from './shared/unhead.xsi8MZXD.mjs';
3
+ import { h as hashTag, i as isMetaArrayDupeKey, a as normalizeProps, d as dedupeKey } from './shared/unhead.BaPU1zLf.mjs';
4
4
  import 'hookable';
5
5
  import './shared/unhead.DZbvapt-.mjs';
6
6
 
@@ -38,6 +38,7 @@ async function renderDOMHead(head, options = {}) {
38
38
  let state = head._dom;
39
39
  if (!state) {
40
40
  state = {
41
+ title: dom.title,
41
42
  elMap: (/* @__PURE__ */ new Map()).set("htmlAttrs", dom.documentElement).set("bodyAttrs", dom.body)
42
43
  };
43
44
  for (const key of ["body", "head"]) {
@@ -149,6 +150,7 @@ async function renderDOMHead(head, options = {}) {
149
150
  continue;
150
151
  if (tag.tag === "title") {
151
152
  dom.title = tag.textContent;
153
+ track("title", "", () => dom.title = state.title);
152
154
  continue;
153
155
  }
154
156
  ctx.$el = ctx.$el || state.elMap.get(id);
@@ -184,22 +186,25 @@ async function renderDOMHead(head, options = {}) {
184
186
  }
185
187
 
186
188
  function createHead(options = {}) {
187
- const head = createUnhead({
188
- document: typeof window !== "undefined" ? document : void 0,
189
- ...options
190
- });
191
- const initialPayload = head.resolvedOptions.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML || false;
192
- if (initialPayload) {
193
- head.push(JSON.parse(initialPayload));
194
- }
195
189
  const render = options.domOptions?.render || renderDOMHead;
196
- head.use({
197
- key: "client",
198
- hooks: {
199
- "entries:updated": render
200
- }
190
+ options.document = options.document || (typeof window !== "undefined" ? document : void 0);
191
+ const initialPayload = options.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML || false;
192
+ return createUnhead({
193
+ ...options,
194
+ plugins: [
195
+ ...options.plugins || [],
196
+ {
197
+ key: "client",
198
+ hooks: {
199
+ "entries:updated": render
200
+ }
201
+ }
202
+ ],
203
+ init: [
204
+ initialPayload ? JSON.parse(initialPayload) : false,
205
+ ...options.init || []
206
+ ]
201
207
  });
202
- return head;
203
208
  }
204
209
 
205
210
  function createDebouncedFn(callee, delayer) {
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { H as HeadSafe } from './shared/unhead.CkcjMbbj.mjs';
2
- import { U as Unhead, R as ResolvableHead, r as HeadEntryOptions, o as ActiveHeadEntry, a8 as UseSeoMetaInput, C as CreateHeadOptions } from './shared/unhead.H7cI6Gl6.mjs';
3
- export { u as useScript } from './shared/unhead.BgkNfCFO.mjs';
1
+ import { H as HeadSafe } from './shared/unhead.DaEqG59d.mjs';
2
+ import { U as Unhead, R as ResolvableHead, r as HeadEntryOptions, o as ActiveHeadEntry, a8 as UseSeoMetaInput, C as CreateHeadOptions } from './shared/unhead.BPGZqmZq.mjs';
3
+ export { u as useScript } from './shared/unhead.DhdHYdZH.mjs';
4
4
  import 'hookable';
5
5
 
6
6
  declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: ResolvableHead, options?: HeadEntryOptions): ActiveHeadEntry<I>;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { H as HeadSafe } from './shared/unhead.1ztrDOLw.js';
2
- import { U as Unhead, R as ResolvableHead, r as HeadEntryOptions, o as ActiveHeadEntry, a8 as UseSeoMetaInput, C as CreateHeadOptions } from './shared/unhead.H7cI6Gl6.js';
3
- export { u as useScript } from './shared/unhead.3Owfjv3i.js';
1
+ import { H as HeadSafe } from './shared/unhead.nqPOI-gJ.js';
2
+ import { U as Unhead, R as ResolvableHead, r as HeadEntryOptions, o as ActiveHeadEntry, a8 as UseSeoMetaInput, C as CreateHeadOptions } from './shared/unhead.BPGZqmZq.js';
3
+ export { u as useScript } from './shared/unhead.CBYQCMZ_.js';
4
4
  import 'hookable';
5
5
 
6
6
  declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: ResolvableHead, options?: HeadEntryOptions): ActiveHeadEntry<I>;
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.BPM0-cfG.mjs';
2
- export { c as createHeadCore, a as createUnhead } from './shared/unhead.CydFxwlU.mjs';
3
- export { u as useScript } from './shared/unhead.Cqz1mYhY.mjs';
2
+ export { c as createHeadCore, a as createUnhead } from './shared/unhead.B52g_5xR.mjs';
3
+ export { u as useScript } from './shared/unhead.B578PsDV.mjs';
4
4
  import './shared/unhead.CApf5sj3.mjs';
5
5
  import './shared/unhead.DQc16pHI.mjs';
6
6
  import './shared/unhead.yem5I2v_.mjs';
7
7
  import 'hookable';
8
- import './shared/unhead.xsi8MZXD.mjs';
8
+ import './shared/unhead.BaPU1zLf.mjs';
9
9
  import './shared/unhead.DZbvapt-.mjs';
package/dist/legacy.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { createUnhead } from './index.mjs';
2
2
  export { useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta } from './index.mjs';
3
- import { U as Unhead, R as ResolvableHead, C as CreateHeadOptions } from './shared/unhead.H7cI6Gl6.mjs';
4
- export { u as useScript } from './shared/unhead.BgkNfCFO.mjs';
5
- import './shared/unhead.CkcjMbbj.mjs';
3
+ import { U as Unhead, R as ResolvableHead, C as CreateHeadOptions } from './shared/unhead.BPGZqmZq.mjs';
4
+ export { u as useScript } from './shared/unhead.DhdHYdZH.mjs';
5
+ import './shared/unhead.DaEqG59d.mjs';
6
6
  import 'hookable';
7
7
 
8
8
  declare const activeHead: {
package/dist/legacy.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { createUnhead } from './index.js';
2
2
  export { useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta } from './index.js';
3
- import { U as Unhead, R as ResolvableHead, C as CreateHeadOptions } from './shared/unhead.H7cI6Gl6.js';
4
- export { u as useScript } from './shared/unhead.3Owfjv3i.js';
5
- import './shared/unhead.1ztrDOLw.js';
3
+ import { U as Unhead, R as ResolvableHead, C as CreateHeadOptions } from './shared/unhead.BPGZqmZq.js';
4
+ export { u as useScript } from './shared/unhead.CBYQCMZ_.js';
5
+ import './shared/unhead.nqPOI-gJ.js';
6
6
  import 'hookable';
7
7
 
8
8
  declare const activeHead: {
package/dist/legacy.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { a as createUnhead } from './shared/unhead.CydFxwlU.mjs';
1
+ import { a as createUnhead } from './shared/unhead.B52g_5xR.mjs';
2
2
  import { D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.DnNYlT4k.mjs';
3
3
  export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.BPM0-cfG.mjs';
4
- export { u as useScript } from './shared/unhead.Cqz1mYhY.mjs';
4
+ export { u as useScript } from './shared/unhead.B578PsDV.mjs';
5
5
  import 'hookable';
6
- import './shared/unhead.xsi8MZXD.mjs';
6
+ import './shared/unhead.BaPU1zLf.mjs';
7
7
  import './shared/unhead.yem5I2v_.mjs';
8
8
  import './shared/unhead.DZbvapt-.mjs';
9
9
  import './shared/unhead.CApf5sj3.mjs';
@@ -1,4 +1,4 @@
1
- import { m as HeadPluginInput, U as Unhead, l as HeadPluginOptions } from './shared/unhead.H7cI6Gl6.mjs';
1
+ import { m as HeadPluginInput, U as Unhead, l as HeadPluginOptions } from './shared/unhead.BPGZqmZq.mjs';
2
2
  import 'hookable';
3
3
 
4
4
  declare const AliasSortingPlugin: HeadPluginInput;
package/dist/plugins.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { m as HeadPluginInput, U as Unhead, l as HeadPluginOptions } from './shared/unhead.H7cI6Gl6.js';
1
+ import { m as HeadPluginInput, U as Unhead, l as HeadPluginOptions } from './shared/unhead.BPGZqmZq.js';
2
2
  import 'hookable';
3
3
 
4
4
  declare const AliasSortingPlugin: HeadPluginInput;
@@ -1,6 +1,6 @@
1
- import { i as RecordingEntry } from './shared/unhead.H7cI6Gl6.mjs';
2
- export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, h as UseFunctionType, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.H7cI6Gl6.mjs';
3
- export { r as resolveScriptKey, u as useScript } from './shared/unhead.BgkNfCFO.mjs';
1
+ import { i as RecordingEntry } from './shared/unhead.BPGZqmZq.mjs';
2
+ export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, h as UseFunctionType, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.BPGZqmZq.mjs';
3
+ export { r as resolveScriptKey, u as useScript } from './shared/unhead.DhdHYdZH.mjs';
4
4
  import 'hookable';
5
5
 
6
6
  declare function createSpyProxy<T extends Record<string, any> | any[]>(target: T, onApply: (stack: RecordingEntry[][]) => void): T;
package/dist/scripts.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { i as RecordingEntry } from './shared/unhead.H7cI6Gl6.js';
2
- export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, h as UseFunctionType, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.H7cI6Gl6.js';
3
- export { r as resolveScriptKey, u as useScript } from './shared/unhead.3Owfjv3i.js';
1
+ import { i as RecordingEntry } from './shared/unhead.BPGZqmZq.js';
2
+ export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, h as UseFunctionType, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.BPGZqmZq.js';
3
+ export { r as resolveScriptKey, u as useScript } from './shared/unhead.CBYQCMZ_.js';
4
4
  import 'hookable';
5
5
 
6
6
  declare function createSpyProxy<T extends Record<string, any> | any[]>(target: T, onApply: (stack: RecordingEntry[][]) => void): T;
package/dist/scripts.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { r as resolveScriptKey, u as useScript } from './shared/unhead.Cqz1mYhY.mjs';
1
+ export { r as resolveScriptKey, u as useScript } from './shared/unhead.B578PsDV.mjs';
2
2
  import './shared/unhead.yem5I2v_.mjs';
3
3
 
4
4
  function createSpyProxy(target, onApply) {
package/dist/server.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as ResolvableHead, p as CreateServerHeadOptions, U as Unhead, u as RenderSSRHeadOptions, t as SSRHeadPayload, a4 as SerializableHead, au as HeadTag } from './shared/unhead.H7cI6Gl6.mjs';
1
+ import { R as ResolvableHead, p as CreateServerHeadOptions, U as Unhead, u as RenderSSRHeadOptions, t as SSRHeadPayload, a4 as SerializableHead, au as HeadTag } from './shared/unhead.BPGZqmZq.mjs';
2
2
  import 'hookable';
3
3
 
4
4
  declare function createHead<T = ResolvableHead>(options?: CreateServerHeadOptions): Unhead<T>;
package/dist/server.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { R as ResolvableHead, p as CreateServerHeadOptions, U as Unhead, u as RenderSSRHeadOptions, t as SSRHeadPayload, a4 as SerializableHead, au as HeadTag } from './shared/unhead.H7cI6Gl6.js';
1
+ import { R as ResolvableHead, p as CreateServerHeadOptions, U as Unhead, u as RenderSSRHeadOptions, t as SSRHeadPayload, a4 as SerializableHead, au as HeadTag } from './shared/unhead.BPGZqmZq.js';
2
2
  import 'hookable';
3
3
 
4
4
  declare function createHead<T = ResolvableHead>(options?: CreateServerHeadOptions): Unhead<T>;
package/dist/server.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { a as createUnhead } from './shared/unhead.CydFxwlU.mjs';
1
+ import { a as createUnhead } from './shared/unhead.B52g_5xR.mjs';
2
2
  import { T as TagsWithInnerContent, S as SelfClosingTags$1 } from './shared/unhead.yem5I2v_.mjs';
3
3
  import 'hookable';
4
- import './shared/unhead.xsi8MZXD.mjs';
4
+ import './shared/unhead.BaPU1zLf.mjs';
5
5
  import './shared/unhead.DZbvapt-.mjs';
6
6
 
7
7
  function createHead(options = {}) {
@@ -15,6 +15,7 @@ function createHead(options = {}) {
15
15
  if (k && k.startsWith("on") && typeof v === "function") {
16
16
  return `this.dataset.${k}fired = true`;
17
17
  }
18
+ return v;
18
19
  }
19
20
  ],
20
21
  init: [
@@ -120,7 +121,7 @@ function propsToString(props) {
120
121
  if (!Object.hasOwn(props, key))
121
122
  continue;
122
123
  let value = props[key];
123
- if (key === "class" || key === "style") {
124
+ if ((key === "class" || key === "style") && typeof value !== "string") {
124
125
  value = key === "class" ? Array.from(value).join(" ") : Array.from(value).map(([k, v]) => `${k}:${v}`).join(";");
125
126
  }
126
127
  if (value !== false && value !== null) {
@@ -1,5 +1,5 @@
1
1
  import { createHooks } from 'hookable';
2
- import { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.xsi8MZXD.mjs';
2
+ import { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.BaPU1zLf.mjs';
3
3
  import { t as tagWeight, s as sortTags } from './unhead.DZbvapt-.mjs';
4
4
  import { c as UsesMergeStrategy, V as ValidHeadTags } from './unhead.yem5I2v_.mjs';
5
5
 
@@ -110,15 +110,23 @@ function createUnhead(resolvedOptions = {}) {
110
110
  return acc;
111
111
  }, ctx.tagMap);
112
112
  const title = ctx.tagMap.get("title");
113
- const titleTemplate = ctx.tagMap.get("titleTemplate")?.textContent;
113
+ const titleTemplate = ctx.tagMap.get("titleTemplate");
114
114
  head._title = title?.textContent;
115
- head._titleTemplate = typeof titleTemplate === "string" ? titleTemplate : void 0;
116
- if (titleTemplate && title) {
117
- let newTitle = typeof titleTemplate === "function" ? titleTemplate(title.textContent) : titleTemplate;
118
- if (typeof newTitle === "string" && !head.plugins.has("template-params")) {
119
- newTitle = newTitle.replace("%s", title.textContent || "");
115
+ if (titleTemplate) {
116
+ const titleTemplateFn = titleTemplate?.textContent;
117
+ head._titleTemplate = typeof titleTemplateFn === "string" ? titleTemplateFn : void 0;
118
+ if (titleTemplateFn) {
119
+ let newTitle = typeof titleTemplateFn === "function" ? titleTemplateFn(title?.textContent) : titleTemplateFn;
120
+ if (typeof newTitle === "string" && !head.plugins.has("template-params")) {
121
+ newTitle = newTitle.replace("%s", title?.textContent || "");
122
+ }
123
+ if (title) {
124
+ newTitle === null ? ctx.tagMap.delete("title") : ctx.tagMap.set("title", { ...title, textContent: newTitle });
125
+ } else {
126
+ titleTemplate.tag = "title";
127
+ titleTemplate.textContent = newTitle;
128
+ }
120
129
  }
121
- newTitle === null ? ctx.tagMap.delete("title") : ctx.tagMap.set("title", { ...title, textContent: newTitle });
122
130
  }
123
131
  ctx.tags = Array.from(ctx.tagMap.values());
124
132
  if (hasFlatMeta) {
@@ -162,9 +162,9 @@ function useScript(head, _input, _options) {
162
162
  const link = {
163
163
  href,
164
164
  rel,
165
- crossorigin: input.crossorigin || isCrossOrigin ? "anonymous" : void 0,
166
- referrerpolicy: input.referrerpolicy || isCrossOrigin ? "no-referrer" : void 0,
167
- fetchpriority: input.fetchpriority || "low",
165
+ crossorigin: typeof input.crossorigin !== "undefined" ? input.crossorigin : isCrossOrigin ? "anonymous" : void 0,
166
+ referrerpolicy: typeof input.referrerpolicy !== "undefined" ? input.referrerpolicy : isCrossOrigin ? "no-referrer" : void 0,
167
+ fetchpriority: typeof input.fetchpriority !== "undefined" ? input.fetchpriority : "low",
168
168
  integrity: input.integrity,
169
169
  as: rel === "preload" ? "script" : void 0
170
170
  };
@@ -2164,7 +2164,7 @@ interface ActiveHeadEntry<Input> {
2164
2164
  */
2165
2165
  _poll: (rm?: boolean) => void;
2166
2166
  }
2167
- type PropResolver = (key: string, value: any, tag?: HeadTag) => any;
2167
+ type PropResolver = (key?: string, value?: any, tag?: HeadTag) => any;
2168
2168
  interface CreateHeadOptions {
2169
2169
  document?: Document;
2170
2170
  plugins?: HeadPluginInput[];
@@ -2174,7 +2174,7 @@ interface CreateHeadOptions {
2174
2174
  *
2175
2175
  * Any tags here are added with low priority.
2176
2176
  */
2177
- init?: (ResolvableHead | undefined)[];
2177
+ init?: (ResolvableHead | undefined | false)[];
2178
2178
  /**
2179
2179
  * Disable the Capo.js tag sorting algorithm.
2180
2180
  *
@@ -2295,6 +2295,7 @@ interface Unhead<Input = ResolvableHead> {
2295
2295
  _titleTemplate?: string;
2296
2296
  }
2297
2297
  interface DomState {
2298
+ title: string;
2298
2299
  pendingSideEffects: SideEffectsRecord;
2299
2300
  sideEffects: SideEffectsRecord;
2300
2301
  elMap: Map<string, Element | Element[]>;
@@ -2164,7 +2164,7 @@ interface ActiveHeadEntry<Input> {
2164
2164
  */
2165
2165
  _poll: (rm?: boolean) => void;
2166
2166
  }
2167
- type PropResolver = (key: string, value: any, tag?: HeadTag) => any;
2167
+ type PropResolver = (key?: string, value?: any, tag?: HeadTag) => any;
2168
2168
  interface CreateHeadOptions {
2169
2169
  document?: Document;
2170
2170
  plugins?: HeadPluginInput[];
@@ -2174,7 +2174,7 @@ interface CreateHeadOptions {
2174
2174
  *
2175
2175
  * Any tags here are added with low priority.
2176
2176
  */
2177
- init?: (ResolvableHead | undefined)[];
2177
+ init?: (ResolvableHead | undefined | false)[];
2178
2178
  /**
2179
2179
  * Disable the Capo.js tag sorting algorithm.
2180
2180
  *
@@ -2295,6 +2295,7 @@ interface Unhead<Input = ResolvableHead> {
2295
2295
  _titleTemplate?: string;
2296
2296
  }
2297
2297
  interface DomState {
2298
+ title: string;
2298
2299
  pendingSideEffects: SideEffectsRecord;
2299
2300
  sideEffects: SideEffectsRecord;
2300
2301
  elMap: Map<string, Element | Element[]>;
@@ -45,13 +45,14 @@ function hashTag(tag) {
45
45
 
46
46
  function walkResolver(val, resolve, key) {
47
47
  const type = typeof val;
48
+ if (type === "function") {
49
+ if (!key || key !== "titleTemplate" && !(key[0] === "o" && key[1] === "n")) {
50
+ val = val();
51
+ }
52
+ }
48
53
  let v;
49
- if (!resolve || !key) {
50
- v = type === "function" ? val() : val;
51
- } else if (resolve && (key === "titleTemplate" || key[0] === "o" && key[1] === "n")) {
54
+ if (resolve) {
52
55
  v = resolve(key, val);
53
- } else if (resolve) {
54
- v = type === "function" ? resolve(key, val()) : resolve(key, val);
55
56
  }
56
57
  if (Array.isArray(v)) {
57
58
  return v.map((r) => walkResolver(r, resolve));
@@ -152,20 +153,19 @@ function normalizeEntryToTags(input, propResolvers) {
152
153
  if (!input) {
153
154
  return [];
154
155
  }
155
- const tags = [];
156
156
  if (typeof input === "function") {
157
- return normalizeEntryToTags(input(), propResolvers);
157
+ input = input();
158
158
  }
159
- input = walkResolver(input, (key, val) => {
160
- let res = val;
159
+ const resolvers = (key, val) => {
161
160
  for (let i = 0; i < propResolvers.length; i++) {
162
- const v = propResolvers[i](key, res);
163
- if (v !== void 0)
164
- res = v;
161
+ val = propResolvers[i](key, val);
165
162
  }
166
- return res;
167
- });
168
- Object.entries(input).forEach(([key, value]) => {
163
+ return val;
164
+ };
165
+ input = resolvers(void 0, input);
166
+ const tags = [];
167
+ input = walkResolver(input, resolvers);
168
+ Object.entries(input || {}).forEach(([key, value]) => {
169
169
  if (value === void 0)
170
170
  return;
171
171
  for (const v of Array.isArray(value) ? value : [value])
@@ -1,4 +1,4 @@
1
- import { U as Unhead, a as UseScriptInput, b as UseScriptOptions, c as UseScriptReturn, d as UseScriptResolvedInput } from './unhead.H7cI6Gl6.js';
1
+ import { U as Unhead, a as UseScriptInput, b as UseScriptOptions, c as UseScriptReturn, d as UseScriptResolvedInput } from './unhead.BPGZqmZq.js';
2
2
 
3
3
  /**
4
4
  * @deprecated compute key manually
@@ -1,4 +1,4 @@
1
- import { a5 as RawInput, R as ResolvableHead, az as ResolvableValue, aA as ResolvableProperties, ag as LinkWithoutEvents, ab as DataKeys, J as SchemaAugmentations, O as UnheadMeta, ai as ScriptWithoutEvents, N as UnheadHtmlAttributes, L as UnheadBodyAttributesWithoutEvents } from './unhead.H7cI6Gl6.mjs';
1
+ import { a5 as RawInput, R as ResolvableHead, az as ResolvableValue, aA as ResolvableProperties, ag as LinkWithoutEvents, ab as DataKeys, J as SchemaAugmentations, O as UnheadMeta, ai as ScriptWithoutEvents, N as UnheadHtmlAttributes, L as UnheadBodyAttributesWithoutEvents } from './unhead.BPGZqmZq.mjs';
2
2
 
3
3
  type Base = RawInput<'base'>;
4
4
  type HtmlAttributes = RawInput<'htmlAttrs'>;
@@ -1,4 +1,4 @@
1
- import { U as Unhead, a as UseScriptInput, b as UseScriptOptions, c as UseScriptReturn, d as UseScriptResolvedInput } from './unhead.H7cI6Gl6.mjs';
1
+ import { U as Unhead, a as UseScriptInput, b as UseScriptOptions, c as UseScriptReturn, d as UseScriptResolvedInput } from './unhead.BPGZqmZq.mjs';
2
2
 
3
3
  /**
4
4
  * @deprecated compute key manually
@@ -1,4 +1,4 @@
1
- import { a5 as RawInput, R as ResolvableHead, az as ResolvableValue, aA as ResolvableProperties, ag as LinkWithoutEvents, ab as DataKeys, J as SchemaAugmentations, O as UnheadMeta, ai as ScriptWithoutEvents, N as UnheadHtmlAttributes, L as UnheadBodyAttributesWithoutEvents } from './unhead.H7cI6Gl6.js';
1
+ import { a5 as RawInput, R as ResolvableHead, az as ResolvableValue, aA as ResolvableProperties, ag as LinkWithoutEvents, ab as DataKeys, J as SchemaAugmentations, O as UnheadMeta, ai as ScriptWithoutEvents, N as UnheadHtmlAttributes, L as UnheadBodyAttributesWithoutEvents } from './unhead.BPGZqmZq.js';
2
2
 
3
3
  type Base = RawInput<'base'>;
4
4
  type HtmlAttributes = RawInput<'htmlAttrs'>;
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { B as Booleanable, e as ReferrerPolicy } from './shared/unhead.H7cI6Gl6.mjs';
2
- export { o as ActiveHeadEntry, ax as Arrayable, A as AsVoidFunctions, ae as BodyAttributesWithoutEvents, af as BodyEvents, q as CreateClientHeadOptions, C as CreateHeadOptions, p as CreateServerHeadOptions, ab as DataKeys, aC as DeepResolvableProperties, x as DomBeforeRenderCtx, I as DomPluginOptions, w as DomRenderTagContext, D as DomState, v as EntryResolveCtx, E as EventHandlerOptions, ad as GlobalAttributes, at as HasTemplateParams, a6 as Head, H as HeadEntry, r as HeadEntryOptions, F as HeadHooks, n as HeadPlugin, m as HeadPluginInput, l as HeadPluginOptions, au as HeadTag, av as HeadTagKeys, s as HookResult, ac as HttpEventAttributes, an as InnerContent, am as InnerContentVal, ag as LinkWithoutEvents, K as MaybeArray, Q as MaybeEventFnHandlers, aa as MergeHead, ah as MetaFlat, M as MetaFlatInput, ay as Never, as as ProcessesTemplateParams, P as PropResolver, a5 as RawInput, i as RecordingEntry, G as RenderDomHeadOptions, u as RenderSSRHeadOptions, X as ResolvableBase, a2 as ResolvableBodyAttributes, R as ResolvableHead, a1 as ResolvableHtmlAttributes, Y as ResolvableLink, Z as ResolvableMeta, a0 as ResolvableNoscript, aA as ResolvableProperties, $ as ResolvableScript, _ as ResolvableStyle, a3 as ResolvableTemplateParams, T as ResolvableTitle, V as ResolvableTitleTemplate, aB as ResolvableUnion, az as ResolvableValue, a7 as ResolvedHead, aj as ResolvesDuplicates, k as RuntimeMode, t as SSRHeadPayload, z as SSRRenderContext, J as SchemaAugmentations, S as ScriptInstance, ai as ScriptWithoutEvents, a4 as SerializableHead, y as ShouldRenderContext, j as SideEffectsRecord, aw as Stringable, aq as TagKey, al as TagPosition, ao as TagPriority, ap as TagUserProperties, ar as TemplateParams, U as Unhead, L as UnheadBodyAttributesWithoutEvents, N as UnheadHtmlAttributes, O as UnheadMeta, h as UseFunctionType, a9 as UseHeadInput, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, a8 as UseSeoMetaInput, ak as ValidTagPositions, W as WarmupStrategy } from './shared/unhead.H7cI6Gl6.mjs';
3
- export { B as Base, j as BodyAttributes, H as HeadSafe, g as HtmlAttributes, L as Link, M as Meta, N as Noscript, S as SafeBodyAttr, a as SafeHtmlAttr, c as SafeLink, b as SafeMeta, e as SafeNoscript, d as SafeScript, f as SafeStyle, i as Script, h as Style } from './shared/unhead.CkcjMbbj.mjs';
4
- export { r as resolveScriptKey, u as useScript } from './shared/unhead.BgkNfCFO.mjs';
1
+ import { B as Booleanable, e as ReferrerPolicy } from './shared/unhead.BPGZqmZq.mjs';
2
+ export { o as ActiveHeadEntry, ax as Arrayable, A as AsVoidFunctions, ae as BodyAttributesWithoutEvents, af as BodyEvents, q as CreateClientHeadOptions, C as CreateHeadOptions, p as CreateServerHeadOptions, ab as DataKeys, aC as DeepResolvableProperties, x as DomBeforeRenderCtx, I as DomPluginOptions, w as DomRenderTagContext, D as DomState, v as EntryResolveCtx, E as EventHandlerOptions, ad as GlobalAttributes, at as HasTemplateParams, a6 as Head, H as HeadEntry, r as HeadEntryOptions, F as HeadHooks, n as HeadPlugin, m as HeadPluginInput, l as HeadPluginOptions, au as HeadTag, av as HeadTagKeys, s as HookResult, ac as HttpEventAttributes, an as InnerContent, am as InnerContentVal, ag as LinkWithoutEvents, K as MaybeArray, Q as MaybeEventFnHandlers, aa as MergeHead, ah as MetaFlat, M as MetaFlatInput, ay as Never, as as ProcessesTemplateParams, P as PropResolver, a5 as RawInput, i as RecordingEntry, G as RenderDomHeadOptions, u as RenderSSRHeadOptions, X as ResolvableBase, a2 as ResolvableBodyAttributes, R as ResolvableHead, a1 as ResolvableHtmlAttributes, Y as ResolvableLink, Z as ResolvableMeta, a0 as ResolvableNoscript, aA as ResolvableProperties, $ as ResolvableScript, _ as ResolvableStyle, a3 as ResolvableTemplateParams, T as ResolvableTitle, V as ResolvableTitleTemplate, aB as ResolvableUnion, az as ResolvableValue, a7 as ResolvedHead, aj as ResolvesDuplicates, k as RuntimeMode, t as SSRHeadPayload, z as SSRRenderContext, J as SchemaAugmentations, S as ScriptInstance, ai as ScriptWithoutEvents, a4 as SerializableHead, y as ShouldRenderContext, j as SideEffectsRecord, aw as Stringable, aq as TagKey, al as TagPosition, ao as TagPriority, ap as TagUserProperties, ar as TemplateParams, U as Unhead, L as UnheadBodyAttributesWithoutEvents, N as UnheadHtmlAttributes, O as UnheadMeta, h as UseFunctionType, a9 as UseHeadInput, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, a8 as UseSeoMetaInput, ak as ValidTagPositions, W as WarmupStrategy } from './shared/unhead.BPGZqmZq.mjs';
3
+ export { B as Base, j as BodyAttributes, H as HeadSafe, g as HtmlAttributes, L as Link, M as Meta, N as Noscript, S as SafeBodyAttr, a as SafeHtmlAttr, c as SafeLink, b as SafeMeta, e as SafeNoscript, d as SafeScript, f as SafeStyle, i as Script, h as Style } from './shared/unhead.DaEqG59d.mjs';
4
+ export { r as resolveScriptKey, u as useScript } from './shared/unhead.DhdHYdZH.mjs';
5
5
  export { createSpyProxy } from './scripts.mjs';
6
6
  import 'hookable';
7
7
 
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { B as Booleanable, e as ReferrerPolicy } from './shared/unhead.H7cI6Gl6.js';
2
- export { o as ActiveHeadEntry, ax as Arrayable, A as AsVoidFunctions, ae as BodyAttributesWithoutEvents, af as BodyEvents, q as CreateClientHeadOptions, C as CreateHeadOptions, p as CreateServerHeadOptions, ab as DataKeys, aC as DeepResolvableProperties, x as DomBeforeRenderCtx, I as DomPluginOptions, w as DomRenderTagContext, D as DomState, v as EntryResolveCtx, E as EventHandlerOptions, ad as GlobalAttributes, at as HasTemplateParams, a6 as Head, H as HeadEntry, r as HeadEntryOptions, F as HeadHooks, n as HeadPlugin, m as HeadPluginInput, l as HeadPluginOptions, au as HeadTag, av as HeadTagKeys, s as HookResult, ac as HttpEventAttributes, an as InnerContent, am as InnerContentVal, ag as LinkWithoutEvents, K as MaybeArray, Q as MaybeEventFnHandlers, aa as MergeHead, ah as MetaFlat, M as MetaFlatInput, ay as Never, as as ProcessesTemplateParams, P as PropResolver, a5 as RawInput, i as RecordingEntry, G as RenderDomHeadOptions, u as RenderSSRHeadOptions, X as ResolvableBase, a2 as ResolvableBodyAttributes, R as ResolvableHead, a1 as ResolvableHtmlAttributes, Y as ResolvableLink, Z as ResolvableMeta, a0 as ResolvableNoscript, aA as ResolvableProperties, $ as ResolvableScript, _ as ResolvableStyle, a3 as ResolvableTemplateParams, T as ResolvableTitle, V as ResolvableTitleTemplate, aB as ResolvableUnion, az as ResolvableValue, a7 as ResolvedHead, aj as ResolvesDuplicates, k as RuntimeMode, t as SSRHeadPayload, z as SSRRenderContext, J as SchemaAugmentations, S as ScriptInstance, ai as ScriptWithoutEvents, a4 as SerializableHead, y as ShouldRenderContext, j as SideEffectsRecord, aw as Stringable, aq as TagKey, al as TagPosition, ao as TagPriority, ap as TagUserProperties, ar as TemplateParams, U as Unhead, L as UnheadBodyAttributesWithoutEvents, N as UnheadHtmlAttributes, O as UnheadMeta, h as UseFunctionType, a9 as UseHeadInput, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, a8 as UseSeoMetaInput, ak as ValidTagPositions, W as WarmupStrategy } from './shared/unhead.H7cI6Gl6.js';
3
- export { B as Base, j as BodyAttributes, H as HeadSafe, g as HtmlAttributes, L as Link, M as Meta, N as Noscript, S as SafeBodyAttr, a as SafeHtmlAttr, c as SafeLink, b as SafeMeta, e as SafeNoscript, d as SafeScript, f as SafeStyle, i as Script, h as Style } from './shared/unhead.1ztrDOLw.js';
4
- export { r as resolveScriptKey, u as useScript } from './shared/unhead.3Owfjv3i.js';
1
+ import { B as Booleanable, e as ReferrerPolicy } from './shared/unhead.BPGZqmZq.js';
2
+ export { o as ActiveHeadEntry, ax as Arrayable, A as AsVoidFunctions, ae as BodyAttributesWithoutEvents, af as BodyEvents, q as CreateClientHeadOptions, C as CreateHeadOptions, p as CreateServerHeadOptions, ab as DataKeys, aC as DeepResolvableProperties, x as DomBeforeRenderCtx, I as DomPluginOptions, w as DomRenderTagContext, D as DomState, v as EntryResolveCtx, E as EventHandlerOptions, ad as GlobalAttributes, at as HasTemplateParams, a6 as Head, H as HeadEntry, r as HeadEntryOptions, F as HeadHooks, n as HeadPlugin, m as HeadPluginInput, l as HeadPluginOptions, au as HeadTag, av as HeadTagKeys, s as HookResult, ac as HttpEventAttributes, an as InnerContent, am as InnerContentVal, ag as LinkWithoutEvents, K as MaybeArray, Q as MaybeEventFnHandlers, aa as MergeHead, ah as MetaFlat, M as MetaFlatInput, ay as Never, as as ProcessesTemplateParams, P as PropResolver, a5 as RawInput, i as RecordingEntry, G as RenderDomHeadOptions, u as RenderSSRHeadOptions, X as ResolvableBase, a2 as ResolvableBodyAttributes, R as ResolvableHead, a1 as ResolvableHtmlAttributes, Y as ResolvableLink, Z as ResolvableMeta, a0 as ResolvableNoscript, aA as ResolvableProperties, $ as ResolvableScript, _ as ResolvableStyle, a3 as ResolvableTemplateParams, T as ResolvableTitle, V as ResolvableTitleTemplate, aB as ResolvableUnion, az as ResolvableValue, a7 as ResolvedHead, aj as ResolvesDuplicates, k as RuntimeMode, t as SSRHeadPayload, z as SSRRenderContext, J as SchemaAugmentations, S as ScriptInstance, ai as ScriptWithoutEvents, a4 as SerializableHead, y as ShouldRenderContext, j as SideEffectsRecord, aw as Stringable, aq as TagKey, al as TagPosition, ao as TagPriority, ap as TagUserProperties, ar as TemplateParams, U as Unhead, L as UnheadBodyAttributesWithoutEvents, N as UnheadHtmlAttributes, O as UnheadMeta, h as UseFunctionType, a9 as UseHeadInput, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, a8 as UseSeoMetaInput, ak as ValidTagPositions, W as WarmupStrategy } from './shared/unhead.BPGZqmZq.js';
3
+ export { B as Base, j as BodyAttributes, H as HeadSafe, g as HtmlAttributes, L as Link, M as Meta, N as Noscript, S as SafeBodyAttr, a as SafeHtmlAttr, c as SafeLink, b as SafeMeta, e as SafeNoscript, d as SafeScript, f as SafeStyle, i as Script, h as Style } from './shared/unhead.nqPOI-gJ.js';
4
+ export { r as resolveScriptKey, u as useScript } from './shared/unhead.CBYQCMZ_.js';
5
5
  export { createSpyProxy } from './scripts.js';
6
6
  import 'hookable';
7
7
 
package/dist/utils.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { au as HeadTag, O as UnheadMeta, ah as MetaFlat, R as ResolvableHead, P as PropResolver, U as Unhead, ar as TemplateParams } from './shared/unhead.H7cI6Gl6.mjs';
1
+ import { au as HeadTag, O as UnheadMeta, ah as MetaFlat, R as ResolvableHead, P as PropResolver, U as Unhead, ar as TemplateParams } from './shared/unhead.BPGZqmZq.mjs';
2
2
  import 'hookable';
3
3
 
4
4
  declare const SelfClosingTags: Set<string>;
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { au as HeadTag, O as UnheadMeta, ah as MetaFlat, R as ResolvableHead, P as PropResolver, U as Unhead, ar as TemplateParams } from './shared/unhead.H7cI6Gl6.js';
1
+ import { au as HeadTag, O as UnheadMeta, ah as MetaFlat, R as ResolvableHead, P as PropResolver, U as Unhead, ar as TemplateParams } from './shared/unhead.BPGZqmZq.js';
2
2
  import 'hookable';
3
3
 
4
4
  declare const SelfClosingTags: Set<string>;
package/dist/utils.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { D as DupeableTags, H as HasElementTags, M as MetaTagsArrayable, b as ScriptNetworkEvents, S as SelfClosingTags, a as TagConfigKeys, T as TagsWithInnerContent, U as UniqueTags, c as UsesMergeStrategy, V as ValidHeadTags } from './shared/unhead.yem5I2v_.mjs';
2
- export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.xsi8MZXD.mjs';
2
+ export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.BaPU1zLf.mjs';
3
3
  export { r as resolveMetaKeyType, a as resolveMetaKeyValue, b as resolvePackedMetaObjectValue, u as unpackMeta } from './shared/unhead.DQc16pHI.mjs';
4
4
  export { s as sortTags, t as tagWeight } from './shared/unhead.DZbvapt-.mjs';
5
5
  export { p as processTemplateParams } from './shared/unhead.kVuXtrDW.mjs';
package/legacy.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/legacy'
1
+ export * from './dist/legacy.mjs'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unhead",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.2",
4
+ "version": "2.0.0-rc.10",
5
5
  "description": "Full-stack <head> manager built for any framework.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -27,35 +27,35 @@
27
27
  "exports": {
28
28
  ".": {
29
29
  "types": "./dist/index.d.ts",
30
- "import": "./dist/index.mjs"
30
+ "default": "./dist/index.mjs"
31
31
  },
32
32
  "./plugins": {
33
33
  "types": "./dist/plugins.d.ts",
34
- "import": "./dist/plugins.mjs"
34
+ "default": "./dist/plugins.mjs"
35
35
  },
36
36
  "./server": {
37
37
  "types": "./dist/server.d.ts",
38
- "import": "./dist/server.mjs"
38
+ "default": "./dist/server.mjs"
39
39
  },
40
40
  "./client": {
41
41
  "types": "./dist/client.d.ts",
42
- "import": "./dist/client.mjs"
42
+ "default": "./dist/client.mjs"
43
43
  },
44
44
  "./legacy": {
45
45
  "types": "./dist/legacy.d.ts",
46
- "import": "./dist/legacy.mjs"
46
+ "default": "./dist/legacy.mjs"
47
47
  },
48
48
  "./utils": {
49
49
  "types": "./dist/utils.d.ts",
50
- "import": "./dist/utils.mjs"
50
+ "default": "./dist/utils.mjs"
51
51
  },
52
52
  "./types": {
53
53
  "types": "./dist/types.d.ts",
54
- "import": "./dist/types.mjs"
54
+ "default": "./dist/types.mjs"
55
55
  },
56
56
  "./scripts": {
57
57
  "types": "./dist/scripts.d.ts",
58
- "import": "./dist/scripts.mjs"
58
+ "default": "./dist/scripts.mjs"
59
59
  }
60
60
  },
61
61
  "main": "dist/index.mjs",
@@ -87,20 +87,15 @@
87
87
  }
88
88
  },
89
89
  "files": [
90
- "client.d.ts",
91
- "dist",
92
- "legacy.d.ts",
93
- "plugins.d.ts",
94
- "scripts.d.ts",
95
- "server.d.ts",
96
- "types.d.ts",
97
- "utils.d.ts"
90
+ "*.d.ts",
91
+ "dist"
98
92
  ],
99
93
  "dependencies": {
100
94
  "hookable": "^5.5.3"
101
95
  },
102
96
  "scripts": {
103
97
  "build": "unbuild",
104
- "stub": "unbuild --stub"
98
+ "stub": "unbuild --stub",
99
+ "test:attw": "attw --pack"
105
100
  }
106
101
  }
package/plugins.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/plugins'
1
+ export * from './dist/plugins.mjs'
package/scripts.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/scripts'
1
+ export * from './dist/scripts.mjs'
package/server.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/server'
1
+ export * from './dist/server.mjs'
package/types.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/types'
1
+ export * from './dist/types'
package/utils.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/utils'
1
+ export * from './dist/utils'