Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikxin committed Jan 31, 2025
2 parents 6504212 + 601ade2 commit 27da76d
Show file tree
Hide file tree
Showing 37 changed files with 1,405 additions and 1,281 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: denoland/setup-deno@v1
if: ${{ matrix.os != 'windows-latest' }}
with:
deno-version: v1.x
deno-version: v2.x
- run: pnpm install
- run: pnpm test:types
if: ${{ matrix.os != 'windows-latest' }}
Expand Down
6 changes: 3 additions & 3 deletions docs/1.guide/0.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Nitro 会自动使您的代码与任何 [部署](/deploy) 提供商和运行时
::note
请确保您已安装推荐的设置:

- 最新的 LTS 版本 [Node.js](https://nodejs.org/en)[Bun](https://bun.sh/)
- 最新的LTS版本,可以选择 [Node.js](https://nodejs.org/en)[Bun](https://bun.sh/)[Deno](https://deno.com/)
- [Visual Studio Code](https://code.visualstudio.com/)
::

Expand All @@ -43,7 +43,7 @@ cd nitro-app
Nitro 已准备好在 `http://localhost:3000/` 上运行!

::tip
如果想要了解正在发生的事情,请检查 `.nitro/dev/index.mjs`
检查 `.nitro/dev/index.mjs` 如果您想知道发生了什么。
::

构建您的生产就绪服务器:
Expand All @@ -62,7 +62,7 @@ Nitro 已准备好在 `http://localhost:3000/` 上运行!

## 目录结构

启动模板包含一些重要文件,以帮助您入门。
启动模板包括一些重要文件,以帮助您入门。

### `routes/`

Expand Down
4 changes: 2 additions & 2 deletions docs/1.guide/2.routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ icon: ri:direction-line
## 事件处理器

[事件处理器](https://h3.unjs.io/guide/event-handler) 是一个功能,它将绑定到一个路由,并在路由被路由器匹配到一个输入请求时执行
事件处理程序是一个将被绑定到路由的函数,当路由被路由器匹配到传入请求时将执行该函数

:read-more{to="https://h3.unjs.io/guide/event-handler"}

Expand Down Expand Up @@ -270,7 +270,7 @@ export default defineEventHandler((event) => {

You can use the [utilities available in H3](https://h3.unjs.io/guide/event-handler#error-handling) to handle errors in both routes and middlewares.

The way errors are sent back to the client depends on the route's path. For most routes `Content-Type` is set to `text/html` by default and a simple html error page is delievered. If the route starts with `/api/` (either because it is placed in `api/` or `routes/api/`) the default will change to `application/json` and a JSON object will be sent.
The way errors are sent back to the client depends on the route's path. For most routes `Content-Type` is set to `text/html` by default and a simple html error page is delivered. If the route starts with `/api/` (either because it is placed in `api/` or `routes/api/`) the default will change to `application/json` and a JSON object will be sent.

This behaviour can be overridden by some request properties (e.g.: `Accept` or `User-Agent` headers).

Expand Down
2 changes: 1 addition & 1 deletion examples/api-routes/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
});
2 changes: 1 addition & 1 deletion examples/auto-imports/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
});
2 changes: 1 addition & 1 deletion examples/cached-handler/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
});
2 changes: 1 addition & 1 deletion examples/custom-error-handler/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import errorHandler from "./error";

export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
errorHandler: "~/error",
devErrorHandler: errorHandler,
});
2 changes: 1 addition & 1 deletion examples/database/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
experimental: {
database: true,
tasks: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/graceful-shutdown/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineNitroConfig } from "nitropack/config";

export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
});
2 changes: 1 addition & 1 deletion examples/hello-world/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://nitro.build/config
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
srcDir: "server",
});
2 changes: 1 addition & 1 deletion examples/middleware/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
});
2 changes: 1 addition & 1 deletion examples/nano-jsx/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
});
2 changes: 1 addition & 1 deletion examples/plugins/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
plugins: ["~/plugins/test"],
});
2 changes: 1 addition & 1 deletion examples/renderer/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
renderer: "~/renderer",
});
2 changes: 1 addition & 1 deletion examples/websocket/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default defineNitroConfig({
compatibilityDate: "2024-09-29",
compatibilityDate: "2025-01-30",
experimental: {
websocket: true,
},
Expand Down
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
},
"dependencies": {
"@cloudflare/kv-asset-handler": "^0.3.4",
"@netlify/functions": "^2.8.2",
"@netlify/functions": "3.0.0",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-inject": "^5.0.5",
Expand All @@ -108,30 +108,30 @@
"@rollup/plugin-terser": "^0.4.4",
"@rollup/pluginutils": "^5.1.4",
"@types/http-proxy": "^1.17.15",
"@vercel/nft": "^0.29.0",
"@vercel/nft": "^0.29.1",
"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.3.3",
"consola": "^3.4.0",
"cookie-es": "^1.2.2",
"croner": "^9.0.0",
"crossws": "^0.3.1",
"db0": "^0.2.1",
"crossws": "^0.3.3",
"db0": "^0.2.3",
"defu": "^6.1.4",
"destr": "^2.0.3",
"dot-prop": "^9.0.0",
"esbuild": "^0.24.2",
"escape-string-regexp": "^5.0.0",
"etag": "^1.8.1",
"fs-extra": "^11.2.0",
"fs-extra": "^11.3.0",
"globby": "^14.0.2",
"gzip-size": "^7.0.0",
"h3": "^1.13.1",
"h3": "^1.14.0",
"hookable": "^5.5.3",
"httpxy": "^0.1.5",
"httpxy": "^0.1.7",
"ioredis": "^5.4.2",
"jiti": "^2.4.2",
"klona": "^2.0.6",
Expand All @@ -141,16 +141,16 @@
"magicast": "^0.3.5",
"mime": "^4.0.6",
"mlly": "^1.7.4",
"node-fetch-native": "^1.6.4",
"node-fetch-native": "^1.6.6",
"ofetch": "^1.4.1",
"ohash": "^1.1.4",
"openapi-typescript": "^7.5.2",
"pathe": "^2.0.1",
"openapi-typescript": "^7.6.0",
"pathe": "^2.0.2",
"perfect-debounce": "^1.0.0",
"pkg-types": "^1.3.0",
"pkg-types": "^1.3.1",
"pretty-bytes": "^6.1.1",
"radix3": "^1.1.2",
"rollup": "^4.30.1",
"rollup": "^4.32.1",
"rollup-plugin-visualizer": "^5.14.0",
"scule": "^1.3.0",
"semver": "^7.6.3",
Expand All @@ -162,7 +162,7 @@
"uncrypto": "^0.1.3",
"unctx": "^2.4.1",
"unenv": "^1.10.0",
"unimport": "^3.14.5",
"unimport": "^4.0.0",
"unstorage": "^1.14.4",
"untyped": "^1.5.2",
"unwasm": "^0.3.9",
Expand All @@ -172,10 +172,10 @@
"devDependencies": {
"@azure/functions": "^3.5.1",
"@azure/static-web-apps-cli": "^1.1.10",
"@cloudflare/workers-types": "^4.20250109.0",
"@cloudflare/workers-types": "^4.20250124.3",
"@deno/types": "^0.0.1",
"@netlify/edge-functions": "^2.11.1",
"@scalar/api-reference": "^1.25.102",
"@scalar/api-reference": "^1.25.109",
"@types/archiver": "^6.0.3",
"@types/aws-lambda": "^8.10.147",
"@types/estree": "^1.0.6",
Expand All @@ -185,24 +185,24 @@
"@types/semver": "^7.5.8",
"@types/serve-static": "^1.15.7",
"@types/xml2js": "^0.4.14",
"@vitest/coverage-v8": "^2.1.8",
"@vitest/coverage-v8": "^3.0.4",
"automd": "^0.3.12",
"better-sqlite3": "^11.7.2",
"better-sqlite3": "^11.8.1",
"changelogen": "^0.5.7",
"edge-runtime": "^4.0.1",
"eslint": "^9.18.0",
"eslint": "^9.19.0",
"eslint-config-unjs": "^0.4.2",
"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.20241230.1",
"miniflare": "^3.20250124.0",
"prettier": "^3.4.2",
"typescript": "^5.7.3",
"unbuild": "^3.3.1",
"undici": "^6.21.0",
"vitest": "^2.1.8",
"undici": "^6.21.1",
"vitest": "^3.0.4",
"xml2js": "^0.6.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion playground/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineNitroConfig } from "nitropack/config";

export default defineNitroConfig({
compatibilityDate: "2024-09-19",
compatibilityDate: "2025-01-30",
});
2 changes: 1 addition & 1 deletion playground/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class_name = "$DurableObject"

[[migrations]]
tag = "v1"
new_classes = ["$DurableObject"]
new_sqlite_classes = ["$DurableObject"]
Loading

0 comments on commit 27da76d

Please sign in to comment.