From 4470ebd4bcd75c89be417eab29e4899201b3aea3 Mon Sep 17 00:00:00 2001 From: Benjamin Cabanes <3447705+bcabanes@users.noreply.github.com> Date: Thu, 2 Dec 2021 11:12:33 -0500 Subject: [PATCH] docs(nxdev): update content (#7975) --- .../api-angular/executors/ng-packagr-lite.md | 6 + .../angular/api-angular/executors/package.md | 6 + .../angular/api-angular/generators/library.md | 8 + .../executors/tsc.md | 2 +- .../angular/api-js/generators/application.md | 161 +++++++++++++++++ .../angular/api-js/generators/library.md | 169 ++++++++++++++++++ .../angular/api-node/executors/build.md | 8 + .../latest/angular/api-nx-devkit/index.md | 48 ++--- .../api-react-native/executors/run-android.md | 8 + .../api-react-native/executors/run-ios.md | 8 + .../executors/{package.md => rollup.md} | 4 +- .../executors/{build.md => webpack.md} | 4 +- .../latest/angular/cli/affected-build.md | 6 - .../latest/angular/cli/affected-e2e.md | 6 - .../latest/angular/cli/affected-lint.md | 6 - .../latest/angular/cli/affected-test.md | 6 - .../latest/angular/cli/affected.md | 6 - .../latest/angular/executors.json | 1 + .../latest/angular/generators.json | 1 + .../latest/angular/guides/configuration.md | 10 +- .../angular/migration/migration-angularjs.md | 2 +- .../tutorial/11-test-affected-projects.md | 8 +- .../public/documentation/latest/builders.json | 3 +- .../public/documentation/latest/map.json | 85 +++++++-- .../api-angular/executors/ng-packagr-lite.md | 6 + .../node/api-angular/executors/package.md | 6 + .../node/api-angular/generators/library.md | 8 + .../executors/tsc.md | 2 +- .../node/api-js/generators/application.md | 161 +++++++++++++++++ .../latest/node/api-js/generators/library.md | 169 ++++++++++++++++++ .../latest/node/api-node/executors/build.md | 8 + .../latest/node/api-nx-devkit/index.md | 48 ++--- .../api-react-native/executors/run-android.md | 8 + .../api-react-native/executors/run-ios.md | 8 + .../api-web/executors/rollup.md} | 4 +- .../api-web/executors/webpack.md} | 4 +- .../latest/node/cli/affected-build.md | 6 - .../latest/node/cli/affected-e2e.md | 6 - .../latest/node/cli/affected-lint.md | 6 - .../latest/node/cli/affected-test.md | 6 - .../documentation/latest/node/cli/affected.md | 6 - .../documentation/latest/node/executors.json | 1 + .../documentation/latest/node/generators.json | 1 + .../api-angular/executors/ng-packagr-lite.md | 6 + .../react/api-angular/executors/package.md | 6 + .../react/api-angular/generators/library.md | 8 + .../executors/tsc.md | 2 +- .../react/api-js/generators/application.md | 161 +++++++++++++++++ .../latest/react/api-js/generators/library.md | 169 ++++++++++++++++++ .../latest/react/api-node/executors/build.md | 8 + .../latest/react/api-nx-devkit/index.md | 48 ++--- .../api-react-native/executors/run-android.md | 8 + .../api-react-native/executors/run-ios.md | 8 + .../api-web/executors/rollup.md} | 4 +- .../api-web/executors/webpack.md} | 4 +- .../latest/react/cli/affected-build.md | 6 - .../latest/react/cli/affected-e2e.md | 6 - .../latest/react/cli/affected-lint.md | 6 - .../latest/react/cli/affected-test.md | 6 - .../latest/react/cli/affected.md | 6 - .../documentation/latest/react/executors.json | 1 + .../latest/react/generators.json | 1 + .../latest/react/guides/configuration.md | 8 +- .../react/tutorial/01-create-application.md | 7 +- .../latest/react/tutorial/05-add-node-app.md | 23 ++- .../latest/react/tutorial/06-proxy.md | 24 +-- .../latest/react/tutorial/07-share-code.md | 3 +- .../latest/react/tutorial/08-create-libs.md | 48 ++--- .../latest/react/tutorial/09-dep-graph.md | 8 + .../react/tutorial/10-computation-caching.md | 37 ---- .../tutorial/11-test-affected-projects.md | 14 +- .../latest/shared/computation-caching.md | 2 +- .../latest/shared/monorepo-ci-gitlab.md | 77 ++++++++ .../latest/shared/react-plugin.md | 2 +- .../latest/shared/using-executors.md | 2 +- 75 files changed, 1461 insertions(+), 294 deletions(-) rename nx-dev/nx-dev/public/documentation/latest/angular/{api-workspace => api-js}/executors/tsc.md (96%) create mode 100644 nx-dev/nx-dev/public/documentation/latest/angular/api-js/generators/application.md create mode 100644 nx-dev/nx-dev/public/documentation/latest/angular/api-js/generators/library.md rename nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/{package.md => rollup.md} (97%) rename nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/{build.md => webpack.md} (98%) rename nx-dev/nx-dev/public/documentation/latest/node/{api-workspace => api-js}/executors/tsc.md (96%) create mode 100644 nx-dev/nx-dev/public/documentation/latest/node/api-js/generators/application.md create mode 100644 nx-dev/nx-dev/public/documentation/latest/node/api-js/generators/library.md rename nx-dev/nx-dev/public/documentation/latest/{react/api-web/executors/package.md => node/api-web/executors/rollup.md} (97%) rename nx-dev/nx-dev/public/documentation/latest/{react/api-web/executors/build.md => node/api-web/executors/webpack.md} (98%) rename nx-dev/nx-dev/public/documentation/latest/react/{api-workspace => api-js}/executors/tsc.md (96%) create mode 100644 nx-dev/nx-dev/public/documentation/latest/react/api-js/generators/application.md create mode 100644 nx-dev/nx-dev/public/documentation/latest/react/api-js/generators/library.md rename nx-dev/nx-dev/public/documentation/latest/{node/api-web/executors/package.md => react/api-web/executors/rollup.md} (97%) rename nx-dev/nx-dev/public/documentation/latest/{node/api-web/executors/build.md => react/api-web/executors/webpack.md} (98%) create mode 100644 nx-dev/nx-dev/public/documentation/latest/shared/monorepo-ci-gitlab.md diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/executors/ng-packagr-lite.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/executors/ng-packagr-lite.md index 46b4741641..1a910703c0 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/executors/ng-packagr-lite.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/executors/ng-packagr-lite.md @@ -22,6 +22,12 @@ Possible values: `dependencies`, `peerDependencies` When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. +### tailwindConfig + +Type: `string` + +The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured. + ### tsConfig Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/executors/package.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/executors/package.md index 05d8c7ba7e..c177134d1b 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/executors/package.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/executors/package.md @@ -22,6 +22,12 @@ Possible values: `dependencies`, `peerDependencies` When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. +### tailwindConfig + +Type: `string` + +The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured. + ### tsConfig Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/generators/library.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/generators/library.md index ef0c98a077..9109329e84 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/generators/library.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-angular/generators/library.md @@ -44,6 +44,14 @@ Type: `boolean` Generate a buildable library. +### compilationMode + +Type: `string` + +Possible values: `full`, `partial` + +Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries. + ### directory Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-workspace/executors/tsc.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-js/executors/tsc.md similarity index 96% rename from nx-dev/nx-dev/public/documentation/latest/angular/api-workspace/executors/tsc.md rename to nx-dev/nx-dev/public/documentation/latest/angular/api-js/executors/tsc.md index 42034d661d..b0babee5f3 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-workspace/executors/tsc.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-js/executors/tsc.md @@ -1,4 +1,4 @@ -# @nrwl/workspace:tsc +# @nrwl/js:tsc Build a project using TypeScript. diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-js/generators/application.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-js/generators/application.md new file mode 100644 index 0000000000..9b81cafee8 --- /dev/null +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-js/generators/application.md @@ -0,0 +1,161 @@ +# @nrwl/js:application + +Create a application + +## Usage + +```bash +nx generate application ... +``` + +```bash +nx g app ... # same +``` + +By default, Nx will search for `application` in the default collection provisioned in `angular.json`. + +You can specify the collection explicitly as follows: + +```bash +nx g @nrwl/js:application ... +``` + +Show what will be generated without writing to disk: + +```bash +nx g application ... --dry-run +``` + +### Examples + +Generate libs/myapp/mylib: + +```bash +nx g lib mylib --directory=myapp +``` + +## Options + +### name (_**required**_) + +Type: `string` + +Library name + +### compiler + +Default: `tsc` + +Type: `string` + +Possible values: `tsc`, `swc` + +The compiler used by the build and test targets + +### config + +Default: `project` + +Type: `string` + +Possible values: `workspace`, `project`, `npm-scripts` + +Determines how whether the project's executors should be configured in workspace.json, project.json or as npm scripts + +### directory + +Type: `string` + +A directory where the lib is placed + +### importPath + +Type: `string` + +The library name used to import it, like @myorg/my-awesome-lib + +### js + +Default: `false` + +Type: `boolean` + +Generate JavaScript files rather than TypeScript files + +### linter + +Default: `eslint` + +Type: `string` + +Possible values: `eslint`, `none` + +The tool to use for running lint checks. + +### pascalCaseFiles + +Alias(es): P + +Default: `false` + +Type: `boolean` + +Use pascal case file names. + +### setParserOptionsProject + +Default: `false` + +Type: `boolean` + +Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. + +### skipFormat + +Default: `false` + +Type: `boolean` + +Skip formatting files + +### skipTsConfig + +Default: `false` + +Type: `boolean` + +Do not update tsconfig.json for development experience. + +### strict + +Default: `true` + +Type: `boolean` + +Whether to enable tsconfig strict mode or not. + +### tags + +Type: `string` + +Add tags to the library (used for linting) + +### testEnvironment + +Default: `jsdom` + +Type: `string` + +Possible values: `jsdom`, `node` + +The test environment to use if unitTestRunner is set to jest + +### unitTestRunner + +Default: `jest` + +Type: `string` + +Possible values: `jest`, `none` + +Test runner to use for unit tests diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-js/generators/library.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-js/generators/library.md new file mode 100644 index 0000000000..2d7dd9ace9 --- /dev/null +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-js/generators/library.md @@ -0,0 +1,169 @@ +# @nrwl/js:library + +Create a library + +## Usage + +```bash +nx generate library ... +``` + +```bash +nx g lib ... # same +``` + +By default, Nx will search for `library` in the default collection provisioned in `angular.json`. + +You can specify the collection explicitly as follows: + +```bash +nx g @nrwl/js:library ... +``` + +Show what will be generated without writing to disk: + +```bash +nx g library ... --dry-run +``` + +### Examples + +Generate libs/myapp/mylib: + +```bash +nx g lib mylib --directory=myapp +``` + +## Options + +### name (_**required**_) + +Type: `string` + +Library name + +### buildable + +Default: `false` + +Type: `boolean` + +Generate a buildable library. + +### compiler + +Default: `tsc` + +Type: `string` + +Possible values: `tsc`, `swc` + +The compiler used by the build and test targets + +### config + +Default: `project` + +Type: `string` + +Possible values: `workspace`, `project`, `npm-scripts` + +Determines how whether the project's executors should be configured in workspace.json, project.json or as npm scripts + +### directory + +Type: `string` + +A directory where the lib is placed + +### importPath + +Type: `string` + +The library name used to import it, like @myorg/my-awesome-lib + +### js + +Default: `false` + +Type: `boolean` + +Generate JavaScript files rather than TypeScript files + +### linter + +Default: `eslint` + +Type: `string` + +Possible values: `eslint`, `none` + +The tool to use for running lint checks. + +### pascalCaseFiles + +Alias(es): P + +Default: `false` + +Type: `boolean` + +Use pascal case file names. + +### setParserOptionsProject + +Default: `false` + +Type: `boolean` + +Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. + +### skipFormat + +Default: `false` + +Type: `boolean` + +Skip formatting files + +### skipTsConfig + +Default: `false` + +Type: `boolean` + +Do not update tsconfig.json for development experience. + +### strict + +Default: `true` + +Type: `boolean` + +Whether to enable tsconfig strict mode or not. + +### tags + +Type: `string` + +Add tags to the library (used for linting) + +### testEnvironment + +Default: `jsdom` + +Type: `string` + +Possible values: `jsdom`, `node` + +The test environment to use if unitTestRunner is set to jest + +### unitTestRunner + +Default: `jest` + +Type: `string` + +Possible values: `jest`, `none` + +Test runner to use for unit tests diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-node/executors/build.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-node/executors/build.md index e833cec250..f46412202b 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-node/executors/build.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-node/executors/build.md @@ -110,6 +110,14 @@ Type: `boolean` Defines the optimization level of the build. +### outputFileName + +Default: `main.js` + +Type: `string` + +Name of the main output file. (defaults to 'main.js') + ### outputPath Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-nx-devkit/index.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-nx-devkit/index.md index 8e17460646..943e346aac 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-nx-devkit/index.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-nx-devkit/index.md @@ -885,7 +885,7 @@ Example: ### getWorkspacePath -▸ **getWorkspacePath**(`tree`): `string` +▸ **getWorkspacePath**(`tree`): `"/angular.json"` \| `"/workspace.json"` \| `null` #### Parameters @@ -895,7 +895,7 @@ Example: #### Returns -`string` +`"/angular.json"` \| `"/workspace.json"` \| `null` --- @@ -1061,9 +1061,9 @@ By default javascript-style comments are allowed. #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | #### Parameters @@ -1113,9 +1113,9 @@ Reads a json file, removes all comments and parses JSON. #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | #### Parameters @@ -1139,9 +1139,9 @@ Reads a JSON file and returns the object the JSON content represents. #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | #### Parameters @@ -1346,9 +1346,9 @@ By default the JSON string is formatted with a 2 space intendation to be easy re #### Type parameters -| Name | Type | -| :--- | :------------------------- | -| `T` | extends ` object``object ` | +| Name | Type | +| :--- | :-------------------------- | +| `T` | extends `object` = `object` | #### Parameters @@ -1459,10 +1459,10 @@ Updates a JSON value to the file system tree #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | -| `U` | extends ` object``T ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | +| `U` | extends `object` = `T` | #### Parameters @@ -1569,9 +1569,9 @@ Writes a JSON value to the file system tree #### Type parameters -| Name | Type | -| :--- | :------------------------- | -| `T` | extends ` object``object ` | +| Name | Type | +| :--- | :-------------------------- | +| `T` | extends `object` = `object` | #### Parameters @@ -1596,9 +1596,9 @@ Serializes the given data to JSON and writes it to a file. #### Type parameters -| Name | Type | -| :--- | :------------------------- | -| `T` | extends ` object``object ` | +| Name | Type | +| :--- | :-------------------------- | +| `T` | extends `object` = `object` | #### Parameters diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-react-native/executors/run-android.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-react-native/executors/run-android.md index 27d72041fb..edcdd2b4cd 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-react-native/executors/run-android.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-react-native/executors/run-android.md @@ -56,6 +56,14 @@ Type: `number` The port where the packager server is listening on. +### resetCache + +Default: `false` + +Type: `boolean` + +Resets metro cache + ### sync Default: `true` diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-react-native/executors/run-ios.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-react-native/executors/run-ios.md index 9a0055937f..020452d5bd 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-react-native/executors/run-ios.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-react-native/executors/run-ios.md @@ -36,6 +36,14 @@ Type: `number` The port where the packager server is listening on. +### resetCache + +Default: `false` + +Type: `boolean` + +Resets metro cache + ### scheme Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/package.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/rollup.md similarity index 97% rename from nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/package.md rename to nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/rollup.md index 86a9b71812..fe97d9beac 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/package.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/rollup.md @@ -1,6 +1,6 @@ -# @nrwl/web:package +# @nrwl/web:rollup -Package a library +Package a library using rollup Options can be configured in `angular.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/core-concepts/configuration#targets. diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/build.md b/nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/webpack.md similarity index 98% rename from nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/build.md rename to nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/webpack.md index 4b904de2ba..fc29065694 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/build.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/api-web/executors/webpack.md @@ -1,6 +1,6 @@ -# @nrwl/web:build +# @nrwl/web:webpack -Build a application +Build an application using webpack Options can be configured in `angular.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/core-concepts/configuration#targets. diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-build.md b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-build.md index faad5e0d72..5a44ab0572 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-build.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-build.md @@ -18,12 +18,6 @@ Run build in parallel: nx affected:build --parallel=5 ``` -Rerun the build target only for the projects that failed last time: - -```bash -nx affected:build --only-failed -``` - Run the build target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-e2e.md b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-e2e.md index 131394bb2f..318ba9ba75 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-e2e.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-e2e.md @@ -18,12 +18,6 @@ Run tests in parallel: nx affected:e2e --parallel=5 ``` -Rerun the test target only for the projects that failed last time: - -```bash -nx affected:e2e --only-failed -``` - Run the test target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-lint.md b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-lint.md index aab020a995..dc95f58a17 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-lint.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-lint.md @@ -18,12 +18,6 @@ Run lint in parallel: nx affected:lint --parallel=5 ``` -Rerun the lint target only for the projects that failed last time: - -```bash -nx affected:lint --only-failed -``` - Run the lint target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-test.md b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-test.md index daffcdc098..67a2575278 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-test.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected-test.md @@ -18,12 +18,6 @@ Run tests in parallel: nx affected:test --parallel=5 ``` -Rerun the test target only for the projects that failed last time: - -```bash -nx affected:test --only-failed -``` - Run the test target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected.md b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected.md index 943a118700..7950a715bf 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/cli/affected.md @@ -24,12 +24,6 @@ Run tests in parallel: nx affected --target=test --parallel=5 ``` -Rerun the test target only for the projects that failed last time: - -```bash -nx affected --target=test --only-failed -``` - Run the test target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/executors.json b/nx-dev/nx-dev/public/documentation/latest/angular/executors.json index 20e4d08631..cb26dd84b8 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/executors.json +++ b/nx-dev/nx-dev/public/documentation/latest/angular/executors.json @@ -4,6 +4,7 @@ "detox", "gatsby", "jest", + "js", "linter", "next", "node", diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/generators.json b/nx-dev/nx-dev/public/documentation/latest/angular/generators.json index c2f47c1b32..4bc621d6ae 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/generators.json +++ b/nx-dev/nx-dev/public/documentation/latest/angular/generators.json @@ -5,6 +5,7 @@ "express", "gatsby", "jest", + "js", "linter", "nest", "next", diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/guides/configuration.md b/nx-dev/nx-dev/public/documentation/latest/angular/guides/configuration.md index 5ca87d2f4d..95f6635dba 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/guides/configuration.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/guides/configuration.md @@ -15,7 +15,7 @@ The `angular.json` configuration file contains information about the targets and "projectType": "application", "architect": { "build": { - "builder": "@nrwl/web:build", + "builder": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "dependsOn": [ { @@ -137,7 +137,7 @@ The `outputs` property lists the folders the builder creates files in. The prope ```json { "build": { - "builder": "@nrwl/web:build", + "builder": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "options": { "index": "apps/myapp/src/app.html", @@ -154,7 +154,7 @@ The `configurations` property provides extra sets of values that will be merged ```json { "build": { - "builder": "@nrwl/web:build", + "builder": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "options": { "index": "apps/myapp/src/app.html", @@ -186,7 +186,7 @@ Targets can depend on other targets. A common scenario is having to build depend ```json { "build": { - "executor": "@nrwl/web:build", + "executor": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "options": { "index": "apps/myapp/src/app.html", @@ -211,7 +211,7 @@ In the following example invoking `nx build myapp` builds all the libraries firs ```json { "build-base": { - "executor": "@nrwl/web:build", + "executor": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "options": { "index": "apps/myapp/src/app.html", diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/migration/migration-angularjs.md b/nx-dev/nx-dev/public/documentation/latest/angular/migration/migration-angularjs.md index bf66a4e329..2ccbd6400a 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/migration/migration-angularjs.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/migration/migration-angularjs.md @@ -411,7 +411,7 @@ To use webpack instead of gulp, go back to your `angular.json` file and modify t ```json ... "build": { - "executor": "@nrwl/web:build", + "executor": "@nrwl/web:webpack", "options": { "outputPath": "dist/apps/realworld", "index": "apps/realworld/src/index.html", diff --git a/nx-dev/nx-dev/public/documentation/latest/angular/tutorial/11-test-affected-projects.md b/nx-dev/nx-dev/public/documentation/latest/angular/tutorial/11-test-affected-projects.md index 8c2c7c406c..e51951abdf 100644 --- a/nx-dev/nx-dev/public/documentation/latest/angular/tutorial/11-test-affected-projects.md +++ b/nx-dev/nx-dev/public/documentation/latest/angular/tutorial/11-test-affected-projects.md @@ -23,15 +23,15 @@ git checkout -b testbranch Run the command to see affected apps. ```sh -npm run affected:apps +npx nx affected:apps ``` You should see `todos` printed out. The `affected:apps` looks at what you have changed and uses the dependency graph to figure out which apps can be affected by this change. Run the command to see affected libraries -``` -npm run affected:libs +```sh +npx nx affected:libs ``` You should see `ui` printed out. This command works similarly, but instead of printing the affected apps, it prints the affected libs. @@ -67,7 +67,7 @@ Note that Nx only tried to retest `ui` and `todos`. It didn't retest `api` or `d Run the command to retest the failed projects. ```sh -npm run affected:test -- --only-failed +npx nx affected:test -- --only-failed ``` ## Affected: diff --git a/nx-dev/nx-dev/public/documentation/latest/builders.json b/nx-dev/nx-dev/public/documentation/latest/builders.json index d147d35dea..ee16974bd1 100644 --- a/nx-dev/nx-dev/public/documentation/latest/builders.json +++ b/nx-dev/nx-dev/public/documentation/latest/builders.json @@ -7,5 +7,6 @@ "node", "storybook", "web", - "workspace" + "workspace", + "js" ] diff --git a/nx-dev/nx-dev/public/documentation/latest/map.json b/nx-dev/nx-dev/public/documentation/latest/map.json index f273182d02..c30e9df39b 100644 --- a/nx-dev/nx-dev/public/documentation/latest/map.json +++ b/nx-dev/nx-dev/public/documentation/latest/map.json @@ -58,7 +58,7 @@ "id": "05-add-node-app" }, { - "name": "6 - Configure Proxy", + "name": "6 - Proxy Configuration", "id": "06-proxy" }, { @@ -352,11 +352,27 @@ "name": "run-script executor", "id": "run-script", "file": "angular/api-workspace/executors/run-script" + } + ] + }, + { + "name": "js", + "id": "js", + "itemList": [ + { + "name": "application generator", + "id": "application", + "file": "angular/api-js/generators/application" + }, + { + "name": "library generator", + "id": "library", + "file": "angular/api-js/generators/library" }, { "name": "tsc executor", "id": "tsc", - "file": "angular/api-workspace/executors/tsc" + "file": "angular/api-js/executors/tsc" } ] }, @@ -378,7 +394,7 @@ { "name": "build executor", "id": "build", - "file": "angular/api-web/executors/build" + "file": "angular/api-web/executors/webpack" }, { "name": "dev-server executor", @@ -393,7 +409,7 @@ { "name": "package executor", "id": "package", - "file": "angular/api-web/executors/package" + "file": "angular/api-web/executors/rollup" } ] }, @@ -1188,6 +1204,11 @@ "id": "monorepo-ci-jenkins", "file": "shared/monorepo-ci-jenkins" }, + { + "name": "Setting up GitLab", + "id": "monorepo-ci-gitlab", + "file": "shared/monorepo-ci-gitlab" + }, { "name": "Distributed CI", "id": "distributed-builds", @@ -1370,7 +1391,7 @@ "id": "05-add-node-app" }, { - "name": "6 - Configure Proxy", + "name": "6 - Proxy Configuration", "id": "06-proxy" }, { @@ -1660,11 +1681,27 @@ "name": "run-script executor", "id": "run-script", "file": "react/api-workspace/executors/run-script" + } + ] + }, + { + "name": "js", + "id": "js", + "itemList": [ + { + "name": "application generator", + "id": "application", + "file": "react/api-js/generators/application" + }, + { + "name": "library generator", + "id": "library", + "file": "react/api-js/generators/library" }, { "name": "tsc executor", "id": "tsc", - "file": "react/api-workspace/executors/tsc" + "file": "react/api-js/executors/tsc" } ] }, @@ -1686,7 +1723,7 @@ { "name": "build executor", "id": "build", - "file": "react/api-web/executors/build" + "file": "react/api-web/executors/webpack" }, { "name": "dev-server executor", @@ -1701,7 +1738,7 @@ { "name": "package executor", "id": "package", - "file": "react/api-web/executors/package" + "file": "react/api-web/executors/rollup" } ] }, @@ -2502,6 +2539,11 @@ "id": "monorepo-ci-jenkins", "file": "shared/monorepo-ci-jenkins" }, + { + "name": "Setting up GitLab", + "id": "monorepo-ci-gitlab", + "file": "shared/monorepo-ci-gitlab" + }, { "name": "Distributed CI", "id": "distributed-builds", @@ -2932,11 +2974,27 @@ "name": "run-script executor", "id": "run-script", "file": "node/api-workspace/executors/run-script" + } + ] + }, + { + "name": "js", + "id": "js", + "itemList": [ + { + "name": "application generator", + "id": "application", + "file": "node/api-js/generators/application" + }, + { + "name": "library generator", + "id": "library", + "file": "node/api-js/generators/library" }, { "name": "tsc executor", "id": "tsc", - "file": "node/api-workspace/executors/tsc" + "file": "node/api-js/executors/tsc" } ] }, @@ -2958,7 +3016,7 @@ { "name": "build executor", "id": "build", - "file": "node/api-web/executors/build" + "file": "node/api-web/executors/webpack" }, { "name": "dev-server executor", @@ -2973,7 +3031,7 @@ { "name": "package executor", "id": "package", - "file": "node/api-web/executors/package" + "file": "node/api-web/executors/rollup" } ] }, @@ -3757,6 +3815,11 @@ "id": "monorepo-ci-jenkins", "file": "shared/monorepo-ci-jenkins" }, + { + "name": "Setting up GitLab", + "id": "monorepo-ci-gitlab", + "file": "shared/monorepo-ci-gitlab" + }, { "name": "Distributed CI", "id": "distributed-builds", diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-angular/executors/ng-packagr-lite.md b/nx-dev/nx-dev/public/documentation/latest/node/api-angular/executors/ng-packagr-lite.md index 5600146283..8a961af8ba 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-angular/executors/ng-packagr-lite.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-angular/executors/ng-packagr-lite.md @@ -22,6 +22,12 @@ Possible values: `dependencies`, `peerDependencies` When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. +### tailwindConfig + +Type: `string` + +The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured. + ### tsConfig Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-angular/executors/package.md b/nx-dev/nx-dev/public/documentation/latest/node/api-angular/executors/package.md index f1f814f0b2..c0cb8912e7 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-angular/executors/package.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-angular/executors/package.md @@ -22,6 +22,12 @@ Possible values: `dependencies`, `peerDependencies` When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. +### tailwindConfig + +Type: `string` + +The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured. + ### tsConfig Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-angular/generators/library.md b/nx-dev/nx-dev/public/documentation/latest/node/api-angular/generators/library.md index 9d79e86a6b..f0710745b6 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-angular/generators/library.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-angular/generators/library.md @@ -44,6 +44,14 @@ Type: `boolean` Generate a buildable library. +### compilationMode + +Type: `string` + +Possible values: `full`, `partial` + +Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries. + ### directory Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-workspace/executors/tsc.md b/nx-dev/nx-dev/public/documentation/latest/node/api-js/executors/tsc.md similarity index 96% rename from nx-dev/nx-dev/public/documentation/latest/node/api-workspace/executors/tsc.md rename to nx-dev/nx-dev/public/documentation/latest/node/api-js/executors/tsc.md index 04bbbfd7c6..0134023b65 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-workspace/executors/tsc.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-js/executors/tsc.md @@ -1,4 +1,4 @@ -# @nrwl/workspace:tsc +# @nrwl/js:tsc Build a project using TypeScript. diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-js/generators/application.md b/nx-dev/nx-dev/public/documentation/latest/node/api-js/generators/application.md new file mode 100644 index 0000000000..d3cb3f64db --- /dev/null +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-js/generators/application.md @@ -0,0 +1,161 @@ +# @nrwl/js:application + +Create a application + +## Usage + +```bash +nx generate application ... +``` + +```bash +nx g app ... # same +``` + +By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. + +You can specify the collection explicitly as follows: + +```bash +nx g @nrwl/js:application ... +``` + +Show what will be generated without writing to disk: + +```bash +nx g application ... --dry-run +``` + +### Examples + +Generate libs/myapp/mylib: + +```bash +nx g lib mylib --directory=myapp +``` + +## Options + +### name (_**required**_) + +Type: `string` + +Library name + +### compiler + +Default: `tsc` + +Type: `string` + +Possible values: `tsc`, `swc` + +The compiler used by the build and test targets + +### config + +Default: `project` + +Type: `string` + +Possible values: `workspace`, `project`, `npm-scripts` + +Determines how whether the project's executors should be configured in workspace.json, project.json or as npm scripts + +### directory + +Type: `string` + +A directory where the lib is placed + +### importPath + +Type: `string` + +The library name used to import it, like @myorg/my-awesome-lib + +### js + +Default: `false` + +Type: `boolean` + +Generate JavaScript files rather than TypeScript files + +### linter + +Default: `eslint` + +Type: `string` + +Possible values: `eslint`, `none` + +The tool to use for running lint checks. + +### pascalCaseFiles + +Alias(es): P + +Default: `false` + +Type: `boolean` + +Use pascal case file names. + +### setParserOptionsProject + +Default: `false` + +Type: `boolean` + +Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. + +### skipFormat + +Default: `false` + +Type: `boolean` + +Skip formatting files + +### skipTsConfig + +Default: `false` + +Type: `boolean` + +Do not update tsconfig.json for development experience. + +### strict + +Default: `true` + +Type: `boolean` + +Whether to enable tsconfig strict mode or not. + +### tags + +Type: `string` + +Add tags to the library (used for linting) + +### testEnvironment + +Default: `jsdom` + +Type: `string` + +Possible values: `jsdom`, `node` + +The test environment to use if unitTestRunner is set to jest + +### unitTestRunner + +Default: `jest` + +Type: `string` + +Possible values: `jest`, `none` + +Test runner to use for unit tests diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-js/generators/library.md b/nx-dev/nx-dev/public/documentation/latest/node/api-js/generators/library.md new file mode 100644 index 0000000000..c48725f0e4 --- /dev/null +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-js/generators/library.md @@ -0,0 +1,169 @@ +# @nrwl/js:library + +Create a library + +## Usage + +```bash +nx generate library ... +``` + +```bash +nx g lib ... # same +``` + +By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. + +You can specify the collection explicitly as follows: + +```bash +nx g @nrwl/js:library ... +``` + +Show what will be generated without writing to disk: + +```bash +nx g library ... --dry-run +``` + +### Examples + +Generate libs/myapp/mylib: + +```bash +nx g lib mylib --directory=myapp +``` + +## Options + +### name (_**required**_) + +Type: `string` + +Library name + +### buildable + +Default: `false` + +Type: `boolean` + +Generate a buildable library. + +### compiler + +Default: `tsc` + +Type: `string` + +Possible values: `tsc`, `swc` + +The compiler used by the build and test targets + +### config + +Default: `project` + +Type: `string` + +Possible values: `workspace`, `project`, `npm-scripts` + +Determines how whether the project's executors should be configured in workspace.json, project.json or as npm scripts + +### directory + +Type: `string` + +A directory where the lib is placed + +### importPath + +Type: `string` + +The library name used to import it, like @myorg/my-awesome-lib + +### js + +Default: `false` + +Type: `boolean` + +Generate JavaScript files rather than TypeScript files + +### linter + +Default: `eslint` + +Type: `string` + +Possible values: `eslint`, `none` + +The tool to use for running lint checks. + +### pascalCaseFiles + +Alias(es): P + +Default: `false` + +Type: `boolean` + +Use pascal case file names. + +### setParserOptionsProject + +Default: `false` + +Type: `boolean` + +Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. + +### skipFormat + +Default: `false` + +Type: `boolean` + +Skip formatting files + +### skipTsConfig + +Default: `false` + +Type: `boolean` + +Do not update tsconfig.json for development experience. + +### strict + +Default: `true` + +Type: `boolean` + +Whether to enable tsconfig strict mode or not. + +### tags + +Type: `string` + +Add tags to the library (used for linting) + +### testEnvironment + +Default: `jsdom` + +Type: `string` + +Possible values: `jsdom`, `node` + +The test environment to use if unitTestRunner is set to jest + +### unitTestRunner + +Default: `jest` + +Type: `string` + +Possible values: `jest`, `none` + +Test runner to use for unit tests diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-node/executors/build.md b/nx-dev/nx-dev/public/documentation/latest/node/api-node/executors/build.md index a8bf83bfd9..e4c9e13a61 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-node/executors/build.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-node/executors/build.md @@ -110,6 +110,14 @@ Type: `boolean` Defines the optimization level of the build. +### outputFileName + +Default: `main.js` + +Type: `string` + +Name of the main output file. (defaults to 'main.js') + ### outputPath Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-nx-devkit/index.md b/nx-dev/nx-dev/public/documentation/latest/node/api-nx-devkit/index.md index 92ee903d8a..85fe3b6387 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-nx-devkit/index.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-nx-devkit/index.md @@ -885,7 +885,7 @@ Example: ### getWorkspacePath -▸ **getWorkspacePath**(`tree`): `string` +▸ **getWorkspacePath**(`tree`): `"/angular.json"` \| `"/workspace.json"` \| `null` #### Parameters @@ -895,7 +895,7 @@ Example: #### Returns -`string` +`"/angular.json"` \| `"/workspace.json"` \| `null` --- @@ -1061,9 +1061,9 @@ By default javascript-style comments are allowed. #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | #### Parameters @@ -1113,9 +1113,9 @@ Reads a json file, removes all comments and parses JSON. #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | #### Parameters @@ -1139,9 +1139,9 @@ Reads a JSON file and returns the object the JSON content represents. #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | #### Parameters @@ -1346,9 +1346,9 @@ By default the JSON string is formatted with a 2 space intendation to be easy re #### Type parameters -| Name | Type | -| :--- | :------------------------- | -| `T` | extends ` object``object ` | +| Name | Type | +| :--- | :-------------------------- | +| `T` | extends `object` = `object` | #### Parameters @@ -1459,10 +1459,10 @@ Updates a JSON value to the file system tree #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | -| `U` | extends ` object``T ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | +| `U` | extends `object` = `T` | #### Parameters @@ -1569,9 +1569,9 @@ Writes a JSON value to the file system tree #### Type parameters -| Name | Type | -| :--- | :------------------------- | -| `T` | extends ` object``object ` | +| Name | Type | +| :--- | :-------------------------- | +| `T` | extends `object` = `object` | #### Parameters @@ -1596,9 +1596,9 @@ Serializes the given data to JSON and writes it to a file. #### Type parameters -| Name | Type | -| :--- | :------------------------- | -| `T` | extends ` object``object ` | +| Name | Type | +| :--- | :-------------------------- | +| `T` | extends `object` = `object` | #### Parameters diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-react-native/executors/run-android.md b/nx-dev/nx-dev/public/documentation/latest/node/api-react-native/executors/run-android.md index a32af02d3a..b5234845b8 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-react-native/executors/run-android.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-react-native/executors/run-android.md @@ -56,6 +56,14 @@ Type: `number` The port where the packager server is listening on. +### resetCache + +Default: `false` + +Type: `boolean` + +Resets metro cache + ### sync Default: `true` diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-react-native/executors/run-ios.md b/nx-dev/nx-dev/public/documentation/latest/node/api-react-native/executors/run-ios.md index 4208fe4106..0c7c27a757 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-react-native/executors/run-ios.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-react-native/executors/run-ios.md @@ -36,6 +36,14 @@ Type: `number` The port where the packager server is listening on. +### resetCache + +Default: `false` + +Type: `boolean` + +Resets metro cache + ### scheme Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/package.md b/nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/rollup.md similarity index 97% rename from nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/package.md rename to nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/rollup.md index 41be450427..6f3badf74e 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/package.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/rollup.md @@ -1,6 +1,6 @@ -# @nrwl/web:package +# @nrwl/web:rollup -Package a library +Package a library using rollup Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/core-concepts/configuration#targets. diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/build.md b/nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/webpack.md similarity index 98% rename from nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/build.md rename to nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/webpack.md index 35ce538cbd..fa14fe3533 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/build.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/webpack.md @@ -1,6 +1,6 @@ -# @nrwl/web:build +# @nrwl/web:webpack -Build a application +Build an application using webpack Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/core-concepts/configuration#targets. diff --git a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-build.md b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-build.md index faad5e0d72..5a44ab0572 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-build.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-build.md @@ -18,12 +18,6 @@ Run build in parallel: nx affected:build --parallel=5 ``` -Rerun the build target only for the projects that failed last time: - -```bash -nx affected:build --only-failed -``` - Run the build target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-e2e.md b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-e2e.md index 131394bb2f..318ba9ba75 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-e2e.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-e2e.md @@ -18,12 +18,6 @@ Run tests in parallel: nx affected:e2e --parallel=5 ``` -Rerun the test target only for the projects that failed last time: - -```bash -nx affected:e2e --only-failed -``` - Run the test target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-lint.md b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-lint.md index aab020a995..dc95f58a17 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-lint.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-lint.md @@ -18,12 +18,6 @@ Run lint in parallel: nx affected:lint --parallel=5 ``` -Rerun the lint target only for the projects that failed last time: - -```bash -nx affected:lint --only-failed -``` - Run the lint target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-test.md b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-test.md index daffcdc098..67a2575278 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-test.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected-test.md @@ -18,12 +18,6 @@ Run tests in parallel: nx affected:test --parallel=5 ``` -Rerun the test target only for the projects that failed last time: - -```bash -nx affected:test --only-failed -``` - Run the test target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected.md b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected.md index 943a118700..7950a715bf 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/cli/affected.md +++ b/nx-dev/nx-dev/public/documentation/latest/node/cli/affected.md @@ -24,12 +24,6 @@ Run tests in parallel: nx affected --target=test --parallel=5 ``` -Rerun the test target only for the projects that failed last time: - -```bash -nx affected --target=test --only-failed -``` - Run the test target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/node/executors.json b/nx-dev/nx-dev/public/documentation/latest/node/executors.json index 20e4d08631..cb26dd84b8 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/executors.json +++ b/nx-dev/nx-dev/public/documentation/latest/node/executors.json @@ -4,6 +4,7 @@ "detox", "gatsby", "jest", + "js", "linter", "next", "node", diff --git a/nx-dev/nx-dev/public/documentation/latest/node/generators.json b/nx-dev/nx-dev/public/documentation/latest/node/generators.json index c2f47c1b32..4bc621d6ae 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/generators.json +++ b/nx-dev/nx-dev/public/documentation/latest/node/generators.json @@ -5,6 +5,7 @@ "express", "gatsby", "jest", + "js", "linter", "nest", "next", diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-angular/executors/ng-packagr-lite.md b/nx-dev/nx-dev/public/documentation/latest/react/api-angular/executors/ng-packagr-lite.md index 5600146283..8a961af8ba 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-angular/executors/ng-packagr-lite.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-angular/executors/ng-packagr-lite.md @@ -22,6 +22,12 @@ Possible values: `dependencies`, `peerDependencies` When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. +### tailwindConfig + +Type: `string` + +The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured. + ### tsConfig Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-angular/executors/package.md b/nx-dev/nx-dev/public/documentation/latest/react/api-angular/executors/package.md index f1f814f0b2..c0cb8912e7 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-angular/executors/package.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-angular/executors/package.md @@ -22,6 +22,12 @@ Possible values: `dependencies`, `peerDependencies` When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`. +### tailwindConfig + +Type: `string` + +The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured. + ### tsConfig Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-angular/generators/library.md b/nx-dev/nx-dev/public/documentation/latest/react/api-angular/generators/library.md index 9d79e86a6b..f0710745b6 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-angular/generators/library.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-angular/generators/library.md @@ -44,6 +44,14 @@ Type: `boolean` Generate a buildable library. +### compilationMode + +Type: `string` + +Possible values: `full`, `partial` + +Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries. + ### directory Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-workspace/executors/tsc.md b/nx-dev/nx-dev/public/documentation/latest/react/api-js/executors/tsc.md similarity index 96% rename from nx-dev/nx-dev/public/documentation/latest/react/api-workspace/executors/tsc.md rename to nx-dev/nx-dev/public/documentation/latest/react/api-js/executors/tsc.md index 04bbbfd7c6..0134023b65 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-workspace/executors/tsc.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-js/executors/tsc.md @@ -1,4 +1,4 @@ -# @nrwl/workspace:tsc +# @nrwl/js:tsc Build a project using TypeScript. diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-js/generators/application.md b/nx-dev/nx-dev/public/documentation/latest/react/api-js/generators/application.md new file mode 100644 index 0000000000..d3cb3f64db --- /dev/null +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-js/generators/application.md @@ -0,0 +1,161 @@ +# @nrwl/js:application + +Create a application + +## Usage + +```bash +nx generate application ... +``` + +```bash +nx g app ... # same +``` + +By default, Nx will search for `application` in the default collection provisioned in `workspace.json`. + +You can specify the collection explicitly as follows: + +```bash +nx g @nrwl/js:application ... +``` + +Show what will be generated without writing to disk: + +```bash +nx g application ... --dry-run +``` + +### Examples + +Generate libs/myapp/mylib: + +```bash +nx g lib mylib --directory=myapp +``` + +## Options + +### name (_**required**_) + +Type: `string` + +Library name + +### compiler + +Default: `tsc` + +Type: `string` + +Possible values: `tsc`, `swc` + +The compiler used by the build and test targets + +### config + +Default: `project` + +Type: `string` + +Possible values: `workspace`, `project`, `npm-scripts` + +Determines how whether the project's executors should be configured in workspace.json, project.json or as npm scripts + +### directory + +Type: `string` + +A directory where the lib is placed + +### importPath + +Type: `string` + +The library name used to import it, like @myorg/my-awesome-lib + +### js + +Default: `false` + +Type: `boolean` + +Generate JavaScript files rather than TypeScript files + +### linter + +Default: `eslint` + +Type: `string` + +Possible values: `eslint`, `none` + +The tool to use for running lint checks. + +### pascalCaseFiles + +Alias(es): P + +Default: `false` + +Type: `boolean` + +Use pascal case file names. + +### setParserOptionsProject + +Default: `false` + +Type: `boolean` + +Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. + +### skipFormat + +Default: `false` + +Type: `boolean` + +Skip formatting files + +### skipTsConfig + +Default: `false` + +Type: `boolean` + +Do not update tsconfig.json for development experience. + +### strict + +Default: `true` + +Type: `boolean` + +Whether to enable tsconfig strict mode or not. + +### tags + +Type: `string` + +Add tags to the library (used for linting) + +### testEnvironment + +Default: `jsdom` + +Type: `string` + +Possible values: `jsdom`, `node` + +The test environment to use if unitTestRunner is set to jest + +### unitTestRunner + +Default: `jest` + +Type: `string` + +Possible values: `jest`, `none` + +Test runner to use for unit tests diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-js/generators/library.md b/nx-dev/nx-dev/public/documentation/latest/react/api-js/generators/library.md new file mode 100644 index 0000000000..c48725f0e4 --- /dev/null +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-js/generators/library.md @@ -0,0 +1,169 @@ +# @nrwl/js:library + +Create a library + +## Usage + +```bash +nx generate library ... +``` + +```bash +nx g lib ... # same +``` + +By default, Nx will search for `library` in the default collection provisioned in `workspace.json`. + +You can specify the collection explicitly as follows: + +```bash +nx g @nrwl/js:library ... +``` + +Show what will be generated without writing to disk: + +```bash +nx g library ... --dry-run +``` + +### Examples + +Generate libs/myapp/mylib: + +```bash +nx g lib mylib --directory=myapp +``` + +## Options + +### name (_**required**_) + +Type: `string` + +Library name + +### buildable + +Default: `false` + +Type: `boolean` + +Generate a buildable library. + +### compiler + +Default: `tsc` + +Type: `string` + +Possible values: `tsc`, `swc` + +The compiler used by the build and test targets + +### config + +Default: `project` + +Type: `string` + +Possible values: `workspace`, `project`, `npm-scripts` + +Determines how whether the project's executors should be configured in workspace.json, project.json or as npm scripts + +### directory + +Type: `string` + +A directory where the lib is placed + +### importPath + +Type: `string` + +The library name used to import it, like @myorg/my-awesome-lib + +### js + +Default: `false` + +Type: `boolean` + +Generate JavaScript files rather than TypeScript files + +### linter + +Default: `eslint` + +Type: `string` + +Possible values: `eslint`, `none` + +The tool to use for running lint checks. + +### pascalCaseFiles + +Alias(es): P + +Default: `false` + +Type: `boolean` + +Use pascal case file names. + +### setParserOptionsProject + +Default: `false` + +Type: `boolean` + +Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons. + +### skipFormat + +Default: `false` + +Type: `boolean` + +Skip formatting files + +### skipTsConfig + +Default: `false` + +Type: `boolean` + +Do not update tsconfig.json for development experience. + +### strict + +Default: `true` + +Type: `boolean` + +Whether to enable tsconfig strict mode or not. + +### tags + +Type: `string` + +Add tags to the library (used for linting) + +### testEnvironment + +Default: `jsdom` + +Type: `string` + +Possible values: `jsdom`, `node` + +The test environment to use if unitTestRunner is set to jest + +### unitTestRunner + +Default: `jest` + +Type: `string` + +Possible values: `jest`, `none` + +Test runner to use for unit tests diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-node/executors/build.md b/nx-dev/nx-dev/public/documentation/latest/react/api-node/executors/build.md index a8bf83bfd9..e4c9e13a61 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-node/executors/build.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-node/executors/build.md @@ -110,6 +110,14 @@ Type: `boolean` Defines the optimization level of the build. +### outputFileName + +Default: `main.js` + +Type: `string` + +Name of the main output file. (defaults to 'main.js') + ### outputPath Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-nx-devkit/index.md b/nx-dev/nx-dev/public/documentation/latest/react/api-nx-devkit/index.md index 5453624c5e..35bd6ee9cb 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-nx-devkit/index.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-nx-devkit/index.md @@ -885,7 +885,7 @@ Example: ### getWorkspacePath -▸ **getWorkspacePath**(`tree`): `string` +▸ **getWorkspacePath**(`tree`): `"/angular.json"` \| `"/workspace.json"` \| `null` #### Parameters @@ -895,7 +895,7 @@ Example: #### Returns -`string` +`"/angular.json"` \| `"/workspace.json"` \| `null` --- @@ -1061,9 +1061,9 @@ By default javascript-style comments are allowed. #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | #### Parameters @@ -1113,9 +1113,9 @@ Reads a json file, removes all comments and parses JSON. #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | #### Parameters @@ -1139,9 +1139,9 @@ Reads a JSON file and returns the object the JSON content represents. #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | #### Parameters @@ -1346,9 +1346,9 @@ By default the JSON string is formatted with a 2 space intendation to be easy re #### Type parameters -| Name | Type | -| :--- | :------------------------- | -| `T` | extends ` object``object ` | +| Name | Type | +| :--- | :-------------------------- | +| `T` | extends `object` = `object` | #### Parameters @@ -1459,10 +1459,10 @@ Updates a JSON value to the file system tree #### Type parameters -| Name | Type | -| :--- | :---------------------- | -| `T` | extends ` object``any ` | -| `U` | extends ` object``T ` | +| Name | Type | +| :--- | :----------------------- | +| `T` | extends `object` = `any` | +| `U` | extends `object` = `T` | #### Parameters @@ -1569,9 +1569,9 @@ Writes a JSON value to the file system tree #### Type parameters -| Name | Type | -| :--- | :------------------------- | -| `T` | extends ` object``object ` | +| Name | Type | +| :--- | :-------------------------- | +| `T` | extends `object` = `object` | #### Parameters @@ -1596,9 +1596,9 @@ Serializes the given data to JSON and writes it to a file. #### Type parameters -| Name | Type | -| :--- | :------------------------- | -| `T` | extends ` object``object ` | +| Name | Type | +| :--- | :-------------------------- | +| `T` | extends `object` = `object` | #### Parameters diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-react-native/executors/run-android.md b/nx-dev/nx-dev/public/documentation/latest/react/api-react-native/executors/run-android.md index a32af02d3a..b5234845b8 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-react-native/executors/run-android.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-react-native/executors/run-android.md @@ -56,6 +56,14 @@ Type: `number` The port where the packager server is listening on. +### resetCache + +Default: `false` + +Type: `boolean` + +Resets metro cache + ### sync Default: `true` diff --git a/nx-dev/nx-dev/public/documentation/latest/react/api-react-native/executors/run-ios.md b/nx-dev/nx-dev/public/documentation/latest/react/api-react-native/executors/run-ios.md index 4208fe4106..0c7c27a757 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/api-react-native/executors/run-ios.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-react-native/executors/run-ios.md @@ -36,6 +36,14 @@ Type: `number` The port where the packager server is listening on. +### resetCache + +Default: `false` + +Type: `boolean` + +Resets metro cache + ### scheme Type: `string` diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/package.md b/nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/rollup.md similarity index 97% rename from nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/package.md rename to nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/rollup.md index 41be450427..6f3badf74e 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/package.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/rollup.md @@ -1,6 +1,6 @@ -# @nrwl/web:package +# @nrwl/web:rollup -Package a library +Package a library using rollup Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/core-concepts/configuration#targets. diff --git a/nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/build.md b/nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/webpack.md similarity index 98% rename from nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/build.md rename to nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/webpack.md index 35ce538cbd..fa14fe3533 100644 --- a/nx-dev/nx-dev/public/documentation/latest/node/api-web/executors/build.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/api-web/executors/webpack.md @@ -1,6 +1,6 @@ -# @nrwl/web:build +# @nrwl/web:webpack -Build a application +Build an application using webpack Options can be configured in `workspace.json` when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/core-concepts/configuration#targets. diff --git a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-build.md b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-build.md index faad5e0d72..5a44ab0572 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-build.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-build.md @@ -18,12 +18,6 @@ Run build in parallel: nx affected:build --parallel=5 ``` -Rerun the build target only for the projects that failed last time: - -```bash -nx affected:build --only-failed -``` - Run the build target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-e2e.md b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-e2e.md index 131394bb2f..318ba9ba75 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-e2e.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-e2e.md @@ -18,12 +18,6 @@ Run tests in parallel: nx affected:e2e --parallel=5 ``` -Rerun the test target only for the projects that failed last time: - -```bash -nx affected:e2e --only-failed -``` - Run the test target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-lint.md b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-lint.md index aab020a995..dc95f58a17 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-lint.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-lint.md @@ -18,12 +18,6 @@ Run lint in parallel: nx affected:lint --parallel=5 ``` -Rerun the lint target only for the projects that failed last time: - -```bash -nx affected:lint --only-failed -``` - Run the lint target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-test.md b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-test.md index daffcdc098..67a2575278 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-test.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected-test.md @@ -18,12 +18,6 @@ Run tests in parallel: nx affected:test --parallel=5 ``` -Rerun the test target only for the projects that failed last time: - -```bash -nx affected:test --only-failed -``` - Run the test target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected.md b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected.md index 943a118700..7950a715bf 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/cli/affected.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/cli/affected.md @@ -24,12 +24,6 @@ Run tests in parallel: nx affected --target=test --parallel=5 ``` -Rerun the test target only for the projects that failed last time: - -```bash -nx affected --target=test --only-failed -``` - Run the test target for all projects: ```bash diff --git a/nx-dev/nx-dev/public/documentation/latest/react/executors.json b/nx-dev/nx-dev/public/documentation/latest/react/executors.json index 20e4d08631..cb26dd84b8 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/executors.json +++ b/nx-dev/nx-dev/public/documentation/latest/react/executors.json @@ -4,6 +4,7 @@ "detox", "gatsby", "jest", + "js", "linter", "next", "node", diff --git a/nx-dev/nx-dev/public/documentation/latest/react/generators.json b/nx-dev/nx-dev/public/documentation/latest/react/generators.json index c2f47c1b32..4bc621d6ae 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/generators.json +++ b/nx-dev/nx-dev/public/documentation/latest/react/generators.json @@ -5,6 +5,7 @@ "express", "gatsby", "jest", + "js", "linter", "nest", "next", diff --git a/nx-dev/nx-dev/public/documentation/latest/react/guides/configuration.md b/nx-dev/nx-dev/public/documentation/latest/react/guides/configuration.md index ef0cacd908..18a62781ad 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/guides/configuration.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/guides/configuration.md @@ -257,7 +257,7 @@ This is an example of `apps/myapp/project.json`: "projectType": "application", "targets": { "build": { - "executor": "@nrwl/web:build", + "executor": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "dependsOn": [ { @@ -362,7 +362,7 @@ The `configurations` property provides extra sets of values that are merged into ```json { "build": { - "executor": "@nrwl/web:build", + "executor": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "options": { "index": "apps/myapp/src/app.html", @@ -397,7 +397,7 @@ building the project. You can specify this using the `dependsOn`. ```json { "build": { - "executor": "@nrwl/web:build", + "executor": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "options": { "index": "apps/myapp/src/app.html", @@ -425,7 +425,7 @@ executed and only then `nx build myapp` is executed. ```json { "build-base": { - "executor": "@nrwl/web:build", + "executor": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "options": { "index": "apps/myapp/src/app.html", diff --git a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/01-create-application.md b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/01-create-application.md index cc138261c0..322fdf2671 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/01-create-application.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/01-create-application.md @@ -25,9 +25,9 @@ Application name todos Default stylesheet format CSS ``` -> You can also choose to add [Nx Cloud](https://nx.app), but its not required for the tutorial. +Enter the indicated answers. -When asked about 'preset', select `react`, and `todos` for the app name. +> You can also choose to add [Nx Cloud](https://nx.app), but its not required for the tutorial. ```treeview myorg/ @@ -46,6 +46,7 @@ myorg/ │ │ ├── .browserslistrc │ │ ├── .eslintrc.json │ │ ├── jest.config.js +│ │ ├── project.json │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ └── tsconfig.spec.json @@ -63,7 +64,7 @@ myorg/ │ │ └── index.ts │ ├── .eslintrc.json │ ├── cypress.json -│ ├── tsconfig.e2e.json +│ ├── project.json │ └── tsconfig.json ├── libs/ ├── tools/ diff --git a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/05-add-node-app.md b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/05-add-node-app.md index a56453296e..72e2ef46c0 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/05-add-node-app.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/05-add-node-app.md @@ -11,12 +11,13 @@ Nx is an open platform with plugins for many modern tools and frameworks. **To s ```bash > NX Installed plugins: - @nrwl/cypress (executors,generators) - @nrwl/jest (executors,generators) - @nrwl/linter (builders) + @nrwl/cypress (builders,generators) + @nrwl/jest (builders,generators) + @nrwl/linter (builders,generators) @nrwl/react (generators) - @nrwl/web (executors,generators) - @nrwl/workspace (executors,generators) + @nrwl/storybook (builders,generators) + @nrwl/web (builders,generators) + @nrwl/workspace (builders,generators) > NX Also available: @@ -27,7 +28,6 @@ Nx is an open platform with plugins for many modern tools and frameworks. **To s @nrwl/next (executors,generators) @nrwl/node (executors,generators) @nrwl/nx-plugin (executors,generators) - @nrwl/storybook (executors,generators) > NX Community plugins: @@ -72,7 +72,10 @@ After this is done, you should see something like this: ```treeview myorg/ ├── apps/ -│ ├── todos/ +│   ├── todos/ +│   │   ├── src/ +│   │   ├── project.json +│   │   └── proxy.conf.json │ ├── todos-e2e/ │ └── api/ │ ├── src/ @@ -83,7 +86,7 @@ myorg/ │ │ │ └── environment.prod.ts │ │ └── main.ts │ ├── jest.conf.js -│ ├── proxy.conf.json +│ ├── project.json │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json @@ -147,3 +150,7 @@ const server = app.listen(port, () => { }); server.on('error', console.error); ``` + +**Now run `npx nx serve api` to run the api server** + +Refresh the application in the browser. The React app is now able to fetch and create todos by calling the API. diff --git a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/06-proxy.md b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/06-proxy.md index b6ef88c2ce..98b3584130 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/06-proxy.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/06-proxy.md @@ -1,4 +1,4 @@ -# React Nx Tutorial - Step 6: Proxy +# React Nx Tutorial - Step 6: Proxy Configuration @@ -6,28 +6,28 @@ You passed `--frontendProject=todos` when creating the node application. What di It created a proxy configuration that allows the React application to talk to the API in development. -**To see how it works, open `workspace.json` and find the `serve` target of the todos app.** +**To see how it works, open `apps/todos/project.json` and find the `serve` target.** ```json { "serve": { - "builder": "@nrwl/web:dev-server", + "executor": "@nrwl/web:dev-server", "options": { "buildTarget": "todos:build", + "hmr": true, "proxyConfig": "apps/todos/proxy.conf.json" }, "configurations": { "production": { - "buildTarget": "todos:build:production" + "buildTarget": "todos:build:production", + "hmr": false } } } } ``` -**Note the `proxyConfig` property.** - -**Now open `proxy.conf.json`:** +Note the `proxyConfig` property which points to `apps/todos/proxy.conf.json`. Open this file. ```json { @@ -40,11 +40,11 @@ It created a proxy configuration that allows the React application to talk to th This configuration tells `npx nx serve` to forward all requests starting with `/api` to the process listening on port `3333`. -## Workspace.json, Targets, Builders +## Project.json, Targets, Executors -You configure your workspaces in `workspace.json`. This file contains the workspace projects with their architect targets. For instance, `todos` has the `build`, `serve`, `lint`, and `test` targets. This means that you can run `npx nx build todos`, `npx nx serve todos`, etc.. +You configure your apps in `apps/[app-name]/project.json`. Open `apps/todos/project.json` to see an example. This file contains configuration for the todos app. For instance, you can see the `build`, `serve`, `lint`, and `test` targets. This means that you can run `npx nx build todos`, `npx nx serve todos`, etc.. -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. +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. **Why not use shell scripts and npm scripts directly?** @@ -54,7 +54,7 @@ There are a lot of advantages to providing additional metadata to the build tool npx nx run todos:serve [options,...] Options: - --buildTarget Target which builds the application` + --buildTarget Target which builds the application --port Port to listen on. (default: 4200) --host Host to listen on. (default: localhost) --ssl Serve using HTTPS. @@ -73,4 +73,4 @@ Options: It helps with good editor integration (see [VSCode Support](/{{framework}}/getting-started/console#nx-console-for-vscode)). -But, most importantly, it provides a holistic dev experience regardless of the tools used, and enables advanced build features like distributed computation caching and distributed builds). +But, most importantly, it provides a holistic dev experience regardless of the tools used, and enables advanced build features like distributed computation caching and distributed builds. diff --git a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/07-share-code.md b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/07-share-code.md index b62c17b2a4..bae241f572 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/07-share-code.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/07-share-code.md @@ -25,8 +25,9 @@ myorg/ │ │ │ └── data.ts │ │ └── index.ts │ ├── jest.conf.js -│ ├── tsconfig.app.json +│ ├── project.json │ ├── tsconfig.json +│ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── tools/ ├── nx.json diff --git a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/08-create-libs.md b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/08-create-libs.md index d7b68b1a4a..cc069f36ea 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/08-create-libs.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/08-create-libs.md @@ -31,17 +31,18 @@ myorg/ │ └── ui/ │ ├── src/ │ │ ├── lib/ -│ │ │ └── ui/ -│ │ │ ├── ui.css -│ │ │ ├── ui.spec.tsx -│ │ │ └── ui.tsx +│ │ │ ├── ui.css +│ │ │ ├── ui.spec.tsx +│ │ │ └── ui.tsx │ │ └── index.ts │ ├── jest.conf.js -│ ├── tsconfig.app.json +│ ├── project.json │ ├── tsconfig.json +│ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── tools/ ├── nx.json +├── workspace.json ├── package.json └── tsconfig.base.json ``` @@ -49,19 +50,18 @@ myorg/ The `libs/ui/src/lib/ui.tsx` file looks like this: ```typescript -import React from 'react'; - -import './ui.css'; +import './ui.module.css'; +/* eslint-disable-next-line */ export interface UiProps {} -export const Ui = (props: UiProps) => { +export function Ui(props: UiProps) { return (
-

Welcome to ui!

+

Welcome to Ui!

); -}; +} export default Ui; ``` @@ -87,18 +87,18 @@ myorg/ │ └── ui/ │ ├── src/ │ │ ├── lib/ -│ │ │ ├── ui/ -│ │ │ │ ├── ui.css -│ │ │ │ ├── ui.spec.tsx -│ │ │ │ └── ui.tsx │ │ │ └── todos/ -│ │ │ ├── todos.css -│ │ │ ├── todos.spec.tsx -│ │ │ └── todos.tsx +│ │ │ │ ├── todos.css +│ │ │ │ ├── todos.spec.tsx +│ │ │ │ └── todos.tsx +│ │ │ ├── ui.css +│ │ │ ├── ui.spec.tsx +│ │ │ └── ui.tsx │ │ └── index.ts │ ├── jest.conf.js -│ ├── tsconfig.app.json +│ ├── project.json │ ├── tsconfig.json +│ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── tools/ ├── workspace.json @@ -110,10 +110,14 @@ myorg/ **Implement the Todos component.** ```typescript -import React from 'react'; import { Todo } from '@myorg/data'; +import './todos.module.css'; -export const Todos = (props: { todos: Todo[] }) => { +export interface TodosProps { + todos: Todo[]; +} + +export function Todos(props: TodosProps) { return ( ); -}; +} export default Todos; ``` diff --git a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/09-dep-graph.md b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/09-dep-graph.md index af1512b9f8..2988d379c6 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/09-dep-graph.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/09-dep-graph.md @@ -7,3 +7,11 @@ An Nx workspace can contain dozens or hundreds of applications and libraries. As Previously, some senior architect would create an ad-hoc dependency diagram and upload it to a corporate wiki. The diagram is not correct even on Day 1 and gets more and more out of sync with every passing day. With Nx, you can do better than that. + +Run + +```bash +npx nx dep-graph +``` + +The dependency graph page opens in a new browser window. Click on "Show all projects" to see all the apps and libraries in the workspace. diff --git a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/10-computation-caching.md b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/10-computation-caching.md index 2de982aca3..90d76e2486 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/10-computation-caching.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/10-computation-caching.md @@ -54,41 +54,4 @@ Nx read the output from cache instead of running the command for 1 out of 2 proj Nx built `api` and retrieved `todos` from its computation cache. Read more about the cache [here](/{{framework}}/core-extended/computation-caching). -## --with-deps - -As we saw already, Nx is smart, so it knows how applications and libraries in the workspace depend on each other. - -**Run `npx nx lint todos --with-deps`, and you see that Nx lints both the `todos` app and the libraries it depends on.** - -```bash -> NX Running target lint for project todos and its 2 deps. - -——————————————————————————————————————————————— - -> npx nx run todos:lint - -Linting "todos"... - -All files pass linting. - - -> npx nx run ui:lint - -Linting "ui"... - -All files pass linting. - - -> npx nx run data:lint - -Linting "data"... - -All files pass linting. - - -——————————————————————————————————————————————— - -> NX SUCCESS Running target "lint" succeeded -``` - > Add --parallel to any command, and Nx does most of the work in parallel. diff --git a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/11-test-affected-projects.md b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/11-test-affected-projects.md index a2244b5f0f..df63f5f658 100644 --- a/nx-dev/nx-dev/public/documentation/latest/react/tutorial/11-test-affected-projects.md +++ b/nx-dev/nx-dev/public/documentation/latest/react/tutorial/11-test-affected-projects.md @@ -4,7 +4,7 @@ In addition to supporting computation caching, Nx scales your development by doing code change analysis to see what is affected by a particular pull request. -**Commit all the changes in the repo**: +**Commit all the changes you have made so far**: ```bash git add . @@ -12,13 +12,17 @@ git commit -am 'init' git checkout -b testbranch ``` -**Open `libs/ui/src/lib/todos/todos.tsx` and change the component:** +**Open `libs/ui/src/lib/todos/todos.tsx` and change the component by updating the `
  • ` content to `{t.title}!!`:** ```typescript -import React from 'react'; import { Todo } from '@myorg/data'; +import './todos.module.css'; -export const Todos = (props: { todos: Todo[] }) => { +export interface TodosProps { + todos: Todo[]; +} + +export function Todos(props: TodosProps) { return ( ); -}; +} export default Todos; ``` diff --git a/nx-dev/nx-dev/public/documentation/latest/shared/computation-caching.md b/nx-dev/nx-dev/public/documentation/latest/shared/computation-caching.md index ad05be390a..b9dbff9b2e 100644 --- a/nx-dev/nx-dev/public/documentation/latest/shared/computation-caching.md +++ b/nx-dev/nx-dev/public/documentation/latest/shared/computation-caching.md @@ -130,7 +130,7 @@ Nx also caches the files generated by a command. The list of folders is listed i "projectType": "application", "architect": { "build": { - "builder": "@nrwl/web:build", + "builder": "@nrwl/web:webpack", "outputs": ["dist/apps/myapp"], "options": { "index": "apps/myapp/src/app.html", diff --git a/nx-dev/nx-dev/public/documentation/latest/shared/monorepo-ci-gitlab.md b/nx-dev/nx-dev/public/documentation/latest/shared/monorepo-ci-gitlab.md new file mode 100644 index 0000000000..d899ce5c1a --- /dev/null +++ b/nx-dev/nx-dev/public/documentation/latest/shared/monorepo-ci-gitlab.md @@ -0,0 +1,77 @@ +# Configuring CI Using GitLab and Nx + +Nx is a smart and extensible build framework, and it works really well with monorepos. Monorepos provide a lot of advantages: + +- Everything at that current commit works together. Changes can be verified across all affected parts of the organization. +- Easy to split code into composable modules +- Easier dependency management +- One toolchain setup +- Code editors and IDEs are "workspace" aware +- Consistent developer experience +- And more ... + +But they come with their own technical challenges. The more code you add into your repository, the slower the CI gets. + +## Setting Gitlab CI/CD + +Below is an example of a GitLab pipeline setup for an Nx workspace only building and testing what is affected. + +```yaml +image: node:16-alpine +stages: + - setup + - test + +install-dependencies: + stage: setup + interruptible: true + only: + - main + - merge_requests + cache: + key: + files: + - yarn.lock + paths: + - node_modules + - .yarn + script: + - yarn install --pure-lockfile --cache-folder .yarn + artifacts: + paths: + - node_modules + +.distributed: + interruptible: true + only: + - main + - merge_requests + needs: + - install-dependencies + artifacts: + paths: + - node_modules/.cache/nx + +build: + stage: test + extends: .distributed + script: + - yarn nx affected --base=HEAD~1 --target=build --parallel --max-parallel=3 + +test: + stage: test + extends: .distributed + script: + - yarn nx affected --base=HEAD~1 --target=test --parallel --max-parallel=2 +``` + +The `build` and `test` jobs implement the CI workflow using `.distributed` as template to keep +CI configuration file clearly. + +## Distributed CI with Nx Cloud + +A computation cache is created on your local machine to make the developer experience faster. This allows you to not waste time re-building, re-testing, re-linting, or any number of other actions you might take on code that hasn't changed. Because the cache is stored locally, you are the only member of your team that can take advantage of these instant commands. You can manage and share this cache manually. + +Nx Cloud allows this cache to be shared across your entire organization, meaning that any cacheable operation completed on your workspace only needs to be run once. Nx Cloud also allows you to distribute your CI across multiple machines to make sure the CI is fast even for very large repos. + +Learn more about [configuring your CI](https://nx.app/docs/configuring-ci) environment using Nx Cloud with [Distributed Caching](https://nx.app/docs/distributed-caching) and [Distributed Task Execution](https://nx.app/docs/distributed-execution) in the Nx Cloud docs. diff --git a/nx-dev/nx-dev/public/documentation/latest/shared/react-plugin.md b/nx-dev/nx-dev/public/documentation/latest/shared/react-plugin.md index 729543c46d..0619ecd467 100644 --- a/nx-dev/nx-dev/public/documentation/latest/shared/react-plugin.md +++ b/nx-dev/nx-dev/public/documentation/latest/shared/react-plugin.md @@ -84,7 +84,7 @@ React applications are built using the executors from the `@nrwl/web` plugin. ## Generators - [application](/{{framework}}/react/application) - Create an React application -- [component](/{{framework}}/react/component) - Create an React library +- [component](/{{framework}}/react/component) - Create an React component - [library](/{{framework}}/react/library) - Create an React library - [redux](/{{framework}}/react/redux) - Generate a Redux slice for a project - [storybook-configuration](/{{framework}}/react/storybook-configuration) - Set up Storybook for a react library diff --git a/nx-dev/nx-dev/public/documentation/latest/shared/using-executors.md b/nx-dev/nx-dev/public/documentation/latest/shared/using-executors.md index 52ce15ad4e..af2657cc19 100644 --- a/nx-dev/nx-dev/public/documentation/latest/shared/using-executors.md +++ b/nx-dev/nx-dev/public/documentation/latest/shared/using-executors.md @@ -21,7 +21,7 @@ The executors that are available for each project are defined and configured in "generators": {}, "targets": { "build": { - "executor": "@nrwl/web:build", + "executor": "@nrwl/web:webpack", "options": { "outputPath": "dist/apps/cart", ...