Compare commits
110 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a45aa0cfc | |||
| 1808ef8c2a | |||
| d81063c844 | |||
| 1492b2992a | |||
| c339db0da8 | |||
| ba5f128fa7 | |||
| 2141e38ab1 | |||
| ff23fb0c07 | |||
| eccd79311d | |||
| 61920a80ce | |||
| 47df9a420e | |||
| 7f31366820 | |||
| c992d4c0d5 | |||
| 88f163e9d5 | |||
| 2bc0755ffe | |||
| fe8a09926e | |||
| 7a1220c672 | |||
| 6c89a5571a | |||
| 569f1ab984 | |||
| c571710716 | |||
| 2fbded36a5 | |||
| cc5e940497 | |||
| e138ebc201 | |||
| 923242d705 | |||
| bd192a6125 | |||
| b6c6248ab5 | |||
| b8ac136e30 | |||
| 952629b857 | |||
| 99ec30a943 | |||
| 9b6874d693 | |||
| 6e2e63731f | |||
| ccf71fd32b | |||
| d297574496 | |||
| bd701e7c05 | |||
| 453b38791e | |||
| b7c97a5023 | |||
| ff9dc5db9c | |||
| b2b0272ba3 | |||
| 265a7b1078 | |||
| a22a378235 | |||
| 868032927d | |||
| 86af878b84 | |||
| 6a91cebda5 | |||
| d50999b7f6 | |||
| 6726b82a42 | |||
| 7738a01232 | |||
| d523373a6d | |||
| 0735b65ace | |||
| 33ff88e037 | |||
| e0b376a457 | |||
| fb98769837 | |||
| 356e674de2 | |||
| f2f1419438 | |||
| 0a4c6202b9 | |||
| 46a9ca47e8 | |||
| cf051aa51d | |||
| bfc4eff080 | |||
| a6bc863789 | |||
| 3d60dd65fc | |||
| d7af0c009c | |||
| b8ac640412 | |||
| cdeba498e2 | |||
| ab9cf56868 | |||
| edbc4b2116 | |||
| c247067931 | |||
| ca0e60c44d | |||
| f21e73c322 | |||
| 251dc11c8e | |||
| 5fc9825131 | |||
| eb65611be0 | |||
| 0c5921e4a6 | |||
| 950f16a3ff | |||
| 285e283be9 | |||
| b76e84dbb1 | |||
| 4a4d43ee9d | |||
| 968cf9041c | |||
| 9e515895a1 | |||
| 25c6f2cf41 | |||
| 77d83876ef | |||
| 3297ee8859 | |||
| 6cae9a458b | |||
| e05b4f075e | |||
| 1b2a55c6da | |||
| b9b7895d7c | |||
| 295bb0afdc | |||
| b563aa3919 | |||
| cfb444f442 | |||
| c70dd177c4 | |||
| a0ceabe016 | |||
| 5ac5544fea | |||
| 434611a77f | |||
| 6c03777a03 | |||
| d8601c9167 | |||
| 3877f6a6f6 | |||
| c04a91d6e8 | |||
| 03e43a0566 | |||
| 08ade26b61 | |||
| a76b176858 | |||
| d6f223b08d | |||
| 8559c0c953 | |||
| a7148b78b8 | |||
| 6c3733395c | |||
| 0a7dc0cfcb | |||
| d48df88976 | |||
| c600406dd1 | |||
| 5f123e118a | |||
| 011b681394 | |||
| da22f90ffa | |||
| 70bb8ca2cf | |||
| adcd9b2b6e |
@@ -91,7 +91,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"
|
||||
- run: npx nx-cloud@next start-ci-run --distribute-on="auto linux-medium" --stop-agents-after="e2e" --require-explicit-completion
|
||||
- run:
|
||||
command: |
|
||||
sudo apt-get update
|
||||
@@ -121,6 +121,10 @@ 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
|
||||
# -------------------------
|
||||
|
||||
@@ -64,6 +64,16 @@
|
||||
],
|
||||
"@nx/workspace/valid-command-object": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["pnpm-lock.yaml"],
|
||||
"parser": "./tools/eslint-rules/raw-file-parser.js",
|
||||
"rules": {
|
||||
"@nx/workspace/ensure-pnpm-lock-version": [
|
||||
"error",
|
||||
{ "version": "9.0" }
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
#!/bin/sh
|
||||
changedFiles="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
|
||||
node ./scripts/notify-lockfile-changes.js $changedFiles
|
||||
node ./scripts/notify-lockfile-changes.js $changedFiles
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
#!/bin/sh
|
||||
changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
|
||||
node ./scripts/notify-lockfile-changes.js $changedFiles
|
||||
node ./scripts/notify-lockfile-changes.js $changedFiles
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
pnpm check-lock-files &&
|
||||
pnpm check-commit &&
|
||||
pnpm documentation &&
|
||||
pnpm check-lock-files
|
||||
pnpm check-commit
|
||||
pnpm documentation
|
||||
pnpm pretty-quick --check
|
||||
|
||||
@@ -1 +1 @@
|
||||
NX_DB_CACHE=true
|
||||
NX_DB_CACHE=false
|
||||
|
||||
@@ -10,7 +10,7 @@ rust-toolchain @nrwl/nx-native-reviewers
|
||||
|
||||
# Docs Site + Graph
|
||||
/docs @nrwl/nx-docs-reviewers
|
||||
/docs/nx-cloud @StalkAltan @rarmatei @nrwl/nx-docs-reviewers
|
||||
/docs/nx-cloud @StalkAltan @rarmatei @nixallover @nrwl/nx-docs-reviewers
|
||||
/graph/** @philipjfulcher @FrozenPandaz @bcabanes @MaxKless @xiongemi
|
||||
/images @nrwl/nx-docs-reviewers
|
||||
/nx-dev/** @nrwl/nx-docs-reviewers
|
||||
|
||||
@@ -290,6 +290,15 @@ version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "ci_info"
|
||||
version = "0.14.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "840dbb7bdd1f2c4d434d6b08420ef204e0bfad0ab31a07a80a1248d24cc6e38b"
|
||||
dependencies = [
|
||||
"envmnt",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clang-sys"
|
||||
version = "1.8.1"
|
||||
@@ -460,6 +469,16 @@ version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
|
||||
|
||||
[[package]]
|
||||
name = "envmnt"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d73999a2b8871e74c8b8bc23759ee9f3d85011b24fafc91a4b3b5c8cc8185501"
|
||||
dependencies = [
|
||||
"fsio",
|
||||
"indexmap",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.8"
|
||||
@@ -545,6 +564,16 @@ dependencies = [
|
||||
"syn 2.0.53",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fs4"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec6fcfb3c0c1d71612528825042261419d5dade9678c39a781e05b63677d9b32"
|
||||
dependencies = [
|
||||
"rustix",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fs_extra"
|
||||
version = "1.3.0"
|
||||
@@ -560,6 +589,15 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fsio"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dad0ce30be0cc441b325c5d705c8b613a0ca0d92b6a8953d41bd236dc09a36d0"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "funty"
|
||||
version = "2.0.0"
|
||||
@@ -1030,6 +1068,16 @@ dependencies = [
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "1.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"hashbrown 0.12.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "inotify"
|
||||
version = "0.9.6"
|
||||
@@ -1467,11 +1515,13 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"assert_fs",
|
||||
"ci_info",
|
||||
"colored",
|
||||
"crossbeam-channel",
|
||||
"crossterm",
|
||||
"dashmap",
|
||||
"dunce",
|
||||
"fs4",
|
||||
"fs_extra",
|
||||
"globset",
|
||||
"hashbrown 0.14.5",
|
||||
|
||||
@@ -498,5 +498,10 @@
|
||||
"name": "nx-github-pages",
|
||||
"description": "A small Nx plugin to make deploying static projects to GitHub Pages easy.",
|
||||
"url": "https://github.com/agentender/nx-github-pages"
|
||||
},
|
||||
{
|
||||
"name": "nx-solhint",
|
||||
"description": "Solhint generators and inferred tasks for Nx",
|
||||
"url": "https://github.com/juliangsibecas/nx-solhint"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -417,6 +417,28 @@ Embed an Nx Graph visualization that can be panned by the user.
|
||||
{% /graph %}
|
||||
````
|
||||
|
||||
## Generating API Documentation
|
||||
|
||||
To generate API documentation for the codebase and update the menu for the docs on nx.dev, you can run:
|
||||
|
||||
```
|
||||
nx documentation
|
||||
```
|
||||
|
||||
This will happen automatically in a `git push` hook, so you'll be reminded if you forget.
|
||||
|
||||
### Generate API Documentation for Ocean Plugins
|
||||
|
||||
To generate API documentation for plugins in the ocean repository, run the `nx documentation` command with the `NX_OCEAN_RELATIVE_PATH` environment variable set to the relative path to your checked out copy of the ocean repo.
|
||||
|
||||
```
|
||||
NX_OCEAN_RELATIVE_PATH=../ocean nx documentation
|
||||
```
|
||||
|
||||
This will create generated API documentation in the `docs/external-generated` folder. This API will be merged into the normal `docs/generated` documentation when the docs site is built.
|
||||
|
||||
Because there are two separate output folders, if someone runs `nx documentation` without the `NX_OCEAN_RELATIVE_PATH` environment variable, the ocean documentation will not be overwritten. The ocean documentation will only be updated or deleted when someone explicitly chooses to do so.
|
||||
|
||||
## Publishing Process
|
||||
|
||||
There are multiple versions of the `nx.dev` site.
|
||||
|
||||
@@ -119,4 +119,4 @@ In addition, we are actively exploring ways to provide advanced analytics for yo
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -335,4 +335,4 @@ If the prettier UI and better performance haven’t convinced you, this surely w
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -608,4 +608,4 @@ This journey through Qwik and Nx demonstrates how thoughtful architecture and th
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -18,4 +18,4 @@ Victor and I are excited to announce that Nx has raised another $16M in a Series
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -495,4 +495,4 @@ If you enjoyed these, [subscribe to our YouTube channel](https://www.youtube.com
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -284,4 +284,4 @@ That’s all for now folks! We’re just starting up a new iteration of developm
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -621,4 +621,4 @@ Nx is a powerful monorepo tool. Together with Nx and these 2 state management to
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -312,4 +312,4 @@ This role, in the context of OpenAI’s chat models, is the response of the AI.
|
||||
- [Nx GitHub](https://github.com/nrwl/nx)
|
||||
- [Nx Official Discord Server](/community)
|
||||
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
|
||||
- [Speed up your CI](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -212,4 +212,4 @@ That’s all for now folks! We’re just starting up a new iteration of developm
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -389,4 +389,4 @@ Exciting stuff! So keep an eye on our channels, and subscribe if you haven’t a
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -185,4 +185,4 @@ We just released Project Crystal, so this is just the beginning of it. While we
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -124,4 +124,4 @@ If you have a task that can’t be run on Nx Agents for some reason, you can eas
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -319,4 +319,4 @@ Here are some example repositories already leveraging Nx release:
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -145,4 +145,4 @@ That’s all for now folks! We’re just starting up a new iteration of developm
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -215,4 +215,4 @@ Here is how to set up Nx with the Gradle workspace. Hopefully, this gives you a
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -235,4 +235,4 @@ Zack
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -56,4 +56,4 @@ This is just the first of a series of AI-powered features that we're going to be
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -4,7 +4,6 @@ slug: 'nx-19-5-adds-stackblitz-new-features-and-more'
|
||||
authors: ['Zack DeRose']
|
||||
cover_image: '/blog/images/2024-08-01/nx-19-5-thumbnail.png'
|
||||
tags: [nx, release]
|
||||
pinned: true
|
||||
---
|
||||
|
||||
## Table of Contents
|
||||
@@ -292,4 +291,4 @@ The [Monorepo World conference](https://monorepo.world) is coming up soon on Oct
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -91,4 +91,4 @@ can [find more details in our docs](/ci/recipes/security/personal-access-tokens)
|
||||
- [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](https://nx.app/)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
---
|
||||
title: Nx 19.8 Update!!
|
||||
slug: nx-19-8-update
|
||||
authors: [Zack DeRose]
|
||||
tags: [nx, release]
|
||||
cover_image: /blog/images/2024-09-20/thumbnail.png
|
||||
youtubeUrl: https://youtu.be/Zgv4LHvwGx0
|
||||
pinned: true
|
||||
---
|
||||
|
||||
Nx 19.8 is here! This is our last minor release before we get ready to move ahead into Nx v20, which should land in October around the same time as the [Monorepo World Conference](https://monorepo.world/)!
|
||||
|
||||
As always, you can find the general details for all Nx releases on our [changelog](/changelog), as well as details on our [Github Releases for the Nx repo](https://github.com/nrwl/nx/releases).
|
||||
|
||||
## Table of Contents
|
||||
|
||||
In this blog post:
|
||||
|
||||
- [Nx Import](#nx-import)
|
||||
- [Improved Task Scheduling!](#improved-task-scheduling)
|
||||
- [Project Crystal Comes to Angular](#project-crystal-comes-to-angular)
|
||||
- [Crystalize Your Entire Workspace In One Command](#crystalize-your-entire-workspace-in-one-command)
|
||||
- [New Nx Workspaces Create with ESLint v9](#new-nx-workspaces-created-with-eslint-v9)
|
||||
- [Nx Release Enhancements](#nx-release-enhancements)
|
||||
- [Migrate to Latest](#migrate-to-latest)
|
||||
- [Round 2 of Monorepo World Conference Speakers Announced!!](#round-2-of-monorepo-world-conference-speakers-announced)
|
||||
- [Learn More](#learn-more)
|
||||
|
||||
## Nx Import
|
||||
|
||||
In Nx 19.8, [`nx import`](/nx-api/nx/documents/import) has now moved from beta support to now generally available!
|
||||
|
||||
Nx Import is a new [top-level command of the Nx CLI](/reference/nx-commands) which allows you to import projects along with its git history from some other repository into your current Nx workspace.
|
||||
|
||||
Keep an eye out for more on Nx Import on our [YouTube Channel](https://www.youtube.com/@nxdevtools) coming soon, and in the meantime be sure to check [the documentation](/nx-api/nx/documents/import) as this is now fully documented!
|
||||
|
||||
## Improved Task Scheduling!
|
||||
|
||||
We've added some optimizations to the core of Nx - particularly around Nx's task scheduling. At the core of Nx is a task runner that supports [task dependencies](/features/run-tasks#defining-a-task-pipeline) (configurable for your entire workspace in the `targetDefaults` of your `nx.json` file, and on a per-project basis in your `project.json` files!), as well as the ability to run mulitple tasks in parallel.
|
||||
|
||||
With 19.8, nx will leverage historical data of previous runs of tasks to add some prioritization to the scheduling tasks that tend to take longer. This should optimize the total runtime of large batch commands in your workspace!
|
||||
|
||||
Read more on [running tasks with Nx](/features/run-tasks)! And checkout [this new optimization on GitHub](https://github.com/nrwl/nx/pull/27783) for more details!
|
||||
|
||||
## Project Crystal Comes to Angular
|
||||
|
||||
[Project Crystal](/concepts/inferred-tasks) has come to Angular!
|
||||
|
||||
Project Crystal allows Nx to _infer_ tasks for projects in your workspace - rather than requiring that they exist in every `project.json` or `angular.json` file of your workspace.
|
||||
|
||||
You can now run the command `nx init` in a project created by the Angular CLI, and we will generate `project.json` files for each angular project in your workspace - splitting that data out from the root `angular.json` file created by the Angular CLI.
|
||||
|
||||
This decision was made based on our feedback from the Angular community - where there is a strong preference for being able to split out the config.
|
||||
|
||||
## Crystalize Your Entire Workspace In One Command
|
||||
|
||||
When we initially launched [Project Crystal](/concepts/inferred-tasks), we shipped originally with `convert-to-inferred` generators, which would allow you to convert your workspace one plugin at a time.
|
||||
|
||||
With Nx 19.8, we've added a [`infer-targets`](/recipes/running-tasks/convert-to-inferred#migrate-all-plugins) generator, which will automatically detect all available `convert-to-inferred` generators, and run the ones you choose. You may also specify a specific project using the `--project` option of the generator.
|
||||
|
||||
## New Nx Workspaces Created with ESLint v9
|
||||
|
||||
When creating a new workspace with the command: `npx create-nx-workspace`, those workspaces will now be created with [`eslint`](https://www.npmjs.com/package/eslint) v9, and [`typescript-eslint`](https://www.npmjs.com/package/typescript-eslint) v8 - their most recent versions respectively.
|
||||
|
||||
Keep in mind as well that ESLint v8 faces end-of-life on October 5th, meaning only [flat config](https://eslint.org/docs/latest/use/configure/migration-guide) is supported moving forward. Nx users should migrate to this new config format using [our flat config generator](/recipes/tips-n-tricks/flat-config#switching-to-eslints-flat-config-format).
|
||||
|
||||
For more on eslint's flat config, and how to use our generator to get to flat config checkout this video:
|
||||
|
||||
{% youtube
|
||||
src="https://www.youtube.com/watch?v=32XH909CZrY"
|
||||
title="ESLint Config Automation With Nx"
|
||||
/%}
|
||||
|
||||
## Nx Release Enhancements
|
||||
|
||||
[`nx release`](/nx-api/nx/documents/release) is a framework/language/platform agnostic solution to versioning, publishing, and changelogs for your monorepo. We've been continuing to invest in Nx Release in 19.8, adding support specifically for [`pnpm publish`](https://pnpm.io/cli/publish) and [Github Enterprise Server](https://github.com/nrwl/nx/pull/26482)!
|
||||
|
||||
We also have a new feature from Nx Champion, Jonathan Gelin - which allows you to use `groupPreVersionCommand` in addition to the `preVersionCommand` when using the release groups feature to support [building before versioning](/recipes/nx-release/build-before-versioning).
|
||||
|
||||
## Migrate to Latest
|
||||
|
||||
{% youtube
|
||||
src="https://youtu.be/A0FjwsTlZ8A"
|
||||
title="How Automated Code Migrations Work"
|
||||
/%}
|
||||
|
||||
As always - updating Nx and its plugins is easy as we ship an [automated migration command](/features/automate-updating-dependencies).
|
||||
|
||||
```shell
|
||||
npx nx migrate latest
|
||||
```
|
||||
|
||||
After updating your dependencies, run any necessary migrations.
|
||||
|
||||
```shell
|
||||
npx nx migrate --run-migrations
|
||||
```
|
||||
|
||||
## Round 2 of Monorepo World Conference Speakers Announced!!
|
||||
|
||||
[](https://monorepo.world)
|
||||
|
||||
The [Monorepo World conference](https://monorepo.world) is coming up soon on October 7, 2024 at the Computer History museum in Mountain View, California.
|
||||
|
||||
[Get your tickets now](https://ti.to/nx-conf/monorepoworld2024), consider [requesting access to the invite-only Enterprise Summit on October 8](https://ti.to/nx-conf/monorepoworld2024), and be sure to check out the [second round of speakers](https://monorepo.world/#speakers-title) that was just published earlier this week!
|
||||
|
||||
## Learn more
|
||||
|
||||
- [Nx Docs](/getting-started/intro)
|
||||
- [X/Twitter](https://twitter.com/nxdevtools) -- [LinkedIn](https://www.linkedin.com/company/nrwl/)
|
||||
- [Nx GitHub](https://github.com/nrwl/nx)
|
||||
- [Nx Official Discord Server](https://go.nx.dev/community)
|
||||
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
|
||||
- [Speed up your CI](/nx-cloud)
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
title: Evolving Nx
|
||||
slug: evolving-nx
|
||||
authors: [Jeff Cross]
|
||||
tags: [nx, release]
|
||||
cover_image: /blog/images/evolving-nx/thumbnail.png
|
||||
---
|
||||
|
||||
Over the years, Nx has grown from a small 20% side project of our consulting business into a tool that empowers millions of developers worldwide and helps Fortune 500 companies ship high-quality software faster. In the last two years, we successfully transformed our consulting business into a product company, where our team can fully focus on evolving Nx and building Nx Cloud to extend Nx’s capabilities beyond local development.
|
||||
|
||||
This success is in large part thanks to:
|
||||
|
||||
- Our commitment to building Nx as MIT-licensed open-source software, supported by the incredible contributions from our vibrant Nx community.
|
||||
- Close collaboration with our customers, allowing us to understand their needs and continuously improve Nx and Nx Cloud to address their demanding and complex challenges.
|
||||
|
||||
When we have new ideas to make Nx better, we’ve always had two options: it could be in the open source build system, or it could be in the paid cloud product, [Nx Cloud](/nx-cloud). But sometimes, there are important things we want to offer that can solve some gnarly problems for teams but don’t require them to spend months convincing their IT department to incorporate yet another cloud service. So, we decided to create a collection of non-cloud-dependent Nx add-ons in a new package called **Nx Powerpack**, which will require paid licenses to use.
|
||||
|
||||
## Introducing Nx Powerpack
|
||||
|
||||
**[Nx Powerpack](/powerpack)** — our newest product designed to elevate the Nx CLI experience for enterprise environments. Powerpack offers advanced features like self-hosted remote cache storage, code ownership for monorepos, and workspace conformance, seamlessly integrating into sealed systems with strict security requirements. It’s also designed for ease of implementation, helping enterprises bypass lengthy procurement processes and quickly access the tools they need.
|
||||
|
||||
> If you want to get into the technical details, we wrote a separate blog post diving deeper into the technical details: [Introducing Nx Powerpack](/blog/introducing-nx-powerpack).
|
||||
|
||||
Everything in Powerpack is new functionality, not previously free features that we’re now putting behind a paywall. However, this change coincides with some Nx improvements that will eventually interfere with users who were relying on our original filesystem-based implementation of local caching. We’ve completely rewritten Nx's local caching to be faster and more secure, partly by using a local database instead of checking the filesystem for artifact metadata. With this rewrite, any custom remote caches that rely on metadata reflected in the filesystem will not work as of Nx 21. This is why we decided to build an API into Powerpack to be able to connect Nx’s cache to different clouds and data sources. Now with Powerpack, teams can use an officially-supported implementation of remote caching, without needing to use Nx Cloud.
|
||||
|
||||
There’s a Steve Jobs quote that I think rings true with all of us at Nx:
|
||||
|
||||
> "I think money is a wonderful thing because it enables you to do things. It enables you to invest in ideas that don't have a short-term payback." - Steve Jobs
|
||||
|
||||
As Nx has grown, we’ve hired more people to make the product better. Naturally, those people want to do good work and be paid. We all show up for work to build things we’re passionate about, and solve real pain points for the millions of developers using Nx every day. Money is what enables us to keep doing what we love. So as much as Victor Savkin and I want to just build things and give them away for free, we need to balance our personal passion with what’s the best long-term decisions for Nx — the project, the community, and the company.
|
||||
|
||||
Like many open source projects, one of the bigger challenges to sustainability in recent years has been larger cloud products who wait for projects to become successful, and then try to capitalize on that success at the expense of the maintainers. To battle this, many open source projects have decided to make their open source licensing more restrictive, or introduce dual licenses, forcing those vendors to work with the maintainers on a fair arrangement. We think we’ve come up with a better solution for the community by introducing a new package, Powerpack, with a new commercial license, with only new functionality. **Nx itself still has one license: the MIT license.**
|
||||
|
||||

|
||||
|
||||
### What about my open-source repo ?
|
||||
|
||||
Open source projects can continue to use Nx Cloud for **free** the same way they always have, and they can continue to use Nx with all its features. If you are an open-source maintainer and you want to use Powerpack, you will get a **free license**. Just reach out to us at [powerpack-support@nrwl.io](mailto:powerpack-support@nrwl.io).
|
||||
|
||||
## How to Get Nx Powerpack
|
||||
|
||||
Powerpack can be easily purchased as a one-off license and is automatically included for all existing enterprise customers. If you’re looking to purchase a license, you can [do so on this page](/powerpack).
|
||||
|
||||
Are you a startup? If these features make sense for your team but the cost is a concern, reach out to our support team, and we’ll work with you to find a solution that fits.
|
||||
|
||||
## Got Questions?
|
||||
|
||||
If you’re curious to learn more about these changes for Nx and how to get started, [check out our docs](/features/powerpack).
|
||||
|
||||
## Learn more
|
||||
|
||||
- [Nx Powerpack](/powerpack)
|
||||
- [Blog: Introducing Nx Powerpack](/blog/introducing-nx-powerpack)
|
||||
- [Docs: Powerpack features](/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)
|
||||
@@ -0,0 +1,256 @@
|
||||
---
|
||||
title: Introducing Nx Powerpack
|
||||
slug: introducing-nx-powerpack
|
||||
authors: [Juri Strumpflohner]
|
||||
tags: [nx, release]
|
||||
cover_image: /blog/images/introducing-powerpack/thumbnail.png
|
||||
youtubeUrl: https://youtu.be/KZ0nh2lj8zE
|
||||
---
|
||||
|
||||
Today we're introducing our latest product, **Nx Powerpack**, a suite of paid extensions for Nx, specifically designed around common enterprise needs. Now, before anyone draws the wrong conclusions:
|
||||
|
||||
- No, we’re **not going to restrict Nx’s license**, lock you in, and then harvest. Nx remains MIT licensed and fully open source.
|
||||
- No, we’re **not placing existing features behind a paywall**. Nx Powerpack introduces new features on top of Nx (more about that below).
|
||||
- Yes, we still **strongly believe in OSS and our community**, and we will keep improving Nx more than ever; if anything, Powerpack will help us fund our OSS work on Nx core and ensure its long-term sustainability.
|
||||
|
||||
### What about my open-source repo ?
|
||||
|
||||
Open source projects can continue to use Nx Cloud for **free** the same way they always have, and they can continue to use Nx with all its features. If you are an open-source maintainer and you want to use Powerpack, you will get a **free license**. Just reach out to us at [powerpack-support@nrwl.io](mailto:powerpack-support@nrwl.io).
|
||||
|
||||
So this leaves us with:
|
||||

|
||||
|
||||
> But why are we releasing Nx Powerpack under a commercial license? Read all about our strategy, the reasoning behind Powerpack and OSS funding in the **blog post from our CEO, Jeff Cross**: [Evolving Nx](/blog/evolving-nx).
|
||||
|
||||
But now to the fun, technical part! Nx Powerpack is a bundle that - in this very first release - comes with three major features:
|
||||
|
||||
- [Codeowners for monorepos](#codeowners-for-monorepos)
|
||||
- [Self-hosted cache storage](#selfhosted-cache-storage)
|
||||
- [Workspace conformance (beta)](#workspace-conformance-beta)
|
||||
|
||||
Let’s dive in!
|
||||
|
||||
## Get an Nx Powerpack License
|
||||
|
||||
All Powerpack features require a dedicated commercial license. You can get one here: [Nx Powerpack](/powerpack).
|
||||
|
||||
Once you have your license, run the following command
|
||||
|
||||
```shell
|
||||
npx nx activate-powerpack <your-license>
|
||||
```
|
||||
|
||||
## Codeowners for Monorepos
|
||||
|
||||
Setting up Codeowners is highly recommended when designing a monorepo. If you’re not familiar, Codeowners is a common feature of VCS providers (such as GitHub, GitLab, Bitbucket, etc.), allowing you to enforce specific code reviewers to approve PRs. This functionality is especially important in a monorepo, where you manage multiple projects with multiple teams. You want to ensure the right people are reviewing the code being submitted.
|
||||
|
||||
Here’s a simple example of a [GitHub CODEOWNERS definition](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners):
|
||||
|
||||
```plain {% fileName=".github/CODEOWNERS" %}
|
||||
/docs/ @doc-owner
|
||||
/apps/orders @orders-team
|
||||
/apps/products @products-team
|
||||
/libs/orders/** @orders-team
|
||||
/libs/products/** @products-team
|
||||
/libs/shared/** @infra-team
|
||||
```
|
||||
|
||||
One of the downsides of how codeowners works on today's VCS providers is that **they are folder-based**. That requires you to map your project paths to your codeowner files and keep maintaining that as you change your monorepo structure. And **this is exactly what we're going to automate**.
|
||||
|
||||
In a monorepo you reason based on projects. That's what you pass to your [Nx run commands](/features/run-tasks), what you see on the [project graph](/features/explore-graph) and also where owners should be defined. To get started install the Codeowners Powerpack plugin:
|
||||
|
||||
```shell
|
||||
npx nx add @nx/powerpack-owners
|
||||
```
|
||||
|
||||
This will allow you to define an owners section in your `nx.json` where you can define owners at the project level or even leverage project tags. Here's a small example:
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
...
|
||||
"owners": {
|
||||
"format": "github",
|
||||
"patterns": [
|
||||
{
|
||||
"description": "CI configuration",
|
||||
"owners": ["@devops"],
|
||||
"files": [".github/workflows/**"]
|
||||
},
|
||||
{
|
||||
"description": "Order team",
|
||||
"owners": ["@team-orders"],
|
||||
"projects": ["tag:scope:orders"]
|
||||
},
|
||||
{
|
||||
"description": "Product team",
|
||||
"owners": ["@team-products"],
|
||||
"projects": ["tag:scope:products"]
|
||||
},
|
||||
{
|
||||
"description": "Design team",
|
||||
"owners": ["@team-design"],
|
||||
"projects": ["tag:scope:design-system"]
|
||||
}
|
||||
]
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
A dedicated `nx sync` command automatically synchronizes these definitions to a `CODEOWNERS` file that matches your VCS provider:
|
||||
|
||||
```{% fileName=".github/CODEOWNERS" %}
|
||||
|
||||
# CI configuration
|
||||
.github/workflows/** @devops
|
||||
|
||||
# Design team
|
||||
/libs/shared/ui/angular/form-controls/ @team-design
|
||||
|
||||
# Design team
|
||||
/libs/shared/ui/react/form-controls/ @team-design
|
||||
|
||||
# Product team
|
||||
/libs/products/feat-product-detail/ @team-products
|
||||
|
||||
# Order team
|
||||
/libs/orders/feat-current-orders/ @team-orders
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
Read all about how to [configure Codeowners for your project in our docs](/features/powerpack/owners).
|
||||
|
||||
## Self-hosted Cache Storage
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Here's an example of how to get started with [Amazon S3](https://aws.amazon.com/s3) based remote caching. First add the Powerpack plugin:
|
||||
|
||||
```shell
|
||||
npx nx add @nx/powerpack-s3-cache
|
||||
```
|
||||
|
||||
This will update your `nx.json` to add the new `cache` section.
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
...
|
||||
"s3": {
|
||||
"bucket": "your-s3-bucket-name",
|
||||
"region": "us-east-1"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To then leverage the S3 powered remote cache on CI, [follow the official AWS documentation](https://github.com/aws-actions/configure-aws-credentials). Here's a short example snippet using OIDC to authenticate with AWS on GitHub Actions:
|
||||
|
||||
```yaml {% fileName=".github/workflows/ci.yml" %}
|
||||
name: CI
|
||||
...
|
||||
permissions:
|
||||
id-token: write
|
||||
...
|
||||
|
||||
env:
|
||||
NX_DB_CACHE: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
...
|
||||
|
||||
- name: 'Configure AWS Credentials'
|
||||
uses: aws-actions/configure-aws-credentials@v4.0.2
|
||||
with:
|
||||
role-to-assume: arn:aws:iam::123456789123:role/GhAIBucketUserRole
|
||||
aws-region: us-east-1
|
||||
|
||||
...
|
||||
|
||||
- run: pnpm exec nx affected -t lint test build
|
||||
```
|
||||
|
||||
Similarly you can **set up network file based caching** using the `nx add @nx/powerpack-shared-fs-cache` package and by setting the `cacheDirectory` path in your `nx.json`.
|
||||
|
||||
Read all about how to [set up S3 or network drive based caching for your Nx workspace in our docs](/features/powerpack/custom-caching).
|
||||
|
||||
## Workspace Conformance (Beta)
|
||||
|
||||
We're releasing the `@nx/powerpack-conformance` plugin in an early preview. This new package focuses specifically on the maintainability of your monorepo. It allows you to encode your organization's standards so they can be enforced automatically. In this first version, the workspace conformance package ships with:
|
||||
|
||||
- [Enforce Module Boundaries](/nx-api/powerpack-conformance#enforce-module-boundaries): Similar to the Nx ESLint [Enforce Module Boundaries rule](https://nx-dev-git-docs-powerpack-nrwl.vercel.app/features/enforce-module-boundaries), but enforces boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
|
||||
- [Ensure Owners](/nx-api/powerpack-conformance#ensure-owners): Requires every project to have an owner defined for the `@nx/powerpack-owners` plugin.
|
||||
|
||||
To get started, install the following package:
|
||||
|
||||
```shell
|
||||
npx nx add @nx/powerpack-conformance
|
||||
```
|
||||
|
||||
This allows you to define conformance rules in your `nx.json`. Here is an example:
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
...
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
"rule": "@nx/powerpack-conformance/enforce-module-boundaries",
|
||||
"projects": ["!remix-app-e2e"],
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"rule": "@nx/powerpack-conformance/ensure-owners",
|
||||
"projects": ["!remix-app-e2e"]
|
||||
},
|
||||
{
|
||||
"rule": "./tools/local-conformance-rule.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can also define rules locally, as shown in the example above, which are simple TypeScript files:
|
||||
|
||||
```ts
|
||||
import { createConformanceRule } from '@nx/powerpack-conformance';
|
||||
|
||||
const rule = createConformanceRule({
|
||||
name: 'local-conformance-rule-example',
|
||||
category: 'security',
|
||||
reporter: 'project-reporter',
|
||||
implementation: async (context) => {
|
||||
return {
|
||||
severity: 'low',
|
||||
details: {
|
||||
violations: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export default rule;
|
||||
```
|
||||
|
||||
You can then run `nx conformance` to execute the conformance checks:
|
||||
|
||||

|
||||
|
||||
In this first preview release, you'll only be able to run workspace conformance rules on a single workspace. In future iterations, you **will be able to connect it to your existing Nx Cloud organization**, allowing you to upload conformance rules and run them across connected workspaces.
|
||||
|
||||
Read all the details on how to [get started with workspace conformance rules in our docs](/features/powerpack/conformance).
|
||||
|
||||
## Learn More
|
||||
|
||||
- [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)
|
||||
|
After Width: | Height: | Size: 645 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 519 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 911 KiB |
@@ -0,0 +1,17 @@
|
||||
# [Nx 19.8 Blogpost](/blog/nx-19-8-update)
|
||||
|
||||
{% youtube
|
||||
src="https://youtu.be/Zgv4LHvwGx0"
|
||||
title="Nx Console Run UI Form"
|
||||
width="100%" /%}
|
||||
|
||||
## Features
|
||||
|
||||
{% cards cols="2" %}
|
||||
{% card title="Nx Import" type="document" url="/nx-api/nx/documents/import" /%}
|
||||
{% card title="Improved Task Scheduling" type="document" url="/blog/nx-19-8-update#improved-task-scheduling" /%}
|
||||
{% card title="Project Crystal Comes to Angular" type="document" url="/blog/nx-19-8-update#project-crystal-comes-to-angular" /%}
|
||||
{% card title="Crystalize Your Entire Workspace In One Command" type="document" url="/blog/nx-19-8-update#crystalize-your-entire-workspace-in-one-command" /%}
|
||||
{% card title="New Nx Workspaces Created with ESLint v9" type="document" url="/blog/nx-19-8-update#new-nx-workspaces-created-with-eslint-v9" /%}
|
||||
{% card title="Nx Release Enhancements" type="document" url="/blog/nx-19-8-update#nx-release-enhancements" /%}
|
||||
{% /cards %}
|
||||
@@ -0,0 +1,144 @@
|
||||
[
|
||||
{
|
||||
"description": "A Nx Powerpack plugin which allows users to write and apply rules for your entire workspace that help with consistency, maintainability, reliability and security.",
|
||||
"documents": [
|
||||
{
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "A Nx Powerpack plugin which allows users to write and apply rules for your entire workspace that help with consistency, maintainability, reliability and security.",
|
||||
"file": "external-generated/packages/powerpack-conformance/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "powerpack-conformance/documents/overview",
|
||||
"tags": [],
|
||||
"originalFilePath": "shared/packages/powerpack-conformance/powerpack-conformance-plugin"
|
||||
}
|
||||
],
|
||||
"executors": [],
|
||||
"generators": [],
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-conformance",
|
||||
"packageName": "@nx/powerpack-conformance",
|
||||
"root": "/libs/nx-packages/powerpack-conformance",
|
||||
"source": "/libs/nx-packages/powerpack-conformance/src"
|
||||
},
|
||||
{
|
||||
"description": "Package to provide the ability to activate and read licenses for Nx Powerpack.",
|
||||
"documents": [],
|
||||
"executors": [],
|
||||
"generators": [],
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-license",
|
||||
"packageName": "@nx/powerpack-license",
|
||||
"root": "/libs/nx-packages/powerpack-license",
|
||||
"source": "/libs/nx-packages/powerpack-license/src"
|
||||
},
|
||||
{
|
||||
"description": "A Nx Powerpack plugin which provides the ability to configure and maintain codeowners for projects in Nx workspaces.",
|
||||
"documents": [
|
||||
{
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "A Nx Powerpack plugin which provides the ability to configure and maintain codeowners for projects in Nx workspaces.",
|
||||
"file": "external-generated/packages/powerpack-owners/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "powerpack-owners/documents/overview",
|
||||
"tags": [],
|
||||
"originalFilePath": "shared/packages/powerpack-owners/powerpack-owners-plugin"
|
||||
}
|
||||
],
|
||||
"executors": [],
|
||||
"generators": [
|
||||
{
|
||||
"description": "Initialize Nx Powerpack Owners config",
|
||||
"file": "external-generated/packages/powerpack-owners/generators/init.json",
|
||||
"hidden": false,
|
||||
"name": "init",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-owners/src/generators/init/schema.json",
|
||||
"path": "powerpack-owners/generators/init",
|
||||
"type": "generator"
|
||||
},
|
||||
{
|
||||
"description": "Sync Nx Powerpack Owners config to a CODEOWNERS file",
|
||||
"file": "external-generated/packages/powerpack-owners/generators/sync-codeowners-file.json",
|
||||
"hidden": false,
|
||||
"name": "sync-codeowners-file",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-owners/src/generators/sync-codeowners-file/schema.json",
|
||||
"path": "powerpack-owners/generators/sync-codeowners-file",
|
||||
"type": "generator"
|
||||
}
|
||||
],
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-owners",
|
||||
"packageName": "@nx/powerpack-owners",
|
||||
"root": "/libs/nx-packages/powerpack-owners",
|
||||
"source": "/libs/nx-packages/powerpack-owners/src"
|
||||
},
|
||||
{
|
||||
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Amazon S3.",
|
||||
"documents": [
|
||||
{
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Amazon S3.",
|
||||
"file": "external-generated/packages/powerpack-s3-cache/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "powerpack-s3-cache/documents/overview",
|
||||
"tags": [],
|
||||
"originalFilePath": "shared/packages/powerpack-s3-cache/powerpack-s3-cache-plugin"
|
||||
}
|
||||
],
|
||||
"executors": [],
|
||||
"generators": [
|
||||
{
|
||||
"description": "Initialize the S3 Cache",
|
||||
"file": "external-generated/packages/powerpack-s3-cache/generators/init.json",
|
||||
"hidden": false,
|
||||
"name": "init",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-s3-cache/src/generators/init/schema.json",
|
||||
"path": "powerpack-s3-cache/generators/init",
|
||||
"type": "generator"
|
||||
}
|
||||
],
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-s3-cache",
|
||||
"packageName": "@nx/powerpack-s3-cache",
|
||||
"root": "/libs/nx-packages/powerpack-s3-cache",
|
||||
"source": "/libs/nx-packages/powerpack-s3-cache/src"
|
||||
},
|
||||
{
|
||||
"description": "A Nx Powerpack plugin to enable you to use a shared file system directory",
|
||||
"documents": [
|
||||
{
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "A Nx Powerpack plugin to enable you to use a shared file system directory",
|
||||
"file": "external-generated/packages/powerpack-shared-fs-cache/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "powerpack-shared-fs-cache/documents/overview",
|
||||
"tags": [],
|
||||
"originalFilePath": "shared/packages/powerpack-shared-fs-cache/powerpack-shared-fs-cache-plugin"
|
||||
}
|
||||
],
|
||||
"executors": [],
|
||||
"generators": [
|
||||
{
|
||||
"description": "Add the shared fs cache",
|
||||
"file": "external-generated/packages/powerpack-shared-fs-cache/generators/init.json",
|
||||
"hidden": false,
|
||||
"name": "init",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-shared-fs-cache/src/generators/init/schema.json",
|
||||
"path": "powerpack-shared-fs-cache/generators/init",
|
||||
"type": "generator"
|
||||
}
|
||||
],
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-shared-fs-cache",
|
||||
"packageName": "@nx/powerpack-shared-fs-cache",
|
||||
"root": "/libs/nx-packages/powerpack-shared-fs-cache",
|
||||
"source": "/libs/nx-packages/powerpack-shared-fs-cache/src"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,215 @@
|
||||
---
|
||||
title: Overview of the Nx powerpack-conformance Plugin
|
||||
description: The Nx Powerpack Conformance plugin provides the ability to write and apply rules for your workspace
|
||||
---
|
||||
|
||||
The `@nx/powerpack-conformance` plugin allows [Nx Powerpack](/powerpack) users to write and apply rules for your entire workspace that help with **consistency**, **maintainability**, **reliability** and **security**.
|
||||
|
||||
The conformance plugin allows you to encode your own organization's standards so that they can be enforced automatically. Conformance rules can also complement linting tools by enforcing that those tools are configured in the recommended way. The rules are written in TypeScript but can be applied to any language in the codebase or focus entirely on configuration files.
|
||||
|
||||
The plugin also provides the following pre-written rules:
|
||||
|
||||
- [**Enforce Project Boundaries**](#enforce-project-boundaries): Similar to the Nx [ESLint Enforce Module Boundaries rule](/features/enforce-module-boundaries), but enforces the boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
|
||||
- [**Ensure Owners**](#ensure-owners): Require every project to have an owner defined for the [`@nx/powerpack-owners` plugin](/nx-api/powerpack-owners)
|
||||
|
||||
{% callout title="This plugin requires an active Nx Powerpack license" %}
|
||||
In order to use `@nx/powerpack-conformance`, you need to have an active Powerpack license. If you don't have a license or it has expired, the `nx conformance` command will fail.
|
||||
{% /callout %}
|
||||
|
||||
## Set Up @nx/powerpack-conformance
|
||||
|
||||
1. [Activate Powerpack](/recipes/installation/activate-powerpack) if you haven't already
|
||||
2. Install the package
|
||||
|
||||
```shell
|
||||
nx add @nx/powerpack-conformance
|
||||
```
|
||||
|
||||
3. Configure Conformance Rules
|
||||
|
||||
Configure the `@nx/powerpack-conformance` plugin in the `nx.json` file or in individual project configuration files. Consult the [Conformance Configuration Reference](#conformance-configuration-reference) section for more details.
|
||||
|
||||
4. Run the `nx conformance` command in CI
|
||||
|
||||
Add `nx conformance` to the beginning of the CI process.
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Without Nx Cloud" %}
|
||||
|
||||
```yaml
|
||||
- name: Enforce all conformance rules
|
||||
run: npx nx conformance
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Using Nx Cloud" %}
|
||||
|
||||
```yaml
|
||||
- name: Enforce all conformance rules
|
||||
run: npx nx-cloud record -- npx nx conformance
|
||||
```
|
||||
|
||||
Use `npx nx-cloud record --` to capture the logs for `nx conformance` in the Nx Cloud dashboard.
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
## Conformance Configuration Reference
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
/**
|
||||
* Relative path to a local rule implementation or node_module path.
|
||||
*/
|
||||
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
|
||||
/**
|
||||
* Rule specific configuration options. (Optional)
|
||||
*/
|
||||
"options": {},
|
||||
/**
|
||||
* The projects array allows users to opt in or out of violations for specific projects being reported by the current rule.
|
||||
* The array can contain any valid matchers for findMatchingProjects(), by default the implied value is ["*"]. (Optional)
|
||||
*/
|
||||
"projects": ["*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Provided Conformance Rules
|
||||
|
||||
The following rules are provided by Nx along with the `@nx/powerpack-conformance` plugin.
|
||||
|
||||
### Enforce Project Boundaries
|
||||
|
||||
This rule is similar to the Nx [ESLint Enforce Module Boundaries rule](/features/enforce-module-boundaries), but enforces the boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
|
||||
|
||||
Set the `rule` property to: `@nx/powerpack-conformance/enforce-project-boundaries`
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
|
||||
"options": {
|
||||
// Optional
|
||||
// Can be a boolean or an object with an array of buildTargetNames
|
||||
"requireBuildableDependenciesForBuildableProjects": {
|
||||
// Defaults to ["build"]
|
||||
"buildTargetNames": ["build", "compile"]
|
||||
},
|
||||
// Optional
|
||||
"ignoredCircularDependencies": [["projectA", "projectB"]],
|
||||
// Optional
|
||||
"depConstraints": [
|
||||
{
|
||||
// Must define either `sourceTag` or `allSourceTags`
|
||||
"sourceTag": "string",
|
||||
"allSourceTags": ["string"],
|
||||
// Optional
|
||||
"onlyDependOnProjectsWithTags": [],
|
||||
// Optional
|
||||
"notDependOnProjectsWithTags": []
|
||||
}
|
||||
],
|
||||
// Optional
|
||||
"checkDynamicDependenciesExceptions": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Options
|
||||
|
||||
| Property | Type | Default | Description |
|
||||
| ------------------------------------------------ | ------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ignoredCircularDependencies | _Array<[string, string]>_ | _[]_ | List of project pairs that should be skipped from `Circular dependencies` checks, including the self-circular dependency check. E.g. `['feature-project-a', 'myapp']`. Project name can be replaced by catch all `*` for more generic matches. |
|
||||
| checkDynamicDependenciesExceptions | _Array<string>_ | _[]_ | List of imports that should be skipped for `Imports of lazy-loaded libraries forbidden` checks. E.g. `['@myorg/lazy-project/component/*', '@myorg/other-project']` |
|
||||
| requireBuildableDependenciesForBuildableProjects | _boolean_ | _false_ | Enable to restrict the buildable projects from importing non-buildable libraries |
|
||||
| depConstraints | _Array<object>_ | _[]_ | List of dependency constraints between projects |
|
||||
|
||||
#### Dependency constraints
|
||||
|
||||
The `depConstraints` is an array of objects representing the constraints defined between source and target projects. A
|
||||
constraint must include `sourceTag` or `allSourceTags`. The constraints are applied with **AND** logical operation - for
|
||||
a given `source` project the resulting constraints would be **all** that match its tags.
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|
||||
| sourceTag | _string_ | Tag that source project must contain to match the constraint |
|
||||
| allSourceTags | _Array<string>_ | List of tags the source project must contain to match the constraint |
|
||||
| onlyDependOnProjectsWithTags | _Array<string>_ | The source **can depend only** on projects that contain at least one of these tags |
|
||||
| notDependOnProjectsWithTags | _Array<string>_ | The source **can not depend** on projects that contain at least one of these tags |
|
||||
|
||||
### Ensure Owners
|
||||
|
||||
This rule requires every project to have an owner defined for the [`@nx/powerpack-owners` plugin](/nx-api/powerpack-owners)
|
||||
|
||||
Set the `rule` property to: `@nx/powerpack-conformance/ensure-owners`
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
"rule": "@nx/powerpack-conformance/ensure-owners"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Custom Conformance Rules
|
||||
|
||||
To write your own conformance rule, specify a relative path to a TypeScript or JavaScript file as the rule name:
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
"rule": "./tools/local-conformance-rule.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The rule definition file should look like this:
|
||||
|
||||
```ts {% fileName="tools/local-conformance-rule.ts" %}
|
||||
import { createConformanceRule } from '@nx/powerpack-conformance';
|
||||
|
||||
const rule = createConformanceRule({
|
||||
name: 'local-conformance-rule-example',
|
||||
category: 'security', // `consistency`, `maintainability`, `reliability` or `security`
|
||||
reporter: 'project-reporter', // `project-reporter` or `project-files-reporter`
|
||||
implementation: async (context) => {
|
||||
const { projectGraph, ruleOptions } = context;
|
||||
// Your rule logic goes here
|
||||
return {
|
||||
severity: 'low', // 'high', 'medium' or 'low'
|
||||
details: {
|
||||
violations: [
|
||||
// Return an empty array if the rule passes
|
||||
{
|
||||
sourceProject: 'my-project',
|
||||
message: 'This is an informative error message.',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export default rule;
|
||||
```
|
||||
|
||||
Note that the severity of the error is defined by the rule author and can be adjusted based on the specific violations that are found.
|
||||
@@ -0,0 +1,326 @@
|
||||
---
|
||||
title: Overview of the Nx powerpack-owners Plugin
|
||||
description: The Nx Powerpack Owners plugin provides the ability to define code ownership based on projects in addition to files
|
||||
---
|
||||
|
||||
The `@nx/powerpack-owners` plugin extends the CODEOWNERS functionality to allow you to define code ownership based on projects in addition to the standard file-based definitions. It leverages the [`nx sync`](/concepts/sync-generators) command to compile `owners` configuration settings from `nx.json` and project configuration files into valid CODEOWNERS files for [GitHub](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners), [Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-use-code-owners/) or [GitLab](https://docs.gitlab.com/ee/user/project/codeowners/).
|
||||
|
||||
With this plugin, you can specify code ownership using the same project matcher syntax as [`nx run-many`](/nx-api/nx/documents/run-many#examples). This allows you to easily define rules for multiple projects that may not be located in the same directory. Also, the CODEOWNERS rules will not need to be revisited if a project location is changed or a new project is added.
|
||||
|
||||
{% callout title="This plugin requires an active Nx Powerpack license" %}
|
||||
In order to use `@nx/powerpack-owners`, you need to have an active Powerpack license. If you don't have a license or it has expired, the syncing process will stop working and you'll need to manually maintain your CODEOWNERS file.
|
||||
{% /callout %}
|
||||
|
||||
## Set Up @nx/powerpack-owners
|
||||
|
||||
1. [Activate Powerpack](/recipes/installation/activate-powerpack) if you haven't already
|
||||
2. Install the package
|
||||
|
||||
```shell
|
||||
nx add @nx/powerpack-owners
|
||||
```
|
||||
|
||||
3. Configure Ownership
|
||||
|
||||
Configure the `@nx/powerpack-owners` plugin in the `nx.json` file or in individual project configuration files. Consult the [Owners Configuration Reference](#owners-configuration-reference) section for more details.
|
||||
|
||||
4. Configure the [Sync Generator](/concepts/sync-generators) and CI
|
||||
|
||||
The `nx add @nx/powerpack-owners` command should have registered the `@nx/powerpack-owners:sync-codeowners-file` generator as a `globalGenerator` in `nx.json`. You can double check to make sure:
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"sync": {
|
||||
"globalGenerators": ["@nx/powerpack-owners:sync-codeowners-file"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Add `nx sync:check` to the beginning of the CI process.
|
||||
|
||||
```yaml
|
||||
- name: Ensure the workspace configuration is in sync
|
||||
run: npx nx sync:check
|
||||
```
|
||||
|
||||
It is also often helpful to add `nx sync` as a git push hook or git commit hook.
|
||||
|
||||
## Owners Configuration Reference
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="GitHub" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
// Can be set to true instead of an object to accept all defaults
|
||||
"owners": {
|
||||
// Options are `github`, `bitbucket` or `gitlab`. (Optional) Defaults to `github`
|
||||
"format": "github",
|
||||
// (Optional) Default changes based on format: `.github/CODEOWNERS`, `.bitbucket/CODEOWNERS`, `.gitlab/CODEOWNERS`
|
||||
"outputPath": "CODEOWNERS",
|
||||
// (Optional)
|
||||
"patterns": [
|
||||
{
|
||||
"description": "A description of the rule",
|
||||
"owners": ["@joelovesrust"],
|
||||
// specify either projects or files, not both
|
||||
// Can be any project specifier that could be used in `nx run-many`
|
||||
// See https://nx.dev/nx-api/nx/documents/run-many
|
||||
"projects": ["my-rust-app", "rust-*", "tag:rust"],
|
||||
// File globs
|
||||
"files": [".github/workflows/**/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Bitbucket" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
// Can be set to true instead of an object to accept all defaults
|
||||
"owners": {
|
||||
// Options are `github`, `bitbucket` or `gitlab`. (Optional) Defaults to `github`
|
||||
"format": "bitbucket",
|
||||
// (Optional) Default changes based on format: `.github/CODEOWNERS`, `.bitbucket/CODEOWNERS`, `.gitlab/CODEOWNERS`
|
||||
"outputPath": "CODEOWNERS",
|
||||
// (Optional)
|
||||
"patterns": [
|
||||
{
|
||||
"description": "A description of the rule",
|
||||
"owners": ["@joelovesrust"],
|
||||
// specify either projects or files, not both
|
||||
// Can be any project specifier that could be used in `nx run-many`
|
||||
// See https://nx.dev/nx-api/nx/documents/run-many
|
||||
"projects": ["my-rust-app", "rust-*", "tag:rust"],
|
||||
// File globs
|
||||
"files": [".github/workflows/**/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="GitLab" %}
|
||||
|
||||
If you are using GitLab, you can specify CODEOWNERS [sections](https://docs.gitlab.com/ee/user/project/codeowners/#organize-code-owners-by-putting-them-into-sections) which give you a little more control over the PR process.
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
// Can be set to true instead of an object to accept all defaults
|
||||
"owners": {
|
||||
// Options are `github`, `bitbucket` or `gitlab`. (Optional) Defaults to `github`
|
||||
"format": "gitlab",
|
||||
// (Optional) Default changes based on format: `.github/CODEOWNERS`, `.bitbucket/CODEOWNERS`, `.gitlab/CODEOWNERS`
|
||||
"outputPath": "CODEOWNERS",
|
||||
// (Optional)
|
||||
"patterns": [
|
||||
{
|
||||
"description": "A description of the rule",
|
||||
"owners": ["@joelovesrust"],
|
||||
// Specify either `projects` or `files`, not both
|
||||
// Can be any project specifier that could be used in `nx run-many`
|
||||
// See https://nx.dev/nx-api/nx/documents/run-many
|
||||
"projects": ["my-rust-app", "rust-*", "tag:rust"],
|
||||
// File globs
|
||||
"files": [".github/workflows/**/*"]
|
||||
}
|
||||
],
|
||||
// (Optional)
|
||||
"sections": [
|
||||
{
|
||||
// Labels the section
|
||||
"name": "My section",
|
||||
// (Optional) The owners to use if a pattern does not specify a set of owners
|
||||
"defaultOwners": ["@cheddar"],
|
||||
// Specify either `numberOfRequiredApprovals` or `optional`, not both
|
||||
// (Optional) Require more than one person to approve the PR
|
||||
"numberOfRequiredApprovals": 2,
|
||||
// (Optional) Do not require any approvals, just notify the owners
|
||||
"optional": true,
|
||||
// Same format as the root patterns
|
||||
"patterns": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```jsonc {% fileName="path/to/project/project.json" %}
|
||||
{
|
||||
"owners": {
|
||||
// Keys are file globs relative to the root of the project
|
||||
// Owners can be listed as a string array
|
||||
"**/*": ["@ahmed", "@petra"],
|
||||
// Owners can be listed as an object with a description
|
||||
"README.md": {
|
||||
"description": "Jared is very particular about the README file",
|
||||
"owners": ["@jared"]
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
**Examples:**
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="GitHub" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"owners": {
|
||||
// defaults to "github"
|
||||
"format": "github",
|
||||
// defaults to ".github/CODEOWNERS"
|
||||
"outputPath": "CODEOWNERS",
|
||||
"patterns": [
|
||||
{
|
||||
"description": "Joe should double check all changes to rust code",
|
||||
"projects": ["tag:rust"],
|
||||
"owners": ["@joelovesrust"]
|
||||
},
|
||||
{
|
||||
"description": "The Finance team owns these projects",
|
||||
"projects": ["finance-*"],
|
||||
"owners": ["@finance-team"]
|
||||
},
|
||||
{
|
||||
"description": "Alice, Bob and Cecil work together on these projects",
|
||||
"projects": ["admin", "booking", "cart"],
|
||||
"owners": ["@alice", "@bob", "@cecil"]
|
||||
},
|
||||
{
|
||||
"description": "CI Workflows",
|
||||
"files": [".github/workflows/**/*"],
|
||||
"owners": ["@devops"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```jsonc {% fileName="packages/my-project/project.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"**/*": ["@ahmed", "@petra"],
|
||||
"package.json": ["@ahmed"],
|
||||
"README.md": {
|
||||
"owners": ["@jared"],
|
||||
"description": "Jared is very particular about the README file"
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Bitbucket" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"format": "bitbucket",
|
||||
// defaults to ".bitbucket/CODEOWNERS"
|
||||
"outputPath": "CODEOWNERS",
|
||||
"patterns": [
|
||||
{
|
||||
"description": "Joe should double check all changes to rust code",
|
||||
"projects": ["tag:rust"],
|
||||
"owners": ["@joelovesrust"]
|
||||
},
|
||||
{
|
||||
"description": "The Finance team owns these projects",
|
||||
"projects": ["finance-*"],
|
||||
"owners": ["@finance-team"]
|
||||
},
|
||||
{
|
||||
"description": "Alice, Bob and Cecil work together on these projects",
|
||||
"projects": ["admin", "booking", "cart"],
|
||||
"owners": ["@alice", "@bob", "@cecil"]
|
||||
},
|
||||
{
|
||||
"description": "CI Workflows",
|
||||
"files": [".github/workflows/**/*"],
|
||||
"owners": ["@devops"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```jsonc {% fileName="packages/my-project/project.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"**/*": ["@ahmed", "@petra"],
|
||||
"package.json": ["@ahmed"],
|
||||
"README.md": {
|
||||
"owners": ["@jared"],
|
||||
"description": "Jared is very particular about the README file"
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="GitLab" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"format": "gitlab",
|
||||
// defaults to ".gitlab/CODEOWNERS"
|
||||
"outputPath": "CODEOWNERS",
|
||||
"patterns": [
|
||||
{
|
||||
"description": "Joe should double check all changes to rust code",
|
||||
"projects": ["tag:rust"],
|
||||
"owners": ["@joelovesrust"]
|
||||
},
|
||||
{
|
||||
"description": "CI Workflows",
|
||||
"files": [".github/workflows/**/*"],
|
||||
"owners": ["@devops"]
|
||||
}
|
||||
],
|
||||
"sections": [
|
||||
{
|
||||
"name": "Finance",
|
||||
"defaultOwners": ["@finance-team"],
|
||||
"numberOfRequiredApprovals": 2,
|
||||
"patterns": [
|
||||
{
|
||||
"description": "The Finance team owns these projects",
|
||||
"projects": ["finance-*"]
|
||||
},
|
||||
{
|
||||
"description": "Alice, Bob and Cecil work together on these projects",
|
||||
"projects": ["admin", "booking", "cart"],
|
||||
"owners": ["@alice", "@bob", "@cecil"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```jsonc {% fileName="packages/my-project/project.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"**/*": ["@ahmed", "@petra"],
|
||||
"package.json": ["@ahmed"],
|
||||
"README.md": {
|
||||
"owners": ["@jared"],
|
||||
"description": "Jared is very particular about the README file"
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "init",
|
||||
"factory": "./src/generators/init/init",
|
||||
"schema": {
|
||||
"$schema": "http://json-schema.org/schema",
|
||||
"id": "NxPowerpackOwnersInit",
|
||||
"title": "Add Powerpack Owners Configuration to the workspace",
|
||||
"type": "object",
|
||||
"cli": "nx",
|
||||
"properties": {},
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Initialize Nx Powerpack Owners config",
|
||||
"implementation": "/libs/nx-packages/powerpack-owners/src/generators/init/init.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/libs/nx-packages/powerpack-owners/src/generators/init/schema.json",
|
||||
"type": "generator"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "sync-codeowners-file",
|
||||
"factory": "./src/generators/sync-codeowners-file/generator",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"$id": "NxPowerpackOwnersSyncCodeownersFileGenerator",
|
||||
"title": "Nx Powerpack Owners Sync CODEOWNERS File Generator",
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": [],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Sync Nx Powerpack Owners config to a CODEOWNERS file",
|
||||
"implementation": "/libs/nx-packages/powerpack-owners/src/generators/sync-codeowners-file/generator.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/libs/nx-packages/powerpack-owners/src/generators/sync-codeowners-file/schema.json",
|
||||
"type": "generator"
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
---
|
||||
title: Overview of the Nx powerpack-s3-cache Plugin
|
||||
description: The powerpack-s3-cache Nx plugin enables you to use an Amazon S3 bucket to host your remote cache instead of Nx Cloud
|
||||
---
|
||||
|
||||
The `@nx/powerpack-s3-cache` plugin enables you to use an [Amazon S3](https://aws.amazon.com/s3) bucket instead of Nx Cloud to host your remote cache.
|
||||
|
||||
This plugin will enable the remote cache for your Nx workspace, but does not provide any of the other features of Nx Cloud. If you want to leverage [distributed task execution](/ci/features/distribute-task-execution), [re-running flaky tasks](/ci/features/flaky-tasks) or [automatically splitting tasks](/ci/features/split-e2e-tasks), you'll need to [connect to Nx Cloud](/ci/intro/connect-to-nx-cloud) and use [Nx Replay](/ci/features/remote-cache) instead.
|
||||
|
||||
{% callout type="warning" title="Potential Cache Poisoning" %}
|
||||
Using your own Amazon S3 bucket to host the remote cache opens you up to the possibility of [cache poisoning](/troubleshooting/unknown-local-cache). To avoid this, use [Nx Replay](/ci/features/remote-cache).
|
||||
{% /callout %}
|
||||
|
||||
{% callout title="This plugin requires an active Nx Powerpack license" %}
|
||||
In order to use `@nx/powerpack-s3-cache`, you need to have an active Powerpack license. If you don't have a license or it has expired, your cache will no longer be shared and each machine will use its local cache.
|
||||
{% /callout %}
|
||||
|
||||
## Set Up @nx/powerpack-s3-cache
|
||||
|
||||
### 1. Install the Package
|
||||
|
||||
1. [Activate Powerpack](/recipes/installation/activate-powerpack) if you haven't already
|
||||
2. Install the package
|
||||
|
||||
```shell
|
||||
nx add @nx/powerpack-s3-cache
|
||||
```
|
||||
|
||||
### 2. Authenticate with AWS
|
||||
|
||||
There are four different ways to authenticate with AWS. They will be attempted in this order:
|
||||
|
||||
1. Environment variables
|
||||
2. INI config files
|
||||
3. Single sign-on
|
||||
4. `nx.json` settings
|
||||
|
||||
#### Environment Variables
|
||||
|
||||
[AWS provides environment variables](https://docs.aws.amazon.com/sdkref/latest/guide/environment-variables.html) that can be used to authenticate:
|
||||
|
||||
| **Environment Variable** | **Description** |
|
||||
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `AWS_ACCESS_KEY_ID` | The access key for your AWS account. |
|
||||
| `AWS_SECRET_ACCESS_KEY` | The secret key for your AWS account. |
|
||||
| `AWS_SESSION_TOKEN` | The session key for your AWS account. This is only needed when you are using temporary credentials. |
|
||||
| `AWS_CREDENTIAL_EXPIRATION` | The expiration time of the credentials contained in the environment variables described above. This value must be in a format compatible with the [ISO-8601 standard](https://en.wikipedia.org/wiki/ISO_8601) and is only needed when you are using temporary credentials. |
|
||||
|
||||
Both the `AWS_ACCESS_KEY_ID` and the `AWS_SECRET_ACCESS_KEY` environment variables are required to use the environment variable authentication method.
|
||||
|
||||
#### INI Config Files
|
||||
|
||||
AWS can read your authentication credentials from [shared INI config files](https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html). The files are located at `~/.aws/credentials` and `~/.aws/config`. Both files are expected to be INI formatted with section names corresponding to profiles. Sections in the credentials file are treated as profile names, whereas profile sections in the config file must have the format of `[profile profile-name]`, except for the default profile. Profiles that appear in both files will not be merged, and the version that appears in the credentials file will be given precedence over the profile found in the config file.
|
||||
|
||||
#### Single Sign-On
|
||||
|
||||
Nx can read the active access token [created after running `aws sso login`](https://docs.aws.amazon.com/sdkref/latest/guide/understanding-sso.html) then request temporary AWS credentials. You can create the `AwsCredentialIdentityProvider` functions using the inline SSO parameters (`ssoStartUrl`, `ssoAccountId`, `ssoRegion`, `ssoRoleName`) or load them from [AWS SDKs and Tools shared configuration and credentials files](https://docs.aws.amazon.com/credref/latest/refdocs/creds-config-files.html). Profiles in the `credentials` file are given precedence over profiles in the `config` file.
|
||||
|
||||
#### Credentials in `nx.json` File
|
||||
|
||||
Storing your credentials in the `nx.json` file is the least secure of the 4 authentication options, since anyone with read access to your code base will have access to your AWS credentials.
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"s3": {
|
||||
"ssoProfile": "default",
|
||||
"accessKeyId": "MYACCESSKEYID",
|
||||
"secretAccessKey": "MYSECRETACCESSKEY"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| **Property** | **Description** |
|
||||
| ------------------- | ----------------------------------------------------------------------------- |
|
||||
| **ssoProfile** | The name of the profile to use from your AWS CLI SSO Configuration (optional) |
|
||||
| **endpoint** | The AWS endpoint URL (optional) |
|
||||
| **accessKeyId** | AWS Access Key ID (optional) |
|
||||
| **secretAccessKey** | AWS secret access key (optional) |
|
||||
|
||||
### 3. Configure S3 Cache
|
||||
|
||||
Regardless of how you manage your AWS authentication, you need to configure your Nx cache in the `nx.json` file. The `bucket` that you specify needs to already exist - Nx doesn't create it for you.
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"s3": {
|
||||
"region": "us-east-1",
|
||||
"bucket": "my-bucket",
|
||||
"encryptionKey": "create-your-own-key"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| **Property** | **Description** |
|
||||
| ----------------- | --------------------------------------------------------------------------------- |
|
||||
| **region** | The id of the AWS region to use |
|
||||
| **bucket** | The name of the AWS bucket to use |
|
||||
| **encryptionKey** | Nx encryption key used to encrypt and decrypt artifacts from the cache (optional) |
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "init",
|
||||
"factory": "./src/generators/init/generator",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"$id": "Init",
|
||||
"title": "",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"region": {
|
||||
"type": "string",
|
||||
"description": "The AWS region the bucket is located in",
|
||||
"x-prompt": "Which AWS region is the bucket located in?"
|
||||
},
|
||||
"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?"
|
||||
}
|
||||
},
|
||||
"required": ["region", "bucket"],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Initialize the S3 Cache",
|
||||
"implementation": "/libs/nx-packages/powerpack-s3-cache/src/generators/init/generator.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/libs/nx-packages/powerpack-s3-cache/src/generators/init/schema.json",
|
||||
"type": "generator"
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: Overview of the Nx powerpack-shared-fs-cache Plugin
|
||||
description: The powerpack-shared-fs-cache Nx plugin enables you to use a shared file system directory instead of Nx Cloud to host your remote cache
|
||||
---
|
||||
|
||||
The `@nx/powerpack-shared-fs-cache` plugin enables you to use a shared file system directory instead of Nx Cloud to host your remote cache. You are responsible for the sharing mechanism for the directory, but the plugin ensures that Nx correctly associates task metadata with the file artifacts.
|
||||
|
||||
This plugin will enable the remote cache for your Nx workspace, but does not provide any of the other features of Nx Cloud. If you want to leverage [distributed task execution](/ci/features/distribute-task-execution), [re-running flaky tasks](/ci/features/flaky-tasks) or [automatically splitting tasks](/ci/features/split-e2e-tasks), you'll need to [connect to Nx Cloud](/ci/intro/connect-to-nx-cloud) and use [Nx Replay](/ci/features/remote-cache) instead.
|
||||
|
||||
{% callout type="warning" title="Potential Cache Poisoning" %}
|
||||
Using a shared file system folder for the remote cache opens you up to the possibility of [cache poisoning](/troubleshooting/unknown-local-cache). To avoid this, use [Nx Replay](/ci/features/remote-cache).
|
||||
{% /callout %}
|
||||
|
||||
{% callout title="This plugin requires an active Nx Powerpack license" %}
|
||||
In order to use `@nx/powerpack-shared-fs-cache`, you need to have an active Powerpack license. If you don't have a license or it has expired, your cache will no longer be shared and each machine will use its local cache.
|
||||
{% /callout %}
|
||||
|
||||
## Set Up @nx/powerpack-shared-fs-cache
|
||||
|
||||
### 1. Install the Package
|
||||
|
||||
1. [Activate Powerpack](/recipes/installation/activate-powerpack) if you haven't already
|
||||
2. Install the package
|
||||
|
||||
```shell
|
||||
nx add @nx/powerpack-shared-fs-cache
|
||||
```
|
||||
|
||||
### 2. Configure the Cache Directory
|
||||
|
||||
The `@nx/powerpack-shared-fs-cache` plugin treats your local cache directory as if it is also a remote cache directory. The local cache directory can be set using `cacheDirectory` in the `nx.json` file or the `NX_CACHE_DIRECTORY` environment variable. The default local cache directory is `.nx/cache`
|
||||
|
||||
### 3. Share the Cache Directory
|
||||
|
||||
The `@nx/powerpack-shared-fs-cache` plugin does not actually share the cache directory across your organization. You are responsible for enabling the actual sharing mechanism. If you want Nx to handle the sharing, use [Nx Replay](/ci/features/remote-cache) instead. Your shared file system directory might be a directory that is saved and restored by a CI provider or it could be a shared network drive.
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "init",
|
||||
"factory": "./src/generators/init/generator",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"$id": "Init",
|
||||
"title": "",
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": [],
|
||||
"presets": []
|
||||
},
|
||||
"description": "Add the shared fs cache",
|
||||
"implementation": "/libs/nx-packages/powerpack-shared-fs-cache/src/generators/init/generator.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/libs/nx-packages/powerpack-shared-fs-cache/src/generators/init/schema.json",
|
||||
"type": "generator"
|
||||
}
|
||||
@@ -85,29 +85,27 @@ Print the task graph to the console:
|
||||
|
||||
## Options
|
||||
|
||||
| Option | Type | Description |
|
||||
| ----------- | ------- | ----------------------------------------- |
|
||||
| ~~`--all`~~ | boolean | **Deprecated:** Use `nx run-many` instead |
|
||||
|
||||
|
|
||||
|
||||
| `--base` | string | Base of the current branch (usually main). |
|
||||
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
|
||||
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
|
||||
| `--exclude` | string | Exclude certain projects from being processed. |
|
||||
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
|
||||
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
|
||||
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
|
||||
| `--head` | string | Latest commit of the current branch (usually HEAD). |
|
||||
| `--help` | boolean | Show help. |
|
||||
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
|
||||
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
|
||||
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
|
||||
| `--parallel` | string | Max number of parallel processes [default is 3]. |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--targets` | string | Tasks to run for affected projects. |
|
||||
| `--uncommitted` | boolean | Uncommitted changes. |
|
||||
| `--untracked` | boolean | Untracked changes. |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
| Option | Type | Description |
|
||||
| --------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ~~`--all`~~ | boolean | **Deprecated:** Use `nx run-many` instead |
|
||||
| `--base` | string | Base of the current branch (usually main). |
|
||||
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
|
||||
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
|
||||
| `--exclude` | string | Exclude certain projects from being processed. |
|
||||
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
|
||||
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
|
||||
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
|
||||
| `--head` | string | Latest commit of the current branch (usually HEAD). |
|
||||
| `--help` | boolean | Show help. |
|
||||
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
|
||||
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
|
||||
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
|
||||
| `--parallel` | string | Max number of parallel processes [default is 3]. |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--skipSync` | boolean | Skips running the sync generators associated with the tasks. (Default: `false`) |
|
||||
| `--targets` | string | Tasks to run for affected projects. |
|
||||
| `--uncommitted` | boolean | Uncommitted changes. |
|
||||
| `--untracked` | boolean | Untracked changes. |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
|
||||
@@ -128,6 +128,7 @@ nx release publish
|
||||
| `--registry` | string | The registry to publish to. |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--skipSync` | boolean | Skips running the sync generators associated with the tasks. (Default: `false`) |
|
||||
| `--tag` | string | The distribution tag to apply to the published package. |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
|
||||
@@ -107,6 +107,7 @@ Print the task graph to the console:
|
||||
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns). |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--skipSync` | boolean | Skips running the sync generators associated with the tasks. (Default: `false`) |
|
||||
| `--targets` | string | Tasks to run for affected projects. |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
|
||||
@@ -81,5 +81,6 @@ Run's a target named build:test for the myapp project. Note the quotes around th
|
||||
| `--project` | string | Target project. |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--skipSync` | boolean | Skips running the sync generators associated with the tasks. (Default: `false`) |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
|
||||
@@ -23,6 +23,7 @@ Nx.json configuration
|
||||
- [cli](../../devkit/documents/NxJsonConfiguration#cli): Object
|
||||
- [defaultBase](../../devkit/documents/NxJsonConfiguration#defaultbase): string
|
||||
- [defaultProject](../../devkit/documents/NxJsonConfiguration#defaultproject): string
|
||||
- [enableDbCache](../../devkit/documents/NxJsonConfiguration#enabledbcache): boolean
|
||||
- [extends](../../devkit/documents/NxJsonConfiguration#extends): string
|
||||
- [generators](../../devkit/documents/NxJsonConfiguration#generators): Object
|
||||
- [implicitDependencies](../../devkit/documents/NxJsonConfiguration#implicitdependencies): ImplicitDependencyEntry<T>
|
||||
@@ -98,6 +99,14 @@ will be used. Convenient for small workspaces with one main application.
|
||||
|
||||
---
|
||||
|
||||
### enableDbCache
|
||||
|
||||
• `Optional` **enableDbCache**: `boolean`
|
||||
|
||||
Enable the new experimental db based cache
|
||||
|
||||
---
|
||||
|
||||
### extends
|
||||
|
||||
• `Optional` **extends**: `string`
|
||||
|
||||
@@ -21,6 +21,7 @@ use ProjectsConfigurations or NxJsonConfiguration
|
||||
- [cli](../../devkit/documents/Workspace#cli): Object
|
||||
- [defaultBase](../../devkit/documents/Workspace#defaultbase): string
|
||||
- [defaultProject](../../devkit/documents/Workspace#defaultproject): string
|
||||
- [enableDbCache](../../devkit/documents/Workspace#enabledbcache): boolean
|
||||
- [extends](../../devkit/documents/Workspace#extends): string
|
||||
- [generators](../../devkit/documents/Workspace#generators): Object
|
||||
- [implicitDependencies](../../devkit/documents/Workspace#implicitdependencies): ImplicitDependencyEntry<string[] | "\*">
|
||||
@@ -118,6 +119,18 @@ will be used. Convenient for small workspaces with one main application.
|
||||
|
||||
---
|
||||
|
||||
### enableDbCache
|
||||
|
||||
• `Optional` **enableDbCache**: `boolean`
|
||||
|
||||
Enable the new experimental db based cache
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[enableDbCache](../../devkit/documents/NxJsonConfiguration#enabledbcache)
|
||||
|
||||
---
|
||||
|
||||
### extends
|
||||
|
||||
• `Optional` **extends**: `string`
|
||||
|
||||
@@ -323,6 +323,39 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Powerpack Features",
|
||||
"path": "/features/powerpack",
|
||||
"id": "powerpack",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Run Language-Agnostic Conformance Rules",
|
||||
"path": "/features/powerpack/conformance",
|
||||
"id": "conformance",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Define Code Ownership at the Project Level",
|
||||
"path": "/features/powerpack/owners",
|
||||
"id": "owners",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Self-Host the Remote Cache",
|
||||
"path": "/features/powerpack/custom-caching",
|
||||
"id": "custom-caching",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "CI Features",
|
||||
"path": "/features/ci-features",
|
||||
@@ -439,6 +472,63 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Powerpack Features",
|
||||
"path": "/features/powerpack",
|
||||
"id": "powerpack",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Run Language-Agnostic Conformance Rules",
|
||||
"path": "/features/powerpack/conformance",
|
||||
"id": "conformance",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Define Code Ownership at the Project Level",
|
||||
"path": "/features/powerpack/owners",
|
||||
"id": "owners",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Self-Host the Remote Cache",
|
||||
"path": "/features/powerpack/custom-caching",
|
||||
"id": "custom-caching",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Run Language-Agnostic Conformance Rules",
|
||||
"path": "/features/powerpack/conformance",
|
||||
"id": "conformance",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Define Code Ownership at the Project Level",
|
||||
"path": "/features/powerpack/owners",
|
||||
"id": "owners",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Self-Host the Remote Cache",
|
||||
"path": "/features/powerpack/custom-caching",
|
||||
"id": "custom-caching",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "CI Features",
|
||||
"path": "/features/ci-features",
|
||||
@@ -1081,6 +1171,14 @@
|
||||
"id": "installation",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Activate Powerpack",
|
||||
"path": "/recipes/installation/activate-powerpack",
|
||||
"id": "activate-powerpack",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Install Nx in a Non-Javascript Repo",
|
||||
"path": "/recipes/installation/install-non-javascript",
|
||||
@@ -2095,6 +2193,14 @@
|
||||
"id": "installation",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Activate Powerpack",
|
||||
"path": "/recipes/installation/activate-powerpack",
|
||||
"id": "activate-powerpack",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Install Nx in a Non-Javascript Repo",
|
||||
"path": "/recipes/installation/install-non-javascript",
|
||||
@@ -2114,6 +2220,14 @@
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Activate Powerpack",
|
||||
"path": "/recipes/installation/activate-powerpack",
|
||||
"id": "activate-powerpack",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Install Nx in a Non-Javascript Repo",
|
||||
"path": "/recipes/installation/install-non-javascript",
|
||||
@@ -4762,6 +4876,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Custom Task Runners",
|
||||
"path": "/deprecated/custom-task-runners",
|
||||
"id": "custom-task-runners",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Workspace Executors",
|
||||
"path": "/deprecated/workspace-executors",
|
||||
@@ -4861,6 +4983,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Custom Task Runners",
|
||||
"path": "/deprecated/custom-task-runners",
|
||||
"id": "custom-task-runners",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Workspace Executors",
|
||||
"path": "/deprecated/workspace-executors",
|
||||
@@ -10407,6 +10537,177 @@
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "powerpack-conformance",
|
||||
"path": "/nx-api/powerpack-conformance",
|
||||
"name": "powerpack-conformance",
|
||||
"children": [
|
||||
{
|
||||
"id": "documents",
|
||||
"path": "/nx-api/powerpack-conformance/documents",
|
||||
"name": "documents",
|
||||
"children": [
|
||||
{
|
||||
"name": "Overview",
|
||||
"path": "/nx-api/powerpack-conformance/documents/overview",
|
||||
"id": "overview",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "powerpack-license",
|
||||
"path": "/nx-api/powerpack-license",
|
||||
"name": "powerpack-license",
|
||||
"children": [],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "powerpack-owners",
|
||||
"path": "/nx-api/powerpack-owners",
|
||||
"name": "powerpack-owners",
|
||||
"children": [
|
||||
{
|
||||
"id": "documents",
|
||||
"path": "/nx-api/powerpack-owners/documents",
|
||||
"name": "documents",
|
||||
"children": [
|
||||
{
|
||||
"name": "Overview",
|
||||
"path": "/nx-api/powerpack-owners/documents/overview",
|
||||
"id": "overview",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "generators",
|
||||
"path": "/nx-api/powerpack-owners/generators",
|
||||
"name": "generators",
|
||||
"children": [
|
||||
{
|
||||
"id": "init",
|
||||
"path": "/nx-api/powerpack-owners/generators/init",
|
||||
"name": "init",
|
||||
"children": [],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "sync-codeowners-file",
|
||||
"path": "/nx-api/powerpack-owners/generators/sync-codeowners-file",
|
||||
"name": "sync-codeowners-file",
|
||||
"children": [],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "powerpack-s3-cache",
|
||||
"path": "/nx-api/powerpack-s3-cache",
|
||||
"name": "powerpack-s3-cache",
|
||||
"children": [
|
||||
{
|
||||
"id": "documents",
|
||||
"path": "/nx-api/powerpack-s3-cache/documents",
|
||||
"name": "documents",
|
||||
"children": [
|
||||
{
|
||||
"name": "Overview",
|
||||
"path": "/nx-api/powerpack-s3-cache/documents/overview",
|
||||
"id": "overview",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "generators",
|
||||
"path": "/nx-api/powerpack-s3-cache/generators",
|
||||
"name": "generators",
|
||||
"children": [
|
||||
{
|
||||
"id": "init",
|
||||
"path": "/nx-api/powerpack-s3-cache/generators/init",
|
||||
"name": "init",
|
||||
"children": [],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "powerpack-shared-fs-cache",
|
||||
"path": "/nx-api/powerpack-shared-fs-cache",
|
||||
"name": "powerpack-shared-fs-cache",
|
||||
"children": [
|
||||
{
|
||||
"id": "documents",
|
||||
"path": "/nx-api/powerpack-shared-fs-cache/documents",
|
||||
"name": "documents",
|
||||
"children": [
|
||||
{
|
||||
"name": "Overview",
|
||||
"path": "/nx-api/powerpack-shared-fs-cache/documents/overview",
|
||||
"id": "overview",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "generators",
|
||||
"path": "/nx-api/powerpack-shared-fs-cache/generators",
|
||||
"name": "generators",
|
||||
"children": [
|
||||
{
|
||||
"id": "init",
|
||||
"path": "/nx-api/powerpack-shared-fs-cache/generators/init",
|
||||
"name": "init",
|
||||
"children": [],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3499,5 +3499,152 @@
|
||||
}
|
||||
},
|
||||
"path": "/nx-api/workspace"
|
||||
},
|
||||
"powerpack-conformance": {
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-conformance",
|
||||
"packageName": "@nx/powerpack-conformance",
|
||||
"description": "A Nx Powerpack plugin which allows users to write and apply rules for your entire workspace that help with consistency, maintainability, reliability and security.",
|
||||
"documents": {
|
||||
"/nx-api/powerpack-conformance/documents/overview": {
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "A Nx Powerpack plugin which allows users to write and apply rules for your entire workspace that help with consistency, maintainability, reliability and security.",
|
||||
"file": "external-generated/packages/powerpack-conformance/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/powerpack-conformance/documents/overview",
|
||||
"tags": [],
|
||||
"originalFilePath": "shared/packages/powerpack-conformance/powerpack-conformance-plugin"
|
||||
}
|
||||
},
|
||||
"root": "/libs/nx-packages/powerpack-conformance",
|
||||
"source": "/libs/nx-packages/powerpack-conformance/src",
|
||||
"executors": {},
|
||||
"generators": {},
|
||||
"path": "/nx-api/powerpack-conformance"
|
||||
},
|
||||
"powerpack-license": {
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-license",
|
||||
"packageName": "@nx/powerpack-license",
|
||||
"description": "Package to provide the ability to activate and read licenses for Nx Powerpack.",
|
||||
"documents": {},
|
||||
"root": "/libs/nx-packages/powerpack-license",
|
||||
"source": "/libs/nx-packages/powerpack-license/src",
|
||||
"executors": {},
|
||||
"generators": {},
|
||||
"path": "/nx-api/powerpack-license"
|
||||
},
|
||||
"powerpack-owners": {
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-owners",
|
||||
"packageName": "@nx/powerpack-owners",
|
||||
"description": "A Nx Powerpack plugin which provides the ability to configure and maintain codeowners for projects in Nx workspaces.",
|
||||
"documents": {
|
||||
"/nx-api/powerpack-owners/documents/overview": {
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "A Nx Powerpack plugin which provides the ability to configure and maintain codeowners for projects in Nx workspaces.",
|
||||
"file": "external-generated/packages/powerpack-owners/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/powerpack-owners/documents/overview",
|
||||
"tags": [],
|
||||
"originalFilePath": "shared/packages/powerpack-owners/powerpack-owners-plugin"
|
||||
}
|
||||
},
|
||||
"root": "/libs/nx-packages/powerpack-owners",
|
||||
"source": "/libs/nx-packages/powerpack-owners/src",
|
||||
"executors": {},
|
||||
"generators": {
|
||||
"/nx-api/powerpack-owners/generators/init": {
|
||||
"description": "Initialize Nx Powerpack Owners config",
|
||||
"file": "external-generated/packages/powerpack-owners/generators/init.json",
|
||||
"hidden": false,
|
||||
"name": "init",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-owners/src/generators/init/schema.json",
|
||||
"path": "/nx-api/powerpack-owners/generators/init",
|
||||
"type": "generator"
|
||||
},
|
||||
"/nx-api/powerpack-owners/generators/sync-codeowners-file": {
|
||||
"description": "Sync Nx Powerpack Owners config to a CODEOWNERS file",
|
||||
"file": "external-generated/packages/powerpack-owners/generators/sync-codeowners-file.json",
|
||||
"hidden": false,
|
||||
"name": "sync-codeowners-file",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-owners/src/generators/sync-codeowners-file/schema.json",
|
||||
"path": "/nx-api/powerpack-owners/generators/sync-codeowners-file",
|
||||
"type": "generator"
|
||||
}
|
||||
},
|
||||
"path": "/nx-api/powerpack-owners"
|
||||
},
|
||||
"powerpack-s3-cache": {
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-s3-cache",
|
||||
"packageName": "@nx/powerpack-s3-cache",
|
||||
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Amazon S3.",
|
||||
"documents": {
|
||||
"/nx-api/powerpack-s3-cache/documents/overview": {
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Amazon S3.",
|
||||
"file": "external-generated/packages/powerpack-s3-cache/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/powerpack-s3-cache/documents/overview",
|
||||
"tags": [],
|
||||
"originalFilePath": "shared/packages/powerpack-s3-cache/powerpack-s3-cache-plugin"
|
||||
}
|
||||
},
|
||||
"root": "/libs/nx-packages/powerpack-s3-cache",
|
||||
"source": "/libs/nx-packages/powerpack-s3-cache/src",
|
||||
"executors": {},
|
||||
"generators": {
|
||||
"/nx-api/powerpack-s3-cache/generators/init": {
|
||||
"description": "Initialize the S3 Cache",
|
||||
"file": "external-generated/packages/powerpack-s3-cache/generators/init.json",
|
||||
"hidden": false,
|
||||
"name": "init",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-s3-cache/src/generators/init/schema.json",
|
||||
"path": "/nx-api/powerpack-s3-cache/generators/init",
|
||||
"type": "generator"
|
||||
}
|
||||
},
|
||||
"path": "/nx-api/powerpack-s3-cache"
|
||||
},
|
||||
"powerpack-shared-fs-cache": {
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "powerpack-shared-fs-cache",
|
||||
"packageName": "@nx/powerpack-shared-fs-cache",
|
||||
"description": "A Nx Powerpack plugin to enable you to use a shared file system directory",
|
||||
"documents": {
|
||||
"/nx-api/powerpack-shared-fs-cache/documents/overview": {
|
||||
"id": "overview",
|
||||
"name": "Overview",
|
||||
"description": "A Nx Powerpack plugin to enable you to use a shared file system directory",
|
||||
"file": "external-generated/packages/powerpack-shared-fs-cache/documents/overview",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/nx-api/powerpack-shared-fs-cache/documents/overview",
|
||||
"tags": [],
|
||||
"originalFilePath": "shared/packages/powerpack-shared-fs-cache/powerpack-shared-fs-cache-plugin"
|
||||
}
|
||||
},
|
||||
"root": "/libs/nx-packages/powerpack-shared-fs-cache",
|
||||
"source": "/libs/nx-packages/powerpack-shared-fs-cache/src",
|
||||
"executors": {},
|
||||
"generators": {
|
||||
"/nx-api/powerpack-shared-fs-cache/generators/init": {
|
||||
"description": "Add the shared fs cache",
|
||||
"file": "external-generated/packages/powerpack-shared-fs-cache/generators/init.json",
|
||||
"hidden": false,
|
||||
"name": "init",
|
||||
"originalFilePath": "/libs/nx-packages/powerpack-shared-fs-cache/src/generators/init/schema.json",
|
||||
"path": "/nx-api/powerpack-shared-fs-cache/generators/init",
|
||||
"type": "generator"
|
||||
}
|
||||
},
|
||||
"path": "/nx-api/powerpack-shared-fs-cache"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,6 +438,51 @@
|
||||
"path": "/features/manage-releases",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
{
|
||||
"id": "powerpack",
|
||||
"name": "Powerpack Features",
|
||||
"description": "Nx Powerpack is a suite of paid extensions for the Nx CLI specifically designed for enterprises.",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/index",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "conformance",
|
||||
"name": "Run Language-Agnostic Conformance Rules",
|
||||
"description": "Write and apply rules for your Nx workspace",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/conformance",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack/conformance",
|
||||
"tags": ["conformance"]
|
||||
},
|
||||
{
|
||||
"id": "owners",
|
||||
"name": "Define Code Ownership at the Project Level",
|
||||
"description": "Configure and maintain code owners for projects in an Nx workspace",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/owners",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack/owners",
|
||||
"tags": ["owners"]
|
||||
},
|
||||
{
|
||||
"id": "custom-caching",
|
||||
"name": "Self-Host the Remote Cache",
|
||||
"description": "Host the remote cache without using Nx Cloud",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/custom-caching",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack/custom-caching",
|
||||
"tags": ["custom-caching"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "ci-features",
|
||||
"name": "CI Features",
|
||||
@@ -598,6 +643,84 @@
|
||||
"path": "/features/manage-releases",
|
||||
"tags": ["nx-release"]
|
||||
},
|
||||
"/features/powerpack": {
|
||||
"id": "powerpack",
|
||||
"name": "Powerpack Features",
|
||||
"description": "Nx Powerpack is a suite of paid extensions for the Nx CLI specifically designed for enterprises.",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/index",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "conformance",
|
||||
"name": "Run Language-Agnostic Conformance Rules",
|
||||
"description": "Write and apply rules for your Nx workspace",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/conformance",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack/conformance",
|
||||
"tags": ["conformance"]
|
||||
},
|
||||
{
|
||||
"id": "owners",
|
||||
"name": "Define Code Ownership at the Project Level",
|
||||
"description": "Configure and maintain code owners for projects in an Nx workspace",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/owners",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack/owners",
|
||||
"tags": ["owners"]
|
||||
},
|
||||
{
|
||||
"id": "custom-caching",
|
||||
"name": "Self-Host the Remote Cache",
|
||||
"description": "Host the remote cache without using Nx Cloud",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/custom-caching",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack/custom-caching",
|
||||
"tags": ["custom-caching"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack",
|
||||
"tags": []
|
||||
},
|
||||
"/features/powerpack/conformance": {
|
||||
"id": "conformance",
|
||||
"name": "Run Language-Agnostic Conformance Rules",
|
||||
"description": "Write and apply rules for your Nx workspace",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/conformance",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack/conformance",
|
||||
"tags": ["conformance"]
|
||||
},
|
||||
"/features/powerpack/owners": {
|
||||
"id": "owners",
|
||||
"name": "Define Code Ownership at the Project Level",
|
||||
"description": "Configure and maintain code owners for projects in an Nx workspace",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/owners",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack/owners",
|
||||
"tags": ["owners"]
|
||||
},
|
||||
"/features/powerpack/custom-caching": {
|
||||
"id": "custom-caching",
|
||||
"name": "Self-Host the Remote Cache",
|
||||
"description": "Host the remote cache without using Nx Cloud",
|
||||
"mediaImage": "",
|
||||
"file": "shared/features/powerpack/custom-caching",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/features/powerpack/custom-caching",
|
||||
"tags": ["custom-caching"]
|
||||
},
|
||||
"/features/ci-features": {
|
||||
"id": "ci-features",
|
||||
"name": "CI Features",
|
||||
@@ -1476,6 +1599,17 @@
|
||||
"mediaImage": "",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "activate-powerpack",
|
||||
"name": "Activate Powerpack",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/installation/activate-powerpack",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/installation/activate-powerpack",
|
||||
"tags": ["installation"]
|
||||
},
|
||||
{
|
||||
"id": "install-non-javascript",
|
||||
"name": "Install Nx in a Non-Javascript Repo",
|
||||
@@ -2864,6 +2998,17 @@
|
||||
"mediaImage": "",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "activate-powerpack",
|
||||
"name": "Activate Powerpack",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/installation/activate-powerpack",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/installation/activate-powerpack",
|
||||
"tags": ["installation"]
|
||||
},
|
||||
{
|
||||
"id": "install-non-javascript",
|
||||
"name": "Install Nx in a Non-Javascript Repo",
|
||||
@@ -2891,6 +3036,17 @@
|
||||
"path": "/recipes/installation",
|
||||
"tags": []
|
||||
},
|
||||
"/recipes/installation/activate-powerpack": {
|
||||
"id": "activate-powerpack",
|
||||
"name": "Activate Powerpack",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/recipes/installation/activate-powerpack",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/installation/activate-powerpack",
|
||||
"tags": ["installation"]
|
||||
},
|
||||
"/recipes/installation/install-non-javascript": {
|
||||
"id": "install-non-javascript",
|
||||
"name": "Install Nx in a Non-Javascript Repo",
|
||||
@@ -6521,6 +6677,17 @@
|
||||
"path": "/deprecated/workspace-generators",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "custom-task-runners",
|
||||
"name": "Custom Task Runners",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/deprecated/custom-task-runners",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/deprecated/custom-task-runners",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "workspace-executors",
|
||||
"name": "Workspace Executors",
|
||||
@@ -6658,6 +6825,17 @@
|
||||
"path": "/deprecated/workspace-generators",
|
||||
"tags": []
|
||||
},
|
||||
"/deprecated/custom-task-runners": {
|
||||
"id": "custom-task-runners",
|
||||
"name": "Custom Task Runners",
|
||||
"description": "",
|
||||
"mediaImage": "",
|
||||
"file": "shared/deprecated/custom-task-runners",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/deprecated/custom-task-runners",
|
||||
"tags": []
|
||||
},
|
||||
"/deprecated/workspace-executors": {
|
||||
"id": "workspace-executors",
|
||||
"name": "Workspace Executors",
|
||||
|
||||
@@ -575,6 +575,33 @@
|
||||
"path": "/nx-api/nx/documents/release"
|
||||
}
|
||||
],
|
||||
"conformance": [
|
||||
{
|
||||
"description": "Write and apply rules for your Nx workspace",
|
||||
"file": "shared/features/powerpack/conformance",
|
||||
"id": "conformance",
|
||||
"name": "Run Language-Agnostic Conformance Rules",
|
||||
"path": "/features/powerpack/conformance"
|
||||
}
|
||||
],
|
||||
"owners": [
|
||||
{
|
||||
"description": "Configure and maintain code owners for projects in an Nx workspace",
|
||||
"file": "shared/features/powerpack/owners",
|
||||
"id": "owners",
|
||||
"name": "Define Code Ownership at the Project Level",
|
||||
"path": "/features/powerpack/owners"
|
||||
}
|
||||
],
|
||||
"custom-caching": [
|
||||
{
|
||||
"description": "Host the remote cache without using Nx Cloud",
|
||||
"file": "shared/features/powerpack/custom-caching",
|
||||
"id": "custom-caching",
|
||||
"name": "Self-Host the Remote Cache",
|
||||
"path": "/features/powerpack/custom-caching"
|
||||
}
|
||||
],
|
||||
"intro": [
|
||||
{
|
||||
"description": "",
|
||||
@@ -821,6 +848,13 @@
|
||||
}
|
||||
],
|
||||
"installation": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/installation/activate-powerpack",
|
||||
"id": "activate-powerpack",
|
||||
"name": "Activate Powerpack",
|
||||
"path": "/recipes/installation/activate-powerpack"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/installation/install-non-javascript",
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
"type": "boolean",
|
||||
"description": "Automatically update any invalid package versions",
|
||||
"default": false
|
||||
},
|
||||
"force": {
|
||||
"type": "boolean",
|
||||
"description": "Force the installation of a package, even if it is already installed",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"presets": []
|
||||
|
||||
@@ -85,29 +85,27 @@ Print the task graph to the console:
|
||||
|
||||
## Options
|
||||
|
||||
| Option | Type | Description |
|
||||
| ----------- | ------- | ----------------------------------------- |
|
||||
| ~~`--all`~~ | boolean | **Deprecated:** Use `nx run-many` instead |
|
||||
|
||||
|
|
||||
|
||||
| `--base` | string | Base of the current branch (usually main). |
|
||||
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
|
||||
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
|
||||
| `--exclude` | string | Exclude certain projects from being processed. |
|
||||
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
|
||||
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
|
||||
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
|
||||
| `--head` | string | Latest commit of the current branch (usually HEAD). |
|
||||
| `--help` | boolean | Show help. |
|
||||
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
|
||||
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
|
||||
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
|
||||
| `--parallel` | string | Max number of parallel processes [default is 3]. |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--targets` | string | Tasks to run for affected projects. |
|
||||
| `--uncommitted` | boolean | Uncommitted changes. |
|
||||
| `--untracked` | boolean | Untracked changes. |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
| Option | Type | Description |
|
||||
| --------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ~~`--all`~~ | boolean | **Deprecated:** Use `nx run-many` instead |
|
||||
| `--base` | string | Base of the current branch (usually main). |
|
||||
| `--batch` | boolean | Run task(s) in batches for executors which support batches. (Default: `false`) |
|
||||
| `--configuration` | string | This is the configuration to use when performing tasks on projects. |
|
||||
| `--exclude` | string | Exclude certain projects from being processed. |
|
||||
| `--excludeTaskDependencies` | boolean | Skips running dependent tasks first. (Default: `false`) |
|
||||
| `--files` | string | Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces. |
|
||||
| `--graph` | string | Show the task graph of the command. Pass a file path to save the graph data instead of viewing it in the browser. Pass "stdout" to print the results to the terminal. |
|
||||
| `--head` | string | Latest commit of the current branch (usually HEAD). |
|
||||
| `--help` | boolean | Show help. |
|
||||
| `--nxBail` | boolean | Stop command execution after the first failed task. (Default: `false`) |
|
||||
| `--nxIgnoreCycles` | boolean | Ignore cycles in the task graph. (Default: `false`) |
|
||||
| `--output-style` | `dynamic`, `static`, `stream`, `stream-without-prefixes` | Defines how Nx emits outputs tasks logs. **dynamic**: use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. **static**: uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. **stream**: nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr. **stream-without-prefixes**: nx prefixes the project name the target is running on, use this option remove the project name prefix from output. |
|
||||
| `--parallel` | string | Max number of parallel processes [default is 3]. |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--skipSync` | boolean | Skips running the sync generators associated with the tasks. (Default: `false`) |
|
||||
| `--targets` | string | Tasks to run for affected projects. |
|
||||
| `--uncommitted` | boolean | Uncommitted changes. |
|
||||
| `--untracked` | boolean | Untracked changes. |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
|
||||
@@ -128,6 +128,7 @@ nx release publish
|
||||
| `--registry` | string | The registry to publish to. |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--skipSync` | boolean | Skips running the sync generators associated with the tasks. (Default: `false`) |
|
||||
| `--tag` | string | The distribution tag to apply to the published package. |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
|
||||
@@ -107,6 +107,7 @@ Print the task graph to the console:
|
||||
| `--projects` | string | Projects to run. (comma/space delimited project names and/or patterns). |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--skipSync` | boolean | Skips running the sync generators associated with the tasks. (Default: `false`) |
|
||||
| `--targets` | string | Tasks to run for affected projects. |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
|
||||
@@ -81,5 +81,6 @@ Run's a target named build:test for the myapp project. Note the quotes around th
|
||||
| `--project` | string | Target project. |
|
||||
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
|
||||
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
|
||||
| `--skipSync` | boolean | Skips running the sync generators associated with the tasks. (Default: `false`) |
|
||||
| `--verbose` | boolean | Prints additional information about the commands (e.g., stack traces). |
|
||||
| `--version` | boolean | Show version number. |
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
"type": "boolean",
|
||||
"description": "Run tests with Playwright Inspector. Shortcut for 'PWDEBUG=1' environment variable and '--timeout=0',--max-failures=1 --headed --workers=1' options"
|
||||
},
|
||||
"lastFailed": {
|
||||
"type": "boolean",
|
||||
"description": "Run only the tests that failed in the last run"
|
||||
},
|
||||
"forbidOnly": {
|
||||
"type": "boolean",
|
||||
"description": "Fail if test.only is called"
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
"type": "string",
|
||||
"enum": ["vite", "webpack", "rspack"],
|
||||
"x-prompt": "Which bundler do you want to use to build the application?",
|
||||
"default": "webpack",
|
||||
"default": "vite",
|
||||
"x-priority": "important"
|
||||
},
|
||||
"minimal": {
|
||||
|
||||
@@ -131,6 +131,35 @@
|
||||
"tags": ["nx-release"],
|
||||
"file": "shared/features/manage-releases"
|
||||
},
|
||||
{
|
||||
"name": "Powerpack Features",
|
||||
"id": "powerpack",
|
||||
"description": "Nx Powerpack is a suite of paid extensions for the Nx CLI specifically designed for enterprises.",
|
||||
"file": "shared/features/powerpack/index",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Run Language-Agnostic Conformance Rules",
|
||||
"description": "Write and apply rules for your Nx workspace",
|
||||
"id": "conformance",
|
||||
"tags": ["conformance"],
|
||||
"file": "shared/features/powerpack/conformance"
|
||||
},
|
||||
{
|
||||
"name": "Define Code Ownership at the Project Level",
|
||||
"description": "Configure and maintain code owners for projects in an Nx workspace",
|
||||
"id": "owners",
|
||||
"tags": ["owners"],
|
||||
"file": "shared/features/powerpack/owners"
|
||||
},
|
||||
{
|
||||
"name": "Self-Host the Remote Cache",
|
||||
"description": "Host the remote cache without using Nx Cloud",
|
||||
"id": "custom-caching",
|
||||
"tags": ["custom-caching"],
|
||||
"file": "shared/features/powerpack/custom-caching"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CI Features",
|
||||
"id": "ci-features",
|
||||
@@ -354,6 +383,12 @@
|
||||
"id": "installation",
|
||||
"description": "Installing Nx",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Activate Powerpack",
|
||||
"id": "activate-powerpack",
|
||||
"tags": ["installation"],
|
||||
"file": "shared/recipes/installation/activate-powerpack"
|
||||
},
|
||||
{
|
||||
"name": "Install Nx in a Non-Javascript Repo",
|
||||
"id": "install-non-javascript",
|
||||
@@ -1364,6 +1399,11 @@
|
||||
"id": "workspace-generators",
|
||||
"file": "shared/deprecated/workspace-generators"
|
||||
},
|
||||
{
|
||||
"name": "Custom Task Runners",
|
||||
"id": "custom-task-runners",
|
||||
"file": "shared/deprecated/custom-task-runners"
|
||||
},
|
||||
{
|
||||
"name": "Workspace Executors",
|
||||
"id": "workspace-executors",
|
||||
@@ -2558,6 +2598,58 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "powerpack-owners",
|
||||
"id": "powerpack-owners",
|
||||
"description": "powerpack-owners package.",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Overview",
|
||||
"id": "overview",
|
||||
"path": "/nx-api/powerpack-owners",
|
||||
"file": "shared/packages/powerpack-owners/powerpack-owners-plugin"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "powerpack-conformance",
|
||||
"id": "powerpack-conformance",
|
||||
"description": "powerpack-conformance package.",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Overview",
|
||||
"id": "overview",
|
||||
"path": "/nx-api/powerpack-conformance",
|
||||
"file": "shared/packages/powerpack-conformance/powerpack-conformance-plugin"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "powerpack-s3-cache",
|
||||
"id": "powerpack-s3-cache",
|
||||
"description": "powerpack-s3-cache package.",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Overview",
|
||||
"id": "overview",
|
||||
"path": "/nx-api/powerpack-s3-cache",
|
||||
"file": "shared/packages/powerpack-s3-cache/powerpack-s3-cache-plugin"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "powerpack-shared-fs-cache",
|
||||
"id": "powerpack-shared-fs-cache",
|
||||
"description": "powerpack-shared-fs-cache package.",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Overview",
|
||||
"id": "overview",
|
||||
"path": "/nx-api/powerpack-shared-fs-cache",
|
||||
"file": "shared/packages/powerpack-shared-fs-cache/powerpack-shared-fs-cache-plugin"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gradle",
|
||||
"id": "gradle",
|
||||
|
||||
@@ -46,7 +46,7 @@ In order to guarantee that cache poisoning will never affect your end users, [sk
|
||||
|
||||
### Do Not Manually Share Your Local Cache
|
||||
|
||||
Nx implicitly trusts the local cache which is stored by default in the `.nx/cache` folder. You can change the location of that folder in the `nx.json` file, so it could be tempting to place it on a network drive and easily share your cache with everyone on the company network. However, by doing this you've voided the guarantee of immutability from your cache. If someone has direct access to the cached files, they could directly poison the cache. Nx will automatically detect if a cache entry has been created in your local cache using a different machine and warn you with an [Unknown Local Cache Error](/troubleshooting/unknown-local-cache). Instead, use Nx Cloud [remote caching](/ci/features/remote-cache).
|
||||
Nx implicitly trusts the local cache which is stored by default in the `.nx/cache` folder. You can change the location of that folder in the `nx.json` file, so it could be tempting to place it on a network drive and easily share your cache with everyone on the company network. However, by doing this you've voided the guarantee of immutability from your cache. If someone has direct access to the cached files, they could directly poison the cache. Nx will automatically detect if a cache entry has been created in your local cache using a different machine and warn you with an [Unknown Local Cache Error](/troubleshooting/unknown-local-cache). Instead, use Nx Cloud [remote caching](/ci/features/remote-cache). If you want share your local cache anyway, you can [activate Nx Powerpack](/recipes/installation/activate-powerpack) and use the [`@nx/powerpack-shared-fs-cache`](/nx-api/powerpack-shared-fs-cache) plugin.
|
||||
|
||||
### Configure End to End Encryption
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 123 KiB |
@@ -1,8 +1,8 @@
|
||||
# Nx CLI and CI Access Tokens
|
||||
|
||||
The permissions and membership define what developers can access on nx.app but they don't affect what happens when you run Nx commands in CI. To manage that, you need to provision CI access tokens in your workspace settings, under the `CI access tokens` tab.
|
||||
The permissions and membership define what developers can access on nx.app but they don't affect what happens when you run Nx commands in CI. To manage that, you need to provision CI access tokens in your workspace settings, under the `Access Control` tab.
|
||||
|
||||

|
||||

|
||||
|
||||
## Access Types
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 47 KiB |
@@ -80,14 +80,13 @@ You can configure your CI run by passing the following flags:
|
||||
|
||||
### --distribute-on
|
||||
|
||||
Tells Nx Cloud how many agents to use (and what launch templates to use) to distribute tasks. E.g.,
|
||||
By default, `npx nx-cloud start-ci-run` is intended for use with [Nx Agents](/ci/features/distribute-task-execution) and expects `--distribute-on` to be configured. It will output a warning if this flag is not set. If you are running a distributed execution with a legacy setup without Nx Agents, you can pass `--distribute-on=manual` to disable this warning.
|
||||
|
||||
This command tells Nx Cloud how many agents to use (and what launch templates to use) to distribute tasks. E.g.,
|
||||
`npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js"` will distribute CI using 8 agents that are initialized
|
||||
using the `linux-medium-js` launch template.
|
||||
|
||||
You can use different types of launch templates as follows:
|
||||
`npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js, 3 linux-large-js"`.
|
||||
|
||||
You can also define the configuration in a file and reference it as follows:
|
||||
You can also [define the configuration in a file](/ci/features/dynamic-agents) and reference it as follows:
|
||||
`npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"`.
|
||||
|
||||
```yaml {% fileName=".nx/workflows/dynamic-changesets.yaml" %}
|
||||
@@ -105,16 +104,12 @@ Nx Cloud side. You can disable this by passing `--require-explicit-completion`.
|
||||
|
||||
### --stop-agents-after
|
||||
|
||||
By default, Nx Cloud won't terminate any agents until you invoke `npx nx-cloud stop-all-agents` because Nx Cloud
|
||||
doesn't know if you will need agents to run another command. This can result in agents being idle at the end of a CI
|
||||
run.
|
||||
|
||||
You can fix it by telling Nx Cloud that it can terminate agents after it sees a certain
|
||||
You can tell Nx Cloud to terminate agents after it sees a certain
|
||||
target: `npx nx-cloud start-ci-run --stop-agents-after=e2e`.
|
||||
|
||||
The target name for `--stop-agents-after` should be the last target run within your pipeline. If not, Nx Cloud will end the CI pipeline execution, preventing the subsequent commands from running.
|
||||
|
||||
Incorrect example:
|
||||
#### Incorrect example:
|
||||
|
||||
```yaml
|
||||
- run: npx nx-cloud start-ci-run --stop-agents-after=build
|
||||
@@ -125,7 +120,7 @@ Incorrect example:
|
||||
|
||||
If build tasks are all cached, then all build tasks will complete immediately causing lint and test tasks to fail with an error saying the CI pipeline execution has already been completed. Instead you should re-order your targets to make sure the build target is last.
|
||||
|
||||
Corrected example:
|
||||
#### Corrected example:
|
||||
|
||||
```yaml
|
||||
- run: npx nx-cloud start-ci-run --stop-agents-after=build
|
||||
@@ -162,7 +157,7 @@ functionality of that machine. In case of unexpected issues on Nx Agents, try fa
|
||||
|
||||
Note: none of the values passed to Nx Agents are stored by Nx Cloud.
|
||||
|
||||
## Enabling/Disabling Distribution
|
||||
### Enabling/Disabling Distribution
|
||||
|
||||
Invoking `npx nx-cloud start-ci-run` will tell Nx to distribute by default. You can enable/disable distribution for
|
||||
individual commands as follows:
|
||||
|
||||
@@ -16,7 +16,7 @@ This behavior can be disabled by setting the [--require-explicit-completion](/ci
|
||||
|
||||
### A command was issued to stop all Nx Cloud agents
|
||||
|
||||
Nx Cloud provides two commands to forcibly stop agents, [stop-all-agents and complete-ci-run](/ci/reference/nx-cloud-cli#npx-nxcloud-stopallagents).
|
||||
Nx Cloud provides two commands to forcibly stop agents, [stop-all-agents and complete-ci-run](/ci/reference/nx-cloud-cli#npx-nxcloud-stopallagents). The two command options are functionally equivalent, but the `complete-ci-run` command is preferred.
|
||||
|
||||
Once these commands are invoked, the current CI Pipeline Execution is closed and can no longer receive new work.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ When you serve your host application via `nx serve host`, the Nx `module-federat
|
||||
|
||||
{% callout type="note" title="Using Module Federation with SSR?" %}
|
||||
The same technique outlined below also applies to the `module-federation-ssr-dev-server`.
|
||||
This is important to know when it comes to deploying your SSR Module Federation application as it indicates that you can place the build artifacts from the `remotes` onto something like an AWS S3 Bucket and your `host` will be able to find these files correctly.
|
||||
This is important to know when it comes to deploying your SSR Module Federation application as it indicates that you can place the build artifacts from the `remotes` onto something like an Amazon S3 Bucket and your `host` will be able to find these files correctly.
|
||||
{% /callout %}
|
||||
|
||||
The executor does the following:
|
||||
@@ -31,7 +31,7 @@ If you prefer diagrams, the one below outlines the above steps.
|
||||
|
||||
Previously, when using shared workspace libraries as part of your Module Federation application, there was a chance that the workspace library would be provided by one of the `static remotes`. This would cause issues where changes to those shared libraries would not be reflected in the locally served application.
|
||||
|
||||
To combat this issue, we developed the `NxRuntimeLibraryControlPlugin`. This is a [Runtime Plugin]() that will ensure that workspace libraries are only shared via any active `dev remote`. This means that any changes to the shared library will be picked up by `webpack-dev-server` and, as such, reflected in the locally served application.
|
||||
To combat this issue, we developed the `NxRuntimeLibraryControlPlugin`. This is a _Runtime Plugin_ that will ensure that workspace libraries are only shared via any active `dev remote`. This means that any changes to the shared library will be picked up by `webpack-dev-server` and, as such, reflected in the locally served application.
|
||||
|
||||
This plugin is enabled by default, however, you can turn it off in your `module-federation.config` file:
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# tasksRunnerOptions
|
||||
|
||||
As of Nx 20, the `tasksRunnerOptions` property in `nx.json` is deprecated. This property was used to register custom task runners. `tasksRunnerOptions` and custom task runners will cease to function in Nx 21. In Nx 20, the local cache metadata and project graph are stored in a database, rather than using the file system. (Cache artifacts are still stored on the file system.) This has two benefits:
|
||||
|
||||
1. Cache reads and writes are faster.
|
||||
2. The local cache is more secure since other processes with access to the file system can no longer read or modify the cache.
|
||||
|
||||
For most organizations, this feature is a net positive. If you are currently using a custom task runner, you are most likely using it to define your own custom [remote cache](/ci/features/remote-cache) storage location. You have several options moving forward:
|
||||
|
||||
1. Use [Nx Cloud](/nx-cloud) for your remote cache
|
||||
2. Use an [Nx Powerpack](/powerpack) plugin to store your remote cache on an [Amazon S3 bucket](/nx-api/powerpack-s3-cache) or a [network drive](/nx-api/powerpack-shared-fs-cache)
|
||||
3. Use the deprecated custom task runner feature until Nx 21
|
||||
@@ -0,0 +1,80 @@
|
||||
# Run Language-Agnostic Conformance Rules
|
||||
|
||||
{% youtube src="https://youtu.be/6wg23sLveTQ" title="Nx Powerpack workspace conformance" /%}
|
||||
|
||||
The [`@nx/powerpack-conformance`](/nx-api/powerpack-conformance) plugin allows [Nx Powerpack](/powerpack) users to write and apply rules for your entire workspace that help with **consistency**, **maintainability**, **reliability** and **security**. Powerpack is available for Nx version 19.8 and higher.
|
||||
|
||||
The conformance plugin allows you to **encode your own organization's standards** so that they can be enforced automatically. Conformance rules can also **complement linting tools** by enforcing that those tools are configured in the recommended way. The rules are written in TypeScript but can be **applied to any language in the codebase** or focus entirely on configuration files.
|
||||
|
||||
The plugin also provides the following pre-written rules:
|
||||
|
||||
- **Enforce Project Boundaries**: Similar to the Nx [ESLint Enforce Module Boundaries rule](/features/enforce-module-boundaries), but enforces the boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
|
||||
- **Ensure Owners**: Require every project to have an owner defined for the [`@nx/powerpack-owners` plugin](/nx-api/powerpack-owners)
|
||||
|
||||
## Setup
|
||||
|
||||
The `@nx/powerpack-conformance` plugin requires an Nx Powerpack license to function. [Activating Powerpack](/recipes/installation/activate-powerpack) is a simple process.
|
||||
|
||||
{% call-to-action title="Buy a Powerpack License" icon="nx" description="Unlock all the features of Nx" url="https://cloud.nx.app/powerpack/purchase" /%}
|
||||
|
||||
Then, add the Conformance plugin to your workspace.
|
||||
|
||||
{% link-card title="Conformance" type="Nx Plugin" url="/nx-api/powerpack-conformance" icon="CheckBadgeIcon" /%}
|
||||
|
||||
## Configure Conformance Rules
|
||||
|
||||
Conformance rules are configured in the `conformance` property of the `nx.json` file. You can use the pre-defined rules or reference [your own custom rule](/nx-api/powerpack-conformance#custom-conformance-rules). See the [plugin documentation](/nx-api/powerpack-conformance) for more details.
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
|
||||
"options": {
|
||||
"depConstraints": [
|
||||
{
|
||||
"sourceTag": "scope:shared",
|
||||
"onlyDependOnProjectsWithTags": ["scope:shared"]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"rule": "@nx/powerpack-conformance/ensure-owners",
|
||||
"projects": ["!experimental-app"]
|
||||
},
|
||||
{
|
||||
"rule": "./tools/local-conformance-rule.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Enforce Rules with the `nx conformance` Command
|
||||
|
||||
The `@nx/powerpack-conformance` plugin enables the `nx conformance` command which checks all the configured rules. This command should be added to the beginning of your CI process so that the conformance rules are enforced for every PR.
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Without Nx Cloud" %}
|
||||
|
||||
```yaml
|
||||
- name: Enforce all conformance rules
|
||||
run: npx nx conformance
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Using Nx Cloud" %}
|
||||
|
||||
```yaml
|
||||
- name: Enforce all conformance rules
|
||||
run: npx nx-cloud record -- npx nx conformance
|
||||
```
|
||||
|
||||
Use `npx nx-cloud record --` to capture the logs for `nx conformance` in the Nx Cloud dashboard.
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
If there is not a valid Powerpack license in the workspace, the `nx conformance` command will fail without checking any rules.
|
||||
@@ -0,0 +1,33 @@
|
||||
# Self-Host the Remote Cache
|
||||
|
||||
{% youtube src="https://youtu.be/vRGAa5SuiTM" title="Nx Powerpack self-hosted cache storage" /%}
|
||||
|
||||
The recommended way to enable the [remote cache](/ci/features/remote-cache) is to use Nx Replay and have Nx Cloud share the task cache across your organization. For those organizations that are unable to use Nx Cloud, Nx offers official plugins that are enabled by [Nx Powerpack](/powerpack) to self-host the remote cache in a fast and secure manner. Powerpack is available for Nx version 19.8 and higher. The recommended ways to host the remote cache are, in order of preference:
|
||||
|
||||
1. [Nx Replay](/ci/features/remote-cache): Cache is hosted on Nx Cloud servers or on-premise with an [Nx Enterprise](/enterprise) contract
|
||||
2. [@nx/powerpack-s3-cache](/nx-api/powerpack-s3-cache): Cache is on a self-hosted Amazon S3 bucket
|
||||
3. [@nx/powerpack-shared-fs-cache](/nx-api/powerpack-shared-fs-cache): Cache is self-hosted on a shared file system location
|
||||
|
||||
The options range from fully opting in to Nx's management of the remote cache to fully managing the configuration and security of your own remote cache.
|
||||
|
||||
## Setup
|
||||
|
||||
The `@nx/powerpack-s3-cache` and `@nx/powerpack-shared-fs-cache` plugins require an Nx Powerpack license to function. [Activating Powerpack](/recipes/installation/activate-powerpack) is a simple process.
|
||||
|
||||
{% call-to-action title="Buy a Powerpack License" icon="nx" description="Unlock all the features of the Nx CLI" url="https://cloud.nx.app/powerpack/purchase" /%}
|
||||
|
||||
Then, choose the appropriate cache plugin for your situation.
|
||||
|
||||
{% cards cols="2" lgCols="2" mdCols="2" smCols="2" %}
|
||||
|
||||
{% link-card title="Amazon S3 Bucket Remote Cache" type="Nx Plugin" url="/nx-api/powerpack-s3-cache" icon="AwsIcon" /%}
|
||||
|
||||
{% link-card title="Shared Network Drive Remote Cache" type="Nx Plugin" url="/nx-api/powerpack-shared-fs-cache" icon="ServerIcon" /%}
|
||||
|
||||
{% /cards %}
|
||||
|
||||
## Switch to Nx Cloud
|
||||
|
||||
These custom remote cache storage solutions only provide the remote cache functionality of Nx Cloud. If you want to leverage [distributed task execution](/ci/features/distribute-task-execution), [re-running flaky tasks](/ci/features/flaky-tasks) or [automatically splitting tasks](/ci/features/split-e2e-tasks), you'll need to [connect to Nx Cloud](/ci/intro/connect-to-nx-cloud) and use Nx Cloud's remote cache solution instead.
|
||||
|
||||
{% call-to-action title="Connect to Nx Cloud" icon="nxcloud" description="Enable task distribution and Atomizer" url="/ci/intro/connect-to-nx-cloud" /%}
|
||||
@@ -0,0 +1,13 @@
|
||||
# Powerpack Features
|
||||
|
||||
Nx PowerPack is a suite of paid extensions for the Nx CLI specifically designed for enterprises. Powerpack is available for Nx version 19.8 and higher.
|
||||
|
||||
The following features are available after you [activate a Powerpack license](/recipes/installation/activate-powerpack):
|
||||
|
||||
{% cards cols="2" lgCols="3" mdCols="3" smCols="2" %}
|
||||
|
||||
{% link-card title="Conformance" type="Powerpack Feature" url="/features/powerpack/conformance" icon="CheckBadgeIcon" /%}
|
||||
{% link-card title="Owners" type="Powerpack Feature" url="/features/powerpack/owners" icon="UserGroupIcon" /%}
|
||||
{% link-card title="Self-Hosted Remote Cache" type="Powerpack Feature" url="/features/powerpack/custom-caching" icon="AwsIcon" /%}
|
||||
|
||||
{% /cards %}
|
||||
@@ -0,0 +1,89 @@
|
||||
# Define Code Ownership at the Project Level
|
||||
|
||||
{% youtube src="https://youtu.be/mor6urvw-L0" title="Nx Powerpack Codeowners" /%}
|
||||
|
||||
This plugin provides [Nx Powerpack](/powerpack) users the ability to configure and maintain code owners for projects in an Nx workspace. Powerpack is available for Nx version 19.8 and higher.
|
||||
|
||||
The atomic unit of code in an Nx workspace is a project. Tasks, module boundaries and the Nx graph all train us to conceptualize the workspace as a collection of projects. The CODEOWNERS file, however, requires you to switch from a project mental model to a more low-level definition based on the folder structure of your workspace. The `@nx/powerpack-owners` plugin enables you to stay in the mental model that your workspace is a collection of projects as you define the ownership rules for your workspace. Nx will take care of compiling the project ownership rules into file-based ownership rules that [GitHub](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners), [Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-use-code-owners/) or [GitLab](https://docs.gitlab.com/ee/user/project/codeowners/) can understand in the CODEOWNERS file.
|
||||
|
||||
## Setup
|
||||
|
||||
The `@nx/powerpack-owners` plugin requires an Nx Powerpack license to function. [Activating Powerpack](/recipes/installation/activate-powerpack) is a simple process.
|
||||
|
||||
{% call-to-action title="Buy a Powerpack License" icon="nx" description="Unlock all the features of Nx" url="https://cloud.nx.app/powerpack/purchase" /%}
|
||||
|
||||
Then, add the Owners plugin to your workspace.
|
||||
|
||||
{% link-card title="Owners" type="Nx Plugin" url="/nx-api/powerpack-owners" icon="UserGroupIcon" /%}
|
||||
|
||||
## Project or File-based Configuration
|
||||
|
||||
The ownership configuration is defined in the `nx.json` file or in individual project configuration files. Nx then uses a [sync generator](/concepts/sync-generators) to automatically compile those settings into a valid CODEOWNERS file for GitHub, Bitbucket or GitLab. See the [plugin documentation](/nx-api/powerpack-owners) for more details.
|
||||
|
||||
{% cards smCols="2" mdCols="2" lgCols="2" %}
|
||||
|
||||
**Define Project Owners**
|
||||
|
||||
**Nx Generates the CODEOWNERS file**
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"format": "github",
|
||||
"patterns": [
|
||||
{
|
||||
"description": "Joe's Rust projects",
|
||||
"projects": ["tag:rust"],
|
||||
"owners": ["@joelovesrust"]
|
||||
},
|
||||
{
|
||||
"description": "Finance projects",
|
||||
"projects": ["finance-*"],
|
||||
"owners": ["@finance-team"]
|
||||
},
|
||||
{
|
||||
"description": "Alphabet soup",
|
||||
"projects": ["admin", "books", "cart"],
|
||||
"owners": ["@alice", "@bob", "@cecil"]
|
||||
},
|
||||
{
|
||||
"description": "CI Workflows",
|
||||
"files": [".github/workflows/**/*"],
|
||||
"owners": ["@devops"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```yaml {% fileName=".github/CODEOWNERS" %}
|
||||
# Joe's Rust projects
|
||||
/packages/rust-api @joelovesrust
|
||||
/packages/experimental-rust @joelovesrust
|
||||
|
||||
# Finance projects
|
||||
/packages/finance-ui @finance-team
|
||||
/packages/finance-data @finance-team
|
||||
|
||||
# Alphabet soup
|
||||
/packages/admin @alice @bob @cecil
|
||||
/packages/books @alice @bob @cecil
|
||||
/packages/cart @alice @bob @cecil
|
||||
|
||||
# CI Workflows
|
||||
.github/workflows/**/* @devops
|
||||
|
||||
/packages/my-project/ @ahmed @petra
|
||||
/packages/my-project/package.json @ahmed
|
||||
```
|
||||
|
||||
```json {% fileName="packages/my-project/project.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"**/*": ["@ahmed", "@petra"],
|
||||
"package.json": ["@ahmed"]
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
{% /cards %}
|
||||
@@ -1,6 +1,6 @@
|
||||
# Unknown Local Cache Error
|
||||
|
||||
This document will explain why the following error happens and how to address it.
|
||||
This document will explain why the following errors happen and how to address them.
|
||||
|
||||
```
|
||||
NX Invalid Cache Directory for Task "myapp:build"
|
||||
@@ -11,6 +11,14 @@ If your machine ID has changed since the artifact was cached, run "nx reset" to
|
||||
Read about the error and how to address it here: https://nx.dev/troubleshooting/unknown-local-cache
|
||||
```
|
||||
|
||||
```
|
||||
NX Unrecognized Cache Artifacts
|
||||
|
||||
Nx found unrecognized artifacts in the cache directory and will not be able to use them.
|
||||
Nx can only restore artifacts it has metadata about.
|
||||
Read about this warning and how to address it here: https://nx.dev/troubleshooting/unknown-local-cache
|
||||
```
|
||||
|
||||
## Nx Tracks Cache Source
|
||||
|
||||
Nx can cache tasks, which can drastically speed up your CI and local builds. However, this comes with the potential risk
|
||||
@@ -19,24 +27,24 @@ executes a task that matches the hash of the tainted artifact, they could retrie
|
||||
the outcome of the task. Nx and Nx Cloud contain several safeguards to minimize the likelihood of cache poisoning or, in
|
||||
the case of Nx Cloud, completely prevent it.
|
||||
|
||||
The error above is one such safeguard.
|
||||
The errors above are some of these safeguards.
|
||||
|
||||
Nx trusts the local cache. If you executed a task and stored the corresponding cached artifact on your machine, you can
|
||||
safely restore it on the same machine without worrying about cache poisoning. After all, in order to tamper with the
|
||||
cache artifact, the actor would need access to the machine itself.
|
||||
|
||||
However, when artifacts in the local cache are created by a different machine, we cannot make such assumption. By
|
||||
default, Nx will refuse to use such artifacts and will throw the "Invalid Cache Directory" error.
|
||||
default, Nx will refuse to use such artifacts and will throw the "Invalid Cache Directory" error or "Unrecognized Cache Artifacts" error.
|
||||
|
||||
## Your MachineId Has Changed
|
||||
|
||||
Upgrading your computer's hardware may alter its Machine ID, yielding the error above. To fix it execute `nx reset` to
|
||||
Upgrading your computer's hardware may alter its Machine ID, yielding one of the errors above. To fix it execute `nx reset` to
|
||||
remove all the cache directories created under the previous Machine ID. After doing so, you should no longer see the
|
||||
error.
|
||||
|
||||
## You Share Cache with Another Machine Using a Network Drive
|
||||
|
||||
You can prefix any Nx command with `NX_REJECT_UNKNOWN_LOCAL_CACHE=0` to ignore the error (
|
||||
You can prefix any Nx command with `NX_REJECT_UNKNOWN_LOCAL_CACHE=0` to ignore the errors (
|
||||
e.g., `NX_REJECT_UNKNOWN_LOCAL_CACHE=0 nx run-many -t build test`). This is similar to
|
||||
setting `NODE_TLS_REJECT_UNAUTHORIZED=0` to ignore any errors stemming form self-signed certificates. Even though it
|
||||
will make it work, this approach is discouraged.
|
||||
@@ -46,25 +54,9 @@ access to all the previously created Nx cache artifacts. Hence, it is plausible
|
||||
single task hash - to be accessed without leaving any trace. This is feasible due to the network drive's capability to
|
||||
allow overwrites.
|
||||
|
||||
Instead of sharing the network drive, we highly recommend you to implement the `RemoteCache` interface.
|
||||
## How Nx Replay Makes Sure Sharing Cache is Safe
|
||||
|
||||
## Implementing Remote Cache Interface
|
||||
|
||||
This is the interface:
|
||||
|
||||
```typescript
|
||||
interface RemoteCache {
|
||||
retrieve(hash: string, cachePath: string);
|
||||
|
||||
store(hash: string, cachePath: string);
|
||||
}
|
||||
```
|
||||
|
||||
> You will need to wrap the default tasks runner to provide the remote cache implementation.
|
||||
|
||||
## How Nx Cloud Makes Sure Sharing Cache is Safe
|
||||
|
||||
The Nx Cloud runner provides an implementation of `RemoteCache` which does the following things making sharing the cache safe:
|
||||
[Nx Replay](/ci/features/remote-cache), the Nx Cloud hosted remote cache, does the following things to make sharing the cache safe:
|
||||
|
||||
1. **Immutable Artifacts:** Nx Cloud allows you to create and store new artifacts without the ability to override the
|
||||
existing ones. This prevents any possibility of poisoning an existing artifact. This is achieved by managing the
|
||||
@@ -81,6 +73,13 @@ The Nx Cloud runner provides an implementation of `RemoteCache` which does the f
|
||||
an access token gets compromised it can be easily removed, in turn deleting all the cache artifacts that were created
|
||||
using it.
|
||||
|
||||
Nx Cloud is not the only remote cache you can use. If you are using a different remote cache or using your
|
||||
own implementation, we would highly recommend ensuring that the same safety mechanisms as Nx Cloud have been put in
|
||||
place.
|
||||
Nx Replay is not the only remote cache you can use. You can also use one of the [Powerpack self-hosted remote cache plugins](/features/powerpack/custom-caching). These plugins offer the performance benefits of a remote cache, but do not have the same security guarantees as Nx Replay.
|
||||
|
||||
## Self-Hosted Remote Cache
|
||||
|
||||
If you can't use Nx Replay, Nx provides plugins that enable you to [self-host the remote cache](/features/powerpack/custom-caching). These plugins are available as part of the [Nx Powerpack](/powerpack), which you can unlock by [activating your license](/recipes/installation/activate-powerpack). There are plugins to self-host your remote cache in the following locations:
|
||||
|
||||
- [Amazon S3 Bucket](/nx-api/powerpack-s3-cache)
|
||||
- [Shared File System](/nx-api/powerpack-shared-fs-cache)
|
||||
|
||||
These plugins will ensure that the task metadata and project graph information are correctly associated with the file artifacts in your cache.
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
---
|
||||
title: Overview of the Nx powerpack-conformance Plugin
|
||||
description: The Nx Powerpack Conformance plugin provides the ability to write and apply rules for your workspace
|
||||
---
|
||||
|
||||
The `@nx/powerpack-conformance` plugin allows [Nx Powerpack](/powerpack) users to write and apply rules for your entire workspace that help with **consistency**, **maintainability**, **reliability** and **security**.
|
||||
|
||||
The conformance plugin allows you to encode your own organization's standards so that they can be enforced automatically. Conformance rules can also complement linting tools by enforcing that those tools are configured in the recommended way. The rules are written in TypeScript but can be applied to any language in the codebase or focus entirely on configuration files.
|
||||
|
||||
The plugin also provides the following pre-written rules:
|
||||
|
||||
- [**Enforce Project Boundaries**](#enforce-project-boundaries): Similar to the Nx [ESLint Enforce Module Boundaries rule](/features/enforce-module-boundaries), but enforces the boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
|
||||
- [**Ensure Owners**](#ensure-owners): Require every project to have an owner defined for the [`@nx/powerpack-owners` plugin](/nx-api/powerpack-owners)
|
||||
|
||||
{% callout title="This plugin requires an active Nx Powerpack license" %}
|
||||
In order to use `@nx/powerpack-conformance`, you need to have an active Powerpack license. If you don't have a license or it has expired, the `nx conformance` command will fail.
|
||||
{% /callout %}
|
||||
|
||||
## Set Up @nx/powerpack-conformance
|
||||
|
||||
1. [Activate Powerpack](/recipes/installation/activate-powerpack) if you haven't already
|
||||
2. Install the package
|
||||
|
||||
```shell
|
||||
nx add @nx/powerpack-conformance
|
||||
```
|
||||
|
||||
3. Configure Conformance Rules
|
||||
|
||||
Configure the `@nx/powerpack-conformance` plugin in the `nx.json` file or in individual project configuration files. Consult the [Conformance Configuration Reference](#conformance-configuration-reference) section for more details.
|
||||
|
||||
4. Run the `nx conformance` command in CI
|
||||
|
||||
Add `nx conformance` to the beginning of the CI process.
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Without Nx Cloud" %}
|
||||
|
||||
```yaml
|
||||
- name: Enforce all conformance rules
|
||||
run: npx nx conformance
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Using Nx Cloud" %}
|
||||
|
||||
```yaml
|
||||
- name: Enforce all conformance rules
|
||||
run: npx nx-cloud record -- npx nx conformance
|
||||
```
|
||||
|
||||
Use `npx nx-cloud record --` to capture the logs for `nx conformance` in the Nx Cloud dashboard.
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
## Conformance Configuration Reference
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
/**
|
||||
* Relative path to a local rule implementation or node_module path.
|
||||
*/
|
||||
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
|
||||
/**
|
||||
* Rule specific configuration options. (Optional)
|
||||
*/
|
||||
"options": {},
|
||||
/**
|
||||
* The projects array allows users to opt in or out of violations for specific projects being reported by the current rule.
|
||||
* The array can contain any valid matchers for findMatchingProjects(), by default the implied value is ["*"]. (Optional)
|
||||
*/
|
||||
"projects": ["*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Provided Conformance Rules
|
||||
|
||||
The following rules are provided by Nx along with the `@nx/powerpack-conformance` plugin.
|
||||
|
||||
### Enforce Project Boundaries
|
||||
|
||||
This rule is similar to the Nx [ESLint Enforce Module Boundaries rule](/features/enforce-module-boundaries), but enforces the boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
|
||||
|
||||
Set the `rule` property to: `@nx/powerpack-conformance/enforce-project-boundaries`
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
|
||||
"options": {
|
||||
// Optional
|
||||
// Can be a boolean or an object with an array of buildTargetNames
|
||||
"requireBuildableDependenciesForBuildableProjects": {
|
||||
// Defaults to ["build"]
|
||||
"buildTargetNames": ["build", "compile"]
|
||||
},
|
||||
// Optional
|
||||
"ignoredCircularDependencies": [["projectA", "projectB"]],
|
||||
// Optional
|
||||
"depConstraints": [
|
||||
{
|
||||
// Must define either `sourceTag` or `allSourceTags`
|
||||
"sourceTag": "string",
|
||||
"allSourceTags": ["string"],
|
||||
// Optional
|
||||
"onlyDependOnProjectsWithTags": [],
|
||||
// Optional
|
||||
"notDependOnProjectsWithTags": []
|
||||
}
|
||||
],
|
||||
// Optional
|
||||
"checkDynamicDependenciesExceptions": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Options
|
||||
|
||||
| Property | Type | Default | Description |
|
||||
| ------------------------------------------------ | ------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ignoredCircularDependencies | _Array<[string, string]>_ | _[]_ | List of project pairs that should be skipped from `Circular dependencies` checks, including the self-circular dependency check. E.g. `['feature-project-a', 'myapp']`. Project name can be replaced by catch all `*` for more generic matches. |
|
||||
| checkDynamicDependenciesExceptions | _Array<string>_ | _[]_ | List of imports that should be skipped for `Imports of lazy-loaded libraries forbidden` checks. E.g. `['@myorg/lazy-project/component/*', '@myorg/other-project']` |
|
||||
| requireBuildableDependenciesForBuildableProjects | _boolean_ | _false_ | Enable to restrict the buildable projects from importing non-buildable libraries |
|
||||
| depConstraints | _Array<object>_ | _[]_ | List of dependency constraints between projects |
|
||||
|
||||
#### Dependency constraints
|
||||
|
||||
The `depConstraints` is an array of objects representing the constraints defined between source and target projects. A
|
||||
constraint must include `sourceTag` or `allSourceTags`. The constraints are applied with **AND** logical operation - for
|
||||
a given `source` project the resulting constraints would be **all** that match its tags.
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|
||||
| sourceTag | _string_ | Tag that source project must contain to match the constraint |
|
||||
| allSourceTags | _Array<string>_ | List of tags the source project must contain to match the constraint |
|
||||
| onlyDependOnProjectsWithTags | _Array<string>_ | The source **can depend only** on projects that contain at least one of these tags |
|
||||
| notDependOnProjectsWithTags | _Array<string>_ | The source **can not depend** on projects that contain at least one of these tags |
|
||||
|
||||
### Ensure Owners
|
||||
|
||||
This rule requires every project to have an owner defined for the [`@nx/powerpack-owners` plugin](/nx-api/powerpack-owners)
|
||||
|
||||
Set the `rule` property to: `@nx/powerpack-conformance/ensure-owners`
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
"rule": "@nx/powerpack-conformance/ensure-owners"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Custom Conformance Rules
|
||||
|
||||
To write your own conformance rule, specify a relative path to a TypeScript or JavaScript file as the rule name:
|
||||
|
||||
```json {% fileName="nx.json" %}
|
||||
{
|
||||
"conformance": {
|
||||
"rules": [
|
||||
{
|
||||
"rule": "./tools/local-conformance-rule.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The rule definition file should look like this:
|
||||
|
||||
```ts {% fileName="tools/local-conformance-rule.ts" %}
|
||||
import { createConformanceRule } from '@nx/powerpack-conformance';
|
||||
|
||||
const rule = createConformanceRule({
|
||||
name: 'local-conformance-rule-example',
|
||||
category: 'security', // `consistency`, `maintainability`, `reliability` or `security`
|
||||
reporter: 'project-reporter', // `project-reporter` or `project-files-reporter`
|
||||
implementation: async (context) => {
|
||||
const { projectGraph, ruleOptions } = context;
|
||||
// Your rule logic goes here
|
||||
return {
|
||||
severity: 'low', // 'high', 'medium' or 'low'
|
||||
details: {
|
||||
violations: [
|
||||
// Return an empty array if the rule passes
|
||||
{
|
||||
sourceProject: 'my-project',
|
||||
message: 'This is an informative error message.',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export default rule;
|
||||
```
|
||||
|
||||
Note that the severity of the error is defined by the rule author and can be adjusted based on the specific violations that are found.
|
||||
@@ -0,0 +1,326 @@
|
||||
---
|
||||
title: Overview of the Nx powerpack-owners Plugin
|
||||
description: The Nx Powerpack Owners plugin provides the ability to define code ownership based on projects in addition to files
|
||||
---
|
||||
|
||||
The `@nx/powerpack-owners` plugin extends the CODEOWNERS functionality to allow you to define code ownership based on projects in addition to the standard file-based definitions. It leverages the [`nx sync`](/concepts/sync-generators) command to compile `owners` configuration settings from `nx.json` and project configuration files into valid CODEOWNERS files for [GitHub](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners), [Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-use-code-owners/) or [GitLab](https://docs.gitlab.com/ee/user/project/codeowners/).
|
||||
|
||||
With this plugin, you can specify code ownership using the same project matcher syntax as [`nx run-many`](/nx-api/nx/documents/run-many#examples). This allows you to easily define rules for multiple projects that may not be located in the same directory. Also, the CODEOWNERS rules will not need to be revisited if a project location is changed or a new project is added.
|
||||
|
||||
{% callout title="This plugin requires an active Nx Powerpack license" %}
|
||||
In order to use `@nx/powerpack-owners`, you need to have an active Powerpack license. If you don't have a license or it has expired, the syncing process will stop working and you'll need to manually maintain your CODEOWNERS file.
|
||||
{% /callout %}
|
||||
|
||||
## Set Up @nx/powerpack-owners
|
||||
|
||||
1. [Activate Powerpack](/recipes/installation/activate-powerpack) if you haven't already
|
||||
2. Install the package
|
||||
|
||||
```shell
|
||||
nx add @nx/powerpack-owners
|
||||
```
|
||||
|
||||
3. Configure Ownership
|
||||
|
||||
Configure the `@nx/powerpack-owners` plugin in the `nx.json` file or in individual project configuration files. Consult the [Owners Configuration Reference](#owners-configuration-reference) section for more details.
|
||||
|
||||
4. Configure the [Sync Generator](/concepts/sync-generators) and CI
|
||||
|
||||
The `nx add @nx/powerpack-owners` command should have registered the `@nx/powerpack-owners:sync-codeowners-file` generator as a `globalGenerator` in `nx.json`. You can double check to make sure:
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"sync": {
|
||||
"globalGenerators": ["@nx/powerpack-owners:sync-codeowners-file"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Add `nx sync:check` to the beginning of the CI process.
|
||||
|
||||
```yaml
|
||||
- name: Ensure the workspace configuration is in sync
|
||||
run: npx nx sync:check
|
||||
```
|
||||
|
||||
It is also often helpful to add `nx sync` as a git push hook or git commit hook.
|
||||
|
||||
## Owners Configuration Reference
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="GitHub" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
// Can be set to true instead of an object to accept all defaults
|
||||
"owners": {
|
||||
// Options are `github`, `bitbucket` or `gitlab`. (Optional) Defaults to `github`
|
||||
"format": "github",
|
||||
// (Optional) Default changes based on format: `.github/CODEOWNERS`, `.bitbucket/CODEOWNERS`, `.gitlab/CODEOWNERS`
|
||||
"outputPath": "CODEOWNERS",
|
||||
// (Optional)
|
||||
"patterns": [
|
||||
{
|
||||
"description": "A description of the rule",
|
||||
"owners": ["@joelovesrust"],
|
||||
// specify either projects or files, not both
|
||||
// Can be any project specifier that could be used in `nx run-many`
|
||||
// See https://nx.dev/nx-api/nx/documents/run-many
|
||||
"projects": ["my-rust-app", "rust-*", "tag:rust"],
|
||||
// File globs
|
||||
"files": [".github/workflows/**/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Bitbucket" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
// Can be set to true instead of an object to accept all defaults
|
||||
"owners": {
|
||||
// Options are `github`, `bitbucket` or `gitlab`. (Optional) Defaults to `github`
|
||||
"format": "bitbucket",
|
||||
// (Optional) Default changes based on format: `.github/CODEOWNERS`, `.bitbucket/CODEOWNERS`, `.gitlab/CODEOWNERS`
|
||||
"outputPath": "CODEOWNERS",
|
||||
// (Optional)
|
||||
"patterns": [
|
||||
{
|
||||
"description": "A description of the rule",
|
||||
"owners": ["@joelovesrust"],
|
||||
// specify either projects or files, not both
|
||||
// Can be any project specifier that could be used in `nx run-many`
|
||||
// See https://nx.dev/nx-api/nx/documents/run-many
|
||||
"projects": ["my-rust-app", "rust-*", "tag:rust"],
|
||||
// File globs
|
||||
"files": [".github/workflows/**/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="GitLab" %}
|
||||
|
||||
If you are using GitLab, you can specify CODEOWNERS [sections](https://docs.gitlab.com/ee/user/project/codeowners/#organize-code-owners-by-putting-them-into-sections) which give you a little more control over the PR process.
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
// Can be set to true instead of an object to accept all defaults
|
||||
"owners": {
|
||||
// Options are `github`, `bitbucket` or `gitlab`. (Optional) Defaults to `github`
|
||||
"format": "gitlab",
|
||||
// (Optional) Default changes based on format: `.github/CODEOWNERS`, `.bitbucket/CODEOWNERS`, `.gitlab/CODEOWNERS`
|
||||
"outputPath": "CODEOWNERS",
|
||||
// (Optional)
|
||||
"patterns": [
|
||||
{
|
||||
"description": "A description of the rule",
|
||||
"owners": ["@joelovesrust"],
|
||||
// Specify either `projects` or `files`, not both
|
||||
// Can be any project specifier that could be used in `nx run-many`
|
||||
// See https://nx.dev/nx-api/nx/documents/run-many
|
||||
"projects": ["my-rust-app", "rust-*", "tag:rust"],
|
||||
// File globs
|
||||
"files": [".github/workflows/**/*"]
|
||||
}
|
||||
],
|
||||
// (Optional)
|
||||
"sections": [
|
||||
{
|
||||
// Labels the section
|
||||
"name": "My section",
|
||||
// (Optional) The owners to use if a pattern does not specify a set of owners
|
||||
"defaultOwners": ["@cheddar"],
|
||||
// Specify either `numberOfRequiredApprovals` or `optional`, not both
|
||||
// (Optional) Require more than one person to approve the PR
|
||||
"numberOfRequiredApprovals": 2,
|
||||
// (Optional) Do not require any approvals, just notify the owners
|
||||
"optional": true,
|
||||
// Same format as the root patterns
|
||||
"patterns": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```jsonc {% fileName="path/to/project/project.json" %}
|
||||
{
|
||||
"owners": {
|
||||
// Keys are file globs relative to the root of the project
|
||||
// Owners can be listed as a string array
|
||||
"**/*": ["@ahmed", "@petra"],
|
||||
// Owners can be listed as an object with a description
|
||||
"README.md": {
|
||||
"description": "Jared is very particular about the README file",
|
||||
"owners": ["@jared"]
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
**Examples:**
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="GitHub" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"owners": {
|
||||
// defaults to "github"
|
||||
"format": "github",
|
||||
// defaults to ".github/CODEOWNERS"
|
||||
"outputPath": "CODEOWNERS",
|
||||
"patterns": [
|
||||
{
|
||||
"description": "Joe should double check all changes to rust code",
|
||||
"projects": ["tag:rust"],
|
||||
"owners": ["@joelovesrust"]
|
||||
},
|
||||
{
|
||||
"description": "The Finance team owns these projects",
|
||||
"projects": ["finance-*"],
|
||||
"owners": ["@finance-team"]
|
||||
},
|
||||
{
|
||||
"description": "Alice, Bob and Cecil work together on these projects",
|
||||
"projects": ["admin", "booking", "cart"],
|
||||
"owners": ["@alice", "@bob", "@cecil"]
|
||||
},
|
||||
{
|
||||
"description": "CI Workflows",
|
||||
"files": [".github/workflows/**/*"],
|
||||
"owners": ["@devops"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```jsonc {% fileName="packages/my-project/project.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"**/*": ["@ahmed", "@petra"],
|
||||
"package.json": ["@ahmed"],
|
||||
"README.md": {
|
||||
"owners": ["@jared"],
|
||||
"description": "Jared is very particular about the README file"
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Bitbucket" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"format": "bitbucket",
|
||||
// defaults to ".bitbucket/CODEOWNERS"
|
||||
"outputPath": "CODEOWNERS",
|
||||
"patterns": [
|
||||
{
|
||||
"description": "Joe should double check all changes to rust code",
|
||||
"projects": ["tag:rust"],
|
||||
"owners": ["@joelovesrust"]
|
||||
},
|
||||
{
|
||||
"description": "The Finance team owns these projects",
|
||||
"projects": ["finance-*"],
|
||||
"owners": ["@finance-team"]
|
||||
},
|
||||
{
|
||||
"description": "Alice, Bob and Cecil work together on these projects",
|
||||
"projects": ["admin", "booking", "cart"],
|
||||
"owners": ["@alice", "@bob", "@cecil"]
|
||||
},
|
||||
{
|
||||
"description": "CI Workflows",
|
||||
"files": [".github/workflows/**/*"],
|
||||
"owners": ["@devops"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```jsonc {% fileName="packages/my-project/project.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"**/*": ["@ahmed", "@petra"],
|
||||
"package.json": ["@ahmed"],
|
||||
"README.md": {
|
||||
"owners": ["@jared"],
|
||||
"description": "Jared is very particular about the README file"
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="GitLab" %}
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"format": "gitlab",
|
||||
// defaults to ".gitlab/CODEOWNERS"
|
||||
"outputPath": "CODEOWNERS",
|
||||
"patterns": [
|
||||
{
|
||||
"description": "Joe should double check all changes to rust code",
|
||||
"projects": ["tag:rust"],
|
||||
"owners": ["@joelovesrust"]
|
||||
},
|
||||
{
|
||||
"description": "CI Workflows",
|
||||
"files": [".github/workflows/**/*"],
|
||||
"owners": ["@devops"]
|
||||
}
|
||||
],
|
||||
"sections": [
|
||||
{
|
||||
"name": "Finance",
|
||||
"defaultOwners": ["@finance-team"],
|
||||
"numberOfRequiredApprovals": 2,
|
||||
"patterns": [
|
||||
{
|
||||
"description": "The Finance team owns these projects",
|
||||
"projects": ["finance-*"]
|
||||
},
|
||||
{
|
||||
"description": "Alice, Bob and Cecil work together on these projects",
|
||||
"projects": ["admin", "booking", "cart"],
|
||||
"owners": ["@alice", "@bob", "@cecil"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```jsonc {% fileName="packages/my-project/project.json" %}
|
||||
{
|
||||
"owners": {
|
||||
"**/*": ["@ahmed", "@petra"],
|
||||
"package.json": ["@ahmed"],
|
||||
"README.md": {
|
||||
"owners": ["@jared"],
|
||||
"description": "Jared is very particular about the README file"
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
@@ -0,0 +1,98 @@
|
||||
---
|
||||
title: Overview of the Nx powerpack-s3-cache Plugin
|
||||
description: The powerpack-s3-cache Nx plugin enables you to use an Amazon S3 bucket to host your remote cache instead of Nx Cloud
|
||||
---
|
||||
|
||||
The `@nx/powerpack-s3-cache` plugin enables you to use an [Amazon S3](https://aws.amazon.com/s3) bucket instead of Nx Cloud to host your remote cache.
|
||||
|
||||
This plugin will enable the remote cache for your Nx workspace, but does not provide any of the other features of Nx Cloud. If you want to leverage [distributed task execution](/ci/features/distribute-task-execution), [re-running flaky tasks](/ci/features/flaky-tasks) or [automatically splitting tasks](/ci/features/split-e2e-tasks), you'll need to [connect to Nx Cloud](/ci/intro/connect-to-nx-cloud) and use [Nx Replay](/ci/features/remote-cache) instead.
|
||||
|
||||
{% callout type="warning" title="Potential Cache Poisoning" %}
|
||||
Using your own Amazon S3 bucket to host the remote cache opens you up to the possibility of [cache poisoning](/troubleshooting/unknown-local-cache). To avoid this, use [Nx Replay](/ci/features/remote-cache).
|
||||
{% /callout %}
|
||||
|
||||
{% callout title="This plugin requires an active Nx Powerpack license" %}
|
||||
In order to use `@nx/powerpack-s3-cache`, you need to have an active Powerpack license. If you don't have a license or it has expired, your cache will no longer be shared and each machine will use its local cache.
|
||||
{% /callout %}
|
||||
|
||||
## Set Up @nx/powerpack-s3-cache
|
||||
|
||||
### 1. Install the Package
|
||||
|
||||
1. [Activate Powerpack](/recipes/installation/activate-powerpack) if you haven't already
|
||||
2. Install the package
|
||||
|
||||
```shell
|
||||
nx add @nx/powerpack-s3-cache
|
||||
```
|
||||
|
||||
### 2. Authenticate with AWS
|
||||
|
||||
There are four different ways to authenticate with AWS. They will be attempted in this order:
|
||||
|
||||
1. Environment variables
|
||||
2. INI config files
|
||||
3. Single sign-on
|
||||
4. `nx.json` settings
|
||||
|
||||
#### Environment Variables
|
||||
|
||||
[AWS provides environment variables](https://docs.aws.amazon.com/sdkref/latest/guide/environment-variables.html) that can be used to authenticate:
|
||||
|
||||
| **Environment Variable** | **Description** |
|
||||
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `AWS_ACCESS_KEY_ID` | The access key for your AWS account. |
|
||||
| `AWS_SECRET_ACCESS_KEY` | The secret key for your AWS account. |
|
||||
| `AWS_SESSION_TOKEN` | The session key for your AWS account. This is only needed when you are using temporary credentials. |
|
||||
| `AWS_CREDENTIAL_EXPIRATION` | The expiration time of the credentials contained in the environment variables described above. This value must be in a format compatible with the [ISO-8601 standard](https://en.wikipedia.org/wiki/ISO_8601) and is only needed when you are using temporary credentials. |
|
||||
|
||||
Both the `AWS_ACCESS_KEY_ID` and the `AWS_SECRET_ACCESS_KEY` environment variables are required to use the environment variable authentication method.
|
||||
|
||||
#### INI Config Files
|
||||
|
||||
AWS can read your authentication credentials from [shared INI config files](https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html). The files are located at `~/.aws/credentials` and `~/.aws/config`. Both files are expected to be INI formatted with section names corresponding to profiles. Sections in the credentials file are treated as profile names, whereas profile sections in the config file must have the format of `[profile profile-name]`, except for the default profile. Profiles that appear in both files will not be merged, and the version that appears in the credentials file will be given precedence over the profile found in the config file.
|
||||
|
||||
#### Single Sign-On
|
||||
|
||||
Nx can read the active access token [created after running `aws sso login`](https://docs.aws.amazon.com/sdkref/latest/guide/understanding-sso.html) then request temporary AWS credentials. You can create the `AwsCredentialIdentityProvider` functions using the inline SSO parameters (`ssoStartUrl`, `ssoAccountId`, `ssoRegion`, `ssoRoleName`) or load them from [AWS SDKs and Tools shared configuration and credentials files](https://docs.aws.amazon.com/credref/latest/refdocs/creds-config-files.html). Profiles in the `credentials` file are given precedence over profiles in the `config` file.
|
||||
|
||||
#### Credentials in `nx.json` File
|
||||
|
||||
Storing your credentials in the `nx.json` file is the least secure of the 4 authentication options, since anyone with read access to your code base will have access to your AWS credentials.
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"s3": {
|
||||
"ssoProfile": "default",
|
||||
"accessKeyId": "MYACCESSKEYID",
|
||||
"secretAccessKey": "MYSECRETACCESSKEY"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| **Property** | **Description** |
|
||||
| ------------------- | ----------------------------------------------------------------------------- |
|
||||
| **ssoProfile** | The name of the profile to use from your AWS CLI SSO Configuration (optional) |
|
||||
| **endpoint** | The AWS endpoint URL (optional) |
|
||||
| **accessKeyId** | AWS Access Key ID (optional) |
|
||||
| **secretAccessKey** | AWS secret access key (optional) |
|
||||
|
||||
### 3. Configure S3 Cache
|
||||
|
||||
Regardless of how you manage your AWS authentication, you need to configure your Nx cache in the `nx.json` file. The `bucket` that you specify needs to already exist - Nx doesn't create it for you.
|
||||
|
||||
```jsonc {% fileName="nx.json" %}
|
||||
{
|
||||
"s3": {
|
||||
"region": "us-east-1",
|
||||
"bucket": "my-bucket",
|
||||
"encryptionKey": "create-your-own-key"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| **Property** | **Description** |
|
||||
| ----------------- | --------------------------------------------------------------------------------- |
|
||||
| **region** | The id of the AWS region to use |
|
||||
| **bucket** | The name of the AWS bucket to use |
|
||||
| **encryptionKey** | Nx encryption key used to encrypt and decrypt artifacts from the cache (optional) |
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: Overview of the Nx powerpack-shared-fs-cache Plugin
|
||||
description: The powerpack-shared-fs-cache Nx plugin enables you to use a shared file system directory instead of Nx Cloud to host your remote cache
|
||||
---
|
||||
|
||||
The `@nx/powerpack-shared-fs-cache` plugin enables you to use a shared file system directory instead of Nx Cloud to host your remote cache. You are responsible for the sharing mechanism for the directory, but the plugin ensures that Nx correctly associates task metadata with the file artifacts.
|
||||
|
||||
This plugin will enable the remote cache for your Nx workspace, but does not provide any of the other features of Nx Cloud. If you want to leverage [distributed task execution](/ci/features/distribute-task-execution), [re-running flaky tasks](/ci/features/flaky-tasks) or [automatically splitting tasks](/ci/features/split-e2e-tasks), you'll need to [connect to Nx Cloud](/ci/intro/connect-to-nx-cloud) and use [Nx Replay](/ci/features/remote-cache) instead.
|
||||
|
||||
{% callout type="warning" title="Potential Cache Poisoning" %}
|
||||
Using a shared file system folder for the remote cache opens you up to the possibility of [cache poisoning](/troubleshooting/unknown-local-cache). To avoid this, use [Nx Replay](/ci/features/remote-cache).
|
||||
{% /callout %}
|
||||
|
||||
{% callout title="This plugin requires an active Nx Powerpack license" %}
|
||||
In order to use `@nx/powerpack-shared-fs-cache`, you need to have an active Powerpack license. If you don't have a license or it has expired, your cache will no longer be shared and each machine will use its local cache.
|
||||
{% /callout %}
|
||||
|
||||
## Set Up @nx/powerpack-shared-fs-cache
|
||||
|
||||
### 1. Install the Package
|
||||
|
||||
1. [Activate Powerpack](/recipes/installation/activate-powerpack) if you haven't already
|
||||
2. Install the package
|
||||
|
||||
```shell
|
||||
nx add @nx/powerpack-shared-fs-cache
|
||||
```
|
||||
|
||||
### 2. Configure the Cache Directory
|
||||
|
||||
The `@nx/powerpack-shared-fs-cache` plugin treats your local cache directory as if it is also a remote cache directory. The local cache directory can be set using `cacheDirectory` in the `nx.json` file or the `NX_CACHE_DIRECTORY` environment variable. The default local cache directory is `.nx/cache`
|
||||
|
||||
### 3. Share the Cache Directory
|
||||
|
||||
The `@nx/powerpack-shared-fs-cache` plugin does not actually share the cache directory across your organization. You are responsible for enabling the actual sharing mechanism. If you want Nx to handle the sharing, use [Nx Replay](/ci/features/remote-cache) instead. Your shared file system directory might be a directory that is saved and restored by a CI provider or it could be a shared network drive.
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Nx Plugins can be used to easily integrate a tool or framework into an Nx repository. If there is no plugin available for your favorite tool or framework, you can write your own.
|
||||
|
||||
In this tutorial, we'll create a plugin that helps to integrate the [Astro]() framework. `Astro` is a JavaScript web framework optimized for building fast, content-driven websites. We'll call our plugin `nx-astro`.
|
||||
In this tutorial, we'll create a plugin that helps to integrate the _Astro_ framework. `Astro` is a JavaScript web framework optimized for building fast, content-driven websites. We'll call our plugin `nx-astro`.
|
||||
|
||||
To create a plugin in a brand new repository, use the `create-nx-plugin` command:
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# Activate Powerpack
|
||||
|
||||
Nx Powerpack unlocks features of Nx that are particularly useful for larger organizations. Powerpack is available for Nx version 19.8 and higher. The features include the ability to:
|
||||
|
||||
- [Run language-agnostic conformance rules](/features/powerpack/conformance)
|
||||
- [Define code ownership at the project level](/features/powerpack/owners)
|
||||
- [Change the remote cache storage location](/features/powerpack/custom-caching)
|
||||
|
||||
Activating Powerpack is a two step process.
|
||||
|
||||
## 1. Purchase a License
|
||||
|
||||
You'll need to [purchase a license](https://cloud.nx.app/powerpack/purchase) online. The license is a seat-based license. If you have an open-source repository, reach out to [powerpack-support@nrwl.io](mailto:powerpack-support@nrwl.io) for a free license.
|
||||
|
||||
{% call-to-action title="Buy a Powerpack License" icon="nx" description="Unlock all the features of Nx" url="https://cloud.nx.app/powerpack/purchase" /%}
|
||||
|
||||
Once you've completed the purchase, you will receive a license key.
|
||||
|
||||
## 2. Register the License Key
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Closed Source Repository" %}
|
||||
|
||||
To register the license key in your repository, run the `nx activate-powerpack` command.
|
||||
|
||||
```shell
|
||||
nx activate-powerpack YOUR_LICENSE_KEY
|
||||
```
|
||||
|
||||
The license will be saved in your repository and should be committed so that every developer has access to the Powerpack features.
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Open Source Repository" %}
|
||||
|
||||
Register the license key as an environment variable that is not committed to the repository.
|
||||
|
||||
```{% fileName=".env" %}
|
||||
NX_POWERPACK_LICENSE=YOUR_LICENSE_KEY
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
@@ -39,8 +39,8 @@ Once those criteria are met, you can submit your plugin by following the steps b
|
||||
- Fork the [Nx repo](https://github.com/nrwl/nx/fork) (if you haven't already)
|
||||
- Update the [`community/approved-plugins.json` file](https://github.com/nrwl/nx/blob/master/community/approved-plugins.json) with a new entry for your plugin that includes name, url and description
|
||||
- Use the following commit message template: `chore(core): nx plugin submission [PLUGIN_NAME]`
|
||||
- push your changes, and run `yarn submit-plugin`
|
||||
- push your changes, and run `pnpm submit-plugin`
|
||||
|
||||
> The `yarn submit-plugin` command automatically opens the GitHub pull request process with the correct template.
|
||||
> The `pnpm submit-plugin` command automatically opens the GitHub pull request process with the correct template.
|
||||
|
||||
We will then verify the plugin, offer suggestions or merge the pull request!
|
||||
|
||||
@@ -2,29 +2,8 @@
|
||||
|
||||
By default the cache is stored locally in `.nx/cache`. Cache results are stored for a week before they get deleted. You can customize the cache location in the `nx.json` file:
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Nx >= 17" %}
|
||||
|
||||
```json {% fileName="nx.json"%}
|
||||
{
|
||||
"cacheDirectory": "/tmp/mycache"
|
||||
}
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="Nx < 17" %}
|
||||
|
||||
```json {% fileName="nx.json"%}
|
||||
{
|
||||
"tasksRunnerOptions": {
|
||||
"default": {
|
||||
"options": {
|
||||
"cacheDirectory": "/tmp/mycache"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
@@ -36,12 +36,13 @@ The following environment variables are ones that you can set to change the beha
|
||||
|
||||
Nx will set the following environment variables so they can be accessible within the process even outside of executors and generators.
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| NX_TASK_TARGET_PROJECT | string | Set to the project name of the task being run. Use this to tell which project is being run. |
|
||||
| NX_TASK_TARGET_TARGET | string | Set to the target name of the task being run. Use this to tell which target of the project is being run. |
|
||||
| NX_TASK_TARGET_CONFIGURATION | string | Set to the configuration name of the task being run. Use this to tell which configuration of the target is being run. |
|
||||
| NX_DRY_RUN | boolean | Set to `true` during dry runs of generators. Use this to avoid side effects during generators. |
|
||||
| NX_INTERACTIVE | boolean | Set to `false` when running generators with `--interactive=false`. Use this to prevent prompting during generators |
|
||||
| Property | Type | Description |
|
||||
| ---------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| NX_TASK_TARGET_PROJECT | string | Set to the project name of the task being run. Use this to tell which project is being run. |
|
||||
| NX_TASK_TARGET_TARGET | string | Set to the target name of the task being run. Use this to tell which target of the project is being run. |
|
||||
| NX_TASK_TARGET_CONFIGURATION | string | Set to the configuration name of the task being run. Use this to tell which configuration of the target is being run. |
|
||||
| NX_GRAPH_CREATION | boolean | Set to `true` during the graph creation process. Use this to have inference plugins run different code during graph creation versus during task execution |
|
||||
| NX_DRY_RUN | boolean | Set to `true` during dry runs of generators. Use this to avoid side effects during generators. |
|
||||
| NX_INTERACTIVE | boolean | Set to `false` when running generators with `--interactive=false`. Use this to prevent prompting during generators |
|
||||
|
||||
[Nx Cloud Environment Variables](/ci/reference/env-vars) are listed on a dedicated page.
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
- [Automate Updating Dependencies](/features/automate-updating-dependencies)
|
||||
- [Enforce Module Boundaries](/features/enforce-module-boundaries)
|
||||
- [Manage Releases](/features/manage-releases)
|
||||
- [Powerpack Features](/features/powerpack)
|
||||
- [Run Language-Agnostic Conformance Rules](/features/powerpack/conformance)
|
||||
- [Define Code Ownership at the Project Level](/features/powerpack/owners)
|
||||
- [Self-Host the Remote Cache](/features/powerpack/custom-caching)
|
||||
- [CI Features](/features/ci-features)
|
||||
- [Concepts](/concepts)
|
||||
- [Mental Model](/concepts/mental-model)
|
||||
@@ -51,6 +55,7 @@
|
||||
- [Folder Structure](/concepts/decisions/folder-structure)
|
||||
- [Recipes](/recipes)
|
||||
- [Installation](/recipes/installation)
|
||||
- [Activate Powerpack](/recipes/installation/activate-powerpack)
|
||||
- [Install Nx in a Non-Javascript Repo](/recipes/installation/install-non-javascript)
|
||||
- [Update Your Global Nx Installation](/recipes/installation/update-global-installation)
|
||||
- [Tasks & Caching](/recipes/running-tasks)
|
||||
@@ -219,6 +224,7 @@
|
||||
- [workspace.json](/deprecated/workspace-json)
|
||||
- [As Provided vs. Derived](/deprecated/as-provided-vs-derived)
|
||||
- [Workspace Generators](/deprecated/workspace-generators)
|
||||
- [Custom Task Runners](/deprecated/custom-task-runners)
|
||||
- [Workspace Executors](/deprecated/workspace-executors)
|
||||
- [runtimeCacheInputs](/deprecated/runtime-cache-inputs)
|
||||
- [cacheableOperations](/deprecated/cacheable-operations)
|
||||
@@ -756,3 +762,23 @@
|
||||
- [npm-package](/nx-api/workspace/generators/npm-package)
|
||||
- [ci-workflow](/nx-api/workspace/generators/ci-workflow)
|
||||
- [infer-targets](/nx-api/workspace/generators/infer-targets)
|
||||
- [powerpack-conformance](/nx-api/powerpack-conformance)
|
||||
- [documents](/nx-api/powerpack-conformance/documents)
|
||||
- [Overview](/nx-api/powerpack-conformance/documents/overview)
|
||||
- [powerpack-license](/nx-api/powerpack-license)
|
||||
- [powerpack-owners](/nx-api/powerpack-owners)
|
||||
- [documents](/nx-api/powerpack-owners/documents)
|
||||
- [Overview](/nx-api/powerpack-owners/documents/overview)
|
||||
- [generators](/nx-api/powerpack-owners/generators)
|
||||
- [init](/nx-api/powerpack-owners/generators/init)
|
||||
- [sync-codeowners-file](/nx-api/powerpack-owners/generators/sync-codeowners-file)
|
||||
- [powerpack-s3-cache](/nx-api/powerpack-s3-cache)
|
||||
- [documents](/nx-api/powerpack-s3-cache/documents)
|
||||
- [Overview](/nx-api/powerpack-s3-cache/documents/overview)
|
||||
- [generators](/nx-api/powerpack-s3-cache/generators)
|
||||
- [init](/nx-api/powerpack-s3-cache/generators/init)
|
||||
- [powerpack-shared-fs-cache](/nx-api/powerpack-shared-fs-cache)
|
||||
- [documents](/nx-api/powerpack-shared-fs-cache/documents)
|
||||
- [Overview](/nx-api/powerpack-shared-fs-cache/documents/overview)
|
||||
- [generators](/nx-api/powerpack-shared-fs-cache/generators)
|
||||
- [init](/nx-api/powerpack-shared-fs-cache/generators/init)
|
||||
|
||||
@@ -499,6 +499,9 @@ describe('Angular Projects', () => {
|
||||
`Building entry point '@${proj}/${lib}/${entryPoint}'`
|
||||
);
|
||||
expect(buildOutput).toContain('Successfully ran target build');
|
||||
|
||||
expect(() => runCLI(`lint ${lib} --fix`)).not.toThrow();
|
||||
expect(() => runCLI(`lint ${childLib} --fix`)).not.toThrow();
|
||||
});
|
||||
|
||||
it('should support generating projects with --project-name-and-root-format=derived', () => {
|
||||
|
||||
@@ -494,7 +494,9 @@ describe('Linter', () => {
|
||||
it('should report dependency check issues', () => {
|
||||
const rootPackageJson = readJson('package.json');
|
||||
const nxVersion = rootPackageJson.devDependencies.nx;
|
||||
const tslibVersion = rootPackageJson.dependencies['tslib'];
|
||||
const tslibVersion =
|
||||
rootPackageJson.dependencies['tslib'] ||
|
||||
rootPackageJson.devDependencies['tslib'];
|
||||
|
||||
let out = runCLI(`lint ${mylib}`, {
|
||||
silenceError: true,
|
||||
@@ -535,20 +537,18 @@ describe('Linter', () => {
|
||||
`Successfully ran target lint for project ${mylib}`
|
||||
);
|
||||
const packageJson = readJson(`libs/${mylib}/package.json`);
|
||||
expect(packageJson).toMatchInlineSnapshot(`
|
||||
{
|
||||
"dependencies": {
|
||||
"@nx/devkit": "${nxVersion}",
|
||||
"tslib": "${tslibVersion}",
|
||||
},
|
||||
"main": "./src/index.js",
|
||||
"name": "@proj/${mylib}",
|
||||
"private": true,
|
||||
"type": "commonjs",
|
||||
"typings": "./src/index.d.ts",
|
||||
"version": "0.0.1",
|
||||
}
|
||||
`);
|
||||
expect(packageJson).toMatchObject({
|
||||
dependencies: {
|
||||
'@nx/devkit': nxVersion,
|
||||
tslib: tslibVersion,
|
||||
},
|
||||
main: './src/index.js',
|
||||
name: `@proj/${mylib}`,
|
||||
private: true,
|
||||
type: 'commonjs',
|
||||
typings: './src/index.d.ts',
|
||||
version: '0.0.1',
|
||||
});
|
||||
|
||||
// intentionally set the invalid version
|
||||
updateJson(`libs/${mylib}/package.json`, (json) => {
|
||||
|
||||
@@ -146,14 +146,14 @@ describe('@nx/expo (legacy)', () => {
|
||||
it('should install', async () => {
|
||||
// run install command
|
||||
let installResults = await runCLIAsync(
|
||||
`install ${appName} --no-interactive`
|
||||
`install ${appName} --no-interactive --force`
|
||||
);
|
||||
expect(installResults.combinedOutput).toContain(
|
||||
'Successfully ran target install'
|
||||
);
|
||||
|
||||
installResults = await runCLIAsync(
|
||||
`install ${appName} --packages=@react-native-async-storage/async-storage,react-native-image-picker --no-interactive`
|
||||
`install ${appName} --force --packages=@react-native-async-storage/async-storage,react-native-image-picker --no-interactive`
|
||||
);
|
||||
expect(installResults.combinedOutput).toContain(
|
||||
'Successfully ran target install'
|
||||
|
||||
@@ -117,14 +117,14 @@ describe('@nx/expo', () => {
|
||||
it('should install', async () => {
|
||||
// run install command
|
||||
let installResults = await runCLIAsync(
|
||||
`install ${appName} --no-interactive`
|
||||
`install ${appName} --force --no-interactive`
|
||||
);
|
||||
expect(installResults.combinedOutput).toContain(
|
||||
'Successfully ran target install'
|
||||
);
|
||||
|
||||
installResults = await runCLIAsync(
|
||||
`install ${appName} --packages=@react-native-async-storage/async-storage,react-native-image-picker --no-interactive`
|
||||
`install ${appName} --force --packages=@react-native-async-storage/async-storage,react-native-image-picker --no-interactive`
|
||||
);
|
||||
expect(installResults.combinedOutput).toContain(
|
||||
'Successfully ran target install'
|
||||
|
||||
@@ -413,7 +413,8 @@ describe('React Rspack Module Federation', () => {
|
||||
}, 600_000);
|
||||
});
|
||||
|
||||
it('should should support generating host and remote apps with the new name and root format', async () => {
|
||||
// TODO(Coly010): investigate this failure
|
||||
xit('should support generating host and remote apps with the new name and root format', async () => {
|
||||
const shell = uniq('shell');
|
||||
const remote = uniq('remote');
|
||||
|
||||
|
||||
@@ -106,7 +106,9 @@ describe('nx release pre-version command', () => {
|
||||
// command should succeed because the pre-version command will build the package
|
||||
const result4 = runCLI(`release patch -d -g ${groupName} --first-release`);
|
||||
|
||||
expect(result4).toContain('NX Executing pre-version command');
|
||||
expect(result4).toContain(
|
||||
`NX Executing release group pre-version command for "${groupName}"`
|
||||
);
|
||||
|
||||
updateJson(`nx.json`, (json) => {
|
||||
json.release = {
|
||||
|
||||
@@ -273,6 +273,7 @@ export function runCommandUntil(
|
||||
...opts.env,
|
||||
FORCE_COLOR: 'false',
|
||||
},
|
||||
windowsHide: true,
|
||||
});
|
||||
return new Promise((res, rej) => {
|
||||
let output = '';
|
||||
|
||||
@@ -62,11 +62,17 @@ export default async function (globalConfig: Config.ConfigGlobals) {
|
||||
function getPublishedVersion(): Promise<string | undefined> {
|
||||
return new Promise((resolve) => {
|
||||
// Resolve the published nx version from verdaccio
|
||||
exec('npm view nx@latest version', (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
return resolve(undefined);
|
||||
exec(
|
||||
'npm view nx@latest version',
|
||||
{
|
||||
windowsHide: true,
|
||||
},
|
||||
(error, stdout, stderr) => {
|
||||
if (error) {
|
||||
return resolve(undefined);
|
||||
}
|
||||
return resolve(stdout.trim());
|
||||
}
|
||||
return resolve(stdout.trim());
|
||||
});
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -106,16 +106,16 @@ export const ProjectDetails = ({
|
||||
</p>
|
||||
) : null}
|
||||
{projectData.tags && projectData.tags.length ? (
|
||||
<TagList tags={projectData.tags} />
|
||||
<TagList className="mb-2" tags={projectData.tags} />
|
||||
) : null}
|
||||
{projectData.root ? (
|
||||
<p>
|
||||
<p className="mb-2">
|
||||
<span className="font-medium">Root:</span>
|
||||
<span className="font-mono"> {projectData.root.trim()}</span>
|
||||
</p>
|
||||
) : null}
|
||||
{projectData.projectType ?? typeToProjectType[project.type] ? (
|
||||
<p>
|
||||
<p className="mb-2">
|
||||
<span className="font-medium">Type:</span>
|
||||
<span className="ml-2 font-mono capitalize">
|
||||
{projectData.projectType ?? typeToProjectType[project.type]}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import React, { useState, useRef, useEffect } from 'react';
|
||||
import { Pill } from '../pill';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
interface TagListProps {
|
||||
tags: string[];
|
||||
className: string;
|
||||
}
|
||||
|
||||
export function TagList({ tags }: TagListProps) {
|
||||
export function TagList({ tags, className }: TagListProps) {
|
||||
const [isExpanded, _setIsExpanded] = useState(false);
|
||||
const [isOverflowing, setIsOverflowing] = useState(false);
|
||||
const tagsContainerRef = useRef<HTMLSpanElement>(null);
|
||||
@@ -34,7 +36,7 @@ export function TagList({ tags }: TagListProps) {
|
||||
}, [tagsContainerRef]);
|
||||
|
||||
return (
|
||||
<div className="relative max-w-full">
|
||||
<div className={twMerge('relative max-w-full', className)}>
|
||||
<p className="flex min-w-0 font-medium leading-loose">
|
||||
<span className="inline-block">Tags:</span>
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import { SchemaViewModel } from './get-schema-view-model';
|
||||
import { SchemaEditor } from './schema-editor';
|
||||
import { SchemaViewer } from './schema-viewer';
|
||||
import { Heading2, Heading3 } from './ui/headings';
|
||||
import { cx } from '@nx/nx-dev/ui-primitives';
|
||||
|
||||
function pathCleaner(path: string): string {
|
||||
return path.split('?')[0];
|
||||
@@ -156,29 +157,38 @@ export function Content({
|
||||
<Link
|
||||
href={schemaViewModel.packageUrl}
|
||||
title="See package information"
|
||||
className="relative inline-flex items-center rounded-l-md border border-slate-200 bg-white px-4 py-2 text-xs font-medium text-slate-600 focus-within:ring-blue-500 hover:bg-slate-50 focus:z-10 focus:outline-none focus:ring-1 dark:border-slate-700 dark:bg-slate-800/60 dark:text-slate-400 dark:focus-within:ring-sky-500 dark:hover:bg-slate-800"
|
||||
className={cx(
|
||||
'relative inline-flex items-center rounded-l-md border border-slate-200 bg-white px-4 py-2 text-xs font-medium text-slate-600 focus-within:ring-blue-500 hover:bg-slate-50 focus:z-10 focus:outline-none focus:ring-1 dark:border-slate-700 dark:bg-slate-800/60 dark:text-slate-400 dark:focus-within:ring-sky-500 dark:hover:bg-slate-800',
|
||||
schemaViewModel.packageName.startsWith('@nx/powerpack')
|
||||
? 'rounded-md'
|
||||
: 'rounded-l-md'
|
||||
)}
|
||||
>
|
||||
{schemaViewModel.packageName}
|
||||
</Link>
|
||||
<Link
|
||||
href={schemaViewModel.schemaGithubUrl}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
title="See this schema on GitHub"
|
||||
className="relative -ml-px inline-flex items-center rounded-r-md border border-slate-200 bg-white px-4 py-2 text-xs font-medium text-slate-600 focus-within:ring-blue-500 hover:bg-slate-50 focus:z-10 focus:outline-none focus:ring-1 dark:border-slate-700 dark:bg-slate-800/60 dark:text-slate-400 dark:focus-within:ring-sky-500 dark:hover:bg-slate-800"
|
||||
>
|
||||
<svg
|
||||
className="mr-2 h-4 w-4"
|
||||
viewBox="0 0 16 16"
|
||||
fill="currentColor"
|
||||
{schemaViewModel.packageName.startsWith(
|
||||
'@nx/powerpack'
|
||||
) ? undefined : (
|
||||
<Link
|
||||
href={schemaViewModel.schemaGithubUrl}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
title="See this schema on GitHub"
|
||||
className="relative -ml-px inline-flex items-center rounded-r-md border border-slate-200 bg-white px-4 py-2 text-xs font-medium text-slate-600 focus-within:ring-blue-500 hover:bg-slate-50 focus:z-10 focus:outline-none focus:ring-1 dark:border-slate-700 dark:bg-slate-800/60 dark:text-slate-400 dark:focus-within:ring-sky-500 dark:hover:bg-slate-800"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"
|
||||
></path>
|
||||
</svg>
|
||||
See schema
|
||||
</Link>
|
||||
<svg
|
||||
className="mr-2 h-4 w-4"
|
||||
viewBox="0 0 16 16"
|
||||
fill="currentColor"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"
|
||||
></path>
|
||||
</svg>
|
||||
See schema
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,24 +25,30 @@ export function TopSchemaLayout({
|
||||
Rescope @nrwl to @nx
|
||||
</Link>
|
||||
</div>
|
||||
<div className="relative z-0 inline-flex flex-shrink-0">
|
||||
<a
|
||||
href={url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
aria-hidden="true"
|
||||
title="See package on GitHub"
|
||||
className="relative inline-flex items-center rounded-md border border-slate-200 bg-slate-50 px-4 py-2 text-xs font-medium dark:border-slate-700 dark:bg-slate-800/60"
|
||||
>
|
||||
<svg className="mr-2 h-4 w-4" viewBox="0 0 16 16" fill="currentColor">
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"
|
||||
></path>
|
||||
</svg>
|
||||
{name}
|
||||
</a>
|
||||
</div>
|
||||
{name.startsWith('@nx/powerpack') ? undefined : (
|
||||
<div className="relative z-0 inline-flex flex-shrink-0">
|
||||
<a
|
||||
href={url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
aria-hidden="true"
|
||||
title="See package on GitHub"
|
||||
className="relative inline-flex items-center rounded-md border border-slate-200 bg-slate-50 px-4 py-2 text-xs font-medium dark:border-slate-700 dark:bg-slate-800/60"
|
||||
>
|
||||
<svg
|
||||
className="mr-2 h-4 w-4"
|
||||
viewBox="0 0 16 16"
|
||||
fill="currentColor"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"
|
||||
></path>
|
||||
</svg>
|
||||
{name}
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||