@nuxt/nitro-server-nightly 4.4.7-29652037.eb785fd0 → 4.4.7-29673425.78b1e698
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/index.mjs +44 -7
- package/package.json +12 -12
package/dist/index.mjs
CHANGED
|
@@ -15,13 +15,13 @@ import { build, copyPublicAssets, createDevServer, createNitro, prepare, prerend
|
|
|
15
15
|
import { addPlugin, addTemplate, addVitePlugin, createIsIgnored, findPath, getDirectory, getLayerDirectories, logger, resolveAlias, resolveIgnorePatterns, resolveNuxtModule } from "@nuxt/kit";
|
|
16
16
|
import escapeRE from "escape-string-regexp";
|
|
17
17
|
import { defu } from "defu";
|
|
18
|
-
import { defineEventHandler, dynamicEventHandler, handleCors, setHeader } from "h3";
|
|
18
|
+
import { defineEventHandler, dynamicEventHandler, getRequestHeader, handleCors, setHeader, setResponseStatus } from "h3";
|
|
19
19
|
import { addDependency } from "nypm";
|
|
20
20
|
import { hasTTY, isCI, isWindows } from "std-env";
|
|
21
21
|
import { ImpoundPlugin } from "impound";
|
|
22
22
|
import { resolveModulePath } from "exsolve";
|
|
23
23
|
import { runtimeDependencies } from "nitropack/runtime/meta";
|
|
24
|
-
var version = "4.4.7-
|
|
24
|
+
var version = "4.4.7-29673425.78b1e698";
|
|
25
25
|
function toArray(value) {
|
|
26
26
|
return Array.isArray(value) ? value : [value];
|
|
27
27
|
}
|
|
@@ -455,7 +455,7 @@ async function bundle(nuxt) {
|
|
|
455
455
|
}).join(",")}}`;
|
|
456
456
|
}
|
|
457
457
|
})}
|
|
458
|
-
export default (path) => defu({}, ...matcher('', path).map(r => r.data).reverse())
|
|
458
|
+
export default (path) => defu({}, ...matcher('', typeof path === 'string' ? path.toLowerCase() : path).map(r => r.data).reverse())
|
|
459
459
|
`;
|
|
460
460
|
}
|
|
461
461
|
});
|
|
@@ -794,10 +794,16 @@ async function bundle(nuxt) {
|
|
|
794
794
|
}
|
|
795
795
|
nitro.options.devHandlers.push({
|
|
796
796
|
route: "/.well-known/appspecific/com.chrome.devtools.json",
|
|
797
|
-
handler: defineEventHandler(() =>
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
797
|
+
handler: defineEventHandler((event) => {
|
|
798
|
+
if (!isLocalDevRequest(event, getDevHandlerAllowedHosts(nuxt))) {
|
|
799
|
+
setResponseStatus(event, 403);
|
|
800
|
+
return "Forbidden";
|
|
801
|
+
}
|
|
802
|
+
return { workspace: {
|
|
803
|
+
...projectConfiguration,
|
|
804
|
+
root: nuxt.options.rootDir
|
|
805
|
+
} };
|
|
806
|
+
})
|
|
801
807
|
});
|
|
802
808
|
}
|
|
803
809
|
if (!nuxt.options.dev && nuxt.options.experimental.noVueServer) nitro.hooks.hook("rollup:before", (nitro) => {
|
|
@@ -901,6 +907,37 @@ async function spaLoadingTemplatePath(nuxt) {
|
|
|
901
907
|
if (typeof nuxt.options.spaLoadingTemplate === "string") return resolve(nuxt.options.srcDir, nuxt.options.spaLoadingTemplate);
|
|
902
908
|
return await findPath(nuxt.options._layers.map((layer) => resolve(layer.config.srcDir, layer.config.dir?.app || "app", "spa-loading-template.html"))) ?? resolve(nuxt.options.srcDir, nuxt.options.dir?.app || "app", "spa-loading-template.html");
|
|
903
909
|
}
|
|
910
|
+
const LOOPBACK_HOSTS = new Set([
|
|
911
|
+
"localhost",
|
|
912
|
+
"127.0.0.1",
|
|
913
|
+
"[::1]",
|
|
914
|
+
"::1"
|
|
915
|
+
]);
|
|
916
|
+
function getDevHandlerAllowedHosts(nuxt) {
|
|
917
|
+
const allowedHosts = nuxt.options.vite?.server?.allowedHosts;
|
|
918
|
+
if (allowedHosts === true) return true;
|
|
919
|
+
const hosts = new Set(LOOPBACK_HOSTS);
|
|
920
|
+
if (Array.isArray(allowedHosts)) {
|
|
921
|
+
for (const host of allowedHosts) if (typeof host === "string" && host) hosts.add(host);
|
|
922
|
+
}
|
|
923
|
+
return hosts;
|
|
924
|
+
}
|
|
925
|
+
function isLocalDevRequest(event, allowedHosts) {
|
|
926
|
+
const hostHeader = getRequestHeader(event, "host");
|
|
927
|
+
if (allowedHosts !== true) {
|
|
928
|
+
const host = hostHeader?.split(":")[0];
|
|
929
|
+
if (!host || !allowedHosts.has(host)) return false;
|
|
930
|
+
}
|
|
931
|
+
const site = getRequestHeader(event, "sec-fetch-site");
|
|
932
|
+
if (site !== void 0) return site === "same-origin" || site === "none";
|
|
933
|
+
const initiator = getRequestHeader(event, "origin") || getRequestHeader(event, "referer");
|
|
934
|
+
if (!initiator) return true;
|
|
935
|
+
try {
|
|
936
|
+
return new URL(initiator).host === hostHeader;
|
|
937
|
+
} catch {
|
|
938
|
+
return false;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
904
941
|
async function spaLoadingTemplate(nuxt) {
|
|
905
942
|
if (nuxt.options.spaLoadingTemplate === false) return "";
|
|
906
943
|
const spaLoadingTemplate = await spaLoadingTemplatePath(nuxt);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/nitro-server-nightly",
|
|
3
|
-
"version": "4.4.7-
|
|
3
|
+
"version": "4.4.7-29673425.78b1e698",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@nuxt/devalue": "^2.0.2",
|
|
30
|
-
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.4.7-
|
|
30
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@4.4.7-29673425.78b1e698",
|
|
31
31
|
"@unhead/vue": "^2.1.15",
|
|
32
|
-
"@vue/shared": "^3.5.
|
|
32
|
+
"@vue/shared": "^3.5.35",
|
|
33
33
|
"consola": "^3.4.2",
|
|
34
34
|
"defu": "^6.1.7",
|
|
35
35
|
"destr": "^2.0.5",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"ufo": "^1.6.4",
|
|
51
51
|
"unctx": "^2.5.0",
|
|
52
52
|
"unstorage": "^1.17.5",
|
|
53
|
-
"vue": "^3.5.
|
|
53
|
+
"vue": "^3.5.35",
|
|
54
54
|
"vue-bundle-renderer": "^2.2.0",
|
|
55
55
|
"vue-devtools-stub": "^0.1.0"
|
|
56
56
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@babel/plugin-proposal-decorators": "^7.25.0",
|
|
59
59
|
"@babel/plugin-syntax-typescript": "^7.25.0",
|
|
60
60
|
"@rollup/plugin-babel": "^6.0.0 || ^7.0.0",
|
|
61
|
-
"nuxt": "npm:nuxt-nightly@4.4.7-
|
|
61
|
+
"nuxt": "npm:nuxt-nightly@4.4.7-29673425.78b1e698"
|
|
62
62
|
},
|
|
63
63
|
"peerDependenciesMeta": {
|
|
64
64
|
"@babel/plugin-proposal-decorators": {
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@babel/plugin-proposal-decorators": "7.29.
|
|
76
|
-
"@babel/plugin-syntax-typescript": "7.
|
|
77
|
-
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.4.7-
|
|
78
|
-
"@rollup/plugin-babel": "7.
|
|
79
|
-
"nuxt": "npm:nuxt-nightly@4.4.7-
|
|
80
|
-
"obuild": "0.4.
|
|
81
|
-
"vitest": "4.1.
|
|
75
|
+
"@babel/plugin-proposal-decorators": "7.29.7",
|
|
76
|
+
"@babel/plugin-syntax-typescript": "7.29.7",
|
|
77
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@4.4.7-29673425.78b1e698",
|
|
78
|
+
"@rollup/plugin-babel": "7.1.0",
|
|
79
|
+
"nuxt": "npm:nuxt-nightly@4.4.7-29673425.78b1e698",
|
|
80
|
+
"obuild": "0.4.36",
|
|
81
|
+
"vitest": "4.1.7"
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": "^22.12.0 || ^24.11.0 || >=26.0.0"
|