Skip to content

Commit

Permalink
Merge branch 'main' into chore/docker-env
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Sep 15, 2023
2 parents 215f45e + 058bacf commit 2d4f1af
Show file tree
Hide file tree
Showing 48 changed files with 3,015 additions and 1,838 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: autofix.ci # needed to securely identify the workflow
name: autofix.ci # needed to securely identify the workflow

on:
pull_request:
push:
branches: [ "main" ]
branches: ["main"]

permissions:
contents: read
Expand All @@ -12,16 +12,16 @@ jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"
- run: pnpm install
- run: pnpm stub
- name: Fix lint issues
run: npm run lint:fix
- uses: autofix-ci/action@8caa572fd27b0019a65e4c695447089c8d3138b9
with:
commit-message: 'chore: apply automated lint fixes'
commit-message: "chore: apply automated fixes"
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
cache: pnpm
- run: pnpm install
- run: pnpm stub
Expand All @@ -31,13 +31,13 @@ jobs:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
cache: pnpm
- uses: oven-sh/setup-bun@v1
if: ${{ matrix.os != 'windows-latest' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
94 changes: 94 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,100 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## v2.6.3

[compare changes](https://github.com/unjs/nitro/compare/v2.6.2...v2.6.3)

### 🩹 Fixes

- **firebase:** Apply region for gen2 deployments ([#1657](https://github.com/unjs/nitro/pull/1657))
- **cloudflare-pages:** Autodetect static preset ([#1659](https://github.com/unjs/nitro/pull/1659))
- Resolve output dirs relative to `rootDir` ([#1666](https://github.com/unjs/nitro/pull/1666))
- **prerender:** Allow disabling html sub-folders ([#1676](https://github.com/unjs/nitro/pull/1676))
- **firebase:** Use correct key when importing firebase `httpsOptions` ([#1663](https://github.com/unjs/nitro/pull/1663))
- Await on `send()` calls ([#1701](https://github.com/unjs/nitro/pull/1701))
- Bun dev compatibility ([#1702](https://github.com/unjs/nitro/pull/1702))
- **aws-lambda,netlify-lambda:** Binary body v2 and cookies v1 ([#1683](https://github.com/unjs/nitro/pull/1683))
- **iis:** Merge `web.config` ([#1658](https://github.com/unjs/nitro/pull/1658))

### 📖 Documentation

- **render-com:** Add note about node version ([#1693](https://github.com/unjs/nitro/pull/1693))
- Add instructions for using nuxt edge release channel ([#1688](https://github.com/unjs/nitro/pull/1688))
- Add instructions for bun ([#1672](https://github.com/unjs/nitro/pull/1672))

### 🏡 Chore

- **release:** V2.6.2 ([9d0a383c](https://github.com/unjs/nitro/commit/9d0a383c))
- Tiny internal typo ([#1668](https://github.com/unjs/nitro/pull/1668))
- Fix code comments ([#1673](https://github.com/unjs/nitro/pull/1673))
- Update dependencies ([3134ba6d](https://github.com/unjs/nitro/commit/3134ba6d))

### ✅ Tests

- Update test for bun headers ([#1684](https://github.com/unjs/nitro/pull/1684))

### ❤️ Contributors

- Gavin Hardaker ([@Hardaker587](http://github.com/Hardaker587))
- Heb ([@Hebilicious](http://github.com/Hebilicious))
- Colin McDonnell ([@colinhacks](http://github.com/colinhacks))
- Pooya Parsa ([@pi0](http://github.com/pi0))
- Luke Nelson <[email protected]>
- Rajeev R Sharma <[email protected]>
- Markthree ([@markthree](http://github.com/markthree))
- Daniel Roe <[email protected]>
- Yuichi Takebe

## v2.6.2

[compare changes](https://github.com/unjs/nitro/compare/v2.6.1...v2.6.2)

### 🩹 Fixes

- Use new h3 generics for `defineCachedEventHandler` ([#1640](https://github.com/unjs/nitro/pull/1640))
- **aws-lambda, netlify:** Add `isBase64Encoded` response field ([#1645](https://github.com/unjs/nitro/pull/1645))
- Exclude typed body from `cachedEventHandler` ([#1647](https://github.com/unjs/nitro/pull/1647))
- **static:** Send immediate empty responses for 304 handling ([#1639](https://github.com/unjs/nitro/pull/1639))

### 🏡 Chore

- **docs:** Update dependencies ([d4d622c2](https://github.com/unjs/nitro/commit/d4d622c2))
- **docs:** Add hotfix for `micromark` import issue ([b1e676e6](https://github.com/unjs/nitro/commit/b1e676e6))
- Update lockfile ([fffd8724](https://github.com/unjs/nitro/commit/fffd8724))
- Update `listhen` ([62ac3065](https://github.com/unjs/nitro/commit/62ac3065))

### ✅ Tests

- Add test for prerender ignored `data:` urls ([#1431](https://github.com/unjs/nitro/pull/1431))

### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))
- Markthree ([@markthree](http://github.com/markthree))
- Daniel Roe <[email protected]>
- Azcray

## v2.6.1

[compare changes](https://github.com/unjs/nitro/compare/v2.6.0...v2.6.1)

### 🩹 Fixes

- Correctly mark `middleware: false` for scanned routes ([#1631](https://github.com/unjs/nitro/pull/1631))
- Pass relative ignore paths when scanning public assets ([#1632](https://github.com/unjs/nitro/pull/1632))

### 🏡 Chore

- Update dependencies ([a779ae79](https://github.com/unjs/nitro/commit/a779ae79))
- Force cf pages headers type ([81ec33a0](https://github.com/unjs/nitro/commit/81ec33a0))
- Update mlly ([f76f0daa](https://github.com/unjs/nitro/commit/f76f0daa))

### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))
- Daniel Roe <[email protected]>

## v2.6.0

[compare changes](https://github.com/unjs/nitro/compare/v2.5.2...v2.6.0)
Expand Down
26 changes: 23 additions & 3 deletions docs/content/1.guide/0.getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ npx giget@latest nitro nitro-app
pnpm dlx giget@latest nitro nitro-app
```

```bash [bun]
bunx giget@latest nitro nitro-app
```

::

```sh
Expand All @@ -56,6 +60,10 @@ yarn install
pnpm install
```

```bash [bun]
bun install
```

::


Expand Down Expand Up @@ -92,15 +100,27 @@ Nitro offers an edge release channel that automatically releases for every commi

You can opt-in to the edge release channel by updating your `package.json`:

```diff
::code-group
```diff [Nitro]
{
"devDependencies": {
-- "nitropack": "^2.0.0"
++ "nitropack": "npm:nitropack-edge@latest"
}
}
```
```diff [Nuxt]
{
"devDependencies": {
-- "nuxt": "^3.0.0"
++ "nuxt": "npm:nuxt3@latest"
}
}
```
::

Remove an lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall the dependencies.

::alert
If you are using Nuxt, [use the Nuxt edge channel](https://nuxt.com/docs/guide/going-further/edge-channel#opting-into-the-edge-channel) as it already includes `nitropack-edge`.
::

Remove the lockfile (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, or `bun.lockb`) and reinstall the dependencies.
2 changes: 1 addition & 1 deletion docs/content/2.deploy/1.node.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You can customize server behavior using following environment variables:

- `NITRO_PORT` or `PORT` (defaults to `3000`)
- `NITRO_HOST` or `HOST`
- `NITRO_SOCKET` - if provided (a path to the desired socket file) the service will be served over the provided UNIX socket.
- `NITRO_UNIX_SOCKET` - if provided (a path to the desired socket file) the service will be served over the provided UNIX socket.
- `NITRO_SSL_CERT` and `NITRO_SSL_KEY` - if both are present, this will launch the server in HTTPS mode. In the vast majority of cases, this should not be used other than for testing, and the Nitro server should be run behind a reverse proxy like nginx or Cloudflare which terminates SSL.
- `NITRO_SHUTDOWN` - Enables the graceful shutdown feature when set to `'true'`. If it's set to `'false'`, the graceful shutdown is bypassed to speed up the development process. Defaults to `'false'`.
- `NITRO_SHUTDOWN_SIGNALS` - Allows you to specify which signals should be handled. Each signal should be separated with a space. Defaults to `'SIGINT SIGTERM'`.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.deploy/providers/cloudflare.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
Integration with this provider is possible with zero configuration. ([Learn More](/deploy/#zero-config-providers))
::

Nitro automatically generates a `_routes.json` file that controls which routes get served from files and which are served from the Worker script. The auto-generated routes file can be overrided with the config option `cloudflare.pages.routes` ([read more](https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes)).
Nitro automatically generates a `_routes.json` file that controls which routes get served from files and which are served from the Worker script. The auto-generated routes file can be overridden with the config option `cloudflare.pages.routes` ([read more](https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes)).

### Git integration

Expand Down
3 changes: 3 additions & 0 deletions docs/content/2.deploy/providers/firebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ yarn add --dev firebase-admin firebase-functions firebase-functions-test
```bash [pnpm]
pnpm install -D firebase-admin firebase-functions firebase-functions-test
```
```bash [bun]
bun add -D firebase-admin firebase-functions firebase-functions-test
```
::

#### 3. Log Into the Firebase CLI
Expand Down
37 changes: 34 additions & 3 deletions docs/content/2.deploy/providers/iis.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ This is an experimental preset.

1. Install [IISnode](https://github.com/azure/iisnode/releases), and the [IIS URL Rewrite Module](https://www.iis.net/downloads/microsoft/url-rewrite).
2. In IIS, add `.mjs` as a new mime type and set its content type to `application/javascript`.
3. Deploy the contents of your `.output` folder to your website in IIS.

3. Deploy the contents of your `.output` folder to your website in IIS.

## Using IIS directly

Expand All @@ -23,4 +22,36 @@ If you do not wish to use IISnode, you can use IIS directly.

1. Make sure that [Node.js](https://nodejs.org/en/) is installed on your Windows Server.
2. Make sure [`HttpPlatformHandler` Module](https://www.iis.net/downloads/microsoft/httpplatformhandler) is installed.
3. Copy your `.output` directory into the Windows Server, and create a website on IIS pointing to that exact directory.
3. Copy your `.output` directory into the Windows Server, and create a website on IIS pointing to that exact directory.

## IIS Config options

::code-group

```ts [nitro.config.ts]
export default defineNitroConfig({
// IIS options default
iis: {
// merges in a pre-exisiting web.config file to the nitro default file
mergeConfig: true,
// overrides the default nitro web.config file all together
overrideConfig: false,
},
});
```

```ts [nuxt.config.ts]
export default defineNuxtConfig({
nitro: {
// IIS options default
iis: {
// merges in a pre-exisiting web.config file to the nitro default file
mergeConfig: true,
// overrides the default nitro web.config file all together
overrideConfig: false,
},
},
});
```

::
2 changes: 1 addition & 1 deletion docs/content/2.deploy/providers/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Nitro supports deploying on [Render](https://render.com/) with minimal configura

1. Update the start command to `node .output/server/index.mjs`

1. Click 'Advanced' and add an environment variable with `NITRO_PRESET` set to `render_com`.
1. Click 'Advanced' and add an environment variable with `NITRO_PRESET` set to `render_com`. You may also need to add a `NODE_VERSION` environment variable set to `18` for the build to succeed ([docs](https://render.com/docs/node-version)).

1. Click 'Create Web Service'.

Expand Down
29 changes: 28 additions & 1 deletion docs/content/3.config.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,41 @@ routeRules: {

### `prerender`

Default: `{ crawlLinks: false, ignore: [], routes: [] }`
Default:

```ts
{
autoSubfolderIndex: true,
concurrency: 1,
interval: 0,
failOnError: false,
crawlLinks: false,
ignore: [],
routes: []
}
```

Prerendered options. Any route specified will be fetched during the build and copied to the `.output/public` directory as a static asset.

Any route that starts with a prefix listed in `ignore` will be ignored.

If `crawlLinks` option is set to `true`, nitro starts with `/` by default (or all routes in `routes` array) and for HTML pages extracts `<a>` tags and prerender them as well.

You can set `failOnError` option to `true` to stop the CI when an error if Nitro could not prerender a route.

The `interval` and `concurrency` options lets you control the speed of pre-rendering, can be useful to avoid hitting some rate-limit if you call external APIs.

Set `autoSubfolderIndex` lets you control how to generate the files in the `.output/public` directory:

```bash
# autoSubFolderIndex: true (default)
/about -> .output/public/about/index.html
# autoSubFolderIndex: false
/about -> .output/public/about.html
```

This option is useful when your hosting provider does not give you an option regarding the trailing slash.

## Directories

### `rootDir`
Expand Down
10 changes: 7 additions & 3 deletions docs/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export default defineNuxtConfig({
extends: '@nuxt-themes/docus',
modules: ['@nuxtjs/plausible']
})
extends: "@nuxt-themes/docus",
modules: ["@nuxtjs/plausible"],
alias: {
"micromark/lib/preprocess.js": "micromark",
"micromark/lib/postprocess.js": "micromark",
},
});
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"devDependencies": {
"@nuxt-themes/docus": "^1.14.6",
"@nuxtjs/plausible": "^0.2.1",
"nuxt": "3.6.5"
"nuxt": "^3.7.0"
}
}
Loading

0 comments on commit 2d4f1af

Please sign in to comment.