Compare commits
108 Commits
docs/tutorial
...
20.2.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 68db3e032c | |||
| 506f206d2d | |||
| 8158edd9f3 | |||
| e1d787f662 | |||
| 59a1345832 | |||
| 7226c13580 | |||
| ae07748701 | |||
| 8f521c82de | |||
| c305dceca2 | |||
| 0381681e4b | |||
| 8f58cbcde9 | |||
| 6f50e2f0e3 | |||
| 9f28983fa0 | |||
| 58d822e659 | |||
| bb58839805 | |||
| 4050dfc0f7 | |||
| b9f1bbcdc1 | |||
| e56f231795 | |||
| d084241cd8 | |||
| 6ad1af3044 | |||
| 223a14344b | |||
| 2d366847bb | |||
| ce53dd2a98 | |||
| 3850e95870 | |||
| 41d0df6587 | |||
| c071f847ab | |||
| d1f296513e | |||
| 20dbd45eac | |||
| ab56d97690 | |||
| 6234d98fd2 | |||
| 046686fbb7 | |||
| 6ed78d29bd | |||
| 62632a92f7 | |||
| 383bc3081c | |||
| 2e98918a3f | |||
| 59a3db8685 | |||
| 37adb48db8 | |||
| 7328a8dae4 | |||
| e9a07da4ac | |||
| 7c25cf150d | |||
| f89fca98f3 | |||
| 625d8f3095 | |||
| b848bb3dba | |||
| 2fa3ce21d4 | |||
| 15060e3a4f | |||
| 4773e35d01 | |||
| 7157e7a07c | |||
| 6c5916a79f | |||
| 972c01bd25 | |||
| 59e3704fb3 | |||
| aefafc55ba | |||
| 67d03937b5 | |||
| db5e2f63bf | |||
| bba941ab4d | |||
| 1dbddb11ba | |||
| 75b2080521 | |||
| dd14f3943c | |||
| 3cc321d4ce | |||
| c1469b68ca | |||
| 38e29b9e90 | |||
| 54dbbfded5 | |||
| 9bd08851f0 | |||
| 6bd86158d1 | |||
| 9ad6b8c208 | |||
| d32ca3788e | |||
| 201cd89f5a | |||
| c62d78dd7e | |||
| e9be7d92cf | |||
| 5448046f06 | |||
| da901dec08 | |||
| 922c0469b1 | |||
| a54bbcc8ac | |||
| 6b870050b6 | |||
| 8c25c02112 | |||
| 6a46030995 | |||
| 3ec539065d | |||
| 06d549b043 | |||
| ec5a5e6360 | |||
| 2cb58b937d | |||
| 08a33075a7 | |||
| dc67660fec | |||
| c66b99c499 | |||
| 182b46ca66 | |||
| 8eb6159696 | |||
| 25c5643283 | |||
| 0bf7565664 | |||
| b018b94096 | |||
| 1ea7bb43e1 | |||
| 47663727c1 | |||
| 0d0d6c7c11 | |||
| 4030494cd5 | |||
| 6089b28916 | |||
| 9ab1068d1d | |||
| a435e263cd | |||
| bcaef27046 | |||
| c75aa8f661 | |||
| 55143297be | |||
| a5c5cbf326 | |||
| 30d722bd98 | |||
| beded4ef6d | |||
| 8b3f9d883a | |||
| cbc19c54ae | |||
| 9921496d64 | |||
| 6904789b10 | |||
| 5f92f1729b | |||
| fc7ee36a96 | |||
| 128778e7d1 | |||
| c7894d7579 |
@@ -114,6 +114,12 @@ jobs:
|
||||
pnpm nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD &
|
||||
pids+=($!)
|
||||
|
||||
pnpm nx-cloud record -- nx sync:check
|
||||
pids+=($!)
|
||||
|
||||
pnpm nx-cloud record -- nx-cloud conformance:check
|
||||
pids+=($!)
|
||||
|
||||
pnpm nx run-many -t check-imports check-commit check-lock-files check-codeowners documentation --parallel=1 --no-dte &
|
||||
pids+=($!)
|
||||
|
||||
|
||||
@@ -71,9 +71,17 @@
|
||||
"rules": {
|
||||
"@nx/workspace/ensure-pnpm-lock-version": [
|
||||
"error",
|
||||
{ "version": "9.0" }
|
||||
{
|
||||
"version": "9.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"rules": {
|
||||
"@angular-eslint/prefer-standalone": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cached-issue-data
|
||||
path: ./scripts/issues-scraper/cached/data.json
|
||||
|
||||
@@ -419,7 +419,7 @@ jobs:
|
||||
- name: (Stable Release Only) Trigger Docs Release
|
||||
# Publish docs only on a full release
|
||||
if: ${{ !github.event.release.prerelease && github.event_name == 'release' }}
|
||||
run: npx ts-node ./scripts/release-docs.ts
|
||||
run: npx ts-node -P ./scripts/tsconfig.scripts.json ./scripts/release-docs.ts
|
||||
|
||||
- name: (PR Release Only) Create comment for successful PR release
|
||||
if: success() && github.event.inputs.pr
|
||||
|
||||
@@ -40,14 +40,13 @@ out
|
||||
# Local dev files
|
||||
.env.local
|
||||
.bashrc
|
||||
.nx
|
||||
|
||||
*.node
|
||||
|
||||
# Fix for issue when working on the repo in a dev container
|
||||
.pnpm-store
|
||||
.nx/cache
|
||||
.nx/workspace-data
|
||||
.nx
|
||||
!.nx/workflows
|
||||
|
||||
.cargo/.package-cache
|
||||
.cargo/bin/
|
||||
@@ -61,4 +60,4 @@ target
|
||||
*.wasm
|
||||
/wasi-sdk*
|
||||
|
||||
vite.config.*.timestamp*
|
||||
vite.config.*.timestamp*
|
||||
|
||||
@@ -56,8 +56,8 @@ launch-templates:
|
||||
|
||||
- name: Install zip and unzip
|
||||
script: sudo apt-get -yqq install zip unzip
|
||||
linux-large:
|
||||
resource-class: 'docker_linux_amd64/large'
|
||||
linux-extra-large:
|
||||
resource-class: 'docker_linux_amd64/extra_large'
|
||||
image: 'ubuntu22.04-node20.11-v10'
|
||||
env:
|
||||
GIT_AUTHOR_EMAIL: test@test.com
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
distribute-on:
|
||||
default: auto linux-medium, 1 linux-large
|
||||
default: auto linux-medium, 1 linux-extra-large
|
||||
assignment-rules:
|
||||
- project: nx-dev
|
||||
target: build-base
|
||||
runs-on:
|
||||
- linux-large
|
||||
- linux-extra-large
|
||||
- target: test
|
||||
runs-on:
|
||||
- linux-medium
|
||||
|
||||
@@ -96,7 +96,6 @@ rust-toolchain @nrwl/nx-native-reviewers
|
||||
/packages/webpack/** @nrwl/nx-js-reviewers
|
||||
/e2e/webpack/** @nrwl/nx-js-reviewers
|
||||
/packages/rspack/** @nrwl/nx-js-reviewers
|
||||
/packages/rspack/src/utils/module-federation @nrwl/nx-js-reviewers
|
||||
/e2e/rspack/** @nrwl/nx-js-reviewers
|
||||
/packages/esbuild/** @nrwl/nx-js-reviewers
|
||||
/e2e/esbuild/** @nrwl/nx-js-reviewers
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Improve your architecture and CI pipeline times with Nx projects
|
||||
slug: improve-architecture-and-ci-times-with-projects
|
||||
authors: [Philip Fulcher]
|
||||
tags: [nx, enterprise]
|
||||
tags: [nx, 'customer story']
|
||||
cover_image: '/blog/images/2024-10-25/header.avif'
|
||||
pinned: true
|
||||
---
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
---
|
||||
title: Advent of Code Gets The Crystal Treatment!
|
||||
slug: advent-of-code-crystal-edition
|
||||
authors: ['Zack DeRose']
|
||||
tags: [nx]
|
||||
cover_image: /blog/images/2024-11-30/thumbnail.png
|
||||
youtubeUrl: https://youtu.be/st6Yq-19bW8
|
||||
---
|
||||
|
||||
Talking with developers, we've found that one of the main reasons folks like using Nx is: Nx allows their team to focus on shipping a great product, while Nx handles all the rest:
|
||||
|
||||
- setting up tools for testing, linting, and etc.
|
||||
- dynamic CI/CD pipelines with Nx Cloud
|
||||
- a code generation framework to manage expanding their projects
|
||||
|
||||
For the past couple years, we've been releasing an `Advent of Code Starter Repo` with this in mind!
|
||||
|
||||
If you're not familiar, [Advent of Code](https://adventofcode.com/) is a special event that runs every December that works like a Advent Calendar of programming problems. Every day at midnight, we all get access to 2 new puzzles that will award us a gold star if you can complete it successfully.
|
||||
|
||||
Specifically, our goal is to give developers an easy to use starting point that allows them to focus on solving the puzzles, and handing the rest over to Nx instead of wrestling with setting up tools, file i/o, and the like.
|
||||
|
||||
This year, we were able to further reduce the nx-specific config needed, using the new [Nx Project Crystal](/concepts/inferred-tasks) enhancements that landed earlier this year!
|
||||
|
||||
## Packages Landed!
|
||||
|
||||
We're excited to announce version `2.0.0` of the [`create-ts-aoc-starter`](https://www.npmjs.com/package/create-ts-aoc-starter) and [`ts-aoc-starter`](https://www.npmjs.com/package/ts-aoc-starter) packages are released, just in time for Advent of Code 2024!
|
||||
|
||||
### [`create-ts-aoc-starter`](https://www.npmjs.com/package/create-ts-aoc-starter)
|
||||
|
||||
This is the code generation command to setup your Advent of Code workspace! Simply run the command:
|
||||
|
||||
```terminal
|
||||
> npx create-ts-aoc-starter@latest
|
||||
```
|
||||
|
||||
And we'll spin up your workspace for you, all tools configured and ready to go!
|
||||
|
||||
### [`ts-aoc-starter`](https://www.npmjs.com/package/ts-aoc-starter)
|
||||
|
||||
This is the Nx Plugin we're shipping this year that comes pre-installed whenever you run the `create-ts-aoc-starter` command. By installing this package, and adding the `dynamic-tasks` to your `plugins` array of your `nx.json` file, Nx can setup all the commands we'll need for Advent of Code this year, with no manual setup or config required!
|
||||
|
||||
## How It Works
|
||||
|
||||
After generating your workspace, you'll find a directory for each of the 25 days of the game, and inside each directory, you'll find the following files:
|
||||
|
||||
- `a.data.sample.txt`
|
||||
- `a.data.txt`
|
||||
- `a.ts`
|
||||
- `b.data.sample.txt`
|
||||
- `b.data.txt`
|
||||
- `b.ts`
|
||||
|
||||
Provide your solution to the first part of the day in the `a.ts`, and you can copy and paste your code into `a.data.txt`.
|
||||
|
||||
For _most_ days, the puzzle also comes with a sample set of data to demonstrate what the correct answer would be. On these days, you can enter that data into the `a.data.sample.txt` file provided!
|
||||
|
||||
To run your solution against the sample data for day 1 then, run one of the commands:
|
||||
|
||||
```terminal
|
||||
> nx day-1-a-sample
|
||||
> nx day-1-sample
|
||||
> nx 1-a-sample
|
||||
> nx 1-sample
|
||||
```
|
||||
|
||||
And to run against the actual data, you can run one of the following:
|
||||
|
||||
```terminal
|
||||
> nx day-1-a
|
||||
> nx day-1
|
||||
> nx 1-a
|
||||
> nx 1
|
||||
```
|
||||
|
||||
Sometimes the second part of the problem simply builds on top of the first. On those days, you can just continue to code in the `a.ts` file, but a `b.ts` and `data.txt` files are also provided if you want to start over. To run these, use the commands:
|
||||
|
||||
```terminal
|
||||
> nx day-1-b
|
||||
> nx 1-b
|
||||
> nx day-1-b-sample
|
||||
> nx 1-b-sample
|
||||
```
|
||||
|
||||
### New Feature for 2.0.0: File Watching!
|
||||
|
||||
We've also added file watching (using [`nx watch`](/nx-api/nx/documents/watch) behind the scenes!)
|
||||
|
||||
Simply add `watch-` to the start of any of the commands and aliases listed above to start any of them in watch mode, so they automatically re-run as soon as any changes to the file system are detected! Example:
|
||||
|
||||
```terminal
|
||||
> nx watch-1
|
||||
```
|
||||
|
||||
### New Feature for 2.0.0: Additional Data Sets!
|
||||
|
||||
This year, we're also including the ability to drop in additional data sets. This can be particularly helpful in later days (as the problems get harder) and you want to test your solution on a data set that isn't the specific sample or the actual dataset provided. For this, simply create a `data.txt` file matching the naming pattern.
|
||||
|
||||
For example, if I wanted to create a data set called `foo`, I'd create in the filesystem a file called `a.data.foo.txt`. Then to run against this data set, run one of the commands:
|
||||
|
||||
```terminal
|
||||
> nx day-1-a-foo
|
||||
> nx day-1-foo
|
||||
> nx 1-a-foo
|
||||
> nx 1-foo
|
||||
> nx watch-day-1-a-foo
|
||||
> nx watch-day-1-foo
|
||||
> nx watch-1-a-foo
|
||||
> nx watch-1-foo
|
||||
```
|
||||
|
||||
## Learn more
|
||||
|
||||
- [Tutorial: Creating Your Own Plugin With Inferred Tasks](/extending-nx/tutorials/tooling-plugin#create-an-inferred-task)
|
||||
- [Nx Docs](/getting-started/intro)
|
||||
- [X/Twitter](https://twitter.com/nxdevtools)
|
||||
- [LinkedIn](https://www.linkedin.com/company/nrwl/)
|
||||
- [Nx GitHub](https://github.com/nrwl/nx)
|
||||
- [Nx Official Discord Server](https://go.nx.dev/community)
|
||||
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
@@ -0,0 +1,86 @@
|
||||
---
|
||||
title: Define the relationship with monorepos
|
||||
slug: define-the-relationship-with-monorepos
|
||||
authors: ['Philip Fulcher']
|
||||
tags: [nx]
|
||||
cover_image: /blog/images/2024-12-03/header.avif
|
||||
---
|
||||
|
||||
A monorepo might sound like a big, intimidating thing, but we're going to break it down to just the bare essentials. **A monorepo helps you better manage the relationships that already exist between your projects.** Once we understand those relationships, we can use tools to very quickly define them and pull them together into a more cohesive whole.
|
||||
|
||||
## So, what is a monorepo?
|
||||
|
||||
Let's start with the big question: what even is a monorepo?
|
||||
|
||||
> That's like when Google only has one repo for the entire company, right?
|
||||
|
||||
Not quite. That scale of monorepo doesn't work for most organizations, and we can still use a monorepo approach for smaller systems.
|
||||
|
||||
> So it's when you throw all your code in one repo and figure out how to manage it later?
|
||||
|
||||
This is also a pretty bad idea. We need tools and processes to manage this volume of code in a single repo.
|
||||
|
||||
The best definition I've seen comes from [monorepo.tools](https://monorepo.tools):
|
||||
|
||||
> A monorepo is a single repository containing multiple distinct projects with well-defined relationships.
|
||||
|
||||
Let's dig into that last part. What do we mean by **well-defined relationships?** It's useful to stat thinking about relationships between code in terms of distance.
|
||||
|
||||
## The shortest distance: importing from another file
|
||||
|
||||
We'll start with the smallest possible distance between two pieces of code: importing something from another file.
|
||||
|
||||

|
||||
|
||||
Say you have a button component. You create a form and import that button to use. This is a relationship we take for granted because we do it all the time, but there are some distinct benefits to this.
|
||||
|
||||
First, we see the impact of our change immediately. We make a change in the button, and we either see the result rendered in the browser, or we get a failed compilation. Or we have a test suite running that will fail or pass a test. Or lint rule warnings appear in our IDE. We immediately see the result of the change we've made, and the impact on the relationship.
|
||||
|
||||
This makes iteration fast: we see the impact of the change and can either refine that change or move on to the next one.
|
||||
|
||||
## One step away in distance: importing from a package
|
||||
|
||||
Let's take a step further away and think about the relationship when you have imported something from a package.
|
||||
|
||||

|
||||
|
||||
Say you have a design system published for your organization. You import the button from that package to use in your form. This looks very similar to what we did before, but we've introduced a big change in this relationship: seeing change is no longer immediate.
|
||||
|
||||
If we make a change in the button, there will be some sort of compilation, bundling, and publishing that will need to happen. And we'll need to consume the latest version of the package to actually see the change.
|
||||
|
||||
This is a slow process when you're working alone, but it can be managed with some tools. However, what happens if this change crosses team boundaries? Your design system team makes a change to the button and has to go through a PR review and merge process. Eventually that change is released as a new version and published. At some point later, you upgrade your version of the dependency just to find out the button has changed. But there's a bug! You report back to the design system team, and now they're going through this entire process again to get the fix in and published. This iteration cycle is very slow because understanding the impact of the change in the design system is no longer immediately apparent to consumers.
|
||||
|
||||
## Even further away: APIs
|
||||
|
||||
Let's step one step further: using APIs. Your frontend (in most cases) requires a backend, and it will be broken without it.
|
||||
|
||||

|
||||
|
||||
There is an **implicit dependency** between the frontend and backend. You don't import code directly, but you do depend on the backend to function.
|
||||
|
||||
Let's say that there's a new API endpoint needed, and you agreed with the team that it would be called `api/v1/contact/create` and would accept a payload with `contactName`.
|
||||
|
||||
But, the backend team had a conversation about naming standards during their sprint and made the decision that it could really be `contact/init` with a payload of `fullName`.
|
||||
|
||||
Understanding the impact of this change is now far-removed from making the change. Not only is there the PR merge, packaging, and releasing, but also deployment. It may not be until the end of the sprint before the impact of this change is actually understood. This iteration is practically glacial.
|
||||
|
||||
## How do monorepos help?
|
||||
|
||||
How do monorepos help with these relationships? **They shorten the distance of relationships between code.** Code is **colocated** so that the impact of your change can be understood immediately.
|
||||
|
||||
In the example with the design system, the button will be imported directly instead of going through a build and package process. The design system team can immediately see the impact of the change they're making and either adjust their approach or fix the issue directly in the consuming app.
|
||||
|
||||
For the API team, we can define that implicit relationship between backend and frontend so that we trigger e2e tests to confirm a change works. Or we can generate models from the backend to be consumed by the frontend. When the models are changed, the frontend code that imported those models will immediately reveal the impact of the change.
|
||||
|
||||
You might think that moving projects into a single repository changes the relationship between the projects. But the relationships we've talked about here already exist; the monorepo makes those relationships explicit and well-defined. With good monorepo tooling, we can understand the impact of change along any of these relationships faster in a monorepo.
|
||||
|
||||
## Learn more
|
||||
|
||||
- [Nx Docs](/getting-started/intro)
|
||||
- [X/Twitter](https://twitter.com/nxdevtools)
|
||||
- [LinkedIn](https://www.linkedin.com/company/nrwl/)
|
||||
- [Bluesky](https://bsky.app/profile/nx.dev)
|
||||
- [Nx GitHub](https://github.com/nrwl/nx)
|
||||
- [Nx Official Discord Server](https://go.nx.dev/community)
|
||||
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
title: Nx Cloud Pipelines Come To Nx Console
|
||||
slug: nx-cloud-pipelines-come-to-nx-console
|
||||
authors: [Zack DeRose]
|
||||
tags: [nx, nx-cloud, nx-console, enterprise]
|
||||
cover_image: '/blog/images/2024-11-25/thumbnail.png'
|
||||
---
|
||||
|
||||
## Your CI Pipelines, Now At-A-Glance In Your IDE
|
||||
|
||||
We're in the process of adding a new integration between [Nx Cloud](/nx-cloud), our CI product, and [Nx Console](/getting-started/editor-setup) our official plugin for the VSCode and JetBrains IDEs!
|
||||
|
||||
Now, once you've [connected your Nx Console to Nx Cloud](https://blog.nrwl.io/nx-console-meets-nx-cloud-d45dc099dc5d), you will have access to a new panel in the console that shows all of your recent CI Pipelines, including those in progress now.
|
||||
|
||||

|
||||
|
||||
This way, you can keep an eye on the status of the pipeline of your latest PR, and always just 1 click away from seeing detailed your results on Nx Cloud.
|
||||
|
||||
## Notifications On What You Care About Most
|
||||
|
||||
In addition to a panel where you can see all of your recent pipelines, you can also receive pop-up notifications when a pipeline completes
|
||||
|
||||

|
||||
|
||||
Head to the Nx Console settings to adjust controls on these notifications. This will allow you to adjust notifications to only show for failed runs if you prefer, or to turn off the notifications altogether.
|
||||
|
||||

|
||||
|
||||
## Coming Soon!
|
||||
|
||||
We're in the process of landing this on Nx Console for VSCode now - and we're already dog-fooding it on the `nx` and `nx-console` repos. It will be landing in the next few week for all Nx Cloud projects, with the feature landing on Nx Console for JetBrains IDEs to follow soon!
|
||||
|
||||
For more on Nx Cloud, check out the Solutions tab above! Nx Cloud is free to get started, so you can [create your free account today](https://cloud.nx.app)!
|
||||
|
||||
[](/nx-cloud)
|
||||
|
||||
And if you're not using Nx Console yet, you can get started now with Nx Console available for VSCode and JetBrains IDEs:
|
||||
|
||||
{% install-nx-console /%}
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 13 MiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 395 KiB |
|
After Width: | Height: | Size: 716 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 4.2 KiB |
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'Automate Task Pipelines to Build Before next start'
|
||||
title: 'Create a Task Pipeline to Build Your Next app Before Serving it'
|
||||
videoUrl: 'https://youtu.be/_U4hu6SuBaY'
|
||||
duration: '3:07'
|
||||
---
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'Configure CI to Access Remote Caching'
|
||||
title: 'Enable Read/Write Access to your Nx Remote Cache from CI'
|
||||
videoUrl: 'https://youtu.be/vBokLJ_F8qs'
|
||||
duration: '1:45'
|
||||
---
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'Run Tasks in Parallel on Different Machines on CI'
|
||||
title: 'Speed Up CI by Running Tasks in Parallel on Different Machines'
|
||||
videoUrl: 'https://youtu.be/lO_p4tA6IZI'
|
||||
duration: '2:08'
|
||||
---
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'Split Playwright e2e Tests for a Faster CI'
|
||||
title: 'Run Playwright E2E Tests Faster by Parallelizing Them on CI'
|
||||
videoUrl: 'https://youtu.be/42XnmzxEXM8'
|
||||
duration: '5:47'
|
||||
---
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
],
|
||||
"executors": [
|
||||
{
|
||||
"description": "Compile and bundle an Nx Conformance Rule",
|
||||
"file": "external-generated/packages/powerpack-conformance/executors/bundle-rule.json",
|
||||
"description": "Compile and bundle one or more Nx Conformance Rules",
|
||||
"file": "external-generated/packages/powerpack-conformance/executors/bundle-rules.json",
|
||||
"hidden": false,
|
||||
"name": "bundle-rule",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rule/schema.json",
|
||||
"path": "powerpack-conformance/executors/bundle-rule",
|
||||
"name": "bundle-rules",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rules/schema.json",
|
||||
"path": "powerpack-conformance/executors/bundle-rules",
|
||||
"type": "executor"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "bundle-rules",
|
||||
"implementation": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rules/executor.ts",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"version": 2,
|
||||
"title": "BundleNxConformanceRules",
|
||||
"description": "Compile and bundle one or more Nx Conformance Rules",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"outputPath": {
|
||||
"type": "string",
|
||||
"description": "The output path for the bundled rules to be written to"
|
||||
}
|
||||
},
|
||||
"required": ["outputPath"],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Compile and bundle one or more Nx Conformance Rules",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rules/schema.json",
|
||||
"type": "executor"
|
||||
}
|
||||
@@ -28,6 +28,7 @@ Install `create-nx-workspace` globally to invoke the command directly, or use `n
|
||||
| `--defaultBase` | string | Default base to use for new projects. (Default: `main`) |
|
||||
| `--docker` | boolean | Generate a Dockerfile for the Node API. |
|
||||
| `--e2eTestRunner` | `playwright`, `cypress`, `none` | Test runner to use for end to end (E2E) tests. |
|
||||
| `--formatter` | string | Code formatter to use. |
|
||||
| `--framework` | string | Framework option to be used with certain stacks. |
|
||||
| `--help` | boolean | Show help. |
|
||||
| `--interactive` | boolean | Enable interactive mode with presets. (Default: `true`) |
|
||||
@@ -45,6 +46,7 @@ Install `create-nx-workspace` globally to invoke the command directly, or use `n
|
||||
| `--style` | string | Stylesheet type to be used with certain stacks. |
|
||||
| `--useGitHub` | boolean | Will you be using GitHub as your git hosting provider? (Default: `false`) |
|
||||
| `--version` | boolean | Show version number. |
|
||||
| `--workspaces` | boolean | Use package manager workspaces. (Default: `false`) |
|
||||
| `--workspaceType` | `integrated`, `package-based`, `standalone` | The type of workspace to create. |
|
||||
|
||||
## Presets
|
||||
|
||||
@@ -847,6 +847,40 @@
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/dte",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "conformance",
|
||||
"name": "Conformance",
|
||||
"description": "Conformance features that are available to Nx Cloud Enterprise customers",
|
||||
"mediaImage": "",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"tags": ["conformance"]
|
||||
},
|
||||
{
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"tags": ["conformance"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance",
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
@@ -1420,6 +1454,40 @@
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/dte",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "conformance",
|
||||
"name": "Conformance",
|
||||
"description": "Conformance features that are available to Nx Cloud Enterprise customers",
|
||||
"mediaImage": "",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"tags": ["conformance"]
|
||||
},
|
||||
{
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"tags": ["conformance"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance",
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
@@ -1736,6 +1804,62 @@
|
||||
"path": "/ci/recipes/enterprise/dte/jenkins-dte",
|
||||
"tags": []
|
||||
},
|
||||
"/ci/recipes/enterprise/conformance": {
|
||||
"id": "conformance",
|
||||
"name": "Conformance",
|
||||
"description": "Conformance features that are available to Nx Cloud Enterprise customers",
|
||||
"mediaImage": "",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"tags": ["conformance"]
|
||||
},
|
||||
{
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"tags": ["conformance"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance",
|
||||
"tags": []
|
||||
},
|
||||
"/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud": {
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"tags": ["conformance"]
|
||||
},
|
||||
"/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud": {
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"tags": ["conformance"]
|
||||
},
|
||||
"/ci/recipes/other": {
|
||||
"id": "other",
|
||||
"name": "Other",
|
||||
|
||||
@@ -1268,6 +1268,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Updating Version References in Manifest Files (e.g. package.json)",
|
||||
"path": "/recipes/nx-release/updating-version-references",
|
||||
"id": "updating-version-references",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Automatically Version with Conventional Commits",
|
||||
"path": "/recipes/nx-release/automatically-version-with-conventional-commits",
|
||||
@@ -1340,14 +1348,6 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Publish a Custom Dist Directory",
|
||||
"path": "/recipes/nx-release/publish-custom-dist-directory",
|
||||
"id": "publish-custom-dist-directory",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Build Before Versioning",
|
||||
"path": "/recipes/nx-release/build-before-versioning",
|
||||
@@ -2417,6 +2417,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Updating Version References in Manifest Files (e.g. package.json)",
|
||||
"path": "/recipes/nx-release/updating-version-references",
|
||||
"id": "updating-version-references",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Automatically Version with Conventional Commits",
|
||||
"path": "/recipes/nx-release/automatically-version-with-conventional-commits",
|
||||
@@ -2489,14 +2497,6 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Publish a Custom Dist Directory",
|
||||
"path": "/recipes/nx-release/publish-custom-dist-directory",
|
||||
"id": "publish-custom-dist-directory",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Build Before Versioning",
|
||||
"path": "/recipes/nx-release/build-before-versioning",
|
||||
@@ -2532,6 +2532,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Updating Version References in Manifest Files (e.g. package.json)",
|
||||
"path": "/recipes/nx-release/updating-version-references",
|
||||
"id": "updating-version-references",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Automatically Version with Conventional Commits",
|
||||
"path": "/recipes/nx-release/automatically-version-with-conventional-commits",
|
||||
@@ -2604,14 +2612,6 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Publish a Custom Dist Directory",
|
||||
"path": "/recipes/nx-release/publish-custom-dist-directory",
|
||||
"id": "publish-custom-dist-directory",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Build Before Versioning",
|
||||
"path": "/recipes/nx-release/build-before-versioning",
|
||||
@@ -6041,6 +6041,31 @@
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Conformance",
|
||||
"path": "/ci/recipes/enterprise/conformance",
|
||||
"id": "conformance",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
@@ -6459,6 +6484,31 @@
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Conformance",
|
||||
"path": "/ci/recipes/enterprise/conformance",
|
||||
"id": "conformance",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
@@ -6689,6 +6739,47 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Conformance",
|
||||
"path": "/ci/recipes/enterprise/conformance",
|
||||
"id": "conformance",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Other",
|
||||
"path": "/ci/recipes/other",
|
||||
@@ -10643,9 +10734,9 @@
|
||||
"name": "executors",
|
||||
"children": [
|
||||
{
|
||||
"id": "bundle-rule",
|
||||
"path": "/nx-api/powerpack-conformance/executors/bundle-rule",
|
||||
"name": "bundle-rule",
|
||||
"id": "bundle-rules",
|
||||
"path": "/nx-api/powerpack-conformance/executors/bundle-rules",
|
||||
"name": "bundle-rules",
|
||||
"children": [],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
"type": "executor"
|
||||
},
|
||||
"/nx-api/angular/executors/application": {
|
||||
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities.",
|
||||
"file": "generated/packages/angular/executors/application.json",
|
||||
"hidden": false,
|
||||
"name": "application",
|
||||
@@ -200,7 +200,7 @@
|
||||
"type": "generator"
|
||||
},
|
||||
"/nx-api/angular/generators/convert-to-application-executor": {
|
||||
"description": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"description": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder.",
|
||||
"file": "generated/packages/angular/generators/convert-to-application-executor.json",
|
||||
"hidden": false,
|
||||
"name": "convert-to-application-executor",
|
||||
@@ -3681,13 +3681,13 @@
|
||||
"root": "/libs/nx-packages/powerpack-conformance",
|
||||
"source": "/libs/nx-packages/powerpack-conformance/src",
|
||||
"executors": {
|
||||
"/nx-api/powerpack-conformance/executors/bundle-rule": {
|
||||
"description": "Compile and bundle an Nx Conformance Rule",
|
||||
"file": "external-generated/packages/powerpack-conformance/executors/bundle-rule.json",
|
||||
"/nx-api/powerpack-conformance/executors/bundle-rules": {
|
||||
"description": "Compile and bundle one or more Nx Conformance Rules",
|
||||
"file": "external-generated/packages/powerpack-conformance/executors/bundle-rules.json",
|
||||
"hidden": false,
|
||||
"name": "bundle-rule",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rule/schema.json",
|
||||
"path": "/nx-api/powerpack-conformance/executors/bundle-rule",
|
||||
"name": "bundle-rules",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rules/schema.json",
|
||||
"path": "/nx-api/powerpack-conformance/executors/bundle-rules",
|
||||
"type": "executor"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1737,6 +1737,17 @@
|
||||
"path": "/recipes/nx-release/release-projects-independently",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
{
|
||||
"id": "updating-version-references",
|
||||
"name": "Updating Version References in Manifest Files (e.g. package.json)",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/nx-release/updating-version-references",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/nx-release/updating-version-references",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
{
|
||||
"id": "automatically-version-with-conventional-commits",
|
||||
"name": "Automatically Version with Conventional Commits",
|
||||
@@ -1836,17 +1847,6 @@
|
||||
"path": "/recipes/nx-release/configure-changelog-format",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
{
|
||||
"id": "publish-custom-dist-directory",
|
||||
"name": "Publish a Custom Dist Directory",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/nx-release/publish-custom-dist-directory",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/nx-release/publish-custom-dist-directory",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
{
|
||||
"id": "build-before-versioning",
|
||||
"name": "Build Before Versioning",
|
||||
@@ -3311,6 +3311,17 @@
|
||||
"path": "/recipes/nx-release/release-projects-independently",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
{
|
||||
"id": "updating-version-references",
|
||||
"name": "Updating Version References in Manifest Files (e.g. package.json)",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/nx-release/updating-version-references",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/nx-release/updating-version-references",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
{
|
||||
"id": "automatically-version-with-conventional-commits",
|
||||
"name": "Automatically Version with Conventional Commits",
|
||||
@@ -3410,17 +3421,6 @@
|
||||
"path": "/recipes/nx-release/configure-changelog-format",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
{
|
||||
"id": "publish-custom-dist-directory",
|
||||
"name": "Publish a Custom Dist Directory",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/nx-release/publish-custom-dist-directory",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/nx-release/publish-custom-dist-directory",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
{
|
||||
"id": "build-before-versioning",
|
||||
"name": "Build Before Versioning",
|
||||
@@ -3470,6 +3470,17 @@
|
||||
"path": "/recipes/nx-release/release-projects-independently",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
"/recipes/nx-release/updating-version-references": {
|
||||
"id": "updating-version-references",
|
||||
"name": "Updating Version References in Manifest Files (e.g. package.json)",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/nx-release/updating-version-references",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/nx-release/updating-version-references",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
"/recipes/nx-release/automatically-version-with-conventional-commits": {
|
||||
"id": "automatically-version-with-conventional-commits",
|
||||
"name": "Automatically Version with Conventional Commits",
|
||||
@@ -3569,17 +3580,6 @@
|
||||
"path": "/recipes/nx-release/configure-changelog-format",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
"/recipes/nx-release/publish-custom-dist-directory": {
|
||||
"id": "publish-custom-dist-directory",
|
||||
"name": "Publish a Custom Dist Directory",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/nx-release/publish-custom-dist-directory",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/nx-release/publish-custom-dist-directory",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
"/recipes/nx-release/build-before-versioning": {
|
||||
"id": "build-before-versioning",
|
||||
"name": "Build Before Versioning",
|
||||
|
||||
@@ -497,6 +497,13 @@
|
||||
"name": "Release Projects Independently",
|
||||
"path": "/recipes/nx-release/release-projects-independently"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/nx-release/updating-version-references",
|
||||
"id": "updating-version-references",
|
||||
"name": "Updating Version References in Manifest Files (e.g. package.json)",
|
||||
"path": "/recipes/nx-release/updating-version-references"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/nx-release/automatically-version-with-conventional-commits",
|
||||
@@ -560,13 +567,6 @@
|
||||
"name": "Configure Changelog Format",
|
||||
"path": "/recipes/nx-release/configure-changelog-format"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/nx-release/publish-custom-dist-directory",
|
||||
"id": "publish-custom-dist-directory",
|
||||
"name": "Publish a Custom Dist Directory",
|
||||
"path": "/recipes/nx-release/publish-custom-dist-directory"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/nx-release/build-before-versioning",
|
||||
@@ -1235,6 +1235,20 @@
|
||||
"id": "conformance",
|
||||
"name": "Run Language-Agnostic Conformance Rules",
|
||||
"path": "/nx-enterprise/powerpack/conformance"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "nx-cloud/enterprise/conformance/configure-conformance-rules-in-nx-cloud",
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud",
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"path": "/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud"
|
||||
}
|
||||
],
|
||||
"owners": [
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
"type": "executor"
|
||||
},
|
||||
{
|
||||
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities.",
|
||||
"file": "generated/packages/angular/executors/application.json",
|
||||
"hidden": false,
|
||||
"name": "application",
|
||||
@@ -195,7 +195,7 @@
|
||||
"type": "generator"
|
||||
},
|
||||
{
|
||||
"description": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"description": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder.",
|
||||
"file": "generated/packages/angular/generators/convert-to-application-executor.json",
|
||||
"hidden": false,
|
||||
"name": "convert-to-application-executor",
|
||||
|
||||
@@ -14,6 +14,7 @@ We provide a recommended version, and it is usually the latest minor version of
|
||||
|
||||
| Angular Version | **Nx Version _(recommended)_** | Nx Version _(range)_ |
|
||||
| --------------- | ------------------------------ | ---------------------------------------- |
|
||||
| ~19.0.0 | **latest** | >=20.2.0 <=latest |
|
||||
| ~18.2.0 | **latest** | >=19.6.0 <=latest |
|
||||
| ~18.1.0 | **latest** | >=19.5.0 <=latest |
|
||||
| ~18.0.0 | **latest** | >=19.1.0 <=latest |
|
||||
@@ -21,9 +22,9 @@ We provide a recommended version, and it is usually the latest minor version of
|
||||
| ~17.2.0 | **latest** | >=18.1.1 <=latest |
|
||||
| ~17.1.0 | **latest** | >=17.3.0 <=latest |
|
||||
| ~17.0.0 | **latest** | >=17.1.0 <=latest |
|
||||
| ~16.2.0 | **latest** | >=16.7.0 <=latest |
|
||||
| ~16.1.0 | **latest** | >=16.4.0 <=latest |
|
||||
| ~16.0.0 | **latest** | >=16.1.0 <=latest |
|
||||
| ~16.2.0 | **~20.1.0** | >=16.7.0 <20.2.0 |
|
||||
| ~16.1.0 | **~20.1.0** | >=16.4.0 <20.2.0 |
|
||||
| ~16.0.0 | **~20.1.0** | >=16.1.0 <20.2.0 |
|
||||
| ~15.2.0 | **~19.0.0** | >=15.8.0 <19.1.0 |
|
||||
| ~15.1.0 | **~19.0.0** | >=15.5.0 <19.1.0 |
|
||||
| ~15.0.0 | **~19.0.0** | >=15.2.0 <=15.4.8 \|\| >=15.7.0 <19.1.0 |
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"schema": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"title": "Schema for Nx Application Executor",
|
||||
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities.",
|
||||
"examplesFile": "This executor is a drop-in replacement for the `@angular-devkit/build-angular:application` builder provided by the Angular CLI. It builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities.\n\nIn addition to the features provided by the Angular CLI builder, the `@nx/angular:application` executor also supports the following:\n\n- Providing esbuild plugins\n- Providing a function to transform the application's `index.html` file\n- Incremental builds\n\n{% callout type=\"check\" title=\"Dev Server\" %}\nThe [`@nx/angular:dev-server` executor](/nx-api/angular/executors/dev-server) is required to serve your application when using the `@nx/angular:application` to build it. It is a drop-in replacement for the Angular CLI's `@angular-devkit/build-angular:dev-server` builder and ensures the application is correctly served with Vite when using the `@nx/angular:application` executor.\n{% /callout %}\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Providing esbuild plugins\" %}\n\nThe executor accepts a `plugins` option that allows you to provide esbuild plugins that will be used when building your application. It allows providing a path to a plugin file or an object with a `path` and `options` property to provide options to the plugin.\n\n```json {% fileName=\"apps/my-app/project.json\" highlightLines=[\"8-16\"] %}\n{\n ...\n \"targets\": {\n \"build\": {\n \"executor\": \"@nx/angular:application\",\n \"options\": {\n ...\n \"plugins\": [\n \"apps/my-app/plugins/plugin1.js\",\n {\n \"path\": \"apps/my-app/plugins/plugin2.js\",\n \"options\": {\n \"someOption\": \"some value\"\n }\n }\n ]\n }\n }\n ...\n }\n}\n```\n\n```ts {% fileName=\"apps/my-app/plugins/plugin1.js\" %}\nconst plugin1 = {\n name: 'plugin1',\n setup(build) {\n const options = build.initialOptions;\n options.define.PLUGIN1_TEXT = '\"Value was provided at build time\"';\n },\n};\n\nmodule.exports = plugin1;\n```\n\n```ts {% fileName=\"apps/my-app/plugins/plugin2.js\" %}\nfunction plugin2({ someOption }) {\n return {\n name: 'plugin2',\n setup(build) {\n const options = build.initialOptions;\n options.define.PLUGIN2_TEXT = JSON.stringify(someOption);\n },\n };\n}\n\nmodule.exports = plugin2;\n```\n\nAdditionally, we need to inform TypeScript of the defined variables to prevent type-checking errors during the build. We can achieve this by creating or updating a type definition file included in the TypeScript build process (e.g. `src/types.d.ts`) with the following content:\n\n```ts {% fileName=\"apps/my-app/src/types.d.ts\" %}\ndeclare const PLUGIN1_TEXT: number;\ndeclare const PLUGIN2_TEXT: string;\n```\n\n{% /tab %}\n\n{% tab label=\"Transforming the 'index.html' file\" %}\n\nThe executor accepts an `indexHtmlTransformer` option to provide a path to a file with a default export for a function that receives the application's `index.html` file contents and outputs the updated contents.\n\n```json {% fileName=\"apps/my-app/project.json\" highlightLines=[8] %}\n{\n ...\n \"targets\": {\n \"build\": {\n \"executor\": \"@nx/angular:application\",\n \"options\": {\n ...\n \"indexHtmlTransformer\": \"apps/my-app/index-html.transformer.ts\"\n }\n }\n ...\n }\n}\n```\n\n```ts {% fileName=\"apps/my-app/index-html.transformer.ts\" %}\nexport default function (indexContent: string) {\n return indexContent.replace(\n '<title>my-app</title>',\n '<title>my-app (transformed)</title>'\n );\n}\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"outputCapture": "direct-nodejs",
|
||||
"type": "object",
|
||||
@@ -55,7 +55,18 @@
|
||||
},
|
||||
"server": {
|
||||
"type": "string",
|
||||
"description": "The full path for the server entry point to the application, relative to the current workspace."
|
||||
"description": "The full path for the server entry point to the application, relative to the current workspace.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "The full path for the server entry point to the application, relative to the current workspace."
|
||||
},
|
||||
{
|
||||
"const": false,
|
||||
"type": "boolean",
|
||||
"description": "Indicates that a server entry point is not provided. _Note: this is only supported in Angular versions >= 19.0.0_."
|
||||
}
|
||||
]
|
||||
},
|
||||
"polyfills": {
|
||||
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
|
||||
@@ -71,6 +82,29 @@
|
||||
"type": "string",
|
||||
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations. _Note: this is only supported in Angular versions >= 17.3.0_."
|
||||
},
|
||||
"security": {
|
||||
"description": "Security features to protect against XSS and other common attacks. _Note: this is only supported in Angular versions >= 19.0.0_.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"autoCsp": {
|
||||
"description": "Enables automatic generation of a hash-based Strict Content Security Policy (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will default to true once we are out of experimental/preview phases. It defaults to `false`.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"unsafeEval": {
|
||||
"type": "boolean",
|
||||
"description": "Include the `unsafe-eval` directive (https://web.dev/articles/strict-csp#remove-eval) in the auto-CSP. Please only enable this if you are absolutely sure that you need to, as allowing calls to eval will weaken the XSS defenses provided by the auto-CSP. It default to `false`."
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
{ "type": "boolean" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"description": "Global scripts to be included in the build.",
|
||||
"type": "array",
|
||||
@@ -157,6 +191,28 @@
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"default": []
|
||||
},
|
||||
"sass": {
|
||||
"description": "Options to pass to the sass preprocessor. _Note: this is only supported in Angular versions >= 19.0.0_.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fatalDeprecations": {
|
||||
"description": "A set of deprecations to treat as fatal. If a deprecation warning of any provided type is encountered during compilation, the compiler will error instead. If a Version is provided, then all deprecations that were active in that compiler version will be treated as fatal.",
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
},
|
||||
"silenceDeprecations": {
|
||||
"description": " A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead.",
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
},
|
||||
"futureDeprecations": {
|
||||
"description": "A set of future deprecations to opt into early. Future deprecations passed here will be treated as active by the compiler, emitting warnings as necessary.",
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
@@ -546,8 +602,7 @@
|
||||
"default": []
|
||||
},
|
||||
"prerender": {
|
||||
"description": "Prerender (SSG) pages of your application during build time.",
|
||||
"default": false,
|
||||
"description": "Prerender (SSG) pages of your application during build time. It defaults to `false` in Angular versions < 19.0.0. Otherwise, the value will be `undefined`.",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean",
|
||||
@@ -584,6 +639,11 @@
|
||||
"entry": {
|
||||
"type": "string",
|
||||
"description": "The server entry-point that when executed will spawn the web server."
|
||||
},
|
||||
"experimentalPlatform": {
|
||||
"description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules. Additionally, it is experimental, and the feature may undergo changes in future versions. _Note: this is only supported in Angular versions >= 19.0.0_.",
|
||||
"default": "node",
|
||||
"enum": ["node", "neutral"]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
@@ -592,8 +652,12 @@
|
||||
},
|
||||
"appShell": {
|
||||
"type": "boolean",
|
||||
"description": "Generates an application shell during build time.",
|
||||
"default": false
|
||||
"description": "Generates an application shell during build time. It defaults to `false` in Angular versions < 19.0.0. Otherwise, the value will be `undefined`."
|
||||
},
|
||||
"outputMode": {
|
||||
"type": "string",
|
||||
"description": "Defines the build output target. 'static': Generates a static site for deployment on any static hosting service. 'server': Produces an application designed for deployment on a server that supports server-side rendering (SSR). _Note: this is only supported in Angular versions >= 19.0.0_.",
|
||||
"enum": ["static", "server"]
|
||||
},
|
||||
"buildLibsFromSource": {
|
||||
"type": "boolean",
|
||||
@@ -739,7 +803,7 @@
|
||||
},
|
||||
"presets": []
|
||||
},
|
||||
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities.",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/packages/angular/src/executors/application/schema.json",
|
||||
|
||||
@@ -514,7 +514,7 @@
|
||||
"default": true
|
||||
},
|
||||
"plugins": {
|
||||
"description": "A list of ESBuild plugins. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"description": "A list of ESBuild plugins.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
|
||||
@@ -93,8 +93,7 @@
|
||||
},
|
||||
"hmr": {
|
||||
"type": "boolean",
|
||||
"description": "Enable hot module replacement.",
|
||||
"default": false
|
||||
"description": "Enable hot module replacement. It defaults to `false` in Angular versions < 19.0.0. Otherwise, the value will be `undefined`."
|
||||
},
|
||||
"watch": {
|
||||
"type": "boolean",
|
||||
@@ -107,7 +106,7 @@
|
||||
},
|
||||
"forceEsbuild": {
|
||||
"type": "boolean",
|
||||
"description": "Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system. _Note: this is only supported in Angular versions >= 16.1.0_.",
|
||||
"description": "Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system.",
|
||||
"default": false
|
||||
},
|
||||
"inspect": {
|
||||
@@ -145,7 +144,7 @@
|
||||
"x-priority": "important"
|
||||
},
|
||||
"esbuildMiddleware": {
|
||||
"description": "A list of HTTP request middleware functions. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"description": "A list of HTTP request middleware functions.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"presets": [
|
||||
{
|
||||
"name": "Buildable Library with Tailwind",
|
||||
"keys": ["project", "tailwindConfig"]
|
||||
},
|
||||
{
|
||||
"name": "Updating Project Dependencies for Buildable Library",
|
||||
"keys": ["project"]
|
||||
@@ -39,10 +35,6 @@
|
||||
"poll": {
|
||||
"type": "number",
|
||||
"description": "Enable and define the file watching poll time period in milliseconds. _Note: this is only supported in Angular versions >= 18.0.0_."
|
||||
},
|
||||
"tailwindConfig": {
|
||||
"type": "string",
|
||||
"description": "The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured."
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
|
||||
@@ -10,13 +10,6 @@
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"presets": [
|
||||
{
|
||||
"name": "Publishable Library with Tailwind",
|
||||
"keys": [
|
||||
"project",
|
||||
"tailwindConfig"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Updating Project Dependencies for Publishable Library",
|
||||
"keys": [
|
||||
@@ -44,12 +37,6 @@
|
||||
"poll": {
|
||||
"type": "number",
|
||||
"description": "Enable and define the file watching poll time period in milliseconds. _Note: this is only supported in Angular versions >= 18.0.0_."
|
||||
},
|
||||
"tailwindConfig": {
|
||||
"type": "string",
|
||||
"description": "The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured. _Note: starting with Angular v17, this option is no longer used and the configuration will be picked up if exists at the project or workspace root_.",
|
||||
"x-completion-type": "file",
|
||||
"x-completion-glob": "tailwind.config@(.js|.cjs|.mjs|.ts)"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
|
||||
@@ -166,9 +166,10 @@
|
||||
"default": false
|
||||
},
|
||||
"bundler": {
|
||||
"description": "Bundler to use to build the application. It defaults to `esbuild` for Angular versions >= 17.0.0. Otherwise, it defaults to `webpack`. _Note: The `esbuild` bundler is only considered stable from Angular v17._",
|
||||
"description": "Bundler to use to build the application.",
|
||||
"type": "string",
|
||||
"enum": ["webpack", "esbuild"],
|
||||
"enum": ["esbuild", "webpack"],
|
||||
"default": "esbuild",
|
||||
"x-prompt": "Which bundler do you want to use to build the application?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
@@ -177,11 +178,15 @@
|
||||
"type": "boolean",
|
||||
"x-prompt": "Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)?",
|
||||
"default": false
|
||||
},
|
||||
"serverRouting": {
|
||||
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["directory"],
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/angular:application apps/my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/angular:app my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Components application\" %}\n\nCreate an application with Single File Components (inline styles and inline templates):\n\n```bash\nnx g @nx/angular:app apps/my-app --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Set custom prefix and tags\" %}\n\nSet the prefix to apply to generated selectors and add tags to the application (used for linting).\n\n```bash\nnx g @nx/angular:app apps/my-app --prefix=admin --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/angular:application apps/my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Specify style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n```bash\nnx g @nx/angular:app my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Components application\" %}\n\nCreate an application with Single File Components (inline styles and inline templates):\n\n```bash\nnx g @nx/angular:app apps/my-app --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Set custom prefix and tags\" %}\n\nSet the prefix to apply to generated selectors and add tags to the application (used for linting).\n\n```bash\nnx g @nx/angular:app apps/my-app --prefix=admin --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["app"],
|
||||
|
||||
@@ -12,14 +12,13 @@
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "The path at which to create the component file, relative to the workspace root. By default, it is set to the root of the project.",
|
||||
"description": "The file path to the component. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where to create the component?"
|
||||
"x-prompt": "What is the component file path?"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the component.",
|
||||
"x-prompt": "What name would you like to use for the component?"
|
||||
"description": "The component symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"prefix": {
|
||||
"type": "string",
|
||||
@@ -105,6 +104,11 @@
|
||||
"default": false,
|
||||
"x-priority": "important"
|
||||
},
|
||||
"exportDefault": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Use default export for the component instead of a named export."
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
"type": "boolean",
|
||||
@@ -113,7 +117,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["path"],
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Component\" %}\n\nCreate a component named `my-component`:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Component\" %}\n\nCreate a component named `my-component` with inline styles and inline template:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Component with OnPush Change Detection Strategy\" %}\n\nCreate a component named `my-component` with OnPush Change Detection Strategy:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component --changeDetection=OnPush\n```\n\n{% /tab %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Component\" %}\n\nGenerate a component named `MyComponent` at `apps/my-app/src/lib/my-component/my-component.component.ts`:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component.ts\n```\n\n{% /tab %}\n\n{% tab label=\"Without Providing the File Extension\" %}\n\nGenerate a component named `MyComponent` at `apps/my-app/src/lib/my-component/my-component.component.ts`:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component\n```\n\n{% /tab %}\n\n{% tab label=\"With Different Symbol Name\" %}\n\nGenerate a component named `CustomComponent` at `apps/my-app/src/lib/my-component/my-component.component.ts`:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component --name=custom\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Component\" %}\n\nCreate a component named `my-component` with inline styles and inline template:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Component with OnPush Change Detection Strategy\" %}\n\nCreate a component named `my-component` with OnPush Change Detection Strategy:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component --changeDetection=OnPush\n```\n\n{% /tab %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["c"],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"$schema": "http://json-schema.org/schema",
|
||||
"$id": "NxAngularConvertToApplicationExecutorGenerator",
|
||||
"cli": "nx",
|
||||
"title": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"title": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder.",
|
||||
"description": "Converts a project or all projects using one of the `@angular-devkit/build-angular:browser`, `@angular-devkit/build-angular:browser-esbuild`, `@nx/angular:browser` and `@nx/angular:browser-esbuild` executors to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder. If the converted target is using one of the `@nx/angular` executors, the `@nx/angular:application` executor will be used. Otherwise, the `@angular-devkit/build-angular:application` builder will be used.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -25,7 +25,7 @@
|
||||
"additionalProperties": false,
|
||||
"presets": []
|
||||
},
|
||||
"description": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder. _Note: this is only supported in Angular versions >= 17.0.0_.",
|
||||
"description": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder.",
|
||||
"implementation": "/packages/angular/src/generators/convert-to-application-executor/convert-to-application-executor.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
|
||||
@@ -9,17 +9,30 @@
|
||||
"type": "object",
|
||||
"description": "Creates a new Angular directive.",
|
||||
"additionalProperties": false,
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate a directive with the exported symbol matching the file name. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
|
||||
"command": "nx g @nx/angular:directive mylib/src/lib/foo.directive.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate a directive without providing the file extension. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
|
||||
"command": "nx g @nx/angular:directive mylib/src/lib/foo"
|
||||
},
|
||||
{
|
||||
"description": "Generate a directive with the exported symbol different from the file name. It results in the directive `CustomDirective` at `mylib/src/lib/foo.directive.ts`",
|
||||
"command": "nx g @nx/angular:directive mylib/src/lib/foo --name=custom"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "The path at which to create the directive file.",
|
||||
"x-prompt": "Where to put the directive?",
|
||||
"$default": { "$source": "argv", "index": 0 }
|
||||
"description": "The file path to the directive. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What is the directive file path?"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the new directive.",
|
||||
"x-prompt": "What name would you like to use for the directive?"
|
||||
"description": "The directive symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"prefix": {
|
||||
"type": "string",
|
||||
|
||||
@@ -6,11 +6,15 @@
|
||||
"cli": "nx",
|
||||
"$id": "NxReactFederateModule",
|
||||
"title": "Federate Module",
|
||||
"description": "Create a federated module, which is exposed by a remote and can be subsequently loaded by a host.",
|
||||
"description": "Create a federated module, which is exposed by a Producer (remote) and can be subsequently loaded by a Consumer (host).",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app --remoteDirectory=apps/my-remote-app",
|
||||
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=myRemoteApp --remoteDirectory=apps/myRemoteApp",
|
||||
"description": "Create a federated module from my-remote-app, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
|
||||
},
|
||||
{
|
||||
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --producer=myProducer --producerDirectory=apps/myProducer",
|
||||
"description": "Create a federated module from myProducer, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
@@ -30,15 +34,17 @@
|
||||
},
|
||||
"remote": {
|
||||
"type": "string",
|
||||
"description": "The name of the remote.",
|
||||
"x-prompt": "What is/should the remote be named?"
|
||||
"description": "The name of the Producer (remote).",
|
||||
"x-prompt": "What is/should the Producer (remote) be named?",
|
||||
"alias": "producer"
|
||||
},
|
||||
"remoteDirectory": {
|
||||
"description": "The directory of the new remote application if one needs to be created.",
|
||||
"type": "string"
|
||||
"description": "The directory of the new Producer (remote) application if one needs to be created.",
|
||||
"type": "string",
|
||||
"alias": "producerDirectory"
|
||||
},
|
||||
"style": {
|
||||
"description": "The file extension to be used for style files for the remote if one needs to be created.",
|
||||
"description": "The file extension to be used for style files for the Producer (remote) if one needs to be created.",
|
||||
"type": "string",
|
||||
"default": "css",
|
||||
"enum": ["css", "scss", "sass", "less"]
|
||||
@@ -52,24 +58,25 @@
|
||||
"unitTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["jest", "vitest", "none"],
|
||||
"description": "Test runner to use for unit tests of the remote if it needs to be created.",
|
||||
"description": "Test runner to use for unit tests of the Producer (remote) if it needs to be created.",
|
||||
"x-prompt": "Which unit test runner would you like to use?",
|
||||
"default": "jest"
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["cypress", "none"],
|
||||
"description": "Test runner to use for end to end (e2e) tests of the remote if it needs to be created.",
|
||||
"description": "Test runner to use for end to end (e2e) tests of the Producer (remote) if it needs to be created.",
|
||||
"default": "cypress"
|
||||
},
|
||||
"standalone": {
|
||||
"description": "Whether to generate the remote application with standalone components if it needs to be created.",
|
||||
"description": "Whether to generate the Producer (remote) application with standalone components if it needs to be created.",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "The host / shell application for this remote."
|
||||
"description": "The Consumer (host) application for this Producer (remote).",
|
||||
"alias": "consumer"
|
||||
}
|
||||
},
|
||||
"required": ["name", "path", "remote"],
|
||||
|
||||
@@ -5,13 +5,17 @@
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"$id": "NxMFHost",
|
||||
"cli": "nx",
|
||||
"title": "Nx Module Federation Host Application",
|
||||
"description": "Create an Angular Host Module Federation Application.",
|
||||
"title": "Nx Module Federation Consumer (Host) Application",
|
||||
"description": "Create an Angular Consumer (Host) Module Federation Application.",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nx/angular:host appName --remotes=remote1",
|
||||
"description": "Create an Angular application with configuration in place for Module Federation. If the `remotes` option is provided, attach the remote application to this application's configuration"
|
||||
"description": "Create an Angular application with configuration in place for Module Federation. If the `remotes` option is provided, attach the Producer (remote) application to this application's configuration"
|
||||
},
|
||||
{
|
||||
"command": "nx g @nx/angular:consumer appName --producers=remote1",
|
||||
"description": "Create an Angular application with configuration in place for Module Federation. If the `producers` option is provided, attach the Producer (remote) application to this application's configuration"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
@@ -23,14 +27,15 @@
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name to give to the host Angular application.",
|
||||
"description": "The name to give to the Consumer (host) Angular application.",
|
||||
"pattern": "^[a-zA-Z][^:]*$",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"remotes": {
|
||||
"type": "array",
|
||||
"description": "The names of the remote applications to add to the host.",
|
||||
"x-priority": "important"
|
||||
"description": "The names of the Producers (remote) applications to add to the Consumer (host).",
|
||||
"x-priority": "important",
|
||||
"alias": "producers"
|
||||
},
|
||||
"dynamic": {
|
||||
"type": "boolean",
|
||||
@@ -160,15 +165,19 @@
|
||||
},
|
||||
"standalone": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to generate a host application that uses standalone components.",
|
||||
"description": "Whether to generate a Consumer (host) application that uses standalone components.",
|
||||
"default": true
|
||||
},
|
||||
"ssr": {
|
||||
"description": "Whether to configure SSR for the host application",
|
||||
"description": "Whether to configure SSR for the Consumer (host) application",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"x-priority": "important"
|
||||
},
|
||||
"serverRouting": {
|
||||
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"typescriptConfiguration": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the module federation configuration and webpack configuration files should use TS.",
|
||||
@@ -181,8 +190,8 @@
|
||||
},
|
||||
"x-type": "application",
|
||||
"description": "Generate a Host Angular Module Federation Application.",
|
||||
"aliases": ["consumer"],
|
||||
"implementation": "/packages/angular/src/generators/host/host.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/packages/angular/src/generators/host/schema.json",
|
||||
"type": "generator"
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["directory"],
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Library\" %}\n\nCreates the `my-ui-lib` library with an `ui` tag:\n\n```bash\nnx g @nx/angular:library libs/my-ui-lib --tags=ui\n```\n\n{% /tab %}\n\n{% tab label=\"Publishable Library\" %}\n\nCreates the `my-lib` library that can be built producing an output following the Angular Package Format (APF) to be distributed as an NPM package:\n\n```bash\nnx g @nx/angular:library libs/my-lib --publishable --import-path=@my-org/my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable Library\" %}\n\nCreates the `my-lib` library with support for incremental builds:\n\n```bash\nnx g @nx/angular:library libs/my-lib --buildable\n```\n\n{% /tab %}\n\n{% tab label=\"Nested Folder & Import\"%}\nCreates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/angular:library libs/nested/my-lib --importPath=@myorg/nested/my-lib\n```\n\n{% /tab %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Library\" %}\n\nCreates the `my-ui-lib` library with an `ui` tag:\n\n```bash\nnx g @nx/angular:library libs/my-ui-lib --tags=ui\n```\n\n{% /tab %}\n\n{% tab label=\"Publishable Library\" %}\n\nCreates the `my-lib` library that can be built producing an output following the Angular Package Format (APF) to be distributed as an NPM package:\n\n```bash\nnx g @nx/angular:library libs/my-lib --publishable --import-path=@my-org/my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable Library\" %}\n\nCreates the `my-lib` library with support for incremental builds:\n\n```bash\nnx g @nx/angular:library libs/my-lib --buildable\n```\n\n{% /tab %}\n\n{% tab label=\"Nested Folder & Import\"%}\nCreates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:\n\n```bash\nnx g @nx/angular:library libs/nested/my-lib --importPath=@myorg/nested/my-lib\n```\n\n{% /tab %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["lib"],
|
||||
|
||||
@@ -9,17 +9,30 @@
|
||||
"cli": "nx",
|
||||
"additionalProperties": false,
|
||||
"description": "Creates an Angular pipe.",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate a pipe with the exported symbol matching the file name. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
|
||||
"command": "nx g @nx/angular:pipe mylib/src/lib/foo.pipe.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate a pipe without providing the file extension. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
|
||||
"command": "nx g @nx/angular:pipe mylib/src/lib/foo"
|
||||
},
|
||||
{
|
||||
"description": "Generate a pipe with the exported symbol different from the file name. It results in the pipe `CustomPipe` at `mylib/src/lib/foo.pipe.ts`",
|
||||
"command": "nx g @nx/angular:pipe mylib/src/lib/foo --name=custom"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "The path at which to create the pipe file, relative to the workspace root.",
|
||||
"description": "The file path to the pipe. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What is the path of the new pipe?"
|
||||
"x-prompt": "What is the pipe file path?"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the pipe.",
|
||||
"x-prompt": "What name would you like to use for the pipe?"
|
||||
"description": "The pipe symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"skipTests": {
|
||||
"type": "boolean",
|
||||
|
||||
@@ -5,13 +5,17 @@
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"$id": "NxMFRemote",
|
||||
"cli": "nx",
|
||||
"title": "Nx Module Federation Remote App",
|
||||
"description": "Create an Angular Remote Module Federation Application.",
|
||||
"title": "Nx Module Federation Producer (Remote) App",
|
||||
"description": "Create an Angular Producer (Remote) Module Federation Application.",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nx/angular:remote appName --host=host --port=4201",
|
||||
"description": "Create an Angular app with configuration in place for Module Federation. If host is provided, attach this remote app to host app's configuration."
|
||||
"description": "Create an Angular app with configuration in place for Module Federation. If Consumer (host) is provided, attach this Producer (remote) app to Consumer (host) app's configuration."
|
||||
},
|
||||
{
|
||||
"command": "nx g @nx/angular:producer appName --consumer=host --port=4201",
|
||||
"description": "Create an Angular app with configuration in place for Module Federation. If Consumer (host) is provided, attach this Producer (remote) app to Consumer (host) app's configuration."
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
@@ -23,15 +27,16 @@
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name to give to the remote Angular app.",
|
||||
"description": "The name to give to the Producer (remote) Angular app.",
|
||||
"pattern": "^[a-zA-Z_$][a-zA-Z_$0-9]*$",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "The name of the host app to attach this remote app to.",
|
||||
"description": "The name of the Consumer (host) app to attach this Producer (remote) app to.",
|
||||
"x-dropdown": "projects",
|
||||
"x-priority": "important"
|
||||
"x-priority": "important",
|
||||
"alias": "consumer"
|
||||
},
|
||||
"port": {
|
||||
"type": "number",
|
||||
@@ -153,15 +158,19 @@
|
||||
"x-priority": "internal"
|
||||
},
|
||||
"standalone": {
|
||||
"description": "Whether to generate a remote application with standalone components.",
|
||||
"description": "Whether to generate a Producer (remote) application with standalone components.",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"ssr": {
|
||||
"description": "Whether to configure SSR for the remote application to be consumed by a host application using SSR.",
|
||||
"description": "Whether to configure SSR for the Producer (remote) application to be consumed by a Consumer (host) application using SSR.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"serverRouting": {
|
||||
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"typescriptConfiguration": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the module federation configuration and webpack configuration files should use TS.",
|
||||
@@ -174,8 +183,8 @@
|
||||
},
|
||||
"x-type": "application",
|
||||
"description": "Generate a Remote Angular Module Federation Application.",
|
||||
"aliases": ["producer"],
|
||||
"implementation": "/packages/angular/src/generators/remote/remote.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/packages/angular/src/generators/remote/schema.json",
|
||||
"type": "generator"
|
||||
|
||||
@@ -9,8 +9,16 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nx/angular:scam-directive my-sample --directory=my-lib/src/lib/my-sample",
|
||||
"description": "Generate a `MySampleDirective` directive in a `my-sample` folder in the `my-lib` library"
|
||||
"description": "Generate a directive with the exported symbol matching the file name. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
|
||||
"command": "nx g @nx/angular:scam-directive mylib/src/lib/foo.directive.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate a directive without providing the file extension. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
|
||||
"command": "nx g @nx/angular:scam-directive mylib/src/lib/foo"
|
||||
},
|
||||
{
|
||||
"description": "Generate a directive with the exported symbol different from the file name. It results in the directive `CustomDirective` at `mylib/src/lib/foo.directive.ts`",
|
||||
"command": "nx g @nx/angular:scam-directive mylib/src/lib/foo --name=custom"
|
||||
}
|
||||
],
|
||||
"description": "Creates a new, generic Angular directive definition in the given or default project.",
|
||||
@@ -18,33 +26,13 @@
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "The path at which to create the SCAM Directive files, relative to the workspace root.",
|
||||
"description": "The file path to the SCAM directive. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What is the path of the new directive?"
|
||||
"x-prompt": "What is the SCAM directive file path?"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the directive.",
|
||||
"x-prompt": "What name would you like to use for the directive?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"directory": {
|
||||
"type": "string",
|
||||
"description": "The directory at which to create the SCAM Directive files. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
|
||||
"aliases": ["dir", "path"],
|
||||
"x-priority": "important"
|
||||
},
|
||||
"nameAndDirectoryFormat": {
|
||||
"description": "Whether to generate the component in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
|
||||
"type": "string",
|
||||
"enum": ["as-provided", "derived"]
|
||||
},
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "The name of the project.",
|
||||
"$default": { "$source": "projectName" },
|
||||
"x-dropdown": "projects",
|
||||
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
|
||||
"description": "The directive symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"skipTests": {
|
||||
"type": "boolean",
|
||||
@@ -57,12 +45,6 @@
|
||||
"default": true,
|
||||
"x-priority": "important"
|
||||
},
|
||||
"flat": {
|
||||
"type": "boolean",
|
||||
"description": "Create the new files at the top level of the current project.",
|
||||
"default": true,
|
||||
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
||||
},
|
||||
"selector": {
|
||||
"type": "string",
|
||||
"format": "html-selector",
|
||||
|
||||
@@ -9,8 +9,16 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nx/angular:scam-pipe mylib/src/lib/my-transformation/my-transformation",
|
||||
"description": "Generates a `MyTransformationPipe` in a `my-transformation` folder in the `my-lib` project"
|
||||
"description": "Generate a pipe with the exported symbol matching the file name. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
|
||||
"command": "nx g @nx/angular:scam-pipe mylib/src/lib/foo.pipe.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate a pipe without providing the file extension. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
|
||||
"command": "nx g @nx/angular:scam-pipe mylib/src/lib/foo"
|
||||
},
|
||||
{
|
||||
"description": "Generate a pipe with the exported symbol different from the file name. It results in the pipe `CustomPipe` at `mylib/src/lib/foo.pipe.ts`",
|
||||
"command": "nx g @nx/angular:scam-pipe mylib/src/lib/foo --name=custom"
|
||||
}
|
||||
],
|
||||
"description": "Creates a new, generic Angular pipe definition in the given or default project.",
|
||||
@@ -18,15 +26,13 @@
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "The path at which to create the pipe file, relative to the workspace root.",
|
||||
"description": "The file path to the SCAM pipe. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What is the path of the new pipe?"
|
||||
"x-prompt": "What is the SCAM pipe file path?"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the pipe.",
|
||||
"x-prompt": "What name would you like to use for the pipe?",
|
||||
"x-priority": "important"
|
||||
"description": "The pipe symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"skipTests": {
|
||||
"type": "boolean",
|
||||
@@ -39,12 +45,6 @@
|
||||
"default": true,
|
||||
"x-priority": "important"
|
||||
},
|
||||
"flat": {
|
||||
"type": "boolean",
|
||||
"description": "Create the new files at the top level of the current project.",
|
||||
"default": true,
|
||||
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
||||
},
|
||||
"export": {
|
||||
"type": "boolean",
|
||||
"description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.",
|
||||
|
||||
@@ -9,8 +9,16 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nx/angular:scam my-lib/src/lib/my-sample/my-sample",
|
||||
"description": "Generate a `MySampleComponent` component in the `my-lib` library."
|
||||
"description": "Generate a component with the exported symbol matching the file name. It results in the component `FooComponent` at `mylib/src/lib/foo.component.ts`",
|
||||
"command": "nx g @nx/angular:scam mylib/src/lib/foo.component.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate a component without providing the file extension. It results in the component `FooComponent` at `mylib/src/lib/foo.component.ts`",
|
||||
"command": "nx g @nx/angular:scam mylib/src/lib/foo"
|
||||
},
|
||||
{
|
||||
"description": "Generate a component with the exported symbol different from the file name. It results in the component `CustomComponent` at `mylib/src/lib/foo.component.ts`",
|
||||
"command": "nx g @nx/angular:scam mylib/src/lib/foo --name=custom"
|
||||
}
|
||||
],
|
||||
"description": "Creates a new Angular SCAM.",
|
||||
@@ -18,14 +26,13 @@
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "The path at which to create the SCAM file, relative to the workspace root.",
|
||||
"description": "The file path to the SCAM. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What is the path of the new SCAM?"
|
||||
"x-prompt": "What is the SCAM file path?"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the component.",
|
||||
"x-prompt": "What name would you like to use for the component?"
|
||||
"description": "The component symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"displayBlock": {
|
||||
"description": "Specifies if the style will contain `:host { display: block; }`.",
|
||||
|
||||
@@ -34,15 +34,17 @@
|
||||
},
|
||||
"remotes": {
|
||||
"type": "array",
|
||||
"description": "A list of remote application names that the host application should consume."
|
||||
"description": "A list of remote application names that the Consumer (host) application should consume.",
|
||||
"alias": "producers"
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "The name of the host application that the remote application will be consumed by."
|
||||
"description": "The name of the host application that the remote application will be consumed by.",
|
||||
"alias": "consumer"
|
||||
},
|
||||
"routing": {
|
||||
"type": "boolean",
|
||||
"description": "Generate a routing setup to allow a host application to route to the remote application.",
|
||||
"description": "Generate a routing setup to allow a Consumer (host) application to route to the Producer (remote) application.",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"skipFormat": {
|
||||
|
||||
@@ -16,13 +16,6 @@
|
||||
"x-prompt": "What app would you like to generate an Angular Universal configuration for?",
|
||||
"x-dropdown": "projects"
|
||||
},
|
||||
"appId": {
|
||||
"type": "string",
|
||||
"format": "html-selector",
|
||||
"description": "The `appId` to use with `withServerTransition`.",
|
||||
"default": "serverApp",
|
||||
"x-deprecated": "This is deprecated and ignored since Angular 16 and not supported since Angular 17."
|
||||
},
|
||||
"main": {
|
||||
"type": "string",
|
||||
"format": "path",
|
||||
@@ -56,7 +49,12 @@
|
||||
},
|
||||
"hydration": {
|
||||
"type": "boolean",
|
||||
"description": "Set up Hydration for the SSR application. It defaults to `true` for Angular versions >= 17.0.0. Otherwise, it defaults to `false`."
|
||||
"description": "Set up Hydration for the SSR application.",
|
||||
"default": true
|
||||
},
|
||||
"serverRouting": {
|
||||
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"skipFormat": {
|
||||
"type": "boolean",
|
||||
|
||||
@@ -47,10 +47,6 @@ npm add -D @nx/esbuild
|
||||
|
||||
### Creating a new JS library
|
||||
|
||||
{% callout type="note" title="Directory Flag Behavior Changes" %}
|
||||
The command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, omit the `--directory` flag. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.
|
||||
{% /callout %}
|
||||
|
||||
You can add a new library that builds using esbuild with:
|
||||
|
||||
```shell
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
"description": "Create an Expo Application for Nx.",
|
||||
"examples": [
|
||||
{
|
||||
"command": "g @nx/expo:app myapp --directory=nested",
|
||||
"command": "nx g @nx/expo:app myapp --directory=nested",
|
||||
"description": "Generate apps/nested/myapp"
|
||||
},
|
||||
{
|
||||
"command": "g @nx/expo:app myapp --classComponent",
|
||||
"command": "nx g @nx/expo:app myapp --classComponent",
|
||||
"description": "Use class components instead of functional components"
|
||||
}
|
||||
],
|
||||
@@ -44,13 +44,15 @@
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
"enum": ["eslint", "none"],
|
||||
"default": "eslint"
|
||||
"default": "none",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"unitTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["jest", "none"],
|
||||
"description": "Test runner to use for unit tests",
|
||||
"default": "jest"
|
||||
"default": "none",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"tags": {
|
||||
"type": "string",
|
||||
@@ -71,7 +73,8 @@
|
||||
"description": "Adds the specified e2e test runner",
|
||||
"type": "string",
|
||||
"enum": ["playwright", "cypress", "detox", "none"],
|
||||
"default": "none"
|
||||
"default": "none",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"standaloneConfig": {
|
||||
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
||||
|
||||
@@ -9,31 +9,37 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "g @nx/expo:component mylib/my-component --name my-component",
|
||||
"description": "Generate a component in the mylib library"
|
||||
"description": "Generate a component with the exported symbol matching the file name. It results in the component `Foo` at `mylib/src/foo.tsx`",
|
||||
"command": "nx g @nx/expo:component mylib/src/foo.tsx"
|
||||
},
|
||||
{
|
||||
"command": "g @nx/expo:component mylib/my-component --name my-component --classComponent",
|
||||
"description": "Generate a class component in the mylib library"
|
||||
"description": "Generate a component with the exported symbol different from the file name. It results in the component `Custom` at `mylib/src/foo.tsx`",
|
||||
"command": "nx g @nx/expo:component mylib/src/foo.tsx --name=custom"
|
||||
},
|
||||
{
|
||||
"description": "Generate a component without the providing the file extension. It results in the component `Foo` at `mylib/src/foo.tsx`",
|
||||
"command": "nx g @nx/expo:component mylib/src/foo"
|
||||
},
|
||||
{
|
||||
"description": "Generate a class component at `mylib/src/foo.tsx`",
|
||||
"command": "nx g @nx/expo:component mylib/src/foo --classComponent"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the component will be generated.",
|
||||
"description": "The file path to the component. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the component be generated?",
|
||||
"x-priority": "important"
|
||||
"x-prompt": "What is the component file path?"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the component.",
|
||||
"x-prompt": "What name would you like to use for the component?"
|
||||
"description": "The component symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"js": {
|
||||
"type": "boolean",
|
||||
"description": "Generate JavaScript files rather than TypeScript files.",
|
||||
"default": false
|
||||
"x-deprecated": "Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21."
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "g @nx/expo:lib mylib --directory=myapp",
|
||||
"command": "nx g @nx/expo:lib mylib --directory=myapp",
|
||||
"description": "Generate libs/myapp/mylib"
|
||||
}
|
||||
],
|
||||
@@ -29,13 +29,16 @@
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
"enum": ["eslint", "none"],
|
||||
"default": "eslint"
|
||||
"default": "none",
|
||||
"x-prompt": "Which linter would you like to use?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"unitTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["jest", "none"],
|
||||
"description": "Test runner to use for unit tests.",
|
||||
"default": "jest"
|
||||
"default": "none",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"tags": {
|
||||
"type": "string",
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["directory"],
|
||||
"examplesFile": "---\ntitle: JS library generator examples\ndescription: This page contains examples for the @nx/js:lib generator.\n---\n\nThe `@nx/js:lib` generator will generate a library for you, and it will configure it according to the options you provide.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib\n```\n\nBy default, the library that is generated when you use this executor without passing any options, like the example above, will be a buildable library, using the `@nx/js:tsc` executor as a builder.\n\nYou may configure the tools you want to use to build your library, or bundle it too, by passing the `--bundler` flag. The `--bundler` flag controls the compiler and/or the bundler that will be used to build your library. If you choose `tsc` or `swc`, the result will be a buildable library using either `tsc` or `swc` as the compiler. If you choose `rollup` or `vite`, the result will be a buildable library using `rollup` or `vite` as the bundler. In the case of `rollup`, it will default to the `tsc` compiler. If you choose `esbuild`, you may use the [`esbuildOptions` property](https://esbuild.github.io/api/) in your `project.json` under the `build` target options to specify whether you wish to bundle your library or not.\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Buildable with default compiler (tsc)\" %}\n\nGenerate a buildable library using the `@nx/js:tsc` executor. This uses `tsc` as the compiler.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with SWC compiler\" %}\n\nGenerate a buildable library using [SWC](https://swc.rs) as the compiler. This will use the `@nx/js:swc` executor.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=swc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with tsc\" %}\n\nGenerate a buildable library using tsc as the compiler. This will use the `@nx/js:tsc` executor.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=tsc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Rollup as a bundler\" %}\n\nGenerate a buildable library using [Rollup](https://rollupjs.org) as the bundler. This will use the `@nx/rollup:rollup` executor. It will also use [SWC](https://swc.rs) as the compiler.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=rollup\n```\n\nIf you do not want to use `swc` as the compiler, and want to use the default `babel` compiler, you can do so in your `project.json` under the `build` target options, using the [`compiler` property](/nx-api/rollup/executors/rollup#compiler):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/rollup:rollup\",\n \"options\": {\n //...\n \"compiler\": \"babel\"\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Vite as a bundler\" %}\n\nGenerate a buildable library using [Vite](https://vitejs.dev/) as the bundler. This will use the `@nx/vite:build` executor.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Using ESBuild\" %}\n\nGenerate a buildable library using [ESBuild](https://esbuild.github.io/) as the bundler. This will use the `@nx/esbuild:esbuild` executor.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=esbuild\n```\n\nIf you want to specify whether you want to bundle your library or not, you can do so in your `project.json` under the `build` target options, using the [`esbuildOptions` property](https://esbuild.github.io/api/):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n //...\n \"esbuildOptions\": {\n \"bundle\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Minimal publishing target\" %}\n\nGenerate a **publishable** library with a minimal publishing target. The result will be a buildable library using the `@nx/js:tsc` executor, using `tsc` as the compiler. You can change the compiler or the bundler by passing the `--bundler` flag.\n\n```bash\nnpx nx g lib libs/mylib --publishable\n```\n\n{% /tab %}\n\n{% tab label=\"Using directory flag\" %}\n\nGenerate a library named `mylib` and put it under a directory named `myapp` (`libs/myapp/mylib`)\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=myapp`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```shell\nnpx nx g lib libs/nested/mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Non-buildable library\" %}\n\nGenerate a non-buildable library.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=none\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
|
||||
"examplesFile": "---\ntitle: JS library generator examples\ndescription: This page contains examples for the @nx/js:lib generator.\n---\n\nThe `@nx/js:lib` generator will generate a library for you, and it will configure it according to the options you provide.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib\n```\n\nBy default, the library that is generated when you use this executor without passing any options, like the example above, will be a buildable library, using the `@nx/js:tsc` executor as a builder.\n\nYou may configure the tools you want to use to build your library, or bundle it too, by passing the `--bundler` flag. The `--bundler` flag controls the compiler and/or the bundler that will be used to build your library. If you choose `tsc` or `swc`, the result will be a buildable library using either `tsc` or `swc` as the compiler. If you choose `rollup` or `vite`, the result will be a buildable library using `rollup` or `vite` as the bundler. In the case of `rollup`, it will default to the `tsc` compiler. If you choose `esbuild`, you may use the [`esbuildOptions` property](https://esbuild.github.io/api/) in your `project.json` under the `build` target options to specify whether you wish to bundle your library or not.\n\n## Examples\n\n{% tabs %}\n\n{% tab label=\"Buildable with default compiler (tsc)\" %}\n\nGenerate a buildable library using the `@nx/js:tsc` executor. This uses `tsc` as the compiler.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with SWC compiler\" %}\n\nGenerate a buildable library using [SWC](https://swc.rs) as the compiler. This will use the `@nx/js:swc` executor.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=swc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable with tsc\" %}\n\nGenerate a buildable library using tsc as the compiler. This will use the `@nx/js:tsc` executor.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=tsc\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Rollup as a bundler\" %}\n\nGenerate a buildable library using [Rollup](https://rollupjs.org) as the bundler. This will use the `@nx/rollup:rollup` executor. It will also use [SWC](https://swc.rs) as the compiler.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=rollup\n```\n\nIf you do not want to use `swc` as the compiler, and want to use the default `babel` compiler, you can do so in your `project.json` under the `build` target options, using the [`compiler` property](/nx-api/rollup/executors/rollup#compiler):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/rollup:rollup\",\n \"options\": {\n //...\n \"compiler\": \"babel\"\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable, with Vite as a bundler\" %}\n\nGenerate a buildable library using [Vite](https://vitejs.dev/) as the bundler. This will use the `@nx/vite:build` executor.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=vite\n```\n\n{% /tab %}\n\n{% tab label=\"Using ESBuild\" %}\n\nGenerate a buildable library using [ESBuild](https://esbuild.github.io/) as the bundler. This will use the `@nx/esbuild:esbuild` executor.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=esbuild\n```\n\nIf you want to specify whether you want to bundle your library or not, you can do so in your `project.json` under the `build` target options, using the [`esbuildOptions` property](https://esbuild.github.io/api/):\n\n```jsonc {% fileName=\"libs/mylib/project.json\" %}\n\"build\": {\n \"executor\": \"@nx/esbuild:esbuild\",\n \"options\": {\n //...\n \"esbuildOptions\": {\n \"bundle\": true\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Minimal publishing target\" %}\n\nGenerate a **publishable** library with a minimal publishing target. The result will be a buildable library using the `@nx/js:tsc` executor, using `tsc` as the compiler. You can change the compiler or the bundler by passing the `--bundler` flag.\n\n```bash\nnpx nx g lib libs/mylib --publishable\n```\n\n{% /tab %}\n\n{% tab label=\"In a nested directory\" %}\n\nGenerate a library named `mylib` and put it under a directory named `nested` (`libs/nested/mylib`).\n\n```shell\nnpx nx g lib libs/nested/mylib\n```\n\n{% /tab %}\n\n{% tab label=\"Non-buildable library\" %}\n\nGenerate a non-buildable library.\n\n```bash\nnpx nx g @nx/js:lib libs/mylib --bundler=none\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["lib"],
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Class Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the class `Foo` at `myapp/src/app/foo.ts`",
|
||||
"command": "nx g @nx/nest:class myapp/src/app/foo.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the class without providing the file extension. It results in the class `Foo` at `myapp/src/app/foo.ts`",
|
||||
"command": "nx g @nx/nest:class myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the class will be generated.",
|
||||
"description": "The file path to the class. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the class be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the class.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the class file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
@@ -32,12 +37,6 @@
|
||||
"enum": ["jest", "none"],
|
||||
"default": "jest"
|
||||
},
|
||||
"flat": {
|
||||
"description": "Flag to indicate if a directory is created.",
|
||||
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"language": {
|
||||
"description": "Nest class language.",
|
||||
"type": "string",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Controller Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the controller `FooController` at `myapp/src/app/foo.controller.ts`",
|
||||
"command": "nx g @nx/nest:controller myapp/src/app/foo.controller.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the controller without providing the file extension. It results in the controller `FooController` at `myapp/src/app/foo.controller.ts`",
|
||||
"command": "nx g @nx/nest:controller myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the controller will be generated.",
|
||||
"description": "The file path to the controller. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the controller be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the controller.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the controller file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Decorator Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the decorator `Foo` at `myapp/src/app/foo.decorator.ts`",
|
||||
"command": "nx g @nx/nest:decorator myapp/src/app/foo.decorator.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the decorator without providing the file extension. It results in the decorator `Foo` at `myapp/src/app/foo.decorator.ts`",
|
||||
"command": "nx g @nx/nest:decorator myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the decorator will be generated.",
|
||||
"description": "The file path to the decorator. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the decorator be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the decorator.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the decorator file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Filter Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the filter `FooFilter` at `myapp/src/app/foo.filter.ts`",
|
||||
"command": "nx g @nx/nest:filter myapp/src/app/foo.filter.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the filter without providing the file extension. It results in the filter `FooFilter` at `myapp/src/app/foo.filter.ts`",
|
||||
"command": "nx g @nx/nest:filter myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the filter will be generated.",
|
||||
"description": "The file path to the filter. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the filter be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the filter.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the filter file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"type": "boolean",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Gateway Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the gateway `FooGateway` at `myapp/src/app/foo.gateway.ts`",
|
||||
"command": "nx g @nx/nest:gateway myapp/src/app/foo.gateway.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the gateway without providing the file extension. It results in the gateway `FooGateway` at `myapp/src/app/foo.gateway.ts`",
|
||||
"command": "nx g @nx/nest:gateway myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the gateway will be generated.",
|
||||
"description": "The file path to the gateway. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the gateway be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the gateway.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the gateway file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Guard Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the guard `FooGuard` at `myapp/src/app/foo.guard.ts`",
|
||||
"command": "nx g @nx/nest:guard myapp/src/app/foo.guard.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the guard without providing the file extension. It results in the guard `FooGuard` at `myapp/src/app/foo.guard.ts`",
|
||||
"command": "nx g @nx/nest:guard myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the guard will be generated.",
|
||||
"description": "The file path to the guard. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the guard be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the guard.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the guard file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
@@ -39,7 +44,7 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["name"],
|
||||
"required": ["path"],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Run the `guard` NestJS generator with Nx project support.",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Interceptor Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the interceptor `FooInterceptor` at `myapp/src/app/foo.interceptor.ts`",
|
||||
"command": "nx g @nx/nest:interceptor myapp/src/app/foo.interceptor.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the interceptor without providing the file extension. It results in the interceptor `FooInterceptor` at `myapp/src/app/foo.interceptor.ts`",
|
||||
"command": "nx g @nx/nest:interceptor myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the interceptor will be generated.",
|
||||
"description": "The file path to the interceptor. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the interceptor be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the interceptor.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the interceptor file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
@@ -39,7 +44,7 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["name"],
|
||||
"required": ["path"],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Run the `interceptor` NestJS generator with Nx project support.",
|
||||
|
||||
@@ -8,29 +8,28 @@
|
||||
"description": "Nest Interface Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the interface `Foo` at `myapp/src/app/foo.interface.ts`",
|
||||
"command": "nx g @nx/nest:interface myapp/src/app/foo.interface.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the interface without providing the file extension. It results in the interface `Foo` at `myapp/src/app/foo.interface.ts`",
|
||||
"command": "nx g @nx/nest:interface myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the interface will be generated.",
|
||||
"description": "The file path to the interface. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the interface be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the interface.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the interface file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"x-priority": "internal"
|
||||
},
|
||||
"flat": {
|
||||
"description": "Flag to indicate if a directory is created.",
|
||||
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Middleware Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the middleware `FooMiddleware` at `myapp/src/app/foo.middleware.ts`",
|
||||
"command": "nx g @nx/nest:middleware myapp/src/app/foo.middleware.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the middleware without providing the file extension. It results in the middleware `FooMiddleware` at `myapp/src/app/foo.middleware.ts`",
|
||||
"command": "nx g @nx/nest:middleware myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the middleware will be generated.",
|
||||
"description": "The file path to the middleware. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the middleware be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the middleware.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the middleware file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Module Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the module `FooModule` at `myapp/src/app/foo.module.ts`",
|
||||
"command": "nx g @nx/nest:module myapp/src/app/foo.module.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the module without providing the file extension. It results in the module `FooModule` at `myapp/src/app/foo.module.ts`",
|
||||
"command": "nx g @nx/nest:module myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the module will be generated.",
|
||||
"description": "The file path to the module. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the module be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the module.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the module file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Pipe Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the pipe `FooPipe` at `myapp/src/app/foo.pipe.ts`",
|
||||
"command": "nx g @nx/nest:pipe myapp/src/app/foo.pipe.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the pipe without providing the file extension. It results in the pipe `FooPipe` at `myapp/src/app/foo.pipe.ts`",
|
||||
"command": "nx g @nx/nest:pipe myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the pipe will be generated.",
|
||||
"description": "The file path to the pipe. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the pipe be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the pipe.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the pipe file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Provider Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the provider `Foo` at `myapp/src/app/foo.ts`",
|
||||
"command": "nx g @nx/nest:provider myapp/src/app/foo.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the provider without providing the file extension. It results in the provider `Foo` at `myapp/src/app/foo.ts`",
|
||||
"command": "nx g @nx/nest:provider myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the provider will be generated.",
|
||||
"description": "The file path to the provider. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the provider be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the provider.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the provider file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Resolver Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the resolver `FooResolver` at `myapp/src/app/foo.resolver.ts`",
|
||||
"command": "nx g @nx/nest:resolver myapp/src/app/foo.resolver.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the resolver without providing the file extension. It results in the resolver `FooResolver` at `myapp/src/app/foo.resolver.ts`",
|
||||
"command": "nx g @nx/nest:resolver myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the resolver will be generated.",
|
||||
"description": "The file path to the resolver. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the resolver be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the resolver.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the resolver file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -8,17 +8,18 @@
|
||||
"description": "Nest Resource Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate `myapp/src/app/entities/foo.entity.ts`, `myapp/src/app/dto/create-foo.dto.ts`, `myapp/src/app/dto/update-foo.dto.ts`, `myapp/src/app/foo.service.ts`, `myapp/src/app/foo.controller.ts`, and `myapp/src/app/foo.module.ts`",
|
||||
"command": "nx g @nx/nest:resource myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the resource will be generated.",
|
||||
"description": "The file path to the resource. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the resource be generated?"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the resource.",
|
||||
"x-prompt": "What name would you like to use for this resource (plural, e.g., `users`)?"
|
||||
"x-prompt": "What is the resource file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
@@ -32,11 +33,6 @@
|
||||
"enum": ["jest", "none"],
|
||||
"default": "jest"
|
||||
},
|
||||
"language": {
|
||||
"description": "Nest class language.",
|
||||
"type": "string",
|
||||
"enum": ["js", "ts"]
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "The transport layer.",
|
||||
|
||||
@@ -8,17 +8,22 @@
|
||||
"description": "Nest Service Options Schema.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate the service `FooService` at `myapp/src/app/foo.service.ts`",
|
||||
"command": "nx g @nx/nest:service myapp/src/app/foo.service.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate the service without providing the file extension. It results in the service `FooService` at `myapp/src/app/foo.service.ts`",
|
||||
"command": "nx g @nx/nest:service myapp/src/app/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the service will be generated.",
|
||||
"description": "The file path to the service. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the service be generated?"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the service.",
|
||||
"type": "string",
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the service file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["buildTarget"],
|
||||
"examplesFile": "---\ntitle: Next.js server executor examples\ndescription: This page contains examples for the @nx/next:serve executor.\n---\n\n`project.json`:\n\n```json\n//...\n{\n \"name\": \"acme\",\n \"$schema\": \"node_modules/nx/schemas/project-schema.json\",\n \"sourceRoot\": \".\",\n \"projectType\": \"application\",\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n }\n }\n //...\n }\n}\n```\n\n```bash\nnx run acme:serve\n```\n\n## Examples\n\n### For Next.js Standalone projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Next.js standalone projects. Our `@nx/next:server` executor is integrated to use Next.js' CLI. You can read more about the serve options at [Next.js CLI Options](https://nextjs.org/docs/app/api-reference/next-cli)\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true\n },\n \"production\": {\n \"buildTarget\": \"acme:build:production\",\n \"dev\": false\n }\n }\n },\n```\n\n{% /tab %}\n{% tab label=\"Enable turbo\" %}\n\nTurbopack (beta) is a cutting-edge bundler designed for JavaScript and TypeScript. To read more about support features see [Next.js Turbopack Doucmentation](https://turbo.build/pack/docs/features)\n\nIn the context of Nx, you can utilize Turbopack within both the `pages` and `app` directories of Next.js to enhance local development speed. To activate Turbopack, simply:\n\nAppend the `--turbo` flag while executing the Nx development server.\n\n```shell\nnx run acme:serve --turbo\n```\n\nUpdating the build options to include `turbo`.\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true,\n \"turbo\": true\n },\n //\n }\n }\n```\n\n```bash\nnx run acme:serve\n```\n\n{% /tab %}\n\n{% tab label=\"Adding keep alive timeout\" %}\n\nWhen using Nx with Next.js behind a downstream proxy, it's important to make sure that the `keep-alive timeouts` of Next.js' HTTP server are set to longer durations than the timeouts of the proxy. If you don't do this, Node.js will unexpectedly end TCP connections without notifying the proxy when the `keep-alive timeout` is reached. This can lead to a proxy error when the proxy tries to reuse a connection that Node.js has already terminated.\n\nTo configure timeout values (in milliseconds) you can:\n\nPass `--keepAliveTimeout`\n\n```shell\nnx run acme:serve --keepAliveTimeout 60000\n```\n\nUpdating the serve options to include `keepAliveTimeout`.\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true,\n \"keepAliveTimeout\": 60000\n },\n //\n }\n }\n```\n\n```shell\nnx run acme:serve\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
|
||||
"examplesFile": "---\ntitle: Next.js server executor examples\ndescription: This page contains examples for the @nx/next:serve executor.\n---\n\n`project.json`:\n\n```json\n//...\n{\n \"name\": \"acme\",\n \"$schema\": \"node_modules/nx/schemas/project-schema.json\",\n \"sourceRoot\": \".\",\n \"projectType\": \"application\",\n \"targets\": {\n //...\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"production\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n }\n }\n //...\n }\n}\n```\n\n```bash\nnx run acme:serve\n```\n\n## Examples\n\n### For Next.js Standalone projects\n\n{% tabs %}\n{% tab label=\"Default configuration\" %}\n\nThis is the default configuration for Next.js standalone projects. Our `@nx/next:server` executor is integrated to use Next.js' CLI. You can read more about the serve options at [Next.js CLI Options](https://nextjs.org/docs/app/api-reference/next-cli)\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true\n },\n \"production\": {\n \"buildTarget\": \"acme:build:production\",\n \"dev\": false\n }\n }\n },\n```\n\n{% /tab %}\n{% tab label=\"Enable turbo\" %}\n\nTurbopack (beta) is a cutting-edge bundler designed for JavaScript and TypeScript. To read more about support features see [Next.js Turbopack Documentation](https://turbo.build/pack/docs/features)\n\nIn the context of Nx, you can utilize Turbopack within both the `pages` and `app` directories of Next.js to enhance local development speed. To activate Turbopack, simply:\n\nAppend the `--turbo` flag while executing the Nx development server.\n\n```shell\nnx run acme:serve --turbo\n```\n\nUpdating the build options to include `turbo`.\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true,\n \"turbo\": true\n },\n //\n }\n }\n```\n\n```bash\nnx run acme:serve\n```\n\n{% /tab %}\n\n{% tab label=\"Adding keep alive timeout\" %}\n\nWhen using Nx with Next.js behind a downstream proxy, it's important to make sure that the `keep-alive timeouts` of Next.js' HTTP server are set to longer durations than the timeouts of the proxy. If you don't do this, Node.js will unexpectedly end TCP connections without notifying the proxy when the `keep-alive timeout` is reached. This can lead to a proxy error when the proxy tries to reuse a connection that Node.js has already terminated.\n\nTo configure timeout values (in milliseconds) you can:\n\nPass `--keepAliveTimeout`\n\n```shell\nnx run acme:serve --keepAliveTimeout 60000\n```\n\nUpdating the serve options to include `keepAliveTimeout`.\n\n```json\n \"serve\": {\n \"executor\": \"@nx/next:server\",\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"buildTarget\": \"acme:build\",\n \"dev\": true\n },\n \"configurations\": {\n \"development\": {\n \"buildTarget\": \"acme:build:development\",\n \"dev\": true,\n \"keepAliveTimeout\": 60000\n },\n //\n }\n }\n```\n\n```shell\nnx run acme:serve\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"description": "Serve a Next.js application.",
|
||||
|
||||
@@ -63,8 +63,10 @@
|
||||
"linter": {
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
"enum": ["eslint"],
|
||||
"default": "eslint"
|
||||
"enum": ["eslint", "none"],
|
||||
"default": "none",
|
||||
"x-prompt": "Which linter would you like to use?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
@@ -76,7 +78,9 @@
|
||||
"type": "string",
|
||||
"enum": ["jest", "none"],
|
||||
"description": "Test runner to use for unit tests.",
|
||||
"default": "jest"
|
||||
"default": "none",
|
||||
"x-prompt": "What unit test runner should be used?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"e2eTestRunner": {
|
||||
"type": "string",
|
||||
@@ -137,7 +141,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["directory"],
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create app in a directory\" %}\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```shell\nnx g app apps/nested/myapp\n```\n\n{% /tab %}\n{% tab label=\"Use a custom Express server\" %}\n\n```shell\nnx g app apps/myapp --custom-server\n```\n\n{% /tab %}\n{% tab label=\"Use plain JavaScript (not TypeScript)\" %}\n\n```shell\nnx g app apps/myapp --js\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create app in a nested directory\" %}\n\n```shell\nnx g app apps/nested/myapp\n```\n\n{% /tab %}\n{% tab label=\"Use a custom Express server\" %}\n\n```shell\nnx g app apps/myapp --custom-server\n```\n\n{% /tab %}\n{% tab label=\"Use plain JavaScript (not TypeScript)\" %}\n\n```shell\nnx g app apps/myapp --js\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["app"],
|
||||
|
||||
@@ -11,16 +11,14 @@
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the component will be generated.",
|
||||
"description": "The file path to the component. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the component be generated?",
|
||||
"x-prompt": "What is the component file path?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the component.",
|
||||
"x-prompt": "What name would you like to use for the component?",
|
||||
"x-priority": "important"
|
||||
"description": "The component symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"style": {
|
||||
"description": "The file extension to be used for style files.",
|
||||
@@ -71,7 +69,7 @@
|
||||
"js": {
|
||||
"type": "boolean",
|
||||
"description": "Generate JavaScript files rather than TypeScript files.",
|
||||
"default": false
|
||||
"x-deprecated": "Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21."
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
@@ -81,7 +79,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["path"],
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create an app component\" %}\n\n```shell\nnx g component apps/my-app/src/lib/my-cmp/my-cmp\n```\n\n{% /tab %}\n{% tab label=\"Create a component without its own folder\" %}\n\nRunning the following will create a component under `apps/my-app/components/my-cmp.tsx` rather than `apps/my-app/components/my-cmp/my-cmp.tsx`.\n\n```shell\nnx g component apps/my-app/src/lib/my-cmp\n```\n\n{% /tab %}\n{% tab label=\"Create component in a custom directory\" %}\n\nRunning the following will create a component under `apps/my-app/foo/my-cmp.tsx` rather than `apps/my-app/my-cmp/my-cmp.tsx`.\n\n```shell\nnx g component apps/my-app/foo/my-cmp\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create a Component\" %}\n\nGenerate a component named `MyComponent` at `apps/my-app/src/app/my-component/my-component.tsx`:\n\n```shell\nnx g component apps/my-app/src/app/my-component/my-component.tsx\n```\n\n{% /tab %}\n{% tab label=\"Create a Component with a Different Symbol Name\" %}\n\nGenerate a component named `Custom` at `apps/my-app/src/app/my-component/my-component.tsx`:\n\n```shell\nnx g component apps/my-app/src/app/my-component/my-component.tsx --name=custom\n```\n\n{% /tab %}\n{% tab label=\"Create a Component Omitting the File Extension\" %}\n\nGenerate a component named `MyComponent` at `apps/my-app/src/app/my-component/my-component.tsx` without specifying the file extension:\n\n```shell\nnx g component apps/my-app/src/app/my-component/my-component\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"description": "Create a component.",
|
||||
|
||||
@@ -56,17 +56,29 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"bundler": {
|
||||
"type": "string",
|
||||
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
|
||||
"enum": ["none", "vite", "rollup"],
|
||||
"default": "none",
|
||||
"x-prompt": "Which bundler would you like to use to build the library? Choose 'none' to skip build setup.",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"linter": {
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
"enum": ["eslint"],
|
||||
"default": "eslint"
|
||||
"enum": ["eslint", "none"],
|
||||
"default": "none",
|
||||
"x-prompt": "Which linter would you like to use?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"unitTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["vitest", "jest", "none"],
|
||||
"description": "Test runner to use for unit tests.",
|
||||
"default": "vitest"
|
||||
"default": "none",
|
||||
"x-prompt": "What unit test runner should be used?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"tags": {
|
||||
"type": "string",
|
||||
@@ -99,7 +111,8 @@
|
||||
"buildable": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Generate a buildable library."
|
||||
"description": "Generate a buildable library that uses rollup to bundle.",
|
||||
"x-deprecated": "Use the `bundler` option for greater control (none, vite, rollup)."
|
||||
},
|
||||
"importPath": {
|
||||
"type": "string",
|
||||
|
||||
@@ -11,16 +11,14 @@
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the page will be generated.",
|
||||
"description": "The path to the directory where the page will be generated. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the page be generated?",
|
||||
"x-prompt": "Which directory do you want to create the page in?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the page.",
|
||||
"x-prompt": "What name would you like to use for the page?",
|
||||
"x-priority": "important"
|
||||
"description": "The page symbol name. Defaults to the page directory name."
|
||||
},
|
||||
"style": {
|
||||
"description": "The file extension to be used for style files.",
|
||||
@@ -73,12 +71,6 @@
|
||||
"description": "Generate JavaScript files rather than TypeScript files.",
|
||||
"default": false
|
||||
},
|
||||
"flat": {
|
||||
"type": "boolean",
|
||||
"description": "Create component at the source root rather than its own directory.",
|
||||
"default": false,
|
||||
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
"type": "boolean",
|
||||
@@ -87,7 +79,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["path"],
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create static page in an app\" %}\n\n```shell\nnx g page apps/my-app/pages/my-page\n```\n\n{% /tab %}\n{% tab label=\"Create dynamic page in an app\" %}\n\nThe following creates a page under `apps/my-app/pages/products/[id].tsx`.\n\n```shell\nnx g page \"apps/my-app/pages/products/[id]\"\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create a Static Page\" %}\n\nGenerate a static page named `MyPage` at `apps/my-app/pages/my-page/page.tsx`:\n\n```shell\nnx g page apps/my-app/pages/my-page\n```\n\n{% /tab %}\n{% tab label=\"Create a Dynamic Page\" %}\n\nGenerate a dynamic page at `apps/my-app/pages/products/[id]/page.tsx`:\n\n```shell\nnx g page \"apps/my-app/pages/products/[id]\"\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"description": "Create a page.",
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["directory"],
|
||||
"examplesFile": "---\ntitle: Nuxt application generator examples\ndescription: This page contains examples for the @nx/nuxt:app generator.\n---\n\nYour new Nuxt application will be generated with the following directory structure, following the suggested [directory structure](https://nuxt.com/docs/guide/directory-structure) for Nuxt applications:\n\n```text\nmy-nuxt-app\n├── nuxt.config.ts\n├── project.json\n├── src\n│ ├── app.vue\n│ ├── assets\n│ │ └── css\n│ │ └── styles.css\n│ ├── components\n│ │ └── NxWelcome.vue\n│ ├── pages\n│ │ ├── about.vue\n│ │ └── index.vue\n│ ├── public\n│ │ └── favicon.ico\n│ └── server\n│ ├── api\n│ │ └── greet.ts\n│ └── tsconfig.json\n├── tsconfig.app.json\n├── tsconfig.json\n├── tsconfig.spec.json\n└── vitest.config.ts\n```\n\nYour new app will contain the following:\n\n- Two pages (home and about) under `pages`\n- A component (`NxWelcome`) under `components`\n- A `greet` API endpoint that returns a JSON response under `/api/greet`\n- Configuration for `vitest`\n- Your app's entrypoint (`app.vue`) will contain the navigation links to the home and about pages, and the `nuxt-page` component to display the contents of your pages.\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Create app in a directory\" %}\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```shell\nnx g @nx/nuxt:app =apps/nested/myapp\n```\n\n{% /tab %}\n\n{% tab label=\"Create app with vitest configured\" %}\n\n```shell\nnx g @nx/nuxt:app apps/nested/myapp --unitTestRunner=vitest\n```\n\n{% /tab %}\n\n{% tab label=\"Use plain JavaScript (not TypeScript)\" %}\n\n```shell\nnx g @nx/nuxt:app apps/myapp --js\n```\n\n{% /tab %}\n{% /tabs %}\n\n## Generate pages and components\n\nYou can use the the [`@nx/vue:component` generator](/nx-api/vue/generators/component) to generate new pages and components for your application. You can read more on the [`@nx/vue:component` generator documentation page](/nx-api/vue/generators/component), but here are some examples:\n\n{% tabs %}\n{% tab label=\"New page\" %}\n\n```shell\nnx g @nx/nuxt:component my-app/src/pages/my-page\n```\n\n{% /tab %}\n\n{% tab label=\"New component\" %}\n\n```shell\nnx g @nx/nuxt:component my-app/src/components/my-cmp\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"examplesFile": "---\ntitle: Nuxt application generator examples\ndescription: This page contains examples for the @nx/nuxt:app generator.\n---\n\nYour new Nuxt application will be generated with the following directory structure, following the suggested [directory structure](https://nuxt.com/docs/guide/directory-structure) for Nuxt applications:\n\n```text\nmy-nuxt-app\n├── nuxt.config.ts\n├── project.json\n├── src\n│ ├── app.vue\n│ ├── assets\n│ │ └── css\n│ │ └── styles.css\n│ ├── components\n│ │ └── NxWelcome.vue\n│ ├── pages\n│ │ ├── about.vue\n│ │ └── index.vue\n│ ├── public\n│ │ └── favicon.ico\n│ └── server\n│ ├── api\n│ │ └── greet.ts\n│ └── tsconfig.json\n├── tsconfig.app.json\n├── tsconfig.json\n├── tsconfig.spec.json\n└── vitest.config.ts\n```\n\nYour new app will contain the following:\n\n- Two pages (home and about) under `pages`\n- A component (`NxWelcome`) under `components`\n- A `greet` API endpoint that returns a JSON response under `/api/greet`\n- Configuration for `vitest`\n- Your app's entrypoint (`app.vue`) will contain the navigation links to the home and about pages, and the `nuxt-page` component to display the contents of your pages.\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Create app in a nested directory\" %}\n\n```shell\nnx g @nx/nuxt:app apps/nested/myapp\n```\n\n{% /tab %}\n\n{% tab label=\"Create app with vitest configured\" %}\n\n```shell\nnx g @nx/nuxt:app apps/nested/myapp --unitTestRunner=vitest\n```\n\n{% /tab %}\n\n{% tab label=\"Use plain JavaScript (not TypeScript)\" %}\n\n```shell\nnx g @nx/nuxt:app apps/myapp --js\n```\n\n{% /tab %}\n{% /tabs %}\n\n## Generate pages and components\n\nYou can use the the [`@nx/vue:component` generator](/nx-api/vue/generators/component) to generate new pages and components for your application. You can read more on the [`@nx/vue:component` generator documentation page](/nx-api/vue/generators/component), but here are some examples:\n\n{% tabs %}\n{% tab label=\"New page\" %}\n\n```shell\nnx g @nx/nuxt:component my-app/src/pages/my-page\n```\n\n{% /tab %}\n\n{% tab label=\"New component\" %}\n\n```shell\nnx g @nx/nuxt:component my-app/src/components/my-cmp\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["app"],
|
||||
|
||||
@@ -28,6 +28,7 @@ Install `create-nx-workspace` globally to invoke the command directly, or use `n
|
||||
| `--defaultBase` | string | Default base to use for new projects. (Default: `main`) |
|
||||
| `--docker` | boolean | Generate a Dockerfile for the Node API. |
|
||||
| `--e2eTestRunner` | `playwright`, `cypress`, `none` | Test runner to use for end to end (E2E) tests. |
|
||||
| `--formatter` | string | Code formatter to use. |
|
||||
| `--framework` | string | Framework option to be used with certain stacks. |
|
||||
| `--help` | boolean | Show help. |
|
||||
| `--interactive` | boolean | Enable interactive mode with presets. (Default: `true`) |
|
||||
@@ -45,6 +46,7 @@ Install `create-nx-workspace` globally to invoke the command directly, or use `n
|
||||
| `--style` | string | Stylesheet type to be used with certain stacks. |
|
||||
| `--useGitHub` | boolean | Will you be using GitHub as your git hosting provider? (Default: `false`) |
|
||||
| `--version` | boolean | Show version number. |
|
||||
| `--workspaces` | boolean | Use package manager workspaces. (Default: `false`) |
|
||||
| `--workspaceType` | `integrated`, `package-based`, `standalone` | The type of workspace to create. |
|
||||
|
||||
## Presets
|
||||
|
||||
@@ -67,25 +67,9 @@ The `targetName` and `ciTargetName` options control the name of the inferred Pla
|
||||
|
||||
### Splitting E2E Tests
|
||||
|
||||
The `@nx/playwright/plugin` will automatically split your e2e tasks by file if you provide a `ciTargetName`. You can read more about the Atomizer feature [here](/ci/features/split-e2e-tasks). This will create a target with that name which can be used in CI to run the tests for each file in a distributed fashion.
|
||||
`@nx/playwright/plugin` leverages Nx Atomizer to split your e2e tests into smaller tasks in a fully automated way. This allows for a much more efficient distribution of tasks in CI. You can read more about the Atomizer feature [here](/ci/features/split-e2e-tasks).
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"plugins": [
|
||||
{
|
||||
"plugin": "@nx/playwright/plugin",
|
||||
"options": {
|
||||
"targetName": "e2e",
|
||||
"ciTargetName": "e2e-ci"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Splitting E2E tasks by file
|
||||
|
||||
The `@nx/playwright/plugin` will automatically split your e2e tasks by file. You can read more about this feature [here](/ci/features/split-e2e-tasks).
|
||||
If you would like to disable Atomizer for Playwright tasks, set `ciTargetName` to `false`.
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Nx < 18" %}
|
||||
@@ -159,6 +143,46 @@ nx e2e <your-app-name> --ui
|
||||
|
||||
You can also use `--headed` flag to run Playwright where the browser can be seen without using the [Playwright UI](https://playwright.dev/docs/test-ui-mode)
|
||||
|
||||
### Specifying a Project/Target Browser
|
||||
|
||||
The default generated Playwright configuration will contain a `projects` property that contains a list of browsers to run the tests against.
|
||||
|
||||
It should look similar to this:
|
||||
|
||||
```ts
|
||||
export default defineConfig({
|
||||
...,
|
||||
projects: [
|
||||
{
|
||||
name: "chromium",
|
||||
use: { ...devices["Desktop Chrome"] },
|
||||
},
|
||||
|
||||
{
|
||||
name: "firefox",
|
||||
use: { ...devices["Desktop Firefox"] },
|
||||
},
|
||||
|
||||
{
|
||||
name: "webkit",
|
||||
use: { ...devices["Desktop Safari"] },
|
||||
}
|
||||
]
|
||||
});
|
||||
```
|
||||
|
||||
By default, Playwright will run tests against all browsers in the `projects` list.
|
||||
|
||||
You can specify a specific browser to run the tests against by passing the `--project` flag to the `nx e2e` command.
|
||||
|
||||
```shell
|
||||
nx e2e frontend-e2e -- --project=firefox
|
||||
```
|
||||
|
||||
{% callout type="note" title="Argument Forwarding" %}
|
||||
As Nx also has a `--project` argument, you need to use `--` to forward the argument to the Playwright configuration.
|
||||
{% /callout %}
|
||||
|
||||
### Specifying a Base Url
|
||||
|
||||
The `baseURL` property within the Playwright configuration can control where the tests visit by default.
|
||||
|
||||
@@ -7,27 +7,19 @@
|
||||
"$id": "NxPluginExecutor",
|
||||
"title": "Create an Executor for an Nx Plugin",
|
||||
"description": "Create an Executor for an Nx Plugin.",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Basic executor\" %}\n\nCreate a new executor called `build` inside the plugin `my-plugin`:\n\n```bash\nnx g @nx/plugin:executor tools/my-plugin/src/executors/build\n```\n\n{% /tab %}\n{% tab label=\"With custom hashing\" %}\n\nCreate a new executor called `build` inside the plugin `my-plugin`, that uses a custom hashing function:\n\n```bash\nnx g @nx/plugin:executor tools/my-plugin/src/executors/build --includeHasher\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Basic executor\" %}\n\nCreate a new executor called `build` at `tools/my-plugin/src/executors/build.ts`:\n\n```bash\nnx g @nx/plugin:executor tools/my-plugin/src/executors/build.ts\n```\n\n{% /tab %}\n{% tab label=\"Without providing the file extension\" %}\n\nCreate a new executor called `build` at `tools/my-plugin/src/executors/build.ts`:\n\n```bash\nnx g @nx/plugin:executor tools/my-plugin/src/executors/build\n```\n\n{% /tab %}\n{% tab label=\"With different exported name\" %}\n\nCreate a new executor called `custom` at `tools/my-plugin/src/executors/build.ts`:\n\n```bash\nnx g @nx/plugin:executor tools/my-plugin/src/executors/build.ts --name=custom\n```\n\n{% /tab %}\n{% tab label=\"With custom hashing\" %}\n\nCreate a new executor called `build` at `tools/my-plugin/src/executors/build.ts`, that uses a custom hashing function:\n\n```bash\nnx g @nx/plugin:executor tools/my-plugin/src/executors/build --includeHasher\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g executor my-executor --project=my-plugin",
|
||||
"description": "Generate `libs/my-plugin/src/executors/my-executor`"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path at which to generate the executor file.",
|
||||
"x-prompt": "What path would you like to use for the executor?",
|
||||
"description": "The file path to the executor. Relative to the current working directory.",
|
||||
"x-prompt": "What is the executor file path?",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-priority": "important"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Executor name.",
|
||||
"x-prompt": "What name would you like to use for the executor?",
|
||||
"x-priority": "important"
|
||||
"description": "The executor name to export in the plugin executors collection."
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
|
||||
@@ -10,23 +10,29 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g generator libs/my-plugin/src/generators//my-generator",
|
||||
"description": "Generate `libs/my-plugin/src/generators/my-generator`"
|
||||
"description": "Generate a generator exported with the name matching the file name. It results in the generator `foo` at `mylib/src/generators/foo.ts`",
|
||||
"command": "nx g @nx/plugin:generator mylib/src/generators/foo.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate a generator without providing the file extension. It results in the generator `foo` at `mylib/src/generators/foo.ts`",
|
||||
"command": "nx g @nx/plugin:generator mylib/src/generators/foo"
|
||||
},
|
||||
{
|
||||
"description": "Generate a generator exported with a different name from the file name. It results in the generator `custom` at `mylib/src/generators/foo.ts`",
|
||||
"command": "nx g @nx/plugin:generator mylib/src/generators/foo --name=custom"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the generator will be generated.",
|
||||
"description": "The file path to the generator. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the generator be generated?",
|
||||
"x-prompt": "What is the generator file path?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Generator name.",
|
||||
"x-prompt": "What name would you like to use for the generator?",
|
||||
"x-priority": "important"
|
||||
"description": "The generator name to export in the plugin generators collection."
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
|
||||
@@ -10,22 +10,29 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g migration my-plugin/my-migration --version=1.0.0",
|
||||
"description": "Adds a new migration inside `my-plugin`, which will be triggered when migrating to version 1.0.0 or above from a previous version."
|
||||
"description": "Generate a migration exported with the name matching the file name, which will be triggered when migrating to version 1.0.0 or above from a previous version. It results in the migration `foo` at `mylib/src/migrations/foo.ts`",
|
||||
"command": "nx g @nx/plugin:migration mylib/src/migrations/foo.ts -v=1.0.0"
|
||||
},
|
||||
{
|
||||
"description": "Generate a migration without providing the file extension, which will be triggered when migrating to version 1.0.0 or above from a previous version. It results in the migration `foo` at `mylib/src/migrations/foo.ts`",
|
||||
"command": "nx g @nx/plugin:migration mylib/src/migrations/foo -v=1.0.0"
|
||||
},
|
||||
{
|
||||
"description": "Generate a migration exported with a different name from the file name, which will be triggered when migrating to version 1.0.0 or above from a previous version. It results in the migration `custom` at `mylib/src/migrations/foo.ts`",
|
||||
"command": "nx g @nx/plugin:migration mylib/src/migrations/foo --name=custom -v=1.0.0"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the migration will be generated.",
|
||||
"description": "The file path to the migration without the file extension. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the migration be generated?",
|
||||
"x-prompt": "What is the migration file path?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Migration name.",
|
||||
"x-priority": "important"
|
||||
"description": "The migration name to export in the plugin migrations collection."
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
|
||||
@@ -44,13 +44,15 @@
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
"enum": ["eslint", "none"],
|
||||
"default": "eslint"
|
||||
"default": "none",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"unitTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["jest", "none"],
|
||||
"description": "Test runner to use for unit tests",
|
||||
"default": "jest"
|
||||
"default": "none",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"tags": {
|
||||
"type": "string",
|
||||
@@ -71,7 +73,8 @@
|
||||
"description": "Adds the specified e2e test runner.",
|
||||
"type": "string",
|
||||
"enum": ["playwright", "cypress", "detox", "none"],
|
||||
"default": "playwright"
|
||||
"default": "none",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"install": {
|
||||
"type": "boolean",
|
||||
|
||||
@@ -10,30 +10,37 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nx/react-native:component mylib/src/lib/my-component/my-component ",
|
||||
"description": "Generate a component in the `mylib` library"
|
||||
"description": "Generate a component with the exported symbol matching the file name. It results in the component `Foo` at `mylib/src/lib/foo.tsx`",
|
||||
"command": "nx g @nx/react-native:component mylib/src/lib/foo.tsx"
|
||||
},
|
||||
{
|
||||
"command": "nx g @nx/react-native:component mylib/src/lib/my-component/my-component --classComponent",
|
||||
"description": "Generate a class component in the `mylib` library"
|
||||
"description": "Generate a component with the exported symbol different from the file name. It results in the component `Custom` at `mylib/src/lib/foo.tsx`",
|
||||
"command": "nx g @nx/react-native:component mylib/src/lib/foo.tsx --name=custom"
|
||||
},
|
||||
{
|
||||
"description": "Generate a component without providing the file extension. It results in the component `Foo` at `mylib/src/lib/foo.tsx`",
|
||||
"command": "nx g @nx/react-native:component mylib/src/lib/foo"
|
||||
},
|
||||
{
|
||||
"description": "Generate a class component at `mylib/src/lib/foo.tsx`",
|
||||
"command": "nx g @nx/react-native:component mylib/src/lib/foo --classComponent"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "The path at which to create the component file.",
|
||||
"description": "The file path to the component. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What path would you like to use for the component?"
|
||||
"x-prompt": "What is the component file path?"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the component.",
|
||||
"x-prompt": "What name would you like to use for the component?"
|
||||
"description": "The component symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"js": {
|
||||
"type": "boolean",
|
||||
"description": "Generate JavaScript files rather than TypeScript files.",
|
||||
"default": false
|
||||
"x-deprecated": "Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21."
|
||||
},
|
||||
"skipTests": {
|
||||
"type": "boolean",
|
||||
|
||||
@@ -32,13 +32,16 @@
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
"enum": ["eslint", "none"],
|
||||
"default": "eslint"
|
||||
"default": "none",
|
||||
"x-prompt": "Which linter would you like to use?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"unitTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["jest", "none"],
|
||||
"description": "Test runner to use for unit tests.",
|
||||
"default": "jest"
|
||||
"default": "none",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"tags": {
|
||||
"type": "string",
|
||||
|
||||
@@ -25,14 +25,16 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"description": "List of remote applications to run in development mode (i.e. using serve target).",
|
||||
"x-priority": "important"
|
||||
"description": "List of Producer (remote) applications to run in development mode (i.e. using serve target).",
|
||||
"x-priority": "important",
|
||||
"alias": "devProducers"
|
||||
},
|
||||
"skipRemotes": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "List of remote applications to not automatically serve, either statically or in development mode. This will not remove the remotes from the `module-federation.config` file, and therefore the application may still try to fetch these remotes.\nThis option is useful if you have other means for serving the `remote` application(s).\n**NOTE:** Remotes that are not in the workspace will be skipped automatically.",
|
||||
"x-priority": "important"
|
||||
"description": "List of Producer (remote) applications to not automatically serve, either statically or in development mode. This will not remove the Producers (remotes) from the `module-federation.config` file, and therefore the application may still try to fetch these Producers (remotes).\nThis option is useful if you have other means for serving the Producer (remote) application(s).\n**NOTE:** Producers (remotes) that are not in the workspace will be skipped automatically.",
|
||||
"x-priority": "important",
|
||||
"alias": "skipProducers"
|
||||
},
|
||||
"buildTarget": {
|
||||
"type": "string",
|
||||
@@ -106,25 +108,27 @@
|
||||
},
|
||||
"static": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to use a static file server instead of the webpack-dev-server. This should be used for remote applications that are also host applications."
|
||||
"description": "Whether to use a static file server instead of the webpack-dev-server. This should be used for Producer (remote) applications that are also Consumer (host) applications."
|
||||
},
|
||||
"isInitialHost": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the host that is running this executor is the first in the project tree to do so.",
|
||||
"description": "Whether the Consumer (host) that is running this executor is the first in the project tree to do so.",
|
||||
"default": true,
|
||||
"x-priority": "internal"
|
||||
"x-priority": "internal",
|
||||
"alias": "isInitialConsumer"
|
||||
},
|
||||
"parallel": {
|
||||
"type": "number",
|
||||
"description": "Max number of parallel processes for building static remotes"
|
||||
"description": "Max number of parallel processes for building static Producers (remotes)"
|
||||
},
|
||||
"staticRemotesPort": {
|
||||
"type": "number",
|
||||
"description": "The port at which to serve the file-server for the static remotes."
|
||||
"description": "The port at which to serve the file-server for the static Producers (remotes).",
|
||||
"alias": "staticProducersPort"
|
||||
},
|
||||
"pathToManifestFile": {
|
||||
"type": "string",
|
||||
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic remote applications relative to the workspace root."
|
||||
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic Producer (remote) applications relative to the workspace root."
|
||||
}
|
||||
},
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve them statically also. \nSee an example set up of it below:\n\n```json\n{\n \"serve\": {\n \"executor\": \"@nx/react:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"buildTarget\": \"host:build:production\"\n },\n \"development\": {\n \"buildTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\"\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Serve host with remotes that can be live reloaded\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve a set selection with live reloading enabled also. \nSee an example set up of it below:\n\n```json\n{\n \"serve-with-hmr-remotes\": {\n \"executor\": \"@nx/react:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"buildTarget\": \"host:build:production\"\n },\n \"development\": {\n \"buildTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\",\n \"devRemotes\": [\n \"remote1\",\n {\n \"remoteName\": \"remote2\",\n \"configuration\": \"development\"\n }\n ]\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"version": 2,
|
||||
"outputCapture": "direct-nodejs",
|
||||
"title": "Module Federation SSR Dev Server",
|
||||
"description": "Serve a SSR host application along with its known remotes.",
|
||||
"description": "Serve a SSR Consumer (host) application along with its known Producers (remotes).",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -28,14 +28,16 @@
|
||||
"devRemotes": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "List of remote applications to run in development mode (i.e. using serve target).",
|
||||
"x-priority": "important"
|
||||
"description": "List of Producer (remote) applications to run in development mode (i.e. using serve target).",
|
||||
"x-priority": "important",
|
||||
"alias": "devProducers"
|
||||
},
|
||||
"skipRemotes": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "List of remote applications to not automatically serve, either statically or in development mode.",
|
||||
"x-priority": "important"
|
||||
"description": "List of Producer (remote) applications to not automatically serve, either statically or in development mode.",
|
||||
"x-priority": "important",
|
||||
"alias": "skipProducers"
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
@@ -44,11 +46,12 @@
|
||||
},
|
||||
"staticRemotesPort": {
|
||||
"type": "number",
|
||||
"description": "The port at which to serve the file-server for the static remotes."
|
||||
"description": "The port at which to serve the file-server for the static Producers (remotes).",
|
||||
"alias": "staticProducersPort"
|
||||
},
|
||||
"pathToManifestFile": {
|
||||
"type": "string",
|
||||
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic remote applications relative to the workspace root."
|
||||
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic Producer (remote) applications relative to the workspace root."
|
||||
},
|
||||
"ssl": {
|
||||
"type": "boolean",
|
||||
@@ -65,9 +68,10 @@
|
||||
},
|
||||
"isInitialHost": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the host that is running this executor is the first in the project tree to do so.",
|
||||
"description": "Whether the Consumer (host) that is running this executor is the first in the project tree to do so.",
|
||||
"default": true,
|
||||
"x-priority": "internal"
|
||||
"x-priority": "internal",
|
||||
"alias": "isInitialConsumer"
|
||||
}
|
||||
},
|
||||
"required": ["browserTarget", "serverTarget"],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"version": 2,
|
||||
"outputCapture": "direct-nodejs",
|
||||
"title": "Module Federation Static Dev Server",
|
||||
"description": "Serve a host application statically along with it's remotes.",
|
||||
"description": "Serve a Consumer (host) application statically along with its Producers (remotes).",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"properties": { "serveTarget": { "type": "string" } },
|
||||
|
||||
@@ -74,12 +74,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"linter": {
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
"enum": ["eslint", "none"],
|
||||
"default": "eslint"
|
||||
},
|
||||
"routing": {
|
||||
"type": "boolean",
|
||||
"description": "Generate application with routes.",
|
||||
@@ -98,11 +92,29 @@
|
||||
"default": false,
|
||||
"x-priority": "internal"
|
||||
},
|
||||
"bundler": {
|
||||
"description": "The bundler to use.",
|
||||
"type": "string",
|
||||
"enum": ["vite", "webpack", "rspack"],
|
||||
"x-prompt": "Which bundler do you want to use to build the application?",
|
||||
"default": "vite",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"linter": {
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
"enum": ["eslint", "none"],
|
||||
"default": "none",
|
||||
"x-prompt": "Which linter would you like to use?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"unitTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["vitest", "jest", "none"],
|
||||
"description": "Test runner to use for unit tests.",
|
||||
"default": "vitest"
|
||||
"default": "none",
|
||||
"x-prompt": "What unit test runner should be used?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"inSourceTests": {
|
||||
"type": "boolean",
|
||||
@@ -165,14 +177,6 @@
|
||||
"default": false,
|
||||
"hidden": true
|
||||
},
|
||||
"bundler": {
|
||||
"description": "The bundler to use.",
|
||||
"type": "string",
|
||||
"enum": ["vite", "webpack", "rspack"],
|
||||
"x-prompt": "Which bundler do you want to use to build the application?",
|
||||
"default": "vite",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"minimal": {
|
||||
"description": "Generate a React app with a minimal setup, no separate test files.",
|
||||
"type": "boolean",
|
||||
@@ -180,7 +184,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["directory"],
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:application apps/my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:app apps/my-app --bundler=vite\n```\n\nWhen choosing `vite` as the bundler, your unit tests will be set up with `vitest`, unless you choose `none` for `unitTestRunner`.\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/react:app apps/my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/react:app apps/my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:application apps/my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Application using Vite as bundler\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/react:app apps/my-app --bundler=vite\n```\n\nWhen choosing `vite` as the bundler, your unit tests will be set up with `vitest`, unless you choose `none` for `unitTestRunner`.\n\n{% /tab %}\n\n{% tab label=\"Specify style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n```bash\nnx g @nx/react:app apps/my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/react:app apps/my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["app"],
|
||||
|
||||
@@ -11,16 +11,14 @@
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the component will be generated.",
|
||||
"description": "The file path to the component. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the component be generated?",
|
||||
"x-prompt": "What is the component file path?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the component.",
|
||||
"x-prompt": "What name would you like to use for the component?",
|
||||
"x-priority": "important"
|
||||
"description": "The component symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"style": {
|
||||
"description": "The file extension to be used for style files.",
|
||||
@@ -59,7 +57,7 @@
|
||||
"js": {
|
||||
"type": "boolean",
|
||||
"description": "Generate JavaScript files rather than TypeScript files.",
|
||||
"default": false
|
||||
"x-deprecated": "Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21."
|
||||
},
|
||||
"skipTests": {
|
||||
"type": "boolean",
|
||||
@@ -89,10 +87,6 @@
|
||||
"description": "Default is `false`. When `true`, the component is generated with `*.css`/`*.scss` instead of `*.module.css`/`*.module.scss`.",
|
||||
"default": false
|
||||
},
|
||||
"fileName": {
|
||||
"type": "string",
|
||||
"description": "Create a component with this file name."
|
||||
},
|
||||
"inSourceTests": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
@@ -106,7 +100,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["path"],
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Component\" %}\n\nCreate a component named `my-component` under the `libs/ui` project:\n\n```shell\nnx g @nx/react:component libs/ui/src/my-component\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone Component\" %}\n\nCreate a class component named `my-component` under the `libs/ui` project:\n\n```shell\nnx g @nx/react:component libs/ui/src/my-component --classComponent\n```\n\n{% /tab %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Component\" %}\n\nCreate a component named `MyComponent` at `libs/ui/src/my-component.tsx`:\n\n```shell\nnx g @nx/react:component libs/ui/src/my-component.tsx\n```\n\n{% /tab %}\n\n{% tab label=\"With a Different Symbol Name\" %}\n\nCreate a component named `Custom` at `libs/ui/src/my-component.tsx`:\n\n```shell\nnx g @nx/react:component libs/ui/src/my-component.tsx --name=custom\n```\n\n{% /tab %}\n\n{% tab label=\"Omitting the File Extension\" %}\n\nCreate a component named `MyComponent` at `libs/ui/src/my-component.tsx` without specifying the file extension:\n\n```shell\nnx g @nx/react:component libs/ui/src/my-component\n```\n\n{% /tab %}\n\n{% tab label=\"Class Component\" %}\n\nCreate a class component named `MyComponent` at `libs/ui/src/my-component.tsx`:\n\n```shell\nnx g @nx/react:component libs/ui/src/my-component --classComponent\n```\n\n{% /tab %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"description": "Create a React component.",
|
||||
|
||||
@@ -6,11 +6,15 @@
|
||||
"cli": "nx",
|
||||
"$id": "NxReactFederateModule",
|
||||
"title": "Federate Module",
|
||||
"description": "Create a federated module, which can be loaded by a remote host.",
|
||||
"description": "Create a federated module, which can be loaded by a Consumer (host) via a Producer (remote).",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app --remoteDirectory=apps/my-remote-app",
|
||||
"description": "Create a federated module from my-remote-app, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
|
||||
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=myRemote --remoteDirectory=apps/myRemote",
|
||||
"description": "Create a federated module from myRemote, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
|
||||
},
|
||||
{
|
||||
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --producer=myProducer --producerDirectory=apps/myProducer",
|
||||
"description": "Create a federated module from myProducer, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
@@ -30,12 +34,14 @@
|
||||
},
|
||||
"remote": {
|
||||
"type": "string",
|
||||
"description": "The name of the remote.",
|
||||
"x-prompt": "What is/should the remote be named?"
|
||||
"description": "The name of the Producer (remote).",
|
||||
"x-prompt": "What is/should the Producer (remote) be named?",
|
||||
"alias": "producer"
|
||||
},
|
||||
"remoteDirectory": {
|
||||
"description": "The directory of the new remote application if one needs to be created.",
|
||||
"type": "string"
|
||||
"description": "The directory of the new Producer (remote) application if one needs to be created.",
|
||||
"type": "string",
|
||||
"alias": "producerDirectory"
|
||||
},
|
||||
"style": {
|
||||
"description": "The file extension to be used for style files.",
|
||||
@@ -70,7 +76,7 @@
|
||||
},
|
||||
"host": {
|
||||
"type": "string",
|
||||
"description": "The host / shell application for this remote."
|
||||
"description": "The Consumer (host) application for this Producer (remote)."
|
||||
},
|
||||
"bundler": {
|
||||
"description": "The bundler to use.",
|
||||
|
||||
@@ -10,28 +10,34 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g hook mylib/my-hook",
|
||||
"description": "Generate a hook `my-hook` in the `mylib` library"
|
||||
"description": "Generate a hook with the exported symbol matching the file name. It results in the hook `useFoo` at `mylib/src/lib/foo.ts`",
|
||||
"command": "nx g @nx/react:hook mylib/src/lib/foo.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate a hook with the exported symbol different from the file name. It results in the hook `useCustom` at `mylib/src/lib/foo.ts`",
|
||||
"command": "nx g @nx/react:hook mylib/src/lib/foo.ts --name=useCustom"
|
||||
},
|
||||
{
|
||||
"description": "Generate a hook without providing the file extension. It results in the hook `useFoo` at `mylib/src/lib/foo.ts`",
|
||||
"command": "nx g @nx/react:hook mylib/src/lib/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the hook will be generated.",
|
||||
"description": "The file path to the hook. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the hook be generated?",
|
||||
"x-prompt": "What is the hook file path?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the hook.",
|
||||
"x-prompt": "What name would you like to use for the hook?",
|
||||
"x-priority": "important"
|
||||
"description": "The hook symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"js": {
|
||||
"type": "boolean",
|
||||
"description": "Generate JavaScript files rather than TypeScript files.",
|
||||
"default": false
|
||||
"x-deprecated": "Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21."
|
||||
},
|
||||
"skipTests": {
|
||||
"type": "boolean",
|
||||
@@ -39,16 +45,6 @@
|
||||
"default": false,
|
||||
"x-priority": "internal"
|
||||
},
|
||||
"directory": {
|
||||
"type": "string",
|
||||
"description": "The directory at which to create the hook file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the project root.",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"nameAndDirectoryFormat": {
|
||||
"description": "Whether to generate the component in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
|
||||
"type": "string",
|
||||
"enum": ["as-provided", "derived"]
|
||||
},
|
||||
"export": {
|
||||
"type": "boolean",
|
||||
"description": "When true, the hook is exported from the project `index.ts` (if it exists).",
|
||||
@@ -57,7 +53,7 @@
|
||||
"x-prompt": "Should this hook be exported in the project?"
|
||||
}
|
||||
},
|
||||
"required": ["name"],
|
||||
"required": ["path"],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Create a hook.",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"$id": "GeneratorReactHost",
|
||||
"cli": "nx",
|
||||
"title": "Generate Module Federation Setup for React Host App",
|
||||
"description": "Create Module Federation configuration files for given React Host Application.",
|
||||
"title": "Generate Module Federation Setup for React Consumer (Host) App",
|
||||
"description": "Create Module Federation configuration files for given React Consumer (Host) Application.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"directory": {
|
||||
@@ -18,7 +18,7 @@
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the host application to generate the Module Federation configuration",
|
||||
"description": "The name of the Consumer (host) application to generate the Module Federation configuration",
|
||||
"pattern": "^[a-zA-Z][^:]*$",
|
||||
"x-priority": "important"
|
||||
},
|
||||
@@ -68,7 +68,7 @@
|
||||
},
|
||||
"dynamic": {
|
||||
"type": "boolean",
|
||||
"description": "Should the host application use dynamic federation?",
|
||||
"description": "Should the Consumer (host) application use dynamic federation?",
|
||||
"default": false
|
||||
},
|
||||
"skipFormat": {
|
||||
@@ -135,18 +135,19 @@
|
||||
},
|
||||
"remotes": {
|
||||
"type": "array",
|
||||
"description": "A list of remote application names that the host application should consume.",
|
||||
"description": "A list of Producer (remote) application names that the Consumer (host) application should consume.",
|
||||
"default": [],
|
||||
"x-priority": "important"
|
||||
"x-priority": "important",
|
||||
"alias": "producers"
|
||||
},
|
||||
"devServerPort": {
|
||||
"type": "number",
|
||||
"description": "The port for the dev server of the remote app.",
|
||||
"description": "The port for the dev server of the Producer (remote) app.",
|
||||
"default": 4200,
|
||||
"x-priority": "important"
|
||||
},
|
||||
"ssr": {
|
||||
"description": "Whether to configure SSR for the host application",
|
||||
"description": "Whether to configure SSR for the Consumer (host) application",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
@@ -181,8 +182,8 @@
|
||||
},
|
||||
"x-type": "application",
|
||||
"description": "Generate a host react application",
|
||||
"aliases": ["consumer"],
|
||||
"implementation": "/packages/react/src/generators/host/host.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/packages/react/src/generators/host/schema.json",
|
||||
"type": "generator"
|
||||
|
||||
@@ -65,18 +65,29 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"bundler": {
|
||||
"type": "string",
|
||||
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
|
||||
"enum": ["none", "vite", "rollup"],
|
||||
"default": "none",
|
||||
"x-prompt": "Which bundler would you like to use to build the library? Choose 'none' to skip build setup.",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"linter": {
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
"enum": ["eslint", "none"],
|
||||
"default": "eslint"
|
||||
"default": "none",
|
||||
"x-prompt": "Which linter would you like to use?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"unitTestRunner": {
|
||||
"type": "string",
|
||||
"enum": ["vitest", "jest", "none"],
|
||||
"default": "vitest",
|
||||
"default": "none",
|
||||
"description": "Test runner to use for unit tests.",
|
||||
"x-prompt": "What unit test runner should be used?"
|
||||
"x-prompt": "What unit test runner should be used?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"inSourceTests": {
|
||||
"type": "boolean",
|
||||
@@ -148,14 +159,6 @@
|
||||
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
||||
"default": false
|
||||
},
|
||||
"bundler": {
|
||||
"type": "string",
|
||||
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
|
||||
"enum": ["none", "vite", "rollup"],
|
||||
"default": "none",
|
||||
"x-prompt": "Which bundler would you like to use to build the library? Choose 'none' to skip build setup.",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"compiler": {
|
||||
"type": "string",
|
||||
"enum": ["babel", "swc"],
|
||||
|
||||
@@ -8,18 +8,31 @@
|
||||
"title": "Create Redux state",
|
||||
"description": "Create a Redux state slice for a React project.",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"description": "Generate a Redux state slice with the exported symbol matching the file name. It results in the slice `fooSlice` at `mylib/src/lib/foo.slice.ts`",
|
||||
"command": "nx g @nx/react:redux mylib/src/lib/foo.slice.ts"
|
||||
},
|
||||
{
|
||||
"description": "Generate a Redux state slice with the exported symbol different from the file name. It results in the slice `customSlice` at `mylib/src/lib/foo.slice.ts`",
|
||||
"command": "nx g @nx/react:redux mylib/src/lib/foo.slice.ts --name=custom"
|
||||
},
|
||||
{
|
||||
"description": "Generate a Redux state slice without providing the \"slice\" suffix and the file extension. It results in the slice `fooSlice` at `mylib/src/lib/foo.slice.ts`",
|
||||
"command": "nx g @nx/react:redux mylib/src/lib/foo"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the Redux slice will be generated.",
|
||||
"description": "The file path to the Redux state slice. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the Redux slice be generated?",
|
||||
"x-prompt": "What is the Redux stateslice file path?",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Redux slice name.",
|
||||
"x-priority": "important"
|
||||
"description": "The Redux state slice symbol name. Defaults to the last segment of the file path."
|
||||
},
|
||||
"appProject": {
|
||||
"type": "string",
|
||||
@@ -29,7 +42,7 @@
|
||||
"js": {
|
||||
"type": "boolean",
|
||||
"description": "Generate JavaScript files rather than TypeScript files.",
|
||||
"default": false
|
||||
"x-deprecated": "Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21."
|
||||
}
|
||||
},
|
||||
"required": ["path"],
|
||||
|
||||