docs(misc): introduce the core concepts docs section

This commit is contained in:
Victor Savkin 2020-12-22 15:54:55 -05:00
parent 24bf8e8b0d
commit 2f2efb8b4d
18 changed files with 148 additions and 134 deletions

View File

@ -24,5 +24,5 @@ npx create-nx-workspace --preset=angular
- [Nx CLI](/{{framework}}/getting-started/cli-overview)
- [Configuration Files](/{{framework}}/getting-started/configuration)
- [Computation Caching](/{{framework}}/workspace/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/guides/ci/monorepo-affected)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)

View File

@ -126,7 +126,7 @@ A target can have multiple configuration. In the example above the serve target
```bash
nx run todos:serve # default configuration
nx run todos:serve:production # producttion configuration
nx run todos:serve:production # production configuration
```
Because running target is such a common operation, you can also use the following syntax to do it:
@ -259,7 +259,7 @@ For example:
2. `workspaceRoot/apps/my-app/.env` contains `AUTH_URL=https://prod-url.com/auth`
3. Nx will first load the variables from `apps/my-app/.local.env` into the process. When it tries to load the variables from `apps/my-app/.env`, it will notice that `AUTH_URL` already exists, so it will ignore it.
We recommend nesting your **app** specific `env` files in `apps/your-app`, and creating workspace/root level `env` files for workspace-specific settings (like the [Nx Cloud token](https://nx.dev/angular/workspace/computation-caching#nx-cloud-and-distributed-computation-memoization)).
We recommend nesting your **app** specific `env` files in `apps/your-app`, and creating workspace/root level `env` files for workspace-specific settings (like the [Nx Cloud token](https://nx.dev/angular/core-concepts/computation-caching#nx-cloud-and-distributed-computation-memoization)).
### Pointing to custom env files

View File

@ -92,8 +92,8 @@ Learn more about the advantages of Nx in the following guides:
- [Using Cypress for e2e tests](/angular/plugins/cypress/overview)
- [Using Jest for unit tests](/angular/plugins/jest/overview)
- [Computation Caching](/angular/workspace/computation-caching)
- [Rebuilding and Retesting What is Affected](/angular/guides/ci/monorepo-affected)
- [Computation Caching](/angular/core-concepts/computation-caching)
- [Rebuilding and Retesting What is Affected](/angular/core-concepts/affected)
## Transitioning Manually
@ -376,4 +376,4 @@ Learn more about the advantages of Nx in the following guides:
[Using Cypress for e2e tests](/angular/plugins/cypress/overview) \
[Using Jest for unit tests](/angular/plugins/jest/overview) \
[Rebuilding and Retesting What is Affected](/angular/guides/ci/monorepo-affected)
[Rebuilding and Retesting What is Affected](/angular/core-concepts/affected)

View File

@ -59,7 +59,7 @@ Based on the state of the source code and the environment, Nx was able to figure
Nx read the output from cache instead of running the command for 1 out of 2 projects.
```
Nx built `api` and retrieved `todos` from its computation cache. Read more about the cache here [here](/{{framework}}/workspace/computation-caching).
Nx built `api` and retrieved `todos` from its computation cache. Read more about the cache here [here](/{{framework}}/core-concepts/computation-caching).
## --with-deps

View File

@ -14,5 +14,5 @@ In this tutorial you:
**Dive Deep:**
- [Nx CLI](/{{framework}}/getting-started/cli-overview)
- [Computation Caching](/{{framework}}/workspace/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/guides/ci/monorepo-affected)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)

View File

@ -32,10 +32,10 @@
"file": "shared/console"
},
{
"name": "File Structure",
"searchResultsName": "File Structure",
"id": "file-structure",
"file": "shared/file-structure"
"name": "Folder Structure",
"searchResultsName": "Folder Structure",
"id": "folder-structure",
"file": "shared/folder-structure"
},
{
"name": "Configuration",
@ -98,6 +98,37 @@
}
]
},
{
"name": "Core Concepts",
"id": "core-concepts",
"itemList": [
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Rebuild Only What is Affected",
"id": "affected",
"file": "shared/affected"
},
{
"name": "Why Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "angular/guides/update"
},
{
"name": "Nx Devkit",
"id": "nx-devkit",
"file": "shared/devkit"
}
]
},
{
"name": "Migration",
"id": "migration",
@ -925,11 +956,6 @@
}
]
},
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Generators",
"id": "generators",
@ -997,11 +1023,6 @@
"name": "CI",
"id": "ci",
"itemList": [
{
"name": "Rebuild Only What is Affected",
"id": "monorepo-affected",
"file": "shared/monorepo-affected"
},
{
"name": "Distributed CI: Overview",
"id": "distributed-builds",
@ -1071,30 +1092,15 @@
"id": "browser-support",
"file": "shared/guides/browser-support"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "angular/guides/update"
},
{
"name": "Running custom commands",
"id": "running-custom-commands",
"file": "angular/guides/running-custom-commands"
},
{
"name": "Nx Devkit",
"id": "nx-devkit",
"file": "shared/devkit"
},
{
"name": "Nx Devkit and Angular Devkit",
"id": "nx-devkit-angular-devkit",
"file": "angular/guides/nx-devkit-angular-devkit"
},
{
"name": "Why Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
}
]
},
@ -1149,10 +1155,10 @@
"file": "shared/console"
},
{
"name": "File Structure",
"searchResultsName": "File Structure",
"id": "file-structure",
"file": "shared/file-structure"
"name": "Folder Structure",
"searchResultsName": "Folder Structure",
"id": "folder-structure",
"file": "shared/folder-structure"
},
{
"name": "Configuration",
@ -1215,6 +1221,37 @@
}
]
},
{
"name": "Core Concepts",
"id": "core-concepts",
"itemList": [
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Rebuild Only What is Affected",
"id": "affected",
"file": "shared/affected"
},
{
"name": "Why Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "shared/update"
},
{
"name": "Nx Devkit",
"id": "nx-devkit",
"file": "shared/devkit"
}
]
},
{
"name": "Migration",
"id": "migration",
@ -2038,11 +2075,6 @@
}
]
},
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Generators",
"id": "generators",
@ -2094,11 +2126,6 @@
"file": "shared/workspace/structure/dependency-graph"
}
]
},
{
"name": "Updating Nx",
"id": "update",
"file": "shared/update"
}
]
},
@ -2110,11 +2137,6 @@
"name": "CI",
"id": "ci",
"itemList": [
{
"name": "Rebuild Only What is Affected",
"id": "monorepo-affected",
"file": "shared/monorepo-affected"
},
{
"name": "Distributed CI: Overview",
"id": "distributed-builds",
@ -2166,16 +2188,6 @@
"name": "Next.js projects with Nx",
"id": "nextjs",
"file": "react/guides/nextjs"
},
{
"name": "Nx Devkit",
"id": "nx-devkit",
"file": "shared/devkit"
},
{
"name": "Why Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
}
]
},
@ -2230,10 +2242,10 @@
"file": "shared/console"
},
{
"name": "File Structure",
"searchResultsName": "File Structure",
"id": "file-structure",
"file": "shared/file-structure"
"name": "Folder Structure",
"searchResultsName": "Folder Structure",
"id": "folder-structure",
"file": "shared/folder-structure"
},
{
"name": "Configuration",
@ -2280,6 +2292,37 @@
}
]
},
{
"name": "Core Concepts",
"id": "core-concepts",
"itemList": [
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Rebuild Only What is Affected",
"id": "affected",
"file": "shared/affected"
},
{
"name": "Why Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "shared/update"
},
{
"name": "Nx Devkit",
"id": "nx-devkit",
"file": "shared/devkit"
}
]
},
{
"name": "Migration",
"id": "migration",
@ -3088,11 +3131,6 @@
}
]
},
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Generators",
"id": "generators",
@ -3144,11 +3182,6 @@
"file": "shared/workspace/structure/dependency-graph"
}
]
},
{
"name": "Updating Nx",
"id": "update",
"file": "shared/update"
}
]
},
@ -3160,11 +3193,6 @@
"name": "CI",
"id": "ci",
"itemList": [
{
"name": "Rebuild Only What is Affected",
"id": "monorepo-affected",
"file": "shared/monorepo-affected"
},
{
"name": "Distributed CI: Overview",
"id": "distributed-builds",
@ -3191,16 +3219,6 @@
"name": "Using Nx at Enterprises",
"id": "monorepo-nx-enterprise",
"file": "shared/monorepo-nx-enterprise"
},
{
"name": "Nx Devkit",
"id": "nx-devkit",
"file": "shared/devkit"
},
{
"name": "Why Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
}
]
}

View File

@ -20,5 +20,5 @@ npx create-nx-workspace --preset=express
- [Nx CLI](/{{framework}}/getting-started/cli-overview)
- [Configuration Files](/{{framework}}/getting-started/configuration)
- [Computation Caching](/{{framework}}/workspace/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/guides/ci/monorepo-affected)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)

View File

@ -63,11 +63,9 @@ You can preview the changes a generator makes by using the `--dry-run` option. I
## Running Tasks
The Nx CLI uses builders to perform tasks, such as building and bundling your application, running unit tests, or running E2E tests against a specific target, whether that be an application or workspace.
The Nx CLI uses executors to perform tasks, such as building and bundling your application, running unit tests, or running E2E tests against a specific target, whether that be an application or workspace.
A builder is a function that uses the Architect API to perform a complex process such as "build", "test", or "lint".
You can configure the builders in `workspace.json`.
You can configure the executors in `workspace.json`.
```json
{
@ -76,9 +74,9 @@ You can configure the builders in `workspace.json`.
"root": "apps/todos/",
"sourceRoot": "apps/todos/src",
"projectType": "application",
"architect": {
"targets": {
"serve": {
"builder": "@nrwl/web:dev-server",
"executor": "@nrwl/web:dev-server",
"options": {
"buildTarget": "todos:build",
"proxyConfig": "apps/todos/proxy.conf.json"
@ -90,7 +88,7 @@ You can configure the builders in `workspace.json`.
}
},
"test": {
"builder": "@nrwl/jest:jest",
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/todos/jest.config.js",
"tsConfig": "apps/todos/tsconfig.spec.json",
@ -103,7 +101,7 @@ You can configure the builders in `workspace.json`.
}
```
In the example above, the `todos` application has two targets: `serve` and `test`. The `serve` target uses the `@nrwl/web:dev-server` builder, and the `test` target uses `@nrwl/jest:jest`. Every target uses a builder which actually runs this target. So targets are analogous to typed npm scripts, and builders are analogous to typed shell scripts.
In the example above, the `todos` application has two targets: `serve` and `test`. The `serve` target uses the `@nrwl/web:dev-server` executor, and the `test` target uses `@nrwl/jest:jest`. Every target uses an executor which actually runs this target. So targets are analogous to typed npm scripts, and executors are analogous to typed shell scripts.
You can run the target as follows:
@ -116,7 +114,7 @@ A target can have multiple configuration. In the example above the serve target
```bash
nx run todos:serve # default configuration
nx run todos:serve:production # producttion configuration
nx run todos:serve:production # production configuration
```
Because running target is such a common operation, you can also use the following syntax to do it:
@ -127,7 +125,7 @@ nx serve todos --configuration=production
nx serve todos --prod
```
You can name your targets any way you want, define as many of them as you want, and use any builders you want to implement them.
You can name your targets any way you want, define as many of them as you want, and use any executors you want to implement them.
**These are some common targets:**
@ -188,7 +186,7 @@ Run the same target for the projects that failed last time.
nx run-many --target=build --all --only-failed
```
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the builder.
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the executor.
```sh
nx run-many --target=build --all --prod
@ -223,7 +221,7 @@ nx affected:lint
nx affected:e2e
```
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the builder.
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the executor.
```sh
nx affected --target=build --prod

View File

@ -14,5 +14,5 @@ In this tutorial you:
**Dive Deep:**
- [Nx CLI](/{{framework}}/getting-started/cli-overview)
- [Computation Caching](/{{framework}}/workspace/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/guides/ci/monorepo-affected)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)

View File

@ -24,5 +24,5 @@ npx create-nx-workspace --preset=react
- [Nx CLI](/{{framework}}/getting-started/cli-overview)
- [Configuration Files](/{{framework}}/getting-started/configuration)
- [Computation Caching](/{{framework}}/workspace/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/guides/ci/monorepo-affected)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)

View File

@ -63,11 +63,9 @@ You can preview the changes a generator makes by using the `--dry-run` option. I
## Running Tasks
The Nx CLI uses builders to perform tasks, such as building and bundling your application, running unit tests, or running E2E tests against a specific target, whether that be an application or workspace.
The Nx CLI uses executors to perform tasks, such as building and bundling your application, running unit tests, or running E2E tests against a specific target, whether that be an application or workspace.
A builder is a function that uses the Architect API to perform a complex process such as "build", "test", or "lint".
You can configure the builders in `workspace.json`.
You can configure the executors in `workspace.json`.
```json
{
@ -76,9 +74,9 @@ You can configure the builders in `workspace.json`.
"root": "apps/todos/",
"sourceRoot": "apps/todos/src",
"projectType": "application",
"architect": {
"targets": {
"serve": {
"builder": "@nrwl/web:dev-server",
"executor": "@nrwl/web:dev-server",
"options": {
"buildTarget": "todos:build",
"proxyConfig": "apps/todos/proxy.conf.json"
@ -90,7 +88,7 @@ You can configure the builders in `workspace.json`.
}
},
"test": {
"builder": "@nrwl/jest:jest",
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/todos/jest.config.js",
"tsConfig": "apps/todos/tsconfig.spec.json",
@ -103,7 +101,7 @@ You can configure the builders in `workspace.json`.
}
```
In the example above, the `todos` application has two targets: `serve` and `test`. The `serve` target uses the `@nrwl/web:dev-server` builder, and the `test` target uses `@nrwl/jest:jest`. Every target uses a builder which actually runs this target. So targets are analogous to typed npm scripts, and builders are analogous to typed shell scripts.
In the example above, the `todos` application has two targets: `serve` and `test`. The `serve` target uses the `@nrwl/web:dev-server` executor, and the `test` target uses `@nrwl/jest:jest`. Every target uses an executor which actually runs this target. So targets are analogous to typed npm scripts, and executors are analogous to typed shell scripts.
You can run the target as follows:
@ -116,7 +114,7 @@ A target can have multiple configuration. In the example above the serve target
```bash
nx run todos:serve # default configuration
nx run todos:serve:production # producttion configuration
nx run todos:serve:production # production configuration
```
Because running target is such a common operation, you can also use the following syntax to do it:
@ -127,7 +125,7 @@ nx serve todos --configuration=production
nx serve todos --prod
```
You can name your targets any way you want, define as many of them as you want, and use any builders you want to implement them.
You can name your targets any way you want, define as many of them as you want, and use any executors you want to implement them.
**These are some common targets:**
@ -188,7 +186,7 @@ Run the same target for the projects that failed last time.
nx run-many --target=build --all --only-failed
```
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the builder.
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the executor.
```sh
nx run-many --target=build --all --prod
@ -223,7 +221,7 @@ nx affected:lint
nx affected:e2e
```
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the builder.
Any flags you pass to `run-many` that aren't Nx specific will be passed down to the executor.
```sh
nx affected --target=build --prod

View File

@ -56,7 +56,7 @@ For example:
2. `workspaceRoot/apps/my-app/.env` contains `AUTH_URL=https://prod-url.com/auth`
3. Nx will first load the variables from `apps/my-app/.local.env` into the process. When it tries to load the variables from `apps/my-app/.env`, it will notice that `AUTH_URL` already exists, so it will ignore it.
We recommend nesting your **app** specific `env` files in `apps/your-app`, and creating workspace/root level `env` files for workspace-specific settings (like the [Nx Cloud token](https://nx.dev/react/workspace/computation-caching#nx-cloud-and-distributed-computation-memoization)).
We recommend nesting your **app** specific `env` files in `apps/your-app`, and creating workspace/root level `env` files for workspace-specific settings (like the [Nx Cloud token](https://nx.dev/react/core-concepts/computation-caching#nx-cloud-and-distributed-computation-memoization)).
### Pointing to custom env files

View File

@ -54,7 +54,7 @@ Based on the state of the source code and the environment, Nx was able to figure
Nx read the output from cache instead of running the command for 1 out of 2 projects.
```
Nx built `api` and retrieved `todos` from its computation cache. Read more about the cache [here](/{{framework}}/workspace/computation-caching).
Nx built `api` and retrieved `todos` from its computation cache. Read more about the cache [here](/{{framework}}/core-concepts/computation-caching).
## --with-deps

View File

@ -14,5 +14,5 @@ In this tutorial you:
**Dive Deep:**
- [Nx CLI](/{{framework}}/getting-started/cli-overview)
- [Computation Caching](/{{framework}}/workspace/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/guides/ci/monorepo-affected)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)

View File

@ -1,4 +1,4 @@
# Nx Workspace
# Folder Structure
## Files

View File

@ -161,7 +161,7 @@ Your use-case may also be covered by one of our community plugins. Plugin author
[Learn more about the `run-commands` builder](/{{framework}}/plugins/workspace/builders/run-commands)
[Learn more about caching](/{{framework}}/workspace/computation-caching)
[Learn more about caching](/{{framework}}/core-concepts/computation-caching)
[Learn more about community plugins](/nx-community)

View File

@ -106,7 +106,7 @@ Full E2Es are supported (and recommended) and will run everything on the file sy
## Executor
The default executor is set up to just emit a console log. Some examples of what a executor can do are:
The default executor is set up to just emit a console log. Some examples of what an executor can do are:
- Support different languages, (Java, Go, Python, C#)
- Compile new UI framework components