Compare commits

...

24 Commits

Author SHA1 Message Date
Jason Jean 25c05e348c Release 12.5.6 2021-07-05 12:49:34 -04:00
Jason Jean 868fd43433 fix(core): include dependencies of projects which do not have a target (#6245) 2021-07-05 11:54:58 -04:00
vsavkin 7859ebad8e fix(misc): dep graph should not remove deps 2021-07-04 20:06:38 -04:00
vsavkin 3a0b0b3a97 fix(core): error messase when missing targets 2021-07-03 21:20:43 -04:00
vsavkin d38ec761ed fix(core): fix fallback for npm scripts 2021-07-03 20:46:40 -04:00
vsavkin 310e68b04b Release 12.5.2 2021-07-02 09:42:10 -04:00
Victor Savkin 5bf4d3d413 fix(core): correct detect run commands when using project.json (#6221) 2021-07-02 09:39:26 -04:00
Kirils L dc4270d2ba fix(core): make missing output check more comprehensive (#6204) 2021-07-02 09:39:19 -04:00
Jason Jean 98cb4fcce7 Release 12.5.1 2021-06-30 11:48:15 -04:00
Craigory V Coppola b4d685e187 fix(core): convert-to-nx-project should not prompt for project when --all is passed (#6179) 2021-06-30 10:54:48 -04:00
James Henry c9d7b3e206 fix(core): affected base and head logs (#6164) 2021-06-30 10:54:48 -04:00
Benjamin Cabanes 3c459ad61a docs(core): add nx speaker (#6178) 2021-06-30 10:46:17 -04:00
Benjamin Cabanes f819e002f7 docs(core): misc cf update (#6177) 2021-06-30 10:46:17 -04:00
Benjamin Cabanes 4f80928307 docs(core): misc cf update (#6176) 2021-06-30 10:46:17 -04:00
Benjamin Cabanes e56cdc3dbf docs(core): misc cf content (#6174) 2021-06-30 10:46:17 -04:00
Leosvel Pérez Espinosa e4b35daba1 fix(angular): check for angular.json when converting config event path (#6170) 2021-06-30 10:45:44 -04:00
Benjamin Cabanes 44699069c4 docs(core): nxdev update cf (#6161) 2021-06-30 10:45:24 -04:00
Brandon 6d2206cbc8 docs(core): update Using Nx guide order (#6169) 2021-06-30 10:45:24 -04:00
Katerina Skroumpelou 27c6938135 docs(nxdev): bad formatting in migrate docs (#6166) 2021-06-30 10:45:08 -04:00
Craigory V Coppola 5033833818 cleanup(core): helpful project json messaging (#6158) 2021-06-30 10:44:12 -04:00
Isaac Mann 5c1e7f2a35 docs(nxdevkit): executor with plugin (#6154)
* docs(devkit): custom executor with nx-plugin

* docs(nxdev): add generated docs

* docs(nxdev): generate docs

* Update nx-dev/nx-dev/public/documentation/latest/shared/tools-workspace-builders.md

Co-authored-by: Brandon <robertsbt@gmail.com>

* Update nx-dev/nx-dev/public/documentation/latest/shared/tools-workspace-builders.md

Co-authored-by: Brandon <robertsbt@gmail.com>

* docs(nxdev): update

* docs(nxdev): docs(nxdev): update

Co-authored-by: Isaac Mann <isaacplmann+git@gmail.com>
Co-authored-by: Brandon <robertsbt@gmail.com>
2021-06-30 10:44:12 -04:00
Noriyuki Shinpuku 45fa390b00 Revert "feat(react): update generator defaults in workspace.json for strict mode (#5529)" (#6146)
This reverts commit bcdbb02aaf.
2021-06-30 10:44:12 -04:00
Jason Jean e5e62ab3b9 chore(nxdev): update latest version documentation to v12.5.0 2021-06-30 10:44:12 -04:00
Juri Strumpflohner a7ca658ed8 cleanup(angular): stories generator adjustments (#6102) 2021-06-30 10:44:12 -04:00
170 changed files with 3895 additions and 1400 deletions
+9 -7
View File
@@ -1,15 +1,17 @@
# migrate
Creates a migrations file or runs migrations from the migrations file.
# migrate
Creates a migrations file or runs migrations from the migrations file.
- Migrate packages and create migrations.json (e.g., nx migrate @nrwl/workspace@latest)
- Run migrations (e.g., nx migrate --run-migrations=migrations.json)
## Usage
```bash
nx migrate
```
## Usage
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
```bash
nx migrate
```
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
+7 -9
View File
@@ -272,7 +272,7 @@ Your `angular.json` file can be renamed to `workspace.json` and Nx will process
## project.json
Project configurations can also be independent files, referenced by `angular.json`. For instance, an `angular.json` may contain projects configured as below.
In version 2 workspaces, project configurations can also be independent files, referenced by `angular.json`. For instance, an `angular.json` may contain projects configured as below.
```json
{
@@ -286,14 +286,12 @@ This tells Nx that all configuration for that project is found in the `libs/myli
```json
{
"mylib": {
"root": "libs/mylib/",
"sourceRoot": "libs/mylib/src",
"projectType": "library",
"targets": {},
"tags": [],
"implicitDependencies": []
}
"root": "libs/mylib/",
"sourceRoot": "libs/mylib/src",
"projectType": "library",
"targets": {},
"tags": [],
"implicitDependencies": []
}
```
+30 -30
View File
@@ -86,21 +86,11 @@
"name": "Using Nx",
"id": "core-concepts",
"itemList": [
{
"name": "Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Mental Model",
"id": "mental-model",
"file": "shared/mental-model"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "angular/guides/update"
},
{
"name": "Configuration",
"id": "configuration",
@@ -110,6 +100,16 @@
"name": "Nx Plugins and Devkit",
"id": "nx-devkit",
"file": "shared/devkit-and-nx-plugins"
},
{
"name": "Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "angular/guides/update"
}
]
},
@@ -1226,21 +1226,11 @@
"name": "Using Nx",
"id": "core-concepts",
"itemList": [
{
"name": "Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Mental Model",
"id": "mental-model",
"file": "shared/mental-model"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "shared/update"
},
{
"name": "Configuration",
"id": "configuration",
@@ -1250,6 +1240,16 @@
"name": "Nx Plugins and Devkit",
"id": "nx-devkit",
"file": "shared/devkit-and-nx-plugins"
},
{
"name": "Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "shared/update"
}
]
},
@@ -2330,21 +2330,11 @@
"name": "Using Nx",
"id": "core-concepts",
"itemList": [
{
"name": "Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Mental Model",
"id": "mental-model",
"file": "shared/mental-model"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "shared/update"
},
{
"name": "Configuration",
"id": "configuration",
@@ -2354,6 +2344,16 @@
"name": "Nx Plugins and Devkit",
"id": "nx-devkit",
"file": "shared/devkit-and-nx-plugins"
},
{
"name": "Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Updating Nx",
"id": "updating-nx",
"file": "shared/update"
}
]
},
+9 -7
View File
@@ -1,15 +1,17 @@
# migrate
Creates a migrations file or runs migrations from the migrations file.
# migrate
Creates a migrations file or runs migrations from the migrations file.
- Migrate packages and create migrations.json (e.g., nx migrate @nrwl/workspace@latest)
- Run migrations (e.g., nx migrate --run-migrations=migrations.json)
## Usage
```bash
nx migrate
```
## Usage
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
```bash
nx migrate
```
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
+6 -8
View File
@@ -320,14 +320,12 @@ This tells Nx that all configuration for that project is found in the `libs/myli
```json
{
"mylib": {
"root": "libs/mylib/",
"sourceRoot": "libs/mylib/src",
"projectType": "library",
"targets": {},
"tags": [],
"implicitDependencies": []
}
"root": "libs/mylib/",
"sourceRoot": "libs/mylib/src",
"projectType": "library",
"targets": {},
"tags": [],
"implicitDependencies": []
}
```
+9 -7
View File
@@ -1,15 +1,17 @@
# migrate
Creates a migrations file or runs migrations from the migrations file.
# migrate
Creates a migrations file or runs migrations from the migrations file.
- Migrate packages and create migrations.json (e.g., nx migrate @nrwl/workspace@latest)
- Run migrations (e.g., nx migrate --run-migrations=migrations.json)
## Usage
```bash
nx migrate
```
## Usage
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
```bash
nx migrate
```
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
### Examples
+6 -8
View File
@@ -308,14 +308,12 @@ This tells Nx that all configuration for that project is found in the `libs/myli
```json
{
"mylib": {
"root": "libs/mylib/",
"sourceRoot": "libs/mylib/src",
"projectType": "library",
"targets": {},
"tags": [],
"implicitDependencies": []
}
"root": "libs/mylib/",
"sourceRoot": "libs/mylib/src",
"projectType": "library",
"targets": {},
"tags": [],
"implicitDependencies": []
}
```
@@ -35,6 +35,30 @@ export function DocViewer({
<title>
{document.data.title} | Nx {flavor.label} documentation
</title>
<meta
name="twitter:title"
content={document.data.title ?? `Nx {flavor.label} documentation`}
/>
<meta
name="twitter:description"
content="With Nx, you can develop multiple full-stack applications holistically and share code between them all in the same workspace. Add Cypress, Jest, Prettier, and Storybook into your dev workflow."
/>
<meta name="twitter:image" content="/images/nx-media.jpg" />
<meta
name="twitter:image:alt"
content="Nx: Smart, Extensible Build Framework"
/>
<meta
property="og:description"
content="With Nx, you can develop multiple full-stack applications holistically and share code between them all in the same workspace. Add Cypress, Jest, Prettier, and Storybook into your dev workflow."
/>
<meta
property="og:title"
content={document.data.title ?? `Nx {flavor.label} documentation`}
/>
<meta property="og:image" content="/images/nx-media.jpg" />
<meta property="og:image:width" content="1000" />
<meta property="og:image:height" content="300" />
</Head>
<div className="w-full max-w-screen-lg mx-auto">
<div className="lg:flex">
-26
View File
@@ -17,36 +17,10 @@ export default function CustomApp({ Component, pageProps }: AppProps) {
return (
<>
<Head>
<title>Nx: Smart, Extensible Build Framework</title>
<meta charSet="utf-8" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@nxdevtools" />
<meta name="twitter:creator" content="@nrwl_io" />
<meta
name="twitter:title"
content="Nx: Smart, Extensible Build Framework"
/>
<meta
name="twitter:description"
content="With Nx, you can develop multiple full-stack applications holistically and share code between them all in the same workspace. Add Cypress, Jest, Prettier, and Storybook into your dev workflow."
/>
<meta name="twitter:image" content="/images/nx-media.jpg" />
<meta
name="twitter:image:alt"
content="Nx: Smart, Extensible Build Framework"
/>
<meta property="og:url" content="https://nx.dev" />
<meta
property="og:description"
content="With Nx, you can develop multiple full-stack applications holistically and share code between them all in the same workspace. Add Cypress, Jest, Prettier, and Storybook into your dev workflow."
/>
<meta
property="og:title"
content="Nx: Smart, Extensible Build Framework"
/>
<meta property="og:image" content="/images/nx-media.jpg" />
<meta property="og:image:width" content="1000" />
<meta property="og:image:height" content="300" />
<link
rel="apple-touch-icon"
sizes="180x180"
+23 -1
View File
@@ -25,8 +25,30 @@ export function AngularPage() {
content="Nx is a suite of powerful dev tools that help developers build, test, and scale full-stack Angular
applications with integration with modern libraries like Jest, Cypress, Storybook, NgRx, ESLint, and more."
/>
<meta name="twitter:title" content="Nx and Modern Angular" />
<meta
name="twitter:description"
content="Nx is a suite of powerful dev tools that help developers build, test, and scale full-stack Angular
applications with integration with modern libraries like Jest, Cypress, Storybook, NgRx, ESLint, and more."
/>
<meta name="twitter:image" content="/images/nx-media.jpg" />
<meta
name="twitter:image:alt"
content="Nx: Smart, Extensible Build Framework"
/>
<meta property="og:url" content="https://nx.dev/angular" />
<meta
property="og:description"
content="Nx is a suite of powerful dev tools that help developers build, test, and scale full-stack Angular
applications with integration with modern libraries like Jest, Cypress, Storybook, NgRx, ESLint, and more."
/>
<meta property="og:title" content="Nx and Modern Angular" />
<meta property="og:image" content="/images/nx-media.jpg" />
<meta property="og:image:width" content="1000" />
<meta property="og:image:height" content="300" />
</Head>
<Header
useDarkBackground={false}
showSearch={false}
flavor={{
name: storedFlavor || 'angular',
@@ -484,7 +506,7 @@ export function AngularPage() {
<NxUsersShowcase />
</div>
</main>
<Footer />
<Footer useDarkBackground={false} />
</>
);
}
+21 -1
View File
@@ -36,8 +36,28 @@ export function Community(props: CommunityProps) {
<Head>
<title>Nx Community and Plugin Listing</title>
<meta name="description" content="Nx Community and Plugin Listing" />
<meta name="twitter:title" content="Nx Community and Plugin Listing" />
<meta
name="twitter:description"
content="With Nx, you can develop multiple full-stack applications holistically and share code between them all in the same workspace. Add Cypress, Jest, Prettier, and Storybook into your dev workflow."
/>
<meta name="twitter:image" content="/images/nx-media.jpg" />
<meta
name="twitter:image:alt"
content="Nx: Smart, Extensible Build Framework"
/>
<meta property="og:url" content="https://nx.dev/community" />
<meta
property="og:description"
content="With Nx, you can develop multiple full-stack applications holistically and share code between them all in the same workspace. Add Cypress, Jest, Prettier, and Storybook into your dev workflow."
/>
<meta property="og:title" content="Nx Community and Plugin Listing" />
<meta property="og:image" content="/images/nx-media.jpg" />
<meta property="og:image:width" content="1000" />
<meta property="og:image:height" content="300" />
</Head>
<Header
useDarkBackground={false}
showSearch={false}
flavor={{
name: storedFlavor || 'react',
@@ -297,7 +317,7 @@ export function Community(props: CommunityProps) {
</div>
</div>
</main>
<Footer />
<Footer useDarkBackground={false} />
</>
);
}
+335
View File
@@ -0,0 +1,335 @@
import React from 'react';
import Head from 'next/head';
import { Footer, Header } from '@nrwl/nx-dev/ui/common';
import { useStorage } from '../lib/use-storage';
export function ConfPage() {
const { value: storedFlavor } = useStorage('flavor');
const { value: storedVersion } = useStorage('version');
return (
<>
<Head>
<title>Announcing the first ever Nx Conf - September 16th-17th</title>
<meta
name="description"
content="Nx Conf is a new, free-to-attend, 2-day conference featuring members of the Nx team and community. Join us as we share our ideas and expertise about making development faster, more scalable, and more collaborative."
/>
<meta
name="twitter:title"
content="Announcing the first ever Nx Conf - September 16th-17th"
/>
<meta
name="twitter:description"
content="Nx Conf is a new, free-to-attend, 2-day conference featuring members of the Nx team and community. Join us as we share our ideas and expertise about making development faster, more scalable, and more collaborative."
/>
<meta name="twitter:image" content="/images/nx-conf-media.jpg" />
<meta
name="twitter:image:alt"
content="Nx Conf - Nx: Smart, Extensible Build Framework"
/>
<meta property="og:url" content="https://nx.dev/conf" />
<meta
property="og:description"
content="Nx Conf is a new, free-to-attend, 2-day conference featuring members of the Nx team and community. Join us as we share our ideas and expertise about making development faster, more scalable, and more collaborative."
/>
<meta
property="og:title"
content="Announcing the first ever Nx Conf - September 16th-17th"
/>
<meta property="og:image" content="/images/nx-conf-media.jpg" />
<meta property="og:image:width" content="1000" />
<meta property="og:image:height" content="500" />
</Head>
<Header
useDarkBackground={true}
showSearch={false}
flavor={{
name: storedFlavor || 'react',
value: storedFlavor || 'react',
}}
version={{
name: storedVersion || 'Latest',
value: storedVersion || 'latest',
}}
/>
<main>
<div
className="w-full overflow-hidden bg-blue-nx-base"
style={{
background:
"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Crect width='2' height='2' fill='white' fill-opacity='0.15'/%3E%3C/svg%3E\"), linear-gradient(180deg, #143055 0%, #0b1a2d 100%)",
}}
>
{/*Nx conf*/}
<div className="max-w-screen-lg xl:max-w-screen-xl mx-auto px-5 py-5 text-white">
<div className="mt-24 py-48 flex lg:flex-row flex-col items-start">
<div className="w-full lg:w-2/5 flex flex-col lg:pb-0 pb-10 mt-8 lg:mt-0 relative">
<svg
id="nx-conf-glow"
className="z-0 absolute w-full"
style={{
transform: 'scale(1.5, 1.5) translate3d(-12%, -25%, 0)',
}}
width="700"
height="700"
viewBox="0 0 872 812"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g filter="url(#blur-100)">
<circle
cx="393.739"
cy="460.779"
r="196.739"
fill="url(#blob1)"
/>
<circle
cx="511.696"
cy="267.957"
r="117.957"
fill="url(#blob2)"
/>
<ellipse
cx="393.739"
cy="307.13"
rx="78.3475"
ry="78.7828"
fill="url(#blob3)"
/>
<circle
cx="571.327"
cy="400.712"
r="136.673"
fill="url(#blob4)"
/>
</g>
<defs>
<filter id="blur-100" filterUnits="userSpaceOnUse">
<feGaussianBlur stdDeviation="100" />
</filter>
<linearGradient
id="blob1"
x1="237.672"
y1="291.154"
x2="512.287"
y2="657.518"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#70C6A6" />
<stop offset="1" stopColor="#45BC98" stopOpacity="0" />
</linearGradient>
<linearGradient
id="blob2"
x1="511.713"
y1="150"
x2="511.713"
y2="456.644"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#70C6A6" />
<stop offset="1" stopColor="#45BC98" stopOpacity="0" />
</linearGradient>
<linearGradient
id="blob3"
x1="393.75"
y1="228.348"
x2="393.75"
y2="433.154"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#70C6A6" />
<stop offset="1" stopColor="#45BC98" stopOpacity="0" />
</linearGradient>
<linearGradient
id="blob4"
x1="571.346"
y1="264.039"
x2="571.346"
y2="619.339"
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#70C6A6" />
<stop offset="1" stopColor="#45BC98" stopOpacity="0" />
</linearGradient>
</defs>
</svg>
<svg
id="nx-conf-logo"
className="z-10 -left-60 -top-60 w-full"
role="img"
width="446"
height="86"
viewBox="0 0 446 86"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M407.071 31.4634V84.9512H417.42V31.4634H443.292V22.0244H417.42V17.7244C417.42 14.7878 418.558 12.6902 420.835 11.4317C423.112 10.1033 426.147 9.43902 429.942 9.43902C432.909 9.43902 435.461 9.68374 437.6 10.1732C439.808 10.5927 441.67 11.0472 443.188 11.5366L445.258 2.72683C443.257 2.02764 440.981 1.39837 438.428 0.839023C435.944 0.279675 433.116 0 429.942 0C423.457 0 418.006 1.57317 413.591 4.71951C409.244 7.79593 407.071 12.1659 407.071 17.8293V22.0244H389.478V31.4634H407.071Z"
fill="white"
/>
<path
d="M180.934 80.0219C185.556 84.0073 192.386 86 201.424 86C209.427 86 215.567 84.3569 219.845 81.0707C224.122 77.7845 226.503 72.9252 226.986 66.4927L216.844 65.8634C216.637 69.4293 215.257 72.1211 212.704 73.939C210.152 75.687 206.392 76.561 201.424 76.561C195.698 76.561 191.42 75.3724 188.592 72.9951C185.832 70.6179 184.452 67.0171 184.452 62.1927V45.2024C184.452 40.1683 185.832 36.4626 188.592 34.0854C191.351 31.6382 195.56 30.4146 201.217 30.4146C206.254 30.4146 210.048 31.4634 212.601 33.561C215.154 35.6585 216.568 38.8748 216.844 43.2098L226.986 42.5805C226.503 35.5187 224.088 30.1699 219.741 26.5341C215.464 22.8285 209.324 20.9756 201.321 20.9756C192.352 20.9756 185.556 23.0382 180.934 27.1634C176.38 31.2187 174.104 37.2317 174.104 45.2024V62.1927C174.104 70.0236 176.38 75.9667 180.934 80.0219Z"
fill="white"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M253.208 79.9171C257.693 83.9724 264.109 86 272.457 86C280.805 86 287.187 83.9724 291.602 79.9171C296.086 75.7919 298.329 69.8837 298.329 62.1927V45.2024C298.329 37.4415 296.086 31.4634 291.602 27.2683C287.187 23.0732 280.839 20.9756 272.56 20.9756C264.212 20.9756 257.796 23.0732 253.312 27.2683C248.827 31.4634 246.585 37.4415 246.585 45.2024V62.1927C246.585 69.8837 248.793 75.7919 253.208 79.9171ZM284.151 72.9951C281.598 75.3724 277.7 76.561 272.457 76.561C267.214 76.561 263.316 75.3724 260.763 72.9951C258.21 70.6179 256.934 67.0171 256.934 62.1927V45.2024C256.934 40.1683 258.21 36.4626 260.763 34.0854C263.316 31.6382 267.214 30.4146 272.457 30.4146C277.7 30.4146 281.598 31.6382 284.151 34.0854C286.704 36.4626 287.98 40.1683 287.98 45.2024V62.1927C287.98 67.0171 286.704 70.6179 284.151 72.9951Z"
fill="white"
/>
<path
d="M319.067 84.9512V22.0244H329.415V32.5122H332.52C334.038 28.9463 336.418 26.1496 339.661 24.122C342.903 22.0244 346.594 20.9756 350.734 20.9756C356.943 20.9756 361.841 22.8984 365.429 26.7439C369.017 30.5894 370.81 35.8333 370.81 42.4756V84.9512H360.462V44.5732C360.462 40.1683 359.392 36.8122 357.253 34.5049C355.184 32.1276 352.183 30.939 348.25 30.939C345.145 30.939 341.972 31.8829 338.729 33.7707C335.556 35.6585 332.451 38.3854 329.415 41.9512V84.9512H319.067Z"
fill="white"
/>
<path
d="M0 21.9504V84.8056H10.3081V41.8545C13.3318 38.2927 16.4243 35.569 19.5854 33.6833C22.8153 31.7977 25.9765 30.8549 29.0689 30.8549C32.986 30.8549 35.9753 32.0421 38.037 34.4166C40.1673 36.7213 41.2325 40.0736 41.2325 44.4735V84.8056H51.5406V42.3783C51.5406 35.7436 49.7539 30.5056 46.1804 26.6645C42.6069 22.8234 37.7277 20.9028 31.5429 20.9028C27.4196 20.9028 23.743 21.9504 20.5132 24.0455C17.2833 26.0709 14.9124 28.8644 13.4006 32.4262H10.3081V21.9504H0Z"
fill="white"
/>
<path
d="M97.3489 60.8158L113.327 84.8056H124.872L103.431 52.7494L125.284 21.9504H113.842L98.2767 44.9973L82.9176 21.9504H71.3725L92.298 53.2732L70.6509 84.8056H82.0929L97.3489 60.8158Z"
fill="white"
/>
</svg>
</div>
<div className="w-full lg:w-3/5 flex flex-col lg:pl-16 lg:pb-0 pb-10 mt-8 lg:mt-0">
<h2 className="my-6">
<div className="inline-block py-4 px-6 text-xl sm:text-2xl lg:text-2xl leading-none font-input-mono font-extrabold tracking-tight py-4 px-6 mb-4 bg-blue-nx-dark rounded-md">
<span className="hidden">
Announcing the first ever Nx Conf on{' '}
</span>{' '}
September 16 & 17
</div>
</h2>
<p className="sm:text-lg mb-6">
Nx Conf is a new, online & free-to-attend, 2-day conference
featuring members of the Nx team and community. Join us as we
share our ideas and expertise about making development faster,
more scalable, and more collaborative.
</p>
<ul className="sm:text-lg list-disc list-inside mb-6">
Here are just a few of our confirmed speakers
<li className="mt-4">
<a
href="https://twitter.com/jeffbcross"
target="_blank"
rel="nofollow"
className="underline pointer"
>
Jeff Cross
</a>{' '}
and{' '}
<a
href="https://twitter.com/victorsavkin"
target="_blank"
rel="nofollow"
className="underline pointer"
>
Victor Savkin
</a>
, co-founders of Nrwl and creators of Nx
</li>
<li className="mt-4">The Nx Core Team at Nrwl</li>
<li className="mt-4">
<a
href="https://twitter.com/ManfredSteyer"
target="_blank"
rel="nofollow"
className="underline pointer"
>
Manfred Steyer
</a>
, speaker, trainer, consultant, and director of
ANGULARarchitects
</li>
<li className="mt-4">
<a
href="https://twitter.com/wwwalkerrun"
target="_blank"
rel="nofollow"
className="underline pointer"
>
Nathan Walker
</a>
, Angular advocate and expert
</li>
<li className="mt-4">
<a
href="https://twitter.com/yallen011"
target="_blank"
rel="nofollow"
className="underline pointer"
>
Yvonne Allen
</a>
, Angular GDE
</li>
<li className="mt-4">
<a
href="https://twitter.com/MrJamesHenry"
target="_blank"
rel="nofollow"
className="underline pointer"
>
James Henry
</a>
, 4x MVP @Microsoft, ESLint Team Alum, creator of @TSESLint
, Babel + Prettier Teams
</li>
<li className="mt-4">
<a
href="https://twitter.com/cotufa82"
target="_blank"
rel="nofollow"
className="underline pointer"
>
Diana Rodriguez
</a>
, GDE, Microsoft MVP, Women Techmaker Ambassador and Auth0
Ambassador
</li>
<li className="mt-4">Lightning talks from the community</li>
</ul>
<p className="sm:text-lg mb-6">
In addition to the conference there will be a{' '}
<b>2-day workshop on September 14th and 15th</b> on{' '}
<b>How to Develop at Scale with Nx Monorepos</b>, presented by
members of the Nx Core Team. Workshop registration is $800 per
attendee.
</p>
<p className="sm:text-lg mb-6">
Grab your FREE Nx Conf ticket and save your workshop seat
today!
</p>
<div className="flex mt-16">
<a
className="flex items-center justify-end font-input-mono group w-full sm:text-2xl"
href="https://ti.to/nrwl/nx-conf-2021?utm_source=nxdev"
>
<span className="group-hover:underline">Register now</span>
<svg
xmlns="http://www.w3.org/2000/svg"
className="ml-1 h-8 w-8 transform-gpu transition ease-out duration-200 group-hover:translate-x-2 "
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M13 7l5 5m0 0l-5 5m5-5H6"
/>
</svg>
</a>
</div>
</div>
</div>
</div>
</div>
</main>
<Footer useDarkBackground={true} />
</>
);
}
export default ConfPage;
+68 -14
View File
@@ -10,12 +10,9 @@ import {
NxUsersShowcase,
} from '@nrwl/nx-dev/ui/common';
import { sendCustomEvent } from '@nrwl/nx-dev/feature-analytics';
import { useStorage } from '../lib/use-storage';
export function Index() {
const router = useRouter();
const { value: storedFlavor } = useStorage('flavor');
const { value: storedVersion } = useStorage('version');
return (
<>
<Head>
@@ -26,8 +23,37 @@ export function Index() {
and build at any scale — integrating seamlessly with modern technologies and libraries while providing a
distributed graph-based task execution, a robust CLI, computation caching, dependency management, and more."
/>
<meta
name="twitter:title"
content="Nx: Smart, Extensible Build Framework"
/>
<meta
name="twitter:description"
content="Nx is a smart and extensible build framework to help you architect, test,
and build at any scale — integrating seamlessly with modern technologies and libraries while providing a
distributed graph-based task execution, a robust CLI, computation caching, dependency management, and more."
/>
<meta name="twitter:image" content="/images/nx-media.jpg" />
<meta
name="twitter:image:alt"
content="Nx: Smart, Extensible Build Framework"
/>
<meta property="og:url" content="https://nx.dev" />
<meta
property="og:description"
content="Nx is a smart and extensible build framework to help you architect, test,
and build at any scale — integrating seamlessly with modern technologies and libraries while providing a
distributed graph-based task execution, a robust CLI, computation caching, dependency management, and more."
/>
<meta
property="og:title"
content="Nx: Smart, Extensible Build Framework"
/>
<meta property="og:image" content="/images/nx-media.jpg" />
<meta property="og:image:width" content="1000" />
<meta property="og:image:height" content="300" />
</Head>
<Header showSearch={false} />
<Header showSearch={false} useDarkBackground={false} />
<main>
<div className="w-full">
{/*INTRO COMPONENT*/}
@@ -101,15 +127,43 @@ export function Index() {
fill="#022f56"
/>
</svg>
{/*<iframe*/}
{/* width="560"*/}
{/* height="315"*/}
{/* src="https://www.youtube.com/embed/TXySu4dZLp0"*/}
{/* frameBorder="0"*/}
{/* allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"*/}
{/* allowFullScreen*/}
{/* className="w-full"*/}
{/*/>*/}
</div>
</div>
</div>
</div>
{/* BANNER */}
<div className="bg-green-nx-base">
<div className="max-w-7xl mx-auto py-3 px-3 sm:px-6 lg:px-8">
<div className="flex items-center flex-col sm:flex-row justify-between flex-wrap">
<div className="flex-1 flex flex-row items-center">
<span className="flex p-2 rounded-lg bg-white">
<svg
className="h-6 w-6 text-green-nx-base"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"
/>
</svg>
</span>
<p className="ml-3 font-medium text-white">
Big news! We're excited to announce the first ever Nx Conf -
September 16th-17th
</p>
</div>
<div className="mt-2 w-full sm:w-auto">
<Link href="/conf">
<a className="flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-blue-nx-base bg-white">
Learn more
</a>
</Link>
</div>
</div>
</div>
@@ -408,7 +462,7 @@ export function Index() {
<NxUsersShowcase />
</div>
</main>
<Footer />
<Footer useDarkBackground={false} />
</>
);
}
+21 -2
View File
@@ -68,8 +68,28 @@ export function Node() {
name="description"
content="Nx is a smart and extensible build framework to help you develop, test, build, and scale Node applications."
/>
<meta name="twitter:title" content="Nx and Node" />
<meta
name="twitter:description"
content="Nx is a smart and extensible build framework to help you develop, test, build, and scale Node applications."
/>
<meta name="twitter:image" content="/images/nx-media.jpg" />
<meta
name="twitter:image:alt"
content="Nx: Smart, Extensible Build Framework"
/>
<meta property="og:url" content="https://nx.dev/node" />
<meta
property="og:description"
content="Nx is a smart and extensible build framework to help you develop, test, build, and scale Node applications."
/>
<meta property="og:title" content="Nx and Node" />
<meta property="og:image" content="/images/nx-media.jpg" />
<meta property="og:image:width" content="1000" />
<meta property="og:image:height" content="300" />
</Head>
<Header
useDarkBackground={false}
showSearch={false}
flavor={{
name: storedFlavor || 'node',
@@ -297,7 +317,6 @@ export function Node() {
Nx Node App Tutorial
</span>
<svg
xmlns="http://www.w3.org/2000/svg"
className="ml-1 h-5 w-5 transform-gpu transition ease-out duration-200 group-hover:translate-x-2 "
fill="none"
viewBox="0 0 24 24"
@@ -552,7 +571,7 @@ export function Node() {
<NxUsersShowcase />
</div>
</main>
<Footer />
<Footer useDarkBackground={false} />
</>
);
}
+21 -1
View File
@@ -24,8 +24,28 @@ export function ReactPage() {
name="description"
content="Nx dev tools help developers build, test, and scale full-stack React, Next.js, Gatsby, React Native projects and monorepos."
/>
<meta name="twitter:title" content="Nx and React" />
<meta
name="twitter:description"
content="Nx dev tools help developers build, test, and scale full-stack React, Next.js, Gatsby, React Native projects and monorepos."
/>
<meta name="twitter:image" content="/images/nx-media.jpg" />
<meta
name="twitter:image:alt"
content="Nx: Smart, Extensible Build Framework"
/>
<meta property="og:url" content="https://nx.dev/react" />
<meta
property="og:description"
content="Nx dev tools help developers build, test, and scale full-stack React, Next.js, Gatsby, React Native projects and monorepos."
/>
<meta property="og:title" content="Nx and React" />
<meta property="og:image" content="/images/nx-media.jpg" />
<meta property="og:image:width" content="1000" />
<meta property="og:image:height" content="300" />
</Head>
<Header
useDarkBackground={false}
showSearch={false}
flavor={{
name: storedFlavor || 'react',
@@ -517,7 +537,7 @@ export function ReactPage() {
<NxUsersShowcase />
</div>
</main>
<Footer />
<Footer useDarkBackground={false} />
</>
);
}
@@ -128,6 +128,14 @@ Type: `boolean`
Skip creating spec files.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -142,7 +150,7 @@ Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`
Possible values: `css`, `scss`, `less`
The file extension to be used for style files.
@@ -1,6 +1,6 @@
# downgrade-module
Setup Downgrade Module
Setup Downgrade Module.
## Usage
@@ -40,7 +40,7 @@ The name of the main AngularJS module.
Type: `string`
The name of the project
The name of the project.
### skipFormat
@@ -48,7 +48,7 @@ Default: `false`
Type: `boolean`
Skip formatting files
Skip formatting files.
### skipPackageJson
@@ -56,4 +56,4 @@ Default: `false`
Type: `boolean`
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson)
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson).
@@ -150,6 +150,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -1,6 +1,6 @@
# ngrx
Add an ngrx config to a project
Add NgRx support to an application or library.
## Usage
@@ -66,23 +66,27 @@ The path to NgModule where the feature state will be registered. The host direct
Type: `string`
Name of the NgRx feature state, such as "products" or "users"). Recommended to use the plural form of the name.
Name of the NgRx feature state, such as `products` or `users`. Recommended to use the plural form of the name.
### onlyAddFiles
### ~~onlyAddFiles~~
Default: `false`
Type: `boolean`
**Deprecated**, use `skipImport`. Only add new NgRx files, without changing the module file (e.g., --onlyAddFiles).
**Deprecated:** Use the `skipImport` option instead.
### onlyEmptyRoot
Only add new NgRx files, without changing the module file (e.g., --onlyAddFiles).
### ~~onlyEmptyRoot~~
Default: `false`
Type: `boolean`
**Deprecated**, use `minimal`. Do not generate any files. Only generate StoreModule.forRoot and EffectsModule.forRoot (e.g., --onlyEmptyRoot).
**Deprecated:** Use the `minimal` option instead.
Do not generate any files. Only generate StoreModule.forRoot and EffectsModule.forRoot (e.g., --onlyEmptyRoot).
### root
@@ -1,6 +1,6 @@
# upgrade-module
Add an upgrade module
Add an upgrade module.
## Usage
@@ -28,7 +28,7 @@ nx g upgrade-module ... --dry-run
Type: `string`
The selector of an AngularJS component (e.g., --angularJsCmpSelector=myComponent)
The selector of an AngularJS component (e.g., --angularJsCmpSelector=myComponent).
### angularJsImport
@@ -46,7 +46,7 @@ The name of the main AngularJS module.
Type: `string`
The name of the project
The name of the project.
### router
@@ -54,7 +54,7 @@ Default: `false`
Type: `boolean`
Sets up router synchronization (e.g., --router)
Sets up router synchronization (e.g., --router).
### skipFormat
@@ -62,7 +62,7 @@ Default: `false`
Type: `boolean`
Skip formatting files
Skip formatting files.
### skipPackageJson
@@ -70,4 +70,4 @@ Default: `false`
Type: `boolean`
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson)
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson).
@@ -0,0 +1,59 @@
# web-worker
Create a Web Worker.
## Usage
```bash
nx generate web-worker ...
```
By default, Nx will search for `web-worker` in the default collection provisioned in `angular.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:web-worker ...
```
Show what will be generated without writing to disk:
```bash
nx g web-worker ... --dry-run
```
## Options
### name
Type: `string`
The name of the worker.
### path
Type: `string`
The path at which to create the worker file, relative to the current workspace.
### project
Type: `string`
The name of the project.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files.
### snippet
Default: `true`
Type: `boolean`
Add a worker creation snippet in a sibling file of the same name.
@@ -98,6 +98,14 @@ Type: `boolean`
Do not add dependencies to package.json.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Type: `string`
@@ -66,6 +66,14 @@ Type: `boolean`
Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### style
Alias(es): s
@@ -72,6 +72,14 @@ Type: `boolean`
Do not add dependencies to package.json.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Type: `string`
@@ -108,6 +108,14 @@ Type: `boolean`
Skip updating workspace.json with default options based on values provided to this app (e.g. babel, style)
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### style
Alias(es): s
@@ -106,6 +106,14 @@ Type: `boolean`
Do not add dependencies to package.json.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Type: `string`
@@ -138,6 +138,14 @@ Type: `boolean`
Do not update tsconfig.base.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `false`
@@ -60,9 +60,11 @@
- [applyChangesToString](../../angular/nx-devkit/index#applychangestostring)
- [convertNxExecutor](../../angular/nx-devkit/index#convertnxexecutor)
- [convertNxGenerator](../../angular/nx-devkit/index#convertnxgenerator)
- [detectPackageManager](../../angular/nx-devkit/index#detectpackagemanager)
- [formatFiles](../../angular/nx-devkit/index#formatfiles)
- [generateFiles](../../angular/nx-devkit/index#generatefiles)
- [getPackageManagerCommand](../../angular/nx-devkit/index#getpackagemanagercommand)
- [getPackageManagerVersion](../../angular/nx-devkit/index#getpackagemanagerversion)
- [getProjects](../../angular/nx-devkit/index#getprojects)
- [getWorkspaceLayout](../../angular/nx-devkit/index#getworkspacelayout)
- [getWorkspacePath](../../angular/nx-devkit/index#getworkspacepath)
@@ -473,7 +475,7 @@ Callback to install dependencies only if necessary. undefined is returned if cha
### addProjectConfiguration
**addProjectConfiguration**(`host`: [_Tree_](../../angular/nx-devkit/index#tree), `projectName`: _string_, `projectConfiguration`: [_ProjectConfiguration_](../../angular/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../angular/nx-devkit/index#nxjsonprojectconfiguration)): _void_
**addProjectConfiguration**(`host`: [_Tree_](../../angular/nx-devkit/index#tree), `projectName`: _string_, `projectConfiguration`: [_ProjectConfiguration_](../../angular/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../angular/nx-devkit/index#nxjsonprojectconfiguration), `standalone?`: _boolean_): _void_
Adds project configuration to the Nx workspace.
@@ -482,11 +484,12 @@ both files.
#### Parameters
| Name | Type | Description |
| :--------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------- |
| `host` | [_Tree_](../../angular/nx-devkit/index#tree) | the file system tree |
| `projectName` | _string_ | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [_ProjectConfiguration_](../../angular/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../angular/nx-devkit/index#nxjsonprojectconfiguration) | project configuration |
| Name | Type | Default value | Description |
| :--------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :----------------------------------------------------------------------------------------- |
| `host` | [_Tree_](../../angular/nx-devkit/index#tree) | - | the file system tree |
| `projectName` | _string_ | - | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [_ProjectConfiguration_](../../angular/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../angular/nx-devkit/index#nxjsonprojectconfiguration) | - | project configuration |
| `standalone` | _boolean_ | false | should the project use package.json? If false, the project config is inside workspace.json |
**Returns:** _void_
@@ -577,6 +580,22 @@ Convert an Nx Generator into an Angular Devkit Schematic
---
### detectPackageManager
**detectPackageManager**(`dir?`: _string_): [_PackageManager_](../../angular/nx-devkit/index#packagemanager)
Detects which package manager is used in the workspace based on the lock file.
#### Parameters
| Name | Type | Default value |
| :---- | :------- | :------------ |
| `dir` | _string_ | '' |
**Returns:** [_PackageManager_](../../angular/nx-devkit/index#packagemanager)
---
### formatFiles
**formatFiles**(`host`: [_Tree_](../../angular/nx-devkit/index#tree)): _Promise_<void\>
@@ -634,7 +653,7 @@ doesn't get confused about incorrect TypeScript files.
### getPackageManagerCommand
**getPackageManagerCommand**(`packageManager?`: [_PackageManager_](../../angular/nx-devkit/index#packagemanager)): _object_
**getPackageManagerCommand**(`packageManager?`: [_PackageManager_](../../angular/nx-devkit/index#packagemanager)): PackageManagerCommands
Returns commands for the package manager used in the workspace.
By default, the package manager is derived based on the lock file,
@@ -652,17 +671,25 @@ execSync(`${getPackageManagerCommand().addDev} my-dev-package`);
| :--------------- | :--------------------------------------------------------------- |
| `packageManager` | [_PackageManager_](../../angular/nx-devkit/index#packagemanager) |
**Returns:** _object_
**Returns:** PackageManagerCommands
| Name | Type |
| :-------- | :------------------------------------------------- |
| `add` | _string_ |
| `addDev` | _string_ |
| `exec` | _string_ |
| `install` | _string_ |
| `list` | _string_ |
| `rm` | _string_ |
| `run` | (`script`: _string_, `args`: _string_) => _string_ |
---
### getPackageManagerVersion
**getPackageManagerVersion**(`packageManager?`: [_PackageManager_](../../angular/nx-devkit/index#packagemanager)): _string_
Returns the version of the package manager used in the workspace.
By default, the package manager is derived based on the lock file,
but it can also be passed in explicitly.
#### Parameters
| Name | Type |
| :--------------- | :--------------------------------------------------------------- |
| `packageManager` | [_PackageManager_](../../angular/nx-devkit/index#packagemanager) |
**Returns:** _string_
---
@@ -78,6 +78,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Alias(es): t
@@ -150,6 +150,14 @@ Type: `boolean`
Skip updating workspace.json with default options based on values provided to this app (e.g. babel, style).
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -158,6 +158,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -77,3 +77,11 @@ The tool to use for running lint checks.
Type: `string`
Project name
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
@@ -60,6 +60,14 @@ Type: `string`
Library or application name
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### uiFramework
Type: `string`
@@ -53,3 +53,11 @@ The tool to use for running lint checks.
Type: `string`
Library or application name
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
@@ -76,6 +76,14 @@ Type: `boolean`
Skip formatting files
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### style
Default: `css`
@@ -0,0 +1,51 @@
# convert-to-nx-project
Moves a project's configuration outside of workspace.json
## Usage
```bash
nx generate convert-to-nx-project ...
```
By default, Nx will search for `convert-to-nx-project` in the default collection provisioned in `angular.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/workspace:convert-to-nx-project ...
```
Show what will be generated without writing to disk:
```bash
nx g convert-to-nx-project ... --dry-run
```
### Examples
Convert the my-feature-lib project to use project.json file instead of workspace.json:
```bash
nx g @nrwl/workspace:convert-to-nx-project --project my-feature-lib
```
Convert all projects in workspace.json to separate project.json files.:
```bash
nx g @nrwl/workspace:convert-to-nx-project --all
```
## Options
### all
Type: `boolean`
Should every project be converted?
### project
Type: `string`
Project name
@@ -130,6 +130,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `false`
@@ -131,3 +131,9 @@ Print additional error stack trace on failure
### version
Show version number
### watch
Default: `false`
Watch for changes to dep graph and update in-browser
@@ -54,6 +54,12 @@ Show the graph where every node is either an ancestor or a descendant of todos-f
nx dep-graph --focus=todos-feature-main --exclude=project-one,project-two
```
Watch for changes to dep graph and update in-browser:
```bash
nx dep-graph --watch
```
## Options
### exclude
@@ -87,3 +93,9 @@ Bind the dep graph server to a specific port.
### version
Show version number
### watch
Default: `false`
Watch for changes to dep graph and update in-browser
@@ -0,0 +1,39 @@
# Composing Generators
Generators are useful individually, but reusing and composing generators allows you to build whole workflows out of simpler building blocks.
## Using Nx Devkit Generators
Nx Devkit generators can be imported and invoked like any javascript function. They often return a `Promise`, so they can be used with the `await` keyword to mimic synchronous code. Because this is standard javascript, control flow logic can be adjusted with `if` blocks and `for` loops as usual.
```typescript
import { libraryGenerator } from '@nrwl/workspace';
export default async function (tree: Tree, schema: any) {
await libraryGenerator(
tree, // virtual file system tree
{ name: schema.name } // options for the generator
);
}
```
## Using Angular Devkit Schematics
If you need to use a generator written with the Angular devkit (also known as a schematic) inside of an Nx devkit generator, you need to wrap the schematic inside the `wrapAngularDevkitSchematic` function.
Note: All Nrwl maintained schematics have been migrated over to the Nx Devkit, so this should only be necessary for third party schematics.
```typescript
import { wrapAngularDevkitSchematic } from '@nrwl/devkit/ngcli-adapter';
export default async function (tree: Tree, schema: any) {
const libraryGenerator = wrapAngularDevkitSchematic(
'@nrwl/angular', // plugin name
'lib' // schematic name
);
await libraryGenerator(
tree, // virtual file system tree
{ name: schema.name } // options for the generator
);
}
```
@@ -0,0 +1,28 @@
# Using Generators
## Overview
Generators provide a way to automate many tasks you regularly perform as part of your development workflow. Whether it is scaffolding out components, features, ensuring libraries are generated and structured in a certain way, or updating your configuration files, generators help you standardize these tasks in a consistent, and predictable manner.
Generators can be written using `@nrwl/devkit` or `@angular-devkit`. Generators written with the `@angular-devkit` are called schematics. To read more about the concepts of `@angular-devkit` schematics, and building an example schematic, see the [Schematics Authoring Guide](https://angular.io/guide/schematics-authoring).
The [Workspace Generators](/{{framework}}/generators/workspace-generators) guide shows you how to create, run, and customize workspace generators within your Nx workspace.
## Types of Generators
There are three main types of generators:
1. **Plugin Generators** are available when an Nx plugin has been installed in your workspace.
2. **Workspace Generators** are generators that you can create for your own workspace. [Workspace generators](/{{framework}}/generators/workspace-generators) allow you to codify the processes that are unique to your own organization.
3. **Update Generators** are invoked by Nx plugins when you [update Nx](/{{framework}}/core-concepts/updating-nx) to keep your config files in sync with the latest versions of third party tools.
## Invoking Plugin Generators
Generators allow you to create or modify your codebase in a simple and repeatable way. Generators are invoked using the [`nx generate`](/{{framework}}/cli/generate) command.
```bash
nx generate [plugin]:[generator-name] [options]
nx generate @nrwl/react:component mycmp --project=myapp
```
It is important to have a clean git working directory before invoking a generator so that you can easily revert changes and re-invoke the generator with different inputs.
@@ -0,0 +1,107 @@
# Workspace Generators
Workspace generators provide a way to automate many tasks you regularly perform as part of your development workflow. Whether it is scaffolding out components, features, or ensuring libraries are generated and structured in a certain way, generators help you standardize these tasks in a consistent, and predictable manner. Nx provides tooling around creating, and running custom generators from within your workspace. This guide shows you how to create, run, and customize workspace generators within your Nx workspace.
## Creating a workspace generator
Use the Nx CLI to generate the initial files needed for your workspace generator.
```bash
nx generate @nrwl/workspace:workspace-generator my-generator
```
After the command is finished, the workspace generator is created under the `tools/generators` folder.
```treeview
happynrwl/
├── apps/
├── libs/
├── tools/
│ ├── generators
│ | └── my-generator/
│ | | ├── index.ts
│ | | └── schema.json
├── nx.json
├── package.json
└── tsconfig.base.json
```
The `index.ts` provides an entry point to the generator. The file contains a function that is called to perform manipulations on a tree that represents the file system.
The `schema.json` provides a description of the generator, available options, validation information, and default values.
The initial generator function creates a library.
```typescript
import { Tree, formatFiles, installPackagesTask } from '@nrwl/devkit';
import { libraryGenerator } from '@nrwl/workspace';
export default async function (tree: Tree, schema: any) {
await libraryGenerator(tree, { name: schema.name });
await formatFiles(tree);
return () => {
installPackagesTask(tree);
};
}
```
To invoke other generators, import the entry point function and run it against the tree tree. `async/await` can be used to make code with Promises read like procedural code. The generator function may return a callback function that is executed after changes to the file system have been applied.
In the schema.json file for your generator, the `name` is provided as a default option. The `cli` property is set to `nx` to signal that this is a generator that uses `@nrwl/devkit` and not `@angular-devkit`.
```json
{
"cli": "nx",
"id": "test",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Library name",
"$default": {
"$source": "argv",
"index": 0
}
}
},
"required": ["name"]
}
```
The `$default` object is used to read arguments from the command-line that are passed to the generator. The first argument passed to this schematic is used as the `name` property.
## Running a workspace generator
To run a generator, invoke the `nx workspace-generator` command with the name of the generator.
```bash
nx workspace-generator my-generator mylib
```
## Running a workspace schematic created with @angular-devkit
Generators that are created using the `@angular-devkit` are called schematics. Workspace schematics that have been created with the `@angular-devkit` will omit the `"cli": "nx"` property in `schema.json`. Nx will recognize this and correctly run the schematic using the same command as an `@nrwl/devkit` generator.
```bash
nx workspace-generator my-schematic mylib
```
The command is also aliased to the previous `workspace-schematic` command, so this still works:
```bash
nx workspace-schematic my-schematic mylib
```
## Debugging Workspace generators
### With Visual Studio Code
1. Open the Command Palette and choose `Debug: Create JavaScript Debug Terminal`.
This will open a terminal with debugging enabled.
2. Set breakpoints in your code
3. Run `nx workspace-generator my-generator` in the debug terminal.
![](/shared/vscode-schematics-debug.png)
## Workspace Generator Utilities
The `@nrwl/devkit` package provides many utility functions that can be used in schematics to help with modifying files, reading and updating configuration files, and working with an Abstract Syntax Tree (AST).
@@ -17,7 +17,7 @@ Nx works especially well for [monorepos](/{{framework}}/core-concepts/why-monore
## Features
- Test (or builds or lints) only the projects [affected](/{{framework}}/cli/affected) by a code change.
- [Cache](/{{framework}}/core-concepts/computation-caching) command output locally so that future runs on the same code happen in seconds. The paid [Nx Cloud](https://nx.app) offering allows this cache to be shared across every developer in your organization.
- [Cache](/{{framework}}/core-extended/computation-caching) command output locally so that future runs on the same code happen in seconds. The paid [Nx Cloud](https://nx.app) offering allows this cache to be shared across every developer in your organization.
- Provide a consistent syntax for [executing commands](/{{framework}}/executors/using-builders). `nx build my-app` works no matter what framework `my-app` uses.
- Automate code modification tasks with [generators](/{{framework}}/cli/affected).
- Access a thriving ecosystem of [plugins](/{{framework}}/generators/using-schematics) from Nrwl and the [community](/community).
@@ -32,5 +32,5 @@ Nx works especially well for [monorepos](/{{framework}}/core-concepts/why-monore
- [Nx CLI](/{{framework}}/getting-started/nx-cli)
- [Configuration Files](/{{framework}}/core-concepts/configuration)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)
- [Computation Caching](/{{framework}}/core-extended/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-extended/affected)
@@ -41,15 +41,6 @@ nx workspace-generator my-generator
[The first command](/{{framework}}/cli/generate) scaffolds a new customizable workspace generator named `my-generator` and [the second command](/{{framework}}/cli/workspace-generator) invokes it.
**Update plugins:**
```bash
nx migrate latest
nx migrate --run-migrations=migrations.json
```
[The first command](/{{framework}}/cli/migrate) updates the installed Nx plugin versions and creates a list of generators to keep configuration files up to date. [The second command](/{{framework}}/cli/migrate) invokes those generators.
**Run an executor on one project:**
```bash
@@ -57,7 +48,15 @@ nx run my-app:build
nx build my-app
```
Both of [these commands](/{{framework}}/cli/run) build the `my-app` application. Custom executors need to use the more verbose `nx run project:target` syntax. See the [workspace.json documentation](/{{framework}}/core-concepts/configuration) for information on configuring executor options.
Both of [these commands](/{{framework}}/cli/run) build the `my-app` application. See the [workspace.json documentation](/{{framework}}/core-concepts/configuration) for information on configuring executor options.
**Run an executor for many projects:**
```bash
nx run-many --target=build --projects=app1,app2
```
[This command](/{{framework}}/cli/run-many) builds `app1` and `app2`.
**Run an executor for all affected projects:**
@@ -71,10 +70,11 @@ nx affected --target=build
```bash
nx dep-graph
nx dep-graph --watch
nx affected:dep-graph
```
[The first command](/{{framework}}/cli/dep-graph) launches a web browser with repository's dependency graph rendered visually. [The second command](/{{framework}}/cli/affected-dep-graph) renders the same graph with projects affected by the current code change highlighted.
[The first command](/{{framework}}/cli/dep-graph) launches a web browser with repository's dependency graph rendered visually. You can add the `--watch` flag to watch for changes to the dep grpah and update the view in-browser. [The second command](/{{framework}}/cli/affected-dep-graph) renders the same graph with projects affected by the current code change highlighted.
**List installed plugins:**
@@ -84,6 +84,20 @@ nx list
[This command](/{{framework}}/cli/list) lists the currently installed Nx plugins and shows other plugins that are available.
**Update plugins:**
```bash
nx migrate latest
nx migrate --run-migrations=migrations.json
```
[The first command](/{{framework}}/cli/migrate) updates the installed Nx plugin versions and creates a list of generators to keep configuration files up to date. [The second command](/{{framework}}/cli/migrate) invokes those generators.
## Common Env Variables
- Setting **NX_VERBOSE_LOGGING=true** will print debug information useful for troubleshooting.
- Setting **NX_PERF_LOGGING=true** will print debug information useful for profiling executors and Nx itself.
## Nx and Angular CLI
Nx supports Angular Devkit. When you run `nx build myapp`, and the build target for `myapp` is implemented using Angular Devkit, Nx behaves exactly the same as the Angular CLI. When you run `nx g component mycmp`, once again, Nx invokes the same schematic. You can think of Nx wrapping the Angular CLI. The results of running commands produces the same result, except that running `nx` is often a lot faster.
@@ -17,6 +17,12 @@ The `angular.json` configuration file contains information about the targets and
"build": {
"builder": "@nrwl/web:build",
"outputs": ["dist/apps/myapp"],
"dependsOn": [
{
"target": "build",
"projects": "dependencies"
}
],
"options": {
"index": "apps/myapp/src/app.html",
"main": "apps/myapp/src/main.ts"
@@ -88,6 +94,8 @@ For instance, the following configures `mylib`.
> Nx uses the architect library built by the Angular team at Google. The naming reflects that. Important to note: it's a general purpose library that **does not** have any dependency on Angular.
> Projects utilizing `project.json` files will not be present in `angular.json`.
### Targets
Let's look at the simple architect target:
@@ -106,7 +114,7 @@ Let's look at the simple architect target:
**Target Name**
The name of the target `test` means that you can invoke it as follows: `nx test mylib` or `nx run mylib:test`. The name isn't significant in any other way. If you rename it to, for example, `mytest`, you will be able to run as follows: `nx run mylib:mytest`.
The name of the target `test` means that you can invoke it as follows: `nx test mylib` or `nx run mylib:test`. The name isn't significant in any other way. If you rename it to, for example, `mytest`, you will be able to run as follows: `nx mytest mylib` or `nx run mylib:mytest`.
**Builder**
@@ -172,6 +180,66 @@ require(`@nrwl/jest`).builders['jest']({...options, ...selectedConfiguration, ..
The selected configuration adds/overrides the default options, and the provided command line args add/override the configuration options.
**Target Dependencies**
Targets can depend on other targets. A common scenario is having to build dependencies of a project first before building the project. You can specify this using the `dependsOn`.
```json
{
"build": {
"executor": "@nrwl/web:build",
"outputs": ["dist/apps/myapp"],
"options": {
"index": "apps/myapp/src/app.html",
"main": "apps/myapp/src/main.ts"
},
"dependsOn": [
{
"target": "build",
"projects": "dependencies"
}
]
}
}
```
In this case, running `nx build myapp` will build all the buildable libraries `myapp` depends on first. In other words, `nx build myapp` will result in multiple tasks executing. The `--parallel`, and `--max-parallel` flags will have the same effect as they would with `run-many` or `affected`.
It is also possible to define dependencies between the targets of the same project.
In the following example invoking `nx build myapp` will build all the libraries first, then `nx build-base myapp` will be executed and only then `nx build myapp` will be executed.
```json
{
"build-base": {
"executor": "@nrwl/web:build",
"outputs": ["dist/apps/myapp"],
"options": {
"index": "apps/myapp/src/app.html",
"main": "apps/myapp/src/main.ts"
}
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"dependsOn": [
{
"target": "build",
"projects": "dependencies"
},
{
"target": "build-base",
"projects": "self"
}
],
"options": {
"command": "./copy-readme-and-license.sh"
}
}
}
```
Often the same `dependsOn` configuration has to be defined for every project in the repo. You can define it once in `nx.json` (see below).
### Generators
Generators that are created using `@angular-devkit` are called schematics. You can configure default generator options in `angular.json` as well. For instance, the following will tell Nx to always pass `--style=scss` when creating new libraries.
@@ -202,6 +270,33 @@ The following command will generate a new library: `nx g @nrwl/angular:lib mylib
Your `angular.json` file can be renamed to `workspace.json` and Nx will process it in the same way. The `workspace.json` has one additional top level property `version`. Setting `version` to 1 means the `workspace.json` file syntax is identical to `angular.json` When the `version` of `workspace.json` is set to 2, `targets`, `generators` and `executor` properties are used instead of the version 1 properties `architect`, `schematics` and `builder`.
## project.json
Project configurations can also be independent files, referenced by `angular.json`. For instance, an `angular.json` may contain projects configured as below.
```json
{
"projects": {
"mylib": "libs/mylib"
}
}
```
This tells Nx that all configuration for that project is found in the `libs/mylib/project.json` file. This file contains a combination of the project's configuration from both `angular.json` and `nx.json`.
```json
{
"mylib": {
"root": "libs/mylib/",
"sourceRoot": "libs/mylib/src",
"projectType": "library",
"targets": {},
"tags": [],
"implicitDependencies": []
}
}
```
## nx.json
The `nx.json` file contains extra configuration options mostly related to the project graph.
@@ -229,6 +324,14 @@ The `nx.json` file contains extra configuration options mostly related to the pr
"tsconfig.base.json": "*",
"nx.json": "*"
},
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
]
},
"projects": {
"myapp": {
"tags": []
@@ -244,6 +347,8 @@ The `nx.json` file contains extra configuration options mostly related to the pr
}
```
> Projects utilizing `project.json` files will not be present in `nx.json`.
**NPM Scope**
Tells Nx what prefix to use when generating library imports.
@@ -352,9 +457,32 @@ You can also add dependencies between projects. For instance, the example below
}
```
### Target Dependencies
Targets can depend on other targets. A common scenario is having to build dependencies of a project first before building the project. The `dependsOn` property in `workspace.json` can be used to define the list of dependencies of an individual target.
Often the same `dependsOn` configuration has to be defined for every project in the repo, and that's when defining `targetDependencies` in `nx.json` is helpful.
```json
{
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
]
}
}
```
The configuration above is identical to adding `{"dependsOn": [{"target": "build", "projects": "dependencies"]}` to every build target in `workspace.json`.
The `dependsOn` property in `workspace.json` takes precedence over the `targetDependencies` in `nx.json`.
## .nxignore
You may optionally add an `.nxignore` file to the root. This file is used to specify files in your workspace that should be completely ignored by nx.
You may optionally add an `.nxignore` file to the root. This file is used to specify files in your workspace that should be completely ignored by Nx.
The syntax is the same as a [`.gitignore` file](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring).
@@ -394,13 +394,3 @@ Your folder structure should now look like this:
├── README.md
└── etc...
```
### Storybook v6 args and controls
Storybook v6 moves from "knobs" to args and controls when it comes to defining and manipulating your storybook
component properties. Feel free to use the new args way of defining stories. More can be found
[on the official Storybook docs](https://storybook.js.org/docs/angular/writing-stories/args).
> **Note:** Nx does not yet automatically generate stories that use the args syntax. The main reason is that args don't
> yet support being loaded via the iframe URL which is used in Nx to setup your Storybook based e2e tests. Once support
> is present in Storybook v6, we will provide a way to generate args & controls based stories. More on the progress [here](https://github.com/storybookjs/storybook/issues/12291).
@@ -1,23 +1,23 @@
# Updating Nx
Nx provides the `migrate` command which help you stay up to date with the latest version of Nx.
The Nx CLI provides the `migrate` command to help you stay up to date with the latest version of Nx.
Not only `nx migrate` updates the version of Nx, but it also updates the versions of dependencies which we install such as jest and cypress. You can also use the `migrate` command to update any Nx plugin or any Angular package.
Not only does `nx migrate` update you to the latest version of Nx, but it also updates the versions of dependencies that we support and test such as Jest and Cypress. You can also use the `migrate` command to update any Nx plugin.
## What About "Ng Update?"
## What about "ng update?"
**TLDR: So if you are using Nx 10, run `nx migrate latest` instead of `ng update`.**
**TLDR: So if you are using Nx 10 or later, run `nx migrate latest` instead of `ng update`.**
If you haven't used Nx before and used the Angular CLI, you probably ran `ng update`. What is the difference?
`nx migrate` is a much improved version of `ng update`. It runs the same migrations, but allows you to:
- rerun the same migration multiple times
- reorder migrations
- skip migrations
- fix migrations that "almost work"
- commit a partially migrated state
- change versions of packages to match org requirements
- Rerun the same migration multiple times.
- Reorder migrations.
- Skip migrations.
- Fix migrations that "almost work".
- Commit a partially migrated state.
- Change versions of packages to match org requirements.
And, in general, it is lot more reliable for non-trivial workspaces. Why?
@@ -44,16 +44,16 @@ If you ran `ng update` and saw the error telling you to use `nx migrate`, do the
- `npm install` (or `yarn install`)
- `nx migrate --run-migrations=migrations.json`
## How to Migrate
## Migrating to the latest Nx version
Migration happens in two steps:
- Updating `package.json` (and `node_modules`)
- Updating the source code of the repo to match the new versions of packages in `package.json`
- The installed dependencies are updated including the `package.json` (and `node_modules`).
- The source code in the repo is updated to match the new versions of packages in `package.json`.
### Step 1: Updating package.json and generating migrations.json
### Step 1: Updating dependencies and generating migrations
Run the following:
First, run the `migrate` command:
```bash
nx migrate latest # same as nx migrate @nrwl/workspace@latest
@@ -65,75 +65,81 @@ You can also specify the name of the package and the version:
nx migrate @nrwl/workspace@version # you can also specify version
```
This will fetch the specified version of `@nrwl/workspace`, analyze the dependencies and fetch all the dependent packages. The process will keep going until the whole tree of dependencies is resolved. This will result in:
This fetches the specified version of the `@nrwl/workspace` package, analyzes the dependencies and fetches all the dependent packages. The process keeps going until all the dependencies are resolved. This results in:
- `package.json` being updated
- `migrations.json` being generated
- The `package.json` being updated
- A `migrations.json` being generated if there are pending migrations.
At this point, no packages have been installed, and no other files have been touched.
Now, you can inspect `package.json` to see if the changes make sense. Sometimes the migration can update some package to the version that is either not allowed or conflicts with with another package. Feel free to manually apply the desired adjustments.
Now, you can inspect `package.json` to see if the changes make sense. Sometimes the migration can update some package to the version that is either not allowed or conflicts with another package. Feel free to manually apply the desired adjustments.
### Step 2: Install the packages
After you are satisfied, make sure to actuall install the packages by running `npm install`, `yarn`, or `pnpm install`.
After inspecting the `package.json`, make sure to install the updated package versions by running `npm install`, `yarn`, or `pnpm install`.
### Step 3: Running migrations
Next, we need to update the repo to match the updated `package.json` and `node_modules`. Every Nx plugin comes with a set of migrations that describe how to update the workspace to make it work with the new version of the plugin. During Step 1 Nx looked at all of the packages being updated and collected their migrations into `migrations.json`. It's important to note that because Nx knows the from and to versions of every package, the `migrations.json` file only contains the relevant migrations.
Next, update the repo to match the updated `package.json` and `node_modules`. Every Nx plugin comes with a set of migrations that describe how to update the workspace to make it work with the new version of the plugin. During step one, Nx looked at all of the packages being updated and collected their migrations into `migrations.json`. It's important to note that because Nx knows the from and to versions of every package, the `migrations.json` file only contains the relevant migrations.
Each migration in `migrations.json` updates the source code in the repository. To run all the migrations in order, invoke:
Each migration in `migrations.json` updates the source code in the repository. To run all the migrations in order, run the following command:
```bash
nx migrate --run-migrations
```
To specify a custom migrations file, pass it to the `--run-migrations` option:
```bash
nx migrate --run-migrations=migrations.json
```
For small projects, running all the migrations at once often succeeds without any issues. For large projects, more flexibility is sometimes needed:
For small projects, running all the migrations at once often succeeds without any issues. For large projects, more flexibility is needed:
- You may have to skip a migration.
- You may want to run one migration at a time to address minor issues.
- You may want to reorder migrations.
- You may want to run the same migration multiple time if the process takes a long time and you had to rebase.
Since you can run `nx migrate --run-migrations=migrations.json` as many times as you want, you can achieve all of that by commenting out and reordering items in `migrations.json`. The migrate process can take a long time, sometimes a day, so it can be useful to commit the migrations file with the partially-updated repo.
Because you can run `nx migrate --run-migrations` as many times as you want, you can achieve all of that by commenting out and reordering items in `migrations.json`. The migration process can take a long time, depending on the number of migrations, so it is useful to commit the migrations file with the partially-updated repo.
### Step 4: Cleaning up
After you run all the migrations, you can remove `migration.json` and commit the changes.
After you run all the migrations, you can remove `migrations.json` and commit the changes.
## Advanced Capabilities & Recommendations
## Advanced capabilities & recommendations
### One Major Version at a Time, Small Steps
### One major version at a time, small steps
Migrating Jest, Cypress, ESLint, React, Angular, Next etc... is a difficult task. All the tools change at different rates, they can conflict with each other etc.. In addition, every workspace is different. Even though our goal is to let you update any version of Nx to any other version in a single go, sometimes it doesn't work. The following process is better for large workspaces.
Migrating Jest, Cypress, ESLint, React, Angular, Next, and more is a difficult task. All the tools change at different rates, they can conflict with each other. In addition, every workspace is different. Even though our goal is for you to update any version of Nx to a newer version of Nx in a single go, sometimes it doesn't work. The following process is better for large workspaces.
Say you want to migrate from Nx 10.1.0 to Nx 11.0.1. The following steps are more likely to work comparing to `nx migrate 11.0.1`.
- Run `nx migrate 10.4.5` to update the latest version in the 10x branch.
- Run `npm install`
- Run `nx migrate --run-migrations=migrations.json`
- Next, run `nx migrate 11.0.1`
- Run `npm install`
- Run `nx migrate --run-migrations=migrations.json`
- Run `nx migrate 10.4.5` to update the latest version in the 10.x branch.
- Run `npm install`.
- Run `nx migrate --run-migrations`.
- Next, run `nx migrate 11.0.1`.
- Run `npm install`.
- Run `nx migrate --run-migrations`.
### Overriding versions
Sometimes, you may want to use a different version of a package than what Nx recommends. You can do it as follows:
Sometimes, you may want to use a different version of a package than what Nx recommends. To do that, specify the package and version:
```bash
nx migrate @nrwl/workspace --to="jest@22.0.0,cypress:3.4.0"
```
By default, Nx uses currently installed packages to calculate what migrations need to run. You can override them like this:
By default, Nx uses currently installed packages to calculate what migrations need to run. To override them, override the version:
```bash
nx migrate @nrwl/workspace --to="@nrwl/jest@8.0.0"
nx migrate @nrwl/workspace --to="@nrwl/jest@12.0.0"
```
### Reverting a failed update
Updates are best done on a clean git history so that it can be easily reversed if something fails.
We try our best to make sure migrations do not fail but if one does, **please report it** on [Github](https://www.github.com/nrwl/nx/issues/new/).
Updates are best done on a clean git history so that it can be easily reversed if something fails. We try our best to make sure migrations do not fail but if one does, **please report it** on [GitHub](https://www.github.com/nrwl/nx/issues/new/).
If an update fails for any reason, you can revert it as you do any other set of changes:
```bash
@@ -12,7 +12,7 @@ using a monorepo approach. If you are currently using an Angular CLI workspace,
To add Nx to an existing Angular CLI workspace to an Nx workspace, with keeping your existing file structure in place, use the `ng add` command with the `--preserveAngularCLILayout` option:
```
```bash
ng add @nrwl/workspace --preserveAngularCLILayout
```
@@ -28,7 +28,7 @@ After the process completes, you continue using the same serve/build/lint/test c
To transform a Angular CLI workspace to an Nx workspace, use the `ng add` command:
```
```bash
ng add @nrwl/workspace
```
@@ -86,14 +86,14 @@ Your workspace is now powered by Nx! You can verify out that your application st
- To run e2e tests, run `ng e2e`.
- To see your dependency graph, run `nx dep-graph`.
> Your dependency graph will grow as you add, and use more applications and libraries.
> Your dependency graph will grow as you add, and use more applications and libraries. You can add the `--watch` flag to `nx dep-graph` to see this changes in-browser as you add them.
Learn more about the advantages of Nx in the following guides:
- [Using Cypress for e2e tests](/angular/cypress/overview)
- [Using Jest for unit tests](/angular/jest/overview)
- [Computation Caching](/angular/core-concepts/computation-caching)
- [Rebuilding and Retesting What is Affected](/angular/core-concepts/affected)
- [Computation Caching](/angular/core-extended/computation-caching)
- [Rebuilding and Retesting What is Affected](/angular/core-extended/affected)
## Transitioning Manually
@@ -376,4 +376,4 @@ Learn more about the advantages of Nx in the following guides:
[Using Cypress for e2e tests](/angular/cypress/overview) \
[Using Jest for unit tests](/angular/jest/overview) \
[Rebuilding and Retesting What is Affected](/angular/core-concepts/affected)
[Rebuilding and Retesting What is Affected](/angular/core-extended/affected)
@@ -59,7 +59,7 @@ Based on the state of the source code and the environment, Nx was able to figure
Nx read the output from cache instead of running the command for 1 out of 2 projects.
```
Nx built `api` and retrieved `todos` from its computation cache. Read more about the cache here [here](/{{framework}}/core-concepts/computation-caching).
Nx built `api` and retrieved `todos` from its computation cache. Read more about the cache here [here](/{{framework}}/core-extended/computation-caching).
## --with-deps
@@ -14,5 +14,5 @@ In this tutorial you:
**Dive Deep:**
- [Nx CLI](/{{framework}}/getting-started/nx-cli)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)
- [Computation Caching](/{{framework}}/core-extended/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-extended/affected)
@@ -86,21 +86,16 @@
"name": "Using Nx",
"id": "core-concepts",
"itemList": [
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Rebuild Only What is Affected",
"id": "affected",
"file": "shared/affected"
},
{
"name": "Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Mental Model",
"id": "mental-model",
"file": "shared/mental-model"
},
{
"name": "Updating Nx",
"id": "updating-nx",
@@ -318,6 +313,11 @@
"id": "workspace-generator",
"file": "angular/api-workspace/generators/workspace-generator"
},
{
"name": "convert-to-nx-project generator",
"id": "convert-to-nx-project-generator",
"file": "angular/api-workspace/generators/convert-to-nx-project"
},
{
"name": "run-commands executor",
"id": "run-commands-executor",
@@ -387,21 +387,26 @@
"id": "application",
"file": "angular/api-angular/generators/application"
},
{
"name": "convert-tslint-to-eslint",
"id": "convert-tslint-to-eslint",
"file": "angular/api-angular/generators/convert-tslint-to-eslint"
},
{
"name": "downgrade-module generator",
"id": "downgrade-module",
"file": "angular/api-angular/generators/downgrade-module"
},
{
"name": "karma-project generator",
"id": "karma-project",
"file": "angular/api-angular/generators/karma-project"
},
{
"name": "karma generator",
"id": "karma",
"file": "angular/api-angular/generators/karma"
},
{
"name": "karma-project generator",
"id": "karma-project",
"file": "angular/api-angular/generators/karma-project"
},
{
"name": "library generator",
"id": "library",
@@ -443,29 +448,29 @@
"file": "angular/api-angular/generators/upgrade-module"
},
{
"name": "convert-tslint-to-eslint",
"id": "convert-tslint-to-eslint",
"file": "angular/api-angular/generators/convert-tslint-to-eslint"
"name": "web-worker generator",
"id": "web-worker",
"file": "angular/api-angular/generators/web-worker"
},
{
"name": "package executor",
"id": "package",
"file": "angular/api-angular/executors/package"
"name": "delegate-build executor",
"id": "delegate-build",
"file": "angular/api-angular/executors/delegate-build"
},
{
"name": "ng packagr lite executor",
"id": "ng-packagr-lite",
"file": "angular/api-angular/executors/ng-packagr-lite"
},
{
"name": "package executor",
"id": "package",
"file": "angular/api-angular/executors/package"
},
{
"name": "webpack-browser executor",
"id": "webpack-browser",
"file": "angular/api-angular/executors/webpack-browser"
},
{
"name": "delegate-build executor",
"id": "delegate-build",
"file": "angular/api-angular/executors/delegate-build"
}
]
},
@@ -903,6 +908,22 @@
}
]
},
{
"name": "Core",
"id": "core-extended",
"itemList": [
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Rebuild Only What is Affected",
"id": "affected",
"file": "shared/affected"
}
]
},
{
"name": "Executors / Builders",
"id": "executors",
@@ -931,12 +952,32 @@
{
"name": "Using Generators",
"id": "using-schematics",
"file": "shared/using-generators"
"file": "angular/generators/using-generators"
},
{
"name": "Workspace Generators",
"id": "workspace-generators",
"file": "shared/tools-workspace-generators"
"file": "angular/generators/workspace-generators"
},
{
"name": "Composing Generators",
"id": "composing-generators",
"file": "angular/generators/composing-generators"
},
{
"name": "Generator Options",
"id": "generator-options",
"file": "shared/generators/generator-options"
},
{
"name": "Creating Files",
"id": "creating-files",
"file": "shared/generators/creating-files"
},
{
"name": "Modifying Files",
"id": "modifying-files",
"file": "shared/generators/modifying-files"
}
]
},
@@ -1185,21 +1226,16 @@
"name": "Using Nx",
"id": "core-concepts",
"itemList": [
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Rebuild Only What is Affected",
"id": "affected",
"file": "shared/affected"
},
{
"name": "Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Mental Model",
"id": "mental-model",
"file": "shared/mental-model"
},
{
"name": "Updating Nx",
"id": "updating-nx",
@@ -1413,6 +1449,11 @@
"id": "workspace-generator",
"file": "react/api-workspace/generators/workspace-generator"
},
{
"name": "convert-to-nx-project generator",
"id": "convert-to-nx-project-generator",
"file": "react/api-workspace/generators/convert-to-nx-project"
},
{
"name": "run-commands executor",
"id": "run-commands-executor",
@@ -1482,21 +1523,26 @@
"id": "application",
"file": "react/api-angular/generators/application"
},
{
"name": "convert-tslint-to-eslint",
"id": "convert-tslint-to-eslint",
"file": "react/api-angular/generators/convert-tslint-to-eslint"
},
{
"name": "downgrade-module generator",
"id": "downgrade-module",
"file": "react/api-angular/generators/downgrade-module"
},
{
"name": "karma-project generator",
"id": "karma-project",
"file": "react/api-angular/generators/karma-project"
},
{
"name": "karma generator",
"id": "karma",
"file": "react/api-angular/generators/karma"
},
{
"name": "karma-project generator",
"id": "karma-project",
"file": "react/api-angular/generators/karma-project"
},
{
"name": "library generator",
"id": "library",
@@ -1512,11 +1558,6 @@
"id": "ngrx",
"file": "react/api-angular/generators/ngrx"
},
{
"name": "convert-tslint-to-eslint",
"id": "convert-tslint-to-eslint",
"file": "react/api-angular/generators/convert-tslint-to-eslint"
},
{
"name": "stories generator",
"id": "stories",
@@ -1543,24 +1584,29 @@
"file": "react/api-angular/generators/upgrade-module"
},
{
"name": "package executor",
"id": "package",
"file": "react/api-angular/executors/package"
"name": "web-worker generator",
"id": "web-worker",
"file": "react/api-angular/generators/web-worker"
},
{
"name": "delegate-build executor",
"id": "delegate-build",
"file": "react/api-angular/executors/delegate-build"
},
{
"name": "ng packagr lite executor",
"id": "ng-packagr-lite",
"file": "react/api-angular/executors/ng-packagr-lite"
},
{
"name": "package executor",
"id": "package",
"file": "react/api-angular/executors/package"
},
{
"name": "webpack-browser executor",
"id": "webpack-browser",
"file": "react/api-angular/executors/webpack-browser"
},
{
"name": "delegate-build executor",
"id": "delegate-build",
"file": "react/api-angular/executors/delegate-build"
}
]
},
@@ -2004,6 +2050,22 @@
}
]
},
{
"name": "Core",
"id": "core-extended",
"itemList": [
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Rebuild Only What is Affected",
"id": "affected",
"file": "shared/affected"
}
]
},
{
"name": "Executors / Builders",
"id": "executors",
@@ -2032,12 +2094,32 @@
{
"name": "Using Generators",
"id": "using-schematics",
"file": "shared/using-generators"
"file": "shared/generators/using-generators"
},
{
"name": "Workspace Generators",
"id": "workspace-generators",
"file": "shared/tools-workspace-generators"
"file": "shared/generators/workspace-generators"
},
{
"name": "Composing Generators",
"id": "composing-generators",
"file": "shared/generators/composing-generators"
},
{
"name": "Generator Options",
"id": "generator-options",
"file": "shared/generators/generator-options"
},
{
"name": "Creating Files",
"id": "creating-files",
"file": "shared/generators/creating-files"
},
{
"name": "Modifying Files",
"id": "modifying-files",
"file": "shared/generators/modifying-files"
}
]
},
@@ -2248,21 +2330,16 @@
"name": "Using Nx",
"id": "core-concepts",
"itemList": [
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Rebuild Only What is Affected",
"id": "affected",
"file": "shared/affected"
},
{
"name": "Monorepos",
"id": "why-monorepos",
"file": "shared/guides/why-monorepos"
},
{
"name": "Mental Model",
"id": "mental-model",
"file": "shared/mental-model"
},
{
"name": "Updating Nx",
"id": "updating-nx",
@@ -2472,6 +2549,11 @@
"id": "workspace-generator",
"file": "node/api-workspace/generators/workspace-generator"
},
{
"name": "convert-to-nx-project generator",
"id": "convert-to-nx-project-generator",
"file": "node/api-workspace/generators/convert-to-nx-project"
},
{
"name": "run-commands executor",
"id": "run-commands-executor",
@@ -2541,21 +2623,26 @@
"id": "application",
"file": "node/api-angular/generators/application"
},
{
"name": "convert-tslint-to-eslint",
"id": "convert-tslint-to-eslint",
"file": "node/api-angular/generators/convert-tslint-to-eslint"
},
{
"name": "downgrade-module generator",
"id": "downgrade-module",
"file": "node/api-angular/generators/downgrade-module"
},
{
"name": "karma-project generator",
"id": "karma-project",
"file": "node/api-angular/generators/karma-project"
},
{
"name": "karma generator",
"id": "karma",
"file": "node/api-angular/generators/karma"
},
{
"name": "karma-project generator",
"id": "karma-project",
"file": "node/api-angular/generators/karma-project"
},
{
"name": "library generator",
"id": "library",
@@ -2597,29 +2684,29 @@
"file": "node/api-angular/generators/upgrade-module"
},
{
"name": "convert-tslint-to-eslint",
"id": "convert-tslint-to-eslint",
"file": "node/api-angular/generators/convert-tslint-to-eslint"
"name": "web-worker generator",
"id": "web-worker",
"file": "node/api-angular/generators/web-worker"
},
{
"name": "package executor",
"id": "package",
"file": "node/api-angular/executors/package"
"name": "delegate-build executor",
"id": "delegate-build",
"file": "node/api-angular/executors/delegate-build"
},
{
"name": "ng packagr lite executor",
"id": "ng-packagr-lite",
"file": "node/api-angular/executors/ng-packagr-lite"
},
{
"name": "package executor",
"id": "package",
"file": "node/api-angular/executors/package"
},
{
"name": "webpack-browser executor",
"id": "webpack-browser",
"file": "node/api-angular/executors/webpack-browser"
},
{
"name": "delegate-build executor",
"id": "delegate-build",
"file": "node/api-angular/executors/delegate-build"
}
]
},
@@ -3056,6 +3143,22 @@
}
]
},
{
"name": "Core",
"id": "core-extended",
"itemList": [
{
"name": "Computation Caching",
"id": "computation-caching",
"file": "shared/computation-caching"
},
{
"name": "Rebuild Only What is Affected",
"id": "affected",
"file": "shared/affected"
}
]
},
{
"name": "Executors / Builders",
"id": "executors",
@@ -3084,12 +3187,32 @@
{
"name": "Using Generators",
"id": "using-schematics",
"file": "shared/using-generators"
"file": "shared/generators/using-generators"
},
{
"name": "Workspace Generators",
"id": "workspace-generators",
"file": "shared/tools-workspace-generators"
"file": "shared/generators/workspace-generators"
},
{
"name": "Composing Generators",
"id": "composing-generators",
"file": "shared/generators/composing-generators"
},
{
"name": "Generator Options",
"id": "generator-options",
"file": "shared/generators/generator-options"
},
{
"name": "Creating Files",
"id": "creating-files",
"file": "shared/generators/creating-files"
},
{
"name": "Modifying Files",
"id": "modifying-files",
"file": "shared/generators/modifying-files"
}
]
},
@@ -128,6 +128,14 @@ Type: `boolean`
Skip creating spec files.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -142,7 +150,7 @@ Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`
Possible values: `css`, `scss`, `less`
The file extension to be used for style files.
@@ -1,6 +1,6 @@
# downgrade-module
Setup Downgrade Module
Setup Downgrade Module.
## Usage
@@ -40,7 +40,7 @@ The name of the main AngularJS module.
Type: `string`
The name of the project
The name of the project.
### skipFormat
@@ -48,7 +48,7 @@ Default: `false`
Type: `boolean`
Skip formatting files
Skip formatting files.
### skipPackageJson
@@ -56,4 +56,4 @@ Default: `false`
Type: `boolean`
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson)
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson).
@@ -150,6 +150,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -1,6 +1,6 @@
# ngrx
Add an ngrx config to a project
Add NgRx support to an application or library.
## Usage
@@ -66,23 +66,27 @@ The path to NgModule where the feature state will be registered. The host direct
Type: `string`
Name of the NgRx feature state, such as "products" or "users"). Recommended to use the plural form of the name.
Name of the NgRx feature state, such as `products` or `users`. Recommended to use the plural form of the name.
### onlyAddFiles
### ~~onlyAddFiles~~
Default: `false`
Type: `boolean`
**Deprecated**, use `skipImport`. Only add new NgRx files, without changing the module file (e.g., --onlyAddFiles).
**Deprecated:** Use the `skipImport` option instead.
### onlyEmptyRoot
Only add new NgRx files, without changing the module file (e.g., --onlyAddFiles).
### ~~onlyEmptyRoot~~
Default: `false`
Type: `boolean`
**Deprecated**, use `minimal`. Do not generate any files. Only generate StoreModule.forRoot and EffectsModule.forRoot (e.g., --onlyEmptyRoot).
**Deprecated:** Use the `minimal` option instead.
Do not generate any files. Only generate StoreModule.forRoot and EffectsModule.forRoot (e.g., --onlyEmptyRoot).
### root
@@ -1,6 +1,6 @@
# upgrade-module
Add an upgrade module
Add an upgrade module.
## Usage
@@ -28,7 +28,7 @@ nx g upgrade-module ... --dry-run
Type: `string`
The selector of an AngularJS component (e.g., --angularJsCmpSelector=myComponent)
The selector of an AngularJS component (e.g., --angularJsCmpSelector=myComponent).
### angularJsImport
@@ -46,7 +46,7 @@ The name of the main AngularJS module.
Type: `string`
The name of the project
The name of the project.
### router
@@ -54,7 +54,7 @@ Default: `false`
Type: `boolean`
Sets up router synchronization (e.g., --router)
Sets up router synchronization (e.g., --router).
### skipFormat
@@ -62,7 +62,7 @@ Default: `false`
Type: `boolean`
Skip formatting files
Skip formatting files.
### skipPackageJson
@@ -70,4 +70,4 @@ Default: `false`
Type: `boolean`
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson)
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson).
@@ -0,0 +1,59 @@
# web-worker
Create a Web Worker.
## Usage
```bash
nx generate web-worker ...
```
By default, Nx will search for `web-worker` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:web-worker ...
```
Show what will be generated without writing to disk:
```bash
nx g web-worker ... --dry-run
```
## Options
### name
Type: `string`
The name of the worker.
### path
Type: `string`
The path at which to create the worker file, relative to the current workspace.
### project
Type: `string`
The name of the project.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files.
### snippet
Default: `true`
Type: `boolean`
Add a worker creation snippet in a sibling file of the same name.
@@ -98,6 +98,14 @@ Type: `boolean`
Do not add dependencies to package.json.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Type: `string`
@@ -66,6 +66,14 @@ Type: `boolean`
Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### style
Alias(es): s
@@ -72,6 +72,14 @@ Type: `boolean`
Do not add dependencies to package.json.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Type: `string`
@@ -108,6 +108,14 @@ Type: `boolean`
Skip updating workspace.json with default options based on values provided to this app (e.g. babel, style)
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### style
Alias(es): s
@@ -106,6 +106,14 @@ Type: `boolean`
Do not add dependencies to package.json.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Type: `string`
@@ -138,6 +138,14 @@ Type: `boolean`
Do not update tsconfig.base.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `false`
@@ -60,9 +60,11 @@
- [applyChangesToString](../../node/nx-devkit/index#applychangestostring)
- [convertNxExecutor](../../node/nx-devkit/index#convertnxexecutor)
- [convertNxGenerator](../../node/nx-devkit/index#convertnxgenerator)
- [detectPackageManager](../../node/nx-devkit/index#detectpackagemanager)
- [formatFiles](../../node/nx-devkit/index#formatfiles)
- [generateFiles](../../node/nx-devkit/index#generatefiles)
- [getPackageManagerCommand](../../node/nx-devkit/index#getpackagemanagercommand)
- [getPackageManagerVersion](../../node/nx-devkit/index#getpackagemanagerversion)
- [getProjects](../../node/nx-devkit/index#getprojects)
- [getWorkspaceLayout](../../node/nx-devkit/index#getworkspacelayout)
- [getWorkspacePath](../../node/nx-devkit/index#getworkspacepath)
@@ -473,7 +475,7 @@ Callback to install dependencies only if necessary. undefined is returned if cha
### addProjectConfiguration
**addProjectConfiguration**(`host`: [_Tree_](../../node/nx-devkit/index#tree), `projectName`: _string_, `projectConfiguration`: [_ProjectConfiguration_](../../node/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../node/nx-devkit/index#nxjsonprojectconfiguration)): _void_
**addProjectConfiguration**(`host`: [_Tree_](../../node/nx-devkit/index#tree), `projectName`: _string_, `projectConfiguration`: [_ProjectConfiguration_](../../node/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../node/nx-devkit/index#nxjsonprojectconfiguration), `standalone?`: _boolean_): _void_
Adds project configuration to the Nx workspace.
@@ -482,11 +484,12 @@ both files.
#### Parameters
| Name | Type | Description |
| :--------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------- |
| `host` | [_Tree_](../../node/nx-devkit/index#tree) | the file system tree |
| `projectName` | _string_ | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [_ProjectConfiguration_](../../node/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../node/nx-devkit/index#nxjsonprojectconfiguration) | project configuration |
| Name | Type | Default value | Description |
| :--------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :----------------------------------------------------------------------------------------- |
| `host` | [_Tree_](../../node/nx-devkit/index#tree) | - | the file system tree |
| `projectName` | _string_ | - | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [_ProjectConfiguration_](../../node/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../node/nx-devkit/index#nxjsonprojectconfiguration) | - | project configuration |
| `standalone` | _boolean_ | false | should the project use package.json? If false, the project config is inside workspace.json |
**Returns:** _void_
@@ -577,6 +580,22 @@ Convert an Nx Generator into an Angular Devkit Schematic
---
### detectPackageManager
**detectPackageManager**(`dir?`: _string_): [_PackageManager_](../../node/nx-devkit/index#packagemanager)
Detects which package manager is used in the workspace based on the lock file.
#### Parameters
| Name | Type | Default value |
| :---- | :------- | :------------ |
| `dir` | _string_ | '' |
**Returns:** [_PackageManager_](../../node/nx-devkit/index#packagemanager)
---
### formatFiles
**formatFiles**(`host`: [_Tree_](../../node/nx-devkit/index#tree)): _Promise_<void\>
@@ -634,7 +653,7 @@ doesn't get confused about incorrect TypeScript files.
### getPackageManagerCommand
**getPackageManagerCommand**(`packageManager?`: [_PackageManager_](../../node/nx-devkit/index#packagemanager)): _object_
**getPackageManagerCommand**(`packageManager?`: [_PackageManager_](../../node/nx-devkit/index#packagemanager)): PackageManagerCommands
Returns commands for the package manager used in the workspace.
By default, the package manager is derived based on the lock file,
@@ -652,17 +671,25 @@ execSync(`${getPackageManagerCommand().addDev} my-dev-package`);
| :--------------- | :------------------------------------------------------------ |
| `packageManager` | [_PackageManager_](../../node/nx-devkit/index#packagemanager) |
**Returns:** _object_
**Returns:** PackageManagerCommands
| Name | Type |
| :-------- | :------------------------------------------------- |
| `add` | _string_ |
| `addDev` | _string_ |
| `exec` | _string_ |
| `install` | _string_ |
| `list` | _string_ |
| `rm` | _string_ |
| `run` | (`script`: _string_, `args`: _string_) => _string_ |
---
### getPackageManagerVersion
**getPackageManagerVersion**(`packageManager?`: [_PackageManager_](../../node/nx-devkit/index#packagemanager)): _string_
Returns the version of the package manager used in the workspace.
By default, the package manager is derived based on the lock file,
but it can also be passed in explicitly.
#### Parameters
| Name | Type |
| :--------------- | :------------------------------------------------------------ |
| `packageManager` | [_PackageManager_](../../node/nx-devkit/index#packagemanager) |
**Returns:** _string_
---
@@ -78,6 +78,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Alias(es): t
@@ -150,6 +150,14 @@ Type: `boolean`
Skip updating workspace.json with default options based on values provided to this app (e.g. babel, style).
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -158,6 +158,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -77,3 +77,11 @@ The tool to use for running lint checks.
Type: `string`
Project name
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
@@ -60,6 +60,14 @@ Type: `string`
Library or application name
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### uiFramework
Type: `string`
@@ -53,3 +53,11 @@ The tool to use for running lint checks.
Type: `string`
Library or application name
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
@@ -76,6 +76,14 @@ Type: `boolean`
Skip formatting files
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### style
Default: `css`
@@ -0,0 +1,51 @@
# convert-to-nx-project
Moves a project's configuration outside of workspace.json
## Usage
```bash
nx generate convert-to-nx-project ...
```
By default, Nx will search for `convert-to-nx-project` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/workspace:convert-to-nx-project ...
```
Show what will be generated without writing to disk:
```bash
nx g convert-to-nx-project ... --dry-run
```
### Examples
Convert the my-feature-lib project to use project.json file instead of workspace.json:
```bash
nx g @nrwl/workspace:convert-to-nx-project --project my-feature-lib
```
Convert all projects in workspace.json to separate project.json files.:
```bash
nx g @nrwl/workspace:convert-to-nx-project --all
```
## Options
### all
Type: `boolean`
Should every project be converted?
### project
Type: `string`
Project name
@@ -130,6 +130,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `false`
@@ -131,3 +131,9 @@ Print additional error stack trace on failure
### version
Show version number
### watch
Default: `false`
Watch for changes to dep graph and update in-browser
@@ -54,6 +54,12 @@ Show the graph where every node is either an ancestor or a descendant of todos-f
nx dep-graph --focus=todos-feature-main --exclude=project-one,project-two
```
Watch for changes to dep graph and update in-browser:
```bash
nx dep-graph --watch
```
## Options
### exclude
@@ -87,3 +93,9 @@ Bind the dep graph server to a specific port.
### version
Show version number
### watch
Default: `false`
Watch for changes to dep graph and update in-browser
@@ -17,7 +17,7 @@ Nx works especially well for [monorepos](/{{framework}}/core-concepts/why-monore
## Features
- Test (or builds or lints) only the projects [affected](/{{framework}}/cli/affected) by a code change.
- [Cache](/{{framework}}/core-concepts/computation-caching) command output locally so that future runs on the same code happen in seconds. The paid [Nx Cloud](https://nx.app) offering allows this cache to be shared across every developer in your organization.
- [Cache](/{{framework}}/core-extended/computation-caching) command output locally so that future runs on the same code happen in seconds. The paid [Nx Cloud](https://nx.app) offering allows this cache to be shared across every developer in your organization.
- Provide a consistent syntax for [executing commands](/{{framework}}/executors/using-builders). `nx build my-app` works no matter what framework `my-app` uses.
- Automate code modification tasks with [generators](/{{framework}}/cli/affected).
- Access a thriving ecosystem of [plugins](/{{framework}}/generators/using-schematics) from Nrwl and the [community](/community).
@@ -31,5 +31,5 @@ Nx works especially well for [monorepos](/{{framework}}/core-concepts/why-monore
- [Nx CLI](/{{framework}}/getting-started/nx-cli)
- [Configuration Files](/{{framework}}/core-concepts/configuration)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)
- [Computation Caching](/{{framework}}/core-extended/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-extended/affected)
@@ -41,15 +41,6 @@ nx workspace-generator my-generator
[The first command](/{{framework}}/cli/generate) scaffolds a new customizable workspace generator named `my-generator` and [the second command](/{{framework}}/cli/workspace-generator) invokes it.
**Update plugins:**
```bash
nx migrate latest
nx migrate --run-migrations=migrations.json
```
[The first command](/{{framework}}/cli/migrate) updates the installed Nx plugin versions and creates a list of generators to keep configuration files up to date. [The second command](/{{framework}}/cli/migrate) invokes those generators.
**Run an executor on one project:**
```bash
@@ -57,7 +48,15 @@ nx run my-app:build
nx build my-app
```
Both of [these commands](/{{framework}}/cli/run) build the `my-app` application. Custom executors need to use the more verbose `nx run project:target` syntax. See the [workspace.json documentation](/{{framework}}/core-concepts/configuration) for information on configuring executor options.
Both of [these commands](/{{framework}}/cli/run) build the `my-app` application. See the [workspace.json documentation](/{{framework}}/core-concepts/configuration) for information on configuring executor options.
**Run an executor for many projects:**
```bash
nx run-many --target=build --projects=app1,app2
```
[This command](/{{framework}}/cli/run-many) builds `app1` and `app2`.
**Run an executor for all affected projects:**
@@ -71,10 +70,11 @@ nx affected --target=build
```bash
nx dep-graph
nx dep-graph --watch
nx affected:dep-graph
```
[The first command](/{{framework}}/cli/dep-graph) launches a web browser with repository's dependency graph rendered visually. [The second command](/{{framework}}/cli/affected-dep-graph) renders the same graph with projects affected by the current code change highlighted.
[The first command](/{{framework}}/cli/dep-graph) launches a web browser with repository's dependency graph rendered visually. You can add the `--watch` flag to watch for changes to the dep grpah and update the view in-browser. [The second command](/{{framework}}/cli/affected-dep-graph) renders the same graph with projects affected by the current code change highlighted.
**List installed plugins:**
@@ -83,3 +83,17 @@ nx list
```
[This command](/{{framework}}/cli/list) lists the currently installed Nx plugins and shows other plugins that are available.
**Update plugins:**
```bash
nx migrate latest
nx migrate --run-migrations=migrations.json
```
[The first command](/{{framework}}/cli/migrate) updates the installed Nx plugin versions and creates a list of generators to keep configuration files up to date. [The second command](/{{framework}}/cli/migrate) invokes those generators.
## Common Env Variables
- Setting **NX_VERBOSE_LOGGING=true** will print debug information useful for troubleshooting.
- Setting **NX_PERF_LOGGING=true** will print debug information useful for profiling executors and Nx itself.
@@ -18,6 +18,12 @@ The `workspace.json` configuration file contains information about the targets a
"build": {
"executor": "@nrwl/node:build",
"outputs": ["dist/apps/myapp"],
"dependsOn": [
{
"target": "build",
"projects": "dependencies"
}
],
"options": {
"outputPath": "dist/packages/myapp",
"main": "packages/myapp/src/main.ts",
@@ -99,9 +105,11 @@ For instance, the following configures `mylib`.
- `root` tells Nx the location of the library including its sources and configuration files.
- `sourceRoot` tells Nx the location of the library's source files.
- `projectType` is either 'application' or 'library'.
- `projectType` is either 'application' or 'library'. The project type is used in dep graph viz and in a few aux commands.
- `targets` configures all the targets which define what tasks you can run against the library.
> Projects utilizing `project.json` files will not be present in `workspace.json`.
### Targets
Let's look at the simple target:
@@ -119,7 +127,7 @@ Let's look at the simple target:
**Target Name**
The name of the target `test` means that you can invoke it as follows: `nx test mylib` or `nx run mylib:test`. The name isn't significant in any other way. If you rename it to, for example, `mytest`, you will be able to run as follows: `nx run mylib:mytest`.
The name of the target `test` means that you can invoke it as follows: `nx test mylib` or `nx run mylib:test`. The name isn't significant in any other way. If you rename it to, for example, `mytest`, you will be able to run as follows: `nx mytest mylib` or `nx run mylib:mytest`.
**Executor**
@@ -188,6 +196,66 @@ require(`@nrwl/jest`).executors['jest']({...options, ...selectedConfiguration, .
The selected configuration adds/overrides the default options, and the provided command line args add/override the configuration options.
**Target Dependencies**
Targets can depend on other targets. A common scenario is having to build dependencies of a project first before building the project. You can specify this using the `dependsOn`.
```json
{
"build": {
"executor": "@nrwl/node:build",
"outputs": ["dist/apps/myapp"],
"options": {
"index": "apps/myapp/src/app.html",
"main": "apps/myapp/src/main.ts"
},
"dependsOn": [
{
"target": "build",
"projects": "dependencies"
}
]
}
}
```
In this case, running `nx build myapp` will build all the buildable libraries `myapp` depends on first. In other words, `nx build myapp` will result in multiple tasks executing. The `--parallel`, and `--max-parallel` flags will have the same effect as they would with `run-many` or `affected`.
It is also possible to define dependencies between the targets of the same project.
In the following example invoking `nx build myapp` will build all the libraries first, then `nx build-base myapp` will be executed and only then `nx build myapp` will be executed.
```json
{
"build-base": {
"executor": "@nrwl/node:build",
"outputs": ["dist/apps/myapp"],
"options": {
"index": "apps/myapp/src/app.html",
"main": "apps/myapp/src/main.ts"
}
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"dependsOn": [
{
"target": "build",
"projects": "dependencies"
},
{
"target": "build-base",
"projects": "self"
}
],
"options": {
"command": "./copy-readme-and-license.sh"
}
}
}
```
Often the same `dependsOn` configuration has to be defined for every project in the repo. You can define it once in `nx.json` (see below).
### Generators
You can configure default generator options in `workspace.json` as well. For instance, the following will tell Nx to always pass `--js` when creating new libraries.
@@ -236,6 +304,33 @@ The following command will generate a new library: `nx g @nrwl/node:lib mylib`.
When the `version` of `workspace.json` is set to 2, `targets`, `generators` and `executor` properties are used instead of the version 1 properties `architect`, `schematics` and `builder`.
## project.json
Project configurations can also be independent files, referenced by `workspace.json`. For instance, a `workspace.json` may contain projects configured as below.
```json
{
"projects": {
"mylib": "libs/mylib"
}
}
```
This tells Nx that all configuration for that project is found in the `libs/mylib/project.json` file. This file contains a combination of the project's configuration from both `workspace.json` and `nx.json`.
```json
{
"mylib": {
"root": "libs/mylib/",
"sourceRoot": "libs/mylib/src",
"projectType": "library",
"targets": {},
"tags": [],
"implicitDependencies": []
}
}
```
## nx.json
The `nx.json` file contains extra configuration options mostly related to the project graph.
@@ -370,3 +465,39 @@ You can also add dependencies between projects. For instance, the example below
}
}
```
> Projects utilizing `project.json` files will not be present in `nx.json`.
### Target Dependencies
Targets can depend on other targets. A common scenario is having to build dependencies of a project first before building the project. The `dependsOn` property in `workspace.json` can be used to define the list of dependencies of an individual target.
Often the same `dependsOn` configuration has to be defined for every project in the repo, and that's when defining `targetDependencies` in `nx.json` is helpful.
```json
{
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
]
}
}
```
The configuration above is identical to adding `{"dependsOn": [{"target": "build", "projects": "dependencies"]}` to every build target in `workspace.json`.
The `dependsOn` property in `workspace.json` takes precedence over the `targetDependencies` in `nx.json`.
## .nxignore
You may optionally add an `.nxignore` file to the root. This file is used to specify files in your workspace that should be completely ignored by Nx.
The syntax is the same as a [`.gitignore` file](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring).
**When a file is specified in the `.nxignore` file:**
1. Changes to that file will not be taken into account in the `affected` calculations.
2. Even if the file is outside an app or library, `nx workspace-lint` will not warn about it.
@@ -14,5 +14,5 @@ In this tutorial you:
**Dive Deep:**
- [Nx CLI](/{{framework}}/getting-started/nx-cli)
- [Computation Caching](/{{framework}}/core-concepts/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-concepts/affected)
- [Computation Caching](/{{framework}}/core-extended/computation-caching)
- [Rebuilding What is Affected](/{{framework}}/core-extended/affected)
@@ -128,6 +128,14 @@ Type: `boolean`
Skip creating spec files.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -142,7 +150,7 @@ Default: `css`
Type: `string`
Possible values: `css`, `scss`, `styl`, `less`
Possible values: `css`, `scss`, `less`
The file extension to be used for style files.
@@ -1,6 +1,6 @@
# downgrade-module
Setup Downgrade Module
Setup Downgrade Module.
## Usage
@@ -40,7 +40,7 @@ The name of the main AngularJS module.
Type: `string`
The name of the project
The name of the project.
### skipFormat
@@ -48,7 +48,7 @@ Default: `false`
Type: `boolean`
Skip formatting files
Skip formatting files.
### skipPackageJson
@@ -56,4 +56,4 @@ Default: `false`
Type: `boolean`
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson)
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson).
@@ -150,6 +150,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -1,6 +1,6 @@
# ngrx
Add an ngrx config to a project
Add NgRx support to an application or library.
## Usage
@@ -66,23 +66,27 @@ The path to NgModule where the feature state will be registered. The host direct
Type: `string`
Name of the NgRx feature state, such as "products" or "users"). Recommended to use the plural form of the name.
Name of the NgRx feature state, such as `products` or `users`. Recommended to use the plural form of the name.
### onlyAddFiles
### ~~onlyAddFiles~~
Default: `false`
Type: `boolean`
**Deprecated**, use `skipImport`. Only add new NgRx files, without changing the module file (e.g., --onlyAddFiles).
**Deprecated:** Use the `skipImport` option instead.
### onlyEmptyRoot
Only add new NgRx files, without changing the module file (e.g., --onlyAddFiles).
### ~~onlyEmptyRoot~~
Default: `false`
Type: `boolean`
**Deprecated**, use `minimal`. Do not generate any files. Only generate StoreModule.forRoot and EffectsModule.forRoot (e.g., --onlyEmptyRoot).
**Deprecated:** Use the `minimal` option instead.
Do not generate any files. Only generate StoreModule.forRoot and EffectsModule.forRoot (e.g., --onlyEmptyRoot).
### root
@@ -1,6 +1,6 @@
# upgrade-module
Add an upgrade module
Add an upgrade module.
## Usage
@@ -28,7 +28,7 @@ nx g upgrade-module ... --dry-run
Type: `string`
The selector of an AngularJS component (e.g., --angularJsCmpSelector=myComponent)
The selector of an AngularJS component (e.g., --angularJsCmpSelector=myComponent).
### angularJsImport
@@ -46,7 +46,7 @@ The name of the main AngularJS module.
Type: `string`
The name of the project
The name of the project.
### router
@@ -54,7 +54,7 @@ Default: `false`
Type: `boolean`
Sets up router synchronization (e.g., --router)
Sets up router synchronization (e.g., --router).
### skipFormat
@@ -62,7 +62,7 @@ Default: `false`
Type: `boolean`
Skip formatting files
Skip formatting files.
### skipPackageJson
@@ -70,4 +70,4 @@ Default: `false`
Type: `boolean`
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson)
Do not add @angular/upgrade to package.json (e.g., --skipPackageJson).
@@ -0,0 +1,59 @@
# web-worker
Create a Web Worker.
## Usage
```bash
nx generate web-worker ...
```
By default, Nx will search for `web-worker` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/angular:web-worker ...
```
Show what will be generated without writing to disk:
```bash
nx g web-worker ... --dry-run
```
## Options
### name
Type: `string`
The name of the worker.
### path
Type: `string`
The path at which to create the worker file, relative to the current workspace.
### project
Type: `string`
The name of the project.
### skipFormat
Default: `false`
Type: `boolean`
Skip formatting files.
### snippet
Default: `true`
Type: `boolean`
Add a worker creation snippet in a sibling file of the same name.
@@ -98,6 +98,14 @@ Type: `boolean`
Do not add dependencies to package.json.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Type: `string`
@@ -66,6 +66,14 @@ Type: `boolean`
Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### style
Alias(es): s
@@ -72,6 +72,14 @@ Type: `boolean`
Do not add dependencies to package.json.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Type: `string`
@@ -108,6 +108,14 @@ Type: `boolean`
Skip updating workspace.json with default options based on values provided to this app (e.g. babel, style)
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### style
Alias(es): s
@@ -106,6 +106,14 @@ Type: `boolean`
Do not add dependencies to package.json.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Type: `string`
@@ -138,6 +138,14 @@ Type: `boolean`
Do not update tsconfig.base.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `false`
@@ -60,9 +60,11 @@
- [applyChangesToString](../../react/nx-devkit/index#applychangestostring)
- [convertNxExecutor](../../react/nx-devkit/index#convertnxexecutor)
- [convertNxGenerator](../../react/nx-devkit/index#convertnxgenerator)
- [detectPackageManager](../../react/nx-devkit/index#detectpackagemanager)
- [formatFiles](../../react/nx-devkit/index#formatfiles)
- [generateFiles](../../react/nx-devkit/index#generatefiles)
- [getPackageManagerCommand](../../react/nx-devkit/index#getpackagemanagercommand)
- [getPackageManagerVersion](../../react/nx-devkit/index#getpackagemanagerversion)
- [getProjects](../../react/nx-devkit/index#getprojects)
- [getWorkspaceLayout](../../react/nx-devkit/index#getworkspacelayout)
- [getWorkspacePath](../../react/nx-devkit/index#getworkspacepath)
@@ -473,7 +475,7 @@ Callback to install dependencies only if necessary. undefined is returned if cha
### addProjectConfiguration
**addProjectConfiguration**(`host`: [_Tree_](../../react/nx-devkit/index#tree), `projectName`: _string_, `projectConfiguration`: [_ProjectConfiguration_](../../react/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../react/nx-devkit/index#nxjsonprojectconfiguration)): _void_
**addProjectConfiguration**(`host`: [_Tree_](../../react/nx-devkit/index#tree), `projectName`: _string_, `projectConfiguration`: [_ProjectConfiguration_](../../react/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../react/nx-devkit/index#nxjsonprojectconfiguration), `standalone?`: _boolean_): _void_
Adds project configuration to the Nx workspace.
@@ -482,11 +484,12 @@ both files.
#### Parameters
| Name | Type | Description |
| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------- |
| `host` | [_Tree_](../../react/nx-devkit/index#tree) | the file system tree |
| `projectName` | _string_ | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [_ProjectConfiguration_](../../react/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../react/nx-devkit/index#nxjsonprojectconfiguration) | project configuration |
| Name | Type | Default value | Description |
| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------ | :----------------------------------------------------------------------------------------- |
| `host` | [_Tree_](../../react/nx-devkit/index#tree) | - | the file system tree |
| `projectName` | _string_ | - | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [_ProjectConfiguration_](../../react/nx-devkit/index#projectconfiguration) & [_NxJsonProjectConfiguration_](../../react/nx-devkit/index#nxjsonprojectconfiguration) | - | project configuration |
| `standalone` | _boolean_ | false | should the project use package.json? If false, the project config is inside workspace.json |
**Returns:** _void_
@@ -577,6 +580,22 @@ Convert an Nx Generator into an Angular Devkit Schematic
---
### detectPackageManager
**detectPackageManager**(`dir?`: _string_): [_PackageManager_](../../react/nx-devkit/index#packagemanager)
Detects which package manager is used in the workspace based on the lock file.
#### Parameters
| Name | Type | Default value |
| :---- | :------- | :------------ |
| `dir` | _string_ | '' |
**Returns:** [_PackageManager_](../../react/nx-devkit/index#packagemanager)
---
### formatFiles
**formatFiles**(`host`: [_Tree_](../../react/nx-devkit/index#tree)): _Promise_<void\>
@@ -634,7 +653,7 @@ doesn't get confused about incorrect TypeScript files.
### getPackageManagerCommand
**getPackageManagerCommand**(`packageManager?`: [_PackageManager_](../../react/nx-devkit/index#packagemanager)): _object_
**getPackageManagerCommand**(`packageManager?`: [_PackageManager_](../../react/nx-devkit/index#packagemanager)): PackageManagerCommands
Returns commands for the package manager used in the workspace.
By default, the package manager is derived based on the lock file,
@@ -652,17 +671,25 @@ execSync(`${getPackageManagerCommand().addDev} my-dev-package`);
| :--------------- | :------------------------------------------------------------- |
| `packageManager` | [_PackageManager_](../../react/nx-devkit/index#packagemanager) |
**Returns:** _object_
**Returns:** PackageManagerCommands
| Name | Type |
| :-------- | :------------------------------------------------- |
| `add` | _string_ |
| `addDev` | _string_ |
| `exec` | _string_ |
| `install` | _string_ |
| `list` | _string_ |
| `rm` | _string_ |
| `run` | (`script`: _string_, `args`: _string_) => _string_ |
---
### getPackageManagerVersion
**getPackageManagerVersion**(`packageManager?`: [_PackageManager_](../../react/nx-devkit/index#packagemanager)): _string_
Returns the version of the package manager used in the workspace.
By default, the package manager is derived based on the lock file,
but it can also be passed in explicitly.
#### Parameters
| Name | Type |
| :--------------- | :------------------------------------------------------------- |
| `packageManager` | [_PackageManager_](../../react/nx-devkit/index#packagemanager) |
**Returns:** _string_
---
@@ -78,6 +78,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### tags
Alias(es): t
@@ -150,6 +150,14 @@ Type: `boolean`
Skip updating workspace.json with default options based on values provided to this app (e.g. babel, style).
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -158,6 +158,14 @@ Type: `boolean`
Do not update tsconfig.json for development experience.
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### strict
Default: `true`
@@ -77,3 +77,11 @@ The tool to use for running lint checks.
Type: `string`
Project name
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
@@ -60,6 +60,14 @@ Type: `string`
Library or application name
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### uiFramework
Type: `string`
@@ -53,3 +53,11 @@ The tool to use for running lint checks.
Type: `string`
Library or application name
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
@@ -76,6 +76,14 @@ Type: `boolean`
Skip formatting files
### standaloneConfig
Default: `false`
Type: `boolean`
Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
### style
Default: `css`
@@ -0,0 +1,51 @@
# convert-to-nx-project
Moves a project's configuration outside of workspace.json
## Usage
```bash
nx generate convert-to-nx-project ...
```
By default, Nx will search for `convert-to-nx-project` in the default collection provisioned in `workspace.json`.
You can specify the collection explicitly as follows:
```bash
nx g @nrwl/workspace:convert-to-nx-project ...
```
Show what will be generated without writing to disk:
```bash
nx g convert-to-nx-project ... --dry-run
```
### Examples
Convert the my-feature-lib project to use project.json file instead of workspace.json:
```bash
nx g @nrwl/workspace:convert-to-nx-project --project my-feature-lib
```
Convert all projects in workspace.json to separate project.json files.:
```bash
nx g @nrwl/workspace:convert-to-nx-project --all
```
## Options
### all
Type: `boolean`
Should every project be converted?
### project
Type: `string`
Project name

Some files were not shown because too many files have changed in this diff Show More