docs(core): remove reference to deno (#21631)
Co-authored-by: Isaac Mann <isaacplmann@gmail.com>
This commit is contained in:
parent
c87884ad6e
commit
7eb83940de
@ -1812,39 +1812,6 @@
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Deno",
|
||||
"path": "/recipes/deno",
|
||||
"id": "deno",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Add a Deno Project",
|
||||
"path": "/recipes/deno/add-deno",
|
||||
"id": "add-deno",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Serverless deployment with Deno Deploy",
|
||||
"path": "/recipes/deno/deno-deploy",
|
||||
"id": "deno-deploy",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Add and Deploy Netlify Edge Functions with Deno",
|
||||
"path": "/recipes/deno/deno-netlify-functions",
|
||||
"id": "deno-netlify-functions",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Next",
|
||||
"path": "/recipes/next",
|
||||
@ -3285,63 +3252,6 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Deno",
|
||||
"path": "/recipes/deno",
|
||||
"id": "deno",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Add a Deno Project",
|
||||
"path": "/recipes/deno/add-deno",
|
||||
"id": "add-deno",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Serverless deployment with Deno Deploy",
|
||||
"path": "/recipes/deno/deno-deploy",
|
||||
"id": "deno-deploy",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Add and Deploy Netlify Edge Functions with Deno",
|
||||
"path": "/recipes/deno/deno-netlify-functions",
|
||||
"id": "deno-netlify-functions",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Add a Deno Project",
|
||||
"path": "/recipes/deno/add-deno",
|
||||
"id": "add-deno",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Serverless deployment with Deno Deploy",
|
||||
"path": "/recipes/deno/deno-deploy",
|
||||
"id": "deno-deploy",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Add and Deploy Netlify Edge Functions with Deno",
|
||||
"path": "/recipes/deno/deno-netlify-functions",
|
||||
"id": "deno-netlify-functions",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Next",
|
||||
"path": "/recipes/next",
|
||||
|
||||
@ -2479,51 +2479,6 @@
|
||||
"path": "/recipes/cypress",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "deno",
|
||||
"name": "Deno",
|
||||
"description": "Deno related recipes",
|
||||
"mediaImage": "",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "add-deno",
|
||||
"name": "Add a Deno Project",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/add-stack/add-deno",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno/add-deno",
|
||||
"tags": ["deno"]
|
||||
},
|
||||
{
|
||||
"id": "deno-deploy",
|
||||
"name": "Serverless deployment with Deno Deploy",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/deployment/deno-deploy",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno/deno-deploy",
|
||||
"tags": ["deployment", "deno"]
|
||||
},
|
||||
{
|
||||
"id": "deno-netlify-functions",
|
||||
"name": "Add and Deploy Netlify Edge Functions with Deno",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/deployment/deno-netlify-edge-functions",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno/deno-netlify-functions",
|
||||
"tags": ["deployment", "deno"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "next",
|
||||
"name": "Next",
|
||||
@ -4497,84 +4452,6 @@
|
||||
"path": "/recipes/cypress/cypress-v11-migration",
|
||||
"tags": []
|
||||
},
|
||||
"/recipes/deno": {
|
||||
"id": "deno",
|
||||
"name": "Deno",
|
||||
"description": "Deno related recipes",
|
||||
"mediaImage": "",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "add-deno",
|
||||
"name": "Add a Deno Project",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/add-stack/add-deno",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno/add-deno",
|
||||
"tags": ["deno"]
|
||||
},
|
||||
{
|
||||
"id": "deno-deploy",
|
||||
"name": "Serverless deployment with Deno Deploy",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/deployment/deno-deploy",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno/deno-deploy",
|
||||
"tags": ["deployment", "deno"]
|
||||
},
|
||||
{
|
||||
"id": "deno-netlify-functions",
|
||||
"name": "Add and Deploy Netlify Edge Functions with Deno",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/deployment/deno-netlify-edge-functions",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno/deno-netlify-functions",
|
||||
"tags": ["deployment", "deno"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno",
|
||||
"tags": []
|
||||
},
|
||||
"/recipes/deno/add-deno": {
|
||||
"id": "add-deno",
|
||||
"name": "Add a Deno Project",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/add-stack/add-deno",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno/add-deno",
|
||||
"tags": ["deno"]
|
||||
},
|
||||
"/recipes/deno/deno-deploy": {
|
||||
"id": "deno-deploy",
|
||||
"name": "Serverless deployment with Deno Deploy",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/deployment/deno-deploy",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno/deno-deploy",
|
||||
"tags": ["deployment", "deno"]
|
||||
},
|
||||
"/recipes/deno/deno-netlify-functions": {
|
||||
"id": "deno-netlify-functions",
|
||||
"name": "Add and Deploy Netlify Edge Functions with Deno",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/deployment/deno-netlify-edge-functions",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/deno/deno-netlify-functions",
|
||||
"tags": ["deployment", "deno"]
|
||||
},
|
||||
"/recipes/next": {
|
||||
"id": "next",
|
||||
"name": "Next",
|
||||
|
||||
@ -775,20 +775,6 @@
|
||||
"id": "node-aws-lambda",
|
||||
"name": "Deploying AWS lambda in Node.js",
|
||||
"path": "/recipes/node/node-aws-lambda"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/deployment/deno-deploy",
|
||||
"id": "deno-deploy",
|
||||
"name": "Serverless deployment with Deno Deploy",
|
||||
"path": "/recipes/deno/deno-deploy"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/deployment/deno-netlify-edge-functions",
|
||||
"id": "deno-netlify-functions",
|
||||
"name": "Add and Deploy Netlify Edge Functions with Deno",
|
||||
"path": "/recipes/deno/deno-netlify-functions"
|
||||
}
|
||||
],
|
||||
"node": [
|
||||
@ -942,29 +928,6 @@
|
||||
"path": "/recipes/storybook/angular-configuring-styles"
|
||||
}
|
||||
],
|
||||
"deno": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/add-stack/add-deno",
|
||||
"id": "add-deno",
|
||||
"name": "Add a Deno Project",
|
||||
"path": "/recipes/deno/add-deno"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/deployment/deno-deploy",
|
||||
"id": "deno-deploy",
|
||||
"name": "Serverless deployment with Deno Deploy",
|
||||
"path": "/recipes/deno/deno-deploy"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/deployment/deno-netlify-edge-functions",
|
||||
"id": "deno-netlify-functions",
|
||||
"name": "Add and Deploy Netlify Edge Functions with Deno",
|
||||
"path": "/recipes/deno/deno-netlify-functions"
|
||||
}
|
||||
],
|
||||
"installation": [
|
||||
{
|
||||
"description": "",
|
||||
|
||||
@ -768,31 +768,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Deno",
|
||||
"id": "deno",
|
||||
"description": "Deno related recipes",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Add a Deno Project",
|
||||
"id": "add-deno",
|
||||
"tags": ["deno"],
|
||||
"file": "shared/recipes/add-stack/add-deno"
|
||||
},
|
||||
{
|
||||
"name": "Serverless deployment with Deno Deploy",
|
||||
"id": "deno-deploy",
|
||||
"tags": ["deployment", "deno"],
|
||||
"file": "shared/recipes/deployment/deno-deploy"
|
||||
},
|
||||
{
|
||||
"name": "Add and Deploy Netlify Edge Functions with Deno",
|
||||
"id": "deno-netlify-functions",
|
||||
"tags": ["deployment", "deno"],
|
||||
"file": "shared/recipes/deployment/deno-netlify-edge-functions"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Next",
|
||||
"id": "next",
|
||||
|
||||
@ -64,7 +64,6 @@ npx create-nx-workspace@latest
|
||||
{% link-card title="Expo" appearance="small" url="/nx-api/expo" icon="expo" /%}
|
||||
{% link-card title="React Native" appearance="small" url="/nx-api/react-native" icon="react" /%}
|
||||
{% link-card title="Fastify" appearance="small" url="/showcase/example-repos/mongo-fastify" icon="fastify" /%}
|
||||
{% link-card title="Deno" appearance="small" url="https://github.com/nrwl/nx-labs/tree/main/api/deno" icon="deno" /%}
|
||||
{% link-card title="Svelte" appearance="small" url="/showcase/example-repos/add-svelte" icon="svelte" /%}
|
||||
{% link-card title="Solid" appearance="small" url="/showcase/example-repos/add-solid" icon="solid" /%}
|
||||
{% link-card title="Lit" appearance="small" url="/showcase/example-repos/add-lit" icon="lit" /%}
|
||||
|
||||
@ -1,98 +0,0 @@
|
||||
# Add a New Deno Project
|
||||
|
||||
**Supported Features**
|
||||
|
||||
Because we are using an Nx plugin for Deno, all the features of Nx are available.
|
||||
|
||||
{% pill url="/features/run-tasks" %}✅ Run Tasks{% /pill %}
|
||||
{% pill url="/features/cache-task-results" %}✅ Cache Task Results{% /pill %}
|
||||
{% pill url="/ci/features/remote-cache" %}✅ Share Your Cache{% /pill %}
|
||||
{% pill url="/features/explore-graph" %}✅ Explore the Graph{% /pill %}
|
||||
{% pill url="/ci/features/distribute-task-execution" %}✅ Distribute Task Execution{% /pill %}
|
||||
{% pill url="/features/integrate-with-editors" %}✅ Integrate with Editors{% /pill %}
|
||||
{% pill url="/features/automate-updating-dependencies" %}✅ Automate Updating Nx{% /pill %}
|
||||
{% pill url="/features/enforce-module-boundaries" %}✅ Enforce Module Boundaries{% /pill %}
|
||||
{% pill url="/features/generate-code" %}✅ Use Code Generators{% /pill %}
|
||||
{% pill url="/features/automate-updating-dependencies" %}✅ Automate Updating Framework Dependencies{% /pill %}
|
||||
|
||||
## Install the Deno Plugin
|
||||
|
||||
{% callout type="warning" title="Have Deno already installed?" %}
|
||||
Make sure you have Deno installed on your machine. Consult the [Deno docs for more details](https://deno.com/manual/getting_started/installation)
|
||||
{% /callout %}
|
||||
|
||||
```shell {% skipRescope=true %}
|
||||
nx add @nx/deno
|
||||
```
|
||||
|
||||
## Create an Application
|
||||
|
||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||
{% /callout %}
|
||||
|
||||
Use the `app` generator to create a new Deno app.
|
||||
|
||||
```shell
|
||||
nx g @nx/deno:app deno-app --directory=apps/deno-app
|
||||
```
|
||||
|
||||
Serve the API by running
|
||||
|
||||
```shell
|
||||
nx serve deno-app
|
||||
```
|
||||
|
||||
This starts the application on localhost:4200 by default.
|
||||
|
||||
## Create a Library
|
||||
|
||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||
{% /callout %}
|
||||
|
||||
To create a new library, run:
|
||||
|
||||
```shell
|
||||
nx g @nx/deno:lib my-lib --directory=libs/my-lib
|
||||
```
|
||||
|
||||
{% callout type="note" title="Deno Library Paths" %}
|
||||
Deno library paths are maintained in the root `import_map.json` file. Because typescript doesn't understand how to parse this file, you may get errors in your code editor that are not problems during `build` or `serve`.
|
||||
{% /callout %}
|
||||
|
||||
Once the library is created, update the following files.
|
||||
|
||||
```typescript {% fileName="libs/my-lib/src/lib/my-lib.ts" %}
|
||||
export function someFunction(): string {
|
||||
return 'some function';
|
||||
}
|
||||
```
|
||||
|
||||
```typescript {% fileName="apps/deno-app/src/handler.ts" %}
|
||||
import { someFunction } from '@my-org/my-lib';
|
||||
|
||||
// deno-lint-ignore require-await
|
||||
export async function handler(_request: Request): Promise<Response> {
|
||||
const message = JSON.stringify({
|
||||
message: 'Hello deno-app ' + someFunction(),
|
||||
});
|
||||
return new Response(message, {
|
||||
status: 200,
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
Now when you serve your app, you'll see the content from the library being displayed.
|
||||
|
||||
## More Documentation
|
||||
|
||||
- [@nx/deno](https://github.com/nrwl/nx-labs/tree/main/packages/deno)
|
||||
- [Deno](https://deno.com)
|
||||
|
||||
{% cards cols="2" %}
|
||||
{% card title="Converting an Express API To Deno" type="video" url="https://youtu.be/Um8xXR54upQ" /%}
|
||||
{% /cards %}
|
||||
@ -1,86 +0,0 @@
|
||||
# Serverless Deployment with Deno Deploy
|
||||
|
||||
In this guide, we'll show you how to deploy serverless functions using [Deno Deploy](https://deno.com/deploy).
|
||||
|
||||
## Prerequisite: A Deno Project
|
||||
|
||||
{% callout type="warning" title="Have Deno already installed?" %}
|
||||
Make sure you have Deno installed on your machine. Consult the [Deno docs for more details](https://deno.com/manual/getting_started/installation)
|
||||
{% /callout %}
|
||||
|
||||
If you don't have a Nx Deno project yet, you can easily create a new one with the following command:
|
||||
|
||||
```shell
|
||||
npx create-nx-workspace@latest denoapp --preset=@nx/deno
|
||||
```
|
||||
|
||||
This creates a single Deno application.
|
||||
|
||||
You can also add a new Deno application to an existing Nx monorepo workspace. Make sure you have the `@nx/deno` package installed:
|
||||
|
||||
```shell {% skipRescope=true %}
|
||||
nx add @nx/deno
|
||||
```
|
||||
|
||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||
{% /callout %}
|
||||
|
||||
Then generate a new Deno app with the following command:
|
||||
|
||||
```shell
|
||||
nx g @nx/deno:app denoapp --directory=apps/denoapp
|
||||
```
|
||||
|
||||
## Configuring Deno Deploy
|
||||
|
||||
First configure your Deno Deploy project:
|
||||
|
||||
1. Push your repository to [GitHub](https://github.com/).
|
||||
2. Go to [Deno dashboard](https://dash.deno.com/) and set up your Deno project. You need to authorize GitHub to allow access to your repositories, then you need to specify the main file (e.g. `src/main.ts`), and the production branch (e.g. `main`).
|
||||
3. Generate an access token from your [account settings page](https://dash.deno.com/account#access-tokens). Copy the new token somewhere.
|
||||
4. Add an entry to the project's `.env` file: `DENO_DEPLOY_TOKEN=<token-from-previous-step>` (create this file if needed, and add it to `.gitignore` so you don't commit it)
|
||||
5. Install the [`deployctl`](https://deno.com/deploy/docs/deployctl) CLI tool.
|
||||
|
||||
`deployctl` is a CLI that allows us to deploy our Deno project. We can embed that into our Nx project by creating a `run-command`. The `@nx/deno` plugin already comes with a `setup-deploy` generator that helps with that. Just run:
|
||||
|
||||
```shell
|
||||
nx g @nx/deno:setup-deploy --platform=deno-deploy
|
||||
```
|
||||
|
||||
This adds a new target to your `project.json`
|
||||
|
||||
```json {% fileName="project.json"}
|
||||
{
|
||||
"name": "denoapp",
|
||||
...
|
||||
"targets": {
|
||||
...
|
||||
"deploy": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"command": "deployctl deploy --project=<Your-Deno-Deploy-Project-Name> --import-map=import_map.json --exclude=node_modules src/main.ts --dry-run"
|
||||
},
|
||||
"configurations": {
|
||||
"preview": {
|
||||
"command": "deployctl deploy --project=<Your-Deno-Deploy-Project-Name> --import-map=import_map.json --exclude=node_modules src/main.ts"
|
||||
},
|
||||
"production": {
|
||||
"command": "deployctl deploy --project=<Your-Deno-Deploy-Project-Name> --import-map=import_map.json --exclude=node_modules --prod src/main.ts"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Deploy
|
||||
|
||||
Once you are done the above steps, you can deploy and view your Deno app using the following command:
|
||||
|
||||
```shell
|
||||
nx deploy
|
||||
```
|
||||
|
||||
You can find the production URL from the [Deno dashboard](https://dash.deno.com/) (e.g. `https://acme-denoapp.deno.dev/`). Browsing to the production URL should return the default JSON message: `{ "message": "Hello denoapp" }`.
|
||||
@ -1,120 +0,0 @@
|
||||
# Add and Deploy Netlify Edge Functions with Deno
|
||||
|
||||
## Prerequisite: A Deno Project
|
||||
|
||||
{% callout type="warning" title="Have Deno already installed?" %}
|
||||
Make sure you have Deno installed on your machine. Consult the [Deno docs for more details](https://deno.com/manual/getting_started/installation)
|
||||
{% /callout %}
|
||||
|
||||
If you don't have a Nx Deno project yet, you can easily create a new one with the following command:
|
||||
|
||||
```shell
|
||||
npx create-nx-workspace@latest denoapp --preset=@nx/deno
|
||||
```
|
||||
|
||||
This creates a single Deno application.
|
||||
|
||||
You can also add a new Deno application to an existing Nx monorepo workspace. Make sure you have the `@nx/deno` package installed:
|
||||
|
||||
```shell {% skipRescope=true %}
|
||||
nx add @nx/deno
|
||||
```
|
||||
|
||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||
{% /callout %}
|
||||
|
||||
Then generate a new Deno app with the following command:
|
||||
|
||||
```shell
|
||||
nx g @nx/deno:app denoapp --directory=apps/denoapp
|
||||
```
|
||||
|
||||
## Adding a Netlify Serverless Function
|
||||
|
||||
To add serverless support to the Deno project, run the `setup-serverless` generator. Pass `--netlify` to the `platform` argument to set it up for Netlify deployment.
|
||||
|
||||
```shell
|
||||
nx g @nx/deno:setup-serverless --platform=netlify
|
||||
```
|
||||
|
||||
This will add a `netlify.toml` file and install the `netlify-cli` package. In addition it also creates a `functions` directory:
|
||||
|
||||
```
|
||||
└─ denoapp
|
||||
├─ ...
|
||||
├─ functions
|
||||
│ └─ hello-geo.ts
|
||||
├─ src
|
||||
│ ├─ ...
|
||||
├─ ...
|
||||
├─ netlify.toml
|
||||
├─ nx.json
|
||||
├─ project.json
|
||||
└─ package.json
|
||||
```
|
||||
|
||||
The generator updates the `project.json` of your Deno project and adds a new `serve-functions` target that delegates the local serving of the function to the Netlify CLI:
|
||||
|
||||
```json {% fileName="project.json" %}
|
||||
{
|
||||
"targets": {
|
||||
...
|
||||
"serve-functions": {
|
||||
"command": "npx netlify dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Just run `nx serve-functions` to start the local server.
|
||||
|
||||
## Configure Your Netlify Deploy Settings
|
||||
|
||||
Make sure you have a site configured on Netlify (skip if you have already). You have mostly two options:
|
||||
|
||||
- either go to [app.netlify.com](https://app.netlify.com) and create a new site
|
||||
- use the Netlify CLI and run `npx netlify deploy` which will walk you through the process
|
||||
|
||||
If you run `npx netlify deploy` in the workspace, the site ID will be automatically saved in the `.netlify/state.json` file. Alternatively adjust the `deploy-functions` in your `project.json` to include the `--site` flag:
|
||||
|
||||
```json {% fileName="project.json" %}
|
||||
{
|
||||
"targets": {
|
||||
...
|
||||
"deploy-functions": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"command": "npx netlify deploy"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"command": "npx netlify deploy --prod"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Deploying to Netlify
|
||||
|
||||
To deploy them to Netlify, run:
|
||||
|
||||
```shell
|
||||
nx deploy-functions
|
||||
```
|
||||
|
||||
This creates a "draft deployment" to a temporary URL. If you want to do a production deployment, pass the `--prod` flag:
|
||||
|
||||
```shell
|
||||
nx deploy-functions --prod
|
||||
```
|
||||
|
||||
This invokes the "production" configuration of the `deploy-functions` target and passes the `--prod` flag to the Netlify CLI.
|
||||
|
||||
{% callout type="info" title="Configure your CI for automated deployments" %}
|
||||
|
||||
Note that for a more stable and automated setup you might want to configure your CI to automatically deploy your functions.
|
||||
|
||||
{% /callout %}
|
||||
@ -39,7 +39,6 @@ All other packages keep the same name, but change scope from `@nrwl` to `@nx`.
|
||||
| @nrwl/angular | @nx/angular |
|
||||
| @nrwl/aws-lambda | @nx/aws-lambda |
|
||||
| @nrwl/cypress | @nx/cypress |
|
||||
| @nrwl/deno | @nx/deno |
|
||||
| @nrwl/detox | @nx/detox |
|
||||
| @nrwl/devkit | @nx/devkit |
|
||||
| @nrwl/esbuild | @nx/esbuild |
|
||||
|
||||
@ -120,10 +120,6 @@
|
||||
- [Cypress](/recipes/cypress)
|
||||
- [Component Testing](/recipes/cypress/cypress-component-testing)
|
||||
- [Cypress v11 Migration Guide](/recipes/cypress/cypress-v11-migration)
|
||||
- [Deno](/recipes/deno)
|
||||
- [Add a Deno Project](/recipes/deno/add-deno)
|
||||
- [Serverless deployment with Deno Deploy](/recipes/deno/deno-deploy)
|
||||
- [Add and Deploy Netlify Edge Functions with Deno](/recipes/deno/deno-netlify-functions)
|
||||
- [Next](/recipes/next)
|
||||
- [How to configure Next.js plugins](/recipes/next/next-config-setup)
|
||||
- [Nuxt](/recipes/nuxt)
|
||||
|
||||
@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('nx-dev: Recipes pages', () => {
|
||||
test('should list related recipes based on tags', async ({ page }) => {
|
||||
await page.goto('/recipes/other/deno-deploy');
|
||||
await page.goto('/recipes/storybook/overview-react');
|
||||
const relatedDocs = page.locator('[data-document="related"] li');
|
||||
const relatedDocsText = await relatedDocs.allInnerTexts();
|
||||
expect(relatedDocsText.length, 'has related docs').toBeGreaterThan(0);
|
||||
|
||||
@ -359,9 +359,6 @@ const recipesUrls = {
|
||||
'/recipes/other/dte': '/showcase/example-repos/dte',
|
||||
'/recipes/other/deploy-nextjs-to-vercel':
|
||||
'/recipes/deployment/deploy-nextjs-to-vercel',
|
||||
'/recipes/other/deno-deploy': '/recipes/deno/deno-deploy',
|
||||
'/recipes/other/deno-netlify-functions':
|
||||
'/recipes/deno/deno-netlify-functions',
|
||||
'/recipes/other/root-level-scripts':
|
||||
'/recipes/managing-repository/root-level-scripts',
|
||||
'/recipes/other/analyze-source-files':
|
||||
@ -944,11 +941,6 @@ const latestRecipesRefactoring = {
|
||||
'/recipes/tips-n-tricks/run-commands-executor',
|
||||
// ci
|
||||
'/recipes/ci/azure-last-successful-commit': '/recipes/ci/monorepo-ci-azure',
|
||||
// other
|
||||
'/recipes/deployment/deno-deploy': '/recipes/other/deno-deploy',
|
||||
'/recipes/deployment/deno-netlify-functions':
|
||||
'/recipes/other/deno-netlify-functions',
|
||||
|
||||
// nx concepts
|
||||
'/recipes/module-federation/faster-builds':
|
||||
'/concepts/more-concepts/faster-builds-with-module-federation',
|
||||
|
||||
@ -880,20 +880,6 @@ export const frameworkIcons: Record<
|
||||
</svg>
|
||||
),
|
||||
},
|
||||
deno: {
|
||||
image: (
|
||||
<svg
|
||||
className="adaptive-icon w-full h-full"
|
||||
fill="#000000"
|
||||
role="img"
|
||||
viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<title>Deno</title>
|
||||
<path d="M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0Zm-.469 6.793c-3.49 0-6.204 2.196-6.204 4.928 0 2.58 2.498 4.228 6.37 4.145l.118-.003.425-.012-.109.279.013.029c.031.072.06.145.084.22l.01.028.015.045.021.065.014.045.014.047.015.049.021.075.022.079.015.054.023.084.022.088.023.091.023.095.015.065.024.1.023.103.032.143.017.074.024.114.024.117.025.12.035.174.029.142.037.195.02.1.028.155.03.158.039.217.04.225.04.231.041.24.042.246.042.254.042.26.032.201.055.344.022.14.055.36.045.295.034.227.046.308.023.156a10.758 10.758 0 0 0 6.529-3.412l.05-.055-.238-.891-.633-2.37-.395-1.47-.348-1.296-.213-.787-.136-.498-.081-.297-.073-.264-.032-.11-.018-.064-.01-.034-.008-.026a6.042 6.042 0 0 0-2.038-2.97c-1.134-.887-2.573-1.351-4.252-1.351ZM8.467 19.3a.586.586 0 0 0-.714.4l-.004.013-.527 1.953c.328.163.665.309 1.008.437l.08.03.57-2.114.004-.015a.586.586 0 0 0-.417-.704Zm3.264-1.43a.586.586 0 0 0-.715.4l-.004.014-.796 2.953-.004.014a.586.586 0 0 0 1.131.305l.004-.014.797-2.953.003-.014a.585.585 0 0 0 .013-.067l.002-.022-.019-.096-.027-.138-.018-.086a.584.584 0 0 0-.367-.295Zm-5.553-3.04a.59.59 0 0 0-.037.09l-.005.02-.797 2.953-.004.014a.586.586 0 0 0 1.131.306l.004-.014.723-2.678a5.295 5.295 0 0 1-1.015-.692Zm-1.9-3.397a.586.586 0 0 0-.715.4l-.004.013-.797 2.953-.003.015a.586.586 0 0 0 1.13.305l.005-.014.797-2.953.003-.015a.586.586 0 0 0-.416-.704Zm17.868-.67a.586.586 0 0 0-.715.399l-.004.014-.797 2.953-.003.014a.586.586 0 0 0 1.13.305l.005-.014.797-2.953.003-.014a.586.586 0 0 0-.416-.704ZM2.542 6.82a10.707 10.707 0 0 0-1.251 3.926.586.586 0 0 0 1.002-.22l.004-.014.797-2.953.003-.014a.586.586 0 0 0-.555-.725Zm17.585.02a.586.586 0 0 0-.714.4l-.004.014-.797 2.953-.004.014a.586.586 0 0 0 1.131.305l.004-.014.797-2.953.004-.014a.586.586 0 0 0-.417-.704Zm-7.846 1.926a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5Zm-6.27-4.733a.586.586 0 0 0-.715.398l-.004.015-.797 2.953-.004.014a.586.586 0 0 0 1.132.305l.003-.014.797-2.953.004-.014a.586.586 0 0 0-.417-.704Zm10.238.558a.586.586 0 0 0-.714.399l-.004.014-.536 1.984c.347.171.678.373.99.603l.051.038.626-2.32.004-.014a.586.586 0 0 0-.417-.704Zm-5.211-3.33c-.374.033-.746.086-1.115.158l-.078.015-.742 2.753-.004.015a.586.586 0 0 0 1.131.305l.004-.014.797-2.953.004-.015a.583.583 0 0 0 .003-.264Zm7.332 2.04-.156.58-.004.015a.586.586 0 0 0 1.131.305l.004-.014.017-.063a10.838 10.838 0 0 0-.923-.772l-.069-.051Zm-4.636-1.944-.283 1.048-.003.014a.586.586 0 0 0 1.13.305l.005-.014.297-1.102c-.35-.097-.705-.176-1.063-.237l-.083-.014Z" />
|
||||
</svg>
|
||||
),
|
||||
},
|
||||
playwright: {
|
||||
image: (
|
||||
<svg
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user