Skip to content

Commit

Permalink
docs: prefer snake_case for preset names (#1499)
Browse files Browse the repository at this point in the history
Co-authored-by: Pooya Parsa <pooya@pi0.io>
  • Loading branch information
marshallswain and pi0 authored Aug 6, 2023
1 parent ad5f353 commit 309c000
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions docs/content/2.deploy/0.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When running Nitro in development mode, Nitro will always use a special preset c
When deploying to the production using CI/CD, Nitro tries to automatically detect the provider environment and set the right one without any additional configuration. Currently, providers below can be auto-detected with zero config.

- [azure](/deploy/providers/azure)
- [cloudflare_pages](/deploy/providers/cloudflare#cloudflare-pages)
- [cloudflare pages](/deploy/providers/cloudflare#cloudflare-pages)
- [netlify](/deploy/providers/netlify)
- [stormkit](/deploy/providers/stormkit)
- [vercel](/deploy/providers/vercel)
Expand All @@ -32,7 +32,7 @@ If you need to build Nitro against a specific provider, you can override it usin

**Example:** Using `NITRO_PRESET`
```bash
NITRO_PRESET=aws-lambda nitro build
NITRO_PRESET=aws_lambda nitro build
```

**Example:** Using [nitro.config.ts](/guide/configuration)
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.deploy/providers/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Deploy Nitro apps to AWS Lambda.

**Preset:** `aws-lambda` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `aws_lambda` ([switch to this preset](/deploy/#changing-the-deployment-preset))

Nitro provides a built-in preset to generate output format compatible with [AWS Lambda](https://aws.amazon.com/lambda/).

Expand Down
6 changes: 3 additions & 3 deletions docs/content/2.deploy/providers/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ If you are using runtimeConfig, you will likely want to configure the correspond

## Azure Functions

**Preset:** `azure-functions`
**Preset:** `azure_functions`

**Note:** If you encounter any issues, please ensure you're using a Node.js 14+ runtime. You can find more information about [how to set the Node version in the Azure docs](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=v2#setting-the-node-version).

Expand All @@ -66,7 +66,7 @@ Install [Azure Functions Core Tools](https://docs.microsoft.com/en-us/azure/azur
You can invoke a development environment from the serverless directory.

```bash
NITRO_PRESET=azure-functions yarn build
NITRO_PRESET=azure_functions yarn build
cd .output
func start
```
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
- name: Build
run: npm run build
env:
NITRO_PRESET: azure-functions
NITRO_PRESET: azure_functions

- name: 'Deploy to Azure Functions'
uses: Azure/functions-action@v1
Expand Down
4 changes: 2 additions & 2 deletions docs/content/2.deploy/providers/cloudflare.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
## Cloudflare Pages
**Preset:** `cloudflare-pages` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `cloudflare_pages` ([switch to this preset](/deploy/#changing-the-deployment-preset))

::alert{type="warning"}
**Note:** This is an experimental preset.
Expand Down Expand Up @@ -175,7 +175,7 @@ wrangler pages deploy

## Cloudflare Module Workers

**Preset:** `cloudflare-module` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `cloudflare_module` ([switch to this preset](/deploy/#changing-the-deployment-preset))

::alert{type="warning"}
**Note:** This is an experimental preset.
Expand Down
10 changes: 5 additions & 5 deletions docs/content/2.deploy/providers/deno.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Deploy Nitro apps to [Deno Deploy](https://deno.com/deploy).

## Deno Deploy

**Preset:** `deno-deploy` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `deno_deploy` ([switch to this preset](/deploy/#changing-the-deployment-preset))

::alert{type="warning"}
Deno deploy preset is experimental.
Expand All @@ -17,8 +17,8 @@ You can use [deployctl](https://deno.com/deploy/docs/deployctl) to deploy your a
Login to [Deno Deploy](https://dash.deno.com/account#access-tokens) to obtain a `DENO_DEPLOY_TOKEN` access token, and set it as an environment variable.

```bash
# Build with the deno-deploy NITRO preset
NITRO_PRESET=deno-deploy npm run build
# Build with the deno_deploy NITRO preset
NITRO_PRESET=deno_deploy npm run build

# Make sure to run the deployctl command from the output directory
cd .output
Expand All @@ -31,7 +31,7 @@ You just need to include the deployctl GitHub Action as a step in your workflow.

You do not need to set up any secrets for this to work. You do need to link your GitHub repository to your Deno Deploy project and choose the "GitHub Actions" deployment mode. You can do this in your project settings on https://dash.deno.com.

Create `.github/workflows/deno-deploy.yml`:
Create `.github/workflows/deno_deploy.yml`:

```yaml
name: deno-deploy
Expand All @@ -56,7 +56,7 @@ jobs:
- run: pnpm install
- run: pnpm build
env:
NITRO_PRESET: deno-deploy
NITRO_PRESET: deno_deploy
- name: Deploy to Deno Deploy
uses: denoland/deployctl@v1
with:
Expand Down
10 changes: 5 additions & 5 deletions docs/content/2.deploy/providers/github-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Deploy Nitro apps to GitHub Pages.

**Preset:** `github-pages` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `github_pages` ([switch to this preset](/deploy/#changing-the-deployment-preset))

Nitro supports deploying on [GitHub Pages](https://pages.github.com/) with minimal configuration.

Expand All @@ -12,7 +12,7 @@ Follow the steps to [create a GitHub Pages site](https://docs.github.com/en/page

## Deployment

Here is an example GitHub Actions workflow to deploy your site to GitHub Pages using the `github-pages` preset:
Here is an example GitHub Actions workflow to deploy your site to GitHub Pages using the `github_pages` preset:

```yaml
# https://github.com/actions/deploy-pages#usage
Expand All @@ -38,7 +38,7 @@ jobs:
- run: npm install
- run: npm run build
env:
NITRO_PRESET: github-pages
NITRO_PRESET: github_pages

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
Expand All @@ -55,9 +55,9 @@ jobs:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
# Deploy to the github_pages environment
environment:
name: github-pages
name: github_pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.deploy/providers/iis.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is an experimental preset.

## Using [IISnode](https://github.com/Azure/iisnode) (recommended)

**Preset:** `iis-node` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `iis_node` ([switch to this preset](/deploy/#changing-the-deployment-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`.
Expand Down
4 changes: 2 additions & 2 deletions docs/content/2.deploy/providers/netlify.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ For deployment, just push to your git repository [as you would normally do for N

## Netlify Edge Functions

**Preset:** `netlify-edge` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `netlify_edge` ([switch to this preset](/deploy/#changing-the-deployment-preset))

Netlify Edge Functions use Deno and the powerful V8 JavaScript runtime to let you run globally distributed functions for the fastest possible response times. ([Read More](https://www.netlify.com/blog/announcing-serverless-compute-with-edge-functions))

Nitro output can directly run the server at the edge. Closer to your users.

## On-demand Builders

**Preset:** `netlify-builder` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `netlify_builder` ([switch to this preset](/deploy/#changing-the-deployment-preset))

On-demand Builders are serverless functions used to generate web content as needed that’s automatically cached on Netlify’s Edge CDN. They enable you to build pages for your site when a user visits them for the first time and then cache them at the edge for subsequent visits. ([Read More](https://docs.netlify.com/configure-builds/on-demand-builders/))

6 changes: 3 additions & 3 deletions docs/content/2.deploy/providers/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Deploy Nitro apps to Render.

**Preset:** `render-com` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `render_com` ([switch to this preset](/deploy/#changing-the-deployment-preset))

Nitro supports deploying on [Render](https://render.com/) with minimal configuration.

Expand All @@ -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`.

1. Click 'Create Web Service'.

Expand All @@ -35,7 +35,7 @@ services:
buildCommand: npm install && npm run build
envVars:
- key: NITRO_PRESET
value: render-com
value: render_com
```
2. [Create a new Blueprint Instance](https://dashboard.render.com/select-repo?type=blueprint) and select the repository containing your `render.yaml` file.

Expand Down
4 changes: 2 additions & 2 deletions docs/content/2.deploy/providers/vercel.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Learn more about Vercel’s [Git Integration](https://vercel.com/docs/concepts/g

## Vercel Edge Functions

**Preset:** `vercel-edge` ([switch to this preset](/deploy/#changing-the-deployment-preset))
**Preset:** `vercel_edge` ([switch to this preset](/deploy/#changing-the-deployment-preset))

It is possible to deploy your nitro applications directly on [Vercel Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions).

Expand All @@ -33,7 +33,7 @@ It is possible to deploy your nitro applications directly on [Vercel Edge Functi
> By taking advantage of this small runtime, Edge Functions can have faster cold boots and higher scalability than Serverless Functions.
> Edge Functions run after the cache, and can both cache and return responses. [Read More](https://vercel.com/docs/concepts/functions/edge-functions)
In order to enable this target, please set `NITRO_PRESET` environment variable to `vercel-edge`.
In order to enable this target, please set `NITRO_PRESET` environment variable to `vercel_edge`.

## Vercel KV Storage

Expand Down

0 comments on commit 309c000

Please sign in to comment.