nitro 3.0.260415-beta → 3.0.260429-beta

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.
Files changed (50) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md +32 -2
  2. package/dist/_build/common.mjs +43 -29
  3. package/dist/_build/rolldown.mjs +1 -1
  4. package/dist/_build/rollup.mjs +2 -2
  5. package/dist/_build/vite.build.mjs +1 -1
  6. package/dist/_chunks/nitro.mjs +5 -5
  7. package/dist/_chunks/nitro2.mjs +1 -1
  8. package/dist/_chunks/nitro3.mjs +1 -1
  9. package/dist/_chunks/nitro4.mjs +2 -2
  10. package/dist/_chunks/utils.mjs +2 -2
  11. package/dist/_common.mjs +1 -1
  12. package/dist/_dev.mjs +3 -2
  13. package/dist/_libs/c12+rc9.mjs +21 -9
  14. package/dist/_libs/hasown+resolve+deepmerge.mjs +47 -34
  15. package/dist/_libs/httpxy.d.mts +1 -3
  16. package/dist/_libs/httpxy.mjs +5 -5
  17. package/dist/_libs/nypm+tinyexec.mjs +129 -98
  18. package/dist/_libs/pkg-types.d.mts +7 -4
  19. package/dist/_libs/plugin-inject.mjs +3 -1
  20. package/dist/_libs/pluginutils.mjs +4 -2
  21. package/dist/_libs/readdirp+chokidar.mjs +2 -1
  22. package/dist/_libs/{unimport+unplugin.mjs → unimport+unplugin+oxc-parser.mjs} +49 -37
  23. package/dist/_libs/unplugin+unimport.d.mts +1 -1
  24. package/dist/_presets.mjs +2 -1
  25. package/dist/cli/_chunks/build.mjs +1 -1
  26. package/dist/cli/_chunks/deploy.mjs +1 -1
  27. package/dist/cli/_chunks/dev.mjs +1 -1
  28. package/dist/cli/_chunks/list.mjs +1 -1
  29. package/dist/cli/_chunks/prepare.mjs +1 -1
  30. package/dist/cli/_chunks/preview.mjs +1 -1
  31. package/dist/cli/_chunks/run.mjs +1 -1
  32. package/dist/docs/0.docs/5.cache.md +53 -9
  33. package/dist/node_modules/ufo/dist/index.mjs +2 -2
  34. package/dist/node_modules/ufo/package.json +9 -9
  35. package/dist/presets/azure/runtime/azure-swa.mjs +2 -0
  36. package/dist/runtime/internal/route-rules.d.mts +1 -0
  37. package/dist/runtime/internal/route-rules.mjs +29 -1
  38. package/dist/runtime/internal/routes/scalar.mjs +1 -0
  39. package/dist/types/index.d.mts +922 -64
  40. package/dist/vite.d.mts +1 -1
  41. package/dist/vite.mjs +11 -5
  42. package/package.json +28 -27
  43. package/dist/_libs/_.mjs +0 -2
  44. package/dist/_libs/_2.mjs +0 -2
  45. package/dist/_libs/_3.mjs +0 -2
  46. package/dist/_libs/_4.mjs +0 -2
  47. package/dist/_libs/_5.mjs +0 -2
  48. package/dist/_libs/_6.mjs +0 -2
  49. package/dist/_libs/_7.mjs +0 -2
  50. package/dist/_libs/escape-string-regexp.mjs +0 -5
package/dist/vite.d.mts CHANGED
@@ -20,7 +20,7 @@ interface NitroPluginConfig extends NitroConfig {
20
20
  */
21
21
  _nitro?: Nitro;
22
22
  experimental?: NitroConfig["experimental"] & {
23
- vite: {
23
+ vite?: {
24
24
  /**
25
25
  * @experimental Enable `?assets` import proposed by https://github.com/vitejs/vite/discussions/20913
26
26
  * @default true
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { D as copyPublicAssets, E as prepare, F as prettyPath, H as v, V as m, at as dirname$1, ct as join$1, d as libChunkName, dt as resolve$1, f as baseBuildConfig, h as writeBuildInfo, it as basename$1, l as NODE_MODULES_RE, n as baseBuildPlugins, nt as resolveModulePath, st as isAbsolute$1, u as getChunkName } from "./_build/common.mjs";
1
+ import { D as copyPublicAssets, E as prepare, F as prettyPath, H as m, U as v, at as basename$1, ct as isAbsolute$1, d as libChunkName, f as baseBuildConfig, ft as resolve$1, h as writeBuildInfo, l as NODE_MODULES_RE, lt as join$1, n as baseBuildPlugins, ot as dirname$1, rt as resolveModulePath, u as getChunkName } from "./_build/common.mjs";
2
2
  import { t as formatCompatibilityDate } from "./_libs/compatx.mjs";
3
3
  import { i as createNitro, r as prerender } from "./_chunks/nitro.mjs";
4
4
  import { n as scanHandlers } from "./_chunks/nitro2.mjs";
@@ -56,7 +56,7 @@ const getBundlerConfig = async (ctx) => {
56
56
  rolldownConfig
57
57
  };
58
58
  } else {
59
- const inject = (await import("./_libs/_3.mjs")).default;
59
+ const inject = (await import("./_libs/plugin-inject.mjs").then((n) => n.t)).default;
60
60
  const alias = (await import("./_libs/plugin-alias.mjs").then((n) => n.n)).default;
61
61
  const rollupConfig = defu({
62
62
  plugins: [inject(base.env.inject), alias({ entries: base.aliases })],
@@ -158,6 +158,7 @@ ${Object.keys(ctx.services).map((name) => {
158
158
  globalThis.__nitro_vite_envs__ = services;
159
159
  `;
160
160
  }
161
+ const ASSET_EXT_RE = /^(?:[jt]sx?|mjs|cjs|css|s[ac]ss|less|styl|vue|svelte|astro|mdx?|map|wasm|png|jpe?g|gif|svg|webp|avif|ico|bmp|woff2?|ttf|otf|eot|mp[34]|webm|wav|ogg|m4a)$/i;
161
162
  function createFetchableDevEnvironment(name, config, devServer, entry, opts) {
162
163
  return new FetchableDevEnvironment(name, config, {
163
164
  hot: true,
@@ -278,11 +279,16 @@ async function configureViteDevServer(ctx, server) {
278
279
  };
279
280
  server.middlewares.use(function nitroDevMiddlewarePre(req, res, next) {
280
281
  const fetchDest = req.headers["sec-fetch-dest"];
282
+ const accept = req.headers["accept"];
281
283
  const ext = req.url.match(/\.([a-z0-9]+)(?:[?#]|$)/i)?.[1];
282
284
  const isNitroRoute = ext ? !!nitro.routing.routes.match(req.method || "", new URL(withBase(req.url, nitro.options.baseURL), "http://localhost").pathname) : false;
283
- res.setHeader("vary", "sec-fetch-dest");
284
- if ((!fetchDest || /^(document|iframe|frame|empty)$/.test(fetchDest)) && (!ext || isNitroRoute) && !/^\/(?:__|@)/.test(req.url)) nitroDevMiddleware(req, res, next);
285
- else next();
285
+ const isDocumentLike = fetchDest ? /^(document|iframe|frame|empty)$/.test(fetchDest) : !(ext && ASSET_EXT_RE.test(ext) && !(typeof accept === "string" && /\btext\/html\b/.test(accept)));
286
+ res.setHeader("vary", "sec-fetch-dest, accept");
287
+ if (isDocumentLike && (!ext || isNitroRoute) && !/^\/(?:__|@)/.test(req.url)) nitroDevMiddleware(req, res, next);
288
+ else {
289
+ if (!isDocumentLike) req._nitroHandled = true;
290
+ next();
291
+ }
286
292
  });
287
293
  return () => {
288
294
  server.middlewares.use(nitroDevMiddleware);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitro",
3
- "version": "3.0.260415-beta",
3
+ "version": "3.0.260429-beta",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "keywords": [
6
6
  "api-routes",
@@ -60,7 +60,7 @@
60
60
  "lint": "oxlint . && oxfmt --check .",
61
61
  "format": "automd && oxlint --fix . && oxfmt .",
62
62
  "nitro": "node ./src/cli/index.ts",
63
- "release": "node ./scripts/release.js",
63
+ "release": "node ./scripts/release.ts",
64
64
  "stub": "obuild --stub",
65
65
  "test": "pnpm lint && pnpm build && pnpm typecheck && pnpm test:rollup && pnpm test:rolldown",
66
66
  "test:rolldown": "NITRO_BUILDER=rolldown pnpm vitest",
@@ -78,15 +78,15 @@
78
78
  "ocache": "^0.1.4",
79
79
  "ofetch": "^2.0.0-alpha.3",
80
80
  "ohash": "^2.0.11",
81
- "rolldown": "^1.0.0-rc.15",
81
+ "rolldown": "^1.0.0-rc.17",
82
82
  "srvx": "^0.11.15",
83
83
  "unenv": "^2.0.0-rc.24",
84
84
  "unstorage": "^2.0.0-alpha.7"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@azure/functions": "^3.5.1",
88
- "@azure/static-web-apps-cli": "^2.0.8",
89
- "@cloudflare/workers-types": "^4.20260414.1",
88
+ "@azure/static-web-apps-cli": "^2.0.9",
89
+ "@cloudflare/workers-types": "^4.20260426.1",
90
90
  "@deno/types": "^0.0.1",
91
91
  "@hiogawa/vite-plugin-fullstack": "^0.0.11",
92
92
  "@netlify/edge-functions": "^3.0.6",
@@ -97,7 +97,7 @@
97
97
  "@rollup/plugin-json": "^6.1.0",
98
98
  "@rollup/plugin-node-resolve": "^16.0.3",
99
99
  "@rollup/plugin-replace": "^6.0.3",
100
- "@scalar/api-reference": "^1.52.1",
100
+ "@scalar/api-reference": "^1.53.1",
101
101
  "@types/aws-lambda": "^8.10.161",
102
102
  "@types/estree": "^1.0.8",
103
103
  "@types/etag": "^1.8.4",
@@ -106,9 +106,9 @@
106
106
  "@types/node-fetch": "^2.6.13",
107
107
  "@types/semver": "^7.7.1",
108
108
  "@types/xml2js": "^0.4.14",
109
- "@typescript/native-preview": "^7.0.0-dev.20260414.1",
109
+ "@typescript/native-preview": "^7.0.0-dev.20260429.1",
110
110
  "@vercel/queue": "^0.1.6",
111
- "@vitest/coverage-v8": "^4.1.4",
111
+ "@vitest/coverage-v8": "^4.1.5",
112
112
  "automd": "^0.4.3",
113
113
  "c12": "^4.0.0-beta.4",
114
114
  "changelogen": "^0.6.2",
@@ -122,7 +122,6 @@
122
122
  "destr": "^2.0.5",
123
123
  "dot-prop": "^10.1.0",
124
124
  "edge-runtime": "^4.0.1",
125
- "escape-string-regexp": "^5.0.0",
126
125
  "etag": "^1.8.1",
127
126
  "execa": "^9.6.1",
128
127
  "expect-type": "^1.3.0",
@@ -130,25 +129,26 @@
130
129
  "get-port-please": "^3.2.0",
131
130
  "giget": "^3.2.0",
132
131
  "gzip-size": "^7.0.0",
133
- "httpxy": "^0.5.0",
132
+ "httpxy": "^0.5.1",
134
133
  "klona": "^2.0.6",
135
134
  "knitwork": "^1.3.0",
136
135
  "magic-string": "^0.30.21",
137
136
  "mdzilla": "^0.2.1",
138
137
  "mime": "^4.1.0",
139
- "miniflare": "^4.20260410.0",
138
+ "miniflare": "^4.20260426.0",
140
139
  "mlly": "^1.8.2",
141
- "nypm": "^0.6.5",
140
+ "nypm": "^0.6.6",
142
141
  "obuild": "^0.4.33",
143
- "oxfmt": "^0.45.0",
144
- "oxlint": "^1.60.0",
142
+ "oxc-parser": "*",
143
+ "oxfmt": "^0.47.0",
144
+ "oxlint": "^1.62.0",
145
145
  "pathe": "^2.0.3",
146
146
  "perfect-debounce": "^2.1.0",
147
- "pkg-types": "^2.3.0",
147
+ "pkg-types": "^2.3.1",
148
148
  "pretty-bytes": "^7.1.0",
149
149
  "react": "^19.2.5",
150
150
  "rendu": "^0.1.0",
151
- "rollup": "^4.60.1",
151
+ "rollup": "^4.60.2",
152
152
  "rou3": "^0.8.1",
153
153
  "scule": "^1.3.0",
154
154
  "semver": "^7.7.4",
@@ -157,29 +157,29 @@
157
157
  "std-env": "^4.1.0",
158
158
  "tinyglobby": "^0.2.16",
159
159
  "tsconfck": "^3.1.6",
160
- "typescript": "^6.0.2",
161
- "ufo": "^1.6.3",
160
+ "typescript": "^6.0.3",
161
+ "ufo": "^1.6.4",
162
162
  "ultrahtml": "^1.6.0",
163
163
  "uncrypto": "^0.1.3",
164
164
  "unctx": "^2.5.0",
165
- "unimport": "^6.1.0",
165
+ "unimport": "^6.2.0",
166
166
  "untyped": "^2.0.0",
167
167
  "unwasm": "^0.5.3",
168
- "vite": "^8.0.8",
168
+ "vite": "^8.0.10",
169
169
  "vite7": "npm:vite@^7.3.2",
170
- "vitest": "^4.1.4",
171
- "wrangler": "^4.82.2",
170
+ "vitest": "^4.1.5",
171
+ "wrangler": "^4.86.0",
172
172
  "xml2js": "^0.6.2",
173
173
  "youch": "^4.1.1",
174
174
  "youch-core": "^0.3.3",
175
- "zephyr-agent": "^1.0.1"
175
+ "zephyr-agent": "^1.0.2"
176
176
  },
177
177
  "peerDependencies": {
178
- "@vercel/queue": "^0.1.4",
178
+ "@vercel/queue": "^0.1.6",
179
179
  "dotenv": "*",
180
180
  "giget": "*",
181
181
  "jiti": "^2.6.1",
182
- "rollup": "^4.60.1",
182
+ "rollup": "^4.60.2",
183
183
  "vite": "^7 || ^8",
184
184
  "xml2js": "^0.6.2",
185
185
  "zephyr-agent": "^0.2.0"
@@ -212,12 +212,13 @@
212
212
  },
213
213
  "resolutions": {
214
214
  "cookie-es": "^3.1.1",
215
- "nitro": "link:."
215
+ "nitro": "link:.",
216
+ "oxc-parser": "link:./shims/oxc-parser"
216
217
  },
217
218
  "engines": {
218
219
  "node": "^20.19.0 || >=22.12.0"
219
220
  },
220
- "packageManager": "pnpm@10.33.0",
221
+ "packageManager": "pnpm@10.33.2",
221
222
  "compatiblePackages": {
222
223
  "schemaVersion": 1,
223
224
  "vite": {
package/dist/_libs/_.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { a as loadDotenv } from "./c12+rc9.mjs";
2
- export { loadDotenv };
package/dist/_libs/_2.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { t as mergeAssets } from "./pluginutils.mjs";
2
- export { mergeAssets };
package/dist/_libs/_3.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { t as inject } from "./plugin-inject.mjs";
2
- export { inject as default };
package/dist/_libs/_4.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { n as utils_exports, t as dist_exports } from "./c12+rc9.mjs";
2
- export { dist_exports as n, utils_exports as t };
package/dist/_libs/_5.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { n as addDevDependency } from "./nypm+tinyexec.mjs";
2
- export { addDevDependency };
package/dist/_libs/_6.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { a as detectImportsAcorn } from "./unimport+unplugin.mjs";
2
- export { detectImportsAcorn };
package/dist/_libs/_7.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { r as unplugin } from "./unimport+unplugin.mjs";
2
- export { unplugin as default };
@@ -1,5 +0,0 @@
1
- function escapeStringRegexp(string) {
2
- if (typeof string !== "string") throw new TypeError("Expected a string");
3
- return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
4
- }
5
- export { escapeStringRegexp as t };