nuxt-nightly 4.1.2-29293260.327ba8f5 → 4.1.2-29293741.3f7624b3
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/dist/app/composables/preload.js +5 -2
- package/dist/app/composables/router.js +7 -2
- package/dist/app/nuxt.js +4 -1
- package/dist/core/runtime/nitro/handlers/renderer.js +8 -1
- package/dist/core/runtime/nitro/utils/renderer/build-files.js +9 -6
- package/dist/head/runtime/components.js +10 -3
- package/dist/index.mjs +102 -40
- package/dist/pages/runtime/page.js +10 -4
- package/package.json +4 -4
|
@@ -42,8 +42,11 @@ export async function preloadRouteComponents(to, router = useRouter()) {
|
|
|
42
42
|
return Promise.all(promises).then(() => preloadRouteComponents(to, router));
|
|
43
43
|
}
|
|
44
44
|
router._routePreloaded.add(path);
|
|
45
|
-
const
|
|
46
|
-
|
|
45
|
+
for (const route of matched) {
|
|
46
|
+
const component = route.components?.default;
|
|
47
|
+
if (typeof component !== "function") {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
47
50
|
const promise = Promise.resolve(component()).catch(() => {
|
|
48
51
|
}).finally(() => promises.splice(promises.indexOf(promise)));
|
|
49
52
|
promises.push(promise);
|
|
@@ -66,8 +66,13 @@ export const navigateTo = (to, options) => {
|
|
|
66
66
|
const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter().resolve(to).href;
|
|
67
67
|
if (import.meta.client && options?.open) {
|
|
68
68
|
const { target = "_blank", windowFeatures = {} } = options.open;
|
|
69
|
-
const features =
|
|
70
|
-
|
|
69
|
+
const features = [];
|
|
70
|
+
for (const [feature, value] of Object.entries(windowFeatures)) {
|
|
71
|
+
if (value !== void 0) {
|
|
72
|
+
features.push(`${feature.toLowerCase()}=${value}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
open(toPath, target, features.join(", "));
|
|
71
76
|
return Promise.resolve();
|
|
72
77
|
}
|
|
73
78
|
const isExternalHost = hasProtocol(toPath, { acceptRelative: true });
|
package/dist/app/nuxt.js
CHANGED
|
@@ -260,7 +260,10 @@ function wrappedConfig(runtimeConfig) {
|
|
|
260
260
|
if (!import.meta.dev || import.meta.server) {
|
|
261
261
|
return runtimeConfig;
|
|
262
262
|
}
|
|
263
|
-
const keys =
|
|
263
|
+
const keys = [];
|
|
264
|
+
for (const key in runtimeConfig) {
|
|
265
|
+
keys.push(`\`${key}\``);
|
|
266
|
+
}
|
|
264
267
|
const lastKey = keys.pop();
|
|
265
268
|
return new Proxy(runtimeConfig, {
|
|
266
269
|
get(target, p, receiver) {
|
|
@@ -213,7 +213,14 @@ export default defineRenderHandler(async (event) => {
|
|
|
213
213
|
};
|
|
214
214
|
});
|
|
215
215
|
function normalizeChunks(chunks) {
|
|
216
|
-
|
|
216
|
+
const result = [];
|
|
217
|
+
for (const _chunk of chunks) {
|
|
218
|
+
const chunk = _chunk?.trim();
|
|
219
|
+
if (chunk) {
|
|
220
|
+
result.push(chunk);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return result;
|
|
217
224
|
}
|
|
218
225
|
function joinTags(tags) {
|
|
219
226
|
return tags.join("");
|
|
@@ -86,9 +86,12 @@ export function getRenderer(ssrContext) {
|
|
|
86
86
|
return process.env.NUXT_NO_SSR || ssrContext.noSSR ? getSPARenderer() : getSSRRenderer();
|
|
87
87
|
}
|
|
88
88
|
export const getSSRStyles = lazyCachedFunction(() => import("#build/dist/server/styles.mjs").then((r) => r.default || r));
|
|
89
|
-
export const getEntryIds = () => getClientManifest().then((r) =>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
export const getEntryIds = () => getClientManifest().then((r) => {
|
|
90
|
+
const entryIds = [];
|
|
91
|
+
for (const entry of Object.values(r)) {
|
|
92
|
+
if (entry._globalCSS) {
|
|
93
|
+
entryIds.push(entry.src);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return entryIds;
|
|
97
|
+
});
|
|
@@ -103,9 +103,16 @@ export const NoScript = defineComponent({
|
|
|
103
103
|
return () => {
|
|
104
104
|
const noscript = normalizeProps(props);
|
|
105
105
|
const slotVnodes = slots.default?.();
|
|
106
|
-
const textContent =
|
|
107
|
-
if (
|
|
108
|
-
|
|
106
|
+
const textContent = [];
|
|
107
|
+
if (slotVnodes) {
|
|
108
|
+
for (const vnode of slotVnodes) {
|
|
109
|
+
if (vnode.children) {
|
|
110
|
+
textContent.push(vnode.children);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (textContent.length > 0) {
|
|
115
|
+
noscript.innerHTML = textContent.join("");
|
|
109
116
|
}
|
|
110
117
|
input.noscript[idx] = noscript;
|
|
111
118
|
return null;
|
package/dist/index.mjs
CHANGED
|
@@ -1325,7 +1325,9 @@ const pagesModule = defineNuxtModule({
|
|
|
1325
1325
|
dts: resolve(nuxt.options.buildDir, declarationFile),
|
|
1326
1326
|
logs: nuxt.options.debug && nuxt.options.debug.router,
|
|
1327
1327
|
async beforeWriteFiles(rootPage) {
|
|
1328
|
-
|
|
1328
|
+
for (const child of rootPage.children) {
|
|
1329
|
+
child.delete();
|
|
1330
|
+
}
|
|
1329
1331
|
const pages = nuxt.apps.default?.pages || await resolvePagesRoutes$1(options.pattern, nuxt);
|
|
1330
1332
|
if (nuxt.apps.default) {
|
|
1331
1333
|
nuxt.apps.default.pages = pages;
|
|
@@ -1345,7 +1347,9 @@ const pagesModule = defineNuxtModule({
|
|
|
1345
1347
|
route.name = page.name;
|
|
1346
1348
|
}
|
|
1347
1349
|
if (page.children) {
|
|
1348
|
-
|
|
1350
|
+
for (const child of page.children) {
|
|
1351
|
+
addPage(route, child, absolutePagePath);
|
|
1352
|
+
}
|
|
1349
1353
|
}
|
|
1350
1354
|
}
|
|
1351
1355
|
for (const page of pages) {
|
|
@@ -1580,10 +1584,20 @@ const pagesModule = defineNuxtModule({
|
|
|
1580
1584
|
getContents: async ({ nuxt: nuxt2 }) => {
|
|
1581
1585
|
const routerOptionsFiles = await resolveRouterOptions(nuxt2, builtInRouterOptions);
|
|
1582
1586
|
const configRouterOptions = genObjectFromRawEntries(Object.entries(nuxt2.options.router.options).map(([key, value]) => [key, genString(value)]));
|
|
1587
|
+
const hashModes = [];
|
|
1588
|
+
for (let index = 0; index < routerOptionsFiles.length; index++) {
|
|
1589
|
+
const file = routerOptionsFiles[index];
|
|
1590
|
+
if (file.path !== builtInRouterOptions) {
|
|
1591
|
+
hashModes.unshift(`routerOptions${index}.hashMode`);
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1583
1594
|
return [
|
|
1584
1595
|
...routerOptionsFiles.map((file, index) => genImport(file.path, `routerOptions${index}`)),
|
|
1585
1596
|
`const configRouterOptions = ${configRouterOptions}`,
|
|
1586
|
-
`export const hashMode = ${[
|
|
1597
|
+
`export const hashMode = ${[
|
|
1598
|
+
...hashModes,
|
|
1599
|
+
nuxt2.options.router.options.hashMode
|
|
1600
|
+
].join(" ?? ")}`,
|
|
1587
1601
|
"export default {",
|
|
1588
1602
|
"...configRouterOptions,",
|
|
1589
1603
|
...routerOptionsFiles.map((_, index) => `...routerOptions${index},`),
|
|
@@ -2144,7 +2158,13 @@ export default defineNuxtPlugin({
|
|
|
2144
2158
|
const componentNamesTemplate = {
|
|
2145
2159
|
filename: "component-names.mjs",
|
|
2146
2160
|
getContents({ app }) {
|
|
2147
|
-
|
|
2161
|
+
const componentNames = [];
|
|
2162
|
+
for (const c of app.components) {
|
|
2163
|
+
if (!c.island) {
|
|
2164
|
+
componentNames.push(c.pascalName);
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
return `export const componentNames = ${JSON.stringify(componentNames)}`;
|
|
2148
2168
|
}
|
|
2149
2169
|
};
|
|
2150
2170
|
const componentsIslandsTemplate = {
|
|
@@ -2179,14 +2199,17 @@ const componentsIslandsTemplate = {
|
|
|
2179
2199
|
const NON_VUE_RE = /\b\.(?!vue)\w+$/g;
|
|
2180
2200
|
function resolveComponentTypes(app, baseDir) {
|
|
2181
2201
|
const serverPlaceholderPath = resolve(distDir, "app/components/server-placeholder");
|
|
2182
|
-
const componentTypes =
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
c.pascalName
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2202
|
+
const componentTypes = [];
|
|
2203
|
+
for (const c of app.components) {
|
|
2204
|
+
if (!c.island) {
|
|
2205
|
+
const type = `typeof ${genDynamicImport(isAbsolute(c.filePath) ? relative(baseDir, c.filePath).replace(NON_VUE_RE, "") : c.filePath.replace(NON_VUE_RE, ""), { wrapper: false })}['${c.export}']`;
|
|
2206
|
+
const isServerOnly = c.mode === "server" && c.filePath !== serverPlaceholderPath && !app.components.some((other) => other.pascalName === c.pascalName && other.mode === "client");
|
|
2207
|
+
componentTypes.push([
|
|
2208
|
+
c.pascalName,
|
|
2209
|
+
isServerOnly ? `IslandComponent<${type}>` : type
|
|
2210
|
+
]);
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2190
2213
|
return componentTypes;
|
|
2191
2214
|
}
|
|
2192
2215
|
const islandType = "type IslandComponent<T extends DefineComponent> = T & DefineComponent<{}, {refresh: () => Promise<void>}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, SlotsType<{ fallback: { error: unknown } }>>";
|
|
@@ -2642,7 +2665,13 @@ function getPropsToString(bindings) {
|
|
|
2642
2665
|
if (Object.keys(bindings).length === 0) {
|
|
2643
2666
|
return "undefined";
|
|
2644
2667
|
}
|
|
2645
|
-
const
|
|
2668
|
+
const contentParts = [];
|
|
2669
|
+
for (const [name, value] of Object.entries(bindings)) {
|
|
2670
|
+
if (name && (name !== "_bind" && name !== "v-for")) {
|
|
2671
|
+
contentParts.push(isBinding(name) ? `[\`${name.slice(1)}\`]: ${value}` : `[\`${name}\`]: \`${value}\``);
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
const content = contentParts.join(",");
|
|
2646
2675
|
const data = bindings._bind ? `__mergeProps(${bindings._bind}, { ${content} })` : `{ ${content} }`;
|
|
2647
2676
|
if (!vfor) {
|
|
2648
2677
|
return `[${data}]`;
|
|
@@ -3789,7 +3818,7 @@ function addDeclarationTemplates(ctx, options) {
|
|
|
3789
3818
|
});
|
|
3790
3819
|
}
|
|
3791
3820
|
|
|
3792
|
-
const version = "4.1.2-
|
|
3821
|
+
const version = "4.1.2-29293741.3f7624b3";
|
|
3793
3822
|
|
|
3794
3823
|
const createImportProtectionPatterns = (nuxt, options) => {
|
|
3795
3824
|
const patterns = [];
|
|
@@ -4031,20 +4060,26 @@ const LayerAliasingPlugin = (options) => createUnplugin((_options, meta) => {
|
|
|
4031
4060
|
};
|
|
4032
4061
|
});
|
|
4033
4062
|
|
|
4034
|
-
const addModuleTranspiles = (
|
|
4035
|
-
const
|
|
4036
|
-
const
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4063
|
+
const addModuleTranspiles = (nuxt) => {
|
|
4064
|
+
const transpile = [];
|
|
4065
|
+
for (const t of nuxt.options.build.transpile) {
|
|
4066
|
+
if (t instanceof Function) {
|
|
4067
|
+
continue;
|
|
4068
|
+
}
|
|
4069
|
+
if (typeof t === "string") {
|
|
4070
|
+
transpile.push(new RegExp(escapeRE(t)));
|
|
4071
|
+
} else {
|
|
4072
|
+
transpile.push(t);
|
|
4073
|
+
}
|
|
4044
4074
|
}
|
|
4045
|
-
for (const
|
|
4046
|
-
|
|
4047
|
-
|
|
4075
|
+
for (const m of [...nuxt.options.modules, ...nuxt.options._modules]) {
|
|
4076
|
+
const mod = typeof m === "string" ? m : Array.isArray(m) ? m[0] : m.src;
|
|
4077
|
+
if (typeof mod !== "string") {
|
|
4078
|
+
continue;
|
|
4079
|
+
}
|
|
4080
|
+
const path = normalizeModuleTranspilePath(mod);
|
|
4081
|
+
if (!transpile.some((t) => t.test(path))) {
|
|
4082
|
+
nuxt.options.build.transpile.push(path);
|
|
4048
4083
|
}
|
|
4049
4084
|
}
|
|
4050
4085
|
};
|
|
@@ -4062,10 +4097,24 @@ const NODE_MODULES_RE = /(?<=\/)node_modules\/(.+)$/;
|
|
|
4062
4097
|
const PNPM_NODE_MODULES_RE = /\.pnpm\/.+\/node_modules\/(.+)$/;
|
|
4063
4098
|
async function initNitro(nuxt) {
|
|
4064
4099
|
const layerDirs = getLayerDirectories(nuxt);
|
|
4065
|
-
const excludePaths =
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4100
|
+
const excludePaths = [];
|
|
4101
|
+
for (const dirs of layerDirs) {
|
|
4102
|
+
const paths = [
|
|
4103
|
+
dirs.root.match(NODE_MODULES_RE)?.[1]?.replace(/\/$/, ""),
|
|
4104
|
+
dirs.root.match(PNPM_NODE_MODULES_RE)?.[1]?.replace(/\/$/, "")
|
|
4105
|
+
];
|
|
4106
|
+
for (const dir of paths) {
|
|
4107
|
+
if (dir) {
|
|
4108
|
+
excludePaths.push(escapeRE(dir));
|
|
4109
|
+
}
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
const layerPublicAssetsDirs = [];
|
|
4113
|
+
for (const dirs of layerDirs) {
|
|
4114
|
+
if (existsSync(dirs.public)) {
|
|
4115
|
+
layerPublicAssetsDirs.push({ dir: dirs.public });
|
|
4116
|
+
}
|
|
4117
|
+
}
|
|
4069
4118
|
const excludePattern = excludePaths.length ? [new RegExp(`node_modules\\/(?!${excludePaths.join("|")})`)] : [/node_modules/];
|
|
4070
4119
|
const rootDirWithSlash = withTrailingSlash$1(nuxt.options.rootDir);
|
|
4071
4120
|
const moduleEntryPaths = [];
|
|
@@ -4170,7 +4219,7 @@ async function initNitro(nuxt) {
|
|
|
4170
4219
|
join(moduleDir, "dist/runtime/server")
|
|
4171
4220
|
];
|
|
4172
4221
|
}),
|
|
4173
|
-
...
|
|
4222
|
+
...layerDirs.map((dirs) => relativeWithDot(nuxt.options.buildDir, join(dirs.shared, "**/*.d.ts")))
|
|
4174
4223
|
],
|
|
4175
4224
|
exclude: [
|
|
4176
4225
|
...nuxt.options.modulesDir.map((m) => relativeWithDot(nuxt.options.buildDir, m)),
|
|
@@ -4185,7 +4234,7 @@ async function initNitro(nuxt) {
|
|
|
4185
4234
|
maxAge: 31536e3,
|
|
4186
4235
|
baseURL: nuxt.options.app.buildAssetsDir
|
|
4187
4236
|
},
|
|
4188
|
-
...
|
|
4237
|
+
...layerPublicAssetsDirs
|
|
4189
4238
|
],
|
|
4190
4239
|
prerender: {
|
|
4191
4240
|
ignoreUnprefixedPublicAssets: true,
|
|
@@ -4207,7 +4256,7 @@ async function initNitro(nuxt) {
|
|
|
4207
4256
|
"nuxt-nightly/dist",
|
|
4208
4257
|
distDir,
|
|
4209
4258
|
// Ensure app config files have auto-imports injected even if they are pure .js files
|
|
4210
|
-
...
|
|
4259
|
+
...layerDirs.map((dirs) => join(dirs.app, "app.config"))
|
|
4211
4260
|
],
|
|
4212
4261
|
traceInclude: [
|
|
4213
4262
|
// force include files used in generated code from the runtime-compiler
|
|
@@ -5671,9 +5720,11 @@ Using \`${fallbackCompatibilityDate}\` as fallback. More info at: ${colors.under
|
|
|
5671
5720
|
});
|
|
5672
5721
|
}
|
|
5673
5722
|
nuxt.options.build.transpile.push("nuxt/app");
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5723
|
+
for (const layer of layerDirs) {
|
|
5724
|
+
if (layer.root.includes("node_modules")) {
|
|
5725
|
+
nuxt.options.build.transpile.push(layer.root.replace(/\/$/, ""));
|
|
5726
|
+
}
|
|
5727
|
+
}
|
|
5677
5728
|
const locallyScannedLayersDirs = layerDirs.map((l) => join(l.root, "layers/"));
|
|
5678
5729
|
const rootWithTrailingSlash = withTrailingSlash(nuxt.options.rootDir);
|
|
5679
5730
|
for (const dirs of layerDirs) {
|
|
@@ -5899,8 +5950,13 @@ export default defineNuxtPlugin({
|
|
|
5899
5950
|
return nuxt.callHook("restart");
|
|
5900
5951
|
}
|
|
5901
5952
|
});
|
|
5902
|
-
nuxt.options.build.transpile = nuxt.options.build.transpile.map((t) =>
|
|
5903
|
-
|
|
5953
|
+
nuxt.options.build.transpile = nuxt.options.build.transpile.map((t) => {
|
|
5954
|
+
if (typeof t !== "string") {
|
|
5955
|
+
return t;
|
|
5956
|
+
}
|
|
5957
|
+
return normalize(t).split("node_modules/").pop();
|
|
5958
|
+
});
|
|
5959
|
+
addModuleTranspiles(nuxt);
|
|
5904
5960
|
await initNitro(nuxt);
|
|
5905
5961
|
const nitro = useNitro();
|
|
5906
5962
|
if (nitro.options.static && nuxt.options.experimental.payloadExtraction === void 0) {
|
|
@@ -5946,9 +6002,15 @@ async function loadNuxt(opts) {
|
|
|
5946
6002
|
}
|
|
5947
6003
|
}
|
|
5948
6004
|
options._modules.push(pagesModule, metaModule, componentsModule);
|
|
6005
|
+
const importIncludes = [];
|
|
6006
|
+
for (const layer of options._layers) {
|
|
6007
|
+
if (layer.cwd && layer.cwd.includes("node_modules")) {
|
|
6008
|
+
importIncludes.push(new RegExp(`(^|\\/)${escapeRE(layer.cwd.split("node_modules/").pop())}(\\/|$)(?!node_modules\\/)`));
|
|
6009
|
+
}
|
|
6010
|
+
}
|
|
5949
6011
|
options._modules.push([importsModule, {
|
|
5950
6012
|
transform: {
|
|
5951
|
-
include:
|
|
6013
|
+
include: importIncludes
|
|
5952
6014
|
}
|
|
5953
6015
|
}]);
|
|
5954
6016
|
options._modules.push(schemaModule);
|
|
@@ -170,10 +170,16 @@ export default defineComponent({
|
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
function _mergeTransitionProps(routeProps) {
|
|
173
|
-
const _props =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
const _props = [];
|
|
174
|
+
for (const prop of routeProps) {
|
|
175
|
+
if (!prop) {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
_props.push({
|
|
179
|
+
...prop,
|
|
180
|
+
onAfterLeave: prop.onAfterLeave ? toArray(prop.onAfterLeave) : void 0
|
|
181
|
+
});
|
|
182
|
+
}
|
|
177
183
|
return defu(..._props);
|
|
178
184
|
}
|
|
179
185
|
function haveParentRoutesRendered(fork, newRoute, Component) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-nightly",
|
|
3
|
-
"version": "4.1.2-
|
|
3
|
+
"version": "4.1.2-29293741.3f7624b3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"@nuxt/cli": "npm:@nuxt/cli-nightly@latest",
|
|
68
68
|
"@nuxt/devalue": "^2.0.2",
|
|
69
69
|
"@nuxt/devtools": "^2.6.3",
|
|
70
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.1.2-
|
|
71
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.1.2-
|
|
70
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.1.2-29293741.3f7624b3",
|
|
71
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.1.2-29293741.3f7624b3",
|
|
72
72
|
"@nuxt/telemetry": "^2.6.6",
|
|
73
|
-
"@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.1.2-
|
|
73
|
+
"@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.1.2-29293741.3f7624b3",
|
|
74
74
|
"@unhead/vue": "^2.0.14",
|
|
75
75
|
"@vue/shared": "^3.5.21",
|
|
76
76
|
"c12": "^3.2.0",
|