docs(node): change Node Tutorial to Node Server Tutorial (#15180)

This commit is contained in:
Nicholas Cunningham 2023-02-23 10:59:22 -07:00 committed by GitHub
parent bde61d89dc
commit 6d499047dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 156 additions and 128 deletions

View File

@ -49,9 +49,9 @@
"disableCollapsible": false
},
{
"name": "Node Tutorial",
"path": "/getting-started/node-tutorial",
"id": "node-tutorial",
"name": "Node Server Tutorial",
"path": "/getting-started/node-server-tutorial",
"id": "node-server-tutorial",
"isExternal": false,
"children": [],
"disableCollapsible": false
@ -100,9 +100,9 @@
"disableCollapsible": false
},
{
"name": "Node Tutorial",
"path": "/getting-started/node-tutorial",
"id": "node-tutorial",
"name": "Node Server Tutorial",
"path": "/getting-started/node-server-tutorial",
"id": "node-server-tutorial",
"isExternal": false,
"children": [],
"disableCollapsible": false
@ -569,14 +569,14 @@
"disableCollapsible": false
},
{
"name": "Node Tutorial",
"path": "/node-tutorial",
"id": "node-tutorial",
"name": "Node Server Tutorial",
"path": "/node-server-tutorial",
"id": "node-server-tutorial",
"isExternal": false,
"children": [
{
"name": "1 - Code Generation",
"path": "/node-tutorial/1-code-generation",
"path": "/node-server-tutorial/1-code-generation",
"id": "1-code-generation",
"isExternal": false,
"children": [],
@ -584,7 +584,7 @@
},
{
"name": "2 - Project Graph",
"path": "/node-tutorial/2-project-graph",
"path": "/node-server-tutorial/2-project-graph",
"id": "2-project-graph",
"isExternal": false,
"children": [],
@ -592,7 +592,7 @@
},
{
"name": "3 - Task Running",
"path": "/node-tutorial/3-task-running",
"path": "/node-server-tutorial/3-task-running",
"id": "3-task-running",
"isExternal": false,
"children": [],
@ -600,7 +600,7 @@
},
{
"name": "4 - Task Pipelines",
"path": "/node-tutorial/4-task-pipelines",
"path": "/node-server-tutorial/4-task-pipelines",
"id": "4-task-pipelines",
"isExternal": false,
"children": [],
@ -608,7 +608,7 @@
},
{
"name": "5 - Docker Target",
"path": "/node-tutorial/5-docker-target",
"path": "/node-server-tutorial/5-docker-target",
"id": "5-docker-target",
"isExternal": false,
"children": [],
@ -616,7 +616,7 @@
},
{
"name": "6 - Summary",
"path": "/node-tutorial/6-summary",
"path": "/node-server-tutorial/6-summary",
"id": "6-summary",
"isExternal": false,
"children": [],
@ -627,7 +627,7 @@
},
{
"name": "1 - Code Generation",
"path": "/node-tutorial/1-code-generation",
"path": "/node-server-tutorial/1-code-generation",
"id": "1-code-generation",
"isExternal": false,
"children": [],
@ -635,7 +635,7 @@
},
{
"name": "2 - Project Graph",
"path": "/node-tutorial/2-project-graph",
"path": "/node-server-tutorial/2-project-graph",
"id": "2-project-graph",
"isExternal": false,
"children": [],
@ -643,7 +643,7 @@
},
{
"name": "3 - Task Running",
"path": "/node-tutorial/3-task-running",
"path": "/node-server-tutorial/3-task-running",
"id": "3-task-running",
"isExternal": false,
"children": [],
@ -651,7 +651,7 @@
},
{
"name": "4 - Task Pipelines",
"path": "/node-tutorial/4-task-pipelines",
"path": "/node-server-tutorial/4-task-pipelines",
"id": "4-task-pipelines",
"isExternal": false,
"children": [],
@ -659,7 +659,7 @@
},
{
"name": "5 - Docker Target",
"path": "/node-tutorial/5-docker-target",
"path": "/node-server-tutorial/5-docker-target",
"id": "5-docker-target",
"isExternal": false,
"children": [],
@ -667,7 +667,7 @@
},
{
"name": "6 - Summary",
"path": "/node-tutorial/6-summary",
"path": "/node-server-tutorial/6-summary",
"id": "6-summary",
"isExternal": false,
"children": [],

View File

@ -56,13 +56,13 @@
"tags": []
},
{
"id": "node-tutorial",
"name": "Node Tutorial",
"id": "node-server-tutorial",
"name": "Node Server Tutorial",
"description": "",
"file": "shared/node-tutorial/1-code-generation",
"file": "shared/node-server-tutorial/1-code-generation",
"itemList": [],
"isExternal": false,
"path": "/getting-started/node-tutorial",
"path": "/getting-started/node-server-tutorial",
"tags": []
}
],
@ -120,14 +120,14 @@
"path": "/getting-started/angular-standalone-tutorial",
"tags": []
},
"/getting-started/node-tutorial": {
"id": "node-tutorial",
"name": "Node Tutorial",
"/getting-started/node-server-tutorial": {
"id": "node-server-tutorial",
"name": "Node Server Tutorial",
"description": "",
"file": "shared/node-tutorial/1-code-generation",
"file": "shared/node-server-tutorial/1-code-generation",
"itemList": [],
"isExternal": false,
"path": "/getting-started/node-tutorial",
"path": "/getting-started/node-server-tutorial",
"tags": []
},
"/core-tutorial": {
@ -705,135 +705,135 @@
"path": "/angular-standalone-tutorial/5-summary",
"tags": []
},
"/node-tutorial": {
"id": "node-tutorial",
"name": "Node Tutorial",
"description": "Learn to use Nx with this Node tutorial where you will learn about all its main feature with a real project.",
"/node-server-tutorial": {
"id": "node-server-tutorial",
"name": "Node Server Tutorial",
"description": "Learn to use Nx with this Node Server Tutorial where you will learn about all its main feature with a real project.",
"file": "",
"itemList": [
{
"id": "1-code-generation",
"name": "1 - Code Generation",
"description": "",
"file": "shared/node-tutorial/1-code-generation",
"file": "shared/node-server-tutorial/1-code-generation",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/1-code-generation",
"path": "/node-server-tutorial/1-code-generation",
"tags": []
},
{
"id": "2-project-graph",
"name": "2 - Project Graph",
"description": "",
"file": "shared/node-tutorial/2-project-graph",
"file": "shared/node-server-tutorial/2-project-graph",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/2-project-graph",
"path": "/node-server-tutorial/2-project-graph",
"tags": []
},
{
"id": "3-task-running",
"name": "3 - Task Running",
"description": "",
"file": "shared/node-tutorial/3-task-running",
"file": "shared/node-server-tutorial/3-task-running",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/3-task-running",
"path": "/node-server-tutorial/3-task-running",
"tags": []
},
{
"id": "4-task-pipelines",
"name": "4 - Task Pipelines",
"description": "",
"file": "shared/node-tutorial/4-task-pipelines",
"file": "shared/node-server-tutorial/4-task-pipelines",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/4-task-pipelines",
"path": "/node-server-tutorial/4-task-pipelines",
"tags": []
},
{
"id": "5-docker-target",
"name": "5 - Docker Target",
"description": "",
"file": "shared/node-tutorial/5-docker-target",
"file": "shared/node-server-tutorial/5-docker-target",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/5-docker-target",
"path": "/node-server-tutorial/5-docker-target",
"tags": []
},
{
"id": "6-summary",
"name": "6 - Summary",
"description": "",
"file": "shared/node-tutorial/6-summary",
"file": "shared/node-server-tutorial/6-summary",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/6-summary",
"path": "/node-server-tutorial/6-summary",
"tags": []
}
],
"isExternal": false,
"path": "/node-tutorial",
"path": "/node-server-tutorial",
"tags": []
},
"/node-tutorial/1-code-generation": {
"/node-server-tutorial/1-code-generation": {
"id": "1-code-generation",
"name": "1 - Code Generation",
"description": "",
"file": "shared/node-tutorial/1-code-generation",
"file": "shared/node-server-tutorial/1-code-generation",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/1-code-generation",
"path": "/node-server-tutorial/1-code-generation",
"tags": []
},
"/node-tutorial/2-project-graph": {
"/node-server-tutorial/2-project-graph": {
"id": "2-project-graph",
"name": "2 - Project Graph",
"description": "",
"file": "shared/node-tutorial/2-project-graph",
"file": "shared/node-server-tutorial/2-project-graph",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/2-project-graph",
"path": "/node-server-tutorial/2-project-graph",
"tags": []
},
"/node-tutorial/3-task-running": {
"/node-server-tutorial/3-task-running": {
"id": "3-task-running",
"name": "3 - Task Running",
"description": "",
"file": "shared/node-tutorial/3-task-running",
"file": "shared/node-server-tutorial/3-task-running",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/3-task-running",
"path": "/node-server-tutorial/3-task-running",
"tags": []
},
"/node-tutorial/4-task-pipelines": {
"/node-server-tutorial/4-task-pipelines": {
"id": "4-task-pipelines",
"name": "4 - Task Pipelines",
"description": "",
"file": "shared/node-tutorial/4-task-pipelines",
"file": "shared/node-server-tutorial/4-task-pipelines",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/4-task-pipelines",
"path": "/node-server-tutorial/4-task-pipelines",
"tags": []
},
"/node-tutorial/5-docker-target": {
"/node-server-tutorial/5-docker-target": {
"id": "5-docker-target",
"name": "5 - Docker Target",
"description": "",
"file": "shared/node-tutorial/5-docker-target",
"file": "shared/node-server-tutorial/5-docker-target",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/5-docker-target",
"path": "/node-server-tutorial/5-docker-target",
"tags": []
},
"/node-tutorial/6-summary": {
"/node-server-tutorial/6-summary": {
"id": "6-summary",
"name": "6 - Summary",
"description": "",
"file": "shared/node-tutorial/6-summary",
"file": "shared/node-server-tutorial/6-summary",
"itemList": [],
"isExternal": false,
"path": "/node-tutorial/6-summary",
"path": "/node-server-tutorial/6-summary",
"tags": []
},
"/core-features": {

View File

@ -39,9 +39,9 @@
"file": "shared/angular-standalone-tutorial/1-code-generation"
},
{
"name": "Node Tutorial",
"id": "node-tutorial",
"file": "shared/node-tutorial/1-code-generation"
"name": "Node Server Tutorial",
"id": "node-server-tutorial",
"file": "shared/node-server-tutorial/1-code-generation"
}
]
},
@ -211,39 +211,39 @@
]
},
{
"name": "Node Tutorial",
"id": "node-tutorial",
"description": "Learn to use Nx with this Node tutorial where you will learn about all its main feature with a real project.",
"name": "Node Server Tutorial",
"id": "node-server-tutorial",
"description": "Learn to use Nx with this Node Server Tutorial where you will learn about all its main feature with a real project.",
"itemList": [
{
"name": "1 - Code Generation",
"id": "1-code-generation",
"file": "shared/node-tutorial/1-code-generation"
"file": "shared/node-server-tutorial/1-code-generation"
},
{
"name": "2 - Project Graph",
"id": "2-project-graph",
"file": "shared/node-tutorial/2-project-graph"
"file": "shared/node-server-tutorial/2-project-graph"
},
{
"name": "3 - Task Running",
"id": "3-task-running",
"file": "shared/node-tutorial/3-task-running"
"file": "shared/node-server-tutorial/3-task-running"
},
{
"name": "4 - Task Pipelines",
"id": "4-task-pipelines",
"file": "shared/node-tutorial/4-task-pipelines"
"file": "shared/node-server-tutorial/4-task-pipelines"
},
{
"name": "5 - Docker Target",
"id": "5-docker-target",
"file": "shared/node-tutorial/5-docker-target"
"file": "shared/node-server-tutorial/5-docker-target"
},
{
"name": "6 - Summary",
"id": "6-summary",
"file": "shared/node-tutorial/6-summary"
"file": "shared/node-server-tutorial/6-summary"
}
]
},

View File

@ -3,7 +3,7 @@
In this tutorial you create multiple projects in a monorepo and take advantage of the core Nx features with a minimum of configuration.
{% callout type="check" title="Package-Based Repo" %}
This tutorial sets up a [package-based repo](/concepts/integrated-vs-package-based). If you prefer an [integrated repo](/concepts/integrated-vs-package-based), check out the [React](/react-tutorial/1-code-generation), [Angular](/angular-tutorial/1-code-generation) or [Node](/getting-started/node-tutorial) tutorials.
This tutorial sets up a [package-based repo](/concepts/integrated-vs-package-based). If you prefer an [integrated repo](/concepts/integrated-vs-package-based), check out the [React](/react-tutorial/1-code-generation), [Angular](/angular-tutorial/1-code-generation) or [Node](/getting-started/node-server-tutorial) tutorials.
{% /callout %}
## Contents:

View File

@ -38,11 +38,11 @@ A modern Angular development experience powered by advanced generators and integ
{% /persona %}
{% persona type="node" title="Create a Standalone Node server" url="/getting-started/node-tutorial" %}
{% persona type="node" title="Create a Standalone Node server" url="/getting-started/node-server-tutorial" %}
A modern Node server with scaffolding for Express, Fastify or Koa. There's also Docker support built-in.
- [Create a Standalone Node server](/getting-started/node-tutorial)
- [Create a Standalone Node server](/getting-started/node-server-tutorial)
{% /persona %}

View File

@ -27101,51 +27101,51 @@
"hash": "c0ef1939d0ec60f2d32066ba8b68a24e695a9ae3"
},
{
"file": "docs/shared/node-tutorial/1-code-generation.md",
"file": "docs/shared/node-server-tutorial/1-code-generation.md",
"hash": "1e221ddc9e89c016158e653d5da711fcebc37c0c"
},
{
"file": "docs/shared/node-tutorial/2-project-graph.md",
"file": "docs/shared/node-server-tutorial/2-project-graph.md",
"hash": "c860c388bcdddd48246a4ec3bdcec4ca69dc6a07"
},
{
"file": "docs/shared/node-tutorial/3-task-running.md",
"file": "docs/shared/node-server-tutorial/3-task-running.md",
"hash": "0e94c244aa4e8e1eaa05afbedf3a2e3d9d8f4de8"
},
{
"file": "docs/shared/node-tutorial/4-workspace-optimization.md",
"file": "docs/shared/node-server-tutorial/4-workspace-optimization.md",
"hash": "94878c75367aa1adb3bf63243acdd9d37e3f0646"
},
{
"file": "docs/shared/node-tutorial/5-summary.md",
"file": "docs/shared/node-server-tutorial/5-summary.md",
"hash": "0bf6b83aef3bfdbdb96642a0e445c6e06848ee7f"
},
{
"file": "docs/shared/node-tutorial/generator-syntax.svg",
"file": "docs/shared/node-server-tutorial/generator-syntax.svg",
"hash": "f0dadf08e354178f8fbe41d750e96d1ea45afb54"
},
{
"file": "docs/shared/node-tutorial/initial-project-graph.png",
"file": "docs/shared/node-server-tutorial/initial-project-graph.png",
"hash": "2b6869b29c87fe4ca531915fc6d1f7edb2136dcd"
},
{
"file": "docs/shared/node-tutorial/matching-graph.png",
"file": "docs/shared/node-server-tutorial/matching-graph.png",
"hash": "f4b8d2dd0abb027be858ed80d89eb950e7b80a3b"
},
{
"file": "docs/shared/node-tutorial/project-graph-with-all-affected.png",
"file": "docs/shared/node-server-tutorial/project-graph-with-all-affected.png",
"hash": "4563ebddbbbda7cff979284dc89bb26f3e00ce58"
},
{
"file": "docs/shared/node-tutorial/project-graph-with-one-affected.png",
"file": "docs/shared/node-server-tutorial/project-graph-with-one-affected.png",
"hash": "dbd2dd8c86a488d7bc1471052fcc1255ab736731"
},
{
"file": "docs/shared/node-tutorial/requirements-diagram.svg",
"file": "docs/shared/node-server-tutorial/requirements-diagram.svg",
"hash": "d010f3bfb640ce86ce50b5f33a5bcc30ce39a50f"
},
{
"file": "docs/shared/node-tutorial/run-target-syntax.svg",
"file": "docs/shared/node-server-tutorial/run-target-syntax.svg",
"hash": "305f6316121588423a2000b08d3b133927125604"
},
{

View File

@ -1,5 +1,5 @@
---
title: 'Node Standalone Tutorial - Part 1: Code Generation'
title: 'Node Server Tutorial - Part 1: Code Generation'
description: In this tutorial you'll create a backend-focused workspace with Nx.
---
@ -9,18 +9,18 @@ There are two styles of repos: integrated and package-based. This tutorial shows
You can find more information on the difference between the two in [our introduction](/getting-started/intro).
{% /callout %}
# Node Tutorial - Part 1: Code Generation
# Node Server Tutorial - Part 1: Code Generation
In this tutorial you'll create a backend-focused workspace with Nx.
## Contents
- [1 - Code Generation](/node-tutorial/1-code-generation)
- [2 - Project Graph](/node-tutorial/2-project-graph)
- [3 - Task Running](/node-tutorial/3-task-running)
- [4 - Task Pipelines](/node-tutorial/4-task-pipelines)
- [5 - Docker Target](/node-tutorial/5-docker-target)
- [6 - Summary](/node-tutorial/6-summary)
- [1 - Code Generation](/node-server-tutorial/1-code-generation)
- [2 - Project Graph](/node-server-tutorial/2-project-graph)
- [3 - Task Running](/node-server-tutorial/3-task-running)
- [4 - Task Pipelines](/node-server-tutorial/4-task-pipelines)
- [5 - Docker Target](/node-server-tutorial/5-docker-target)
- [6 - Summary](/node-server-tutorial/6-summary)
## Your Objective
@ -47,7 +47,7 @@ The `node-server` preset automatically creates a `products-api` application at t
To create the `auth` library, use the `@nrwl/node:lib` generator:
![Nx Generator Syntax](/shared/node-tutorial/generator-syntax.svg)
![Nx Generator Syntax](/shared/node-server-tutorial/generator-syntax.svg)
```{% command="npx nx g @nrwl/node:lib auth --buildable" path="~/products-api" %}
> NX Generating @nrwl/node:library
@ -82,4 +82,4 @@ You have now created three projects:
## What's Next
- Continue to [2: Project Graph](/node-tutorial/2-project-graph)
- Continue to [2: Project Graph](/node-server-tutorial/2-project-graph)

View File

@ -1,13 +1,13 @@
---
title: 'Node Standalone Tutorial - Part 2: Project Graph'
title: 'Node Server Tutorial - Part 2: Project Graph'
description: In this tutorial you'll create a backend-focused workspace with Nx.
---
# Node Standalone Tutorial - Part 2: Project Graph
# Node Server Tutorial - Part 2: Project Graph
Run the command: `npx nx graph`. A browser should open up with the following contents:
{% graph height="200px" type="project" jsonFile="shared/node-tutorial/initial-project-graph.json" %}
{% graph height="200px" type="project" jsonFile="shared/node-server-tutorial/initial-project-graph.json" %}
{% /graph %}
You'll notice that there is no dependency drawn from `products-api` to the `auth` library. The project graph is derived from the source code of your workspace. Once we actually wire everything up, the project graph will update accordingly.
@ -84,13 +84,13 @@ describe('POST /auth', () => {
Now run `npx nx graph` again:
{% graph height="200px" type="project" jsonFile="shared/node-tutorial/final-project-graph.json" %}
{% graph height="200px" type="project" jsonFile="shared/node-server-tutorial/final-project-graph.json" %}
{% /graph %}
The graph now shows the dependency between `products-api` and `auth`.
The project graph is more than just a visualization - Nx provides tooling to optimize your task-running and even automate your CI based on this graph. This will be covered in more detail in: [4: Task Pipelines](/node-tutorial/4-task-pipelines).
The project graph is more than just a visualization - Nx provides tooling to optimize your task-running and even automate your CI based on this graph. This will be covered in more detail in: [4: Task Pipelines](/node-server-tutorial/4-task-pipelines).
## What's Next
- Continue to [3: Task Running](/node-tutorial/3-task-running)
- Continue to [3: Task Running](/node-server-tutorial/3-task-running)

View File

@ -1,9 +1,9 @@
---
title: 'Node Standalone Tutorial - Part 3: Task-Running'
title: 'Node Server Tutorial - Part 3: Task-Running'
description: In this tutorial you'll create a backend-focused workspace with Nx.
---
# Node Standalone Tutorial - Part 3: Task-Running
# Node Server Tutorial - Part 3: Task-Running
Common tasks include:
@ -67,12 +67,12 @@ You can see that three targets are defined here: `build`, `test` and `lint`.
The properties of these targets are defined as follows:
- `executor` - which Nx executor to run. The syntax here is: `<plugin name>:<executor name>`
- `outputs` - this is an array of files that would be created by running this target. (This informs Nx on what to save for it's caching mechanisms you'll learn about in [4 - Task Pipelines](/node-tutorial/4-task-pipelines)).
- `outputs` - this is an array of files that would be created by running this target. (This informs Nx on what to save for it's caching mechanisms you'll learn about in [4 - Task Pipelines](/node-server-tutorial/4-task-pipelines)).
- `options` - this is an object defining which executor options to use for the given target. Every Nx executor allows for options as a way to parameterize it's functionality.
## Running Tasks
![Syntax for Running Tasks in Nx](/shared/node-tutorial/run-target-syntax.svg)
![Syntax for Running Tasks in Nx](/shared/node-server-tutorial/run-target-syntax.svg)
Run the `build` target for your `auth` project:
@ -151,4 +151,4 @@ Tearing down...
## What's Next
- Continue to [4: Task Pipelines](/node-tutorial/4-task-pipelines)
- Continue to [4: Task Pipelines](/node-server-tutorial/4-task-pipelines)

View File

@ -1,9 +1,9 @@
---
title: 'Node Standalone Tutorial - Part 4: Task Pipelines'
title: 'Node Server Tutorial - Part 4: Task Pipelines'
description: In this tutorial you'll create a backend-focused workspace with Nx.
---
# Node Standalone Tutorial - Part 4: Task Pipelines
# Node Server Tutorial - Part 4: Task Pipelines
## Running Dependent Tasks
@ -220,7 +220,7 @@ You can visualize how our workspace is affected by this change using the command
npx nx affected:graph
```
{% graph height="450px" jsonFile="shared/node-tutorial/affected-project-graph.json" %}
{% graph height="450px" jsonFile="shared/node-server-tutorial/affected-project-graph.json" %}
{% /graph %}
The change made to the `products-api` project is also affecting the `e2e` project. This can be leveraged to run tasks only on the projects that were affected by this commit.
@ -237,4 +237,4 @@ This can be particularly helpful in CI pipelines for larger repos, where most co
## What's Next
- Continue to [5: Docker Target](/node-tutorial/5-docker-target)
- Continue to [5: Docker Target](/node-server-tutorial/5-docker-target)

View File

@ -1,9 +1,9 @@
---
title: 'Node Standalone Tutorial - Part 5: Docker Target'
title: 'Node Server Tutorial - Part 5: Docker Target'
description: In this tutorial you'll create a backend-focused workspace with Nx.
---
# Node Standalone Tutorial - Part 5: Docker Target
# Node Server Tutorial - Part 5: Docker Target
## Generate a Micro-service with a Docker File
@ -129,4 +129,4 @@ The `docker-build` command is defined as a target in the `orders-api` `project.j
## What's Next
- Continue to [6: Summary](/node-tutorial/6-summary)
- Continue to [6: Summary](/node-server-tutorial/6-summary)

View File

@ -1,9 +1,9 @@
---
title: 'Node Standalone Tutorial - Part 6: Summary'
title: 'Node Server Tutorial - Part 6: Summary'
description: In this tutorial you'll create a backend-focused workspace with Nx.
---
# Node Standalone Tutorial - Part 6: Summary
# Node Server Tutorial - Part 6: Summary
In this tutorial you:

View File

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -229,6 +229,6 @@ npx nx affected --target=build
{% card title="React Tutorial" description="A step-by-step tutorial showing how to build an integrated monorepo with React applications sharing code." url="/react-tutorial/1-code-generation" /%}
{% card title="Node.js Tutorial" description="A step-by-step tutorial showing how to build an integrated monorepo with Node.js applications sharing code." url="/getting-started/node-tutorial" /%}
{% card title="Node.js Tutorial" description="A step-by-step tutorial showing how to build an integrated monorepo with Node.js applications sharing code." url="/getting-started/node-server-tutorial" /%}
{% /cards %}

View File

@ -342,7 +342,7 @@ const tutorialBaseUrls = {
'/(l|latest)/(a|angular)/tutorial/1-code-generation':
'/angular-tutorial/1-code-generation',
'/(l|latest)/(a|node)/tutorial/1-code-generation':
'/getting-started/node-tutorial',
'/getting-started/node-server-tutorial',
'/(l|latest)/(r|react)/tutorial/1-code-generation':
'/react-tutorial/1-code-generation',
};
@ -376,7 +376,17 @@ const oldNodeTutorialPaths = [
'/node-tutorial/4-workspace-optimization',
'/node-tutorial/08-summary',
];
const nodeRedirectDestination = '/getting-started/node-tutorial';
const extraNodeRedirects = {
'/getting-started/node-tutorial': '/getting-started/node-server-tutorial',
'/node-tutorial/1-code-generation': '/node-server-tutorial/1-code-generation',
'/node-tutorial/2-project-graph': '/node-server-tutorial/2-project-graph',
'/node-tutorial/3-task-running': '/node-server-tutorial/3-task-running',
'/node-tutorial/4-task-pipelines': '/node-server-tutorial/4-task-pipelines',
'/node-tutorial/5-docker-target': '/node-server-tutorial/5-docker-target',
'/node-tutorial/6-summary': '/node-server-tutorial/6-summary',
};
const nodeRedirectDestination = '/getting-started/node-server-tutorial';
const nodeTutorialRedirects = oldNodeTutorialPaths.reduce((acc, path) => {
acc[path] = nodeRedirectDestination;
return acc;
@ -384,7 +394,8 @@ const nodeTutorialRedirects = oldNodeTutorialPaths.reduce((acc, path) => {
const tutorialRedirects = Object.assign(
tutorialBaseUrls,
reactTutorialRedirects,
nodeTutorialRedirects
nodeTutorialRedirects,
extraNodeRedirects
);
const oldAngularTutorialPaths = [

View File

@ -79,9 +79,26 @@ describe('Redirect rules configuration', () => {
for (const url of oldNodeTutorialPaths) {
expect(redirectRules.tutorialRedirects[url]).toEqual(
'/getting-started/node-tutorial'
'/getting-started/node-server-tutorial'
);
}
const oldNodePathPrefix = '/node-tutorial';
const newNodePathPrefix = '/node-server-tutorial';
const nodeDestination = [
'/1-code-generation',
'/2-project-graph',
'/3-task-running',
'/4-task-pipelines',
'/5-docker-target',
'/6-summary',
];
nodeDestination.forEach((des) => {
expect(
redirectRules.tutorialRedirects[`${oldNodePathPrefix}${des}`]
).toEqual(`${newNodePathPrefix}${des}`);
});
});
});
});

View File

@ -1417,7 +1417,7 @@ function pointToTutorialAndCourse(preset: Preset) {
output.addVerticalSeparator();
output.note({
title,
bodyLines: [`https://nx.dev/node-tutorial/1-code-generation`],
bodyLines: [`https://nx.dev/node-server-tutorial/1-code-generation`],
});
break;
}