Skip to content

Commit

Permalink
Merge branch 'v2' into pr/noootwo/2953
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 4, 2025
2 parents b429419 + 6ba4066 commit 43a71e0
Show file tree
Hide file tree
Showing 12 changed files with 1,869 additions and 1,534 deletions.
2 changes: 1 addition & 1 deletion docs/1.guide/2.routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Returning anything from a middleware will close the request and should be avoide

### Route Meta

You can define route handler meta at build-time using `defineRouteMeta` micro in the event handler files.
You can define route handler meta at build-time using `defineRouteMeta` macro in the event handler files.

> [!IMPORTANT]
> 🚧 This feature is currently experimental.
Expand Down
2 changes: 1 addition & 1 deletion docs/1.guide/7.fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ export default defineEventHandler(async (event) => {
})
```

In reality, no fetch request is made and the handler is directly called thanks to [unjs/unenv](https://unenv.unjs.io). This is useful to avoid making HTTP request overhead.
In reality, no fetch request is made and the handler is directly called, thanks to [unjs/unenv](https://unenv.unjs.io). This is useful to avoid making HTTP request overhead.
2 changes: 1 addition & 1 deletion docs/1.guide/9.plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ You can use plugins to register a hook that modifies the [`renderer`](https://ni

::note
This **only works** for render handler defined with [`renderer`](https://nitro.build/config#renderer) and won't be called for other api/server routes.
In [Nuxt](https://nuxt.com/) this hook will be called for Server Side Rendered pages
In [Nuxt](https://nuxt.com/) this hook will be called for Server-side rendered pages
::

```ts
Expand Down
18 changes: 18 additions & 0 deletions docs/3.config/0.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ Server runtime configuration.

**Note:**: `nitro` namespace is reserved.

### `compatibilityDate`

Deployment providers introduce new features that Nitro presets can leverage, but some of them need to be explicitly opted into.

Set it to latest tested date in `YY-MM-DD` format to leverage latest preset features.

If this configuration is not provided, Nitro will continue using the current (v2.9) behavior for presets and show a warning.

## Features

### `experimental`
Expand All @@ -56,6 +64,16 @@ openAPI: {
}
```

Theses routes are disabled by default in production. To enable them, use the `production` key.
`"runtime"` allows middleware usage, and `"prerender"` is the most efficient because the JSON response is constant.

```js
openAPI: {
// IMPORTANT: make sure to protect OpenAPI routes if necessary!
production: "runtime", // or "prerender"
}
```

If you like to customize the Scalar integration, you can [pass a configuration object](https://github.com/scalar/scalar) like this:

```js
Expand Down
9 changes: 8 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import unjs from "eslint-config-unjs";

export default unjs({
ignores: ["**/.output", "**/.nitro", "**/.netlify", "**/.nuxt", "**/*.gen.*"],
ignores: [
"**/.output",
"**/.nitro",
"**/.netlify",
"**/.nuxt",
"**/*.gen.*",
"**/dist",
],
rules: {
"unicorn/no-null": 0,
"no-undef": 0,
Expand Down
70 changes: 35 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,30 +100,30 @@
"@cloudflare/kv-asset-handler": "^0.3.4",
"@netlify/functions": "^2.8.2",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-inject": "^5.0.5",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-replace": "^6.0.1",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-replace": "^6.0.2",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/pluginutils": "^5.1.3",
"@rollup/pluginutils": "^5.1.4",
"@types/http-proxy": "^1.17.15",
"@vercel/nft": "^0.27.6",
"@vercel/nft": "^0.27.10",
"archiver": "^7.0.1",
"c12": "2.0.1",
"chokidar": "^3.6.0",
"citty": "^0.1.6",
"compatx": "^0.1.8",
"confbox": "^0.1.8",
"consola": "^3.2.3",
"consola": "^3.3.3",
"cookie-es": "^1.2.2",
"croner": "^9.0.0",
"crossws": "^0.3.1",
"db0": "^0.2.1",
"defu": "^6.1.4",
"destr": "^2.0.3",
"dot-prop": "^9.0.0",
"esbuild": "^0.24.0",
"esbuild": "^0.24.2",
"escape-string-regexp": "^5.0.0",
"etag": "^1.8.1",
"fs-extra": "^11.2.0",
Expand All @@ -132,74 +132,74 @@
"h3": "^1.13.0",
"hookable": "^5.5.3",
"httpxy": "^0.1.5",
"ioredis": "^5.4.1",
"jiti": "^2.4.0",
"ioredis": "^5.4.2",
"jiti": "^2.4.2",
"klona": "^2.0.6",
"knitwork": "^1.1.0",
"knitwork": "^1.2.0",
"listhen": "^1.9.0",
"magic-string": "^0.30.14",
"magic-string": "^0.30.17",
"magicast": "^0.3.5",
"mime": "^4.0.4",
"mime": "^4.0.6",
"mlly": "^1.7.3",
"node-fetch-native": "^1.6.4",
"ofetch": "^1.4.1",
"ohash": "^1.1.4",
"openapi-typescript": "^7.4.3",
"pathe": "^1.1.2",
"openapi-typescript": "^7.5.1",
"pathe": "^2.0.0",
"perfect-debounce": "^1.0.0",
"pkg-types": "^1.2.1",
"pkg-types": "^1.3.0",
"pretty-bytes": "^6.1.1",
"radix3": "^1.1.2",
"rollup": "^4.27.4",
"rollup-plugin-visualizer": "^5.12.0",
"rollup": "^4.29.1",
"rollup-plugin-visualizer": "^5.13.1",
"scule": "^1.3.0",
"semver": "^7.6.3",
"serve-placeholder": "^2.0.2",
"serve-static": "^1.16.2",
"std-env": "^3.8.0",
"ufo": "^1.5.4",
"uncrypto": "^0.1.3",
"unctx": "^2.3.1",
"unctx": "^2.4.1",
"unenv": "^1.10.0",
"unimport": "^3.13.4",
"unstorage": "^1.13.1",
"untyped": "^1.5.1",
"unimport": "^3.14.5",
"unstorage": "^1.14.4",
"untyped": "^1.5.2",
"unwasm": "^0.3.9"
},
"devDependencies": {
"@azure/functions": "^3.5.1",
"@azure/static-web-apps-cli": "^1.1.10",
"@cloudflare/workers-types": "^4.20241112.0",
"@cloudflare/workers-types": "^4.20241230.0",
"@deno/types": "^0.0.1",
"@netlify/edge-functions": "^2.11.1",
"@scalar/api-reference": "^1.25.72",
"@scalar/api-reference": "^1.25.99",
"@types/archiver": "^6.0.3",
"@types/aws-lambda": "^8.10.146",
"@types/aws-lambda": "^8.10.147",
"@types/estree": "^1.0.6",
"@types/etag": "^1.8.3",
"@types/fs-extra": "^11.0.4",
"@types/node-fetch": "^2.6.12",
"@types/semver": "^7.5.8",
"@types/serve-static": "^1.15.7",
"@types/xml2js": "^0.4.14",
"@vitest/coverage-v8": "^2.1.6",
"@vitest/coverage-v8": "^2.1.8",
"automd": "^0.3.12",
"better-sqlite3": "^11.6.0",
"better-sqlite3": "^11.7.0",
"changelogen": "^0.5.7",
"edge-runtime": "^3.0.5",
"eslint": "^9.15.0",
"edge-runtime": "^4.0.1",
"eslint": "^9.17.0",
"eslint-config-unjs": "^0.4.2",
"execa": "^9.5.1",
"execa": "^9.5.2",
"expect-type": "^1.1.0",
"firebase-admin": "^12.7.0",
"firebase-functions": "^4.9.0",
"get-port-please": "^3.1.2",
"miniflare": "^3.20241106.1",
"prettier": "^3.4.1",
"miniflare": "^3.20241218.0",
"prettier": "^3.4.2",
"typescript": "^5.7.2",
"unbuild": "3.0.0-rc.11",
"undici": "^6.20.1",
"vitest": "^2.1.6",
"unbuild": "^3.2.0",
"undici": "^6.21.0",
"vitest": "^2.1.8",
"xml2js": "^0.6.2"
},
"peerDependencies": {
Expand All @@ -210,7 +210,7 @@
"optional": true
}
},
"packageManager": "pnpm@9.14.2",
"packageManager": "pnpm@9.15.2",
"engines": {
"node": "^16.11.0 || >=17.0.0"
},
Expand Down
Loading

0 comments on commit 43a71e0

Please sign in to comment.