nitro-nightly 3.0.1-20260122-201913-dfdff9e9 → 3.0.1-20260123-195236-c6b834cd
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/_chunks/nitro.mjs
CHANGED
|
@@ -682,17 +682,20 @@ async function installModules(nitro) {
|
|
|
682
682
|
}
|
|
683
683
|
async function _resolveNitroModule(mod, nitroOptions) {
|
|
684
684
|
let _url;
|
|
685
|
-
if (typeof mod === "string")
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
685
|
+
if (typeof mod === "string") {
|
|
686
|
+
_url = resolveModuleURL(mod, {
|
|
687
|
+
from: [nitroOptions.rootDir],
|
|
688
|
+
extensions: [
|
|
689
|
+
".mjs",
|
|
690
|
+
".cjs",
|
|
691
|
+
".js",
|
|
692
|
+
".mts",
|
|
693
|
+
".cts",
|
|
694
|
+
".ts"
|
|
695
|
+
]
|
|
696
|
+
});
|
|
697
|
+
mod = await import(_url).then((m) => m.default || m);
|
|
698
|
+
}
|
|
696
699
|
if (typeof mod === "function") mod = { setup: mod };
|
|
697
700
|
if ("nitro" in mod) mod = mod.nitro;
|
|
698
701
|
if (!mod.setup) throw new Error("Invalid Nitro module: missing setup() function.");
|
|
@@ -8,8 +8,6 @@ const nitroApp = useNitroApp();
|
|
|
8
8
|
|
|
9
9
|
export const fetch = nitroApp.fetch;
|
|
10
10
|
|
|
11
|
-
const ws = import.meta._websocket
|
|
12
|
-
? wsAdapter({ resolve: resolveWebsocketHooks })
|
|
13
|
-
: undefined;
|
|
11
|
+
const ws = import.meta._websocket ? wsAdapter({ resolve: resolveWebsocketHooks }) : undefined;
|
|
14
12
|
|
|
15
13
|
export const handleUpgrade = ws?.handleUpgrade;
|
|
@@ -70,10 +70,7 @@ class EnvRunner {
|
|
|
70
70
|
try {
|
|
71
71
|
const entryFetch = this.entry.fetch || this.entry.default?.fetch;
|
|
72
72
|
if (!entryFetch) {
|
|
73
|
-
throw httpError(
|
|
74
|
-
500,
|
|
75
|
-
`No fetch handler exported from ${this.entryPath}`
|
|
76
|
-
);
|
|
73
|
+
throw httpError(500, `No fetch handler exported from ${this.entryPath}`);
|
|
77
74
|
}
|
|
78
75
|
return await entryFetch(req, init);
|
|
79
76
|
} catch (error) {
|
|
@@ -160,10 +157,7 @@ process.on("uncaughtException", (error) => console.error(error));
|
|
|
160
157
|
// define __VITE_ENVIRONMENT_RUNNER_IMPORT__ for RSC support
|
|
161
158
|
// https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-rsc/README.md#__vite_environment_runner_import__
|
|
162
159
|
|
|
163
|
-
globalThis.__VITE_ENVIRONMENT_RUNNER_IMPORT__ = async function (
|
|
164
|
-
environmentName,
|
|
165
|
-
id
|
|
166
|
-
) {
|
|
160
|
+
globalThis.__VITE_ENVIRONMENT_RUNNER_IMPORT__ = async function (environmentName, id) {
|
|
167
161
|
const env = envs[environmentName];
|
|
168
162
|
if (!env) {
|
|
169
163
|
throw new Error(`Vite environment "${environmentName}" is not registered`);
|
|
@@ -189,14 +183,10 @@ if (workerData.server) {
|
|
|
189
183
|
const { toNodeHandler } = await import("srvx/node");
|
|
190
184
|
const server = createServer(
|
|
191
185
|
toNodeHandler(async (req, init) => {
|
|
192
|
-
const viteEnv =
|
|
193
|
-
init?.viteEnv || req?.headers.get("x-vite-env") || "nitro"; // TODO
|
|
186
|
+
const viteEnv = init?.viteEnv || req?.headers.get("x-vite-env") || "nitro"; // TODO
|
|
194
187
|
const env = envs[viteEnv];
|
|
195
188
|
if (!env) {
|
|
196
|
-
return renderError(
|
|
197
|
-
req,
|
|
198
|
-
httpError(500, `Unknown vite environment "${viteEnv}"`)
|
|
199
|
-
);
|
|
189
|
+
return renderError(req, httpError(500, `Unknown vite environment "${viteEnv}"`));
|
|
200
190
|
}
|
|
201
191
|
return env.fetch(req, init);
|
|
202
192
|
})
|
package/dist/types/index.d.mts
CHANGED
|
@@ -61,7 +61,7 @@ type MatchResult<Key extends string, Exact extends boolean = false, Score extend
|
|
|
61
61
|
catchAll: catchAll;
|
|
62
62
|
} }[Key];
|
|
63
63
|
type Subtract<Minuend extends any[] = [], Subtrahend extends any[] = []> = Minuend extends [...Subtrahend, ...infer Remainder] ? Remainder : never;
|
|
64
|
-
type TupleIfDiff<First extends string, Second extends string, Tuple extends any[] = []> = First extends `${Second}${infer Diff}` ? Diff extends "" ? [] : Tuple : [];
|
|
64
|
+
type TupleIfDiff<First extends string, Second extends string, Tuple extends any[] = []> = First extends `${Second}${infer Diff}` ? (Diff extends "" ? [] : Tuple) : [];
|
|
65
65
|
type MaxTuple<N extends any[] = [], T extends any[] = []> = {
|
|
66
66
|
current: T;
|
|
67
67
|
result: MaxTuple<N, ["", ...T]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-nightly",
|
|
3
|
-
"version": "3.0.1-
|
|
3
|
+
"version": "3.0.1-20260123-195236-c6b834cd",
|
|
4
4
|
"description": "Build and Deploy Universal JavaScript Servers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-routes",
|
|
@@ -14,9 +14,17 @@
|
|
|
14
14
|
"web"
|
|
15
15
|
],
|
|
16
16
|
"homepage": "https://nitro.build",
|
|
17
|
-
"repository": "nitrojs/nitro",
|
|
18
17
|
"license": "MIT",
|
|
18
|
+
"repository": "nitrojs/nitro",
|
|
19
|
+
"bin": {
|
|
20
|
+
"nitro": "./dist/cli/index.mjs"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"lib"
|
|
25
|
+
],
|
|
19
26
|
"type": "module",
|
|
27
|
+
"types": "./lib/index.d.mts",
|
|
20
28
|
"imports": {
|
|
21
29
|
"#nitro/runtime/*": "./dist/runtime/internal/*.mjs",
|
|
22
30
|
"#nitro/virtual/*": "./dist/runtime/virtual/*.mjs"
|
|
@@ -41,14 +49,6 @@
|
|
|
41
49
|
"./vite/runtime": "./dist/runtime/vite.mjs",
|
|
42
50
|
"./vite/types": "./lib/vite.types.mjs"
|
|
43
51
|
},
|
|
44
|
-
"types": "./lib/index.d.mts",
|
|
45
|
-
"bin": {
|
|
46
|
-
"nitro": "./dist/cli/index.mjs"
|
|
47
|
-
},
|
|
48
|
-
"files": [
|
|
49
|
-
"dist",
|
|
50
|
-
"lib"
|
|
51
|
-
],
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "pnpm gen-presets && obuild",
|
|
54
54
|
"dev": "pnpm -C playground dev",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"dev:start": "node playground/.output/server/index.mjs",
|
|
57
57
|
"gen-node-compat": "node scripts/gen-node-compat.ts",
|
|
58
58
|
"gen-presets": "obuild --stub && node ./scripts/gen-presets.ts",
|
|
59
|
-
"lint": "
|
|
60
|
-
"
|
|
59
|
+
"lint": "oxlint . && oxfmt --check .",
|
|
60
|
+
"format": "automd && oxlint --fix . && oxfmt .",
|
|
61
61
|
"nitro": "node ./src/cli/index.ts",
|
|
62
62
|
"release": "pnpm test && pnpm build && changelogen --release --prerelease --push",
|
|
63
63
|
"stub": "obuild --stub",
|
|
@@ -66,10 +66,6 @@
|
|
|
66
66
|
"test:rollup": "NITRO_BUILDER=rollup pnpm vitest",
|
|
67
67
|
"test:types": "tsc --noEmit"
|
|
68
68
|
},
|
|
69
|
-
"resolutions": {
|
|
70
|
-
"nitro": "link:.",
|
|
71
|
-
"undici": "^7.18.2"
|
|
72
|
-
},
|
|
73
69
|
"dependencies": {
|
|
74
70
|
"consola": "^3.4.2",
|
|
75
71
|
"crossws": "^0.4.3",
|
|
@@ -125,8 +121,6 @@
|
|
|
125
121
|
"dot-prop": "^10.1.0",
|
|
126
122
|
"edge-runtime": "^4.0.1",
|
|
127
123
|
"escape-string-regexp": "^5.0.0",
|
|
128
|
-
"eslint": "^9.39.2",
|
|
129
|
-
"eslint-config-unjs": "^0.6.2",
|
|
130
124
|
"etag": "^1.8.1",
|
|
131
125
|
"execa": "^9.6.1",
|
|
132
126
|
"expect-type": "^1.3.0",
|
|
@@ -144,10 +138,11 @@
|
|
|
144
138
|
"mlly": "^1.8.0",
|
|
145
139
|
"nypm": "^0.6.4",
|
|
146
140
|
"obuild": "^0.4.18",
|
|
141
|
+
"oxfmt": "^0.26.0",
|
|
142
|
+
"oxlint": "^1.41.0",
|
|
147
143
|
"pathe": "^2.0.3",
|
|
148
144
|
"perfect-debounce": "^2.0.0",
|
|
149
145
|
"pkg-types": "^2.3.0",
|
|
150
|
-
"prettier": "^3.8.0",
|
|
151
146
|
"pretty-bytes": "^7.1.0",
|
|
152
147
|
"react": "^19.2.3",
|
|
153
148
|
"rendu": "^0.0.7",
|
|
@@ -197,10 +192,14 @@
|
|
|
197
192
|
"optional": true
|
|
198
193
|
}
|
|
199
194
|
},
|
|
200
|
-
"
|
|
195
|
+
"resolutions": {
|
|
196
|
+
"nitro": "link:.",
|
|
197
|
+
"undici": "^7.18.2"
|
|
198
|
+
},
|
|
201
199
|
"engines": {
|
|
202
200
|
"node": "^20.19.0 || >=22.12.0"
|
|
203
201
|
},
|
|
202
|
+
"packageManager": "pnpm@10.28.0",
|
|
204
203
|
"compatiblePackages": {
|
|
205
204
|
"schemaVersion": 1,
|
|
206
205
|
"vite": {
|