nuxt-ignis 0.5.0-rc.1 → 0.5.0-rc.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/.data/content/contents.sqlite +0 -0
- package/.env +1 -1
- package/.nuxt/components.d.ts +218 -230
- package/.nuxt/content/components.ts +108 -107
- package/.nuxt/dev/index.mjs +148 -111
- package/.nuxt/dev/index.mjs.map +1 -1
- package/.nuxt/dist/server/client.manifest.json +2 -2
- package/.nuxt/dist/server/client.manifest.mjs +2 -2
- package/.nuxt/eslint-typegen.d.ts +60 -6
- package/.nuxt/eslint.config.d.mts +3 -3
- package/.nuxt/eslint.config.mjs +11 -11
- package/.nuxt/imports.d.ts +56 -56
- package/.nuxt/manifest/latest.json +1 -1
- package/.nuxt/manifest/meta/dev.json +1 -1
- package/.nuxt/mdc-image-component.mjs +1 -1
- package/.nuxt/module/nuxt-robots.d.ts +12 -12
- package/.nuxt/module/nuxt-seo-utils.d.ts +10 -10
- package/.nuxt/module/nuxt-site-config.d.ts +11 -8
- package/.nuxt/module/nuxt-sitemap.d.ts +17 -17
- package/.nuxt/nitro.json +5 -5
- package/.nuxt/nuxt.d.ts +11 -8
- package/.nuxt/nuxt.json +2 -2
- package/.nuxt/nuxt.node.d.ts +9 -7
- package/.nuxt/tsconfig.app.json +186 -162
- package/.nuxt/tsconfig.json +188 -161
- package/.nuxt/tsconfig.node.json +101 -84
- package/.nuxt/tsconfig.server.json +124 -120
- package/.nuxt/tsconfig.shared.json +60 -55
- package/.nuxt/types/build.d.ts +1 -1
- package/.nuxt/types/components.d.ts +288 -300
- package/.nuxt/types/i18n-plugin.d.ts +2 -2
- package/.nuxt/types/imports.d.ts +677 -673
- package/.nuxt/types/modules.d.ts +34 -14
- package/.nuxt/types/nitro-imports.d.ts +249 -249
- package/.nuxt/types/nitro-nuxt.d.ts +3 -1
- package/.nuxt/types/nitro-routes.d.ts +15 -15
- package/.nuxt/types/plugins.d.ts +36 -36
- package/.nuxt/ui-image-component.ts +1 -1
- package/.output/nitro.json +2 -2
- package/.output/public/_fonts/31PZhXd_YTCmsoiPQZc-xVtAWAkLogRFRj5mWplmKFE-6WsTw05QKugcwLySGc_b9CIheG8j8LRyo47qPL430Mk.woff2 +0 -0
- package/.output/public/_fonts/9FWLUGCSCYLRIRMtCzLrt4Go7DMFXOeN_pyCOJD_44Y-Yh2wNaqrq_e759vVlc3tX81lMwRu9ktkQJX_Svgs-VI.woff2 +0 -0
- package/.output/public/_fonts/BQnDL9FFy0Q_jvURlmv87luvmXLSMbSuXsfZv_R2Rkk-y5MVrLtP4J_1al8rz8R-MDaUOMAHckAWCwDrKhw25fY.woff2 +0 -0
- package/.output/public/_fonts/JSrPAbQHsQEdUrIE5Ts6fIQ2ymsa4i7HhiCpui6ulCc-_AoyGWssOn06OMh3ZY_GddBBPRny4Igxin4fT_1K6F4.woff2 +0 -0
- package/.output/public/_fonts/Jtqhy44WKYEjGWTSusP5YJfJv7Wf74QqgkBOI9u_77s-Rl_Bht5SvmaotE20bkavBEAJEEGEa0hcz3d_8yOeXmw.woff +0 -0
- package/.output/public/_fonts/M-60tFLmAJxdPjHsK-2ILWom5zPbu37lb3Qex2waL14-A9y4QcXALPi_RvQsmRsSFUxrT3_J213W4zPFIXetlbw.woff2 +0 -0
- package/.output/public/_fonts/T-ozk-QJ_Ck37B2RHPl2i-s_gAGGo7suFgagWoJ8bO4-maDXQ_nEXKAaLHm4Joud3DJR9EVzS7QXWMWK8YOTIcs.woff2 +0 -0
- package/.output/public/_fonts/TTYbISAfwy-y4uVGS9AH32sK7b2xJsoCESo64ryf8LU-y87nRMqBGo42rUOW9tWZa06o4oTa0USJrAMMoKDamgs.woff2 +0 -0
- package/.output/public/_fonts/Y_5DOsLit49q2i2tbcNxnyUen9__GPCX8mwAi03q1aA-pBCjVKDT5tBT3BJckh9uzNkfUWeUIBPz9Y8T55vcj8E.woff2 +0 -0
- package/.output/public/_fonts/ZHaz3DhCHNWhsElqYfuM71rfBBDgjuU2sd34vaYJwQg-71NZaZSGjxzAGjCMnCc2zS5rS_EGA0xHKPGCggWuXik.woff +0 -0
- package/.output/public/_fonts/h9PwCjip_BNPVO50hT4v29USWFv6H3ZlYx_IestfqgY-sYfLVuZXl9E1aYbn1S0pAr4zfdQ_WT7iBZhrgQY6N-4.woff2 +0 -0
- package/.output/public/_fonts/l00UCz_-QvI_NO8AGcu7ooAcrFDlxYUdxCSCh6gBwd4-vPjTZ3ztgw27A2TnHeCycxPvUtXWEVpG33_97ra6su8.woff2 +0 -0
- package/.output/public/_fonts/nuenOq7ZFSZ65QudJO7uQ0sOjDqow2WjfXrQh4S9gEc-uF81rxcswER5srfhzyLfPoGlKNAIt2C_BvkXFOc19rw.woff2 +0 -0
- package/.output/public/_fonts/pWMvGwciZ-EfQsfR2ueelhC7Jnt5K-8Px8PjPK0mDII-eT9iD0iZ9WWhTJs6V5GxXr0iaUwx_WxgGGriOiGb81o.woff2 +0 -0
- package/.output/public/_fonts/y3mP_zJcojQwJn30TpF_XxDzgeM6Nbk7MaRg1Ne0YcI-lFx13nqMCMgk_S70gRmwEHXlE5BLp1B4W82RpFihpMs.woff2 +0 -0
- package/.output/public/_fonts/zr3WxpLd5PmlBr7e4PWGkhZv6XTg70Pi4sCbC-CEV0Q-v2yL98XOiD3FkbiYlYYeAeTSVSkgAckeOp55Q5kHJmU.woff2 +0 -0
- package/.output/public/_ignis-config.json +1789 -1
- package/.output/public/_nuxt/Bhpb4lc3.js +1 -0
- package/.output/public/_nuxt/{DXbccJ2T.js → BqsN2CZp.js} +1 -1
- package/.output/public/_nuxt/C9ePPGPX.js +94 -0
- package/.output/public/_nuxt/CQozUI2A.js +1 -0
- package/.output/public/_nuxt/DBJqMhGy.js +35 -0
- package/.output/public/_nuxt/{BiUZ9mZX.js → DvwlldUy.js} +1 -1
- package/.output/public/_nuxt/RbPLLy5S.js +1 -0
- package/.output/public/_nuxt/{DXBpKbsa.js → aetvq4w9.js} +40 -32
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/cbc9377a-971e-4db1-b4b1-01807b82ee58.json +1 -0
- package/.output/public/_nuxt/entry.whtwWr_z.css +1 -0
- package/.output/public/_nuxt/error-404.Cq535Uij.css +1 -0
- package/.output/public/_nuxt/error-500.BHm_N15n.css +1 -0
- package/.output/public/_nuxt/{dJ-vStNn.js → jpnxxCHq.js} +1 -1
- package/.output/public/nuxt-spec.png +0 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -1
- package/.output/server/chunks/_/nitro.mjs +273 -154
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/build/client.manifest.mjs +64 -64
- package/.output/server/chunks/routes/renderer.mjs +3 -3
- package/.output/server/chunks/routes/renderer.mjs.map +1 -1
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +131 -96
- package/.output/server/node_modules/@vue/compiler-core/package.json +4 -4
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +4 -1
- package/.output/server/node_modules/@vue/compiler-dom/package.json +3 -3
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +10 -1
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +4 -3
- package/.output/server/node_modules/@vue/reactivity/package.json +2 -2
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +25 -27
- package/.output/server/node_modules/@vue/runtime-core/package.json +3 -3
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +40 -14
- package/.output/server/node_modules/@vue/runtime-dom/package.json +4 -4
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +1 -1
- package/.output/server/node_modules/@vue/server-renderer/package.json +4 -4
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +1 -1
- package/.output/server/node_modules/@vue/shared/package.json +1 -1
- package/.output/server/node_modules/debug/package.json +1 -1
- package/.output/server/node_modules/vue/dist/vue.cjs.js +1 -1
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +1 -1
- package/.output/server/node_modules/vue/package.json +6 -6
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +158 -53
- package/.output/server/node_modules/vue-bundle-renderer/package.json +16 -11
- package/.output/server/node_modules/vue-router/dist/devtools-BLCumUwL.mjs +1218 -0
- package/.output/server/node_modules/vue-router/dist/vue-router.mjs +1459 -3688
- package/.output/server/node_modules/vue-router/package.json +43 -38
- package/.output/server/node_modules/vue-router/vue-router.node.mjs +2 -0
- package/.output/server/package.json +13 -13
- package/README.md +4 -0
- package/app/app.vue +2 -2
- package/app/assets/css/ignis-open-props.css +4 -5
- package/app/components/CurrentTime.vue +8 -1
- package/app/components/ignis/{IgnisInfo.vue → IgnisContent.vue} +3 -3
- package/app/components/ignis/{IgnisConfig.vue → IgnisContentConfig.vue} +5 -1
- package/app/components/ignis/IgnisContentFeatures.vue +102 -0
- package/app/components/ignis/{IgnisWelcome.vue → IgnisContentWelcome.vue} +2 -2
- package/app/components/ignis/IgnisFooter.vue +11 -3
- package/app/pages/_ignis-config.vue +1 -1
- package/app/pages/_ignis-info.vue +1 -1
- package/app/pages/_ignis-welcome.vue +1 -1
- package/app/pages/index.vue +2 -2
- package/bin/cli.js +59 -0
- package/bin/set-app-vue.js +18 -0
- package/bin/set-css.js +3 -8
- package/bin/set-eslint.js +3 -8
- package/bin/setup.js +208 -45
- package/features.ts +17 -8
- package/nuxt.config.ts +9 -4
- package/package.json +15 -17
- package/public/_ignis-config.json +1789 -1
- package/test/config/css-multiple.txt +30 -24
- package/test/config/css-nuxt-ui.txt +34 -28
- package/test/config/css-open-props.txt +1812 -1805
- package/test/config/css-single.txt +28 -22
- package/test/config/css-tailwind.txt +55 -48
- package/test/config/custom-lang.txt +27 -21
- package/test/config/db-neon.txt +28 -22
- package/test/config/db-supabase.txt +31 -25
- package/test/config/default.txt +27 -21
- package/test/config/equipment-1-composable.txt +33 -27
- package/test/config/equipment-2-plugins.txt +34 -28
- package/test/config/equipment-all.txt +38 -32
- package/test/config/forms-formkit.txt +32 -26
- package/test/config/forms-vueform.txt +28 -22
- package/test/config/i18n.txt +36 -30
- package/test/config/no-default-css.txt +24 -18
- package/test/config/open-props.txt +1811 -1804
- package/test/config/seo-ssr-false.txt +35 -29
- package/test/config/ui-nuxt-ui.txt +33 -27
- package/test/config/ui-tailwind.txt +54 -47
- package/test/features.test.ts +33 -33
- package/.nuxt/i18n.options.mjs +0 -165
- package/.nuxt/nuxt-i18n-logger.mjs +0 -1
- package/.output/public/_nuxt/BA2WKEAc.js +0 -1
- package/.output/public/_nuxt/BE_a_Zhd.js +0 -1
- package/.output/public/_nuxt/Bnm5Nral.js +0 -1
- package/.output/public/_nuxt/BrY1radz.js +0 -35
- package/.output/public/_nuxt/CmzFGS1a.js +0 -90
- package/.output/public/_nuxt/builds/meta/9a624d26-216d-4e69-b3a7-54b68357876f.json +0 -1
- package/.output/public/_nuxt/entry.jMyW6Sg0.css +0 -1
- package/.output/public/_nuxt/error-404.BGUbR0Uk.css +0 -1
- package/.output/public/_nuxt/error-500.CQfkKpQ2.css +0 -1
- package/.output/server/node_modules/vue-router/dist/vue-router.node.mjs +0 -2
- package/app/components/ignis/IgnisFeatureList.vue +0 -111
- /package/app/components/ignis/{IgnisFeature.vue → IgnisContentFeaturesDetail.vue} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.
|
|
2
|
+
* @vue/runtime-dom v3.5.22
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -216,11 +216,11 @@ function resolveTransitionProps(rawProps) {
|
|
|
216
216
|
const resolve = () => finishLeave(el, done);
|
|
217
217
|
addTransitionClass(el, leaveFromClass);
|
|
218
218
|
if (!el._enterCancelled) {
|
|
219
|
-
forceReflow();
|
|
219
|
+
forceReflow(el);
|
|
220
220
|
addTransitionClass(el, leaveActiveClass);
|
|
221
221
|
} else {
|
|
222
222
|
addTransitionClass(el, leaveActiveClass);
|
|
223
|
-
forceReflow();
|
|
223
|
+
forceReflow(el);
|
|
224
224
|
}
|
|
225
225
|
nextFrame(() => {
|
|
226
226
|
if (!el._isLeaving) {
|
|
@@ -363,8 +363,9 @@ function toMs(s) {
|
|
|
363
363
|
if (s === "auto") return 0;
|
|
364
364
|
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
365
365
|
}
|
|
366
|
-
function forceReflow() {
|
|
367
|
-
|
|
366
|
+
function forceReflow(el) {
|
|
367
|
+
const targetDocument = el ? el.ownerDocument : document;
|
|
368
|
+
return targetDocument.body.offsetHeight;
|
|
368
369
|
}
|
|
369
370
|
|
|
370
371
|
function patchClass(el, value, isSVG) {
|
|
@@ -780,7 +781,11 @@ class VueElement extends BaseClass {
|
|
|
780
781
|
this._root = this.shadowRoot;
|
|
781
782
|
} else {
|
|
782
783
|
if (_def.shadowRoot !== false) {
|
|
783
|
-
this.attachShadow(
|
|
784
|
+
this.attachShadow(
|
|
785
|
+
shared.extend({}, _def.shadowRootOptions, {
|
|
786
|
+
mode: "open"
|
|
787
|
+
})
|
|
788
|
+
);
|
|
784
789
|
this._root = this.shadowRoot;
|
|
785
790
|
} else {
|
|
786
791
|
this._root = this;
|
|
@@ -840,9 +845,18 @@ class VueElement extends BaseClass {
|
|
|
840
845
|
this._app && this._app.unmount();
|
|
841
846
|
if (this._instance) this._instance.ce = void 0;
|
|
842
847
|
this._app = this._instance = null;
|
|
848
|
+
if (this._teleportTargets) {
|
|
849
|
+
this._teleportTargets.clear();
|
|
850
|
+
this._teleportTargets = void 0;
|
|
851
|
+
}
|
|
843
852
|
}
|
|
844
853
|
});
|
|
845
854
|
}
|
|
855
|
+
_processMutations(mutations) {
|
|
856
|
+
for (const m of mutations) {
|
|
857
|
+
this._setAttr(m.attributeName);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
846
860
|
/**
|
|
847
861
|
* resolve inner component definition (handle possible async component)
|
|
848
862
|
*/
|
|
@@ -853,11 +867,7 @@ class VueElement extends BaseClass {
|
|
|
853
867
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
854
868
|
this._setAttr(this.attributes[i].name);
|
|
855
869
|
}
|
|
856
|
-
this._ob = new MutationObserver((
|
|
857
|
-
for (const m of mutations) {
|
|
858
|
-
this._setAttr(m.attributeName);
|
|
859
|
-
}
|
|
860
|
-
});
|
|
870
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
861
871
|
this._ob.observe(this, { attributes: true });
|
|
862
872
|
const resolve = (def, isAsync = false) => {
|
|
863
873
|
this._resolved = true;
|
|
@@ -964,7 +974,10 @@ class VueElement extends BaseClass {
|
|
|
964
974
|
}
|
|
965
975
|
if (shouldReflect) {
|
|
966
976
|
const ob = this._ob;
|
|
967
|
-
|
|
977
|
+
if (ob) {
|
|
978
|
+
this._processMutations(ob.takeRecords());
|
|
979
|
+
ob.disconnect();
|
|
980
|
+
}
|
|
968
981
|
if (val === true) {
|
|
969
982
|
this.setAttribute(shared.hyphenate(key), "");
|
|
970
983
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -1043,7 +1056,7 @@ class VueElement extends BaseClass {
|
|
|
1043
1056
|
* Only called when shadowRoot is false
|
|
1044
1057
|
*/
|
|
1045
1058
|
_renderSlots() {
|
|
1046
|
-
const outlets =
|
|
1059
|
+
const outlets = this._getSlots();
|
|
1047
1060
|
const scopeId = this._instance.type.__scopeId;
|
|
1048
1061
|
for (let i = 0; i < outlets.length; i++) {
|
|
1049
1062
|
const o = outlets[i];
|
|
@@ -1069,6 +1082,19 @@ class VueElement extends BaseClass {
|
|
|
1069
1082
|
parent.removeChild(o);
|
|
1070
1083
|
}
|
|
1071
1084
|
}
|
|
1085
|
+
/**
|
|
1086
|
+
* @internal
|
|
1087
|
+
*/
|
|
1088
|
+
_getSlots() {
|
|
1089
|
+
const roots = [this];
|
|
1090
|
+
if (this._teleportTargets) {
|
|
1091
|
+
roots.push(...this._teleportTargets);
|
|
1092
|
+
}
|
|
1093
|
+
return roots.reduce((res, i) => {
|
|
1094
|
+
res.push(...Array.from(i.querySelectorAll("slot")));
|
|
1095
|
+
return res;
|
|
1096
|
+
}, []);
|
|
1097
|
+
}
|
|
1072
1098
|
/**
|
|
1073
1099
|
* @internal
|
|
1074
1100
|
*/
|
|
@@ -1147,7 +1173,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1147
1173
|
prevChildren.forEach(callPendingCbs);
|
|
1148
1174
|
prevChildren.forEach(recordPosition);
|
|
1149
1175
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
1150
|
-
forceReflow();
|
|
1176
|
+
forceReflow(instance.vnode.el);
|
|
1151
1177
|
movedChildren.forEach((c) => {
|
|
1152
1178
|
const el = c.el;
|
|
1153
1179
|
const style = el.style;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-dom",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.22",
|
|
4
4
|
"description": "@vue/runtime-dom",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-dom.esm-bundler.js",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-dom#readme",
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"csstype": "^3.1.3",
|
|
53
|
-
"@vue/
|
|
54
|
-
"@vue/
|
|
55
|
-
"@vue/runtime-core": "3.5.
|
|
53
|
+
"@vue/reactivity": "3.5.22",
|
|
54
|
+
"@vue/shared": "3.5.22",
|
|
55
|
+
"@vue/runtime-core": "3.5.22"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/trusted-types": "^2.0.7"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/server-renderer",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.22",
|
|
4
4
|
"description": "@vue/server-renderer",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/server-renderer.esm-bundler.js",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/server-renderer#readme",
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"vue": "3.5.
|
|
49
|
+
"vue": "3.5.22"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@vue/shared": "3.5.
|
|
53
|
-
"@vue/compiler-ssr": "3.5.
|
|
52
|
+
"@vue/shared": "3.5.22",
|
|
53
|
+
"@vue/compiler-ssr": "3.5.22"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.22",
|
|
4
4
|
"description": "The progressive JavaScript framework for building modern web UI.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/vue.runtime.esm-bundler.js",
|
|
@@ -95,11 +95,11 @@
|
|
|
95
95
|
},
|
|
96
96
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/vue#readme",
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@vue/shared": "3.5.
|
|
99
|
-
"@vue/compiler-dom": "3.5.
|
|
100
|
-
"@vue/runtime-dom": "3.5.
|
|
101
|
-
"@vue/compiler-sfc": "3.5.
|
|
102
|
-
"@vue/server-renderer": "3.5.
|
|
98
|
+
"@vue/shared": "3.5.22",
|
|
99
|
+
"@vue/compiler-dom": "3.5.22",
|
|
100
|
+
"@vue/runtime-dom": "3.5.22",
|
|
101
|
+
"@vue/compiler-sfc": "3.5.22",
|
|
102
|
+
"@vue/server-renderer": "3.5.22"
|
|
103
103
|
},
|
|
104
104
|
"peerDependencies": {
|
|
105
105
|
"typescript": "*"
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { withLeadingSlash } from 'ufo';
|
|
2
2
|
|
|
3
|
-
function createRendererContext({ manifest, buildAssetsURL }) {
|
|
3
|
+
function createRendererContext({ manifest, precomputed, buildAssetsURL }) {
|
|
4
|
+
if (!manifest && !precomputed) {
|
|
5
|
+
throw new Error("Either manifest or precomputed data must be provided");
|
|
6
|
+
}
|
|
4
7
|
const ctx = {
|
|
5
|
-
//
|
|
8
|
+
// Options
|
|
6
9
|
buildAssetsURL: buildAssetsURL || withLeadingSlash,
|
|
7
|
-
manifest
|
|
10
|
+
manifest,
|
|
11
|
+
precomputed,
|
|
8
12
|
updateManifest,
|
|
9
13
|
// Internal cache
|
|
10
|
-
_dependencies:
|
|
11
|
-
_dependencySets:
|
|
12
|
-
_entrypoints:
|
|
14
|
+
_dependencies: {},
|
|
15
|
+
_dependencySets: {},
|
|
16
|
+
_entrypoints: []
|
|
13
17
|
};
|
|
14
18
|
function updateManifest(manifest2) {
|
|
15
19
|
const manifestEntries = Object.entries(manifest2);
|
|
@@ -18,7 +22,12 @@ function createRendererContext({ manifest, buildAssetsURL }) {
|
|
|
18
22
|
ctx._dependencySets = {};
|
|
19
23
|
ctx._entrypoints = manifestEntries.filter((e) => e[1].isEntry).map(([module]) => module);
|
|
20
24
|
}
|
|
21
|
-
|
|
25
|
+
if (precomputed) {
|
|
26
|
+
ctx._dependencies = precomputed.dependencies;
|
|
27
|
+
ctx._entrypoints = precomputed.entrypoints;
|
|
28
|
+
} else if (manifest) {
|
|
29
|
+
updateManifest(manifest);
|
|
30
|
+
}
|
|
22
31
|
return ctx;
|
|
23
32
|
}
|
|
24
33
|
function getModuleDependencies(id, rendererContext) {
|
|
@@ -31,6 +40,9 @@ function getModuleDependencies(id, rendererContext) {
|
|
|
31
40
|
preload: {},
|
|
32
41
|
prefetch: {}
|
|
33
42
|
};
|
|
43
|
+
if (!rendererContext.manifest) {
|
|
44
|
+
return dependencies;
|
|
45
|
+
}
|
|
34
46
|
const meta = rendererContext.manifest[id];
|
|
35
47
|
if (!meta) {
|
|
36
48
|
return dependencies;
|
|
@@ -49,9 +61,15 @@ function getModuleDependencies(id, rendererContext) {
|
|
|
49
61
|
}
|
|
50
62
|
for (const depId of meta.imports || []) {
|
|
51
63
|
const depDeps = getModuleDependencies(depId, rendererContext);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
for (const key in depDeps.styles) {
|
|
65
|
+
dependencies.styles[key] = depDeps.styles[key];
|
|
66
|
+
}
|
|
67
|
+
for (const key in depDeps.preload) {
|
|
68
|
+
dependencies.preload[key] = depDeps.preload[key];
|
|
69
|
+
}
|
|
70
|
+
for (const key in depDeps.prefetch) {
|
|
71
|
+
dependencies.prefetch[key] = depDeps.prefetch[key];
|
|
72
|
+
}
|
|
55
73
|
}
|
|
56
74
|
const filteredPreload = {};
|
|
57
75
|
for (const id2 in dependencies.preload) {
|
|
@@ -64,7 +82,12 @@ function getModuleDependencies(id, rendererContext) {
|
|
|
64
82
|
return dependencies;
|
|
65
83
|
}
|
|
66
84
|
function getAllDependencies(ids, rendererContext) {
|
|
67
|
-
|
|
85
|
+
let cacheKey = "";
|
|
86
|
+
const sortedIds = [...ids].sort();
|
|
87
|
+
for (let i = 0; i < sortedIds.length; i++) {
|
|
88
|
+
if (i > 0) cacheKey += ",";
|
|
89
|
+
cacheKey += sortedIds[i];
|
|
90
|
+
}
|
|
68
91
|
if (rendererContext._dependencySets[cacheKey]) {
|
|
69
92
|
return rendererContext._dependencySets[cacheKey];
|
|
70
93
|
}
|
|
@@ -76,15 +99,29 @@ function getAllDependencies(ids, rendererContext) {
|
|
|
76
99
|
};
|
|
77
100
|
for (const id of ids) {
|
|
78
101
|
const deps = getModuleDependencies(id, rendererContext);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
102
|
+
for (const key in deps.scripts) {
|
|
103
|
+
allDeps.scripts[key] = deps.scripts[key];
|
|
104
|
+
}
|
|
105
|
+
for (const key in deps.styles) {
|
|
106
|
+
allDeps.styles[key] = deps.styles[key];
|
|
107
|
+
}
|
|
108
|
+
for (const key in deps.preload) {
|
|
109
|
+
allDeps.preload[key] = deps.preload[key];
|
|
110
|
+
}
|
|
111
|
+
for (const key in deps.prefetch) {
|
|
112
|
+
allDeps.prefetch[key] = deps.prefetch[key];
|
|
113
|
+
}
|
|
114
|
+
for (const dynamicDepId of rendererContext.manifest?.[id]?.dynamicImports || []) {
|
|
84
115
|
const dynamicDeps = getModuleDependencies(dynamicDepId, rendererContext);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
116
|
+
for (const key in dynamicDeps.scripts) {
|
|
117
|
+
allDeps.prefetch[key] = dynamicDeps.scripts[key];
|
|
118
|
+
}
|
|
119
|
+
for (const key in dynamicDeps.styles) {
|
|
120
|
+
allDeps.prefetch[key] = dynamicDeps.styles[key];
|
|
121
|
+
}
|
|
122
|
+
for (const key in dynamicDeps.preload) {
|
|
123
|
+
allDeps.prefetch[key] = dynamicDeps.preload[key];
|
|
124
|
+
}
|
|
88
125
|
}
|
|
89
126
|
}
|
|
90
127
|
const filteredPrefetch = {};
|
|
@@ -119,49 +156,126 @@ function getRequestDependencies(ssrContext, rendererContext) {
|
|
|
119
156
|
}
|
|
120
157
|
function renderStyles(ssrContext, rendererContext) {
|
|
121
158
|
const { styles } = getRequestDependencies(ssrContext, rendererContext);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
159
|
+
let result = "";
|
|
160
|
+
for (const key in styles) {
|
|
161
|
+
const resource = styles[key];
|
|
162
|
+
result += `<link rel="stylesheet" href="${rendererContext.buildAssetsURL(resource.file)}" crossorigin>`;
|
|
163
|
+
}
|
|
164
|
+
return result;
|
|
125
165
|
}
|
|
126
166
|
function getResources(ssrContext, rendererContext) {
|
|
127
167
|
return [...getPreloadLinks(ssrContext, rendererContext), ...getPrefetchLinks(ssrContext, rendererContext)];
|
|
128
168
|
}
|
|
129
169
|
function renderResourceHints(ssrContext, rendererContext) {
|
|
130
|
-
|
|
170
|
+
const { preload, prefetch } = getRequestDependencies(ssrContext, rendererContext);
|
|
171
|
+
let result = "";
|
|
172
|
+
for (const key in preload) {
|
|
173
|
+
const resource = preload[key];
|
|
174
|
+
const href = rendererContext.buildAssetsURL(resource.file);
|
|
175
|
+
const rel = resource.module ? "modulepreload" : "preload";
|
|
176
|
+
const crossorigin = resource.resourceType === "style" || resource.resourceType === "font" || resource.resourceType === "script" || resource.module ? " crossorigin" : "";
|
|
177
|
+
if (resource.resourceType && resource.mimeType) {
|
|
178
|
+
result += `<link rel="${rel}" as="${resource.resourceType}" type="${resource.mimeType}"${crossorigin} href="${href}">`;
|
|
179
|
+
} else if (resource.resourceType) {
|
|
180
|
+
result += `<link rel="${rel}" as="${resource.resourceType}"${crossorigin} href="${href}">`;
|
|
181
|
+
} else {
|
|
182
|
+
result += `<link rel="${rel}"${crossorigin} href="${href}">`;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
for (const key in prefetch) {
|
|
186
|
+
const resource = prefetch[key];
|
|
187
|
+
const href = rendererContext.buildAssetsURL(resource.file);
|
|
188
|
+
const crossorigin = resource.resourceType === "style" || resource.resourceType === "font" || resource.resourceType === "script" || resource.module ? " crossorigin" : "";
|
|
189
|
+
if (resource.resourceType && resource.mimeType) {
|
|
190
|
+
result += `<link rel="prefetch" as="${resource.resourceType}" type="${resource.mimeType}"${crossorigin} href="${href}">`;
|
|
191
|
+
} else if (resource.resourceType) {
|
|
192
|
+
result += `<link rel="prefetch" as="${resource.resourceType}"${crossorigin} href="${href}">`;
|
|
193
|
+
} else {
|
|
194
|
+
result += `<link rel="prefetch"${crossorigin} href="${href}">`;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return result;
|
|
131
198
|
}
|
|
132
199
|
function renderResourceHeaders(ssrContext, rendererContext) {
|
|
200
|
+
const { preload, prefetch } = getRequestDependencies(ssrContext, rendererContext);
|
|
201
|
+
const links = [];
|
|
202
|
+
for (const key in preload) {
|
|
203
|
+
const resource = preload[key];
|
|
204
|
+
const href = rendererContext.buildAssetsURL(resource.file);
|
|
205
|
+
const rel = resource.module ? "modulepreload" : "preload";
|
|
206
|
+
let header = `<${href}>; rel="${rel}"`;
|
|
207
|
+
if (resource.resourceType) {
|
|
208
|
+
header += `; as="${resource.resourceType}"`;
|
|
209
|
+
}
|
|
210
|
+
if (resource.mimeType) {
|
|
211
|
+
header += `; type="${resource.mimeType}"`;
|
|
212
|
+
}
|
|
213
|
+
if (resource.resourceType === "style" || resource.resourceType === "font" || resource.resourceType === "script" || resource.module) {
|
|
214
|
+
header += "; crossorigin";
|
|
215
|
+
}
|
|
216
|
+
links.push(header);
|
|
217
|
+
}
|
|
218
|
+
for (const key in prefetch) {
|
|
219
|
+
const resource = prefetch[key];
|
|
220
|
+
const href = rendererContext.buildAssetsURL(resource.file);
|
|
221
|
+
let header = `<${href}>; rel="prefetch"`;
|
|
222
|
+
if (resource.resourceType) {
|
|
223
|
+
header += `; as="${resource.resourceType}"`;
|
|
224
|
+
}
|
|
225
|
+
if (resource.mimeType) {
|
|
226
|
+
header += `; type="${resource.mimeType}"`;
|
|
227
|
+
}
|
|
228
|
+
if (resource.resourceType === "style" || resource.resourceType === "font" || resource.resourceType === "script" || resource.module) {
|
|
229
|
+
header += "; crossorigin";
|
|
230
|
+
}
|
|
231
|
+
links.push(header);
|
|
232
|
+
}
|
|
133
233
|
return {
|
|
134
|
-
link:
|
|
234
|
+
link: links.join(", ")
|
|
135
235
|
};
|
|
136
236
|
}
|
|
137
237
|
function getPreloadLinks(ssrContext, rendererContext) {
|
|
138
238
|
const { preload } = getRequestDependencies(ssrContext, rendererContext);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
239
|
+
const result = [];
|
|
240
|
+
for (const key in preload) {
|
|
241
|
+
const resource = preload[key];
|
|
242
|
+
result.push({
|
|
243
|
+
rel: resource.module ? "modulepreload" : "preload",
|
|
244
|
+
as: resource.resourceType,
|
|
245
|
+
type: resource.mimeType ?? null,
|
|
246
|
+
crossorigin: resource.resourceType === "style" || resource.resourceType === "font" || resource.resourceType === "script" || resource.module ? "" : null,
|
|
247
|
+
href: rendererContext.buildAssetsURL(resource.file)
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return result;
|
|
146
251
|
}
|
|
147
252
|
function getPrefetchLinks(ssrContext, rendererContext) {
|
|
148
253
|
const { prefetch } = getRequestDependencies(ssrContext, rendererContext);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
254
|
+
const result = [];
|
|
255
|
+
for (const key in prefetch) {
|
|
256
|
+
const resource = prefetch[key];
|
|
257
|
+
result.push({
|
|
258
|
+
rel: "prefetch",
|
|
259
|
+
as: resource.resourceType,
|
|
260
|
+
type: resource.mimeType ?? null,
|
|
261
|
+
crossorigin: resource.resourceType === "style" || resource.resourceType === "font" || resource.resourceType === "script" || resource.module ? "" : null,
|
|
262
|
+
href: rendererContext.buildAssetsURL(resource.file)
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
return result;
|
|
156
266
|
}
|
|
157
267
|
function renderScripts(ssrContext, rendererContext) {
|
|
158
268
|
const { scripts } = getRequestDependencies(ssrContext, rendererContext);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
269
|
+
let result = "";
|
|
270
|
+
for (const key in scripts) {
|
|
271
|
+
const resource = scripts[key];
|
|
272
|
+
if (resource.module) {
|
|
273
|
+
result += `<script type="module" src="${rendererContext.buildAssetsURL(resource.file)}" crossorigin><\/script>`;
|
|
274
|
+
} else {
|
|
275
|
+
result += `<script src="${rendererContext.buildAssetsURL(resource.file)}" defer crossorigin><\/script>`;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return result;
|
|
165
279
|
}
|
|
166
280
|
function createRenderer(createApp, renderOptions) {
|
|
167
281
|
const rendererContext = createRendererContext(renderOptions);
|
|
@@ -183,14 +297,5 @@ function createRenderer(createApp, renderOptions) {
|
|
|
183
297
|
}
|
|
184
298
|
};
|
|
185
299
|
}
|
|
186
|
-
function renderScriptToString(attrs) {
|
|
187
|
-
return `<script${Object.entries(attrs).map(([key, value]) => value === null ? "" : value ? ` ${key}="${value}"` : " " + key).join("")}><\/script>`;
|
|
188
|
-
}
|
|
189
|
-
function renderLinkToString(attrs) {
|
|
190
|
-
return `<link${Object.entries(attrs).map(([key, value]) => value === null ? "" : value ? ` ${key}="${value}"` : " " + key).join("")}>`;
|
|
191
|
-
}
|
|
192
|
-
function renderLinkToHeader(attrs) {
|
|
193
|
-
return `<${attrs.href}>${Object.entries(attrs).map(([key, value]) => key === "href" || value === null ? "" : value ? `; ${key}="${value}"` : `; ${key}`).join("")}`;
|
|
194
|
-
}
|
|
195
300
|
|
|
196
301
|
export { createRenderer, createRendererContext, getAllDependencies, getModuleDependencies, getPrefetchLinks, getPreloadLinks, getRequestDependencies, getResources, renderResourceHeaders, renderResourceHints, renderScripts, renderStyles };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-bundle-renderer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Bundle Renderer for Vue 3.0",
|
|
5
5
|
"repository": "nuxt-contrib/vue-bundle-renderer",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,23 +28,28 @@
|
|
|
28
28
|
"dev": "vitest",
|
|
29
29
|
"lint": "eslint src",
|
|
30
30
|
"prepack": "unbuild",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
31
|
+
"test": "pnpm lint && pnpm vitest run --coverage && tsc --noEmit",
|
|
32
|
+
"bench": "vitest bench"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"ufo": "^1.6.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@
|
|
38
|
+
"@codspeed/vitest-plugin": "^5.0.0",
|
|
39
|
+
"@nuxt/eslint-config": "^1.9.0",
|
|
40
|
+
"@types/node": "^22.18.6",
|
|
41
|
+
"@types/semver": "^7.7.1",
|
|
39
42
|
"@vitest/coverage-v8": "^3.2.4",
|
|
40
43
|
"changelogen": "^0.6.2",
|
|
41
|
-
"eslint": "^9.
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
44
|
+
"eslint": "^9.36.0",
|
|
45
|
+
"pkg-pr-new": "^0.0.60",
|
|
46
|
+
"semver": "^7.7.2",
|
|
47
|
+
"std-env": "^3.9.0",
|
|
48
|
+
"typescript": "^5.9.2",
|
|
49
|
+
"unbuild": "^3.6.1",
|
|
50
|
+
"vite": "^7.1.7",
|
|
45
51
|
"vitest": "3.2.4",
|
|
46
|
-
"vue": "3.5.
|
|
47
|
-
"@nuxt/eslint-config": "^1.7.1"
|
|
52
|
+
"vue": "3.5.22"
|
|
48
53
|
},
|
|
49
|
-
"packageManager": "pnpm@10.
|
|
54
|
+
"packageManager": "pnpm@10.17.1"
|
|
50
55
|
}
|