nuxt-nightly 4.1.1-29283211.1cd8a685 → 4.1.1-29284589.27dc1f24
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.
|
@@ -179,7 +179,7 @@ export default defineNuxtPlugin({
|
|
|
179
179
|
}
|
|
180
180
|
for (const middleware of middlewareEntries) {
|
|
181
181
|
if (import.meta.dev) {
|
|
182
|
-
nuxtApp._processingMiddleware = middleware.
|
|
182
|
+
nuxtApp._processingMiddleware = middleware._path || true;
|
|
183
183
|
}
|
|
184
184
|
const result = await nuxtApp.runWithContext(() => middleware(to, from));
|
|
185
185
|
if (import.meta.server) {
|
package/dist/index.mjs
CHANGED
|
@@ -62,9 +62,9 @@ async function isDirectory$1(path) {
|
|
|
62
62
|
}
|
|
63
63
|
const logger = useLogger("nuxt");
|
|
64
64
|
function resolveToAlias(path, nuxt = tryUseNuxt()) {
|
|
65
|
-
return reverseResolveAlias(path, { ...nuxt?.options.alias || {}, ...strippedAtAliases }).pop() || path;
|
|
65
|
+
return reverseResolveAlias(path, { ...nuxt?.options.alias || {}, ...strippedAtAliases$1 }).pop() || path;
|
|
66
66
|
}
|
|
67
|
-
const strippedAtAliases = {
|
|
67
|
+
const strippedAtAliases$1 = {
|
|
68
68
|
"@": "",
|
|
69
69
|
"@@": ""
|
|
70
70
|
};
|
|
@@ -3760,7 +3760,7 @@ function addDeclarationTemplates(ctx, options) {
|
|
|
3760
3760
|
});
|
|
3761
3761
|
}
|
|
3762
3762
|
|
|
3763
|
-
const version = "4.1.1-
|
|
3763
|
+
const version = "4.1.1-29284589.27dc1f24";
|
|
3764
3764
|
|
|
3765
3765
|
const createImportProtectionPatterns = (nuxt, options) => {
|
|
3766
3766
|
const patterns = [];
|
|
@@ -6365,14 +6365,35 @@ const layoutTemplate = {
|
|
|
6365
6365
|
};
|
|
6366
6366
|
const middlewareTemplate = {
|
|
6367
6367
|
filename: "middleware.mjs",
|
|
6368
|
-
getContents({ app }) {
|
|
6368
|
+
getContents({ app, nuxt }) {
|
|
6369
6369
|
const globalMiddleware = app.middleware.filter((mw) => mw.global);
|
|
6370
6370
|
const namedMiddleware = app.middleware.filter((mw) => !mw.global);
|
|
6371
|
-
const
|
|
6371
|
+
const alias = nuxt.options.dev ? { ...nuxt?.options.alias || {}, ...strippedAtAliases } : {};
|
|
6372
6372
|
return [
|
|
6373
6373
|
...globalMiddleware.map((mw) => genImport(mw.path, genSafeVariableName(mw.name))),
|
|
6374
|
-
|
|
6375
|
-
|
|
6374
|
+
...!nuxt.options.dev ? [
|
|
6375
|
+
`export const globalMiddleware = ${genArrayFromRaw(globalMiddleware.map((mw) => genSafeVariableName(mw.name)))}`,
|
|
6376
|
+
`export const namedMiddleware = ${genObjectFromRawEntries(namedMiddleware.map((mw) => [mw.name, genDynamicImport(mw.path)]))}`
|
|
6377
|
+
] : [
|
|
6378
|
+
`const _globalMiddleware = ${genObjectFromRawEntries(globalMiddleware.map((mw) => [reverseResolveAlias(mw.path, alias).pop() || mw.path, genSafeVariableName(mw.name)]))}`,
|
|
6379
|
+
`for (const path in _globalMiddleware) {`,
|
|
6380
|
+
` Object.defineProperty(_globalMiddleware[path], '_path', { value: path })`,
|
|
6381
|
+
`}`,
|
|
6382
|
+
`export const globalMiddleware = Object.values(_globalMiddleware)`,
|
|
6383
|
+
`const _namedMiddleware = ${genArrayFromRaw(namedMiddleware.map((mw) => ({
|
|
6384
|
+
name: genString(mw.name),
|
|
6385
|
+
path: genString(reverseResolveAlias(mw.path, alias).pop() || mw.path),
|
|
6386
|
+
import: genDynamicImport(mw.path)
|
|
6387
|
+
})))}`,
|
|
6388
|
+
`for (const mw of _namedMiddleware) {`,
|
|
6389
|
+
` const i = mw.import`,
|
|
6390
|
+
` mw.import = () => i().then(r => {`,
|
|
6391
|
+
` Object.defineProperty(r.default || r, '_path', { value: mw.path })`,
|
|
6392
|
+
` return r`,
|
|
6393
|
+
` })`,
|
|
6394
|
+
`}`,
|
|
6395
|
+
`export const namedMiddleware = Object.fromEntries(_namedMiddleware.map(mw => [mw.name, mw.import]))`
|
|
6396
|
+
]
|
|
6376
6397
|
].join("\n");
|
|
6377
6398
|
}
|
|
6378
6399
|
};
|
|
@@ -6654,6 +6675,10 @@ const buildTypeTemplate = {
|
|
|
6654
6675
|
return declarations;
|
|
6655
6676
|
}
|
|
6656
6677
|
};
|
|
6678
|
+
const strippedAtAliases = {
|
|
6679
|
+
"@": "",
|
|
6680
|
+
"@@": ""
|
|
6681
|
+
};
|
|
6657
6682
|
|
|
6658
6683
|
const defaultTemplates = {
|
|
6659
6684
|
__proto__: null,
|
|
@@ -166,7 +166,7 @@ const plugin = defineNuxtPlugin({
|
|
|
166
166
|
}
|
|
167
167
|
try {
|
|
168
168
|
if (import.meta.dev) {
|
|
169
|
-
nuxtApp._processingMiddleware = (typeof entry === "string" ? entry :
|
|
169
|
+
nuxtApp._processingMiddleware = middleware._path || (typeof entry === "string" ? entry : true);
|
|
170
170
|
}
|
|
171
171
|
const result = await nuxtApp.runWithContext(() => middleware(to, from));
|
|
172
172
|
if (import.meta.server || !nuxtApp.payload.serverRendered && nuxtApp.isHydrating) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-nightly",
|
|
3
|
-
"version": "4.1.1-
|
|
3
|
+
"version": "4.1.1-29284589.27dc1f24",
|
|
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.1-
|
|
71
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.1.1-
|
|
70
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.1.1-29284589.27dc1f24",
|
|
71
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.1.1-29284589.27dc1f24",
|
|
72
72
|
"@nuxt/telemetry": "^2.6.6",
|
|
73
|
-
"@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.1.1-
|
|
73
|
+
"@nuxt/vite-builder": "npm:@nuxt/vite-builder-nightly@4.1.1-29284589.27dc1f24",
|
|
74
74
|
"@unhead/vue": "^2.0.14",
|
|
75
75
|
"@vue/shared": "^3.5.20",
|
|
76
76
|
"c12": "^3.2.0",
|