docs(misc): standardize all the install commands with different pm (#21226)
This commit is contained in:
parent
4700df62be
commit
dd5f3c8d17
@ -25,14 +25,30 @@ can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-
|
|||||||
|
|
||||||
Adding the Angular plugin to an existing Nx workspace can be done with the following:
|
Adding the Angular plugin to an existing Nx workspace can be done with the following:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @nx/angular
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @nx/angular
|
yarn add -D @nx/angular
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/angular
|
pnpm add -D @nx/angular
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
{% callout type="note" title="Angular Tutorials" %}
|
{% callout type="note" title="Angular Tutorials" %}
|
||||||
For a full tutorial experience, follow the [Angular Standalone Tutorial](/getting-started/tutorials/angular-standalone-tutorial) or the [Angular Monorepo Tutorial](/getting-started/tutorials/angular-monorepo-tutorial)
|
For a full tutorial experience, follow the [Angular Standalone Tutorial](/getting-started/tutorials/angular-standalone-tutorial) or the [Angular Monorepo Tutorial](/getting-started/tutorials/angular-monorepo-tutorial)
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|||||||
@ -15,14 +15,30 @@ Cypress is a test runner built for the modern web. It has a lot of great feature
|
|||||||
|
|
||||||
If the `@nx/cypress` package is not installed, install the version that matches your `nx` package version.
|
If the `@nx/cypress` package is not installed, install the version that matches your `nx` package version.
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
yarn add --dev @nx/cypress
|
{% tab label="npm" %}
|
||||||
```
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/cypress
|
npm add -D @nx/cypress
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @nx/cypress
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/cypress
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
## E2E Testing
|
## E2E Testing
|
||||||
|
|
||||||
By default, when creating a new frontend application, Nx will use Cypress to create the e2e tests project.
|
By default, when creating a new frontend application, Nx will use Cypress to create the e2e tests project.
|
||||||
|
|||||||
@ -38,19 +38,24 @@ You can create a new Detox E2E project for an existing mobile project.
|
|||||||
If the `@nx/detox` package is not installed, install the version that matches your `@nx/workspace` version.
|
If the `@nx/detox` package is not installed, install the version that matches your `@nx/workspace` version.
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```sh
|
```shell
|
||||||
# npm
|
npm add -D @nx/detox
|
||||||
npm install --save-dev @nx/detox
|
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```sh
|
```shell
|
||||||
# yarn
|
yarn add -D @nx/detox
|
||||||
yarn add --dev @nx/detox
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/detox
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ To add the esbuild plugin to an existing workspace, run the following:
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/esbuild
|
npm add -D @nx/esbuild
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -31,6 +31,13 @@ npm install -D @nx/esbuild
|
|||||||
yarn add -D @nx/esbuild
|
yarn add -D @nx/esbuild
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/esbuild
|
||||||
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% /tabs %}
|
{% /tabs %}
|
||||||
|
|
||||||
|
|||||||
@ -14,17 +14,24 @@ Make sure to install the `@nx/eslint-plugin` version that matches the version of
|
|||||||
In any Nx workspace, you can install `@nx/eslint-plugin` by running the following commands if the package is not already installed:
|
In any Nx workspace, you can install `@nx/eslint-plugin` by running the following commands if the package is not already installed:
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/eslint-plugin
|
npm add -D @nx/eslint-plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/eslint-plugin
|
yarn add -D @nx/eslint-plugin
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/eslint-plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -19,17 +19,24 @@ Make sure to install the `@nx/expo` version that matches the version of `nx` in
|
|||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/expo
|
npm add -D @nx/expo
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/expo
|
yarn add -D @nx/expo
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/expo
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -22,14 +22,30 @@ First, install `@nx/jest`, if not already installed using your preferred package
|
|||||||
Make sure to install the `@nx/jest` version that matches the version of `nx` in your repository. If the version numbers get out of sync, you can encounter some difficult to debug errors. You can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-versions-in-sync).
|
Make sure to install the `@nx/jest` version that matches the version of `nx` in your repository. If the version numbers get out of sync, you can encounter some difficult to debug errors. You can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-versions-in-sync).
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
npm install --save-dev @nx/jest
|
{% tab label="npm" %}
|
||||||
```
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/jest
|
npm add -D @nx/jest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @nx/jest
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/jest
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Once installed, run the `configuration` generator
|
Once installed, run the `configuration` generator
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -11,17 +11,24 @@ Make sure to install the `@nx/js` version that matches the version of `nx` in yo
|
|||||||
In any Nx workspace, you can install `@nx/js` by running the following commands if `@nx/js` package is not installed:
|
In any Nx workspace, you can install `@nx/js` by running the following commands if `@nx/js` package is not installed:
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/js
|
npm add -D @nx/js
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/js
|
yarn add -D @nx/js
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/js
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -27,14 +27,30 @@ Make sure to install the `@nx/nest` version that matches the version of `nx` in
|
|||||||
|
|
||||||
To add the Nest plugin to an existing workspace, run one the following commands:
|
To add the Nest plugin to an existing workspace, run one the following commands:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/nest
|
npm add -D @nx/nest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @nx/nest
|
yarn add -D @nx/nest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/nest
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
### Create Applications
|
### Create Applications
|
||||||
|
|
||||||
You can add a new Nest application with the following command:
|
You can add a new Nest application with the following command:
|
||||||
|
|||||||
@ -16,14 +16,21 @@ To add Next.js to an existing Nx workspace, install the `@nx/next` package. Make
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/next
|
npm add -D @nx/next
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="yarn" %}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/next
|
yarn add -D @nx/next
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/next
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -8,14 +8,30 @@ Make sure to install the `@nx/node` version that matches the version of `nx` in
|
|||||||
|
|
||||||
To add the Node plugin to an existing workspace, run one of the following:
|
To add the Node plugin to an existing workspace, run one of the following:
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
# For npm users
|
{% tab label="npm" %}
|
||||||
npm install -D @nx/node
|
|
||||||
|
|
||||||
# For yarn users
|
```shell
|
||||||
|
npm add -D @nx/node
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
yarn add -D @nx/node
|
yarn add -D @nx/node
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/node
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
### Creating Applications
|
### Creating Applications
|
||||||
|
|
||||||
You can add a new application with the following:
|
You can add a new application with the following:
|
||||||
|
|||||||
@ -25,7 +25,7 @@ There are a number of ways to use Nuxt in your existing workspace.
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/nuxt
|
npm add -D @nx/nuxt
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -39,7 +39,7 @@ yarn add -D @nx/nuxt
|
|||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install -D @nx/nuxt
|
pnpm add -D @nx/nuxt
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -14,21 +14,21 @@ If the `@nx/playwright` package is not installed, install the version that match
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/playwright
|
npm add -D @nx/playwright
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="yarn" %}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/playwright
|
yarn add -D @nx/playwright
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm i -D @nx/playwright
|
pnpm add -D @nx/playwright
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -35,17 +35,24 @@ Make sure to install the `@nx/react-native` version that matches the version of
|
|||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/react-native
|
npm add -D @nx/react-native
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/react-native
|
yarn add -D @nx/react-native
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/react-native
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -16,14 +16,30 @@ Make sure to install the `@nx/react` version that matches the version of `nx` in
|
|||||||
|
|
||||||
To add the React plugin to an existing workspace, run one of the following:
|
To add the React plugin to an existing workspace, run one of the following:
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
# For npm users
|
{% tab label="npm" %}
|
||||||
npm install -D @nx/react
|
|
||||||
|
|
||||||
# For yarn users
|
```shell
|
||||||
|
npm add -D @nx/react
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
yarn add -D @nx/react
|
yarn add -D @nx/react
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/react
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
{% callout type="note" title="React Tutorials" %}
|
{% callout type="note" title="React Tutorials" %}
|
||||||
For a full tutorial experience, follow the [React Standalone Tutorial](/getting-started/tutorials/react-standalone-tutorial) or the [React Monorepo Tutorial](/getting-started/tutorials/react-monorepo-tutorial)
|
For a full tutorial experience, follow the [React Standalone Tutorial](/getting-started/tutorials/react-standalone-tutorial) or the [React Monorepo Tutorial](/getting-started/tutorials/react-monorepo-tutorial)
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|||||||
@ -20,14 +20,30 @@ can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-
|
|||||||
|
|
||||||
Adding the Remix plugin to an existing Nx workspace can be done with the following:
|
Adding the Remix plugin to an existing Nx workspace can be done with the following:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @nx/remix
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @nx/remix
|
yarn add -D @nx/remix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/remix
|
pnpm add -D @nx/remix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
## Using the Remix Plugin
|
## Using the Remix Plugin
|
||||||
|
|
||||||
## Generate a Remix Application
|
## Generate a Remix Application
|
||||||
|
|||||||
@ -16,24 +16,24 @@ Make sure to install the `@nx/storybook` version that matches the version of `nx
|
|||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @nx/storybook
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
{% tab label="yarn" %}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @nx/storybook
|
yarn add -D @nx/storybook
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
|
||||||
{% tab label="npm" %}
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm install -D @nx/storybook
|
|
||||||
```
|
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install -D @nx/storybook
|
pnpm add -D @nx/storybook
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -70,7 +70,7 @@ Make sure to install the `@nx/vite` version that matches the version of `nx` in
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/vite
|
npm add -D @nx/vite
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -84,7 +84,7 @@ yarn add -D @nx/vite
|
|||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install -D @nx/vite
|
pnpm add -D @nx/vite
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ There are a number of ways to use Vue in your existing workspace.
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/vue
|
npm add -D @nx/vue
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -43,7 +43,7 @@ yarn add -D @nx/vue
|
|||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install -D @nx/vue
|
pnpm add -D @nx/vue
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -14,14 +14,30 @@ Make sure to install the `@nx/web` version that matches the version of `nx` in y
|
|||||||
|
|
||||||
To add the web plugin to an existing workspace, run one of the following:
|
To add the web plugin to an existing workspace, run one of the following:
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
# For npm users
|
{% tab label="npm" %}
|
||||||
npm install -D @nx/web
|
|
||||||
|
|
||||||
# For yarn users
|
```shell
|
||||||
|
npm add -D @nx/web
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
yarn add -D @nx/web
|
yarn add -D @nx/web
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/web
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
### Creating Applications
|
### Creating Applications
|
||||||
|
|
||||||
You can add a new application with the following:
|
You can add a new application with the following:
|
||||||
|
|||||||
@ -15,10 +15,30 @@ Nx provides an `enforce-module-boundaries` eslint rule that enforces the public
|
|||||||
|
|
||||||
To set up the lint rule, install these dependencies:
|
To set up the lint rule, install these dependencies:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i @nx/eslint-plugin @nx/devkit
|
npm add @nx/eslint-plugin @nx/devkit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add @nx/eslint-plugin @nx/devkit
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add @nx/eslint-plugin @nx/devkit
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
And configure the rule in your root `.eslintrc.json` file:
|
And configure the rule in your root `.eslintrc.json` file:
|
||||||
|
|
||||||
```jsonc {% fileName=".eslintrc.json" %}
|
```jsonc {% fileName=".eslintrc.json" %}
|
||||||
|
|||||||
@ -61,17 +61,24 @@ Which tells yarn (or npm) and Nx to look in the `packages` folder for projects t
|
|||||||
To install Eleventy run:
|
To install Eleventy run:
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{% tab label="yarn" %}
|
|
||||||
|
|
||||||
```shell
|
|
||||||
yarn add -D -W @11ty/eleventy@1.0.0
|
|
||||||
```
|
|
||||||
|
|
||||||
{% /tab %}
|
|
||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @11ty/eleventy@1.0.0
|
npm add -D @11ty/eleventy@1.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @11ty/eleventy@1.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @11ty/eleventy@1.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -140,12 +140,26 @@ Once you've migrated all your libraries, you can think about removing the root-l
|
|||||||
|
|
||||||
If you choose to opt-in to Webpack 5, by specifying `builder: 'webpack5'` in your project's `.storybook/main.(js|ts)` (as shown above, in the example of a newly generated `main.js` file), don't forget to add the Storybook dependencies for Webpack 5 to work:
|
If you choose to opt-in to Webpack 5, by specifying `builder: 'webpack5'` in your project's `.storybook/main.(js|ts)` (as shown above, in the example of a newly generated `main.js` file), don't forget to add the Storybook dependencies for Webpack 5 to work:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @storybook/builder-webpack5 @storybook/manager-webpack5
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @storybook/builder-webpack5 @storybook/manager-webpack5
|
yarn add -D @storybook/builder-webpack5 @storybook/manager-webpack5
|
||||||
```
|
```
|
||||||
|
|
||||||
or if you're using `npm`:
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @storybook/builder-webpack5 @storybook/manager-webpack5
|
pnpm add -D @storybook/builder-webpack5 @storybook/manager-webpack5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|||||||
@ -205,12 +205,26 @@ Once you've migrated all your libraries, you can think about removing the root-l
|
|||||||
|
|
||||||
If you choose to opt-in to Webpack 5, by specifying `builder: 'webpack5'` in your project's `.storybook/main.(js|ts)` (as shown above, in the example of a newly generated `main.js` file), don't forget to add the Storybook dependencies for Webpack 5 to work:
|
If you choose to opt-in to Webpack 5, by specifying `builder: 'webpack5'` in your project's `.storybook/main.(js|ts)` (as shown above, in the example of a newly generated `main.js` file), don't forget to add the Storybook dependencies for Webpack 5 to work:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @storybook/builder-webpack5 @storybook/manager-webpack5
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @storybook/builder-webpack5 @storybook/manager-webpack5
|
yarn add -D @storybook/builder-webpack5 @storybook/manager-webpack5
|
||||||
```
|
```
|
||||||
|
|
||||||
or if you're using `npm`:
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @storybook/builder-webpack5 @storybook/manager-webpack5
|
pnpm add -D @storybook/builder-webpack5 @storybook/manager-webpack5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|||||||
@ -68,7 +68,7 @@ You can install Nx globally. Depending on your package manager, use one of the f
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --global nx@latest
|
npm add --global nx@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -82,7 +82,7 @@ yarn global add nx@latest
|
|||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install --global nx@latest
|
pnpm add --global nx@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -89,28 +89,61 @@ take advantage of remote caching and other features it provides.
|
|||||||
|
|
||||||
Then, for React users, install the `@nx/react` plugin; and for Angular users, install the `@nx/angular` plugin.
|
Then, for React users, install the `@nx/react` plugin; and for Angular users, install the `@nx/angular` plugin.
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# If you use React
|
# If you use React
|
||||||
npm install --save-dev @nx/react
|
npm add -D @nx/react
|
||||||
|
|
||||||
# If you use Angular
|
# If you use Angular
|
||||||
npm install --save-dev @nx/angular
|
npm add -D @nx/angular
|
||||||
|
|
||||||
# Or with yarn
|
|
||||||
yarn add --dev @nx/react
|
|
||||||
yarn add --dev @nx/angular
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# If you use React
|
||||||
|
yarn add -D @nx/react
|
||||||
|
|
||||||
|
# If you use Angular
|
||||||
|
yarn add -D @nx/angular
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# If you use React
|
||||||
|
pnpm add -D @nx/react
|
||||||
|
|
||||||
|
# If you use Angular
|
||||||
|
pnpm add -D @nx/angular
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Next, generate the host and remote applications.
|
Next, generate the host and remote applications.
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
# React
|
{% tab label="React" %}
|
||||||
nx g @nx/react:host host --remotes=shop,cart,about
|
|
||||||
|
|
||||||
# Angular
|
```shell
|
||||||
|
nx g @nx/react:host host --remotes=shop,cart,about
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="Angular" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
nx g @nx/angular:host host --remotes=shop,cart,about
|
nx g @nx/angular:host host --remotes=shop,cart,about
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
{% callout type="note" title="More details" %}
|
{% callout type="note" title="More details" %}
|
||||||
You can leave off the `--remotes` option and add them later with `nx g @nx/react:remote shop --host=host`
|
You can leave off the `--remotes` option and add them later with `nx g @nx/react:remote shop --host=host`
|
||||||
or `nx g @nx/angular:remote shop --host=host`.
|
or `nx g @nx/angular:remote shop --host=host`.
|
||||||
|
|||||||
@ -51,16 +51,25 @@ Keeping the applications independent allows them to be deployed on different cad
|
|||||||
The generator for MFEs is the same as with basic Module Federation. You can use `nx g host` to create a new host
|
The generator for MFEs is the same as with basic Module Federation. You can use `nx g host` to create a new host
|
||||||
application, and `nx g remote` for remote applications.
|
application, and `nx g remote` for remote applications.
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="React" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# React
|
|
||||||
nx g @nx/react:host shell --remotes=shop,cart
|
nx g @nx/react:host shell --remotes=shop,cart
|
||||||
nx g @nx/react:remote about --host=shell
|
nx g @nx/react:remote about --host=shell
|
||||||
|
```
|
||||||
|
|
||||||
#a Angular
|
{% /tab %}
|
||||||
|
{% tab label="Angular" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
nx g @nx/angular:host shell --remotes=shop,cart
|
nx g @nx/angular:host shell --remotes=shop,cart
|
||||||
nx g @nx/angular:remote about --host=shell
|
nx g @nx/angular:remote about --host=shell
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
That is! You can now run `nx serve shell` to develop on the `shell` application, while keeping all remotes static. To
|
That is! You can now run `nx serve shell` to develop on the `shell` application, while keeping all remotes static. To
|
||||||
develop on one or more remote applications, pass the `--devRemotes` option.
|
develop on one or more remote applications, pass the `--devRemotes` option.
|
||||||
|
|
||||||
|
|||||||
@ -134,13 +134,30 @@ When using React Native in Nx, you get the out-of-the-box support for TypeScript
|
|||||||
|
|
||||||
For existing Nx workspaces, install the `@nx/react-native` package to add React Native capabilities to it.
|
For existing Nx workspaces, install the `@nx/react-native` package to add React Native capabilities to it.
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
npm install @nx/react-native --save-dev
|
{% tab label="npm" %}
|
||||||
|
|
||||||
# Or with yarn
|
```shell
|
||||||
yarn add @nx/react-native --dev
|
npm add -D @nx/react-native
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @nx/react-native
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/react-native
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
## Generating an Application
|
## Generating an Application
|
||||||
|
|
||||||
To create additional React Native apps run:
|
To create additional React Native apps run:
|
||||||
|
|||||||
@ -31,10 +31,30 @@ In this recipe, we'll show you how to create a [Remix](https://remix.run) applic
|
|||||||
Make sure to install the `@nx/remix` version that is on the same minor version as the `nx` version in your repository. If the version numbers get out of sync, you can encounter some difficult to debug errors. You can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-versions-in-sync).
|
Make sure to install the `@nx/remix` version that is on the same minor version as the `nx` version in your repository. If the version numbers get out of sync, you can encounter some difficult to debug errors. You can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-versions-in-sync).
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/remix
|
npm add -D @nx/remix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @nx/remix
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/remix
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
## Generate a Remix Application
|
## Generate a Remix Application
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
|
|||||||
@ -29,13 +29,30 @@ The first two options is a matter of changing your build target configuration or
|
|||||||
|
|
||||||
First, install `@types/node` so we can use `process.env` in our code.
|
First, install `@types/node` so we can use `process.env` in our code.
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
npm install --save-dev @types/node
|
{% tab label="npm" %}
|
||||||
|
|
||||||
# Or with yarn
|
```shell
|
||||||
yarn add --dev @types/node
|
npm add -D @types/node
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @types/node
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @types/node
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Next, update the `build` and `serve` targets (in `project.json` or `angular.json` file), to the following.
|
Next, update the `build` and `serve` targets (in `project.json` or `angular.json` file), to the following.
|
||||||
|
|
||||||
```json lines
|
```json lines
|
||||||
|
|||||||
@ -30,13 +30,30 @@ These manual steps are not required if you use the generator from the previous s
|
|||||||
|
|
||||||
### Step 1: Install Tailwind Dependencies
|
### Step 1: Install Tailwind Dependencies
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
|
{% tab label="npm" %}
|
||||||
|
|
||||||
# or with yarn
|
```shell
|
||||||
|
npm add -D tailwindcss@latest postcss@latest autoprefixer@latest
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
yarn add -D tailwindcss@latest postcss@latest autoprefixer@latest
|
yarn add -D tailwindcss@latest postcss@latest autoprefixer@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D tailwindcss@latest postcss@latest autoprefixer@latest
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
This installs the requisite tailwind dependencies.
|
This installs the requisite tailwind dependencies.
|
||||||
|
|
||||||
### Step 2: Initialize Tailwind
|
### Step 2: Initialize Tailwind
|
||||||
|
|||||||
@ -42,11 +42,29 @@ To enable Nx support (and thus speed up task running) go through the following s
|
|||||||
|
|
||||||
**1. Install Nx**
|
**1. Install Nx**
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i nx --save-dev
|
npm add -D nx
|
||||||
```
|
```
|
||||||
|
|
||||||
(or the yarn/pnpm alternatives).
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D nx
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D nx
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
**2. Adjust your lerna.json**
|
**2. Adjust your lerna.json**
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ The `apps` directory is the place where your top-level applications will be stor
|
|||||||
{% tab label="Angular" %}
|
{% tab label="Angular" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/angular
|
npm add -D @nx/angular
|
||||||
# then
|
# then
|
||||||
nx generate @nx/angular:application my-application
|
nx generate @nx/angular:application my-application
|
||||||
```
|
```
|
||||||
@ -44,7 +44,7 @@ nx generate @nx/angular:application my-application
|
|||||||
{% tab label="React" %}
|
{% tab label="React" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/react
|
npm add -D @nx/react
|
||||||
# then
|
# then
|
||||||
nx generate @nx/react:application my-application
|
nx generate @nx/react:application my-application
|
||||||
```
|
```
|
||||||
|
|||||||
@ -41,10 +41,30 @@ At the next prompt, you can choose whether to use [Nx Cloud](https://nx.app) or
|
|||||||
|
|
||||||
Your new workspace won’t have much in it because of the `apps` preset. You’ll need to generate an application to have some structure created. Add the Angular plugin to your workspace:
|
Your new workspace won’t have much in it because of the `apps` preset. You’ll need to generate an application to have some structure created. Add the Angular plugin to your workspace:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/angular
|
npm add -D @nx/angular
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @nx/angular
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/angular
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
For this example, we will use Karma and Protractor, the most common unit test runner and e2e test runner for AngularJS.
|
For this example, we will use Karma and Protractor, the most common unit test runner and e2e test runner for AngularJS.
|
||||||
|
|
||||||
{% callout type="note" title="Unit & E2E tests" %}
|
{% callout type="note" title="Unit & E2E tests" %}
|
||||||
@ -365,10 +385,30 @@ So far, you’ve mostly gotten already existing code and processes to work. This
|
|||||||
|
|
||||||
But migrating AngularJS code means we need to switch some of our tools to a more modern tool stack. Specifically, using webpack and babel is going to allow us to take advantage of Nx more easily. Becoming an expert in these build tools is outside the scope of this article, but I’ll address some AngularJS specific concerns. To get started, install these new dependencies:
|
But migrating AngularJS code means we need to switch some of our tools to a more modern tool stack. Specifically, using webpack and babel is going to allow us to take advantage of Nx more easily. Becoming an expert in these build tools is outside the scope of this article, but I’ll address some AngularJS specific concerns. To get started, install these new dependencies:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/web babel-plugin-angularjs-annotate
|
npm add -D @nx/web babel-plugin-angularjs-annotate
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @nx/web babel-plugin-angularjs-annotate
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/web babel-plugin-angularjs-annotate
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Nx already has most of what you need for webpack added as a dependency. `@nx/web` contains the [executors](/core-features/plugin-features/use-task-executors) we need to use to build and serve the application with webpack and
|
Nx already has most of what you need for webpack added as a dependency. `@nx/web` contains the [executors](/core-features/plugin-features/use-task-executors) we need to use to build and serve the application with webpack and
|
||||||
`babel-plugin-angularjs-annotate` is going to accomplish the same thing that `browserify-ngannotate` previously did in gulp: add dependency injection annotations.
|
`babel-plugin-angularjs-annotate` is going to accomplish the same thing that `browserify-ngannotate` previously did in gulp: add dependency injection annotations.
|
||||||
|
|
||||||
@ -572,10 +612,30 @@ Unit testing can be an important part of any code migration. If you migrate your
|
|||||||
|
|
||||||
You need a few dependencies for AngularJS unit testing that Nx doesn’t provide by default:
|
You need a few dependencies for AngularJS unit testing that Nx doesn’t provide by default:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D angular-mocks@1.5.11 karma-webpack
|
npm add -D angular-mocks@1.5.11 karma-webpack
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D angular-mocks@1.5.11 karma-webpack
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D angular-mocks@1.5.11 karma-webpack
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Earlier, you configured this app to use Karma as its unit test runner. Nx has provided a Karma config file for you, but you’ll need to modify it to work with AngularJS:
|
Earlier, you configured this app to use Karma as its unit test runner. Nx has provided a Karma config file for you, but you’ll need to modify it to work with AngularJS:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|||||||
@ -67,10 +67,30 @@ export const isEven = (x: number) => x % 2 === 0;
|
|||||||
|
|
||||||
Next install TypeScript (notice we're using `tsc` for the `build` script in `package.json` above). While we could install TypeScript at the package-level, it is more convenient to have it globally for the entire monorepo. Run the following command at the root of your workspace.
|
Next install TypeScript (notice we're using `tsc` for the `build` script in `package.json` above). While we could install TypeScript at the package-level, it is more convenient to have it globally for the entire monorepo. Run the following command at the root of your workspace.
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i typescript -D -W
|
npm add -D typescript
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D typescript
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D typescript
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Next run your `build` script with:
|
Next run your `build` script with:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -136,10 +156,30 @@ The `workspaces` property in the root-level `package.json` tells NPM to create l
|
|||||||
|
|
||||||
At the root of your workspace run:
|
At the root of your workspace run:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
NPM will create a Symbolic Link in your file system at: `node_modules/is-even` and `node_modules/is-odd`, so they reflect changes to your `packages/is-even` and `packages/is-odd` directories as they happen.
|
NPM will create a Symbolic Link in your file system at: `node_modules/is-even` and `node_modules/is-odd`, so they reflect changes to your `packages/is-even` and `packages/is-odd` directories as they happen.
|
||||||
|
|
||||||
## Task Dependencies
|
## Task Dependencies
|
||||||
|
|||||||
@ -25,14 +25,30 @@ can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-
|
|||||||
|
|
||||||
Adding the Angular plugin to an existing Nx workspace can be done with the following:
|
Adding the Angular plugin to an existing Nx workspace can be done with the following:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @nx/angular
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @nx/angular
|
yarn add -D @nx/angular
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/angular
|
pnpm add -D @nx/angular
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
{% callout type="note" title="Angular Tutorials" %}
|
{% callout type="note" title="Angular Tutorials" %}
|
||||||
For a full tutorial experience, follow the [Angular Standalone Tutorial](/getting-started/tutorials/angular-standalone-tutorial) or the [Angular Monorepo Tutorial](/getting-started/tutorials/angular-monorepo-tutorial)
|
For a full tutorial experience, follow the [Angular Standalone Tutorial](/getting-started/tutorials/angular-standalone-tutorial) or the [Angular Monorepo Tutorial](/getting-started/tutorials/angular-monorepo-tutorial)
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|||||||
@ -15,14 +15,30 @@ Cypress is a test runner built for the modern web. It has a lot of great feature
|
|||||||
|
|
||||||
If the `@nx/cypress` package is not installed, install the version that matches your `nx` package version.
|
If the `@nx/cypress` package is not installed, install the version that matches your `nx` package version.
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
yarn add --dev @nx/cypress
|
{% tab label="npm" %}
|
||||||
```
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/cypress
|
npm add -D @nx/cypress
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @nx/cypress
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/cypress
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
## E2E Testing
|
## E2E Testing
|
||||||
|
|
||||||
By default, when creating a new frontend application, Nx will use Cypress to create the e2e tests project.
|
By default, when creating a new frontend application, Nx will use Cypress to create the e2e tests project.
|
||||||
|
|||||||
@ -38,19 +38,24 @@ You can create a new Detox E2E project for an existing mobile project.
|
|||||||
If the `@nx/detox` package is not installed, install the version that matches your `@nx/workspace` version.
|
If the `@nx/detox` package is not installed, install the version that matches your `@nx/workspace` version.
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```sh
|
```shell
|
||||||
# npm
|
npm add -D @nx/detox
|
||||||
npm install --save-dev @nx/detox
|
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```sh
|
```shell
|
||||||
# yarn
|
yarn add -D @nx/detox
|
||||||
yarn add --dev @nx/detox
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/detox
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ To add the esbuild plugin to an existing workspace, run the following:
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/esbuild
|
npm add -D @nx/esbuild
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -31,6 +31,13 @@ npm install -D @nx/esbuild
|
|||||||
yarn add -D @nx/esbuild
|
yarn add -D @nx/esbuild
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/esbuild
|
||||||
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% /tabs %}
|
{% /tabs %}
|
||||||
|
|
||||||
|
|||||||
@ -14,17 +14,24 @@ Make sure to install the `@nx/eslint-plugin` version that matches the version of
|
|||||||
In any Nx workspace, you can install `@nx/eslint-plugin` by running the following commands if the package is not already installed:
|
In any Nx workspace, you can install `@nx/eslint-plugin` by running the following commands if the package is not already installed:
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/eslint-plugin
|
npm add -D @nx/eslint-plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/eslint-plugin
|
yarn add -D @nx/eslint-plugin
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/eslint-plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -19,17 +19,24 @@ Make sure to install the `@nx/expo` version that matches the version of `nx` in
|
|||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/expo
|
npm add -D @nx/expo
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/expo
|
yarn add -D @nx/expo
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/expo
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -22,14 +22,30 @@ First, install `@nx/jest`, if not already installed using your preferred package
|
|||||||
Make sure to install the `@nx/jest` version that matches the version of `nx` in your repository. If the version numbers get out of sync, you can encounter some difficult to debug errors. You can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-versions-in-sync).
|
Make sure to install the `@nx/jest` version that matches the version of `nx` in your repository. If the version numbers get out of sync, you can encounter some difficult to debug errors. You can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-versions-in-sync).
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
npm install --save-dev @nx/jest
|
{% tab label="npm" %}
|
||||||
```
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/jest
|
npm add -D @nx/jest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @nx/jest
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/jest
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Once installed, run the `configuration` generator
|
Once installed, run the `configuration` generator
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@ -11,17 +11,24 @@ Make sure to install the `@nx/js` version that matches the version of `nx` in yo
|
|||||||
In any Nx workspace, you can install `@nx/js` by running the following commands if `@nx/js` package is not installed:
|
In any Nx workspace, you can install `@nx/js` by running the following commands if `@nx/js` package is not installed:
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/js
|
npm add -D @nx/js
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/js
|
yarn add -D @nx/js
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/js
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -27,14 +27,30 @@ Make sure to install the `@nx/nest` version that matches the version of `nx` in
|
|||||||
|
|
||||||
To add the Nest plugin to an existing workspace, run one the following commands:
|
To add the Nest plugin to an existing workspace, run one the following commands:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/nest
|
npm add -D @nx/nest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @nx/nest
|
yarn add -D @nx/nest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/nest
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
### Create Applications
|
### Create Applications
|
||||||
|
|
||||||
You can add a new Nest application with the following command:
|
You can add a new Nest application with the following command:
|
||||||
|
|||||||
@ -16,14 +16,21 @@ To add Next.js to an existing Nx workspace, install the `@nx/next` package. Make
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/next
|
npm add -D @nx/next
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="yarn" %}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/next
|
yarn add -D @nx/next
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/next
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -8,14 +8,30 @@ Make sure to install the `@nx/node` version that matches the version of `nx` in
|
|||||||
|
|
||||||
To add the Node plugin to an existing workspace, run one of the following:
|
To add the Node plugin to an existing workspace, run one of the following:
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
# For npm users
|
{% tab label="npm" %}
|
||||||
npm install -D @nx/node
|
|
||||||
|
|
||||||
# For yarn users
|
```shell
|
||||||
|
npm add -D @nx/node
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
yarn add -D @nx/node
|
yarn add -D @nx/node
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/node
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
### Creating Applications
|
### Creating Applications
|
||||||
|
|
||||||
You can add a new application with the following:
|
You can add a new application with the following:
|
||||||
|
|||||||
@ -25,7 +25,7 @@ There are a number of ways to use Nuxt in your existing workspace.
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/nuxt
|
npm add -D @nx/nuxt
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -39,7 +39,7 @@ yarn add -D @nx/nuxt
|
|||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install -D @nx/nuxt
|
pnpm add -D @nx/nuxt
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -14,21 +14,21 @@ If the `@nx/playwright` package is not installed, install the version that match
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/playwright
|
npm add -D @nx/playwright
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="yarn" %}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/playwright
|
yarn add -D @nx/playwright
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm i -D @nx/playwright
|
pnpm add -D @nx/playwright
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -35,17 +35,24 @@ Make sure to install the `@nx/react-native` version that matches the version of
|
|||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{%tab label="npm"%}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/react-native
|
npm add -D @nx/react-native
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/react-native
|
yarn add -D @nx/react-native
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/react-native
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -16,14 +16,30 @@ Make sure to install the `@nx/react` version that matches the version of `nx` in
|
|||||||
|
|
||||||
To add the React plugin to an existing workspace, run one of the following:
|
To add the React plugin to an existing workspace, run one of the following:
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
# For npm users
|
{% tab label="npm" %}
|
||||||
npm install -D @nx/react
|
|
||||||
|
|
||||||
# For yarn users
|
```shell
|
||||||
|
npm add -D @nx/react
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
yarn add -D @nx/react
|
yarn add -D @nx/react
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/react
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
{% callout type="note" title="React Tutorials" %}
|
{% callout type="note" title="React Tutorials" %}
|
||||||
For a full tutorial experience, follow the [React Standalone Tutorial](/getting-started/tutorials/react-standalone-tutorial) or the [React Monorepo Tutorial](/getting-started/tutorials/react-monorepo-tutorial)
|
For a full tutorial experience, follow the [React Standalone Tutorial](/getting-started/tutorials/react-standalone-tutorial) or the [React Monorepo Tutorial](/getting-started/tutorials/react-monorepo-tutorial)
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|||||||
@ -20,14 +20,30 @@ can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-
|
|||||||
|
|
||||||
Adding the Remix plugin to an existing Nx workspace can be done with the following:
|
Adding the Remix plugin to an existing Nx workspace can be done with the following:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @nx/remix
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @nx/remix
|
yarn add -D @nx/remix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/remix
|
pnpm add -D @nx/remix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
## Using the Remix Plugin
|
## Using the Remix Plugin
|
||||||
|
|
||||||
## Generate a Remix Application
|
## Generate a Remix Application
|
||||||
|
|||||||
@ -16,24 +16,24 @@ Make sure to install the `@nx/storybook` version that matches the version of `nx
|
|||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @nx/storybook
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
{% tab label="yarn" %}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @nx/storybook
|
yarn add -D @nx/storybook
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
|
||||||
{% tab label="npm" %}
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm install -D @nx/storybook
|
|
||||||
```
|
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install -D @nx/storybook
|
pnpm add -D @nx/storybook
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -70,7 +70,7 @@ Make sure to install the `@nx/vite` version that matches the version of `nx` in
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/vite
|
npm add -D @nx/vite
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -84,7 +84,7 @@ yarn add -D @nx/vite
|
|||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install -D @nx/vite
|
pnpm add -D @nx/vite
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ There are a number of ways to use Vue in your existing workspace.
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D @nx/vue
|
npm add -D @nx/vue
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -43,7 +43,7 @@ yarn add -D @nx/vue
|
|||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm install -D @nx/vue
|
pnpm add -D @nx/vue
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -14,14 +14,30 @@ Make sure to install the `@nx/web` version that matches the version of `nx` in y
|
|||||||
|
|
||||||
To add the web plugin to an existing workspace, run one of the following:
|
To add the web plugin to an existing workspace, run one of the following:
|
||||||
|
|
||||||
```shell
|
{% tabs %}
|
||||||
# For npm users
|
{% tab label="npm" %}
|
||||||
npm install -D @nx/web
|
|
||||||
|
|
||||||
# For yarn users
|
```shell
|
||||||
|
npm add -D @nx/web
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
yarn add -D @nx/web
|
yarn add -D @nx/web
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/web
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
### Creating Applications
|
### Creating Applications
|
||||||
|
|
||||||
You can add a new application with the following:
|
You can add a new application with the following:
|
||||||
|
|||||||
@ -121,6 +121,13 @@ module.exports = composePlugins(
|
|||||||
To add the `css-loader` to your config, install it and add the rule.
|
To add the `css-loader` to your config, install it and add the rule.
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D css-loader
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
{% tab label="yarn" %}
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -128,10 +135,10 @@ yarn add -D css-loader
|
|||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="npm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install -D css-loader
|
pnpm add -D css-loader
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -14,8 +14,31 @@ In order to use your plugin in other workspaces or share it with the community,
|
|||||||
Currently you will have to modify the `package.json` version by yourself or with a tool.
|
Currently you will have to modify the `package.json` version by yourself or with a tool.
|
||||||
{% /callout %}
|
{% /callout %}
|
||||||
|
|
||||||
After that, you can then install your plugin like any other npm package,
|
After that, you can then install your plugin like any other npm package -
|
||||||
`npm i -D @my-org/my-plugin` or `yarn add -D @my-org/my-plugin`.
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @my-org/my-plugin
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @my-org/my-plugin
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @my-org/my-plugin
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
## List your Nx Plugin
|
## List your Nx Plugin
|
||||||
|
|
||||||
|
|||||||
@ -496,10 +496,30 @@ export * from './lib/product-list/product-list';
|
|||||||
|
|
||||||
We're ready to import it into our main application now. First (if you haven't already), let's set up React Router.
|
We're ready to import it into our main application now. First (if you haven't already), let's set up React Router.
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install react-router-dom
|
npm add react-router-dom
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add react-router-dom
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add react-router-dom
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Configure it in the `main.tsx`.
|
Configure it in the `main.tsx`.
|
||||||
|
|
||||||
```tsx {% fileName="src/main.tsx" %}
|
```tsx {% fileName="src/main.tsx" %}
|
||||||
|
|||||||
@ -407,10 +407,30 @@ export * from './lib/product-list/product-list';
|
|||||||
|
|
||||||
We're ready to import it into our main application now. First (if you haven't already), let's set up React Router.
|
We're ready to import it into our main application now. First (if you haven't already), let's set up React Router.
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install react-router-dom
|
npm add react-router-dom
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add react-router-dom
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add react-router-dom
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Configure it in the `main.tsx`.
|
Configure it in the `main.tsx`.
|
||||||
|
|
||||||
```tsx {% fileName="apps/react-store/src/main.tsx" %}
|
```tsx {% fileName="apps/react-store/src/main.tsx" %}
|
||||||
|
|||||||
@ -83,10 +83,30 @@ Install `@nx/js` plugin.
|
|||||||
|
|
||||||
> Note: you should make sure any first party, `@nx/` scoped, plugins match the `nx` package version
|
> Note: you should make sure any first party, `@nx/` scoped, plugins match the `nx` package version
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i -DE @nx/js@<nx-version>
|
npm add -DE @nx/js@<nx-version>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -DE @nx/js@<nx-version>
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -DE @nx/js@<nx-version>
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Then generate a project
|
Then generate a project
|
||||||
|
|
||||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||||
|
|||||||
@ -26,14 +26,21 @@ Make sure you have Deno installed on your machine. Consult the [Deno docs for mo
|
|||||||
{%tab label="npm"%}
|
{%tab label="npm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/deno
|
npm add -D @nx/deno
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{%tab label="yarn"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/deno
|
yarn add -D @nx/deno
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{%tab label="pnpm"%}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/deno
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -26,14 +26,21 @@ Make sure you have .NET installed on your machine. Consult the [.NET docs for mo
|
|||||||
{%tab label="npm"%}
|
{%tab label="npm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx-dotnet/core
|
npm add -D @nx-dotnet/core
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{%tab label="yarn"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx-dotnet/core
|
yarn add -D @nx-dotnet/core
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{%tab label="pnpm"%}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx-dotnet/core
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -26,14 +26,21 @@ Make sure to install the `@nx/express` version that matches the version of `nx`
|
|||||||
{%tab label="npm"%}
|
{%tab label="npm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/express
|
npm add -D @nx/express
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{%tab label="yarn"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/express
|
yarn add -D @nx/express
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{%tab label="pnpm"%}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/express
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -39,14 +39,21 @@ If you are adding Fastify to an existing repo, continue to the next section.
|
|||||||
{%tab label="npm"%}
|
{%tab label="npm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/node
|
npm add -D @nx/node
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{%tab label="yarn"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/node
|
yarn add -D @nx/node
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{%tab label="pnpm"%}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/node
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -28,14 +28,21 @@ Install all the dependencies we need:
|
|||||||
{%tab label="npm"%}
|
{%tab label="npm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev @nx/node lit http-server
|
npm add -D @nx/node lit http-server
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{%tab label="yarn"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/node lit http-server
|
yarn add -D @nx/node lit http-server
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{%tab label="pnpm"%}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/node lit http-server
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -28,21 +28,21 @@ Install the `qwik-nx` plugin:
|
|||||||
{%tab label="npm"%}
|
{%tab label="npm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i --save-dev qwik-nx
|
npm add -D qwik-nx
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{%tab label="yarn"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev qwik-nx
|
yarn add -D qwik-nx
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="pnpm"%}
|
{%tab label="pnpm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm i --dev qwik-nx
|
pnpm add -D qwik-nx
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -28,8 +28,8 @@ updating any framework dependencies as needed.
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i solid-js
|
npm add solid-js
|
||||||
npm i --save-dev @nx/web solid-devtools vite-plugin-solid
|
npm add -D @nx/web solid-devtools vite-plugin-solid
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
@ -37,15 +37,15 @@ npm i --save-dev @nx/web solid-devtools vite-plugin-solid
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add solid-js
|
yarn add solid-js
|
||||||
yarn add --dev @nx/web solid-devtools vite-plugin-solid
|
yarn add -D @nx/web solid-devtools vite-plugin-solid
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="pnpm" %}
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm i solid-js
|
pnpm add solid-js
|
||||||
pnpm i --save-dev @nx/web solid-devtools vite-plugin-solid
|
pnpm add -D @nx/web solid-devtools vite-plugin-solid
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -58,21 +58,21 @@ Make sure to install the `@nx/vite` and `@nx/js` versions that matches the versi
|
|||||||
{%tab label="npm"%}
|
{%tab label="npm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @nx/vite @nx/js vitest vite svelte svelte-check @sveltejs/vite-plugin-svelte
|
npm add -D @nx/vite @nx/js vitest vite svelte svelte-check @sveltejs/vite-plugin-svelte
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="yarn"%}
|
{%tab label="yarn"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add --dev @nx/vite @nx/js vitest vite svelte svelte-check @sveltejs/vite-plugin-svelte
|
yarn add -D @nx/vite @nx/js vitest vite svelte svelte-check @sveltejs/vite-plugin-svelte
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{%tab label="pnpm"%}
|
{%tab label="pnpm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm add --save-dev @nx/vite @nx/js vitest vite svelte svelte-check @sveltejs/vite-plugin-svelte
|
pnpm add -D @nx/vite @nx/js vitest vite svelte svelte-check @sveltejs/vite-plugin-svelte
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ You can also add a new Deno application to an existing Nx monorepo workspace. Ma
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i -D @nx/deno
|
npm add -D @nx/deno
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ You can also add a new Deno application to an existing Nx monorepo workspace. Ma
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i -D @nx/deno
|
npm add -D @nx/deno
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ First, make sure you have `@nx/aws-lambda` installed.
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i -D @nx/aws-lambda
|
npm add -D @nx/aws-lambda
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ You will need to install `@nx/netlify` if you haven't already.
|
|||||||
{% tab label="npm" %}
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i -D @nx/netlify
|
npm add -D @nx/netlify
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -14,11 +14,33 @@ caption="Demoes how to use Nx generators in a PNPM workspace to automate the cre
|
|||||||
|
|
||||||
If you don't already have a local plugin, use Nx to generate one:
|
If you don't already have a local plugin, use Nx to generate one:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{% tab label="npm" %}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install @nx/plugin@latest
|
npm add @nx/plugin@latest
|
||||||
nx g @nx/plugin:plugin my-plugin
|
nx g @nx/plugin:plugin my-plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="yarn" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add @nx/plugin@latest
|
||||||
|
nx g @nx/plugin:plugin my-plugin
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% tab label="pnpm" %}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add @nx/plugin@latest
|
||||||
|
nx g @nx/plugin:plugin my-plugin
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Note that `latest` should match the version of the `nx` plugins installed in your workspace.
|
Note that `latest` should match the version of the `nx` plugins installed in your workspace.
|
||||||
|
|
||||||
Use the Nx CLI to generate the initial files needed for your generator.
|
Use the Nx CLI to generate the initial files needed for your generator.
|
||||||
|
|||||||
@ -30,7 +30,7 @@ Make sure to install the `@nx/angular` or `@nx/react` versions that matches the
|
|||||||
|
|
||||||
{% tab label="Angular" %}
|
{% tab label="Angular" %}
|
||||||
|
|
||||||
```{% command="npm install --save-dev @nx/angular" path="~/myorg" %}
|
```{% command="npm add -D @nx/angular" path="~/myorg" %}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ Make sure to install the `@nx/angular` or `@nx/react` versions that matches the
|
|||||||
|
|
||||||
{% tab label="React" %}
|
{% tab label="React" %}
|
||||||
|
|
||||||
```{% command="npm install --save-dev @nx/react" path="~/myorg" %}
|
```{% command="npm add -D @nx/react" path="~/myorg" %}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -60,24 +60,24 @@ This guide assumes that you have an Angular project with Storybook configured in
|
|||||||
First we need to install the necessary packages:
|
First we need to install the necessary packages:
|
||||||
|
|
||||||
{% tabs %}
|
{% tabs %}
|
||||||
{% tab label="yarn" %}
|
{%tab label="npm"%}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm add -D @compodoc/compodoc
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{%tab label="yarn"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn add -D @compodoc/compodoc
|
yarn add -D @compodoc/compodoc
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
{% tab label="npm" %}
|
{%tab label="pnpm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install --save-dev @compodoc/compodoc
|
pnpm add -D @compodoc/compodoc
|
||||||
```
|
|
||||||
|
|
||||||
{% /tab %}
|
|
||||||
{% tab label="pnpm" %}
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pnpm install --save-dev @compodoc/compodoc
|
|
||||||
```
|
```
|
||||||
|
|
||||||
{% /tab %}
|
{% /tab %}
|
||||||
|
|||||||
@ -11,10 +11,30 @@ It can be difficult to set up a typescript library to compile to ESM and CommonJ
|
|||||||
|
|
||||||
If you do not use Rollup already, install the corresponding Nx plugin as follows:
|
If you do not use Rollup already, install the corresponding Nx plugin as follows:
|
||||||
|
|
||||||
|
{% tabs %}
|
||||||
|
{%tab label="npm"%}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm i @nx/rollup
|
npm add -D @nx/rollup
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{%tab label="yarn"%}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn add -D @nx/rollup
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{%tab label="pnpm"%}
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm add -D @nx/rollup
|
||||||
|
```
|
||||||
|
|
||||||
|
{% /tab %}
|
||||||
|
{% /tabs %}
|
||||||
|
|
||||||
Make sure the version of `@nx/rollup` matches your other `@nx/*` package versions.
|
Make sure the version of `@nx/rollup` matches your other `@nx/*` package versions.
|
||||||
|
|
||||||
You can then configure Rollup to compile your library by adding a `build` target to your `project.json` or `package.json` file. Here's an example:
|
You can then configure Rollup to compile your library by adding a `build` target to your `project.json` or `package.json` file. Here's an example:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user