Compare commits
93 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02e175c2bb | |||
| 4ea8aa10d3 | |||
| 301ca87f9d | |||
| 58f0b17313 | |||
| 6fbb56c91c | |||
| 1e60d18c6a | |||
| bf24839e79 | |||
| 2491a1c55a | |||
| fd6f940b07 | |||
| 45dc148381 | |||
| 4530c13b2f | |||
| 3cc7eaed9b | |||
| 9f79265751 | |||
| d9607d3fc3 | |||
| 9087339a1b | |||
| 8bf1f0c4cc | |||
| 69c036ab8c | |||
| 7a7268cab7 | |||
| 1f3b6fe2b4 | |||
| 316e8d2878 | |||
| 20dce44970 | |||
| 182313da65 | |||
| 65f75a2ccf | |||
| 8fe3d22c44 | |||
| 0f330590b7 | |||
| 2e8916808d | |||
| cd5c8d5ad6 | |||
| 26f67c101a | |||
| 628ed52424 | |||
| 3003b66879 | |||
| 548d1421db | |||
| bc2bf37639 | |||
| 55989b7ec8 | |||
| f7ef112343 | |||
| a6058c5cba | |||
| a8877bdf20 | |||
| 79110e937f | |||
| 93b906f38a | |||
| c27db584d5 | |||
| 6c3defbd1d | |||
| bdb96cca63 | |||
| 949762a105 | |||
| 7839aff1d7 | |||
| 1ebf0076d1 | |||
| 75c1b866ab | |||
| 0e1ee4d2c1 | |||
| 9e9c08d6ea | |||
| 95a1c09de3 | |||
| 7a92592a2e | |||
| 2bc9ab5e1c | |||
| dd88acc1b3 | |||
| 10b861c0c7 | |||
| bab6b19b46 | |||
| 37881b53bd | |||
| 0cf45378e0 | |||
| f85b26c33e | |||
| c5e961c93e | |||
| f7b8eb1c81 | |||
| 640802acfc | |||
| 379517c045 | |||
| 95cdd7ce7a | |||
| 7ae01cc9e4 | |||
| be69f8c918 | |||
| d10cc6b1c9 | |||
| 7913c878d5 | |||
| 3b9462a0b3 | |||
| 15802c3706 | |||
| 5705ec0a4f | |||
| 1ba7622861 | |||
| b00b646bb8 | |||
| 765715c0e0 | |||
| b363ada820 | |||
| ef2475e1f6 | |||
| 81f9c540a3 | |||
| 83c1597f0c | |||
| 834178a12e | |||
| 7226065329 | |||
| 303cadfcc5 | |||
| 47c9ac5e5b | |||
| 84435fbcbe | |||
| b25a03e22a | |||
| 9ef43f65b8 | |||
| 3d0568dfdf | |||
| c1f068ea43 | |||
| 622c2eac4f | |||
| d59d84c935 | |||
| 2ee80a1de4 | |||
| 80fec8b003 | |||
| e8266e28c4 | |||
| b87865ded3 | |||
| 47d18a9bed | |||
| fa2f2899e6 | |||
| 0f38664407 |
@@ -93,7 +93,7 @@ jobs:
|
||||
- checkout
|
||||
- nx/set-shas:
|
||||
main-branch-name: 'master'
|
||||
- run: npx nx-cloud@next start-ci-run --distribute-on="auto linux-medium" --stop-agents-after="e2e" --require-explicit-completion
|
||||
- run: npx nx-cloud@next start-ci-run --distribute-on="./.nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
|
||||
- run:
|
||||
command: |
|
||||
sudo apt-get update
|
||||
@@ -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+=($!)
|
||||
|
||||
@@ -123,10 +129,6 @@ jobs:
|
||||
for pid in "${pids[@]}"; do
|
||||
wait "$pid"
|
||||
done
|
||||
- run:
|
||||
name: End CI Run
|
||||
command: npx nx-cloud@next complete-ci-run
|
||||
no_output_timeout: 20m
|
||||
# -------------------------
|
||||
# JOBS: Main-MacOS
|
||||
# -------------------------
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -38,7 +38,64 @@ launch-templates:
|
||||
- name: Install Browsers
|
||||
script: |
|
||||
pnpm exec cypress install
|
||||
pnpm exec playwright install
|
||||
pnpm exec playwright install --with-deps
|
||||
|
||||
- name: Install Rust
|
||||
script: |
|
||||
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
source "$HOME/.cargo/env"
|
||||
rustup toolchain install 1.70.0
|
||||
|
||||
- name: Configure git metadata (needed for lerna smoke tests)
|
||||
script: |
|
||||
git config --global user.email test@test.com
|
||||
git config --global user.name "Test Test"
|
||||
|
||||
- name: Load Cargo Env
|
||||
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
|
||||
|
||||
- name: Install zip and unzip
|
||||
script: sudo apt-get -yqq install zip unzip
|
||||
linux-large:
|
||||
resource-class: 'docker_linux_amd64/large'
|
||||
image: 'ubuntu22.04-node20.11-v10'
|
||||
env:
|
||||
GIT_AUTHOR_EMAIL: test@test.com
|
||||
GIT_AUTHOR_NAME: Test
|
||||
GIT_COMMITTER_EMAIL: test@test.com
|
||||
GIT_COMMITTER_NAME: Test
|
||||
SELECTED_PM: 'pnpm'
|
||||
NPM_CONFIG_PREFIX: '/home/workflows/.npm-global'
|
||||
NX_NATIVE_LOGGING: 'nx::native::db'
|
||||
init-steps:
|
||||
- name: Checkout
|
||||
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml'
|
||||
- name: Cache restore
|
||||
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
|
||||
inputs:
|
||||
key: 'pnpm-lock.yaml'
|
||||
paths: |
|
||||
node_modules
|
||||
~/.cache/Cypress
|
||||
~/.cache/ms-playwright
|
||||
~/.pnpm-store
|
||||
base_branch: 'master'
|
||||
- name: Install e2e deps
|
||||
script: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
|
||||
- name: Install Pnpm
|
||||
script: |
|
||||
npm install -g pnpm@9.8.0
|
||||
|
||||
- name: Pnpm Install
|
||||
script: |
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install Browsers
|
||||
script: |
|
||||
pnpm exec cypress install
|
||||
pnpm exec playwright install --with-deps
|
||||
|
||||
- name: Install Rust
|
||||
script: |
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
distribute-on:
|
||||
small-changeset: 8 linux-medium
|
||||
medium-changeset: 10 linux-medium
|
||||
large-changeset: 12 linux-medium
|
||||
default: auto linux-medium, 1 linux-large
|
||||
assignment-rules:
|
||||
- project: nx-dev
|
||||
target: build-base
|
||||
runs-on:
|
||||
- linux-large
|
||||
- target: test
|
||||
runs-on:
|
||||
- linux-medium
|
||||
|
||||
@@ -503,5 +503,10 @@
|
||||
"name": "nx-solhint",
|
||||
"description": "Solhint generators and inferred tasks for Nx",
|
||||
"url": "https://github.com/juliangsibecas/nx-solhint"
|
||||
},
|
||||
{
|
||||
"name": "nx-foundry",
|
||||
"description": "Foundry generators and inferred tasks for Nx",
|
||||
"url": "https://github.com/juliangsibecas/nx-foundry"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -188,7 +188,7 @@ It also generates a nice `CHANGELOG.md` for us:
|
||||
|
||||
- **buttons:** add new background shadow
|
||||
|
||||
### ❤️ Thank You
|
||||
### ❤️ Thank You
|
||||
|
||||
- Juri
|
||||
|
||||
|
||||
@@ -40,10 +40,6 @@ Note that you'll need to be an organization admin for your Nx Cloud workspace to
|
||||
Log in to Nx Cloud
|
||||
{% /call-to-action %}
|
||||
|
||||
### I want to try this, but I'm on the Hobby plan 🤔
|
||||
|
||||
If you're currently on the Hobby plan, you can start a free Pro plan trial for 14 days to try it out on your own workspace. No, we don't ask for credit cards to start a trial, so feel free to experiment!
|
||||
|
||||
## More to come!
|
||||
|
||||
This is just the first of a series of AI-powered features that we're going to be rolling out to your workspaces. We've got some cool features in the works already, which we're going to **announce publicly during the [Monorepo World](https://monorepo.world) conference in October**! So stay tuned!
|
||||
|
||||
@@ -125,7 +125,7 @@ Read all about how to [configure Codeowners for your project in our docs](/nx-en
|
||||
|
||||
A continuous effort on our Nx core is to improve speed. Last year, we began **rewriting performance-critical parts of Nx into Rust**, and more core components are being rewritten. As part of this effort, we also changed how we manage local cache, moving from a **file-based to a database-based approach**. In addition to small performance gains from reduced I/O, this opens up many opportunities for improving local cache handling, such as keeping only relevant cache based on usage, more easily controlling maximum cache size, and optimizing task orchestration by running failed tasks earlier.
|
||||
|
||||
As part of this new approach we're also going to [deprecate custom task runners](/deprecated/custom-task-runners) in Nx 20. I bring this up because it might affect users that relied on 3rd party tools that hooked into the task runners API.
|
||||
As part of this new approach we're also going to [deprecate custom task runners](/deprecated/legacy-cache) in Nx 20. I bring this up because it might affect users that relied on 3rd party tools that hooked into the task runners API.
|
||||
|
||||
To fill in on the custom task runner API we're providing a new Powerpack plugin that allows you to use S3 or a network drive as your storing mechanism for your Nx cache.
|
||||
|
||||
|
||||
@@ -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,147 @@
|
||||
---
|
||||
title: Handling CORS In Your Workspace
|
||||
slug: handling-cors
|
||||
authors: [Mike Hartington]
|
||||
tags: [nx]
|
||||
cover_image: '/blog/images/2024-11-14/cors.png'
|
||||
---
|
||||
|
||||
## CORS - The Great Initiation For Web Developers
|
||||
|
||||
Are you even a developer if you've never dealt with CORS? Jokes aside, CORS is one of those problems that everyone faces at least once in their life, and if it's your first time, it can be quite frustrating. CORS stands for Cross Origin Resource Sharing, which is a mechanism for allowing what URLs can access other URLs. Meaning if I have `http://site1.com` and I try to access something from `http://site2.com`, I will get an `Access-Control-Allow-Origin` error.
|
||||
|
||||
To demonstrate the issue most developers will encounter with CORS, take this example: I have a web server that I'm hosting locally on port 3333. This is a typical REST API that I can make a request to and get a response back:
|
||||
|
||||

|
||||
|
||||
That's working as expected, but now consider trying to make this request from a different origin. When I try to make my request in my web app, the request will fail:
|
||||
|
||||

|
||||
|
||||
This is due to CORS restriction that is actually built into our browser. Whenever you make a network request from one location (in this case, our Angular App that is hosted on [http://localhost:4200](http://localhost:4200/)) to a different location (the API hosted at [http://localhost:3333](http://localhost:3333/)), the browser will intercept this request, and if the API hasn't allowed requests from `localhost:4200`, it will block the request.
|
||||
|
||||
## Letting The Request Through
|
||||
|
||||
Now CORS-related issues can be addressed in multiple ways, and it can be as simple as bypassing CORS all together (the less ideal solution) or configuring a middleware for our dev server to intercept any requests.
|
||||
|
||||
> But wait, I thought Nx would do this for me?
|
||||
|
||||
In past releases, Nx would provide options in our executors to configure a proxy connection between backend and frontend applications. This still exists for example in our Angular plugin where we are still using executors. However, with our decision to move to a more “optionally opinionated” approach, we now recommend that you use native CLI tools (like vite or webpack) instead of our executors. In this approach, you’d configure the proxy exactly according to how the tool prescribes. Nx doesn’t get in your way!
|
||||
|
||||
To address this, our two possible solutions could be at the API level, or the framework level.
|
||||
|
||||
### Handle The CORS Request On The API
|
||||
|
||||
Let's take this very basic Express app that you can get when you run our default Express app generator from `@nx/express`:
|
||||
|
||||
```ts {% fileName="main.ts" %}
|
||||
import express from 'express';
|
||||
import * as path from 'path';
|
||||
const app = express();
|
||||
|
||||
app.use('/assets', express.static(path.join(__dirname, 'assets')));
|
||||
|
||||
app.get('/api', (_req, res) => {
|
||||
res.send({ message: 'Welcome to api!' });
|
||||
});
|
||||
|
||||
const port = process.env.PORT || 3333;
|
||||
const server = app.listen(port, () => {
|
||||
console.log(`Listening at <http://localhost>:${port}/api`);
|
||||
});
|
||||
server.on('error', console.error);
|
||||
```
|
||||
|
||||
There are two ways we can address CORS in our API. One approach can be to actually set the `Access-Control-Allow-Origin` header in our request:
|
||||
|
||||
```ts {% fileName="main.ts" %}
|
||||
app.get('/api', (_req, res) => {
|
||||
res
|
||||
.setHeader('Access-Control-Allow-Origin', '*')
|
||||
.send({ message: 'Welcome to api!' });
|
||||
});
|
||||
```
|
||||
|
||||
Or, we can use the `cors` middleware.
|
||||
|
||||
```shell
|
||||
npm install cors @types/cors
|
||||
```
|
||||
|
||||
With `cors` installed, you can import the package and `use` it in your app:
|
||||
|
||||
```diff {% fileName="main.ts" %}
|
||||
import express from 'express';
|
||||
import * as path from 'path';
|
||||
+ import cors from 'cors'
|
||||
|
||||
const app = express();
|
||||
|
||||
+ app.use(cors())
|
||||
|
||||
```
|
||||
|
||||
By just doing this, any requests made to our Express API will allow all requests, but you can limit it to certain origins by passing in some options to `cors()`
|
||||
|
||||
```ts {% fileName="main.ts" %}
|
||||
app.use(
|
||||
cors({
|
||||
origin: '<http://example.com>',
|
||||
})
|
||||
);
|
||||
```
|
||||
|
||||
Now, why would you use the `cors` middleware when you could just set the `Access-Control-Allow-Origin` header yourself? The middleware handles a lot of edge cases that you would need to write yourself, and at sub 250 lines of code, it doesn’t add too much to your codebase.
|
||||
|
||||
### Leave It To The Framework Tools
|
||||
|
||||
If you don't have control over the API and are not able to enable CORS, there's still another option for you. Most framework tools have an option to let you pass a proxy file to your dev server. Then any requests made during development can be proxied by the dev server, and you can continue building your app.
|
||||
|
||||
For example, in our Angular application, let's create a `proxy.conf.json` in our web project:
|
||||
|
||||
```shell
|
||||
touch apps/web/src/proxy.conf.json
|
||||
```
|
||||
|
||||
In that file, let's add the following:
|
||||
|
||||
```json {% fileName="proxy.conf.json" %}
|
||||
{
|
||||
"/api": {
|
||||
"target": "http://localhost:3333",
|
||||
"secure": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then in our in the `project.json`, let's tell the dev server about this newly created proxy file:
|
||||
|
||||
```diff {% fileName="project.json" %}
|
||||
"serve": {
|
||||
"executor": "@angular-devkit/build-angular:dev-server",
|
||||
+ "options":{
|
||||
+ "proxyConfig": "apps/web/src/proxy.conf.json"
|
||||
+ },
|
||||
```
|
||||
|
||||
With our dev server running, we can simply make requests to `/api` and the request will be allowed.
|
||||
|
||||
For frameworks like Vue and React that provide a Vite config, you can inline this right in the config:
|
||||
|
||||
```ts {% fileName="vite.config.ts" %}
|
||||
export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:3333',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
## Parting Thoughts
|
||||
|
||||
With CORS being an ever present issue in many apps, it's important to know how to address it when you run into it. By either addressing it at the API level or with in your app directly, you can make sure that CORS doesn't stop you from shipping your projects.
|
||||
|
||||
- [MDM CORS Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
title: See your affected project graph in Nx Cloud
|
||||
slug: ci-affected-graph
|
||||
authors: ['Philip Fulcher']
|
||||
tags: [nx-cloud]
|
||||
cover_image: /blog/images/2024-11-19/header.avif
|
||||
youtubeUrl: https://youtu.be/TS-Fp2iSlVM
|
||||
---
|
||||
|
||||
As monorepos grow in size and complexity, it can be difficult to understand the relationships between different parts of
|
||||
your codebase. That's why Nx has the [graph visualization](/features/explore-graph) that helps you see the different
|
||||
connections between projects and tasks in your workspace. But that runs locally, and sometimes you need to see that same graph from your CI's perspective. Now you can do that with the affected project graph in Nx Cloud.
|
||||
|
||||
## More insight into CI tasks
|
||||
|
||||
The CLI project graph visualization can give you some information about what projects or tasks are affected by your changes. But
|
||||
CI may run different tasks than you do locally, or compare to different branches for affected calculations. So you often
|
||||
feel like you're passing your work off to a black box with no insight into why a project is marked as affected on CI.
|
||||
|
||||
What do we mean by "marked as affected?" In a monorepo, running all your tasks, all the time, quickly becomes untenable. You'll either be wasting time waiting for tasks to finish, or spending a fortune on runners powerful enough to run in a timely manner. Instead, Nx analyzes the structure of your workspace and understands the relationship between different projects. When you run [`affected`](/ci/features/affected) tasks, it traces the projects that are actually affected by the change. For example, if you've made changes to a single app, Nx only marks that app as affected and doesn't run tasks for any other app.
|
||||
|
||||
## How do I use it?
|
||||
|
||||
The affected project graph is available on all CI Pipeline Executions (CIPEs) in Nx Cloud. Click the new "Affected Project Graph" link at the top of your CIPE view.
|
||||
|
||||

|
||||
|
||||
The affected project graph uses the new [Composite Graph](/features/explore-graph#focusing-on-valuable-projects) introduced in Nx 20.
|
||||
Groups of projects are collapsed into a single node on the graph based on directories. You can expand those nodes to see
|
||||
inside by double-clicking them, or by clicking on the node and then clicking "Expand".
|
||||
|
||||
You can explore affected project graphs on your own on the
|
||||
public [Nx OSS workspace](https://staging.nx.app/orgs/62d013d4d26f260059f7765e/workspaces/62d013ea0852fe0a2df74438/overview).
|
||||
|
||||
We've put together an example of one problem you can solve using this new view: [reducing the number of affected projects on CI](/ci/recipes/other/cipe-affected-project-graph).
|
||||
|
||||
## Get started with Nx Cloud
|
||||
|
||||
Not an Nx Cloud user? You can get started today, for free!
|
||||
|
||||
{% call-to-action title="Get started with Nx Cloud" url="/nx-cloud" icon="nxcloud" description="Try Nx Cloud for Free" %}
|
||||
Get started with Nx Cloud
|
||||
{% /call-to-action %}
|
||||
|
||||
## Learn more
|
||||
|
||||
- [Recipe: Reduce the Number of Affected Projects in a CI Pipeline Execution](/ci/recipes/other/cipe-affected-project-graph)
|
||||
- [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)
|
||||
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 775 KiB |
|
After Width: | Height: | Size: 338 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 970 KiB |
|
After Width: | Height: | Size: 23 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"
|
||||
}
|
||||
@@ -122,5 +122,33 @@ Regardless of how you manage your AWS authentication, you need to configure your
|
||||
| **Property** | **Description** |
|
||||
| ----------------- | --------------------------------------------------------------------------------- |
|
||||
| **region** | The id of the AWS region to use |
|
||||
| **bucket** | The name of the AWS bucket to use |
|
||||
| **bucket** | The name of the S3 bucket to use |
|
||||
| **encryptionKey** | Nx encryption key used to encrypt and decrypt artifacts from the cache (optional) |
|
||||
|
||||
#### S3 Compatible Providers
|
||||
|
||||
To use `@nx/powerpack-s3-cache` with S3 compatible providers ([MinIO](https://min.io/product/s3-compatibility), [LocalStack](https://www.localstack.cloud), [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces), [Cloudflare](https://www.cloudflare.com/developer-platform/solutions/s3-compatible-object-storage), etc..), `endpoint` will need to be provided. Some providers also need to have `forcePathStyle` set to true in the configuration.
|
||||
|
||||
Below is an example on how to connect to MinIO:
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"s3": {
|
||||
"region": "us-east-1",
|
||||
"bucket": "my-bucket",
|
||||
"endpoint": "https://play.min.io",
|
||||
"forcePathStyle": true,
|
||||
"accessKeyId": "abc1234",
|
||||
"secretAccessKey": "4321cba"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| **Property** | **Description** |
|
||||
| ------------------- | --------------------------------------------------------------------------------------------------------- |
|
||||
| **region** | The id of the S3 compatible storage region to use |
|
||||
| **bucket** | The name of the S3 compatible storage bucket to use |
|
||||
| **forcePathStyle** | Changes the way artifacts are uploaded. Usually used for S3 compatible providers (MinIO, LocalStack, etc) |
|
||||
| **endpoint** | The custom endpoint to upload artifacts to. If endpoint is not defined, the default AWS endpoint is used |
|
||||
| **accessKeyId** | AWS Access Key ID (optional if `AWS_ACCESS_KEY_ID` is set in the environment) |
|
||||
| **secretAccessKey** | AWS secret access key (optional if `AWS_SECRET_ACCESS_KEY` is set in the environment) |
|
||||
|
||||
@@ -9,16 +9,26 @@
|
||||
"properties": {
|
||||
"region": {
|
||||
"type": "string",
|
||||
"description": "The AWS region the bucket is located in",
|
||||
"x-prompt": "Which AWS region is the bucket located in?"
|
||||
"description": "The AWS region the bucket is located in"
|
||||
},
|
||||
"accessKeyId": {
|
||||
"type": "string",
|
||||
"description": "The AWS Access Key ID to use to access the S3 Bucket, alternatively set the AWS_ACCESS_KEY_ID environment variable"
|
||||
},
|
||||
"secretAccessKey": {
|
||||
"type": "string",
|
||||
"description": "The AWS Secret Access Key to use to access the S3 Bucket, alternatively set the AWS_SECRET_ACCESS_KEY environment variable"
|
||||
},
|
||||
"bucket": {
|
||||
"type": "string",
|
||||
"description": "The the name of the S3 Bucket to store the Nx Cache in",
|
||||
"x-prompt": "What is the name of the S3 Bucket to store the Nx Cache in?"
|
||||
"description": "The the name of the S3 Bucket to store the Nx Cache in"
|
||||
},
|
||||
"forcePathStyle": {
|
||||
"type": "boolean",
|
||||
"description": "Set to true to use path style URLs for S3 objects"
|
||||
}
|
||||
},
|
||||
"required": ["region", "bucket"],
|
||||
"required": [],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Initialize the S3 Cache",
|
||||
|
||||
@@ -600,7 +600,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/security/personal-access-tokens",
|
||||
"tags": []
|
||||
"tags": ["login"]
|
||||
},
|
||||
{
|
||||
"id": "encryption",
|
||||
@@ -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,
|
||||
@@ -881,6 +915,17 @@
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/other/ci-deployment",
|
||||
"tags": ["docker", "deploy"]
|
||||
},
|
||||
{
|
||||
"id": "cipe-affected-project-graph",
|
||||
"name": "Reduce the Number of Affected Projects in a CI Pipeline Execution",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/recipes/cipe-affected-project-graph",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/other/cipe-affected-project-graph",
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
@@ -1074,7 +1119,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/security/personal-access-tokens",
|
||||
"tags": []
|
||||
"tags": ["login"]
|
||||
},
|
||||
{
|
||||
"id": "encryption",
|
||||
@@ -1123,7 +1168,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/security/personal-access-tokens",
|
||||
"tags": []
|
||||
"tags": ["login"]
|
||||
},
|
||||
"/ci/recipes/security/encryption": {
|
||||
"id": "encryption",
|
||||
@@ -1409,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,
|
||||
@@ -1725,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",
|
||||
@@ -1753,6 +1888,17 @@
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/other/ci-deployment",
|
||||
"tags": ["docker", "deploy"]
|
||||
},
|
||||
{
|
||||
"id": "cipe-affected-project-graph",
|
||||
"name": "Reduce the Number of Affected Projects in a CI Pipeline Execution",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/recipes/cipe-affected-project-graph",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/other/cipe-affected-project-graph",
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
@@ -1781,6 +1927,17 @@
|
||||
"path": "/ci/recipes/other/ci-deployment",
|
||||
"tags": ["docker", "deploy"]
|
||||
},
|
||||
"/ci/recipes/other/cipe-affected-project-graph": {
|
||||
"id": "cipe-affected-project-graph",
|
||||
"name": "Reduce the Number of Affected Projects in a CI Pipeline Execution",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/recipes/cipe-affected-project-graph",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/recipes/other/cipe-affected-project-graph",
|
||||
"tags": []
|
||||
},
|
||||
"/ci/reference": {
|
||||
"id": "reference",
|
||||
"name": "Reference",
|
||||
@@ -1821,6 +1978,17 @@
|
||||
"path": "/ci/reference/launch-templates",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "assignment-rules",
|
||||
"name": "Assignment Rules",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/reference/assignment-rules",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/reference/assignment-rules",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "custom-steps",
|
||||
"name": "Custom Steps",
|
||||
@@ -1892,6 +2060,17 @@
|
||||
"path": "/ci/reference/launch-templates",
|
||||
"tags": []
|
||||
},
|
||||
"/ci/reference/assignment-rules": {
|
||||
"id": "assignment-rules",
|
||||
"name": "Assignment Rules",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "nx-cloud/reference/assignment-rules",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/ci/reference/assignment-rules",
|
||||
"tags": []
|
||||
},
|
||||
"/ci/reference/custom-steps": {
|
||||
"id": "custom-steps",
|
||||
"name": "Custom Steps",
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/extending-nx/recipes/create-sync-generator",
|
||||
"tags": ["generate-code"]
|
||||
"tags": ["generate-code", "sync"]
|
||||
},
|
||||
{
|
||||
"id": "migration-generators",
|
||||
@@ -308,7 +308,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/extending-nx/recipes/create-sync-generator",
|
||||
"tags": ["generate-code"]
|
||||
"tags": ["generate-code", "sync"]
|
||||
},
|
||||
"/extending-nx/recipes/migration-generators": {
|
||||
"id": "migration-generators",
|
||||
|
||||
@@ -4796,9 +4796,9 @@
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Custom Task Runners",
|
||||
"path": "/deprecated/custom-task-runners",
|
||||
"id": "custom-task-runners",
|
||||
"name": "Legacy Cache",
|
||||
"path": "/deprecated/legacy-cache",
|
||||
"id": "legacy-cache",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
@@ -4919,9 +4919,9 @@
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Custom Task Runners",
|
||||
"path": "/deprecated/custom-task-runners",
|
||||
"id": "custom-task-runners",
|
||||
"name": "Legacy Cache",
|
||||
"path": "/deprecated/legacy-cache",
|
||||
"id": "legacy-cache",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
@@ -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
|
||||
@@ -6066,6 +6091,14 @@
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Reduce the Number of Affected Projects in a CI Pipeline Execution",
|
||||
"path": "/ci/recipes/other/cipe-affected-project-graph",
|
||||
"id": "cipe-affected-project-graph",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
@@ -6451,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
|
||||
@@ -6681,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",
|
||||
@@ -6702,6 +6801,14 @@
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Reduce the Number of Affected Projects in a CI Pipeline Execution",
|
||||
"path": "/ci/recipes/other/cipe-affected-project-graph",
|
||||
"id": "cipe-affected-project-graph",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
@@ -6722,6 +6829,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Reduce the Number of Affected Projects in a CI Pipeline Execution",
|
||||
"path": "/ci/recipes/other/cipe-affected-project-graph",
|
||||
"id": "cipe-affected-project-graph",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Reference",
|
||||
"path": "/ci/reference",
|
||||
@@ -6752,6 +6867,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Assignment Rules",
|
||||
"path": "/ci/reference/assignment-rules",
|
||||
"id": "assignment-rules",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Custom Steps",
|
||||
"path": "/ci/reference/custom-steps",
|
||||
@@ -6803,6 +6926,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Assignment Rules",
|
||||
"path": "/ci/reference/assignment-rules",
|
||||
"id": "assignment-rules",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Custom Steps",
|
||||
"path": "/ci/reference/custom-steps",
|
||||
@@ -10579,9 +10710,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
|
||||
|
||||
@@ -1736,7 +1736,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/create-nx-workspace",
|
||||
"tags": [],
|
||||
"tags": ["installation"],
|
||||
"originalFilePath": "generated/cli/create-nx-workspace"
|
||||
},
|
||||
"/nx-api/nx/documents/init": {
|
||||
@@ -1747,7 +1747,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/init",
|
||||
"tags": [],
|
||||
"tags": ["init"],
|
||||
"originalFilePath": "generated/cli/init"
|
||||
},
|
||||
"/nx-api/nx/documents/generate": {
|
||||
@@ -1780,7 +1780,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/daemon",
|
||||
"tags": [],
|
||||
"tags": ["daemon"],
|
||||
"originalFilePath": "generated/cli/daemon"
|
||||
},
|
||||
"/nx-api/nx/documents/dep-graph": {
|
||||
@@ -1912,7 +1912,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/sync",
|
||||
"tags": [],
|
||||
"tags": ["sync"],
|
||||
"originalFilePath": "generated/cli/sync"
|
||||
},
|
||||
"/nx-api/nx/documents/sync-check": {
|
||||
@@ -1923,7 +1923,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/sync-check",
|
||||
"tags": [],
|
||||
"tags": ["sync"],
|
||||
"originalFilePath": "generated/cli/sync-check"
|
||||
},
|
||||
"/nx-api/nx/documents/import": {
|
||||
@@ -1934,7 +1934,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/import",
|
||||
"tags": [],
|
||||
"tags": ["import"],
|
||||
"originalFilePath": "generated/cli/import"
|
||||
},
|
||||
"/nx-api/nx/documents/exec": {
|
||||
@@ -1945,7 +1945,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/exec",
|
||||
"tags": [],
|
||||
"tags": ["exec"],
|
||||
"originalFilePath": "generated/cli/exec"
|
||||
},
|
||||
"/nx-api/nx/documents/watch": {
|
||||
@@ -1967,7 +1967,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/show",
|
||||
"tags": [],
|
||||
"tags": ["explore-graph"],
|
||||
"originalFilePath": "generated/cli/show"
|
||||
},
|
||||
"/nx-api/nx/documents/view-logs": {
|
||||
@@ -2000,7 +2000,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/add",
|
||||
"tags": [],
|
||||
"tags": ["add"],
|
||||
"originalFilePath": "generated/cli/add"
|
||||
},
|
||||
"/nx-api/nx/documents/login": {
|
||||
@@ -2011,7 +2011,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/login",
|
||||
"tags": [],
|
||||
"tags": ["login"],
|
||||
"originalFilePath": "generated/cli/login"
|
||||
},
|
||||
"/nx-api/nx/documents/logout": {
|
||||
@@ -2022,7 +2022,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/nx/documents/logout",
|
||||
"tags": [],
|
||||
"tags": ["login"],
|
||||
"originalFilePath": "generated/cli/logout"
|
||||
}
|
||||
},
|
||||
@@ -3651,13 +3651,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"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -791,7 +791,12 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/concepts/nx-plugins",
|
||||
"tags": ["generate-code", "create-your-own-plugin", "inferred-tasks"]
|
||||
"tags": [
|
||||
"add",
|
||||
"generate-code",
|
||||
"create-your-own-plugin",
|
||||
"inferred-tasks"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "inferred-tasks",
|
||||
@@ -835,7 +840,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/concepts/nx-daemon",
|
||||
"tags": []
|
||||
"tags": ["daemon"]
|
||||
},
|
||||
{
|
||||
"id": "sync-generators",
|
||||
@@ -846,7 +851,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/concepts/sync-generators",
|
||||
"tags": []
|
||||
"tags": ["sync"]
|
||||
},
|
||||
{
|
||||
"id": "turbo-and-nx",
|
||||
@@ -1073,7 +1078,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/concepts/nx-plugins",
|
||||
"tags": ["generate-code", "create-your-own-plugin", "inferred-tasks"]
|
||||
"tags": ["add", "generate-code", "create-your-own-plugin", "inferred-tasks"]
|
||||
},
|
||||
"/concepts/inferred-tasks": {
|
||||
"id": "inferred-tasks",
|
||||
@@ -1117,7 +1122,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/concepts/nx-daemon",
|
||||
"tags": []
|
||||
"tags": ["daemon"]
|
||||
},
|
||||
"/concepts/sync-generators": {
|
||||
"id": "sync-generators",
|
||||
@@ -1128,7 +1133,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/concepts/sync-generators",
|
||||
"tags": []
|
||||
"tags": ["sync"]
|
||||
},
|
||||
"/concepts/turbo-and-nx": {
|
||||
"id": "turbo-and-nx",
|
||||
@@ -1563,7 +1568,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/running-tasks/root-level-scripts",
|
||||
"tags": ["run-tasks"]
|
||||
"tags": ["run-tasks", "exec"]
|
||||
},
|
||||
{
|
||||
"id": "workspace-watching",
|
||||
@@ -1641,7 +1646,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/adopting-nx/adding-to-monorepo",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
{
|
||||
"id": "from-turborepo",
|
||||
@@ -1663,7 +1668,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/adopting-nx/adding-to-existing-project",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
{
|
||||
"id": "import-project",
|
||||
@@ -1674,7 +1679,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/adopting-nx/import-project",
|
||||
"tags": []
|
||||
"tags": ["import"]
|
||||
},
|
||||
{
|
||||
"id": "preserving-git-histories",
|
||||
@@ -2104,7 +2109,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/angular/migration/angular",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
{
|
||||
"id": "angular-multiple",
|
||||
@@ -2679,7 +2684,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/tips-n-tricks/keep-nx-versions-in-sync",
|
||||
"tags": ["automate-updating-dependencies"]
|
||||
"tags": ["automate-updating-dependencies", "add"]
|
||||
},
|
||||
{
|
||||
"id": "define-environment-variables",
|
||||
@@ -2939,7 +2944,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/running-tasks/root-level-scripts",
|
||||
"tags": ["run-tasks"]
|
||||
"tags": ["run-tasks", "exec"]
|
||||
},
|
||||
{
|
||||
"id": "workspace-watching",
|
||||
@@ -3076,7 +3081,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/running-tasks/root-level-scripts",
|
||||
"tags": ["run-tasks"]
|
||||
"tags": ["run-tasks", "exec"]
|
||||
},
|
||||
"/recipes/running-tasks/workspace-watching": {
|
||||
"id": "workspace-watching",
|
||||
@@ -3149,7 +3154,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/adopting-nx/adding-to-monorepo",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
{
|
||||
"id": "from-turborepo",
|
||||
@@ -3171,7 +3176,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/adopting-nx/adding-to-existing-project",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
{
|
||||
"id": "import-project",
|
||||
@@ -3182,7 +3187,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/adopting-nx/import-project",
|
||||
"tags": []
|
||||
"tags": ["import"]
|
||||
},
|
||||
{
|
||||
"id": "preserving-git-histories",
|
||||
@@ -3220,7 +3225,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/adopting-nx/adding-to-monorepo",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
"/recipes/adopting-nx/from-turborepo": {
|
||||
"id": "from-turborepo",
|
||||
@@ -3242,7 +3247,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/adopting-nx/adding-to-existing-project",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
"/recipes/adopting-nx/import-project": {
|
||||
"id": "import-project",
|
||||
@@ -3253,7 +3258,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/adopting-nx/import-project",
|
||||
"tags": []
|
||||
"tags": ["import"]
|
||||
},
|
||||
"/recipes/adopting-nx/preserving-git-histories": {
|
||||
"id": "preserving-git-histories",
|
||||
@@ -4008,7 +4013,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/angular/migration/angular",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
{
|
||||
"id": "angular-multiple",
|
||||
@@ -4102,7 +4107,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/angular/migration/angular",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
{
|
||||
"id": "angular-multiple",
|
||||
@@ -4129,7 +4134,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/angular/migration/angular",
|
||||
"tags": []
|
||||
"tags": ["init"]
|
||||
},
|
||||
"/recipes/angular/migration/angular-multiple": {
|
||||
"id": "angular-multiple",
|
||||
@@ -5024,7 +5029,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/tips-n-tricks/keep-nx-versions-in-sync",
|
||||
"tags": ["automate-updating-dependencies"]
|
||||
"tags": ["automate-updating-dependencies", "add"]
|
||||
},
|
||||
{
|
||||
"id": "define-environment-variables",
|
||||
@@ -5205,7 +5210,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/tips-n-tricks/keep-nx-versions-in-sync",
|
||||
"tags": ["automate-updating-dependencies"]
|
||||
"tags": ["automate-updating-dependencies", "add"]
|
||||
},
|
||||
"/recipes/tips-n-tricks/define-environment-variables": {
|
||||
"id": "define-environment-variables",
|
||||
@@ -6567,14 +6572,14 @@
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "custom-task-runners",
|
||||
"name": "Custom Task Runners",
|
||||
"id": "legacy-cache",
|
||||
"name": "Legacy Cache",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/deprecated/custom-task-runners",
|
||||
"file": "shared/deprecated/legacy-cache",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/deprecated/custom-task-runners",
|
||||
"path": "/deprecated/legacy-cache",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
@@ -6736,15 +6741,15 @@
|
||||
"path": "/deprecated/workspace-generators",
|
||||
"tags": []
|
||||
},
|
||||
"/deprecated/custom-task-runners": {
|
||||
"id": "custom-task-runners",
|
||||
"name": "Custom Task Runners",
|
||||
"/deprecated/legacy-cache": {
|
||||
"id": "legacy-cache",
|
||||
"name": "Legacy Cache",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/deprecated/custom-task-runners",
|
||||
"file": "shared/deprecated/legacy-cache",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/deprecated/custom-task-runners",
|
||||
"path": "/deprecated/legacy-cache",
|
||||
"tags": []
|
||||
},
|
||||
"/deprecated/workspace-executors": {
|
||||
|
||||
@@ -278,6 +278,13 @@
|
||||
"id": "dep-graph",
|
||||
"name": "graph",
|
||||
"path": "/nx-api/nx/documents/dep-graph"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/show",
|
||||
"id": "show",
|
||||
"name": "show",
|
||||
"path": "/nx-api/nx/documents/show"
|
||||
}
|
||||
],
|
||||
"generate-code": [
|
||||
@@ -628,6 +635,29 @@
|
||||
"path": "/extending-nx/recipes/project-graph-plugins"
|
||||
}
|
||||
],
|
||||
"add": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/concepts/nx-plugins",
|
||||
"id": "nx-plugins",
|
||||
"name": "What Are Nx Plugins",
|
||||
"path": "/concepts/nx-plugins"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/tips-n-tricks/keep-nx-versions-in-sync",
|
||||
"id": "keep-nx-versions-in-sync",
|
||||
"name": "Keep Nx Versions in Sync",
|
||||
"path": "/recipes/tips-n-tricks/keep-nx-versions-in-sync"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/add",
|
||||
"id": "add",
|
||||
"name": "add",
|
||||
"path": "/nx-api/nx/documents/add"
|
||||
}
|
||||
],
|
||||
"create-your-own-plugin": [
|
||||
{
|
||||
"description": "",
|
||||
@@ -679,6 +709,52 @@
|
||||
"path": "/nx-api/angular/documents/nx-devkit-angular-devkit"
|
||||
}
|
||||
],
|
||||
"daemon": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/concepts/daemon",
|
||||
"id": "nx-daemon",
|
||||
"name": "Nx Daemon",
|
||||
"path": "/concepts/nx-daemon"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/daemon",
|
||||
"id": "daemon",
|
||||
"name": "daemon",
|
||||
"path": "/nx-api/nx/documents/daemon"
|
||||
}
|
||||
],
|
||||
"sync": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/concepts/sync-generators",
|
||||
"id": "sync-generators",
|
||||
"name": "Sync Generators",
|
||||
"path": "/concepts/sync-generators"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/create-sync-generator",
|
||||
"id": "create-sync-generator",
|
||||
"name": "Create a Sync Generator",
|
||||
"path": "/extending-nx/recipes/create-sync-generator"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/sync",
|
||||
"id": "sync",
|
||||
"name": "sync",
|
||||
"path": "/nx-api/nx/documents/sync"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/sync-check",
|
||||
"id": "sync-check",
|
||||
"name": "sync:check",
|
||||
"path": "/nx-api/nx/documents/sync-check"
|
||||
}
|
||||
],
|
||||
"module-federation": [
|
||||
{
|
||||
"description": "",
|
||||
@@ -811,6 +887,29 @@
|
||||
"id": "activate-powerpack",
|
||||
"name": "Activate Powerpack",
|
||||
"path": "/nx-enterprise/activate-powerpack"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/create-nx-workspace",
|
||||
"id": "create-nx-workspace",
|
||||
"name": "create-nx-workspace",
|
||||
"path": "/nx-api/nx/documents/create-nx-workspace"
|
||||
}
|
||||
],
|
||||
"exec": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/running-tasks/root-level-scripts",
|
||||
"id": "root-level-scripts",
|
||||
"name": "Run Root-Level NPM Scripts with Nx",
|
||||
"path": "/recipes/running-tasks/root-level-scripts"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/exec",
|
||||
"id": "exec",
|
||||
"name": "exec",
|
||||
"path": "/nx-api/nx/documents/exec"
|
||||
}
|
||||
],
|
||||
"workspace-watching": [
|
||||
@@ -829,6 +928,52 @@
|
||||
"path": "/nx-api/nx/documents/watch"
|
||||
}
|
||||
],
|
||||
"init": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/migration/adding-to-monorepo",
|
||||
"id": "adding-to-monorepo",
|
||||
"name": "NPM/Yarn/PNPM workspaces",
|
||||
"path": "/recipes/adopting-nx/adding-to-monorepo"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/migration/adding-to-existing-project",
|
||||
"id": "adding-to-existing-project",
|
||||
"name": "Add to any Project",
|
||||
"path": "/recipes/adopting-nx/adding-to-existing-project"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/migration/migration-angular",
|
||||
"id": "angular",
|
||||
"name": "Migrating from Angular CLI",
|
||||
"path": "/recipes/angular/migration/angular"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/init",
|
||||
"id": "init",
|
||||
"name": "init",
|
||||
"path": "/nx-api/nx/documents/init"
|
||||
}
|
||||
],
|
||||
"import": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/migration/import-project",
|
||||
"id": "import-project",
|
||||
"name": "Import an Existing Project into an Nx Workspace",
|
||||
"path": "/recipes/adopting-nx/import-project"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/import",
|
||||
"id": "import",
|
||||
"name": "import",
|
||||
"path": "/nx-api/nx/documents/import"
|
||||
}
|
||||
],
|
||||
"environment-variables": [
|
||||
{
|
||||
"description": "",
|
||||
@@ -1090,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": [
|
||||
@@ -1195,6 +1354,29 @@
|
||||
"path": "/ci/features/remote-cache"
|
||||
}
|
||||
],
|
||||
"login": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "nx-cloud/recipes/personal-access-tokens",
|
||||
"id": "personal-access-tokens",
|
||||
"name": "Personal Access Tokens",
|
||||
"path": "/ci/recipes/security/personal-access-tokens"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/login",
|
||||
"id": "login",
|
||||
"name": "login",
|
||||
"path": "/nx-api/nx/documents/login"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/nx/documents/logout",
|
||||
"id": "logout",
|
||||
"name": "logout",
|
||||
"path": "/nx-api/nx/documents/logout"
|
||||
}
|
||||
],
|
||||
"single-tenant": [
|
||||
{
|
||||
"description": "",
|
||||
|
||||
@@ -1715,7 +1715,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/create-nx-workspace",
|
||||
"tags": [],
|
||||
"tags": ["installation"],
|
||||
"originalFilePath": "generated/cli/create-nx-workspace"
|
||||
},
|
||||
{
|
||||
@@ -1726,7 +1726,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/init",
|
||||
"tags": [],
|
||||
"tags": ["init"],
|
||||
"originalFilePath": "generated/cli/init"
|
||||
},
|
||||
{
|
||||
@@ -1759,7 +1759,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/daemon",
|
||||
"tags": [],
|
||||
"tags": ["daemon"],
|
||||
"originalFilePath": "generated/cli/daemon"
|
||||
},
|
||||
{
|
||||
@@ -1891,7 +1891,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/sync",
|
||||
"tags": [],
|
||||
"tags": ["sync"],
|
||||
"originalFilePath": "generated/cli/sync"
|
||||
},
|
||||
{
|
||||
@@ -1902,7 +1902,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/sync-check",
|
||||
"tags": [],
|
||||
"tags": ["sync"],
|
||||
"originalFilePath": "generated/cli/sync-check"
|
||||
},
|
||||
{
|
||||
@@ -1913,7 +1913,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/import",
|
||||
"tags": [],
|
||||
"tags": ["import"],
|
||||
"originalFilePath": "generated/cli/import"
|
||||
},
|
||||
{
|
||||
@@ -1924,7 +1924,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/exec",
|
||||
"tags": [],
|
||||
"tags": ["exec"],
|
||||
"originalFilePath": "generated/cli/exec"
|
||||
},
|
||||
{
|
||||
@@ -1946,7 +1946,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/show",
|
||||
"tags": [],
|
||||
"tags": ["explore-graph"],
|
||||
"originalFilePath": "generated/cli/show"
|
||||
},
|
||||
{
|
||||
@@ -1979,7 +1979,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/add",
|
||||
"tags": [],
|
||||
"tags": ["add"],
|
||||
"originalFilePath": "generated/cli/add"
|
||||
},
|
||||
{
|
||||
@@ -1990,7 +1990,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/login",
|
||||
"tags": [],
|
||||
"tags": ["login"],
|
||||
"originalFilePath": "generated/cli/login"
|
||||
},
|
||||
{
|
||||
@@ -2001,7 +2001,7 @@
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "nx/documents/logout",
|
||||
"tags": [],
|
||||
"tags": ["login"],
|
||||
"originalFilePath": "generated/cli/logout"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -175,7 +175,6 @@
|
||||
"optimization": {
|
||||
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
|
||||
"default": true,
|
||||
"x-user-analytics": "ep.ng_optimization",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
@@ -304,7 +303,6 @@
|
||||
"aot": {
|
||||
"type": "boolean",
|
||||
"description": "Build using Ahead of Time compilation.",
|
||||
"x-user-analytics": "ep.ng_aot",
|
||||
"default": true
|
||||
},
|
||||
"sourceMap": {
|
||||
|
||||
@@ -171,7 +171,6 @@
|
||||
"optimization": {
|
||||
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
|
||||
"default": true,
|
||||
"x-user-analytics": "ep.ng_optimization",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
@@ -256,7 +255,6 @@
|
||||
"aot": {
|
||||
"type": "boolean",
|
||||
"description": "Build using Ahead of Time compilation.",
|
||||
"x-user-analytics": "ep.ng_aot",
|
||||
"default": true
|
||||
},
|
||||
"sourceMap": {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"title": "Schema for Webpack Dev Server",
|
||||
"description": "Serves an Angular application using [webpack](https://webpack.js.org/) when the build target is using a webpack-based executor, or [Vite](https://vitejs.dev/) when the build target uses an [esbuild](https://esbuild.github.io/)-based executor.",
|
||||
"examplesFile": "This executor is a drop-in replacement for the `@angular-devkit/build-angular:dev-server` builder provided by the Angular CLI. In addition to the features provided by the Angular CLI builder, the `@nx/angular:dev-server` executor also supports the following:\n\n- Serving applications with Vite when using the `@nx/angular:application` or `@nx/angular:browser-esbuild` executors to build them\n- Serving applications with webpack when using the `@nx/angular:webpack-browser` executor\n- Providing HTTP request middleware functions when the build target is using an esbuild-based executor\n- Incremental builds\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Using a custom webpack configuration\" %}\n\nThis executor should be used along with `@nx/angular:webpack-browser` to serve an application using a custom webpack configuration.\n\nAdd the `serve` target using the `@nx/angular:dev-server` executor, set the `build` target executor as `@nx/angular:webpack-browser` and set the `customWebpackConfig` option as shown below:\n\n```json {% fileName=\"apps/my-app/project.json\" highlightLines=[2,\"5-7\",\"10-20\"] %}\n\"build\": {\n \"executor\": \"@nx/angular:webpack-browser\",\n \"options\": {\n ...\n \"customWebpackConfig\": {\n \"path\": \"apps/my-app/webpack.config.js\"\n }\n }\n},\n\"serve\": {\n \"executor\": \"@nx/angular:dev-server\",\n \"configurations\": {\n \"production\": {\n \"buildTarget\": \"my-app:build:production\"\n },\n \"development\": {\n \"buildTarget\": \"my-app:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n}\n```\n\n```js {% fileName=\"apps/my-app/webpack.config.js\" %}\nmodule.exports = (config) => {\n // update the config with your custom configuration\n\n return config;\n};\n```\n\n{% /tab %}\n\n{% tab label=\"Providing HTTP request middleware function\" %}\n\n{% callout type=\"warning\" title=\"Overrides\" }\n\nAvailable for workspaces using Angular version 17.0.0 or greater and with `build` targets using an esbuild-based executor.\n\n{% /callout %}\n\nThe executor accepts an `esbuildMidleware` option that allows you to provide HTTP require middleware functions that will be used by the Vite development server.\n\n```json {% fileName=\"apps/my-app/project.json\" highlightLines=[8] %}\n{\n ...\n \"targets\": {\n \"serve\": {\n \"executor\": \"@nx/angular:dev-server\",\n \"options\": {\n ...\n \"esbuildMidleware\": [\"apps/my-app/hello-world.middleware.ts\"]\n }\n }\n ...\n }\n}\n```\n\n```ts {% fileName=\"apps/my-app/hello-world.middleware.ts\" %}\nimport type { IncomingMessage, ServerResponse } from 'node:http';\n\nconst helloWorldMiddleware = (\n req: IncomingMessage,\n res: ServerResponse,\n next: (err?: unknown) => void\n) => {\n if (req.url === '/hello-world') {\n res.end('<h1>Hello World!</h1>');\n } else {\n next();\n }\n};\n\nexport default helloWorldMiddleware;\n```\n\n{% /tab %}\n",
|
||||
"examplesFile": "This executor is a drop-in replacement for the `@angular-devkit/build-angular:dev-server` builder provided by the Angular CLI. In addition to the features provided by the Angular CLI builder, the `@nx/angular:dev-server` executor also supports the following:\n\n- Serving applications with Vite when using the `@nx/angular:application` or `@nx/angular:browser-esbuild` executors to build them\n- Serving applications with webpack when using the `@nx/angular:webpack-browser` executor\n- Providing HTTP request middleware functions when the build target is using an esbuild-based executor\n- Incremental builds\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Using a custom webpack configuration\" %}\n\nThis executor should be used along with `@nx/angular:webpack-browser` to serve an application using a custom webpack configuration.\n\nAdd the `serve` target using the `@nx/angular:dev-server` executor, set the `build` target executor as `@nx/angular:webpack-browser` and set the `customWebpackConfig` option as shown below:\n\n```json {% fileName=\"apps/my-app/project.json\" highlightLines=[2,\"5-7\",\"10-20\"] %}\n\"build\": {\n \"executor\": \"@nx/angular:webpack-browser\",\n \"options\": {\n ...\n \"customWebpackConfig\": {\n \"path\": \"apps/my-app/webpack.config.js\"\n }\n }\n},\n\"serve\": {\n \"executor\": \"@nx/angular:dev-server\",\n \"configurations\": {\n \"production\": {\n \"buildTarget\": \"my-app:build:production\"\n },\n \"development\": {\n \"buildTarget\": \"my-app:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n}\n```\n\n```js {% fileName=\"apps/my-app/webpack.config.js\" %}\nmodule.exports = (config) => {\n // update the config with your custom configuration\n\n return config;\n};\n```\n\n{% /tab %}\n\n{% tab label=\"Providing HTTP request middleware function\" %}\n\n{% callout type=\"warning\" title=\"Overrides\" }\n\nAvailable for workspaces using Angular version 17.0.0 or greater and with `build` targets using an esbuild-based executor.\n\n{% /callout %}\n\nThe executor accepts an `esbuildMiddleware` option that allows you to provide HTTP require middleware functions that will be used by the Vite development server.\n\n```json {% fileName=\"apps/my-app/project.json\" highlightLines=[8] %}\n{\n ...\n \"targets\": {\n \"serve\": {\n \"executor\": \"@nx/angular:dev-server\",\n \"options\": {\n ...\n \"esbuildMiddleware\": [\"apps/my-app/hello-world.middleware.ts\"]\n }\n }\n ...\n }\n}\n```\n\n```ts {% fileName=\"apps/my-app/hello-world.middleware.ts\" %}\nimport type { IncomingMessage, ServerResponse } from 'node:http';\n\nconst helloWorldMiddleware = (\n req: IncomingMessage,\n res: ServerResponse,\n next: (err?: unknown) => void\n) => {\n if (req.url === '/hello-world') {\n res.end('<h1>Hello World!</h1>');\n } else {\n next();\n }\n};\n\nexport default helloWorldMiddleware;\n```\n\n{% /tab %}\n",
|
||||
"type": "object",
|
||||
"presets": [
|
||||
{ "name": "Using a Different Port", "keys": ["buildTarget", "port"] }
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
},
|
||||
"optimization": {
|
||||
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
|
||||
"x-user-analytics": 16,
|
||||
"default": true,
|
||||
"oneOf": [
|
||||
{
|
||||
@@ -293,7 +292,6 @@
|
||||
"aot": {
|
||||
"type": "boolean",
|
||||
"description": "Build using Ahead of Time compilation.",
|
||||
"x-user-analytics": 13,
|
||||
"default": true
|
||||
},
|
||||
"sourceMap": {
|
||||
|
||||
@@ -80,7 +80,6 @@
|
||||
"optimization": {
|
||||
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
|
||||
"default": true,
|
||||
"x-user-analytics": "ep.ng_optimization",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
},
|
||||
"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 without the file extension and suffix. 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",
|
||||
@@ -113,7 +112,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\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"],
|
||||
|
||||
@@ -9,17 +9,26 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 without the file extension and suffix. 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",
|
||||
|
||||
@@ -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,26 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 without the file extension and suffix. 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",
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 +22,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 without the file extension and suffix. 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 +41,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,12 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 +22,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 without the file extension and suffix. 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 +41,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,12 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 +22,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 without the file extension and suffix. 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; }`.",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -30,6 +30,7 @@ The `@nx/eslint` plugin will create a task for any project that has an ESLint co
|
||||
- `.eslintrc.yml`
|
||||
- `.eslintrc.json`
|
||||
- `eslint.config.js`
|
||||
- `eslint.config.cjs`
|
||||
|
||||
Because ESLint applies configuration files to all subdirectories, the `@nx/eslint` plugin will also infer tasks for projects in subdirectories. So, if there is an ESLint configuration file in the root of the repository, every project will have an inferred ESLint task.
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -9,26 +9,28 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 --name=custom"
|
||||
},
|
||||
{
|
||||
"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 without the file extension. 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",
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Using TypeScript Transformer Plugins\" %}\n\n`@nx/js:tsc` can run the [TypeScript Transformers](https://github.com/madou/typescript-transformer-handbook) by using the `transformers` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"transformers\": [\n \"@nestjs/swagger/plugin\",\n {\n \"name\": \"@automapper/classes/transformer-plugin\",\n \"options\": {}\n }\n ]\n }\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Inline libraries\" %}\n\n`@nx/js:tsc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"all\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=all\n```\n\n`@nx/js:tsc` can also inline buildable libraries by setting `external: 'none'`\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"none\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=none\n```\n\n{% /tab %}\n{% tab label=\"Batch mode execution\" %}\n\n{% callout type=\"check\" title=\"Available since Nx 16.6.0\" %}\nThe `@nx/js:tsc` batch implementation was introduced in Nx **16.6.0**.\n{% /callout %}\n\nThe `@nx/js:tsc` executor supports running multiple tasks in a single process. When running in batch mode, the executor uses the [TypeScript APIs for incremental builds](https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript). This results in a much faster build time when compared to the default implementation (the bigger the task graph to run, the more the performance improvements).\n\n{% callout type=\"warning\" title=\"Experimental feature\" %}\nExecuting tasks in batch mode is an experimental feature.\n{% /callout %}\n\n{% callout type=\"info\" title=\"Requirements\" %}\nBuilding a project with the `@nx/js:tsc` executor in batch mode requires all dependent projects to be buildable and built using the `@nx/js:tsc` executor.\n{% /callout %}\n\nTo run your builds using the batch implementation, pass in `--batch` flag:\n\n```shell\nnx build ts-lib --batch\n```\n\nFor optimal performance, you could set the `clean` option to `false`. Otherwise, the executor cleans the output folder before running the build, which results in the loss of the [`.tsbuildinfo` file](https://www.typescriptlang.org/tsconfig/#tsBuildInfoFile) and, consequently, the loss of important optimizations performed by TypeScript. This is not a requirement. Even if the `clean` option is not set to `false` there are other important optimizations that are performed by the batch implementation.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"clean\": false\n }\n }\n}\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Using TypeScript Transformer Plugins\" %}\n\n`@nx/js:tsc` can run the [TypeScript Transformers](https://github.com/madou/typescript-transformer-handbook) by using the `transformers` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"transformers\": [\n \"@nestjs/swagger/plugin\",\n {\n \"name\": \"@automapper/classes/transformer-plugin\",\n \"options\": {}\n }\n ]\n }\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Inline libraries\" %}\n\n`@nx/js:tsc` can inline non-buildable libraries by opt-in to **Inlining** mode with `external` option.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"all\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=all\n```\n\n`@nx/js:tsc` can also inline buildable libraries by setting `external: 'none'`\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"external\": \"none\"\n }\n }\n}\n```\n\n```shell\nnpx nx build ts-lib --external=none\n```\n\n{% /tab %}\n{% tab label=\"Batch mode execution\" %}\n\n{% callout type=\"check\" title=\"Available since Nx 16.6.0\" %}\nThe `@nx/js:tsc` batch implementation was introduced in Nx **16.6.0**.\n{% /callout %}\n\nThe `@nx/js:tsc` executor supports running multiple tasks in a single process. When running in batch mode, the executor uses the [TypeScript APIs for incremental builds](https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript). This results in a much faster build time when compared to the default implementation (the bigger the task graph to run, the more the performance improvements).\n\n{% callout type=\"warning\" title=\"Experimental feature\" %}\nExecuting tasks in batch mode is an experimental feature.\n{% /callout %}\n\n{% callout type=\"info\" title=\"Requirements\" %}\nBuilding a project with the `@nx/js:tsc` executor in batch mode requires all dependent projects (excluding implicit dependencies) to be buildable and built using the `@nx/js:tsc` executor.\n{% /callout %}\n\nTo run your builds using the batch implementation, pass in `--batch` flag:\n\n```shell\nnx build ts-lib --batch\n```\n\nFor optimal performance, you could set the `clean` option to `false`. Otherwise, the executor cleans the output folder before running the build, which results in the loss of the [`.tsbuildinfo` file](https://www.typescriptlang.org/tsconfig/#tsBuildInfoFile) and, consequently, the loss of important optimizations performed by TypeScript. This is not a requirement. Even if the `clean` option is not set to `false` there are other important optimizations that are performed by the batch implementation.\n\n```json {% fileName=\"libs/ts-lib/project.json\" %}\n{\n \"build\": {\n \"executor\": \"@nx/js:tsc\",\n \"options\": {\n \"outputPath\": \"dist/libs/ts-lib\",\n \"main\": \"libs/ts-lib/src/index.ts\",\n \"tsConfig\": \"libs/ts-lib/tsconfig.lib.json\",\n \"assets\": [\"libs/ts-lib/*.md\"],\n \"clean\": false\n }\n }\n}\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"description": "Build a project using TypeScript.",
|
||||
|
||||
@@ -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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the class will be generated.",
|
||||
"description": "The file path to the class without the file extension. 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 +33,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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the controller will be generated.",
|
||||
"description": "The file path to the controller without the file extension and suffix. 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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the decorator will be generated.",
|
||||
"description": "The file path to the decorator without the file extension and suffix. 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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the filter will be generated.",
|
||||
"description": "The file path to the filter without the file extension and suffix. 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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the gateway will be generated.",
|
||||
"description": "The file path to the gateway without the file extension and suffix. 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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the guard will be generated.",
|
||||
"description": "The file path to the guard without the file extension and suffix. 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 +40,7 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["name"],
|
||||
"required": ["path"],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Run the `guard` NestJS generator with Nx project support.",
|
||||
|
||||
@@ -8,17 +8,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the interceptor will be generated.",
|
||||
"description": "The file path to the interceptor without the file extension and suffix. 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 +40,7 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["name"],
|
||||
"required": ["path"],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Run the `interceptor` NestJS generator with Nx project support.",
|
||||
|
||||
@@ -8,29 +8,24 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the interface will be generated.",
|
||||
"description": "The file path to the interface without the file extension and suffix. 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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the middleware will be generated.",
|
||||
"description": "The file path to the middleware without the file extension and suffix. 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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the module will be generated.",
|
||||
"description": "The file path to the module without the file extension and suffix. 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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the pipe will be generated.",
|
||||
"description": "The file path to the pipe without the file extension and suffix. 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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the provider will be generated.",
|
||||
"description": "The file path to the provider without the file extension and suffix. 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,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"description": "Path where the resolver will be generated.",
|
||||
"description": "The file path to the resolver without the file extension and suffix. 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 without the file extension and suffix. 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.",
|
||||
|
||||
@@ -8,12 +8,18 @@
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "The name of the service.",
|
||||
"path": {
|
||||
"description": "The file path to the service without the file extension and suffix. Relative to the current working directory.",
|
||||
"type": "string",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What name would you like to use?"
|
||||
"x-prompt": "What is the service file path?"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
@@ -34,7 +40,7 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["name"],
|
||||
"required": ["path"],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Run the `service` NestJS generator with Nx project support.",
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -137,7 +137,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 without the file extension. 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.",
|
||||
@@ -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\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 --name=custom\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"description": "Create a component.",
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -159,6 +159,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\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 --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 without the file extension. 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,25 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 without the file extension. 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,25 @@
|
||||
"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 -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",
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-android\": {\n \"executor\": \"@nx/react-native:run-android\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:run-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Run on a specific device/simulator\" %}\nTo see all the avaiable emulators, run command:\n\n```bash\nemulator -list-avds\n```\n\nThe `deviceId` option allows you to launch your android app in a specific device/simulator:\n\n```json\n \"run-android\": {\n \"executor\": \"@nx/react-native:run-android\",\n \"options\": {\n \"deviceId\": \"Pixel_5_API_30\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run the debug/release app\" %}\nThe `mode` option allows to specify the build variant, such as `debug` or `release`.\n\n```json\n \"run-android\": {\n \"executor\": \"@nx/react-native:run-android\",\n \"options\": {\n \"mode\": \"release\"\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n"
|
||||
"examplesFile": "`project.json`:\n\n```json\n{\n \"name\": \"mobile\",\n //...\n \"targets\": {\n //...\n \"run-android\": {\n \"executor\": \"@nx/react-native:run-android\",\n \"options\": {}\n }\n }\n}\n```\n\n```bash\nnx run mobile:run-android\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Run on a specific device/simulator\" %}\nTo see all the available emulators, run command:\n\n```bash\nemulator -list-avds\n```\n\nThe `deviceId` option allows you to launch your android app in a specific device/simulator:\n\n```json\n \"run-android\": {\n \"executor\": \"@nx/react-native:run-android\",\n \"options\": {\n \"deviceId\": \"Pixel_5_API_30\"\n }\n }\n```\n\n{% /tab %}\n{% tab label=\"Run the debug/release app\" %}\nThe `mode` option allows to specify the build variant, such as `debug` or `release`.\n\n```json\n \"run-android\": {\n \"executor\": \"@nx/react-native:run-android\",\n \"options\": {\n \"mode\": \"release\"\n }\n }\n```\n\n{% /tab %}\n{% /tabs %}\n\n---\n"
|
||||
},
|
||||
"description": "Runs Android application.",
|
||||
"aliases": [],
|
||||
|
||||
@@ -10,25 +10,28 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 --name=custom"
|
||||
},
|
||||
{
|
||||
"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 without the file extension. 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",
|
||||
|
||||
@@ -180,7 +180,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 without the file extension. 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.",
|
||||
@@ -106,7 +104,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\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 --name=custom\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.",
|
||||
|
||||
@@ -10,23 +10,25 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 --name=useCustom"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the hook will be generated.",
|
||||
"description": "The file path to the hook without the file extension. 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",
|
||||
@@ -39,16 +41,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 +49,7 @@
|
||||
"x-prompt": "Should this hook be exported in the project?"
|
||||
}
|
||||
},
|
||||
"required": ["name"],
|
||||
"required": ["path"],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Create a hook.",
|
||||
|
||||
@@ -8,18 +8,27 @@
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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 --name=custom"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the Redux slice will be generated.",
|
||||
"description": "The file path to the Redux state slice without the file extension. 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",
|
||||
|
||||
@@ -84,10 +84,6 @@ npm add -D @nx/remix
|
||||
|
||||
## Generate a Remix Application
|
||||
|
||||
{% 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 %}
|
||||
|
||||
```{% command="nx g @nx/remix:app apps/myapp" path="~/acme" %}
|
||||
NX Generating @nx/remix:application
|
||||
|
||||
|
||||
@@ -12,11 +12,6 @@
|
||||
"description": "The route path or path to the filename of the route.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What is the path of the route? (e.g. 'apps/demo/app/routes/foo/bar.tsx')"
|
||||
},
|
||||
"nameAndDirectoryFormat": {
|
||||
"description": "Whether to generate the action 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"]
|
||||
}
|
||||
},
|
||||
"required": ["path"],
|
||||
|
||||
@@ -18,11 +18,6 @@
|
||||
"type": "string",
|
||||
"description": "The path to route file relative to the project root."
|
||||
},
|
||||
"nameAndDirectoryFormat": {
|
||||
"description": "Whether to generate the error boundary in the path 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"]
|
||||
},
|
||||
"skipFormat": {
|
||||
"type": "boolean",
|
||||
"description": "Skip formatting files after generation.",
|
||||
|
||||
@@ -12,11 +12,6 @@
|
||||
"description": "The route path or path to the filename of the route.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What is the path of the route? (e.g. 'apps/demo/app/routes/foo/bar.tsx')"
|
||||
},
|
||||
"nameAndDirectoryFormat": {
|
||||
"description": "Whether to generate the loader in the path 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"]
|
||||
}
|
||||
},
|
||||
"required": ["path"],
|
||||
|
||||
@@ -12,11 +12,6 @@
|
||||
"description": "The route path or path to the filename of the route.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "What is the path of the route? (e.g. 'apps/demo/app/routes/foo/bar.tsx')"
|
||||
},
|
||||
"nameAndDirectoryFormat": {
|
||||
"description": "Whether to generate the meta function in the path 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"]
|
||||
}
|
||||
},
|
||||
"required": ["path"],
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["directory"],
|
||||
"examplesFile": "---\ntitle: Vue application generator examples\ndescription: This page contains examples for the @nx/vue:app generator.\n---\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```shell\nnx g @nx/vue:app 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```shell\nnx g @nx/vue: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```shell\nnx g @nx/vue:app apps/my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"examplesFile": "---\ntitle: Vue application generator examples\ndescription: This page contains examples for the @nx/vue:app generator.\n---\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```shell\nnx g @nx/vue:app 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```shell\nnx g @nx/vue: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```shell\nnx g @nx/vue:app apps/my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["app"],
|
||||
|
||||
@@ -10,26 +10,16 @@
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nx/vue:component my-app/src/app/one --name=one --unitTestRunner=vitest",
|
||||
"description": "Generate a component `one` in the `my-app` application at my-app/src/app/one"
|
||||
},
|
||||
{
|
||||
"command": "nx g @nx/vue:component my-app/src/app/one",
|
||||
"description": "Generate a component `one` in the `my-app` application at my-app/src/app/one"
|
||||
"description": "Generate a component at `mylib/src/lib/foo.vue` with `vitest` as the unit test runner",
|
||||
"command": "nx g @nx/vue:component mylib/src/lib/foo --unitTestRunner=vitest"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Path where the component will be generated.",
|
||||
"description": "The file path to the component without the file extension. Relative to the current working directory.",
|
||||
"$default": { "$source": "argv", "index": 0 },
|
||||
"x-prompt": "Where should the component be generated?",
|
||||
"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-prompt": "What is the component file path?"
|
||||
},
|
||||
"js": {
|
||||
"type": "boolean",
|
||||
|
||||
@@ -108,7 +108,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/web: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/web: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\" %}\n\nCreate an application named `my-app` in the `my-dir` directory:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/web:app apps/my-dir/my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/web:app 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/web: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/web: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=\"In a nested directory\" %}\n\nCreate an application named `my-app` in the `my-dir` directory:\n\n```bash\nnx g @nx/web:app apps/my-dir/my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Add tags\" %}\n\nAdd tags to the application (used for linting).\n\n```bash\nnx g @nx/web:app apps/my-app --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["app"],
|
||||
|
||||
@@ -210,6 +210,7 @@
|
||||
{
|
||||
"name": "What Are Nx Plugins",
|
||||
"tags": [
|
||||
"add",
|
||||
"generate-code",
|
||||
"create-your-own-plugin",
|
||||
"inferred-tasks"
|
||||
@@ -238,11 +239,13 @@
|
||||
{
|
||||
"name": "Nx Daemon",
|
||||
"id": "nx-daemon",
|
||||
"tags": ["daemon"],
|
||||
"file": "shared/concepts/daemon"
|
||||
},
|
||||
{
|
||||
"name": "Sync Generators",
|
||||
"id": "sync-generators",
|
||||
"tags": ["sync"],
|
||||
"file": "shared/concepts/sync-generators"
|
||||
},
|
||||
{
|
||||
@@ -406,7 +409,7 @@
|
||||
{
|
||||
"name": "Run Root-Level NPM Scripts with Nx",
|
||||
"id": "root-level-scripts",
|
||||
"tags": ["run-tasks"],
|
||||
"tags": ["run-tasks", "exec"],
|
||||
"file": "shared/recipes/running-tasks/root-level-scripts"
|
||||
},
|
||||
{
|
||||
@@ -447,6 +450,7 @@
|
||||
{
|
||||
"name": "NPM/Yarn/PNPM workspaces",
|
||||
"id": "adding-to-monorepo",
|
||||
"tags": ["init"],
|
||||
"file": "shared/migration/adding-to-monorepo"
|
||||
},
|
||||
{
|
||||
@@ -457,11 +461,13 @@
|
||||
{
|
||||
"name": "Add to any Project",
|
||||
"id": "adding-to-existing-project",
|
||||
"tags": ["init"],
|
||||
"file": "shared/migration/adding-to-existing-project"
|
||||
},
|
||||
{
|
||||
"name": "Import an Existing Project into an Nx Workspace",
|
||||
"id": "import-project",
|
||||
"tags": ["import"],
|
||||
"file": "shared/migration/import-project"
|
||||
},
|
||||
{
|
||||
@@ -690,6 +696,7 @@
|
||||
{
|
||||
"name": "Migrating from Angular CLI",
|
||||
"id": "angular",
|
||||
"tags": ["init"],
|
||||
"file": "shared/migration/migration-angular"
|
||||
},
|
||||
{
|
||||
@@ -1011,7 +1018,7 @@
|
||||
{
|
||||
"name": "Keep Nx Versions in Sync",
|
||||
"id": "keep-nx-versions-in-sync",
|
||||
"tags": ["automate-updating-dependencies"],
|
||||
"tags": ["automate-updating-dependencies", "add"],
|
||||
"file": "shared/recipes/tips-n-tricks/keep-nx-versions-in-sync"
|
||||
},
|
||||
{
|
||||
@@ -1381,9 +1388,9 @@
|
||||
"file": "shared/deprecated/workspace-generators"
|
||||
},
|
||||
{
|
||||
"name": "Custom Task Runners",
|
||||
"id": "custom-task-runners",
|
||||
"file": "shared/deprecated/custom-task-runners"
|
||||
"name": "Legacy Cache",
|
||||
"id": "legacy-cache",
|
||||
"file": "shared/deprecated/legacy-cache"
|
||||
},
|
||||
{
|
||||
"name": "Workspace Executors",
|
||||
@@ -1576,7 +1583,7 @@
|
||||
{
|
||||
"name": "Create a Sync Generator",
|
||||
"id": "create-sync-generator",
|
||||
"tags": ["generate-code"],
|
||||
"tags": ["generate-code", "sync"],
|
||||
"file": "shared/recipes/generators/create-sync-generator"
|
||||
},
|
||||
{
|
||||
@@ -1825,6 +1832,7 @@
|
||||
{
|
||||
"name": "Personal Access Tokens",
|
||||
"id": "personal-access-tokens",
|
||||
"tags": ["login"],
|
||||
"file": "nx-cloud/recipes/personal-access-tokens"
|
||||
},
|
||||
{
|
||||
@@ -1945,6 +1953,25 @@
|
||||
"file": "nx-cloud/enterprise/dte/jenkins-dte"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Conformance",
|
||||
"id": "conformance",
|
||||
"description": "Conformance features that are available to Nx Cloud Enterprise customers",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Configure Conformance Rules in Nx Cloud",
|
||||
"id": "configure-conformance-rules-in-nx-cloud",
|
||||
"tags": ["conformance"],
|
||||
"file": "nx-cloud/enterprise/conformance/configure-conformance-rules-in-nx-cloud"
|
||||
},
|
||||
{
|
||||
"name": "Publish Conformance Rules to Nx Cloud",
|
||||
"id": "publish-conformance-rules-to-nx-cloud",
|
||||
"tags": ["conformance"],
|
||||
"file": "nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1963,6 +1990,11 @@
|
||||
"id": "ci-deployment",
|
||||
"tags": ["docker", "deploy"],
|
||||
"file": "shared/recipes/ci-deployment"
|
||||
},
|
||||
{
|
||||
"name": "Reduce the Number of Affected Projects in a CI Pipeline Execution",
|
||||
"id": "cipe-affected-project-graph",
|
||||
"file": "nx-cloud/recipes/cipe-affected-project-graph"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1988,6 +2020,11 @@
|
||||
"id": "launch-templates",
|
||||
"file": "nx-cloud/reference/launch-templates"
|
||||
},
|
||||
{
|
||||
"name": "Assignment Rules",
|
||||
"id": "assignment-rules",
|
||||
"file": "nx-cloud/reference/assignment-rules"
|
||||
},
|
||||
{
|
||||
"name": "Custom Steps",
|
||||
"id": "custom-steps",
|
||||
@@ -2039,11 +2076,13 @@
|
||||
{
|
||||
"name": "create-nx-workspace",
|
||||
"id": "create-nx-workspace",
|
||||
"tags": ["installation"],
|
||||
"file": "generated/cli/create-nx-workspace"
|
||||
},
|
||||
{
|
||||
"name": "init",
|
||||
"id": "init",
|
||||
"tags": ["init"],
|
||||
"file": "generated/cli/init"
|
||||
},
|
||||
{
|
||||
@@ -2061,6 +2100,7 @@
|
||||
{
|
||||
"name": "daemon",
|
||||
"id": "daemon",
|
||||
"tags": ["daemon"],
|
||||
"file": "generated/cli/daemon"
|
||||
},
|
||||
{
|
||||
@@ -2129,21 +2169,25 @@
|
||||
{
|
||||
"name": "sync",
|
||||
"id": "sync",
|
||||
"tags": ["sync"],
|
||||
"file": "generated/cli/sync"
|
||||
},
|
||||
{
|
||||
"name": "sync:check",
|
||||
"id": "sync-check",
|
||||
"tags": ["sync"],
|
||||
"file": "generated/cli/sync-check"
|
||||
},
|
||||
{
|
||||
"name": "import",
|
||||
"id": "import",
|
||||
"tags": ["import"],
|
||||
"file": "generated/cli/import"
|
||||
},
|
||||
{
|
||||
"name": "exec",
|
||||
"id": "exec",
|
||||
"tags": ["exec"],
|
||||
"file": "generated/cli/exec"
|
||||
},
|
||||
{
|
||||
@@ -2155,6 +2199,7 @@
|
||||
{
|
||||
"name": "show",
|
||||
"id": "show",
|
||||
"tags": ["explore-graph"],
|
||||
"file": "generated/cli/show"
|
||||
},
|
||||
{
|
||||
@@ -2171,16 +2216,19 @@
|
||||
{
|
||||
"name": "add",
|
||||
"id": "add",
|
||||
"tags": ["add"],
|
||||
"file": "generated/cli/add"
|
||||
},
|
||||
{
|
||||
"name": "login",
|
||||
"id": "login",
|
||||
"tags": ["login"],
|
||||
"file": "generated/cli/login"
|
||||
},
|
||||
{
|
||||
"name": "logout",
|
||||
"id": "logout",
|
||||
"tags": ["login"],
|
||||
"file": "generated/cli/logout"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -17,7 +17,7 @@ Ensure that you **accept the AI terms** to start using the AI features.
|
||||
|
||||
{% callout type="info" title="AI Features Availability" %}
|
||||
|
||||
AI features are available only for the [Nx Cloud Pro plan](/pricing). If you are on the Hobby plan, you can start a free trial to test AI features in your workspace.
|
||||
AI features are available only for the [Nx Cloud Team plan](/pricing).
|
||||
|
||||
{% /callout %}
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# Configure Conformance Rules in Nx Cloud
|
||||
|
||||
[Nx Cloud Enterprise](/enterprise) allows you to publish your organization's [Nx Conformance](/nx-enterprise/powerpack/conformance) rules to your Nx Cloud Organization, and consume them in any of your other Nx Workspaces without having to deal with the complexity and friction of dealing with a private NPM registry or similar. Authentication is handled automatically through your Nx Cloud connection and rules are downloaded and applied based on your preferences configured in the Nx Cloud UI.
|
||||
|
||||
To learn about how to create and publish custom rules to your Nx Cloud Organization, please refer to the [Publish Conformance Rules to Nx Cloud](/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud) recipe.
|
||||
|
||||
Once you have one or more rules published to your Nx Cloud Organization, you can configure your Nx Cloud Organization to use them in the Nx Cloud UI by visiting:
|
||||
|
||||
[https://cloud.nx.app/go/organization/conformance-rules](https://cloud.nx.app/go/organization/conformance-rules)
|
||||
|
||||
## Choose the Scope of Configured Rules
|
||||
|
||||
The value in the dropdown will determine what workspace(s) the rules will be applied to. By default, "All Workspaces" is the selected value, but you can change this to focus on a specific workspace instead.
|
||||
|
||||
## Configure a Rule for the Chosen Workspace Scope
|
||||
|
||||
After choosing the target workspace(s), click on the "Configure rule" to open the rule configuration dialog.
|
||||
|
||||
Here you will choose which of the rules published to your Nx Cloud Organization should be applied to the chosen workspace(s), and configure any options that the chosen rule supports.
|
||||
|
||||
### Rule Options
|
||||
|
||||
{% callout title="Rule Options UI" %}
|
||||
The rule options are currently provided via JSON, but in the near future we will dynamically generate a UI for configuring the options of each rule.
|
||||
{% /callout %}
|
||||
|
||||
The rule options will be validated against the rule's JSON schema definition before being saved, and you will be notified of any validation errors.
|
||||
|
||||
### Rule Status
|
||||
|
||||
Here you will choose whether or not the rule should be:
|
||||
|
||||
- **Enabled**
|
||||
- The rule will be executed in the chosen workspace(s) when `nx-cloud conformance` or `nx-cloud conformance:check` is run and any violations will cause the process to fail (exit with a non-zero exit code).
|
||||
- **Evaluated**
|
||||
- The rule will be executed in the chosen workspace(s) when `nx-cloud conformance` or `nx-cloud conformance:check` is run, but any violations will not cause the process to fail (i.e. the process will exit with a zero exit code).
|
||||
- This status is useful for exposing violations to allow them to be addressed but without blocking the CI process in the meantime.
|
||||
- You can combine this with the [Scheduled Status](#scheduled-status) feature to set a deadline for the chosen workspace(s) to become compliant with the rule.
|
||||
- **Disabled**
|
||||
- The rule will not be executed at all in the chosen workspace(s) and violations will therefore not be reported.
|
||||
|
||||
### Scheduled Status
|
||||
|
||||
By toggling on the "Schedule configuration", you can choose to set a future date on which the rule should be automatically transitioned to an alternate status.
|
||||
|
||||
Most commonly this would be used to transition a rule from **Evaluated** to **Enabled** after a grace period, to allow contributors to address the violations before enforcement begins, but any combination of current and scheduled statuses is supported.
|
||||
|
||||
## Notes on the Application of Rules at Runtime
|
||||
|
||||
When `nx-cloud conformance` or `nx-cloud conformance:check` are run, any configured rules for the current workspace will be dynamically downloaded from your Nx Cloud Organization and applied to the resolved conformance configuration. This means that the conformance configuration itself is completely optional when using it with Nx Cloud, but it can still be useful if the workspace wants to combine cloud rules with other locally-defined rules.
|
||||
|
||||
{% callout title="Organization Rules Override Local Rules" %}
|
||||
By design, the workspace cannot choose to disable the rules configured in Nx Cloud - any conflict between local and cloud rules will result in the local configuration being overridden by the cloud configuration.
|
||||
{% /callout %}
|
||||
|
||||
If the cloud rules were written to depend on a different version of Nx or Nx Powerpack than is installed within the current workspace, Nx Cloud will handle installing applicable versions dynamically at runtime.
|
||||
@@ -0,0 +1,104 @@
|
||||
# Publish Conformance Rules to Nx Cloud
|
||||
|
||||
[Nx Cloud Enterprise](/enterprise) allows you to publish your organization's [Nx Conformance](/nx-enterprise/powerpack/conformance) rules to your Nx Cloud Organization, and consume them in any of your other Nx Workspaces without having to deal with the complexity and friction of dealing with a private NPM registry or similar. Authentication is handled automatically through your Nx Cloud connection and rules are downloaded and applied based on your preferences configured in the Nx Cloud UI.
|
||||
|
||||
Let's create a custom rule which we can then publish to Nx Cloud. We will first create a new library project to contain our rule (and any others we might create in the future):
|
||||
|
||||
```shell
|
||||
nx generate @nx/js:library cloud-conformance-rules
|
||||
```
|
||||
|
||||
The Nx Cloud distribution mechanism expects each rule to be created in a named subdirectory in the `src/` directory of our new project, and each rule directory to contain an `index.ts` and a `schema.json` file.
|
||||
|
||||
E.g.
|
||||
|
||||
```
|
||||
cloud-conformance-rules/
|
||||
├── src/
|
||||
│ ├── test-cloud-rule/
|
||||
│ │ ├── index.ts // Our rule implementation
|
||||
│ │ └── schema.json // The schema definition for the options supported by our rule
|
||||
```
|
||||
|
||||
Our simple rule implementation in `test-cloud-rule/index.ts`, that will currently not report any violations, might look like this:
|
||||
|
||||
```ts
|
||||
import { createConformanceRule } from '@nx/powerpack-conformance';
|
||||
|
||||
export default createConformanceRule<object>({
|
||||
name: 'test-cloud-rule',
|
||||
category: 'reliability',
|
||||
description: 'A test cloud rule',
|
||||
reporter: 'non-project-files-reporter',
|
||||
implementation: async () => {
|
||||
return {
|
||||
severity: 'low',
|
||||
details: {
|
||||
violations: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
And because we do not yet have any options that we want to support for our rule, our `schema.json` file will looks like this (using the [JSON Schema](https://json-schema.org/) format):
|
||||
|
||||
```json
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"additionalProperties": false
|
||||
}
|
||||
```
|
||||
|
||||
We now have a valid implementation of a rule and we are ready to build it and publish it to Nx Cloud. The [`@nx/powerpack-conformance` plugin](/nx-api/powerpack-conformance) provides a [dedicated executor called `bundle-rules`](/nx-api/powerpack-conformance/executors/bundle-rules) for creating appropriate build artifacts for this purpose, so we will wire that executor up to a new build target in our `cloud-conformance-rules` project's `project.json` file:
|
||||
|
||||
```jsonc {% fileName="cloud-conformance-rules/project.json" %}
|
||||
{
|
||||
// ...any existing project.json content
|
||||
"targets": {
|
||||
// ...any existing targets
|
||||
"build": {
|
||||
"executor": "@nx/powerpack-conformance:bundle-rules",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "{projectRoot}/dist"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
We can now run `nx build cloud-conformance-rules` to build our rule and create the build artifacts in the `cloud-conformance-rules/dist` directory (or wherever you prefer to configure that `outputPath` location). If we take a look at the output path location we will see the same structure of one named subdirectory per rule, now containing the (bundled) `index.js` and `schema.json` files.
|
||||
|
||||
Our final step is to publish the rule artifacts to Nx Cloud. We achieve this by running the `publish-conformance-rules` command on the `nx-cloud` CLI, passing the output path location as the first positional argument:
|
||||
|
||||
```shell
|
||||
nx-cloud publish-conformance-rules cloud-conformance-rules/dist
|
||||
```
|
||||
|
||||
Subsequent calls to this command will overwrite the previously published rule artifacts for that rule, including implementation and schema changes. Effectively, the rules are always "at HEAD" and do not therefore have explicit versioning. If you need to support different versions of various setups, you should write the rule implementation to handle it at runtime. This approach helps reduce a lot of complexity and friction when managing Nx Conformance configurations across your organization.
|
||||
|
||||
Because publishing the rules is a relatively common operation, you can also wire up a target in your `cloud-conformance-rules` project to wrap the CLI command. Therefore, including our build target from before, our `project.json` file now looks like this:
|
||||
|
||||
```jsonc {% fileName="cloud-conformance-rules/project.json" %}
|
||||
{
|
||||
// ...any existing project.json content
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/powerpack-conformance:bundle-rules",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "{projectRoot}/dist"
|
||||
}
|
||||
},
|
||||
"publish": {
|
||||
"dependsOn": ["build"],
|
||||
"command": "npx nx-cloud publish-conformance-rules {projectRoot}/dist"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
We can now run `nx publish cloud-conformance-rules` to both build and publish our rule (and any future rules in this project) to Nx Cloud.
|
||||
@@ -18,26 +18,51 @@ jobs:
|
||||
- ...
|
||||
```
|
||||
|
||||
This works great but may not be the most cost-effective way to run your tasks. The goal is to **balance cost and speed**. For example, you might want to run a small PR on a few agents to save costs, but use many agents for a large PR to get the fastest possible build time.
|
||||
This works great, but may not be the most cost-effective way to run your tasks. The goal is to **balance cost and speed**. For example, you might want to run a small PR on a few agents to save costs, but use many agents for a large PR to get the fastest possible build time.
|
||||
|
||||
## Configure Dynamic Agents based on PR size
|
||||
|
||||
Instead of using a static configuration of agents (like the one shown above), you can also configure to use a different number and type of agents based on the size of your PR.
|
||||
You can configure Nx Cloud to execute a different number of agents based on the size of your PR's affected changes. Define any number of **changesets** (the number of agents and types of agents) to use for different sized PRs and pass them in a configuration file to your `start-ci-run` command.
|
||||
|
||||
Create a file called `dynamic-changesets.yaml` in the `.nx/workflows` directory of your repo.
|
||||
Start by creating a file called `distribution-config.yaml` in the `.nx/workflows` directory of your repo. This file will contain a `distribute-on` property that will be used to define the changesets to use for your PR. You can name your changesets anything you want.
|
||||
|
||||
```yaml {% fileName=".nx/workflows/dynamic-changesets.yaml" %}
|
||||
{% callout type="warning" title="The order of your changesets matters!" %}
|
||||
Define your changesets in order of increasing size (i.e. smallest changesets are defined before larger changesets). Nx Cloud uses the position of your changesets as part of its calculations to dynamically determine the correct changeset to use for your PR.
|
||||
{% /callout %}
|
||||
|
||||
```yaml {% fileName=".nx/workflows/distribution-config.yaml" %}
|
||||
distribute-on:
|
||||
small-changeset: 3 linux-medium-js
|
||||
medium-changeset: 6 linux-medium-js
|
||||
large-changeset: 10 linux-medium-js
|
||||
```
|
||||
|
||||
You can also specify a `default` changeset if you only want one changeset to be used for all PRs. Note that `default` is a reserved keyword so do not use it if you would like to define multiple changesets.
|
||||
|
||||
```yaml {% fileName=".nx/workflows/distribution-config.yaml" %}
|
||||
distribute-on:
|
||||
default: 3 linux-medium-js
|
||||
```
|
||||
|
||||
You can have as many changesets as you want. Based on the number of changesets specified, each changeset is assigned an equal percentage out of 100. Nx Cloud can determine the percentage of affected projects in your PR and use that value to evaluate which changeset to use.
|
||||
|
||||
{% callout type="deepdive" title="How is the size of the PR determined?" %}
|
||||
To determine the size of the PR, Nx Cloud calculates the relationship between the number of [affected projects](/ci/features/affected) and the total number of projects in the workspace. It then assigns it to one of the three categories: small, medium, or large.
|
||||
Nx Cloud calculates the relationship between the number of [affected projects](/ci/features/affected) and the total number of projects in the workspace to determine the size of a PR.
|
||||
{% /callout %}
|
||||
|
||||
You can then reference it in your CI pipeline configuration:
|
||||
## Setting up Dynamic Agents in your CI Pipeline
|
||||
|
||||
In the example below, each changeset would be assigned an equal percentage range out of 100%. If Nx Cloud determines that 30% of your projects have been affected, then it will use the medium changeset to distribute the workload on. If Nx Cloud determines that 55% of your projects have been affected, it will use the large changeset.
|
||||
|
||||
```yaml {% fileName=".nx/workflows/distribution-config.yaml" %}
|
||||
distribute-on:
|
||||
small-changeset: 3 linux-medium-js # Distribute on small if 1-25% of projects affected in PR
|
||||
medium-changeset: 6 linux-medium-js # Distribute on medium if 26-50% of projects affected in PR
|
||||
large-changeset: 10 linux-medium-js # Distribute on large if 51-75% of projects affected in PR
|
||||
extra-large-changeset: 15 linux-medium-js # Distribute on extra-large if 76-100% of projects affected in PR
|
||||
```
|
||||
|
||||
You can then reference your distribution configuration in your CI pipeline configuration:
|
||||
|
||||
```yaml {% fileName=".github/workflows/main.yaml" highlightLines=[8] %}
|
||||
...
|
||||
@@ -47,8 +72,9 @@ jobs:
|
||||
...
|
||||
steps:
|
||||
...
|
||||
- run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e-ci"
|
||||
- run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/distribution-config.yaml" --stop-agents-after="e2e-ci"
|
||||
- ...
|
||||
```
|
||||
|
||||
Now, PRs that affect a small percentage of the repo will run on 3 agents, mid-size PRs will use 6 agents, and large PRs will use 10 agents. This feature helps save costs on smaller PRs while maintaining the high performance necessary for large PRs.
|
||||
Now your agents will distribute your tasks dynamically—scaling and adapting to your PR sizes.
|
||||
This feature helps save costs on smaller PRs while maintaining the high performance necessary for large PRs.
|
||||
|
||||
@@ -15,7 +15,7 @@ To use the "Explain with AI" feature, you need to [enable AI features for your o
|
||||
|
||||

|
||||
|
||||
AI features are available only for the [Nx Cloud Pro plan](/pricing). If you are on the Hobby plan, you can start a free trial to test AI features in your workspace.
|
||||
AI features are available only for the [Nx Cloud Team plan](/pricing).
|
||||
|
||||
## Using Explain with AI
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ npx nx g ci-workflow
|
||||
Connect on our channels and with the Nx Community to ask questions, get help and keep up to date with the latest news.
|
||||
|
||||
- Reach out for [Enterprise Support](/enterprise)
|
||||
- ⭐️ [Star us on GitHub](https://github.com/nrwl/nx) to show your support and stay updated on new releases!
|
||||
- Join our [Discord Community](https://go.nx.dev/community)
|
||||
- Subscribe to our [Youtube Channel](https://www.youtube.com/@nxdevtools)
|
||||
- Follow us on [Twitter](https://twitter.com/nxdevtools)
|
||||
|
||||
|
After Width: | Height: | Size: 280 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 47 KiB |