@praxisjs/head 0.3.0 → 0.3.2
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/CHANGELOG.md +40 -0
- package/dist/head-stack.d.ts.map +1 -1
- package/dist/head-stack.js +114 -94
- package/dist/head-stack.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +15 -6
- package/src/head-stack.ts +111 -86
- package/dist/__tests__/head.test.d.ts +0 -2
- package/dist/__tests__/head.test.d.ts.map +0 -1
- package/dist/__tests__/head.test.js +0 -481
- package/dist/__tests__/head.test.js.map +0 -1
- package/dist/__tests__/internal.test.d.ts +0 -2
- package/dist/__tests__/internal.test.d.ts.map +0 -1
- package/dist/__tests__/internal.test.js +0 -32
- package/dist/__tests__/internal.test.js.map +0 -1
- package/src/__tests__/head.test.ts +0 -381
- package/src/__tests__/internal.test.ts +0 -38
- package/tsconfig.json +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @praxisjs/head
|
|
2
2
|
|
|
3
|
+
## 0.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 75115a9: Published packages no longer contain their tests: package builds compile `src` without `src/**/__tests__` (through a `tsconfig.build.json`), and each package's `files` leaves test sources and stale compiled tests out of the tarball. `pnpm typecheck` still type-checks the tests.
|
|
8
|
+
- 75115a9: Performance pass and bug fixes across the feature packages.
|
|
9
|
+
- `@praxisjs/router`: static paths are matched through an index and dynamic ones with a single regex run; `RouterView` keeps a shared layout mounted across navigations; new `router.isActive(path)` (used by `Link`, so a navigation re-evaluates only the links whose state changed) and `router.destroy()`. Fixes regex characters in route paths (`.`, `(`, `+`...) being treated as patterns, and a router replaced by `createRouter()` still reacting to `popstate`. `@Route` no longer wraps the class, and the field decorators share one accessor.
|
|
10
|
+
- `@praxisjs/store`: plugin-wrapped actions keep their identity across reads, extensions are bound once, and writing a field inside an effect no longer subscribes the effect to it. `constructor` and inherited `Object.prototype` members are no longer reported as actions. `@Store` caches the singleton.
|
|
11
|
+
- `@praxisjs/motion`: `@Tween` and `@Spring` share one accessor per field and no longer start a frame loop at construction; `tween()`/`spring()` react to target writes without an effect. Fixes `reset()` leaving a tween marked as playing.
|
|
12
|
+
- `@praxisjs/di`: cached singletons and tokens resolve without allocating, `@Injectable` registers the class itself instead of a subclass, and a dependency cycle through `inject()` calls in constructors now reports `[DI] Circular dependency detected` instead of overflowing the stack.
|
|
13
|
+
- `@praxisjs/fsm`: `send()` and `reset()` no longer subscribe the calling effect to the machine state, transitions allocate nothing per send, and `@StateMachine` shares one accessor.
|
|
14
|
+
- `@praxisjs/head`: tag diffing without `JSON.stringify` or a full `<head>` query per update; updating or removing an entry below the top one leaves the document alone, and removing an unknown id no longer resets the title.
|
|
15
|
+
- `@praxisjs/content`: each entry is loaded, parsed and rendered once and shared by `getCollection`, `getPage` and `getEntry`; `getEntry` looks the slug up in an index; schema defaults are built once per class.
|
|
16
|
+
|
|
17
|
+
- 75115a9: Smaller production bundles. The framework and feature packages are marked `"sideEffects": false`, so bundlers leave out the modules an app does not use (`For`/`Index` and `selector()` were kept in every bundle by their shape keepers). `@praxisjs/core`'s graph gates its observer instrumentation on a boolean that minifiers fold away when no observer is ever installed. `@praxisjs/runtime` passes `Index`'s positional update to the list view, so `For`-only apps leave it out, and builds its event prop table from camel-case names. `@praxisjs/devtools` is built one file per module and its decorators check `process.env.NODE_ENV` inline, so `@Trace`/`@Debug` in production code no longer bundle the registry and the panel. `@praxisjs/vite-plugin` serves TypeScript's decorator helpers and the claimed fields' helper from one virtual module (`virtual:praxisjs/decorators`) instead of writing them into every decorated file, and replaces the identical copies `tsc` wrote into ES module libraries.
|
|
18
|
+
- Updated dependencies [75115a9]
|
|
19
|
+
- Updated dependencies [75115a9]
|
|
20
|
+
- Updated dependencies [75115a9]
|
|
21
|
+
- Updated dependencies [75115a9]
|
|
22
|
+
- Updated dependencies [75115a9]
|
|
23
|
+
- Updated dependencies [75115a9]
|
|
24
|
+
- Updated dependencies [75115a9]
|
|
25
|
+
- Updated dependencies [75115a9]
|
|
26
|
+
- Updated dependencies [75115a9]
|
|
27
|
+
- Updated dependencies [75115a9]
|
|
28
|
+
- Updated dependencies [75115a9]
|
|
29
|
+
- @praxisjs/decorators@2.0.0
|
|
30
|
+
- @praxisjs/core@2.3.0
|
|
31
|
+
- @praxisjs/shared@0.3.2
|
|
32
|
+
|
|
33
|
+
## 0.3.1
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 98f3a18: Updating the head only adds and removes the tags that actually changed instead of recreating every managed tag on each update.
|
|
38
|
+
- Updated dependencies [a97a37c]
|
|
39
|
+
- Updated dependencies [c7a5950]
|
|
40
|
+
- @praxisjs/core@2.2.0
|
|
41
|
+
- @praxisjs/decorators@1.7.0
|
|
42
|
+
|
|
3
43
|
## 0.3.0
|
|
4
44
|
|
|
5
45
|
### Minor Changes
|
package/dist/head-stack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head-stack.d.ts","sourceRoot":"","sources":["../src/head-stack.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAAC;CAC/C;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC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AO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,EAAE,CAAC,EAAE;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAgBD,qFAAqF;AACrF,eAAO,MAAM,WAAW,2CAAY,CAAC;AAMrC,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAe7D;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAQ3C;AA8GD;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAQrC"}
|
package/dist/head-stack.js
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { signal } from "@praxisjs/core/internal";
|
|
2
2
|
const ATTR = "data-praxis-head";
|
|
3
3
|
const _stack = [];
|
|
4
|
+
let _managed = new Map();
|
|
4
5
|
let _initialTitle;
|
|
6
|
+
// Tags a prerender left in the document are not in `_managed`; they are swept once, on the first
|
|
7
|
+
// sync, instead of querying the whole <head> on every update.
|
|
8
|
+
let _swept = false;
|
|
5
9
|
/** Increments on every head update. Read reactively to subscribe to head changes. */
|
|
6
10
|
export const headVersion = signal(0);
|
|
11
|
+
function _bump() {
|
|
12
|
+
headVersion.update((n) => n + 1);
|
|
13
|
+
}
|
|
7
14
|
export function pushHead(id, config) {
|
|
8
15
|
if (typeof document === "undefined")
|
|
9
16
|
return;
|
|
10
17
|
_initialTitle ??= document.title;
|
|
11
18
|
const idx = _stack.findIndex((e) => e.id === id);
|
|
12
|
-
if (idx
|
|
13
|
-
_stack
|
|
19
|
+
if (idx === -1) {
|
|
20
|
+
_stack.push({ id, config });
|
|
14
21
|
}
|
|
15
22
|
else {
|
|
16
|
-
_stack.
|
|
23
|
+
_stack[idx].config = config;
|
|
24
|
+
// Only the top entry is shown; one below it changes nothing in the document yet.
|
|
25
|
+
if (idx !== _stack.length - 1) {
|
|
26
|
+
_bump();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
17
29
|
}
|
|
18
30
|
_apply();
|
|
19
31
|
}
|
|
@@ -21,109 +33,115 @@ export function removeHead(id) {
|
|
|
21
33
|
if (typeof document === "undefined")
|
|
22
34
|
return;
|
|
23
35
|
const idx = _stack.findIndex((e) => e.id === id);
|
|
24
|
-
if (idx
|
|
25
|
-
_stack.splice(idx, 1);
|
|
26
|
-
_apply();
|
|
27
|
-
}
|
|
28
|
-
function _apply() {
|
|
29
|
-
headVersion.update((n) => n + 1);
|
|
30
|
-
document.querySelectorAll(`[${ATTR}]`).forEach((el) => { el.remove(); });
|
|
31
|
-
const top = _stack.at(-1);
|
|
32
|
-
if (top === undefined) {
|
|
33
|
-
document.title = _initialTitle ?? "";
|
|
36
|
+
if (idx === -1)
|
|
34
37
|
return;
|
|
38
|
+
const wasTop = idx === _stack.length - 1;
|
|
39
|
+
_stack.splice(idx, 1);
|
|
40
|
+
if (wasTop)
|
|
41
|
+
_apply();
|
|
42
|
+
else
|
|
43
|
+
_bump();
|
|
44
|
+
}
|
|
45
|
+
function _meta(specs, attr, key, content) {
|
|
46
|
+
if (content != null)
|
|
47
|
+
specs.push({ tag: "meta", attrs: [attr, key, "content", content] });
|
|
48
|
+
}
|
|
49
|
+
function _collect(config) {
|
|
50
|
+
const specs = [];
|
|
51
|
+
_meta(specs, "name", "description", config.description);
|
|
52
|
+
if (config.canonical != null) {
|
|
53
|
+
specs.push({ tag: "link", attrs: ["rel", "canonical", "href", config.canonical] });
|
|
54
|
+
}
|
|
55
|
+
for (const link of config.preload ?? []) {
|
|
56
|
+
const attrs = ["rel", "preload", "href", link.href, "as", link.as];
|
|
57
|
+
if (link.type != null)
|
|
58
|
+
attrs.push("type", link.type);
|
|
59
|
+
if (link.crossOrigin != null)
|
|
60
|
+
attrs.push("crossorigin", link.crossOrigin);
|
|
61
|
+
specs.push({ tag: "link", attrs });
|
|
62
|
+
}
|
|
63
|
+
for (const link of config.prefetch ?? []) {
|
|
64
|
+
const attrs = ["rel", "prefetch", "href", link.href];
|
|
65
|
+
if (link.as != null)
|
|
66
|
+
attrs.push("as", link.as);
|
|
67
|
+
specs.push({ tag: "link", attrs });
|
|
35
68
|
}
|
|
36
|
-
const { config } = top;
|
|
37
|
-
if (config.title != null)
|
|
38
|
-
document.title = config.title;
|
|
39
|
-
if (config.description != null)
|
|
40
|
-
_metaName("description", config.description);
|
|
41
|
-
if (config.canonical != null)
|
|
42
|
-
_canonical(config.canonical);
|
|
43
|
-
for (const link of config.preload ?? [])
|
|
44
|
-
_linkPreload(link);
|
|
45
|
-
for (const link of config.prefetch ?? [])
|
|
46
|
-
_linkPrefetch(link);
|
|
47
69
|
for (const tag of config.meta ?? []) {
|
|
48
70
|
if (tag.property != null)
|
|
49
|
-
|
|
71
|
+
_meta(specs, "property", tag.property, tag.content);
|
|
50
72
|
else if (tag.name != null)
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
if (config.og != null) {
|
|
54
|
-
const og = config.og;
|
|
55
|
-
_applyMap("property", {
|
|
56
|
-
"og:title": og.title,
|
|
57
|
-
"og:description": og.description,
|
|
58
|
-
"og:image": og.image,
|
|
59
|
-
"og:url": og.url,
|
|
60
|
-
"og:type": og.type,
|
|
61
|
-
"og:site_name": og.siteName,
|
|
62
|
-
});
|
|
73
|
+
_meta(specs, "name", tag.name, tag.content);
|
|
63
74
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
const og = config.og;
|
|
76
|
+
if (og != null) {
|
|
77
|
+
_meta(specs, "property", "og:title", og.title);
|
|
78
|
+
_meta(specs, "property", "og:description", og.description);
|
|
79
|
+
_meta(specs, "property", "og:image", og.image);
|
|
80
|
+
_meta(specs, "property", "og:url", og.url);
|
|
81
|
+
_meta(specs, "property", "og:type", og.type);
|
|
82
|
+
_meta(specs, "property", "og:site_name", og.siteName);
|
|
72
83
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
_metaProp(key, value);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
+
const tw = config.twitter;
|
|
85
|
+
if (tw != null) {
|
|
86
|
+
_meta(specs, "name", "twitter:card", tw.card);
|
|
87
|
+
_meta(specs, "name", "twitter:title", tw.title);
|
|
88
|
+
_meta(specs, "name", "twitter:description", tw.description);
|
|
89
|
+
_meta(specs, "name", "twitter:image", tw.image);
|
|
84
90
|
}
|
|
91
|
+
return specs;
|
|
85
92
|
}
|
|
86
|
-
function
|
|
87
|
-
const el = document.createElement(
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
function _create(spec) {
|
|
94
|
+
const el = document.createElement(spec.tag);
|
|
95
|
+
const { attrs } = spec;
|
|
96
|
+
for (let i = 0; i < attrs.length; i += 2)
|
|
97
|
+
el.setAttribute(attrs[i], attrs[i + 1]);
|
|
90
98
|
el.setAttribute(ATTR, "");
|
|
91
|
-
|
|
99
|
+
return el;
|
|
92
100
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
101
|
+
// Tags the new config shares with the previous one stay in the document untouched instead of being
|
|
102
|
+
// removed and recreated on every update; only the difference is added or removed.
|
|
103
|
+
function _syncTags(specs) {
|
|
104
|
+
const next = new Map();
|
|
105
|
+
for (const spec of specs) {
|
|
106
|
+
const base = `${spec.tag}\0${spec.attrs.join("\0")}`;
|
|
107
|
+
let key = base;
|
|
108
|
+
for (let n = 2; next.has(key); n++)
|
|
109
|
+
key = `${base}#${String(n)}`;
|
|
110
|
+
let el = _managed.get(key);
|
|
111
|
+
if (el?.isConnected) {
|
|
112
|
+
_managed.delete(key);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
el = _create(spec);
|
|
116
|
+
document.head.appendChild(el);
|
|
117
|
+
}
|
|
118
|
+
next.set(key, el);
|
|
119
|
+
}
|
|
120
|
+
for (const stale of _managed.values())
|
|
121
|
+
stale.remove();
|
|
122
|
+
if (!_swept) {
|
|
123
|
+
_swept = true;
|
|
124
|
+
const keep = new Set(next.values());
|
|
125
|
+
document.head.querySelectorAll(`[${ATTR}]`).forEach((el) => {
|
|
126
|
+
if (!keep.has(el))
|
|
127
|
+
el.remove();
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
_managed = next;
|
|
118
131
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
132
|
+
function _apply() {
|
|
133
|
+
_bump();
|
|
134
|
+
const top = _stack.at(-1);
|
|
135
|
+
if (top === undefined) {
|
|
136
|
+
_syncTags([]);
|
|
137
|
+
// Set by the push that the removal emptying the stack undid.
|
|
138
|
+
document.title = _initialTitle;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const { config } = top;
|
|
142
|
+
if (config.title != null)
|
|
143
|
+
document.title = config.title;
|
|
144
|
+
_syncTags(_collect(config));
|
|
127
145
|
}
|
|
128
146
|
/**
|
|
129
147
|
* Resets all head state — the tag stack and the remembered initial `<title>`.
|
|
@@ -133,7 +151,9 @@ function _linkPrefetch(link) {
|
|
|
133
151
|
*/
|
|
134
152
|
export function resetHeadState() {
|
|
135
153
|
_stack.length = 0;
|
|
154
|
+
_managed = new Map();
|
|
136
155
|
_initialTitle = undefined;
|
|
156
|
+
_swept = false;
|
|
137
157
|
if (typeof document !== "undefined") {
|
|
138
158
|
document.querySelectorAll(`[${ATTR}]`).forEach((el) => { el.remove(); });
|
|
139
159
|
}
|
package/dist/head-stack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head-stack.js","sourceRoot":"","sources":["../src/head-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AA2CjD,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAOhC,MAAM,MAAM,GAAgB,EAAE,CAAC;AAC/B,IAAI,aAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"head-stack.js","sourceRoot":"","sources":["../src/head-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AA2CjD,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAOhC,MAAM,MAAM,GAAgB,EAAE,CAAC;AAC/B,IAAI,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;AAC9C,IAAI,aAAiC,CAAC;AACtC,iGAAiG;AACjG,8DAA8D;AAC9D,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,qFAAqF;AACrF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAErC,SAAS,KAAK;IACZ,WAAW,CAAC,MAA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CAAC;QACtB,SAAS,CAAC,EAAE,CAAC,CAAC;QACd,6DAA6D;QAC7D,QAAQ,CAAC,KAAK,GAAG,aAAuB,CAAC;QACzC,OAAO;IACT,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACvB,IAAI,MAAM,CAAC,KAAK,IAAI,IAAI;QAAE,QAAQ,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IACxD,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;IACrB,aAAa,GAAG,SAAS,CAAC;IAC1B,MAAM,GAAG,KAAK,CAAC;IACf,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { type RootComponent } from "@praxisjs/core/internal";
|
|
|
2
2
|
import { type HeadConfig, type MetaTag, type LinkPreload, type LinkPrefetch, headVersion } from "./head-stack";
|
|
3
3
|
export type { HeadConfig, MetaTag, LinkPreload, LinkPrefetch };
|
|
4
4
|
export { headVersion };
|
|
5
|
-
export declare function Head(config: HeadConfig | ((self: any) => HeadConfig)): <T extends new (...args: any[]) => RootComponent<Record<string, any>>>(constructor: T,
|
|
5
|
+
export declare function Head(config: HeadConfig | ((self: any) => HeadConfig)): <T extends new (...args: any[]) => RootComponent<Record<string, any>>>(constructor: T, context: ClassDecoratorContext) => T;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,aAAa,EAAG,MAAM,yBAAyB,CAAC;AAOtE,OAAO,EAAwB,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAErI,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,CAAC;AA4BvB,wBAAgB,IAAI,CAElB,MAAM,EAAE,UAAU,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,aAAa,EAAG,MAAM,yBAAyB,CAAC;AAOtE,OAAO,EAAwB,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAErI,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,CAAC;AA4BvB,wBAAgB,IAAI,CAElB,MAAM,EAAE,UAAU,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,UAAU,CAAC,+HAKjD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisjs/head",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
@@ -14,16 +15,24 @@
|
|
|
14
15
|
"types": "./dist/internal.d.ts"
|
|
15
16
|
}
|
|
16
17
|
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"src",
|
|
21
|
+
"!dist/**/__tests__",
|
|
22
|
+
"!src/**/__tests__",
|
|
23
|
+
"CHANGELOG.md"
|
|
24
|
+
],
|
|
17
25
|
"devDependencies": {
|
|
18
26
|
"typescript": "^6.0.3"
|
|
19
27
|
},
|
|
20
28
|
"dependencies": {
|
|
21
|
-
"@praxisjs/core": "2.
|
|
22
|
-
"@praxisjs/decorators": "
|
|
23
|
-
"@praxisjs/shared": "0.3.
|
|
29
|
+
"@praxisjs/core": "2.3.0",
|
|
30
|
+
"@praxisjs/decorators": "2.0.0",
|
|
31
|
+
"@praxisjs/shared": "0.3.2"
|
|
24
32
|
},
|
|
25
33
|
"scripts": {
|
|
26
|
-
"build": "tsc",
|
|
27
|
-
"dev": "tsc --watch"
|
|
34
|
+
"build": "tsc -p tsconfig.build.json",
|
|
35
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
36
|
+
"typecheck": "tsc --noEmit"
|
|
28
37
|
}
|
|
29
38
|
}
|