docs(core): deprecation for nameAndDirectoryFormat (#19861)
This commit is contained in:
parent
48e8f6de93
commit
4d1e0bd7e9
@ -4853,9 +4853,9 @@
|
|||||||
"disableCollapsible": false
|
"disableCollapsible": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "workspace-layout",
|
"name": "As Provided vs. Derived",
|
||||||
"path": "/deprecated/workspace-layout",
|
"path": "/deprecated/as-provided-vs-derived",
|
||||||
"id": "workspace-layout",
|
"id": "as-provided-vs-derived",
|
||||||
"isExternal": false,
|
"isExternal": false,
|
||||||
"children": [],
|
"children": [],
|
||||||
"disableCollapsible": false
|
"disableCollapsible": false
|
||||||
@ -4993,9 +4993,9 @@
|
|||||||
"disableCollapsible": false
|
"disableCollapsible": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "workspace-layout",
|
"name": "As Provided vs. Derived",
|
||||||
"path": "/deprecated/workspace-layout",
|
"path": "/deprecated/as-provided-vs-derived",
|
||||||
"id": "workspace-layout",
|
"id": "as-provided-vs-derived",
|
||||||
"isExternal": false,
|
"isExternal": false,
|
||||||
"children": [],
|
"children": [],
|
||||||
"disableCollapsible": false
|
"disableCollapsible": false
|
||||||
|
|||||||
@ -6051,13 +6051,13 @@
|
|||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "workspace-layout",
|
"id": "as-provided-vs-derived",
|
||||||
"name": "workspace-layout",
|
"name": "As Provided vs. Derived",
|
||||||
"description": "",
|
"description": "",
|
||||||
"file": "shared/deprecated/workspace-layout",
|
"file": "shared/deprecated/as-provided-vs-derived",
|
||||||
"itemList": [],
|
"itemList": [],
|
||||||
"isExternal": false,
|
"isExternal": false,
|
||||||
"path": "/deprecated/workspace-layout",
|
"path": "/deprecated/as-provided-vs-derived",
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -6226,14 +6226,14 @@
|
|||||||
"path": "/deprecated/workspace-lint",
|
"path": "/deprecated/workspace-lint",
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"/deprecated/workspace-layout": {
|
"/deprecated/as-provided-vs-derived": {
|
||||||
"id": "workspace-layout",
|
"id": "as-provided-vs-derived",
|
||||||
"name": "workspace-layout",
|
"name": "As Provided vs. Derived",
|
||||||
"description": "",
|
"description": "",
|
||||||
"file": "shared/deprecated/workspace-layout",
|
"file": "shared/deprecated/as-provided-vs-derived",
|
||||||
"itemList": [],
|
"itemList": [],
|
||||||
"isExternal": false,
|
"isExternal": false,
|
||||||
"path": "/deprecated/workspace-layout",
|
"path": "/deprecated/as-provided-vs-derived",
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"/deprecated/workspace-generators": {
|
"/deprecated/workspace-generators": {
|
||||||
|
|||||||
@ -177,7 +177,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": ["name"],
|
"required": ["name"],
|
||||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/angular:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/angular:app my-app --directory=my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Components application\" %}\n\nCreate an application with Single File Components (inline styles and inline templates):\n\n```bash\nnx g @nx/angular:app my-app --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone Components application\" %}\n\nCreate an application that is setup to use standalone components:\n\n```bash\nnx g @nx/angular:app my-app --standalone\n```\n\n{% /tab %}\n\n{% tab label=\"Set custom prefix and tags\" %}\n\nSet the prefix to apply to generated selectors and add tags to the application (used for linting).\n\n```bash\nnx g @nx/angular:app my-app --prefix=admin --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/angular:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/angular:app my-app --directory=my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Components application\" %}\n\nCreate an application with Single File Components (inline styles and inline templates):\n\n```bash\nnx g @nx/angular:app my-app --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone Components application\" %}\n\nCreate an application that is setup to use standalone components:\n\n```bash\nnx g @nx/angular:app my-app --standalone\n```\n\n{% /tab %}\n\n{% tab label=\"Set custom prefix and tags\" %}\n\nSet the prefix to apply to generated selectors and add tags to the application (used for linting).\n\n```bash\nnx g @nx/angular:app my-app --prefix=admin --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||||
"presets": []
|
"presets": []
|
||||||
},
|
},
|
||||||
"aliases": ["app"],
|
"aliases": ["app"],
|
||||||
|
|||||||
@ -204,7 +204,7 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": ["name"],
|
"required": ["name"],
|
||||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Library\" %}\n\nCreates the `my-ui-lib` library with an `ui` tag:\n\n```bash\nnx g @nx/angular:library my-ui-lib --tags=ui\n```\n\n{% /tab %}\n\n{% tab label=\"Publishable Library\" %}\n\nCreates the `my-lib` library that can be built producing an output following the Angular Package Format (APF) to be distributed as an NPM package:\n\n```bash\nnx g @nx/angular:library my-lib --publishable --import-path=@my-org/my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable Library\" %}\n\nCreates the `my-lib` library with support for incremental builds:\n\n```bash\nnx g @nx/angular:library my-lib --buildable\n```\n\n{% /tab %}\n\n{% tab label=\"Nested Folder & Import\"%}\nCreates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/angular:library --directory=libs/nested/my-lib --importPath=@myorg/nested/my-lib my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone component\"%}\nCreates the `my-standalone-lib` library with a standalone component as an entry point instead of an ng-module. The component can be used via the `myorg-standalone-component` selector.\n\n```bash\nnx g @nx/angular:library --standalone --selector=myorg-standalone-component my-standalone-lib\n```\n\n{% /tab %}\n",
|
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Library\" %}\n\nCreates the `my-ui-lib` library with an `ui` tag:\n\n```bash\nnx g @nx/angular:library my-ui-lib --tags=ui\n```\n\n{% /tab %}\n\n{% tab label=\"Publishable Library\" %}\n\nCreates the `my-lib` library that can be built producing an output following the Angular Package Format (APF) to be distributed as an NPM package:\n\n```bash\nnx g @nx/angular:library my-lib --publishable --import-path=@my-org/my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable Library\" %}\n\nCreates the `my-lib` library with support for incremental builds:\n\n```bash\nnx g @nx/angular:library my-lib --buildable\n```\n\n{% /tab %}\n\n{% tab label=\"Nested Folder & Import\"%}\nCreates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/angular:library --directory=libs/nested/my-lib --importPath=@myorg/nested/my-lib my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone component\"%}\nCreates the `my-standalone-lib` library with a standalone component as an entry point instead of an ng-module. The component can be used via the `myorg-standalone-component` selector.\n\n```bash\nnx g @nx/angular:library --standalone --selector=myorg-standalone-component my-standalone-lib\n```\n\n{% /tab %}\n",
|
||||||
"presets": []
|
"presets": []
|
||||||
},
|
},
|
||||||
"aliases": ["lib"],
|
"aliases": ["lib"],
|
||||||
|
|||||||
@ -37,7 +37,7 @@ yarn add -D @nx/esbuild
|
|||||||
### Creating a new JS library
|
### Creating a new JS library
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
You can add a new library that builds using esbuild with:
|
You can add a new library that builds using esbuild with:
|
||||||
|
|||||||
@ -147,7 +147,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["name"],
|
"required": ["name"],
|
||||||
"examplesFile": "---\ntitle: JS library generator examples\ndescription: This page contains examples for the @nx/js:lib generator.\n---\n\nThe `@nx/js:lib` generator will generate a library for you, and it will configure it according to the options you provide.\n\n```bash\nnpx nx g @nx/js:lib mylib\n```\n\nBy default, the library that is generated when you use this executor without passing any options, like the example above, will be a buildable library, using the `@nx/js:tsc` executor as a builder.\n\nYou may configure the tools you want to use to build your library, or bundle it too, by passing the `--bundler` flag. The `--bundler` flag controls the compiler and/or the bundler that will be used to build your library. If you choose `tsc` or `swc`, the result will be a buildable library using either `tsc` or `swc` as the compiler. If you choose `rollup` or `vite`, the result will be a buildable library using `rollup` or `vite` as the bundler. In the case of `rollup`, it will default to the `tsc` compiler. If you choose `esbuild`, you may use the [`esbuildOptions` property](https://esbuild.github.io/api/) in your `project.json` under the `build` target options to specify whether you wish to bundle your library or not.\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Buildable with default compiler (tsc)\" %}\n\nGenerate a buildable library using the `@nx/js:tsc` executor. This uses `tsc` as the compiler.\n\n```bash\nnpx nx g @nx/js:lib mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with SWC compiler\" %}\n\nGenerate a buildable library using [SWC](https://swc.rs) as the compiler. This will use the `@nx/js:swc` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=swc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with tsc\" %}\n\nGenerate a buildable library using tsc as the compiler. This will use the `@nx/js:tsc` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=tsc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Rollup as a bundler\" %}\n\nGenerate a buildable library using [Rollup](https://rollupjs.org) as the bundler. This will use the `@nx/rollup:rollup` executor. It will also use [SWC](https://swc.rs) as the compiler.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=rollup\n```\n\nIf you do not want to use `swc` as the compiler, and want to use the default `babel` compiler, you can do so in your `project.json` under the `build` target options, using the [`compiler` property](https://nx.dev/packages/rollup/executors/rollup#compiler):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/rollup:rollup\",\n \"options\": {\n //...\n \"compiler\": \"babel\"\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Vite as a bundler\" %}\n\nGenerate a buildable library using [Vite](https://vitejs.dev/) as the bundler. This will use the `@nx/vite:build` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Using ESBuild\" %}\n\nGenerate a buildable library using [ESBuild](https://esbuild.github.io/) as the bundler. This will use the `@nx/esbuild:esbuild` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=esbuild\n```\n\nIf you want to specify whether you want to bundle your library or not, you can do so in your `project.json` under the `build` target options, using the [`esbuildOptions` property](https://esbuild.github.io/api/):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n //...\n \"esbuildOptions\": {\n \"bundle\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Minimal publishing target\" %}\n\nGenerate a **publishable** library with a minimal publishing target. The result will be a buildable library using the `@nx/js:tsc` executor, using `tsc` as the compiler. You can change the compiler or the bundler by passing the `--bundler` flag.\n\n```bash\nnpx nx g lib mylib --publishable\n```\n\n{% /tab %}\n\n{% tab label=\"Using directory flag\" %}\n\nGenerate a library named `mylib` and put it under a directory named `myapp` (`libs/myapp/mylib`)\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=myapp`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.\n{% /callout %}\n\n```shell\nnpx nx g lib mylib --directory=libs/myapp/mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Non-buildable library\" %}\n\nGenerate a non-buildable library.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=none\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
|
"examplesFile": "---\ntitle: JS library generator examples\ndescription: This page contains examples for the @nx/js:lib generator.\n---\n\nThe `@nx/js:lib` generator will generate a library for you, and it will configure it according to the options you provide.\n\n```bash\nnpx nx g @nx/js:lib mylib\n```\n\nBy default, the library that is generated when you use this executor without passing any options, like the example above, will be a buildable library, using the `@nx/js:tsc` executor as a builder.\n\nYou may configure the tools you want to use to build your library, or bundle it too, by passing the `--bundler` flag. The `--bundler` flag controls the compiler and/or the bundler that will be used to build your library. If you choose `tsc` or `swc`, the result will be a buildable library using either `tsc` or `swc` as the compiler. If you choose `rollup` or `vite`, the result will be a buildable library using `rollup` or `vite` as the bundler. In the case of `rollup`, it will default to the `tsc` compiler. If you choose `esbuild`, you may use the [`esbuildOptions` property](https://esbuild.github.io/api/) in your `project.json` under the `build` target options to specify whether you wish to bundle your library or not.\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Buildable with default compiler (tsc)\" %}\n\nGenerate a buildable library using the `@nx/js:tsc` executor. This uses `tsc` as the compiler.\n\n```bash\nnpx nx g @nx/js:lib mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with SWC compiler\" %}\n\nGenerate a buildable library using [SWC](https://swc.rs) as the compiler. This will use the `@nx/js:swc` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=swc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with tsc\" %}\n\nGenerate a buildable library using tsc as the compiler. This will use the `@nx/js:tsc` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=tsc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Rollup as a bundler\" %}\n\nGenerate a buildable library using [Rollup](https://rollupjs.org) as the bundler. This will use the `@nx/rollup:rollup` executor. It will also use [SWC](https://swc.rs) as the compiler.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=rollup\n```\n\nIf you do not want to use `swc` as the compiler, and want to use the default `babel` compiler, you can do so in your `project.json` under the `build` target options, using the [`compiler` property](https://nx.dev/packages/rollup/executors/rollup#compiler):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/rollup:rollup\",\n \"options\": {\n //...\n \"compiler\": \"babel\"\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Vite as a bundler\" %}\n\nGenerate a buildable library using [Vite](https://vitejs.dev/) as the bundler. This will use the `@nx/vite:build` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Using ESBuild\" %}\n\nGenerate a buildable library using [ESBuild](https://esbuild.github.io/) as the bundler. This will use the `@nx/esbuild:esbuild` executor.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=esbuild\n```\n\nIf you want to specify whether you want to bundle your library or not, you can do so in your `project.json` under the `build` target options, using the [`esbuildOptions` property](https://esbuild.github.io/api/):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n //...\n \"esbuildOptions\": {\n \"bundle\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Minimal publishing target\" %}\n\nGenerate a **publishable** library with a minimal publishing target. The result will be a buildable library using the `@nx/js:tsc` executor, using `tsc` as the compiler. You can change the compiler or the bundler by passing the `--bundler` flag.\n\n```bash\nnpx nx g lib mylib --publishable\n```\n\n{% /tab %}\n\n{% tab label=\"Using directory flag\" %}\n\nGenerate a library named `mylib` and put it under a directory named `myapp` (`libs/myapp/mylib`)\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=myapp`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```shell\nnpx nx g lib mylib --directory=libs/myapp/mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Non-buildable library\" %}\n\nGenerate a non-buildable library.\n\n```bash\nnpx nx g @nx/js:lib mylib --bundler=none\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
|
||||||
"presets": []
|
"presets": []
|
||||||
},
|
},
|
||||||
"aliases": ["lib"],
|
"aliases": ["lib"],
|
||||||
|
|||||||
@ -133,7 +133,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [],
|
"required": [],
|
||||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create app in a directory\" %}\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.\n{% /callout %}\n\n```shell\nnx g app myapp --directory=apps/nested/myapp\n```\n\n{% /tab %}\n{% tab label=\"Use a custom Express server\" %}\n\n```shell\nnx g app myapp --custom-server\n```\n\n{% /tab %}\n{% tab label=\"Use plain JavaScript (not TypeScript)\" %}\n\n```shell\nnx g app myapp --js\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create app in a directory\" %}\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```shell\nnx g app myapp --directory=apps/nested/myapp\n```\n\n{% /tab %}\n{% tab label=\"Use a custom Express server\" %}\n\n```shell\nnx g app myapp --custom-server\n```\n\n{% /tab %}\n{% tab label=\"Use plain JavaScript (not TypeScript)\" %}\n\n```shell\nnx g app myapp --js\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||||
"presets": []
|
"presets": []
|
||||||
},
|
},
|
||||||
"aliases": ["app"],
|
"aliases": ["app"],
|
||||||
|
|||||||
@ -149,7 +149,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["name"],
|
"required": ["name"],
|
||||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create a new lib\" %}\n\n```shell\nnx g lib my-lib\n```\n\n{% /tab %}\n{% tab label=\"Create a new lib under a directory\" %}\n\nThe following will create a library at `libs/shared/my-lib`.\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=shared`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.\n{% /callout %}\n\n```shell\nnx g lib my-lib --directory=libs/shared/my-lib\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create a new lib\" %}\n\n```shell\nnx g lib my-lib\n```\n\n{% /tab %}\n{% tab label=\"Create a new lib under a directory\" %}\n\nThe following will create a library at `libs/shared/my-lib`.\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=shared`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```shell\nnx g lib my-lib --directory=libs/shared/my-lib\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||||
"presets": []
|
"presets": []
|
||||||
},
|
},
|
||||||
"aliases": ["lib"],
|
"aliases": ["lib"],
|
||||||
|
|||||||
@ -187,7 +187,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["name"],
|
"required": ["name"],
|
||||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:app my-app --bundler=vite\n```\n\nWhen choosing `vite` as the bundler, your unit tests will be set up with `vitest`, unless you choose `none` for `unitTestRunner`.\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/react:app my-app --directory=apps/my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/react:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:app my-app --bundler=vite\n```\n\nWhen choosing `vite` as the bundler, your unit tests will be set up with `vitest`, unless you choose `none` for `unitTestRunner`.\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/react:app my-app --directory=apps/my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/react:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||||
"presets": []
|
"presets": []
|
||||||
},
|
},
|
||||||
"aliases": ["app"],
|
"aliases": ["app"],
|
||||||
|
|||||||
@ -130,7 +130,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["name"],
|
"required": ["name"],
|
||||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```shell\nnx g @nx/vue:app my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.\n{% /callout %}\n\n```shell\nnx g @nx/vue:app my-app --directory=apps/my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```shell\nnx g @nx/vue:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```shell\nnx g @nx/vue:app my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```shell\nnx g @nx/vue:app my-app --directory=apps/my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```shell\nnx g @nx/vue:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||||
"presets": []
|
"presets": []
|
||||||
},
|
},
|
||||||
"aliases": ["app"],
|
"aliases": ["app"],
|
||||||
|
|||||||
@ -106,7 +106,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["name"],
|
"required": ["name"],
|
||||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/web:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/web:app my-app --bundler=vite\n```\n\nWhen choosing `vite` as the bundler, your unit tests will be set up with `vitest`, unless you choose `none` for `unitTestRunner`.\n\n{% /tab %}\n\n{% tab label=\"Specify directory\" %}\n\nCreate an application named `my-app` in the `my-dir` directory:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/web:app my-app --directory=apps/my-dir/my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/web:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/web:application my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/web:app my-app --bundler=vite\n```\n\nWhen choosing `vite` as the bundler, your unit tests will be set up with `vitest`, unless you choose `none` for `unitTestRunner`.\n\n{% /tab %}\n\n{% tab label=\"Specify directory\" %}\n\nCreate an application named `my-app` in the `my-dir` directory:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/web:app my-app --directory=apps/my-dir/my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/web:app my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||||
"presets": []
|
"presets": []
|
||||||
},
|
},
|
||||||
"aliases": ["app"],
|
"aliases": ["app"],
|
||||||
|
|||||||
@ -1370,9 +1370,9 @@
|
|||||||
"file": "shared/deprecated/workspace-lint"
|
"file": "shared/deprecated/workspace-lint"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "workspace-layout",
|
"name": "As Provided vs. Derived",
|
||||||
"id": "workspace-layout",
|
"id": "as-provided-vs-derived",
|
||||||
"file": "shared/deprecated/workspace-layout"
|
"file": "shared/deprecated/as-provided-vs-derived"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Workspace Generators",
|
"name": "Workspace Generators",
|
||||||
|
|||||||
120
docs/shared/deprecated/as-provided-vs-derived.md
Normal file
120
docs/shared/deprecated/as-provided-vs-derived.md
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
# As Provided vs. Derived Generator Path Options
|
||||||
|
|
||||||
|
Nx is moving toward a more transparent and predictable way of determining where code will be generated when you run a generator. The new behavior is to take generator options _as provided_ and place the generated code in the exact folder that you specify. Nx will only use the new behavior in Nx version 18. The directory can be specified with a `--directory` flag or use a fully specified path (i.e. `libs/shared/my-lib/src/my-component`). The `--directory` flag will be calculated relative to where you run the command.
|
||||||
|
|
||||||
|
In the past, Nx had lots of logic to try and _derive_ the best place to put code for you. This approach worked for some people, but there were always people that wanted to generate their code in a slightly different location. Accounting for these variations lead to either (1) people in repos with a different structure not being able to use these generators or (2) Nx introducing lots of flags to allow people to tweak where code was generated (flags like `--project`, `--flat`, `--pascalCaseFiles`, `--pascalCaseDirectory`, `--fileName`). It also caused some confusion when code was not generated in the expected location or frustration when the user did not know how to get Nx to derive the right thing.
|
||||||
|
|
||||||
|
Here are some of the issues with the `derived` behavior that are addressed with `as-provided`:
|
||||||
|
|
||||||
|
- Some generators had multiple flags for the same thing: `directory`, `path`, etc. Going forward, we only use `--directory` across all generators.
|
||||||
|
- Generators resolved the directory option inconsistently. Some resolved it relative to the workspace root while others resolved it relative to the project's source root. In the future, all generators will resolve the directory option relative to the current working directory. As such, your terminal's path autocomplete will work as expected and you can also `cd` right into the directory you want.
|
||||||
|
- Nx transformed the provided names to `kebab-case`. In the future, the name will be taken as provided. This allows for users to deviate from the `kebab-case` directory structure. Nx also included the directory in the project name, which lead to verbose names such as `products-product-detail-page`. Now that Nx takes options as provided, names will be as simple as you would like. You can keep it simple for feature projects (.e.g. `home-page`), or name libraries based on their import path like `@my-org/design-system/buttons`. You can do a mix of both, or deviate from this completely. Note that projects still need to have unique names so you might encounter an error when the name you provide is not valid, but you can resolve the conflict however suits your workspace best.
|
||||||
|
|
||||||
|
## Using Nx Console
|
||||||
|
|
||||||
|
You can use [Nx Console](/core-features/integrate-with-editors) for an intuitive experience running generators.
|
||||||
|
|
||||||
|
1. If you right-click a folder and choose `Nx generate`, the `directory` field will be populated with that folder path.
|
||||||
|
2. As you fill out the generate form, Nx Console will show you a preview of where the new files will be generated.
|
||||||
|
|
||||||
|
## Prompting
|
||||||
|
|
||||||
|
To mitigate the impact of this change of direction, Nx will prompt you when running most generators until Nx 18. We know changing these habits may take time so this prompt allows you to choose the previous behavior.
|
||||||
|
|
||||||
|
```{% command="nx g lib my-lib --directory=shared/my-lib" path="~/myorg" %}
|
||||||
|
✔ Which generator would you like to use? · @nx/node:library
|
||||||
|
|
||||||
|
> NX Generating @nx/node:library
|
||||||
|
|
||||||
|
? What should be the project name and where should it be generated? …
|
||||||
|
❯ As provided:
|
||||||
|
Name: my-lib
|
||||||
|
Root: shared/my-lib
|
||||||
|
Derived:
|
||||||
|
Name: shared-my-lib-my-lib
|
||||||
|
Root: packages/shared/my-lib/my-lib
|
||||||
|
```
|
||||||
|
|
||||||
|
There are two different kinds of generators that will prompt you to choose between `as-provided` and `derived`:
|
||||||
|
|
||||||
|
- Project Generators (applications and libraries)
|
||||||
|
- Other Code Generators (components and other code)
|
||||||
|
|
||||||
|
Your intent is your intent. However, the commands you write and run are based on how you think Nx will act. Nx used to derive the location of your code, but Nx will not in the future. In the future for the reasons stated above, Nx will _only_ take options as provided so you should no longer expect Nx to derive the location. We know it will take time to get used to the new way Nx calculates generated code paths and names.
|
||||||
|
|
||||||
|
## Project Generators
|
||||||
|
|
||||||
|
As of Nx 16.8.0, generating a project will prompt you to choose how Nx will calculate where the project should be located. For now, you can choose between `as-provided` and `derived` but `as-provided` will be the only option in Nx 18.
|
||||||
|
|
||||||
|
### Generate Paths and Names `as-provided`
|
||||||
|
|
||||||
|
This setting makes app or lib generators behave in the following way:
|
||||||
|
|
||||||
|
- `nx g app my-app` creates a new application named `my-app` in the `/my-app` folder
|
||||||
|
- `nx g lib my-lib` creates a new library named `my-lib` in the `/my-lib` folder
|
||||||
|
- `cd apps/nested/my-app && nx g app my-app` creates a new application named `my-app` in the `/apps/nested/my-app` folder
|
||||||
|
- `nx g app my-app --directory=apps/nested/my-app` creates a new application named `my-app` in the `/apps/nested/my-app` folder
|
||||||
|
- `nx g lib my-lib --directory=libs/shared/ui/my-lib` creates a new library named `my-lib` in the `/libs/shared/ui/my-lib` folder
|
||||||
|
|
||||||
|
### Use the Old `derived` Paths and Names
|
||||||
|
|
||||||
|
Choosing `derived` makes Nx behave the way it did before version 16.8.0. Nx will check the `workspaceLayout` property in `nx.json` to determine how it should calculate the path to the new project.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"workspaceLayout": {
|
||||||
|
"appsDir": "demos",
|
||||||
|
"libsDir": "packages"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
These settings would store apps in `/demos/` and libraries in `/packages/`. The paths specified are relative to the
|
||||||
|
workspace root.
|
||||||
|
|
||||||
|
This makes app or lib generators behave in the following way:
|
||||||
|
|
||||||
|
- `nx g app my-app` creates a new application named `my-app` in the `/demos/my-app` folder
|
||||||
|
- `nx g lib my-lib` creates a new library named `my-lib` in the `/packages/my-lib` folder
|
||||||
|
- `nx g app my-app --directory=nested` creates a new application named `nested-my-app` in the `/demos/nested/my-app` folder
|
||||||
|
- `nx g lib my-lib --directory=shared/ui` creates a new library named `shared-ui-my-lib` in the `/packages/shared/ui/my-lib` folder
|
||||||
|
|
||||||
|
If you accidentally generate a project in the wrong folder, use the [move generator](/nx-api/workspace/generators/move) to move it to the correct location.
|
||||||
|
|
||||||
|
## Code Generators
|
||||||
|
|
||||||
|
As of Nx 17, code generators such as `component`, `service`, and others will prompt you to choose whether or not Nx will derive the location based on your options or not. In Nx 18, Nx will take the generator options as provided. The following flags are deprecated and will be removed in Nx 18: `--project`, `--flat`, `--pascalCaseFiles`, `--pascalCaseDirectory`, `--fileName`.
|
||||||
|
|
||||||
|
### Generate Paths and Names `as-provided`
|
||||||
|
|
||||||
|
This setting makes generators behave in the following way:
|
||||||
|
|
||||||
|
- `nx g component my-component` creates a component in the root.
|
||||||
|
- `cd apps/nested/my-app && nx g component my-component` creates a new component named `my-component` in the `/apps/nested/my-app` folder
|
||||||
|
- `nx g component my-component --directory=apps/nested/my-app` creates a new component named `my-component` in the `/apps/nested/my-app` folder
|
||||||
|
- `nx g component apps/nested/my-app/my-component` creates a new component named `my-component` in the `/apps/nested/my-app` folder
|
||||||
|
|
||||||
|
{% callout type="note" title="Must generate inside a project" %}
|
||||||
|
If the directory specified is not inside a project, an error will be thrown.
|
||||||
|
{% /callout %}
|
||||||
|
|
||||||
|
### Use the Old `derived` Paths and Names
|
||||||
|
|
||||||
|
Choosing `derived` makes Nx behave the way it did before version 17. Nx will use the deprecated flags (`--project`, `--flat`, `--pascalCaseFiles`, `--pascalCaseDirectory`, `--fileName`) to calculate where to generate the code. This behavior will not be available in Nx 18.
|
||||||
|
|
||||||
|
This makes generators behave in the following way:
|
||||||
|
|
||||||
|
- `nx g component my-component` creates a component in the default project.
|
||||||
|
- `nx g component my-component --project=my-app` creates a new component named `my-component` in the `/apps/nested/my-app` folder
|
||||||
|
- `nx g component apps/nested/my-app/my-component` creates a new component named `my-component` in the `/apps/nested/my-app` folder
|
||||||
|
|
||||||
|
## Writing Scripts
|
||||||
|
|
||||||
|
If you are using `nx generate` in a script or another environment where it cannot have an interactive prompt, the command will still behave as it did before. You should opt into the new behavior and change the command with a command line flag.
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- nx g lib lib1 --no-interactive`
|
||||||
|
+ nx g lib lib1 --directory libs/lib1 --projectNameAndRootFormat as-provided --no-interactive
|
||||||
|
- nx g c button --project lib1 --no-interactive
|
||||||
|
+ nx g c button --directory libs/lib1/src/lib/button --nameAndDirectoryFormat as-provided --no-interactive
|
||||||
|
```
|
||||||
@ -1,68 +0,0 @@
|
|||||||
# Workspace Layout and projectNameAndRootFormat
|
|
||||||
|
|
||||||
As of Nx 16.8.0, generating a project will prompt you to choose how Nx will calculate where the project should be located. You can choose between `as-provided` and `derived`. `as-provided` will be the default in Nx 18.
|
|
||||||
|
|
||||||
## `as-provided`
|
|
||||||
|
|
||||||
This setting makes app or lib generators behave in the following way:
|
|
||||||
|
|
||||||
- `nx g app my-app` creates a new application named `my-app` in the `/my-app` folder
|
|
||||||
- `nx g lib my-lib` creates a new library named `my-lib` in the `/my-lib` folder
|
|
||||||
- `nx g app my-app --directory=apps/nested/my-app` creates a new application named `my-app` in the `/apps/nested/my-app` folder
|
|
||||||
- `nx g lib my-lib --directory=libs/shared/ui/my-lib` creates a new library named `my-lib` in the `/libs/shared/ui/my-lib` folder
|
|
||||||
|
|
||||||
## `derived`
|
|
||||||
|
|
||||||
Choosing `derived` makes Nx behave the way it did before version 16.8.0. Nx will check the `workspaceLayout` property in `nx.json` to determine how it should calculate the path to the new project.
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"workspaceLayout": {
|
|
||||||
"appsDir": "demos",
|
|
||||||
"libsDir": "packages"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
These settings would store apps in `/demos/` and libraries in `/packages/`. The paths specified are relative to the
|
|
||||||
workspace root.
|
|
||||||
|
|
||||||
This makes app or lib generators behave in the following way:
|
|
||||||
|
|
||||||
- `nx g app my-app` creates a new application named `my-app` in the `/demos/my-app` folder
|
|
||||||
- `nx g lib my-lib` creates a new library named `my-lib` in the `/packages/my-lib` folder
|
|
||||||
- `nx g app my-app --directory=nested` creates a new application named `nested-my-app` in the `/demos/nested/my-app` folder
|
|
||||||
- `nx g lib my-lib --directory=shared/ui` creates a new library named `shared-ui-my-lib` in the `/packages/shared/ui/my-lib` folder
|
|
||||||
|
|
||||||
If you accidentally generate a project in the wrong folder, use the [move generator](/nx-api/workspace/generators/move) to move it to the correct location.
|
|
||||||
|
|
||||||
## Skipping the Prompt
|
|
||||||
|
|
||||||
You can skip the prompt in two ways:
|
|
||||||
|
|
||||||
1. Specify a flag directly in the terminal `nx g app my-app --directory=apps/my-app --projectNameAndRootFormat=as-provided`
|
|
||||||
2. Set a default value for that property for every generator that you use.
|
|
||||||
|
|
||||||
```jsonc {% fileName="nx.json" %}
|
|
||||||
{
|
|
||||||
"generators": {
|
|
||||||
"@nx/node": {
|
|
||||||
"application": {
|
|
||||||
"projectNameAndRootFormat": "as-provided"
|
|
||||||
},
|
|
||||||
"library": {
|
|
||||||
"projectNameAndRootFormat": "as-provided"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@nx/react": {
|
|
||||||
"application": {
|
|
||||||
"projectNameAndRootFormat": "as-provided"
|
|
||||||
},
|
|
||||||
"library": {
|
|
||||||
"projectNameAndRootFormat": "as-provided"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// etc
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
@ -38,7 +38,7 @@ npm install --save-dev @nx/remix
|
|||||||
## Generate a Remix Application
|
## Generate a Remix Application
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```{% command="nx g @nx/remix:app myapp --directory=apps/myapp" path="~/acme" %}
|
```{% command="nx g @nx/remix:app myapp --directory=apps/myapp" path="~/acme" %}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ node-linker=hoisted
|
|||||||
To enable incremental builds you need to use buildable libraries.
|
To enable incremental builds you need to use buildable libraries.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
You can generate a new buildable library with:
|
You can generate a new buildable library with:
|
||||||
|
|||||||
@ -54,7 +54,7 @@ Codebases with existing unit and e2e tests should continue to use whatever runne
|
|||||||
With the Angular capability added, generate your application:
|
With the Angular capability added, generate your application:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -37,7 +37,7 @@ yarn add -D @nx/esbuild
|
|||||||
### Creating a new JS library
|
### Creating a new JS library
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
You can add a new library that builds using esbuild with:
|
You can add a new library that builds using esbuild with:
|
||||||
|
|||||||
@ -90,7 +90,7 @@ npm i -DE @nx/js@<nx-version>
|
|||||||
Then generate a project
|
Then generate a project
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```{% command="nx g @nx/js:lib ui --directory=libs/ui --simpleName --minimal}
|
```{% command="nx g @nx/js:lib ui --directory=libs/ui --simpleName --minimal}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ yarn add --dev @nx/deno
|
|||||||
## Create an Application
|
## Create an Application
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
Use the `app` generator to create a new Deno app.
|
Use the `app` generator to create a new Deno app.
|
||||||
@ -62,7 +62,7 @@ This starts the application on localhost:4200 by default.
|
|||||||
## Create a Library
|
## Create a Library
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
To create a new library, run:
|
To create a new library, run:
|
||||||
|
|||||||
@ -106,7 +106,7 @@ This generates the following files:
|
|||||||
Use the `app` generator to create a new .NET app. For this demo, use the `nx` path naming convention and the `web-api` project template.
|
Use the `app` generator to create a new .NET app. For this demo, use the `nx` path naming convention and the `web-api` project template.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -124,7 +124,7 @@ nx serve my-api
|
|||||||
To create a new library, run the library generator. Use the `classlib` template.
|
To create a new library, run the library generator. Use the `classlib` template.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -44,7 +44,7 @@ yarn add --dev @nx/express
|
|||||||
Use the `app` generator to create a new Express app.
|
Use the `app` generator to create a new Express app.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -64,7 +64,7 @@ This starts the application on localhost:3333/api by default.
|
|||||||
The `@nx/express` plugin does not have a `library` generator, but we can use the `library` generator from the `@nx/js` plugin. To create a new library, install the `@nx/js` package and run:
|
The `@nx/express` plugin does not have a `library` generator, but we can use the `library` generator from the `@nx/js` plugin. To create a new library, install the `@nx/js` package and run:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -57,7 +57,7 @@ yarn add --dev @nx/node
|
|||||||
Use the `app` generator to create a new Fastify app.
|
Use the `app` generator to create a new Fastify app.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -77,7 +77,7 @@ This starts the application on localhost:3000/api by default.
|
|||||||
To create a new library, run:
|
To create a new library, run:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -44,7 +44,7 @@ yarn add --dev @nx/node lit http-server
|
|||||||
## Create an Application
|
## Create an Application
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
We'll start with a node application and then tweak the settings to match what we need. Add a new node application to your workspace with the following command:
|
We'll start with a node application and then tweak the settings to match what we need. Add a new node application to your workspace with the following command:
|
||||||
@ -168,7 +168,7 @@ nx serve my-lit-app
|
|||||||
## Create a Library
|
## Create a Library
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
Let's create a library that our Lit application is going to consume. To create a new library, install the `@nx/js` package and run:
|
Let's create a library that our Lit application is going to consume. To create a new library, install the `@nx/js` package and run:
|
||||||
|
|||||||
@ -61,7 +61,7 @@ If you need help finding the version of `nx` you are currently using, run `nx re
|
|||||||
Let's generate a new application using `qwik-nx`.
|
Let's generate a new application using `qwik-nx`.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -73,7 +73,7 @@ nx g qwik-nx:app todo --directory=apps/todo
|
|||||||
Let's generate a new library using `qwik-nx`.
|
Let's generate a new library using `qwik-nx`.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -61,7 +61,7 @@ Using the preset provided by `@monodon/rust` will:
|
|||||||
Let's generate a new application using `@monodon/rust`.
|
Let's generate a new application using `@monodon/rust`.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -73,7 +73,7 @@ nx g @monodon/rust:binary myapp --directory=apps/myapp
|
|||||||
Let's generate a new library using `@monodon/rust`.
|
Let's generate a new library using `@monodon/rust`.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -54,7 +54,7 @@ pnpm i --save-dev @nx/web solid-devtools vite-plugin-solid
|
|||||||
## Create an Application
|
## Create an Application
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
We'll start with a web application and then tweak the settings to match what we need. Add a new web application to your
|
We'll start with a web application and then tweak the settings to match what we need. Add a new web application to your
|
||||||
@ -233,7 +233,7 @@ You can now run `nx serve my-solid-app` and your Solid application can be viewed
|
|||||||
## Create a Library
|
## Create a Library
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
Let's create a library that our Solid application is going to consume. To create a new library, install the `@nx/js`
|
Let's create a library that our Solid application is going to consume. To create a new library, install the `@nx/js`
|
||||||
|
|||||||
@ -274,7 +274,7 @@ Navigate to `http://localhost:4200` and you should see your application.
|
|||||||
Instead of having our Counter directly defined in `App.svelte` file, let's create a library that we can import into our application.
|
Instead of having our Counter directly defined in `App.svelte` file, let's create a library that we can import into our application.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -240,7 +240,7 @@ nx serve acme
|
|||||||
Instead of having our Counter directly defined in the app we can instead create a library that exports the Counter component.
|
Instead of having our Counter directly defined in the app we can instead create a library that exports the Counter component.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
Create a new library `nx generate @nx/js:library --name=Counter --directory=libs/counter --unitTestRunner=vitest --bundler=vite --importPath=@acme/counter`
|
Create a new library `nx generate @nx/js:library --name=Counter --directory=libs/counter --unitTestRunner=vitest --bundler=vite --importPath=@acme/counter`
|
||||||
|
|||||||
@ -43,7 +43,7 @@ pnpm add -D @nx/deno
|
|||||||
{% /tabs %}
|
{% /tabs %}
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
Then generate a new Deno app with the following command:
|
Then generate a new Deno app with the following command:
|
||||||
|
|||||||
@ -41,7 +41,7 @@ pnpm add -D @nx/deno
|
|||||||
{% /tabs %}
|
{% /tabs %}
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
Then generate a new Deno app with the following command:
|
Then generate a new Deno app with the following command:
|
||||||
|
|||||||
@ -21,7 +21,7 @@ Let’s see how we can implement this solution:
|
|||||||
According to the framework you are using, use the corresponding generator to generate a new library. Let’s suppose that you are using React and all your stories are using the `@storybook/react-vite` framework:
|
According to the framework you are using, use the corresponding generator to generate a new library. Let’s suppose that you are using React and all your stories are using the `@storybook/react-vite` framework:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -87,7 +87,7 @@ Let's assume in this case that all our libraries are using Angular.
|
|||||||
Let's generate three Angular libraries, one for each scope, and let's call them `storybook-host-client`, `storybook-host-admin`, and `storybook-host-shared`. We can do this by running the following commands:
|
Let's generate three Angular libraries, one for each scope, and let's call them `storybook-host-client`, `storybook-host-admin`, and `storybook-host-shared`. We can do this by running the following commands:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The commands below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The commands below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -29,7 +29,7 @@ We are going to assume that you are at the state where you already have your `st
|
|||||||
It does not matter which framework you use for the host Storybook library. It can be any framework really, and it does not have to be one of the frameworks that are used in the hosted apps. The only thing that is important is for this host library to have _at least one story_. This is important, or else Storybook will not load. The one story can be a component, for example, which would work like a title for the application, or any other introduction to your Storybook you see fit.
|
It does not matter which framework you use for the host Storybook library. It can be any framework really, and it does not have to be one of the frameworks that are used in the hosted apps. The only thing that is important is for this host library to have _at least one story_. This is important, or else Storybook will not load. The one story can be a component, for example, which would work like a title for the application, or any other introduction to your Storybook you see fit.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
So, let’s use React for the Storybook Composition host library:
|
So, let’s use React for the Storybook Composition host library:
|
||||||
|
|||||||
@ -227,7 +227,7 @@
|
|||||||
- [Deprecated](/deprecated)
|
- [Deprecated](/deprecated)
|
||||||
- [workspace.json](/deprecated/workspace-json)
|
- [workspace.json](/deprecated/workspace-json)
|
||||||
- [workspace-lint](/deprecated/workspace-lint)
|
- [workspace-lint](/deprecated/workspace-lint)
|
||||||
- [workspace-layout](/deprecated/workspace-layout)
|
- [As Provided vs. Derived](/deprecated/as-provided-vs-derived)
|
||||||
- [Workspace Generators](/deprecated/workspace-generators)
|
- [Workspace Generators](/deprecated/workspace-generators)
|
||||||
- [Workspace Executors](/deprecated/workspace-executors)
|
- [Workspace Executors](/deprecated/workspace-executors)
|
||||||
- [defaultCollection](/deprecated/default-collection)
|
- [defaultCollection](/deprecated/default-collection)
|
||||||
|
|||||||
@ -16,7 +16,7 @@ nx g @nx/angular:application my-app
|
|||||||
Create an application named `my-app` in the `my-dir` directory and use `scss` for styles:
|
Create an application named `my-app` in the `my-dir` directory and use `scss` for styles:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@ -35,7 +35,7 @@ nx g @nx/angular:library my-lib --buildable
|
|||||||
Creates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:
|
Creates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@ -118,7 +118,7 @@ npx nx g lib mylib --publishable
|
|||||||
Generate a library named `mylib` and put it under a directory named `myapp` (`libs/myapp/mylib`)
|
Generate a library named `mylib` and put it under a directory named `myapp` (`libs/myapp/mylib`)
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=myapp`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=myapp`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
{% tab label="Create app in a directory" %}
|
{% tab label="Create app in a directory" %}
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -13,7 +13,7 @@ nx g lib my-lib
|
|||||||
The following will create a library at `libs/shared/my-lib`.
|
The following will create a library at `libs/shared/my-lib`.
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=shared`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=shared`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -9,7 +9,7 @@ description: This page contains examples for the @nx/nuxt:app generator.
|
|||||||
{% tab label="Create app in a directory" %}
|
{% tab label="Create app in a directory" %}
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -28,7 +28,7 @@ When choosing `vite` as the bundler, your unit tests will be set up with `vitest
|
|||||||
Create an application named `my-app` in the `my-dir` directory and use `scss` for styles:
|
Create an application named `my-app` in the `my-dir` directory and use `scss` for styles:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@ -16,7 +16,7 @@ nx g @nx/vue:app my-app
|
|||||||
Create an application named `my-app` in the `my-dir` directory and use `scss` for styles:
|
Create an application named `my-app` in the `my-dir` directory and use `scss` for styles:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -28,7 +28,7 @@ When choosing `vite` as the bundler, your unit tests will be set up with `vitest
|
|||||||
Create an application named `my-app` in the `my-dir` directory:
|
Create an application named `my-app` in the `my-dir` directory:
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [workspace layout documentation](/deprecated/workspace-layout) for more details.
|
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user