nitro-nightly 3.0.1-20260122-200414-64df4cfd → 3.0.1-20260123-194149-eec384aa

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.
@@ -24655,8 +24655,8 @@ function sourcemapMinify() {
24655
24655
 
24656
24656
  //#endregion
24657
24657
  //#region src/build/plugins/raw.ts
24658
- const HELPER_ID = "\0nitro-raw-helpers";
24659
- const RESOLVED_PREFIX = "\0nitro:raw:";
24658
+ const HELPER_ID = "virtual:nitro-raw-helpers";
24659
+ const RESOLVED_PREFIX = "virtual:nitro:raw:";
24660
24660
  const PREFIX = "raw:";
24661
24661
  function raw() {
24662
24662
  return {
@@ -24678,14 +24678,14 @@ function raw() {
24678
24678
  filter: { id: [/* @__PURE__ */ new RegExp(`^${HELPER_ID}$`), /* @__PURE__ */ new RegExp(`^${RESOLVED_PREFIX}`)] },
24679
24679
  handler(id) {
24680
24680
  if (id === HELPER_ID) return getHelpers();
24681
- if (id.startsWith(RESOLVED_PREFIX)) return promises.readFile(id.slice(11), isBinary(id) ? "binary" : "utf8");
24681
+ if (id.startsWith(RESOLVED_PREFIX)) return promises.readFile(id.slice(18), isBinary(id) ? "binary" : "utf8");
24682
24682
  }
24683
24683
  },
24684
24684
  transform: {
24685
24685
  order: "pre",
24686
24686
  filter: { id: /* @__PURE__ */ new RegExp(`^${RESOLVED_PREFIX}`) },
24687
24687
  handler(code, id) {
24688
- const path$2 = id.slice(11);
24688
+ const path$2 = id.slice(18);
24689
24689
  if (isBinary(id)) return {
24690
24690
  code: `import {base64ToUint8Array } from "${HELPER_ID}" \n export default base64ToUint8Array("${Buffer.from(code, "binary").toString("base64")}")`,
24691
24691
  map: rawAssetMap(path$2)
@@ -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") mod = await import(resolveModuleURL(mod, {
686
- from: [nitroOptions.rootDir],
687
- extensions: [
688
- ".mjs",
689
- ".cjs",
690
- ".js",
691
- ".mts",
692
- ".cts",
693
- ".ts"
694
- ]
695
- })).then((m) => m.default || m);
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
  })
@@ -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-20260122-200414-64df4cfd",
3
+ "version": "3.0.1-20260123-194149-eec384aa",
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": "eslint --cache . && prettier -c .",
60
- "lint:fix": "automd && eslint --cache --fix . && prettier -w .",
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
- "packageManager": "pnpm@10.28.0",
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": {