docs(misc): new self-hosted cache updates (#30550)

Adds the new updates around self-hosted caching possibilities.
This commit is contained in:
Juri Strumpflohner 2025-03-31 19:28:42 +02:00 committed by GitHub
parent 5974851c24
commit a22f4fce49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
83 changed files with 2255 additions and 1307 deletions

View File

@ -197,14 +197,14 @@ This can be a game-changer when building huge apps. Stay tuned for more content
We recommend this approach if you want to speed up local serve and build times, but you still deploy the application as a whole.
Read more on our docs: [/concepts/module-federation/faster-builds-with-module-federation](/concepts/module-federation/faster-builds-with-module-federation)
Read more in our docs: [/concepts/module-federation/faster-builds-with-module-federation](/concepts/module-federation/faster-builds-with-module-federation)
## Micro Frontend Architecture with Nx
As mentioned in the previous section, Nx v14 comes with out-of-the-box for Webpack Module Federation. The Micro Frontend architecture builds on top of that and adds the ability for independent deployability. While Module Federation enables faster builds by vertically slicing your application into smaller ones, the MFE architecture layers _independent deployments_
on top of federation. Teams should only choose MFEs if they want to deploy their host and remotes on different cadences.
Read more on our docs: [/concepts/module-federation/micro-frontend-architecture](/concepts/module-federation/micro-frontend-architecture)
Read more in our docs: [/concepts/module-federation/micro-frontend-architecture](/concepts/module-federation/micro-frontend-architecture)
## Dark mode for Project Graph as well as path tracking
@ -242,7 +242,7 @@ In version 13.4 we released a brand new dedicated package for developing pure Ja
We kept improving it, adding SWC support (including an easy migration between TSC → SWC using an Nx generator) and we're currently looking into automated publishing support.
Read all the details on our docs: [/getting-started/intro](/getting-started/intro)
Read all the details in our docs: [/getting-started/intro](/getting-started/intro)
## React

View File

@ -200,7 +200,7 @@ npx nx g @nrwl/vite:configuration
This will adjust the NxExt Vite plugin configuration to match the one provided by our core team. Check out our docs for more info: [/nx-api/vite/generators/configuration](/nx-api/vite/generators/configuration)
You can also find all the details about the new Vite package on our docs: [/nx-api/vite](/nx-api/vite)
You can also find all the details about the new Vite package in our docs: [/nx-api/vite](/nx-api/vite)
## Adopting Nx has never been easier
@ -271,7 +271,7 @@ This process will ask you a few questions about which operations are cacheable.
}
```
Read more on our docs: [/recipes/adopting-nx/adding-to-existing-project](/recipes/adopting-nx/adding-to-existing-project)
Read more in our docs: [/recipes/adopting-nx/adding-to-existing-project](/recipes/adopting-nx/adding-to-existing-project)
## Root-level Scripts
@ -312,7 +312,7 @@ npx nx docs
As the next steps you might obviously want to add `docs` to the [cacheable operations](/ci/reference/config) and [fine-tune it's cache inputs](/recipes/running-tasks/configure-inputs).
Read more about it on our docs: [/recipes/running-tasks/root-level-scripts](/recipes/running-tasks/root-level-scripts)
Read more about it in our docs: [/recipes/running-tasks/root-level-scripts](/recipes/running-tasks/root-level-scripts)
## Simplified Nx run-commands
@ -386,7 +386,7 @@ For simple commands this was a huge overhead, so we simplified it to just this:
Simple, isn't it! Obviously the expanded form is still there and also useful for when you need more options, run multiple commands or features such as argument forwarding.
You can read all about it on our docs: [/recipes/running-tasks/run-commands-executor](/recipes/running-tasks/run-commands-executor)
You can read all about it in our docs: [/recipes/running-tasks/run-commands-executor](/recipes/running-tasks/run-commands-executor)
## Coming up

View File

@ -151,7 +151,7 @@ Inspired by our new [Vite setup](/nx-api/vite), which allows for a more modular
![](/blog/images/2023-02-16/emRP2gF7umWc4UE-.avif)
If you want to upgrade but still retain the previous behavior, we introduced an `isolatedConfig` mode that can be set to `false`. More details on our docs: [/recipes/webpack/webpack-config-setup](/recipes/webpack/webpack-config-setup)
If you want to upgrade but still retain the previous behavior, we introduced an `isolatedConfig` mode that can be set to `false`. More details in our docs: [/recipes/webpack/webpack-config-setup](/recipes/webpack/webpack-config-setup)
## How to Update Nx

View File

@ -306,7 +306,7 @@ We've also added the ability to sort the registry by these metrics as a way of s
![](/blog/images/2023-09-06/f0AhdlWaIcC96LXK.avif)
Go [check it out now](/plugin-registry) live on our docs site!
Go [check it out now](/plugin-registry) live in our docs site!
## DOCS ENHANCEMENT: Redesigned Intro & Examples

View File

@ -35,7 +35,7 @@ In a nutshell, the Nx Docs AI Assistant works in the following way:
This is based on the Web Q&A Tutorial from OpenAI [(https://platform.openai.com/docs/tutorials/web-qa-embeddings)](https://platform.openai.com/docs/tutorials/web-qa-embeddings) and Supabases Vector Search example [(https://supabase.com/docs/guides/ai/examples/nextjs-vector-search)](https://supabase.com/docs/guides/ai/examples/nextjs-vector-search).
Its important to note here that we are not “training the model on our docs”. The model is pretrained. We are just giving the model parts of our docs which are relevant to the users question, and the model creates a coherent answer to the question. Its basically like pasting in ChatGPT a docs page and asking it “how do I do that?”. Except in this case, were first searching our documentation and giving GPT only the relevant parts (more about how we do that later in this article), which it can “read” and extract information from.
Its important to note here that we are not “training the model in our docs”. The model is pretrained. We are just giving the model parts of our docs which are relevant to the users question, and the model creates a coherent answer to the question. Its basically like pasting in ChatGPT a docs page and asking it “how do I do that?”. Except in this case, were first searching our documentation and giving GPT only the relevant parts (more about how we do that later in this article), which it can “read” and extract information from.
## Step 1: Preprocessing our docs

View File

@ -328,7 +328,7 @@ You can also browse them in the [nx-recipes](https://github.com/nrwl/nx-recipes)
{% tweet url="https://twitter.com/juristr/status/1736023402933318011" /%}
And obviously, we jumped on the AI train as well. A couple of months ago, we added the [Nx Assistant](/ai-chat). A ChatGPT-powered interface trained on our docs. [Katerina](https://twitter.com/psybercity) wrote about it [on our blog](/blog/nx-docs-ai-assistant). The AI chat allows to interactively ask questions about Nx and will give you relevant answers from our docs (including linking to the sources).
And obviously, we jumped on the AI train as well. A couple of months ago, we added the [Nx Assistant](/ai-chat). A ChatGPT-powered interface trained in our docs. [Katerina](https://twitter.com/psybercity) wrote about it [on our blog](/blog/nx-docs-ai-assistant). The AI chat allows to interactively ask questions about Nx and will give you relevant answers from our docs (including linking to the sources).
## New Tagline: Smart Monorepos — Fast CI

View File

@ -7,11 +7,11 @@ cover_image: /blog/images/evolving-nx/thumbnail.png
description: Nx's journey from a side project to a tool for millions, including Nx Cloud and Nx Powerpack developments.
---
_Update from Jeff Cross, October 17, 2024_
{% callout type="info" title="Update - March 15th, 2025" %}
In my original version of this post, I said that Powerpack is completely new functionality. I mistakenly thought that all custom remote cache solutions were using private/unsupported APIs, but I've since learned that we've had docs and some APIs that helped people build their own remote caches. I'm sorry for the error, and have updated the text to indicate that Powerpack is mostly new functionality. We've also updated the [Powerpack page](/powerpack) to make it more explicit how some teams can get free Powerpack licenses.
Self-hosted caching is now free for everyone. Read more [in our blog post](todojs) and in our documentation about [remote caching options with Nx](/remote-cache).
---
{% /callout %}
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.
@ -24,11 +24,13 @@ When we have new ideas to make Nx better, we've always had two options: it could
## 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.
**[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).
Powerpack is mostly new functionality. 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.
Powerpack is mostly new functionality. ~~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.~~
_Edit: Self-hosted caching with Nx is now completely free for everyone. Read more in [our latest announcement.](/blog/custom-runners-and-self-hosted-caching)_
There's a Steve Jobs quote that I think rings true with all of us at Nx:
@ -42,7 +44,10 @@ Like many open source projects, one of the bigger challenges to sustainability i
### 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).
Open Source projects can:
- Get all Powerpack features as well as fully managed remote caching (and more) via the free Nx Cloud OSS plan. [Learn more here](/nx-enterprise/powerpack/licenses-and-trials#powerpack-for-oss-projects).
- Get self-hosted remote caches via the according Nx plugins. [Learn more in the docs](/recipes/running-tasks/self-hosted-caching).
## How to Get Nx Powerpack

View File

@ -4,10 +4,15 @@ slug: introducing-nx-powerpack
authors: [Juri Strumpflohner]
tags: [nx, release]
cover_image: /blog/images/introducing-powerpack/thumbnail.png
youtubeUrl: https://youtu.be/KZ0nh2lj8zE
description: Introducing Nx Powerpack, a paid extension suite for enterprise use cases, ensuring Nx remains open source and existing features are free.
---
{% callout type="info" title="Update - March 15th, 2025" %}
Self-hosted caching is now free for everyone. Read more [in our blog post](todojs) and in our documentation about [remote caching options with Nx](/remote-cache).
{% /callout %}
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.
@ -23,10 +28,9 @@ 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:
But now to the fun, technical part! Nx Powerpack is a bundle that - in this very first release - comes with these 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!
@ -38,7 +42,7 @@ All Powerpack features require a dedicated commercial license. You can get one h
Once you have your license, run the following command
```shell
npx nx activate-powerpack <your-license>
npx nx register <your-activation-key>
```
## Codeowners for Monorepos
@ -61,7 +65,7 @@ One of the downsides of how codeowners works on today's VCS providers is that **
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
npx nx add @nx/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:
@ -122,73 +126,17 @@ A dedicated `nx sync` command automatically synchronizes these definitions to a
Read all about how to [configure Codeowners for your project in our docs](/nx-enterprise/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/legacy-cache) in Nx 20. I bring this up because it might affect users that relied on 3rd party tools that hooked into the task runners API.
To fill in on the custom task runner API we're providing a new Powerpack plugin that allows you to use S3 or a network drive as your storing mechanism for your Nx cache.
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
...
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](/nx-enterprise/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:
We're releasing the `@nx/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.
- [Enforce Module Boundaries](/nx-api/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/conformance#ensure-owners): Requires every project to have an owner defined for the `@nx/owners` plugin.
To get started, install the following package:
```shell
npx nx add @nx/powerpack-conformance
npx nx add @nx/conformance
```
This allows you to define conformance rules in your `nx.json`. Here is an example:
@ -199,12 +147,12 @@ This allows you to define conformance rules in your `nx.json`. Here is an exampl
"conformance": {
"rules": [
{
"rule": "@nx/powerpack-conformance/enforce-module-boundaries",
"rule": "@nx/conformance/enforce-module-boundaries",
"projects": ["!remix-app-e2e"],
"options": {}
},
{
"rule": "@nx/powerpack-conformance/ensure-owners",
"rule": "@nx/conformance/ensure-owners",
"projects": ["!remix-app-e2e"]
},
{
@ -218,7 +166,7 @@ This allows you to define conformance rules in your `nx.json`. Here is an exampl
You can also define rules locally, as shown in the example above, which are simple TypeScript files:
```ts
import { createConformanceRule } from '@nx/powerpack-conformance';
import { createConformanceRule } from '@nx/conformance';
const rule = createConformanceRule({
name: 'local-conformance-rule-example',

View File

@ -15,7 +15,7 @@ It's been a few months now since our last major update with [Nx 20](), let's che
- [Nx Cloud Enhancements](#nx-cloud-enhancements)
- [Angular 19 Support](#angular-19-support)
- [Core Performance Improvements](#core-performance-improvements)
- [Powerpack Updates](#powerpack-updates)
- [Self-hosted Cache Updates](#selfhosted-cache-updates)
- [RFC for Infinite Tasks](#rfc-for-infinite-tasks)
You can also catch most of these updates direct from the team from our livestream:
@ -191,31 +191,19 @@ We've also introduced spinners into the terminal ui for instances where a task i
![](/blog/images/2025-01-06/project-graph-spinner.gif)
## Powerpack Updates
## Self-hosted Cache Updates
[Nx Powerpack](/nx-enterprise/powerpack) is a suite of paid extensions for the Nx CLI, that enables some features like [allowing for third-party storage services to be used for your remoted and shared caching](/nx-enterprise/powerpack/custom-caching), [specifying specific developers as owners of specific projects in your repo](/nx-enterprise/powerpack/owners), and [running language-agnostic conformance rules](/nx-enterprise/powerpack/conformance):
> Update: Self-hosted cache was previously part of Powerpack. But no more, it is no free for everyone to use.
{% cards cols="2" lgCols="3" mdCols="3" smCols="2" %}
We just improved support for our [self-hosted caching packages](/recipes/running-tasks/self-hosted-caching) by adding adapters for [Azure](/nx-api/azure-cache) and [Google Cloud Storage](/nx-api/gcs-cache) as supported storage providers (in addition to [S3](/nx-api/s3-cache) or [simply using a shared file system](/nx-api/shared-fs-cache)).
{% link-card title="Conformance" type="Powerpack Feature" url="/nx-enterprise/powerpack/conformance" icon="CheckBadgeIcon" /%}
{% link-card title="Owners" type="Powerpack Feature" url="/nx-enterprise/powerpack/owners" icon="UserGroupIcon" /%}
{% link-card title="Self-Hosted Remote Cache" type="Powerpack Feature" url="/nx-enterprise/powerpack/custom-caching" icon="ServerIcon" /%}
{% /cards %}
Recently, we've added support for [Azure](/nx-api/powerpack-azure-cache) and [Google Cloud Storage](/nx-api/powerpack-gcs-cache) as supported storage providers (in addition to [S3](/nx-api/powerpack-s3-cache) or [simply using a shared file system](/nx-api/powerpack-shared-fs-cache)).
We've also [added support for S3 compatible providers](/nx-api/powerpack-s3-cache#s3-compatible-providers) such as:
We've also [added support for S3 compatible providers](/nx-api/s3-cache#s3-compatible-providers) such as:
- [MinIO](https://min.io/product/s3-compatibility)
- [LocalStack](https://www.localstack.cloud)
- [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces)
- [Cloudflare](https://www.cloudflare.com/developer-platform/solutions/s3-compatible-object-storage)
We've also added the capability to allow folks to authenticate their Powerpack license via Nx Cloud (rather than requiring that the license be committed to the repository). This should enable oss library authors use Powerpack - without exposing their private license via their repo.
We are offering free Nx Powerpack licenses to all open source libraries. We also offer free licenses to smaller businesses. If you are interested, you may [request a license now using Nx Cloud](/nx-enterprise/powerpack/free-licenses-and-trials).
## RFC for Infinite Tasks
Last up, we have an [RFC for the concept of "Infinite Tasks"](https://github.com/nrwl/nx/discussions/29025) on GitHub now. This is a new feature that we'll be adding soon to support non-discrete tasks in terms of the task dependencies. It should come in handy for use-cases like:

View File

@ -49,7 +49,7 @@ Hetzner Cloud needed a solution that would streamline their development process,
After evaluating Nx and Turborepo, Hetzner Cloud selected Nx for its advanced monorepo management capabilities. They started a [Nx Enterprise](/enterprise) contract and closely collaborated with the Nx Developer Productivity Engineers to assess Hetzner's current software landscape and evaluate the best strategy. Their goal was not necessarily to create a monorepo in the first place, but to modularize their monolithic application. Nx provided the right tools to:
- **Break down the monolith** into modular packages without affecting deployment.
- **Define clear domain boundaries** using [module boundary rules](/features/enforce-module-boundaries) and [conformance rules](/nx-api/powerpack-conformance).
- **Define clear domain boundaries** using [module boundary rules](/features/enforce-module-boundaries) and [conformance rules](/nx-api/conformance).
- **Improve ownership management** by having a more modular structure with clear boundaries allowing for easier allocaton of owernship. Something that could further be improved in the future by using [CodeOwners](/nx-enterprise/powerpack/owners).
Beyond modularization, Nx helped consolidate fragmented projects into a single, structured workspace. This reduced the overhead of maintaining multiple repositories and simplified dependency management. Using the [Nx Graph](/features/explore-graph), the team gained visibility into their project relationships, making it easier to coordinate work and optimize collaboration.

View File

@ -0,0 +1,71 @@
---
title: 'Custom Task Runners and Self-Hosted Caching Changes'
slug: custom-runners-and-self-hosted-caching
authors: [Victor Savkin]
description: 'Learn about free plugins for self-hosting your cache, a new Open API RFC and hooks for the task lifecycle as well as the commitment to open source and improved community collaboration.'
tags: [nx]
cover_image: /blog/images/articles/bg-self-hosted-caching-article.jpg
---
**TL;DR:** **Nx remains free for everyone who chooses to self-host their own cache**. There will be two ways to self-host:
1. **Maximum independence and control:** An OpenAPI specification so you can run your own cache server implementation on your own terms.
2. **Maximum convenience:** Free plugins for each major cloud storage provider (and arbitrary file system storage), all maintained by us.
These options will be released before Nx 21.
---
**So, what happened?**
In September 2024, we announced that custom task runners would be deprecated and would reach end-of-life in April 2025. This announcement is consistent with how we typically design and ship. We create a draft proposal (for example, a new API) that doesn't affect anyone immediately and give ourselves 6 to 12 months to gather feedback from the community, with real teams. After which, once it becomes stable, we finalize the design. I strongly believe in designing-while-doing and we've found that continuous-thinking-without-doing re-enforces ivory tower solutions.
In this instance, we did not spend enough time engaging with the community on a couple key concerns. Our communication around this situation also fell short and I sincerely apologize for the confusion and concern this caused. I will outline the feedback we heard below and explain what we're improving to ensure this does not happen again.
## **1. "We don't want open source capabilities to be taken away."**
While we're still deprecating the older custom task runners API, our mistake was in not providing a one for one replacement. To address this, we are introducing new APIs to replace the old one — **fully supporting everything the previous implementation offered, including free self-hosted caching.**
### Self-Hosted Cache API RFC
We have [published a new RFC](https://github.com/nrwl/nx/discussions/30548) detailing a custom self-hosted cache based on an OpenAPI specification. This will be available before Nx 21, ensuring a smooth migration path for those who are looking for full control.
### New preTasksExecution and postTasksExecution API
Some teams used custom task runners for non-cache-related workflows, and removing them created gaps in functionality. We have released open-source preTasksExecution and postTasksExecution hooks to provide the same capabilities in a more composable way. More details [in our docs](/extending-nx/recipes/task-running-lifecycle). We also [added detailed instructions to migrate to this new API](/deprecated/custom-tasks-runner#the-pretasksexecution-and-posttasksexecution-hooks) if you've been using custom task runners for such use cases in the past.
We worked closely with large teams that have advanced use cases to ensure they can still accomplish everything they did before.
{% callout title="A Clear Commitment Moving Forward" type="info" %}
Our commitment is that **no major open-source feature or API will be replaced with a non-open-source alternative.** Some features will inevitably become obsolete over time, but when that happens, we will provide clear deprecation notices and migration strategies. Nx will continue to evolve, but removing an old API will never be a means to move users toward a paid feature.
We will keep developing Nx Cloud and other premium offerings for teams that need enterprise-scale solutions, but we remain focused on a strong open-source foundation that allows teams to use and scale Nx without requiring paid features.
Nx open-source remains a primary focus for us as a company.
{% /callout %}
### **@nx/s3, @nx/gcp, @nx/azure… and related packages are free for everyone**
In addition to updating the API, we believe the first-party packages we offer are the best option for most organizations using self-hosted cache today **so we've made them free for everyone**. The activation is simple and can be done in the CLI. _Full refunds will be issued to anyone who paid for these packages during this transition._
> **Why is there an activation process?** It simply helps us better understand our users as we continue to improve our tools. You can also use the OpenAPI specification to run your own cache for complete independence.
## 2. "We want more input into the roadmap."
We recognize that some of these changes felt abrupt. To address that, we've put the following measures in place to improve how we involve the community in major decisions:
- **New RFC Process:** We've started putting all major API changes through an RFC process before being finalized:
- [**RFC: Nx Custom Self-Hosted Remote Cache**](https://github.com/nrwl/nx/discussions/30548)
- [**RFC: Linking Packages with Workspaces**](https://github.com/nrwl/nx/discussions/29099) (new [TypeScript Setup](/blog/new-nx-experience-for-typescript-monorepos))
- [**RFC: Infinite Tasks**](https://github.com/nrwl/nx/discussions/29025)
- **Regular Office Hours:** A space for open discussions, where we share updates and answer questions. Join us [here](http://go.nx.dev/office-hours)!
- **Published Roadmaps:** More transparency on what's coming next. View [current roadmap](https://github.com/nrwl/nx/discussions/28731).
- **Closer Collaboration with Nx Champions and teams:** This new approach and even this post were shaped through dozens of conversations with [**Nx Champions**](/community) and many teams. We will continue to do so to minimize future blindspots.
### **Moving Forward**
The community's enthusiasm is what makes Nx successful, and we're very grateful for it. Good developer tools aren't built in isolation; they come from working together, listening, and refining as we go. The conversations we had over the past few months have helped us shape a better solution one that works for more teams while keeping Nx fast and powerful.
A huge thank you to everyone who shared their thoughts and helped push Nx forward - we wouldn't be where we are without you!

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1,240 +1,206 @@
[
{
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Azure Blob Storage.",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Azure Blob Storage.",
"documents": [
{
"id": "overview",
"name": "Overview",
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Azure Blob Storage.",
"file": "external-generated/packages/powerpack-azure-cache/documents/overview",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Azure Blob Storage.",
"file": "external-generated/packages/azure-cache/documents/overview",
"itemList": [],
"isExternal": false,
"path": "powerpack-azure-cache/documents/overview",
"path": "azure-cache/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-azure-cache/powerpack-azure-cache-plugin"
"originalFilePath": "shared/packages/azure-cache/azure-cache-plugin"
}
],
"executors": [],
"generators": [],
"migrations": [],
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "powerpack-azure-cache",
"packageName": "@nx/powerpack-azure-cache",
"root": "/libs/nx-packages/powerpack-azure-cache",
"source": "/libs/nx-packages/powerpack-azure-cache/src"
"name": "azure-cache",
"packageName": "@nx/azure-cache",
"root": "/libs/nx-packages/azure-cache",
"source": "/libs/nx-packages/azure-cache/src"
},
{
"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.",
"description": "A Nx 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",
"description": "A Nx 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/conformance/documents/overview",
"itemList": [],
"isExternal": false,
"path": "powerpack-conformance/documents/overview",
"path": "conformance/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-conformance/powerpack-conformance-plugin"
"originalFilePath": "shared/packages/conformance/conformance-plugin"
},
{
"id": "create-conformance-rule",
"name": "Create a Conformance Rule",
"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/create-conformance-rule",
"description": "A Nx 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/conformance/documents/create-conformance-rule",
"itemList": [],
"isExternal": false,
"path": "powerpack-conformance/documents/create-conformance-rule",
"path": "conformance/documents/create-conformance-rule",
"tags": [],
"originalFilePath": "shared/packages/powerpack-conformance/create-conformance-rule"
"originalFilePath": "shared/packages/conformance/create-conformance-rule"
}
],
"executors": [
{
"description": "Compile and bundle one or more Nx Conformance Rules",
"file": "external-generated/packages/powerpack-conformance/executors/bundle-rules.json",
"file": "external-generated/packages/conformance/executors/bundle-rules.json",
"hidden": false,
"name": "bundle-rules",
"originalFilePath": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rules/schema.json",
"path": "powerpack-conformance/executors/bundle-rules",
"originalFilePath": "/libs/nx-packages/conformance/src/executors/bundle-rules/schema.json",
"path": "conformance/executors/bundle-rules",
"type": "executor"
}
],
"generators": [
{
"description": "Create a new conformance rule",
"file": "external-generated/packages/powerpack-conformance/generators/create-rule.json",
"file": "external-generated/packages/conformance/generators/create-rule.json",
"hidden": false,
"name": "create-rule",
"originalFilePath": "/libs/nx-packages/powerpack-conformance/src/generators/create-rule/schema.json",
"path": "powerpack-conformance/generators/create-rule",
"originalFilePath": "/libs/nx-packages/conformance/src/generators/create-rule/schema.json",
"path": "conformance/generators/create-rule",
"type": "generator"
}
],
"migrations": [],
"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"
"name": "conformance",
"packageName": "@nx/conformance",
"root": "/libs/nx-packages/conformance",
"source": "/libs/nx-packages/conformance/src"
},
{
"description": "A Nx Powerpack plugin which is specific to Nx Enterprise Cloud workspaces.",
"documents": [],
"executors": [],
"generators": [
{
"description": "Initialize Nx Powerpack Enterprise Cloud config",
"file": "external-generated/packages/powerpack-enterprise-cloud/generators/init.json",
"hidden": false,
"name": "init",
"originalFilePath": "/libs/nx-packages/powerpack-enterprise-cloud/src/generators/init/schema.json",
"path": "powerpack-enterprise-cloud/generators/init",
"type": "generator"
}
],
"migrations": [],
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "powerpack-enterprise-cloud",
"packageName": "@nx/powerpack-enterprise-cloud",
"root": "/libs/nx-packages/powerpack-enterprise-cloud",
"source": "/libs/nx-packages/powerpack-enterprise-cloud/src"
},
{
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Google Cloud Storage.",
"description": "A Nx 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 a Nx cache which can be self hosted on Google Cloud Storage.",
"file": "external-generated/packages/powerpack-gcs-cache/documents/overview",
"description": "A Nx plugin which provides the ability to configure and maintain codeowners for projects in Nx workspaces.",
"file": "external-generated/packages/owners/documents/overview",
"itemList": [],
"isExternal": false,
"path": "powerpack-gcs-cache/documents/overview",
"path": "owners/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-gcs-cache/powerpack-gcs-cache-plugin"
}
],
"executors": [],
"generators": [],
"migrations": [],
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "powerpack-gcs-cache",
"packageName": "@nx/powerpack-gcs-cache",
"root": "/libs/nx-packages/powerpack-gcs-cache",
"source": "/libs/nx-packages/powerpack-gcs-cache/src"
},
{
"description": "Package to provide the ability to activate and read licenses for Nx Powerpack.",
"documents": [],
"executors": [],
"generators": [],
"migrations": [],
"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"
"originalFilePath": "shared/packages/owners/owners-plugin"
}
],
"executors": [],
"generators": [
{
"description": "Initialize Nx Powerpack Owners config",
"file": "external-generated/packages/powerpack-owners/generators/init.json",
"file": "external-generated/packages/owners/generators/init.json",
"hidden": false,
"name": "init",
"originalFilePath": "/libs/nx-packages/powerpack-owners/src/generators/init/schema.json",
"path": "powerpack-owners/generators/init",
"originalFilePath": "/libs/nx-packages/owners/src/generators/init/schema.json",
"path": "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",
"file": "external-generated/packages/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",
"originalFilePath": "/libs/nx-packages/owners/src/generators/sync-codeowners-file/schema.json",
"path": "owners/generators/sync-codeowners-file",
"type": "generator"
}
],
"migrations": [],
"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"
"name": "owners",
"packageName": "@nx/owners",
"root": "/libs/nx-packages/owners",
"source": "/libs/nx-packages/owners/src"
},
{
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Amazon S3.",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Google Cloud Storage.",
"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",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Google Cloud Storage.",
"file": "external-generated/packages/gcs-cache/documents/overview",
"itemList": [],
"isExternal": false,
"path": "powerpack-s3-cache/documents/overview",
"path": "gcs-cache/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-s3-cache/powerpack-s3-cache-plugin"
"originalFilePath": "shared/packages/gcs-cache/gcs-cache-plugin"
}
],
"executors": [],
"generators": [],
"migrations": [],
"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"
"name": "gcs-cache",
"packageName": "@nx/gcs-cache",
"root": "/libs/nx-packages/gcs-cache",
"source": "/libs/nx-packages/gcs-cache/src"
},
{
"description": "A Nx Powerpack plugin to enable you to use a shared file system directory",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Amazon S3.",
"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",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Amazon S3.",
"file": "external-generated/packages/s3-cache/documents/overview",
"itemList": [],
"isExternal": false,
"path": "powerpack-shared-fs-cache/documents/overview",
"path": "s3-cache/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-shared-fs-cache/powerpack-shared-fs-cache-plugin"
"originalFilePath": "shared/packages/s3-cache/s3-cache-plugin"
}
],
"executors": [],
"generators": [],
"migrations": [],
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "s3-cache",
"packageName": "@nx/s3-cache",
"root": "/libs/nx-packages/s3-cache",
"source": "/libs/nx-packages/s3-cache/src"
},
{
"description": "A Nx plugin to enable you to use a shared file system directory",
"documents": [
{
"id": "overview",
"name": "Overview",
"description": "A Nx plugin to enable you to use a shared file system directory",
"file": "external-generated/packages/shared-fs-cache/documents/overview",
"itemList": [],
"isExternal": false,
"path": "shared-fs-cache/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/shared-fs-cache/shared-fs-cache-plugin"
}
],
"executors": [],
"generators": [
{
"description": "Add the shared fs cache",
"file": "external-generated/packages/powerpack-shared-fs-cache/generators/init.json",
"file": "external-generated/packages/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",
"originalFilePath": "/libs/nx-packages/shared-fs-cache/src/generators/init/schema.json",
"path": "shared-fs-cache/generators/init",
"type": "generator"
}
],
"migrations": [],
"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"
"name": "shared-fs-cache",
"packageName": "@nx/shared-fs-cache",
"root": "/libs/nx-packages/shared-fs-cache",
"source": "/libs/nx-packages/shared-fs-cache/src"
}
]

View File

@ -1,27 +1,46 @@
---
title: Overview of the Nx powerpack-azure-cache Plugin
description: The powerpack-azure-cache Nx plugin enables you to use Azure Storage to host your remote cache instead of Nx Cloud
title: Overview of the Nx Azure Cache Plugin
description: The @nx/azure-cache plugin enables you to use Azure Storage to host your remote cache for efficient build caching across your team.
---
The `@nx/powerpack-azure-cache` plugin enables you to use [Azure Storage](https://azure.microsoft.com/en-us/products/storage/blobs) instead of Nx Cloud to host your remote cache.
The `@nx/azure-cache` plugin enables you to self-host your remote cache on [Azure Storage](https://azure.microsoft.com/en-us/products/storage/blobs).
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="deepdive" title="Free managed remote cache with Nx Cloud" %}
Note, you can get started for free with a **fully managed remote caching powered by Nx Cloud**. It comes with a generous Hobby plan that is enough for most small teams. [Learn more here](/nx-cloud).
If you are an enterprise and **data privacy and security is a concern**, [reach out for an Enterprise trial](/enterprise/trial). It is fully SOC 2 type 1 and 2 compliant and comes with single-tenant, dedicated EU region hosting as well as on-premise.
**Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss).
{% callout title="This plugin requires an active Nx Powerpack license" %}
In order to use `@nx/powerpack-azure-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-azure-cache
{% callout type="info" title="Self-hosted caching is now free" %}
Self-hosted caching is **now free for everyone** to use.
{% /callout %}
## Set Up @nx/azure-cache
### 1. Install the Package
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already. It only takes a minute.
2. Install the package
Run the following command:
```shell
nx add @nx/powerpack-azure-cache
nx add @nx/azure-cache
```
This will add the `@nx/azure-cache` NPM package and automatically configure it for your workspace. As part of this process, you'll be guided to **generate a new activation key**. This is a fully automated process to register your plugin.
The key will be saved in your repository (`.nx/key/key.ini`) and should be committed so that every developer has access to it. If your repository is public (or in CI), you can also use an environment variable:
```{% fileName=".env" %}
NX_KEY=YOUR_ACTIVATION_KEY
```
> Why require an activation key? It simply helps us know and support our users. If you prefer not to provide this information, you can also build your own cache server. [Learn more.](/recipes/running-tasks/self-hosted-caching)
### 2. Authenticate with Azure
There are several ways to [authenticate with Azure Storage](https://github.com/Azure/login#login-with-openid-connect-oidc-recommended), but the method recommended by Azure is to use OpenID Connect, like this:
@ -36,7 +55,7 @@ permissions:
jobs:
main:
env:
NX_POWERPACK_LICENSE: ${{ secrets.NX_POWERPACK_LICENSE }}
NX_KEY: ${{ secrets.NX_KEY }}
runs-on: ubuntu-latest
steps:
...
@ -57,7 +76,7 @@ You need to set the `AZURE_CLIENT_ID`, `AZURE_TENANT_ID` and `AZURE_SUBSCRIPTION
Note: Any authentication method that [sets up the `DefaultAzureCredentials`](https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/credential-chains#use-defaultazurecredential-for-flexibility) will enable the plugin to work.
{% callout type="note" title="Custom Azure Endpoint" %}
If you are using a custom Azure endpoint, you will need to authenticate by [setting the `AZURE_STORAGE_CONNECTION_STRING` environment variable](https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string). The `@nx/powerpack-azure-cache` plugin will detect the environment variable and automatically use it to connect to Azure.
If you are using a custom Azure endpoint, you will need to authenticate by [setting the `AZURE_STORAGE_CONNECTION_STRING` environment variable](https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string). The `@nx/azure-cache` plugin will detect the environment variable and automatically use it to connect to Azure.
{% /callout %}
### 3. Configure the Nx Cache to Use Azure Storage

View File

@ -9,10 +9,10 @@ For local conformance rules, the resolution utilities from `@nx/js` are used in
Therefore, in practice, writing your local conformance rules in an Nx generated library is the easiest way to organize them and ensure that they are easily resolvable via TypeScript. The library in question could also be an Nx plugin, but it does not have to be.
To write your own conformance rule, run the `@nx/powerpack-conformance:create-rule` generator and answer the prompts.
To write your own conformance rule, run the `@nx/conformance:create-rule` generator and answer the prompts.
```text {% command="nx g @nx/powerpack-conformance:create-rule" %}
NX Generating @nx/powerpack-conformance:create-rule
```text {% command="nx g @nx/conformance:create-rule" %}
NX Generating @nx/conformance:create-rule
✔ What is the name of the rule? · local-conformance-rule-example
✔ Which directory do you want to create the rule directory in? · packages/my-plugin/local-conformance-rule
@ -26,10 +26,7 @@ CREATE packages/my-plugin/local-conformance-rule/local-conformance-rule-example/
The generated rule definition file should look like this:
```ts {% fileName="packages/my-plugin/local-conformance-rule/index.ts" %}
import {
createConformanceRule,
ProjectViolation,
} from '@nx/powerpack-conformance';
import { createConformanceRule, ProjectViolation } from '@nx/conformance';
export default createConformanceRule({
name: 'local-conformance-rule-example',
@ -76,14 +73,11 @@ There are three types of reporters that a rule can use.
{% tabs %}
{% tab label="project-reporter" %}
The `@nx/powerpack-conformance:ensure-owners` rule provides us an example of how to write a `project-reporter` rule. The `@nx/powerpack-owners` plugin adds an `owners` metadata property to every project node that has an owner in the project graph. This rule checks each project node metadata to make sure that each project has some owner defined.
The `@nx/conformance:ensure-owners` rule provides us an example of how to write a `project-reporter` rule. The `@nx/owners` plugin adds an `owners` metadata property to every project node that has an owner in the project graph. This rule checks each project node metadata to make sure that each project has some owner defined.
```ts
import { ProjectGraphProjectNode } from '@nx/devkit';
import {
createConformanceRule,
ProjectViolation,
} from '@nx/powerpack-conformance';
import { createConformanceRule, ProjectViolation } from '@nx/conformance';
export default createConformanceRule({
name: 'ensure-owners',
@ -121,10 +115,7 @@ export default createConformanceRule({
This rule uses TypeScript AST processing to ensure that `index.ts` files use a client-side style of export syntax and `server.ts` files use a server-side style of export syntax.
```ts
import {
createConformanceRule,
ProjectFilesViolation,
} from '@nx/powerpack-conformance';
import { createConformanceRule, ProjectFilesViolation } from '@nx/conformance';
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import {
@ -264,7 +255,7 @@ import { readJsonFile, workspaceRoot } from '@nx/devkit';
import {
createConformanceRule,
NonProjectFilesViolation,
} from '@nx/powerpack-conformance';
} from '@nx/conformance';
import { join } from 'node:path';
import { satisfies } from 'semver';

View File

@ -3,31 +3,31 @@ 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 `@nx/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)
- [**Ensure Owners**](#ensure-owners): Require every project to have an owner defined for the [`@nx/owners` plugin](/nx-api/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.
In order to use `@nx/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
## Set Up @nx/conformance
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already
2. Install the package
```shell
nx add @nx/powerpack-conformance
nx add @nx/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.
Configure the `@nx/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
@ -64,7 +64,7 @@ Use `npx nx-cloud record --` to capture the logs for `nx conformance` in the Nx
/**
* Relative path to a local rule implementation or node_module path.
*/
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
"rule": "@nx/conformance/enforce-project-boundaries",
/**
* Rule specific configuration options. (Optional)
*/
@ -82,20 +82,20 @@ Use `npx nx-cloud record --` to capture the logs for `nx conformance` in the Nx
## Provided Conformance Rules
The following rules are provided by Nx along with the `@nx/powerpack-conformance` plugin.
The following rules are provided by Nx along with the `@nx/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`
Set the `rule` property to: `@nx/conformance/enforce-project-boundaries`
```json {% fileName="nx.json" %}
{
"conformance": {
"rules": [
{
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
"rule": "@nx/conformance/enforce-project-boundaries",
"options": {
// Optional
// Can be a boolean or an object with an array of buildTargetNames
@ -150,16 +150,16 @@ a given `source` project the resulting constraints would be **all** that match i
### Ensure Owners
This rule requires every project to have an owner defined for the [`@nx/powerpack-owners` plugin](/nx-api/powerpack-owners)
This rule requires every project to have an owner defined for the [`@nx/owners` plugin](/nx-api/owners)
Set the `rule` property to: `@nx/powerpack-conformance/ensure-owners`
Set the `rule` property to: `@nx/conformance/ensure-owners`
```json {% fileName="nx.json" %}
{
"conformance": {
"rules": [
{
"rule": "@nx/powerpack-conformance/ensure-owners"
"rule": "@nx/conformance/ensure-owners"
}
]
}
@ -170,6 +170,6 @@ Set the `rule` property to: `@nx/powerpack-conformance/ensure-owners`
For more information about the conformance plugin, consult the following articles:
- [Create a Conformance Rule](/nx-api/powerpack-conformance/documents/create-conformance-rule)
- [Create a Conformance Rule](/nx-api/conformance/documents/create-conformance-rule)
- [Publish Conformance Rules to Nx Cloud](/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud)
- [Configure Conformance Rules in Nx Cloud](/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud)

View File

@ -1,6 +1,6 @@
{
"name": "bundle-rules",
"implementation": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rules/executor.ts",
"implementation": "/libs/nx-packages/conformance/src/executors/bundle-rules/executor.ts",
"schema": {
"$schema": "https://json-schema.org/schema",
"version": 2,
@ -23,6 +23,6 @@
"description": "Compile and bundle one or more Nx Conformance Rules",
"aliases": [],
"hidden": false,
"path": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rules/schema.json",
"path": "/libs/nx-packages/conformance/src/executors/bundle-rules/schema.json",
"type": "executor"
}

View File

@ -51,9 +51,9 @@
"presets": []
},
"description": "Create a new conformance rule",
"implementation": "/libs/nx-packages/powerpack-conformance/src/generators/create-rule/create-rule.ts",
"implementation": "/libs/nx-packages/conformance/src/generators/create-rule/create-rule.ts",
"aliases": [],
"hidden": false,
"path": "/libs/nx-packages/powerpack-conformance/src/generators/create-rule/schema.json",
"path": "/libs/nx-packages/conformance/src/generators/create-rule/schema.json",
"type": "generator"
}

View File

@ -1,27 +1,46 @@
---
title: Overview of the Nx powerpack-gcs-cache Plugin
description: The powerpack-gcs-cache Nx plugin enables you to use Google Cloud Storage to host your remote cache instead of Nx Cloud
title: Overview of the Nx GCS Cache Plugin
description: The @nx/gcs-cache plugin enables you to use Google Cloud Storage to host your remote cache for efficient build caching across your team.
---
The `@nx/powerpack-gcs-cache` plugin enables you to use [Google Cloud Storage](https://cloud.google.com/storage) instead of Nx Cloud to host your remote cache.
The `@nx/gcs-cache` plugin enables you to self-host your remote cache on [Google Cloud Storage](https://cloud.google.com/storage).
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="deepdive" title="Free managed remote cache with Nx Cloud" %}
Note, you can get started for free with a **fully managed remote caching powered by Nx Cloud**. It comes with a generous Hobby plan that is enough for most small teams. [Learn more here](/nx-cloud).
If you are an enterprise and **data privacy and security is a concern**, [reach out for an Enterprise trial](/enterprise/trial). It is fully SOC 2 type 1 and 2 compliant and comes with single-tenant, dedicated EU region hosting as well as on-premise.
**Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss).
{% callout title="This plugin requires an active Nx Powerpack license" %}
In order to use `@nx/powerpack-gcs-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-gcs-cache
{% callout type="info" title="Self-hosted caching is now free" %}
Self-hosted caching is **now free for everyone** to use.
{% /callout %}
## Set Up @nx/gcs-cache
### 1. Install the Package
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already. It only takes a minute.
2. Install the package
Run the following command:
```shell
nx add @nx/powerpack-gcs-cache
nx add @nx/gcs-cache
```
This will add the `@nx/gcs-cache` NPM package and automatically configure it for your workspace. As part of this process, you'll be guided to **generate a new activation key**. This is a fully automated process to register your plugin.
The key will be saved in your repository (`.nx/key/key.ini`) and should be committed so that every developer has access to it. If your repository is public (or in CI), you can also use an environment variable:
```{% fileName=".env" %}
NX_KEY=YOUR_ACTIVATION_KEY
```
> Why require an activation key? It simply helps us know and support our users. If you prefer not to provide this information, you can also build your own cache server. [Learn more.](/recipes/running-tasks/self-hosted-caching)
### 2. Authenticate with Google Cloud
There are several ways to [authenticate with Google Cloud Storage](https://github.com/google-github-actions/setup-gcloud#authorization), but the method recommended by Google is to use Workload Identity Federation, like this:
@ -36,7 +55,7 @@ permissions:
jobs:
main:
env:
NX_POWERPACK_LICENSE: ${{ secrets.NX_POWERPACK_LICENSE }}
NX_KEY: ${{ secrets.NX_KEY }}
runs-on: ubuntu-latest
steps:
...
@ -98,7 +117,7 @@ Nx will only show warnings when the remote cache is not writable. You can disabl
}
```
The cache mode in CI can also be configured by setting `ciMode` to `read-only` or `no-cache` in the `nx.json` file. Or setting `NX_POWERPACK_CACHE_MODE` to `read-only` or `no-cache` in the CI environment.
The cache mode in CI can also be configured by setting `ciMode` to `read-only` or `no-cache` in the `nx.json` file. Or by setting `NX_POWERPACK_CACHE_MODE` to `read-only` or `no-cache` in the CI environment.
```jsonc {% fileName="nx.json" %}
{

View File

@ -3,35 +3,35 @@ 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/).
The `@nx/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.
In order to use `@nx/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
## Set Up @nx/owners
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already
2. Install the package
```shell
nx add @nx/powerpack-owners
nx add @nx/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.
Configure the `@nx/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:
The `nx add @nx/owners` command should have registered the `@nx/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"]
"globalGenerators": ["@nx/owners:sync-codeowners-file"]
}
}
```

View File

@ -13,9 +13,9 @@
"presets": []
},
"description": "Initialize Nx Powerpack Owners config",
"implementation": "/libs/nx-packages/powerpack-owners/src/generators/init/init.ts",
"implementation": "/libs/nx-packages/owners/src/generators/init/init.ts",
"aliases": [],
"hidden": false,
"path": "/libs/nx-packages/powerpack-owners/src/generators/init/schema.json",
"path": "/libs/nx-packages/owners/src/generators/init/schema.json",
"type": "generator"
}

View File

@ -11,9 +11,9 @@
"presets": []
},
"description": "Sync Nx Powerpack Owners config to a CODEOWNERS file",
"implementation": "/libs/nx-packages/powerpack-owners/src/generators/sync-codeowners-file/generator.ts",
"implementation": "/libs/nx-packages/owners/src/generators/sync-codeowners-file/generator.ts",
"aliases": [],
"hidden": false,
"path": "/libs/nx-packages/powerpack-owners/src/generators/sync-codeowners-file/schema.json",
"path": "/libs/nx-packages/owners/src/generators/sync-codeowners-file/schema.json",
"type": "generator"
}

View File

@ -1,28 +0,0 @@
{
"name": "bundle-rule",
"implementation": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rule/executor.ts",
"schema": {
"$schema": "https://json-schema.org/schema",
"version": 2,
"title": "BundleNxConformanceRule",
"description": "Compile and bundle an Nx Conformance Rule",
"type": "object",
"properties": {
"main": {
"type": "string",
"description": "The entrypoint file for the rule"
},
"outputPath": {
"type": "string",
"description": "The output path for the bundled rule"
}
},
"required": ["main", "outputPath"],
"presets": []
},
"description": "Compile and bundle an Nx Conformance Rule",
"aliases": [],
"hidden": false,
"path": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rule/schema.json",
"type": "executor"
}

View File

@ -1,21 +0,0 @@
{
"name": "init",
"factory": "./src/generators/init/init",
"schema": {
"$schema": "http://json-schema.org/schema",
"id": "NxPowerpackEnterpriseCloudInit",
"title": "Add Powerpack Enterprise Cloud plugin to the workspace",
"type": "object",
"cli": "nx",
"properties": {},
"additionalProperties": false,
"required": [],
"presets": []
},
"description": "Initialize Nx Powerpack Enterprise Cloud config",
"implementation": "/libs/nx-packages/powerpack-enterprise-cloud/src/generators/init/init.ts",
"aliases": [],
"hidden": false,
"path": "/libs/nx-packages/powerpack-enterprise-cloud/src/generators/init/schema.json",
"type": "generator"
}

View File

@ -1,108 +0,0 @@
---
title: Overview of the Nx powerpack-gcs-cache Plugin
description: The powerpack-gcs-cache Nx plugin enables you to use Google Cloud Storage to host your remote cache instead of Nx Cloud
---
The `@nx/powerpack-gcs-cache` plugin enables you to use [Google Cloud Storage](https://cloud.google.com/storage) 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 Google Cloud Storage account 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-gcs-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-gcs-cache
### 1. Install the Package
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already
2. Install the package
```shell
nx add @nx/powerpack-gcs-cache
```
### 2. Authenticate with Google Cloud
There are several ways to [authenticate with Google Cloud Storage](https://github.com/google-github-actions/setup-gcloud#authorization), but the method recommended by Google is to use Workload Identity Federation, like this:
```yaml {% fileName=".github/workflows/ci.yml" %}
name: CI
...
permissions:
id-token: write
...
jobs:
main:
env:
NX_POWERPACK_LICENSE: ${{ secrets.NX_POWERPACK_LICENSE }}
runs-on: ubuntu-latest
steps:
...
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
token_format: 'access_token'
workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
service_account: 'my-service-account@my-project.iam.gserviceaccount.com'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
...
- run: pnpm exec nx affected -t lint test build
```
Note: Any authentication method that [sets up the Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials) will enable the plugin to work.
### 3. Configure the Nx Cache to Use Google Cloud Storage
Finally, 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" %}
{
"gcs": {
"bucket": "my-bucket"
}
}
```
| **Property** | **Description** |
| ------------ | ----------------------------- |
| **bucket** | The name of the bucket to use |
# Cache Modes
By default, Nx will try to write and read from the remote cache while running locally. This means that permissions must be set for users who are expected to access the remote cache.
Nx will only show warnings when the remote cache is not writable. You can disable these warnings by setting `localMode` to `read-only` or `no-cache` in the `nx.json` file.
```jsonc {% fileName="nx.json" %}
{
"gcs": {
// ...
"localMode": "read-only"
}
}
```
The cache mode in CI can also be configured by setting `ciMode` to `read-only` or `no-cache` in the `nx.json` file. Or setting `NX_POWERPACK_CACHE_MODE` to `read-only` or `no-cache` in the CI environment.
```jsonc {% fileName="nx.json" %}
{
"gcs": {
// ...
"ciMode": "read-only"
}
}
```

View File

@ -1,40 +0,0 @@
{
"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"
},
"accessKeyId": {
"type": "string",
"description": "The AWS Access Key ID to use to access the S3 Bucket, alternatively set the AWS_ACCESS_KEY_ID environment variable"
},
"secretAccessKey": {
"type": "string",
"description": "The AWS Secret Access Key to use to access the S3 Bucket, alternatively set the AWS_SECRET_ACCESS_KEY environment variable"
},
"bucket": {
"type": "string",
"description": "The the name of the S3 Bucket to store the Nx Cache in"
},
"forcePathStyle": {
"type": "boolean",
"description": "Set to true to use path style URLs for S3 objects"
}
},
"required": [],
"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"
}

View File

@ -1,35 +0,0 @@
---
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](/nx-enterprise/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.

View File

@ -1,31 +1,47 @@
---
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
title: Overview of the Nx S3 Cache Plugin
description: The @nx/s3-cache plugin enables you to use an Amazon S3 bucket to host your remote cache for efficient build caching across your team.
---
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.
The `@nx/s3-cache` plugin enables you to self-host your remote cache on an [Amazon S3](https://aws.amazon.com/s3) bucket.
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="deepdive" title="Free managed remote cache with Nx Cloud" %}
{% callout title="No Cache Poisoning" %}
`@nx/powerpack-s3-cache` implements content integrity checks to prevent cache poisoning, making it a more secure solution than previous DIY approaches.
Note, you can get started for free with a **fully managed remote caching powered by Nx Cloud**. It comes with a generous Hobby plan that is enough for most small teams. [Learn more here](/nx-cloud).
If you are an enterprise and **data privacy and security is a concern**, [reach out for an Enterprise trial](/enterprise/trial). It is fully SOC 2 type 1 and 2 compliant and comes with single-tenant, dedicated EU region hosting as well as on-premise.
**Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss).
{% /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 type="info" title="Self-hosted caching is now free" %}
Self-hosted caching is **now free for everyone** to use.
{% /callout %}
## Set Up @nx/powerpack-s3-cache
## Set Up @nx/s3-cache
### 1. Install the Package
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already. It only takes a minute.
2. Install the package
Run the following command:
```shell
nx add @nx/powerpack-s3-cache
nx add @nx/s3-cache
```
This will add the `@nx/s3-cache` NPM package and automatically configure it for your workspace. As part of this process you'll be guided to **generate a new activation key**. This is a fully automated process to register your plugin.
The key will be saved in your repository (`.nx/key/key.ini`) and should be committed so that every developer has access to it. If your repository is public (or in CI) you can also use an environment variable:
```{% fileName=".env" %}
NX_KEY=YOUR_ACTIVATION_KEY
```
If you didn't get an activation key or skipped that step, you can easily generate one at any time by running `nx register` in your terminal.
> Why require an activation key? It simply helps us know and support our users. If you prefer not to provide this information, you can also build your own cache server. [Learn more.](/recipes/running-tasks/self-hosted-caching)
### 2. Authenticate with AWS
There are four different ways to authenticate with AWS. They will be attempted in this order:
@ -48,7 +64,7 @@ There are four different ways to authenticate with AWS. They will be attempted i
Both the `AWS_ACCESS_KEY_ID` and the `AWS_SECRET_ACCESS_KEY` environment variables are required to use the environment variable authentication method.
Here's an example of using OICD in GitHub Actions to set the environment variables in CI:
Here's an example of using OIDC in GitHub Actions to set the environment variables in CI:
```yaml {% fileName=".github/workflows/ci.yml" %}
name: CI
@ -60,7 +76,7 @@ permissions:
jobs:
main:
env:
NX_POWERPACK_LICENSE: ${{ secrets.NX_POWERPACK_LICENSE }}
NX_KEY: ${{ secrets.NX_KEY }}
runs-on: ubuntu-latest
steps:
...
@ -121,13 +137,13 @@ Regardless of how you manage your AWS authentication, you need to configure your
| **Property** | **Description** |
| ----------------- | --------------------------------------------------------------------------------- |
| **region** | The id of the AWS region to use |
| **region** | The ID of the AWS region to use |
| **bucket** | The name of the S3 bucket to use |
| **encryptionKey** | Nx encryption key used to encrypt and decrypt artifacts from the cache (optional) |
#### S3 Compatible Providers
To use `@nx/powerpack-s3-cache` with S3 compatible providers ([MinIO](https://min.io/product/s3-compatibility), [LocalStack](https://www.localstack.cloud), [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces), [Cloudflare](https://www.cloudflare.com/developer-platform/solutions/s3-compatible-object-storage), etc..), `endpoint` will need to be provided. Some providers also need to have `forcePathStyle` set to true in the configuration.
To use `@nx/s3-cache` with S3 compatible providers ([MinIO](https://min.io/product/s3-compatibility), [LocalStack](https://www.localstack.cloud), [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces), [Cloudflare](https://www.cloudflare.com/developer-platform/solutions/s3-compatible-object-storage), etc.), `endpoint` will need to be provided. Some providers also need to have `forcePathStyle` set to true in the configuration.
Below is an example on how to connect to MinIO:
@ -146,7 +162,7 @@ Below is an example on how to connect to MinIO:
| **Property** | **Description** |
| ------------------- | --------------------------------------------------------------------------------------------------------- |
| **region** | The id of the S3 compatible storage region to use |
| **region** | The ID of the S3 compatible storage region to use |
| **bucket** | The name of the S3 compatible storage bucket to use |
| **forcePathStyle** | Changes the way artifacts are uploaded. Usually used for S3 compatible providers (MinIO, LocalStack, etc) |
| **endpoint** | The custom endpoint to upload artifacts to. If endpoint is not defined, the default AWS endpoint is used |
@ -169,7 +185,7 @@ Nx will only show warnings when the remote cache is not writable. You can disabl
}
```
The cache mode in CI can also be configured by setting `ciMode` to `read-only` or `no-cache` in the `nx.json` file. Or setting `NX_POWERPACK_CACHE_MODE` to `read-only` or `no-cache` in the CI environment.
The cache mode in CI can also be configured by setting `ciMode` to `read-only` or `no-cache` in the `nx.json` file. Or by setting `NX_POWERPACK_CACHE_MODE` to `read-only` or `no-cache` in the CI environment.
```jsonc {% fileName="nx.json" %}
{

View File

@ -0,0 +1,54 @@
---
title: Overview of the Nx Shared File System Cache Plugin
description: The @nx/shared-fs-cache plugin enables you to use a shared file system directory to host your remote cache for efficient build caching across your team.
---
The `@nx/shared-fs-cache` plugin enables you to host your remote cache on a shared file system directory. While you're responsible for implementing the actual directory sharing mechanism, the plugin configures Nx to read from both your local cache and the shared directory.
{% callout type="warning" title="Potential Cache Poisoning" %}
Using a shared file system folder for remote caching introduces the risk of [cache poisoning](/troubleshooting/unknown-local-cache). To mitigate this risk, consider using [Nx Replay](/ci/features/remote-cache) instead.
{% /callout %}
{% callout type="deepdive" title="Free managed remote cache with Nx Cloud" %}
Note, you can get started for free with a **fully managed remote caching powered by Nx Cloud**. It comes with a generous Hobby plan that is enough for most small teams. [Learn more here](/nx-cloud).
If you are an enterprise and **data privacy and security is a concern**, [reach out for an Enterprise trial](/enterprise/trial). It is fully SOC 2 type 1 and 2 compliant and comes with single-tenant, dedicated EU region hosting as well as on-premise.
**Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss).
{% /callout %}
{% callout type="info" title="Self-hosted caching is now free" %}
Self-hosted caching is **now free for everyone** to use.
{% /callout %}
## Set Up @nx/shared-fs-cache
### 1. Install the Package
Run the following command:
```shell
nx add @nx/shared-fs-cache
```
This will add the `@nx/shared-fs-cache` NPM package and automatically configure it for your workspace. As part of this process, you'll be guided to **generate a new activation key**. This is a fully automated process to register your plugin.
The key will be saved in your repository (`.nx/key/key.ini`) and should be committed so that every developer has access to it. If your repository is public (or in CI), you can also use an environment variable:
```{% fileName=".env" %}
NX_KEY=YOUR_ACTIVATION_KEY
```
> Why require an activation key? It simply helps us know and support our users. If you prefer not to provide this information, you can also build your own cache server. [Learn more.](/recipes/running-tasks/self-hosted-caching)
### 2. Configure the Cache Directory
The `@nx/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/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.

View File

@ -11,9 +11,9 @@
"presets": []
},
"description": "Add the shared fs cache",
"implementation": "/libs/nx-packages/powerpack-shared-fs-cache/src/generators/init/generator.ts",
"implementation": "/libs/nx-packages/shared-fs-cache/src/generators/init/generator.ts",
"aliases": [],
"hidden": false,
"path": "/libs/nx-packages/powerpack-shared-fs-cache/src/generators/init/schema.json",
"path": "/libs/nx-packages/shared-fs-cache/src/generators/init/schema.json",
"type": "generator"
}

View File

@ -238,6 +238,17 @@
"isExternal": false,
"path": "/extending-nx/recipes/publish-plugin",
"tags": ["create-your-own-plugin"]
},
{
"id": "task-running-lifecycle",
"name": "Hook into the Task Running Lifecycle",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/task-running-lifecycle",
"itemList": [],
"isExternal": false,
"path": "/extending-nx/recipes/task-running-lifecycle",
"tags": ["running-tasks"]
}
],
"isExternal": false,
@ -386,5 +397,16 @@
"isExternal": false,
"path": "/extending-nx/recipes/publish-plugin",
"tags": ["create-your-own-plugin"]
},
"/extending-nx/recipes/task-running-lifecycle": {
"id": "task-running-lifecycle",
"name": "Hook into the Task Running Lifecycle",
"description": "",
"mediaImage": "",
"file": "shared/recipes/plugins/task-running-lifecycle",
"itemList": [],
"isExternal": false,
"path": "/extending-nx/recipes/task-running-lifecycle",
"tags": ["running-tasks"]
}
}

View File

@ -1161,6 +1161,14 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Self-Host the Remote Cache",
"path": "/recipes/running-tasks/self-hosted-caching",
"id": "self-hosted-caching",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"disableCollapsible": false
@ -2223,6 +2231,14 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Self-Host the Remote Cache",
"path": "/recipes/running-tasks/self-hosted-caching",
"id": "self-hosted-caching",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"disableCollapsible": false
@ -2323,6 +2339,14 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Self-Host the Remote Cache",
"path": "/recipes/running-tasks/self-hosted-caching",
"id": "self-hosted-caching",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Adopting Nx",
"path": "/recipes/adopting-nx",
@ -4076,8 +4100,8 @@
"children": [
{
"name": "Free Licenses & Trials",
"path": "/nx-enterprise/powerpack/free-licenses-and-trials",
"id": "free-licenses-and-trials",
"path": "/nx-enterprise/powerpack/licenses-and-trials",
"id": "licenses-and-trials",
"isExternal": false,
"children": [],
"disableCollapsible": false
@ -4097,14 +4121,6 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Self-Host the Remote Cache",
"path": "/nx-enterprise/powerpack/custom-caching",
"id": "custom-caching",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"disableCollapsible": false
@ -4128,8 +4144,8 @@
"children": [
{
"name": "Free Licenses & Trials",
"path": "/nx-enterprise/powerpack/free-licenses-and-trials",
"id": "free-licenses-and-trials",
"path": "/nx-enterprise/powerpack/licenses-and-trials",
"id": "licenses-and-trials",
"isExternal": false,
"children": [],
"disableCollapsible": false
@ -4149,22 +4165,14 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Self-Host the Remote Cache",
"path": "/nx-enterprise/powerpack/custom-caching",
"id": "custom-caching",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"disableCollapsible": false
},
{
"name": "Free Licenses & Trials",
"path": "/nx-enterprise/powerpack/free-licenses-and-trials",
"id": "free-licenses-and-trials",
"path": "/nx-enterprise/powerpack/licenses-and-trials",
"id": "licenses-and-trials",
"isExternal": false,
"children": [],
"disableCollapsible": false
@ -4185,14 +4193,6 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Self-Host the Remote Cache",
"path": "/nx-enterprise/powerpack/custom-caching",
"id": "custom-caching",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Showcase",
"path": "/showcase",
@ -5518,6 +5518,14 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Hook into the Task Running Lifecycle",
"path": "/extending-nx/recipes/task-running-lifecycle",
"id": "task-running-lifecycle",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"disableCollapsible": false
@ -5625,6 +5633,14 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Hook into the Task Running Lifecycle",
"path": "/extending-nx/recipes/task-running-lifecycle",
"id": "task-running-lifecycle",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
]
},
@ -11078,18 +11094,18 @@
"disableCollapsible": false
},
{
"id": "powerpack-azure-cache",
"path": "/nx-api/powerpack-azure-cache",
"name": "powerpack-azure-cache",
"id": "azure-cache",
"path": "/nx-api/azure-cache",
"name": "azure-cache",
"children": [
{
"id": "documents",
"path": "/nx-api/powerpack-azure-cache/documents",
"path": "/nx-api/azure-cache/documents",
"name": "documents",
"children": [
{
"name": "Overview",
"path": "/nx-api/powerpack-azure-cache/documents/overview",
"path": "/nx-api/azure-cache/documents/overview",
"id": "overview",
"isExternal": false,
"children": [],
@ -11104,18 +11120,18 @@
"disableCollapsible": false
},
{
"id": "powerpack-conformance",
"path": "/nx-api/powerpack-conformance",
"name": "powerpack-conformance",
"id": "conformance",
"path": "/nx-api/conformance",
"name": "conformance",
"children": [
{
"id": "documents",
"path": "/nx-api/powerpack-conformance/documents",
"path": "/nx-api/conformance/documents",
"name": "documents",
"children": [
{
"name": "Overview",
"path": "/nx-api/powerpack-conformance/documents/overview",
"path": "/nx-api/conformance/documents/overview",
"id": "overview",
"isExternal": false,
"children": [],
@ -11123,7 +11139,7 @@
},
{
"name": "Create a Conformance Rule",
"path": "/nx-api/powerpack-conformance/documents/create-conformance-rule",
"path": "/nx-api/conformance/documents/create-conformance-rule",
"id": "create-conformance-rule",
"isExternal": false,
"children": [],
@ -11135,12 +11151,12 @@
},
{
"id": "executors",
"path": "/nx-api/powerpack-conformance/executors",
"path": "/nx-api/conformance/executors",
"name": "executors",
"children": [
{
"id": "bundle-rules",
"path": "/nx-api/powerpack-conformance/executors/bundle-rules",
"path": "/nx-api/conformance/executors/bundle-rules",
"name": "bundle-rules",
"children": [],
"isExternal": false,
@ -11152,12 +11168,12 @@
},
{
"id": "generators",
"path": "/nx-api/powerpack-conformance/generators",
"path": "/nx-api/conformance/generators",
"name": "generators",
"children": [
{
"id": "create-rule",
"path": "/nx-api/powerpack-conformance/generators/create-rule",
"path": "/nx-api/conformance/generators/create-rule",
"name": "create-rule",
"children": [],
"isExternal": false,
@ -11172,78 +11188,18 @@
"disableCollapsible": false
},
{
"id": "powerpack-enterprise-cloud",
"path": "/nx-api/powerpack-enterprise-cloud",
"name": "powerpack-enterprise-cloud",
"children": [
{
"id": "generators",
"path": "/nx-api/powerpack-enterprise-cloud/generators",
"name": "generators",
"children": [
{
"id": "init",
"path": "/nx-api/powerpack-enterprise-cloud/generators/init",
"name": "init",
"children": [],
"isExternal": false,
"disableCollapsible": false
}
],
"isExternal": false,
"disableCollapsible": false
}
],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "powerpack-gcs-cache",
"path": "/nx-api/powerpack-gcs-cache",
"name": "powerpack-gcs-cache",
"id": "owners",
"path": "/nx-api/owners",
"name": "owners",
"children": [
{
"id": "documents",
"path": "/nx-api/powerpack-gcs-cache/documents",
"path": "/nx-api/owners/documents",
"name": "documents",
"children": [
{
"name": "Overview",
"path": "/nx-api/powerpack-gcs-cache/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",
"path": "/nx-api/owners/documents/overview",
"id": "overview",
"isExternal": false,
"children": [],
@ -11255,12 +11211,12 @@
},
{
"id": "generators",
"path": "/nx-api/powerpack-owners/generators",
"path": "/nx-api/owners/generators",
"name": "generators",
"children": [
{
"id": "init",
"path": "/nx-api/powerpack-owners/generators/init",
"path": "/nx-api/owners/generators/init",
"name": "init",
"children": [],
"isExternal": false,
@ -11268,7 +11224,7 @@
},
{
"id": "sync-codeowners-file",
"path": "/nx-api/powerpack-owners/generators/sync-codeowners-file",
"path": "/nx-api/owners/generators/sync-codeowners-file",
"name": "sync-codeowners-file",
"children": [],
"isExternal": false,
@ -11283,18 +11239,18 @@
"disableCollapsible": false
},
{
"id": "powerpack-s3-cache",
"path": "/nx-api/powerpack-s3-cache",
"name": "powerpack-s3-cache",
"id": "gcs-cache",
"path": "/nx-api/gcs-cache",
"name": "gcs-cache",
"children": [
{
"id": "documents",
"path": "/nx-api/powerpack-s3-cache/documents",
"path": "/nx-api/gcs-cache/documents",
"name": "documents",
"children": [
{
"name": "Overview",
"path": "/nx-api/powerpack-s3-cache/documents/overview",
"path": "/nx-api/gcs-cache/documents/overview",
"id": "overview",
"isExternal": false,
"children": [],
@ -11309,18 +11265,44 @@
"disableCollapsible": false
},
{
"id": "powerpack-shared-fs-cache",
"path": "/nx-api/powerpack-shared-fs-cache",
"name": "powerpack-shared-fs-cache",
"id": "s3-cache",
"path": "/nx-api/s3-cache",
"name": "s3-cache",
"children": [
{
"id": "documents",
"path": "/nx-api/powerpack-shared-fs-cache/documents",
"path": "/nx-api/s3-cache/documents",
"name": "documents",
"children": [
{
"name": "Overview",
"path": "/nx-api/powerpack-shared-fs-cache/documents/overview",
"path": "/nx-api/s3-cache/documents/overview",
"id": "overview",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"isExternal": false,
"disableCollapsible": false
}
],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "shared-fs-cache",
"path": "/nx-api/shared-fs-cache",
"name": "shared-fs-cache",
"children": [
{
"id": "documents",
"path": "/nx-api/shared-fs-cache/documents",
"name": "documents",
"children": [
{
"name": "Overview",
"path": "/nx-api/shared-fs-cache/documents/overview",
"id": "overview",
"isExternal": false,
"children": [],
@ -11332,12 +11314,12 @@
},
{
"id": "generators",
"path": "/nx-api/powerpack-shared-fs-cache/generators",
"path": "/nx-api/shared-fs-cache/generators",
"name": "generators",
"children": [
{
"id": "init",
"path": "/nx-api/powerpack-shared-fs-cache/generators/init",
"path": "/nx-api/shared-fs-cache/generators/init",
"name": "init",
"children": [],
"isExternal": false,

View File

@ -6265,250 +6265,214 @@
},
"path": "/nx-api/workspace"
},
"powerpack-azure-cache": {
"azure-cache": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "powerpack-azure-cache",
"packageName": "@nx/powerpack-azure-cache",
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Azure Blob Storage.",
"name": "azure-cache",
"packageName": "@nx/azure-cache",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Azure Blob Storage.",
"documents": {
"/nx-api/powerpack-azure-cache/documents/overview": {
"/nx-api/azure-cache/documents/overview": {
"id": "overview",
"name": "Overview",
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Azure Blob Storage.",
"file": "external-generated/packages/powerpack-azure-cache/documents/overview",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Azure Blob Storage.",
"file": "external-generated/packages/azure-cache/documents/overview",
"itemList": [],
"isExternal": false,
"path": "/nx-api/powerpack-azure-cache/documents/overview",
"path": "/nx-api/azure-cache/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-azure-cache/powerpack-azure-cache-plugin"
"originalFilePath": "shared/packages/azure-cache/azure-cache-plugin"
}
},
"root": "/libs/nx-packages/powerpack-azure-cache",
"source": "/libs/nx-packages/powerpack-azure-cache/src",
"root": "/libs/nx-packages/azure-cache",
"source": "/libs/nx-packages/azure-cache/src",
"executors": {},
"generators": {},
"migrations": {},
"path": "/nx-api/powerpack-azure-cache"
"path": "/nx-api/azure-cache"
},
"powerpack-conformance": {
"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.",
"name": "conformance",
"packageName": "@nx/conformance",
"description": "A Nx 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": {
"/nx-api/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",
"description": "A Nx 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/conformance/documents/overview",
"itemList": [],
"isExternal": false,
"path": "/nx-api/powerpack-conformance/documents/overview",
"path": "/nx-api/conformance/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-conformance/powerpack-conformance-plugin"
"originalFilePath": "shared/packages/conformance/conformance-plugin"
},
"/nx-api/powerpack-conformance/documents/create-conformance-rule": {
"/nx-api/conformance/documents/create-conformance-rule": {
"id": "create-conformance-rule",
"name": "Create a Conformance Rule",
"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/create-conformance-rule",
"description": "A Nx 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/conformance/documents/create-conformance-rule",
"itemList": [],
"isExternal": false,
"path": "/nx-api/powerpack-conformance/documents/create-conformance-rule",
"path": "/nx-api/conformance/documents/create-conformance-rule",
"tags": [],
"originalFilePath": "shared/packages/powerpack-conformance/create-conformance-rule"
"originalFilePath": "shared/packages/conformance/create-conformance-rule"
}
},
"root": "/libs/nx-packages/powerpack-conformance",
"source": "/libs/nx-packages/powerpack-conformance/src",
"root": "/libs/nx-packages/conformance",
"source": "/libs/nx-packages/conformance/src",
"executors": {
"/nx-api/powerpack-conformance/executors/bundle-rules": {
"/nx-api/conformance/executors/bundle-rules": {
"description": "Compile and bundle one or more Nx Conformance Rules",
"file": "external-generated/packages/powerpack-conformance/executors/bundle-rules.json",
"file": "external-generated/packages/conformance/executors/bundle-rules.json",
"hidden": false,
"name": "bundle-rules",
"originalFilePath": "/libs/nx-packages/powerpack-conformance/src/executors/bundle-rules/schema.json",
"path": "/nx-api/powerpack-conformance/executors/bundle-rules",
"originalFilePath": "/libs/nx-packages/conformance/src/executors/bundle-rules/schema.json",
"path": "/nx-api/conformance/executors/bundle-rules",
"type": "executor"
}
},
"generators": {
"/nx-api/powerpack-conformance/generators/create-rule": {
"/nx-api/conformance/generators/create-rule": {
"description": "Create a new conformance rule",
"file": "external-generated/packages/powerpack-conformance/generators/create-rule.json",
"file": "external-generated/packages/conformance/generators/create-rule.json",
"hidden": false,
"name": "create-rule",
"originalFilePath": "/libs/nx-packages/powerpack-conformance/src/generators/create-rule/schema.json",
"path": "/nx-api/powerpack-conformance/generators/create-rule",
"originalFilePath": "/libs/nx-packages/conformance/src/generators/create-rule/schema.json",
"path": "/nx-api/conformance/generators/create-rule",
"type": "generator"
}
},
"migrations": {},
"path": "/nx-api/powerpack-conformance"
"path": "/nx-api/conformance"
},
"powerpack-enterprise-cloud": {
"owners": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "powerpack-enterprise-cloud",
"packageName": "@nx/powerpack-enterprise-cloud",
"description": "A Nx Powerpack plugin which is specific to Nx Enterprise Cloud workspaces.",
"documents": {},
"root": "/libs/nx-packages/powerpack-enterprise-cloud",
"source": "/libs/nx-packages/powerpack-enterprise-cloud/src",
"executors": {},
"generators": {
"/nx-api/powerpack-enterprise-cloud/generators/init": {
"description": "Initialize Nx Powerpack Enterprise Cloud config",
"file": "external-generated/packages/powerpack-enterprise-cloud/generators/init.json",
"hidden": false,
"name": "init",
"originalFilePath": "/libs/nx-packages/powerpack-enterprise-cloud/src/generators/init/schema.json",
"path": "/nx-api/powerpack-enterprise-cloud/generators/init",
"type": "generator"
}
},
"migrations": {},
"path": "/nx-api/powerpack-enterprise-cloud"
},
"powerpack-gcs-cache": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "powerpack-gcs-cache",
"packageName": "@nx/powerpack-gcs-cache",
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Google Cloud Storage.",
"name": "owners",
"packageName": "@nx/owners",
"description": "A Nx plugin which provides the ability to configure and maintain codeowners for projects in Nx workspaces.",
"documents": {
"/nx-api/powerpack-gcs-cache/documents/overview": {
"/nx-api/owners/documents/overview": {
"id": "overview",
"name": "Overview",
"description": "A Nx Powerpack plugin which provides a Nx cache which can be self hosted on Google Cloud Storage.",
"file": "external-generated/packages/powerpack-gcs-cache/documents/overview",
"description": "A Nx plugin which provides the ability to configure and maintain codeowners for projects in Nx workspaces.",
"file": "external-generated/packages/owners/documents/overview",
"itemList": [],
"isExternal": false,
"path": "/nx-api/powerpack-gcs-cache/documents/overview",
"path": "/nx-api/owners/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-gcs-cache/powerpack-gcs-cache-plugin"
"originalFilePath": "shared/packages/owners/owners-plugin"
}
},
"root": "/libs/nx-packages/powerpack-gcs-cache",
"source": "/libs/nx-packages/powerpack-gcs-cache/src",
"executors": {},
"generators": {},
"migrations": {},
"path": "/nx-api/powerpack-gcs-cache"
},
"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": {},
"migrations": {},
"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",
"root": "/libs/nx-packages/owners",
"source": "/libs/nx-packages/owners/src",
"executors": {},
"generators": {
"/nx-api/powerpack-owners/generators/init": {
"/nx-api/owners/generators/init": {
"description": "Initialize Nx Powerpack Owners config",
"file": "external-generated/packages/powerpack-owners/generators/init.json",
"file": "external-generated/packages/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",
"originalFilePath": "/libs/nx-packages/owners/src/generators/init/schema.json",
"path": "/nx-api/owners/generators/init",
"type": "generator"
},
"/nx-api/powerpack-owners/generators/sync-codeowners-file": {
"/nx-api/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",
"file": "external-generated/packages/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",
"originalFilePath": "/libs/nx-packages/owners/src/generators/sync-codeowners-file/schema.json",
"path": "/nx-api/owners/generators/sync-codeowners-file",
"type": "generator"
}
},
"migrations": {},
"path": "/nx-api/powerpack-owners"
"path": "/nx-api/owners"
},
"powerpack-s3-cache": {
"gcs-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.",
"name": "gcs-cache",
"packageName": "@nx/gcs-cache",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Google Cloud Storage.",
"documents": {
"/nx-api/powerpack-s3-cache/documents/overview": {
"/nx-api/gcs-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",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Google Cloud Storage.",
"file": "external-generated/packages/gcs-cache/documents/overview",
"itemList": [],
"isExternal": false,
"path": "/nx-api/powerpack-s3-cache/documents/overview",
"path": "/nx-api/gcs-cache/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-s3-cache/powerpack-s3-cache-plugin"
"originalFilePath": "shared/packages/gcs-cache/gcs-cache-plugin"
}
},
"root": "/libs/nx-packages/powerpack-s3-cache",
"source": "/libs/nx-packages/powerpack-s3-cache/src",
"root": "/libs/nx-packages/gcs-cache",
"source": "/libs/nx-packages/gcs-cache/src",
"executors": {},
"generators": {},
"migrations": {},
"path": "/nx-api/powerpack-s3-cache"
"path": "/nx-api/gcs-cache"
},
"powerpack-shared-fs-cache": {
"s3-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",
"name": "s3-cache",
"packageName": "@nx/s3-cache",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Amazon S3.",
"documents": {
"/nx-api/powerpack-shared-fs-cache/documents/overview": {
"/nx-api/s3-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",
"description": "A Nx plugin which provides a Nx cache which can be self hosted on Amazon S3.",
"file": "external-generated/packages/s3-cache/documents/overview",
"itemList": [],
"isExternal": false,
"path": "/nx-api/powerpack-shared-fs-cache/documents/overview",
"path": "/nx-api/s3-cache/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/powerpack-shared-fs-cache/powerpack-shared-fs-cache-plugin"
"originalFilePath": "shared/packages/s3-cache/s3-cache-plugin"
}
},
"root": "/libs/nx-packages/powerpack-shared-fs-cache",
"source": "/libs/nx-packages/powerpack-shared-fs-cache/src",
"root": "/libs/nx-packages/s3-cache",
"source": "/libs/nx-packages/s3-cache/src",
"executors": {},
"generators": {},
"migrations": {},
"path": "/nx-api/s3-cache"
},
"shared-fs-cache": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "shared-fs-cache",
"packageName": "@nx/shared-fs-cache",
"description": "A Nx plugin to enable you to use a shared file system directory",
"documents": {
"/nx-api/shared-fs-cache/documents/overview": {
"id": "overview",
"name": "Overview",
"description": "A Nx plugin to enable you to use a shared file system directory",
"file": "external-generated/packages/shared-fs-cache/documents/overview",
"itemList": [],
"isExternal": false,
"path": "/nx-api/shared-fs-cache/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/shared-fs-cache/shared-fs-cache-plugin"
}
},
"root": "/libs/nx-packages/shared-fs-cache",
"source": "/libs/nx-packages/shared-fs-cache/src",
"executors": {},
"generators": {
"/nx-api/powerpack-shared-fs-cache/generators/init": {
"/nx-api/shared-fs-cache/generators/init": {
"description": "Add the shared fs cache",
"file": "external-generated/packages/powerpack-shared-fs-cache/generators/init.json",
"file": "external-generated/packages/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",
"originalFilePath": "/libs/nx-packages/shared-fs-cache/src/generators/init/schema.json",
"path": "/nx-api/shared-fs-cache/generators/init",
"type": "generator"
}
},
"migrations": {},
"path": "/nx-api/powerpack-shared-fs-cache"
"path": "/nx-api/shared-fs-cache"
}
}

View File

@ -1591,6 +1591,17 @@
"isExternal": false,
"path": "/recipes/running-tasks/convert-to-inferred",
"tags": ["inferred-tasks", "automate-updating-dependencies"]
},
{
"id": "self-hosted-caching",
"name": "Self-Host the Remote Cache",
"description": "Host the remote cache without using Nx Cloud",
"mediaImage": "",
"file": "shared/recipes/running-tasks/self-hosted-caching",
"itemList": [],
"isExternal": false,
"path": "/recipes/running-tasks/self-hosted-caching",
"tags": ["self-hosted-caching"]
}
],
"isExternal": false,
@ -3045,6 +3056,17 @@
"isExternal": false,
"path": "/recipes/running-tasks/convert-to-inferred",
"tags": ["inferred-tasks", "automate-updating-dependencies"]
},
{
"id": "self-hosted-caching",
"name": "Self-Host the Remote Cache",
"description": "Host the remote cache without using Nx Cloud",
"mediaImage": "",
"file": "shared/recipes/running-tasks/self-hosted-caching",
"itemList": [],
"isExternal": false,
"path": "/recipes/running-tasks/self-hosted-caching",
"tags": ["self-hosted-caching"]
}
],
"isExternal": false,
@ -3183,6 +3205,17 @@
"path": "/recipes/running-tasks/convert-to-inferred",
"tags": ["inferred-tasks", "automate-updating-dependencies"]
},
"/recipes/running-tasks/self-hosted-caching": {
"id": "self-hosted-caching",
"name": "Self-Host the Remote Cache",
"description": "Host the remote cache without using Nx Cloud",
"mediaImage": "",
"file": "shared/recipes/running-tasks/self-hosted-caching",
"itemList": [],
"isExternal": false,
"path": "/recipes/running-tasks/self-hosted-caching",
"tags": ["self-hosted-caching"]
},
"/recipes/adopting-nx": {
"id": "adopting-nx",
"name": "Adopting Nx",
@ -5582,14 +5615,14 @@
"file": "shared/features/powerpack/index",
"itemList": [
{
"id": "free-licenses-and-trials",
"id": "licenses-and-trials",
"name": "Free Licenses & Trials",
"description": "",
"mediaImage": "",
"file": "shared/features/powerpack/free-licenses-and-trials",
"file": "shared/features/powerpack/licenses-and-trials",
"itemList": [],
"isExternal": false,
"path": "/nx-enterprise/powerpack/free-licenses-and-trials",
"path": "/nx-enterprise/powerpack/licenses-and-trials",
"tags": []
},
{
@ -5613,17 +5646,6 @@
"isExternal": false,
"path": "/nx-enterprise/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": "/nx-enterprise/powerpack/custom-caching",
"tags": ["custom-caching"]
}
],
"isExternal": false,
@ -5654,14 +5676,14 @@
"file": "shared/features/powerpack/index",
"itemList": [
{
"id": "free-licenses-and-trials",
"id": "licenses-and-trials",
"name": "Free Licenses & Trials",
"description": "",
"mediaImage": "",
"file": "shared/features/powerpack/free-licenses-and-trials",
"file": "shared/features/powerpack/licenses-and-trials",
"itemList": [],
"isExternal": false,
"path": "/nx-enterprise/powerpack/free-licenses-and-trials",
"path": "/nx-enterprise/powerpack/licenses-and-trials",
"tags": []
},
{
@ -5685,32 +5707,21 @@
"isExternal": false,
"path": "/nx-enterprise/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": "/nx-enterprise/powerpack/custom-caching",
"tags": ["custom-caching"]
}
],
"isExternal": false,
"path": "/nx-enterprise/powerpack",
"tags": []
},
"/nx-enterprise/powerpack/free-licenses-and-trials": {
"id": "free-licenses-and-trials",
"/nx-enterprise/powerpack/licenses-and-trials": {
"id": "licenses-and-trials",
"name": "Free Licenses & Trials",
"description": "",
"mediaImage": "",
"file": "shared/features/powerpack/free-licenses-and-trials",
"file": "shared/features/powerpack/licenses-and-trials",
"itemList": [],
"isExternal": false,
"path": "/nx-enterprise/powerpack/free-licenses-and-trials",
"path": "/nx-enterprise/powerpack/licenses-and-trials",
"tags": []
},
"/nx-enterprise/powerpack/conformance": {
@ -5735,17 +5746,6 @@
"path": "/nx-enterprise/powerpack/owners",
"tags": ["owners"]
},
"/nx-enterprise/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": "/nx-enterprise/powerpack/custom-caching",
"tags": ["custom-caching"]
},
"/showcase": {
"id": "showcase",
"name": "Showcase",

View File

@ -988,6 +988,15 @@
"path": "/nx-api/nx/documents/watch"
}
],
"self-hosted-caching": [
{
"description": "Host the remote cache without using Nx Cloud",
"file": "shared/recipes/running-tasks/self-hosted-caching",
"id": "self-hosted-caching",
"name": "Self-Host the Remote Cache",
"path": "/recipes/running-tasks/self-hosted-caching"
}
],
"init": [
{
"description": "",
@ -1356,15 +1365,6 @@
"path": "/nx-enterprise/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": "/nx-enterprise/powerpack/custom-caching"
}
],
"database": [
{
"description": "",
@ -1441,6 +1441,15 @@
"path": "/nx-api/nx/documents/connect-to-nx-cloud"
}
],
"running-tasks": [
{
"description": "",
"file": "shared/recipes/plugins/task-running-lifecycle",
"id": "task-running-lifecycle",
"name": "Hook into the Task Running Lifecycle",
"path": "/extending-nx/recipes/task-running-lifecycle"
}
],
"remote-cache": [
{
"description": "Learn how to enable remote caching s.t. you don't just benefit locally from it but also in CI.",

View File

@ -442,6 +442,13 @@
"id": "convert-to-inferred",
"tags": ["inferred-tasks", "automate-updating-dependencies"],
"file": "shared/recipes/running-tasks/convert-to-inferred"
},
{
"name": "Self-Host the Remote Cache",
"description": "Host the remote cache without using Nx Cloud",
"id": "self-hosted-caching",
"tags": ["self-hosted-caching"],
"file": "shared/recipes/running-tasks/self-hosted-caching"
}
]
},
@ -1146,8 +1153,8 @@
"itemList": [
{
"name": "Free Licenses & Trials",
"id": "free-licenses-and-trials",
"file": "shared/features/powerpack/free-licenses-and-trials"
"id": "licenses-and-trials",
"file": "shared/features/powerpack/licenses-and-trials"
},
{
"name": "Run Language-Agnostic Conformance Rules",
@ -1162,13 +1169,6 @@
"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"
}
]
}
@ -1685,6 +1685,12 @@
"id": "publish-plugin",
"tags": ["create-your-own-plugin"],
"file": "shared/recipes/plugins/publish-plugin"
},
{
"name": "Hook into the Task Running Lifecycle",
"id": "task-running-lifecycle",
"tags": ["running-tasks"],
"file": "shared/recipes/plugins/task-running-lifecycle"
}
]
}
@ -2732,86 +2738,86 @@
]
},
{
"name": "powerpack-owners",
"id": "powerpack-owners",
"name": "owners",
"id": "owners",
"description": "powerpack-owners package.",
"itemList": [
{
"name": "Overview",
"id": "overview",
"path": "/nx-api/powerpack-owners",
"file": "shared/packages/powerpack-owners/powerpack-owners-plugin"
"path": "/nx-api/owners",
"file": "shared/packages/owners/owners-plugin"
}
]
},
{
"name": "powerpack-conformance",
"id": "powerpack-conformance",
"name": "conformance",
"id": "conformance",
"description": "powerpack-conformance package.",
"itemList": [
{
"name": "Overview",
"id": "overview",
"path": "/nx-api/powerpack-conformance",
"file": "shared/packages/powerpack-conformance/powerpack-conformance-plugin"
"path": "/nx-api/conformance",
"file": "shared/packages/conformance/conformance-plugin"
},
{
"name": "Create a Conformance Rule",
"id": "create-conformance-rule",
"path": "/nx-api/powerpack-conformance",
"file": "shared/packages/powerpack-conformance/create-conformance-rule"
"path": "/nx-api/conformance",
"file": "shared/packages/conformance/create-conformance-rule"
}
]
},
{
"name": "powerpack-azure-cache",
"id": "powerpack-azure-cache",
"name": "azure-cache",
"id": "azure-cache",
"description": "powerpack-azure-cache package.",
"itemList": [
{
"name": "Overview",
"id": "overview",
"path": "/nx-api/powerpack-azure-cache",
"file": "shared/packages/powerpack-azure-cache/powerpack-azure-cache-plugin"
"path": "/nx-api/azure-cache",
"file": "shared/packages/azure-cache/azure-cache-plugin"
}
]
},
{
"name": "powerpack-gcs-cache",
"id": "powerpack-gcs-cache",
"name": "gcs-cache",
"id": "gcs-cache",
"description": "powerpack-gcs-cache package.",
"itemList": [
{
"name": "Overview",
"id": "overview",
"path": "/nx-api/powerpack-gcs-cache",
"file": "shared/packages/powerpack-gcs-cache/powerpack-gcs-cache-plugin"
"path": "/nx-api/gcs-cache",
"file": "shared/packages/gcs-cache/gcs-cache-plugin"
}
]
},
{
"name": "powerpack-s3-cache",
"id": "powerpack-s3-cache",
"name": "s3-cache",
"id": "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"
"path": "/nx-api/s3-cache",
"file": "shared/packages/s3-cache/s3-cache-plugin"
}
]
},
{
"name": "powerpack-shared-fs-cache",
"id": "powerpack-shared-fs-cache",
"name": "shared-fs-cache",
"id": "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"
"path": "/nx-api/shared-fs-cache",
"file": "shared/packages/shared-fs-cache/shared-fs-cache-plugin"
}
]
},

View File

@ -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). If you want share your local cache anyway, you can [activate Nx Powerpack](/nx-enterprise/activate-powerpack) and use the [`@nx/powerpack-shared-fs-cache`](/nx-api/powerpack-shared-fs-cache) plugin.
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](/nx-enterprise/activate-powerpack) and use the [`@nx/shared-fs-cache`](/nx-api/shared-fs-cache) plugin.
### Configure End to End Encryption

View File

@ -8,17 +8,17 @@ Let's create a custom rule which we can then publish to Nx Cloud. We will first
nx generate @nx/js:library cloud-conformance-rules
```
The Nx Cloud distribution mechanism expects each rule to be created in a named subdirectory in the `src/` directory of our new project, and each rule directory to contain an `index.ts` and a `schema.json` file. You can read more about [creating a conformance rule](/nx-api/powerpack-conformance/documents/create-conformance-rule) in the dedicated guide. For this recipe, we'll generate a default rule to use in the publishing process.
The Nx Cloud distribution mechanism expects each rule to be created in a named subdirectory in the `src/` directory of our new project, and each rule directory to contain an `index.ts` and a `schema.json` file. You can read more about [creating a conformance rule](/nx-api/conformance/documents/create-conformance-rule) in the dedicated guide. For this recipe, we'll generate a default rule to use in the publishing process.
```shell
nx g @nx/powerpack-conformance:create-rule --name=test-cloud-rule --directory=cloud-conformance-rules/src --category=reliability --description="A test cloud rule" --reporter=non-project-files-reporter
nx g @nx/conformance:create-rule --name=test-cloud-rule --directory=cloud-conformance-rules/src --category=reliability --description="A test cloud rule" --reporter=non-project-files-reporter
```
{% callout type="warning" title="Adding the @nx/powerpack-conformance plugin" %}
If you get an error resolving the `@nx/powerpack-conformance` plugin, you may need to add it. You can do this by running `nx add @nx/powerpack-conformance` in your workspace.
{% callout type="warning" title="Adding the @nx/conformance plugin" %}
If you get an error resolving the `@nx/conformance` plugin, you may need to add it. You can do this by running `nx add @nx/conformance` in your workspace.
{% /callout %}
We now have a valid implementation of a rule and we are ready to build it and publish it to Nx Cloud. The [`@nx/powerpack-conformance` plugin](/nx-api/powerpack-conformance) provides a [dedicated executor called `bundle-rules`](/nx-api/powerpack-conformance/executors/bundle-rules) for creating appropriate build artifacts for this purpose. We will replace the existing build target and wire up that executor in our `cloud-conformance-rules` project's `project.json` file:
We now have a valid implementation of a rule and we are ready to build it and publish it to Nx Cloud. The [`@nx/conformance` plugin](/nx-api/conformance) provides a [dedicated executor called `bundle-rules`](/nx-api/conformance/executors/bundle-rules) for creating appropriate build artifacts for this purpose. We will replace the existing build target and wire up that executor in our `cloud-conformance-rules` project's `project.json` file:
```jsonc {% fileName="cloud-conformance-rules/project.json" %}
{
@ -27,7 +27,7 @@ We now have a valid implementation of a rule and we are ready to build it and pu
// ...any other existing targets
// new build target:
"build": {
"executor": "@nx/powerpack-conformance:bundle-rules",
"executor": "@nx/conformance:bundle-rules",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/dist"
@ -58,7 +58,7 @@ Because publishing the rules is a relatively common operation, you can also wire
// ...any existing project.json content
"targets": {
"build": {
"executor": "@nx/powerpack-conformance:bundle-rules",
"executor": "@nx/conformance:bundle-rules",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/dist"

View File

@ -5,13 +5,70 @@ description: 'Learn about the transition from Custom Tasks Runner to the new plu
# Deprecating Custom Tasks Runner
The Nx core has been migrated to Rust. However, the Custom Tasks Runner API is not compatible with this rewrite because it allows modifications to the lifecycle of the Nx command execution, which could break important invariants that Nx depends on.
The Custom Task Runners API was created many years ago and has not been supported for several years. It was developed before we introduced a formal method for extending Nx through [plugins](/extending-nx/intro/getting-started). The API potentially allows modifications to the lifecycle of the Nx command execution, which breaks important invariants that Nx depends on. The new API leverages the plugins API for better performance and functionality.
The custom task runners API was created many years ago and has not been supported for several years. It was developed before we introduced a formal method for extending Nx through plugins. The new API leverages the plugins API for better performance and functionality.
This page guides you on how to migrate off the now deprecated Custom Task Runner API for both:
- achieving self-hosted remote caching
- implementing pre/post processing logic when running tasks
## Self-Hosted Remote Cache
Nx offers different ways to enable self-hosted remote caching for your workspace that can be used starting with Nx version 19.8 and higher. You can either use our official Nx packages that come with ready-to-use adapters for AWS S3, GCP, Azure and more, or build your own cache server by following the Nx Remote Caching OpenAPI spec.
Read more in our [documentation](/recipes/running-tasks/self-hosted-caching).
### Migrating from `@nx-aws-plugin`
If you've been using the `@nx-aws-plugin/nx-aws-cache` community plugin, you should be easily able to migrate to the free [Nx S3 cache plugin](/nx-api/s3-cache). The specific modification depends on your repository's configuration.
The following is one example, where a custom tasks runner configuration in `nx.json` will be removed:
```json
{
"tasksRunnerOptions": {
"default": {
"runner": "@nx-aws-plugin/nx-aws-cache",
"options": {
"awsAccessKeyId": "key",
"awsSecretAccessKey": "secret",
"awsForcePathStyle": true,
"awsEndpoint": "http://custom",
"awsBucket": "my-bucket",
"awsRegion": "eu-central-1",
"encryptionFileKey": "key"
}
}
}
}
```
And replaced with:
```json
{
"s3": {
"accessKeyId": "key",
"secretAccessKey": "secret",
"forcePathStyle": true,
"endpoint": "http://custom",
"bucket": "my-bucket",
"region": "eu-central-1",
"encryptionFileKey": "key",
"localMode": "read-write"
}
}
```
The [API documentation](/recipes/running-tasks/self-hosted-caching#official-nx-selfhosted-cache-packages) for each plugin describes the available options.
## The preTasksExecution and postTasksExecution hooks
### Custom Tasks Runner Version
Starting with Nx 20.4, a dedicated plugin-based API has been introduced that allows you to safely hook into the task running lifecycle. This new approach provides pre and post execution hooks without compromising Nx's internal operations. For comprehensive documentation on this feature, see [Hook into the Task Running Lifecycle](/extending-nx/recipes/task-running-lifecycle).
Let's look into some concrete examples of how you can migrate from the previous custom task runners to this new API.
### Before: Custom Tasks Runner Version
Let's imagine that you have implemented a custom task runner as follows:
@ -72,7 +129,7 @@ And let's imagine you configured it in `nx.json` as follows:
}
```
### New API
### After: Using the New API
The new API includes `preTasksExecution` and `postTasksExecution` hooks that plugins can register. These hooks do not affect task execution and cannot violate any invariants.
@ -178,7 +235,7 @@ You can then choose which hooks to use by setting the RUNNER env variable.
### Passing Options
You can no longer augment options passed in to the default tasks runner, so instead you need to set env variables in the `preTasksExecution` hook.
You can no longer augment options passed to the default tasks runner, so instead you need to set env variables in the `preTasksExecution` hook.
### Composing Plugins
@ -188,56 +245,6 @@ Implementing hooks in plugins offers several advantages. It allows multiple plug
By default, every plugin initiates a long-running process, allowing you to maintain state across command invocations, which can be very useful for advanced analytics.
## Self-Hosted Remote Cache
The `preTasksExecution` and `postTasksExecution` hooks cannot modify the execution of tasks, making it impossible to use them for implementing a remote cache. Instead, you should [install and activate one of the Nx Powerpack packages](/nx-enterprise/activate-powerpack). Nx Powerpack does not make requests to external APIs, nor does it collect or send any data. **Additionally, it offers more security and prevents cache poisoning, unlike DIY solutions.**
We recognize that many organizations have been using DIY remote cache solutions. Therefore, we have made the migration to Nx Powerpack as streamlined as possible.
{% call-to-action title="Get a License and Activate Powerpack" icon="nx" description="Unlock all the features of the Nx CLI" url="/nx-enterprise/activate-powerpack" /%}
### Example Configuration Change
Enabling a Nx Powerpack plugin will configure it in `nx.json`. The specific modification depends on your repository's configuration. The following is one example, where a custom tasks runner configuration in `nx.json` will be removed:
```json
{
"tasksRunnerOptions": {
"default": {
"runner": "@nx-aws-plugin/nx-aws-cache",
"options": {
"awsAccessKeyId": "key",
"awsSecretAccessKey": "secret",
"awsForcePathStyle": true,
"awsEndpoint": "http://custom",
"awsBucket": "my-bucket",
"awsRegion": "eu-central-1",
"encryptionFileKey": "key"
}
}
}
}
```
And replaced with:
```json
{
"s3": {
"accessKeyId": "key",
"secretAccessKey": "secret",
"forcePathStyle": true,
"endpoint": "http://custom",
"bucket": "my-bucket",
"region": "eu-central-1",
"encryptionFileKey": "key",
"localMode": "read-write"
}
}
```
The API documentation for each plugin describes the available options.
## Unhandled Custom Tasks Runner Use Cases?
If you have a use case that the new API doesn't handle, please [open an issue](http://github.com/nrwl/nx).

View File

@ -22,7 +22,7 @@ If you are using a custom tasks runner to customize your cache, you have the fol
Use [Nx Cloud](/nx-cloud) for your remote cache. This is the safest, lowest-maintenance, most recommended option.
If you cannot use Nx Cloud, consider an [Nx Powerpack](/powerpack) plugin for caching: [Amazon S3](/nx-api/powerpack-s3-cache), [Google Cloud](/nx-api/powerpack-gcs-cache), [Azure](/nx-api/powerpack-azure-cache) or a [shared network drive](/nx-api/powerpack-shared-fs-cache). If there is no Powerpack plugin that supports the service where you want to store the remote cache, [file an issue](https://github.com/nrwl/nx/issues/new).
If you cannot use Nx Cloud, consider an [Nx Powerpack](/powerpack) plugin for caching: [Amazon S3](/nx-api/s3-cache), [Google Cloud](/nx-api/gcs-cache), [Azure](/nx-api/azure-cache) or a [shared network drive](/nx-api/shared-fs-cache). If there is no Powerpack plugin that supports the service where you want to store the remote cache, [file an issue](https://github.com/nrwl/nx/issues/new).
**To learn more about migrating from custom task runners, [please refer to this detailed guide](/deprecated/custom-tasks-runner).**
@ -33,5 +33,5 @@ The `NX_REJECT_UNKNOWN_LOCAL_CACHE` environment variable does not work with the
If you are using `NX_REJECT_UNKNOWN_LOCAL_CACHE` to share your local cache on a network drive, you have a few options moving forward:
1. Use [Nx Cloud](/nx-cloud) for your remote cache. This is the safest, lowest-maintenance, most recommended option
2. Use the [Nx Powerpack Shared Fs Cache](/nx-api/powerpack-shared-fs-cache) which recognizes artifacts from other machines
3. Use another [Nx Powerpack](/powerpack) plugin for caching on a cloud provider: [Amazon S3](/nx-api/powerpack-s3-cache), [Google Cloud](/nx-api/powerpack-gcs-cache), or [Azure](/nx-api/powerpack-azure-cache)
2. Use the [Nx Powerpack Shared Fs Cache](/nx-api/shared-fs-cache) which recognizes artifacts from other machines
3. Use another [Nx Powerpack](/powerpack) plugin for caching on a cloud provider: [Amazon S3](/nx-api/s3-cache), [Google Cloud](/nx-api/gcs-cache), or [Azure](/nx-api/azure-cache)

View File

@ -63,13 +63,17 @@ the result of the test run.
## Enable Remote Caching
By default, Nx caches task results locally. The biggest benefit of caching comes from using remote caching in CI, where you can **share the cache between different runs**. To enable remote caching, connect your workspace to [Nx Cloud](/nx-cloud) by running the following command:
By default, Nx caches task results locally. The biggest benefit of caching comes from using remote caching in CI, where you can **share the cache between different runs**. Nx comes with a managed remote caching solution built on top of Nx Cloud.
To enable remote caching, connect your workspace to [Nx Cloud](/nx-cloud) by running the following command:
```shell
npx nx connect
```
Learn more about [remote caching](/ci/features/remote-cache).
Learn more about [remote caching with Nx Cloud](/ci/features/remote-cache).
You can also **self-host your remote cache** with one of the official Nx packages or build your own remote caching server implementation. [Learn more here.](/recipes/running-tasks/self-hosted-caching)
## Fine-tune Caching with Inputs and Outputs

View File

@ -7,35 +7,35 @@ description: 'Learn how to use Nx Powerpack conformance rules to enforce organiz
{% 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 [`@nx/conformance`](/nx-api/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)
- **Ensure Owners**: Require every project to have an owner defined for the [`@nx/owners` plugin](/nx-api/owners)
## Setup
The `@nx/powerpack-conformance` plugin requires an Nx Powerpack license to function. [Activating Powerpack](/nx-enterprise/activate-powerpack) is a simple process.
The `@nx/conformance` plugin requires an Nx Powerpack license to function. [Activating Powerpack](/nx-enterprise/activate-powerpack) is a simple process.
{% call-to-action title="Get a License and Activate Powerpack" icon="nx" description="Unlock all the features of the Nx CLI" url="/nx-enterprise/activate-powerpack" /%}
Then, add the Conformance plugin to your workspace.
{% link-card title="Conformance" type="Nx Plugin" url="/nx-api/powerpack-conformance" icon="CheckBadgeIcon" /%}
{% link-card title="Conformance" type="Nx Plugin" url="/nx-api/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.
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/conformance#custom-conformance-rules). See the [plugin documentation](/nx-api/conformance) for more details.
```jsonc {% fileName="nx.json" %}
{
"conformance": {
"rules": [
{
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
"rule": "@nx/conformance/enforce-project-boundaries",
"options": {
"depConstraints": [
{
@ -46,7 +46,7 @@ Conformance rules are configured in the `conformance` property of the `nx.json`
}
},
{
"rule": "@nx/powerpack-conformance/ensure-owners",
"rule": "@nx/conformance/ensure-owners",
"projects": ["!experimental-app"]
},
{
@ -59,7 +59,7 @@ Conformance rules are configured in the `conformance` property of the `nx.json`
## Enforce Rules with the `nx conformance` and `nx conformance:check` Commands
The `@nx/powerpack-conformance` plugin enables the `nx conformance` and `nx conformance:check` commands which check all the configured rules. The difference is that `nx conformance` will invoke any fix generators on a configured rule automatically, whereas `nx conformance:check` will only check the current workspace state and show any violations.
The `@nx/conformance` plugin enables the `nx conformance` and `nx conformance:check` commands which check all the configured rules. The difference is that `nx conformance` will invoke any fix generators on a configured rule automatically, whereas `nx conformance:check` will only check the current workspace state and show any violations.
Therefore, `nx conformance` is intended to be run locally while working on a feature branch. `nx conformance:check` should be added to the beginning of your CI process so that the conformance rules are enforced for every PR.

View File

@ -1,47 +0,0 @@
---
title: 'Self-Host the Remote Cache'
description: 'Learn how to use Nx Powerpack plugins to self-host your remote cache on Amazon S3, Google Cloud Storage, Azure, or a shared network drive.'
---
# 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 self-hosted on an Amazon S3 bucket
3. [@nx/powerpack-gcs-cache](/nx-api/powerpack-gcs-cache): Cache is self-hosted on Google Cloud storage
4. [@nx/powerpack-azure-cache](/nx-api/powerpack-azure-cache): Cache is self-hosted on Azure
5. [@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.
## Migrating from Custom Tasks Runners
Many people who are interested in Nx Powerpack have previously used custom task runners. Nx offers a new and simpler extension API designed to meet the same use cases as the now-deprecated custom task runners.
To learn more about migrating from custom task runners, [please refer to this detailed guide](/deprecated/custom-tasks-runner).
## Setup
All the self-hosted cache storage plugins require an Nx Powerpack license to function. [Activating Powerpack](/nx-enterprise/activate-powerpack) is a simple process.
{% call-to-action title="Get a License and Activate Powerpack" icon="nx" description="Unlock all the features of the Nx CLI" url="/nx-enterprise/activate-powerpack" /%}
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="AmazonS3Icon" /%}
{% link-card title="Google Cloud Storage Remote Cache" type="Nx Plugin" url="/nx-api/powerpack-gcs-cache" icon="GoogleCloudIcon" /%}
{% link-card title="Azure Remote Cache" type="Nx Plugin" url="/nx-api/powerpack-azure-cache" icon="AzureDevOpsIcon" /%}
{% 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" /%}

View File

@ -1,32 +0,0 @@
---
title: 'Free Licenses and Trials'
description: 'Learn about Nx Powerpack free licenses for small teams and open source projects, as well as trial options and extended evaluation periods.'
---
# Powerpack Free Licenses and Trials
## Free Licenses Enabling Self-Hosted Remote Cache
We value small teams using Nx. That's why we provide a free, remote cache-only license to any company with fewer than 30 engineers using Nx.
All licenses are perpetual, so you can use the latest version of Nx available to you while your license remains active, even after it expires.
[Get Your Free License Immediately](https://cloud.nx.app/powerpack/request/free?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-free-license&utm_content=link&utm_term=self-hosted-remote-cache)
We understand that some organizations may not neatly fit this definition (e.g., a larger organization with a small number of engineers using an Nx workspace). We'd like to unblock you. [Please reach out.](mailto:powerpack-support@nrwl.io)
## OSS License
We offer free, full-featured, Nx Powerpack licences to open source projects. [Apply for a free OSS license](https://docs.google.com/forms/d/e/1FAIpQLSczHgY1NuT1k8paVNO3TcR9cjTfpm6dg1zbG3Ji6zaLURYfcg/viewform).
## Free Trial Licenses
You can get a free, 30-day license immediately if you want to try Nx Powerpack. We're here to support you—whether that means extending your trial or helping with the installation. [Learn more about Nx Powerpack trials.](/assets/powerpack/NxPowerpack-Trial-v1.1.pdf)
[Get Your Trial License Immediately](https://cloud.nx.app/powerpack/request/trial?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-trial&utm_content=link&utm_term=free-trial-license)
If you're having trouble, [reach out for help.](mailto:powerpack-support@nrwl.io)
## Extended Trial Periods
Nx Powerpack does not make any requests to external APIs, and activating Powerpack can be completed in just a few minutes. However, we understand that in many large organizations approval processes can take a long time. We're here to help you. Need a trial extension or help with your business case? [Reach out and we'll help.](mailto:powerpack-support@nrwl.io)

View File

@ -1,6 +1,6 @@
---
title: 'Nx Powerpack Features'
description: 'Explore the enterprise-focused features available in Nx Powerpack, including conformance rules, code ownership management, and self-hosted remote caching solutions.'
description: 'Explore the enterprise-focused features available in Nx Powerpack, including conformance rules and code ownership management.'
---
# Powerpack Features
@ -13,6 +13,11 @@ The following features are available after you [activate a Powerpack license](/n
{% link-card title="Conformance" type="Powerpack Feature" url="/nx-enterprise/powerpack/conformance" icon="CheckBadgeIcon" /%}
{% link-card title="Owners" type="Powerpack Feature" url="/nx-enterprise/powerpack/owners" icon="UserGroupIcon" /%}
{% link-card title="Self-Hosted Remote Cache" type="Powerpack Feature" url="/nx-enterprise/powerpack/custom-caching" icon="ServerIcon" /%}
{% /cards %}
{% callout title="Looking for self-hosted caching?" type="info" %}
Self-hosted caching has previously been part of Powerpack, but no more. It is now free for everyone to use. [Learn more about our self-hosted caching options.](/recipes/running-tasks/self-hosted-caching)
{% /callout %}

View File

@ -0,0 +1,30 @@
---
title: 'Free Licenses and Trials'
description: 'Learn about Nx Powerpack free licenses for small teams and open source projects, as well as trial options and extended evaluation periods.'
---
# Powerpack Free Licenses and Trials
{% callout type="deepdive" title="Looking for self-hosted caching?" %}
Self-hosted caching is now free for everyone. [Read more about remote caching options here](/recipes/running-tasks/self-hosted-caching).
{% /callout %}
## Free Trial Licenses
You can get a free, 30-day license immediately if you want to try Nx Powerpack. We're here to support you—whether that means extending your trial or helping with the installation. [Learn more about Nx Powerpack trials.](/assets/powerpack/NxPowerpack-Trial-v1.1.pdf)
[Get Your Trial License Immediately](https://cloud.nx.app/powerpack/request/trial?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-trial&utm_content=link&utm_term=free-trial-license)
If you're having trouble, [reach out for help.](mailto:powerpack-support@nrwl.io)
## Extended Trial Periods
Nx Powerpack does not make any requests to external APIs, and activating Powerpack can be completed in just a few minutes. However, we understand that in many large organizations, approval processes can take a long time. We're here to help you. Need a trial extension or help with your business case? [Reach out and we'll help.](mailto:powerpack-support@nrwl.io)
## Powerpack for OSS Projects
We offer free, full-featured Nx Powerpack licenses to open source projects. This happens through Nx Cloud (which is free for OSS projects). Just apply [here](/pricing#oss) and in the application form, make sure to confirm the Powerpack question.
If you're primarily looking for remote caching, then Nx Cloud is a great fit as it comes with a fully managed remote cache solution (among other CI features), free for OSS projects.

View File

@ -9,21 +9,21 @@ description: 'Learn how to use Nx Powerpack owners plugin to manage code ownersh
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.
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/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](/nx-enterprise/activate-powerpack) is a simple process.
The `@nx/owners` plugin requires an Nx Powerpack license to function. [Activating Powerpack](/nx-enterprise/activate-powerpack) is a simple process.
{% call-to-action title="Get a License and Activate Powerpack" icon="nx" description="Unlock all the features of the Nx CLI" url="/nx-enterprise/activate-powerpack" /%}
Then, add the Owners plugin to your workspace.
{% link-card title="Owners" type="Nx Plugin" url="/nx-api/powerpack-owners" icon="UserGroupIcon" /%}
{% link-card title="Owners" type="Nx Plugin" url="/nx-api/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.
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/owners) for more details.
{% cards smCols="2" mdCols="2" lgCols="2" %}

View File

@ -76,6 +76,12 @@ Caching access can be restricted in terms of read/write access. You can configur
Nx Replay automatically syncs the remote cache to the local cache folder. As such, if the remote cache is not available, it will automatically fall back to the local cache or just run the task if it is not cached.
### Skipping Cloud Cache
### Can I self-host my remote cache?
If you're an enterprise and have special restrictions, [reach out to us](/enterprise/trial). Our enterprise plan includes various hosting options, from dedicated EU region hosting, to single-tenant and also on-premise.
If you still want to manage and self-host the cache on your own, have a look at [our self-hosting options](/recipes/running-tasks/self-hosted-caching).
### How can I skip Nx Cloud caching?
To learn more about how to temporarily skip task caching, head over to [our corresponding docs page](/recipes/running-tasks/skipping-cache#skip-remote-caching-from-nx-cloud).

View File

@ -73,19 +73,4 @@ allow overwrites.
the cache artifacts created in `main` might be accessible by anyone across any branch, whereas the artifacts created
in your PR could be shared only within your PR runs.
4. **Access Token Traceability:** Nx Cloud keeps a record of the access token used to create a cache artifact. In case
an access token gets compromised it can be easily removed, in turn deleting all the cache artifacts that were created
using it.
Nx Replay is not the only remote cache you can use. You can also use one of the [Powerpack self-hosted remote cache plugins](/nx-enterprise/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](/nx-enterprise/powerpack/custom-caching). These plugins are available as part of the [Nx Powerpack](/powerpack), which you can unlock by [activating your license](/nx-enterprise/activate-powerpack). There are plugins to self-host your remote cache in the following locations:
- [Amazon S3 Bucket](/nx-api/powerpack-s3-cache)
- [Google Cloud Storage](/nx-api/powerpack-gcs-cache)
- [Azure](/nx-api/powerpack-azure-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.
4. **Access Token Traceability:** Nx Cloud keeps a record of the access token used to create a cache artifact. In case an access token gets compromised it can be easily removed, in turn deleting all the cache artifacts that were created using it.

View File

@ -1,31 +1,46 @@
---
title: Overview of the Nx powerpack-azure-cache Plugin
description: The powerpack-azure-cache Nx plugin enables you to use Azure Storage to host your remote cache instead of Nx Cloud
title: Overview of the Nx Azure Cache Plugin
description: The @nx/azure-cache plugin enables you to use Azure Storage to host your remote cache for efficient build caching across your team.
---
The `@nx/powerpack-azure-cache` plugin enables you to use [Azure Storage](https://azure.microsoft.com/en-us/products/storage/blobs) instead of Nx Cloud to host your remote cache.
The `@nx/azure-cache` plugin enables you to self-host your remote cache on [Azure Storage](https://azure.microsoft.com/en-us/products/storage/blobs).
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="deepdive" title="Free managed remote cache with Nx Cloud" %}
Note, you can get started for free with a **fully managed remote caching powered by Nx Cloud**. It comes with a generous Hobby plan that is enough for most small teams. [Learn more here](/nx-cloud).
If you are an enterprise and **data privacy and security is a concern**, [reach out for an Enterprise trial](/enterprise/trial). It is fully SOC 2 type 1 and 2 compliant and comes with single-tenant, dedicated EU region hosting as well as on-premise.
**Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss).
{% callout type="warning" title="Potential Cache Poisoning" %}
Using your own Azure Storage account 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-azure-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 type="info" title="Self-hosted caching is now free" %}
Self-hosted caching is **now free for everyone** to use.
{% /callout %}
## Set Up @nx/powerpack-azure-cache
## Set Up @nx/azure-cache
### 1. Install the Package
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already
2. Install the package
Run the following command:
```shell
nx add @nx/powerpack-azure-cache
nx add @nx/azure-cache
```
This will add the `@nx/azure-cache` NPM package and automatically configure it for your workspace. As part of this process, you'll be guided to **generate a new activation key**. This is a fully automated process to register your plugin.
The key will be saved in your repository (`.nx/key/key.ini`) and should be committed so that every developer has access to it. If your repository is public (or in CI), you can also use an environment variable:
```{% fileName=".env" %}
NX_KEY=YOUR_ACTIVATION_KEY
```
> Why require an activation key? It simply helps us know and support our users. If you prefer not to provide this information, you can also build your own cache server. [Learn more.](/recipes/running-tasks/self-hosted-caching)
### 2. Authenticate with Azure
There are several ways to [authenticate with Azure Storage](https://github.com/Azure/login#login-with-openid-connect-oidc-recommended), but the method recommended by Azure is to use OpenID Connect, like this:
@ -40,7 +55,7 @@ permissions:
jobs:
main:
env:
NX_POWERPACK_LICENSE: ${{ secrets.NX_POWERPACK_LICENSE }}
NX_KEY: ${{ secrets.NX_KEY }}
runs-on: ubuntu-latest
steps:
...
@ -61,7 +76,7 @@ You need to set the `AZURE_CLIENT_ID`, `AZURE_TENANT_ID` and `AZURE_SUBSCRIPTION
Note: Any authentication method that [sets up the `DefaultAzureCredentials`](https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/credential-chains#use-defaultazurecredential-for-flexibility) will enable the plugin to work.
{% callout type="note" title="Custom Azure Endpoint" %}
If you are using a custom Azure endpoint, you will need to authenticate by [setting the `AZURE_STORAGE_CONNECTION_STRING` environment variable](https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string). The `@nx/powerpack-azure-cache` plugin will detect the environment variable and automatically use it to connect to Azure.
If you are using a custom Azure endpoint, you will need to authenticate by [setting the `AZURE_STORAGE_CONNECTION_STRING` environment variable](https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string). The `@nx/azure-cache` plugin will detect the environment variable and automatically use it to connect to Azure.
{% /callout %}
### 3. Configure the Nx Cache to Use Azure Storage
@ -82,6 +97,12 @@ Finally, you need to configure your Nx cache in the `nx.json` file. The `contain
| **container** | The name of the container to use |
| **accountName** | The name of blob storage account |
### Migrating from Custom Tasks Runners
Many people who are interested in Nx Powerpack have previously used custom task runners. Nx offers a new and simpler extension API designed to meet the same use cases as the now-deprecated custom task runners.
To learn more about migrating from custom task runners, [please refer to this detailed guide](/deprecated/custom-tasks-runner).
# Cache Modes
By default, Nx will try to write and read from the remote cache while running locally. This means that permissions must be set for users who are expected to access the remote cache.

View File

@ -3,31 +3,31 @@ 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 `@nx/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)
- [**Ensure Owners**](#ensure-owners): Require every project to have an owner defined for the [`@nx/owners` plugin](/nx-api/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.
In order to use `@nx/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
## Set Up @nx/conformance
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already
2. Install the package
```shell
nx add @nx/powerpack-conformance
nx add @nx/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.
Configure the `@nx/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
@ -64,7 +64,7 @@ Use `npx nx-cloud record --` to capture the logs for `nx conformance` in the Nx
/**
* Relative path to a local rule implementation or node_module path.
*/
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
"rule": "@nx/conformance/enforce-project-boundaries",
/**
* Rule specific configuration options. (Optional)
*/
@ -82,20 +82,20 @@ Use `npx nx-cloud record --` to capture the logs for `nx conformance` in the Nx
## Provided Conformance Rules
The following rules are provided by Nx along with the `@nx/powerpack-conformance` plugin.
The following rules are provided by Nx along with the `@nx/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`
Set the `rule` property to: `@nx/conformance/enforce-project-boundaries`
```json {% fileName="nx.json" %}
{
"conformance": {
"rules": [
{
"rule": "@nx/powerpack-conformance/enforce-project-boundaries",
"rule": "@nx/conformance/enforce-project-boundaries",
"options": {
// Optional
// Can be a boolean or an object with an array of buildTargetNames
@ -150,16 +150,16 @@ a given `source` project the resulting constraints would be **all** that match i
### Ensure Owners
This rule requires every project to have an owner defined for the [`@nx/powerpack-owners` plugin](/nx-api/powerpack-owners)
This rule requires every project to have an owner defined for the [`@nx/owners` plugin](/nx-api/owners)
Set the `rule` property to: `@nx/powerpack-conformance/ensure-owners`
Set the `rule` property to: `@nx/conformance/ensure-owners`
```json {% fileName="nx.json" %}
{
"conformance": {
"rules": [
{
"rule": "@nx/powerpack-conformance/ensure-owners"
"rule": "@nx/conformance/ensure-owners"
}
]
}
@ -170,6 +170,6 @@ Set the `rule` property to: `@nx/powerpack-conformance/ensure-owners`
For more information about the conformance plugin, consult the following articles:
- [Create a Conformance Rule](/nx-api/powerpack-conformance/documents/create-conformance-rule)
- [Create a Conformance Rule](/nx-api/conformance/documents/create-conformance-rule)
- [Publish Conformance Rules to Nx Cloud](/ci/recipes/enterprise/conformance/publish-conformance-rules-to-nx-cloud)
- [Configure Conformance Rules in Nx Cloud](/ci/recipes/enterprise/conformance/configure-conformance-rules-in-nx-cloud)

View File

@ -1,13 +1,18 @@
---
title: Create a Conformance Rule
description: Learn how to create custom conformance rules for Nx Powerpack to enforce standards and best practices across your Nx workspace.
---
# Create a Conformance Rule
For local conformance rules, the resolution utilities from `@nx/js` are used in the same way they are for all other JavaScript/TypeScript files in Nx. Therefore, you can simply reference an adhoc JavaScript file or TypeScript file in your `"rule"` property (as long as the path is resolvable based on your package manager and/or tsconfig setup), and the rule will be loaded/transpiled as needed. The rule implementation file should also have a `schema.json` file next to it that defines the available rule options, if any.
Therefore, in practice, writing your local conformance rules in an Nx generated library is the easiest way to organize them and ensure that they are easily resolvable via TypeScript. The library in question could also be an Nx plugin, but it does not have to be.
To write your own conformance rule, run the `@nx/powerpack-conformance:create-rule` generator and answer the prompts.
To write your own conformance rule, run the `@nx/conformance:create-rule` generator and answer the prompts.
```text {% command="nx g @nx/powerpack-conformance:create-rule" %}
NX Generating @nx/powerpack-conformance:create-rule
```text {% command="nx g @nx/conformance:create-rule" %}
NX Generating @nx/conformance:create-rule
✔ What is the name of the rule? · local-conformance-rule-example
✔ Which directory do you want to create the rule directory in? · packages/my-plugin/local-conformance-rule
@ -21,10 +26,7 @@ CREATE packages/my-plugin/local-conformance-rule/local-conformance-rule-example/
The generated rule definition file should look like this:
```ts {% fileName="packages/my-plugin/local-conformance-rule/index.ts" %}
import {
createConformanceRule,
ProjectViolation,
} from '@nx/powerpack-conformance';
import { createConformanceRule, ProjectViolation } from '@nx/conformance';
export default createConformanceRule({
name: 'local-conformance-rule-example',
@ -71,14 +73,11 @@ There are three types of reporters that a rule can use.
{% tabs %}
{% tab label="project-reporter" %}
The `@nx/powerpack-conformance:ensure-owners` rule provides us an example of how to write a `project-reporter` rule. The `@nx/powerpack-owners` plugin adds an `owners` metadata property to every project node that has an owner in the project graph. This rule checks each project node metadata to make sure that each project has some owner defined.
The `@nx/conformance:ensure-owners` rule provides us an example of how to write a `project-reporter` rule. The `@nx/owners` plugin adds an `owners` metadata property to every project node that has an owner in the project graph. This rule checks each project node metadata to make sure that each project has some owner defined.
```ts
import { ProjectGraphProjectNode } from '@nx/devkit';
import {
createConformanceRule,
ProjectViolation,
} from '@nx/powerpack-conformance';
import { createConformanceRule, ProjectViolation } from '@nx/conformance';
export default createConformanceRule({
name: 'ensure-owners',
@ -116,10 +115,7 @@ export default createConformanceRule({
This rule uses TypeScript AST processing to ensure that `index.ts` files use a client-side style of export syntax and `server.ts` files use a server-side style of export syntax.
```ts
import {
createConformanceRule,
ProjectFilesViolation,
} from '@nx/powerpack-conformance';
import { createConformanceRule, ProjectFilesViolation } from '@nx/conformance';
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import {
@ -259,7 +255,7 @@ import { readJsonFile, workspaceRoot } from '@nx/devkit';
import {
createConformanceRule,
NonProjectFilesViolation,
} from '@nx/powerpack-conformance';
} from '@nx/conformance';
import { join } from 'node:path';
import { satisfies } from 'semver';

View File

@ -0,0 +1,129 @@
---
title: Overview of the Nx GCS Cache Plugin
description: The @nx/gcs-cache plugin enables you to use Google Cloud Storage to host your remote cache for efficient build caching across your team.
---
The `@nx/gcs-cache` plugin enables you to self-host your remote cache on [Google Cloud Storage](https://cloud.google.com/storage).
{% callout type="deepdive" title="Free managed remote cache with Nx Cloud" %}
Note, you can get started for free with a **fully managed remote caching powered by Nx Cloud**. It comes with a generous Hobby plan that is enough for most small teams. [Learn more here](/nx-cloud).
If you are an enterprise and **data privacy and security is a concern**, [reach out for an Enterprise trial](/enterprise/trial). It is fully SOC 2 type 1 and 2 compliant and comes with single-tenant, dedicated EU region hosting as well as on-premise.
**Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss).
{% /callout %}
{% callout type="info" title="Self-hosted caching is now free" %}
Self-hosted caching is **now free for everyone** to use.
{% /callout %}
## Set Up @nx/gcs-cache
### 1. Install the Package
Run the following command:
```shell
nx add @nx/gcs-cache
```
This will add the `@nx/gcs-cache` NPM package and automatically configure it for your workspace. As part of this process, you'll be guided to **generate a new activation key**. This is a fully automated process to register your plugin.
The key will be saved in your repository (`.nx/key/key.ini`) and should be committed so that every developer has access to it. If your repository is public (or in CI), you can also use an environment variable:
```{% fileName=".env" %}
NX_KEY=YOUR_ACTIVATION_KEY
```
> Why require an activation key? It simply helps us know and support our users. If you prefer not to provide this information, you can also build your own cache server. [Learn more.](/recipes/running-tasks/self-hosted-caching)
### 2. Authenticate with Google Cloud
There are several ways to [authenticate with Google Cloud Storage](https://github.com/google-github-actions/setup-gcloud#authorization), but the method recommended by Google is to use Workload Identity Federation, like this:
```yaml {% fileName=".github/workflows/ci.yml" %}
name: CI
...
permissions:
id-token: write
...
jobs:
main:
env:
NX_KEY: ${{ secrets.NX_KEY }}
runs-on: ubuntu-latest
steps:
...
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
token_format: 'access_token'
workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
service_account: 'my-service-account@my-project.iam.gserviceaccount.com'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
...
- run: pnpm exec nx affected -t lint test build
```
Note: Any authentication method that [sets up the Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials) will enable the plugin to work.
### 3. Configure the Nx Cache to Use Google Cloud Storage
Finally, 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" %}
{
"gcs": {
"bucket": "my-bucket"
}
}
```
| **Property** | **Description** |
| ------------ | ----------------------------- |
| **bucket** | The name of the bucket to use |
### Migrating from Custom Tasks Runners
Many people who are interested in Nx Powerpack have previously used custom task runners. Nx offers a new and simpler extension API designed to meet the same use cases as the now-deprecated custom task runners.
To learn more about migrating from custom task runners, [please refer to this detailed guide](/deprecated/custom-tasks-runner).
# Cache Modes
By default, Nx will try to write and read from the remote cache while running locally. This means that permissions must be set for users who are expected to access the remote cache.
Nx will only show warnings when the remote cache is not writable. You can disable these warnings by setting `localMode` to `read-only` or `no-cache` in the `nx.json` file.
```jsonc {% fileName="nx.json" %}
{
"gcs": {
// ...
"localMode": "read-only"
}
}
```
The cache mode in CI can also be configured by setting `ciMode` to `read-only` or `no-cache` in the `nx.json` file. Or by setting `NX_POWERPACK_CACHE_MODE` to `read-only` or `no-cache` in the CI environment.
```jsonc {% fileName="nx.json" %}
{
"gcs": {
// ...
"ciMode": "read-only"
}
}
```

View File

@ -3,35 +3,35 @@ 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/).
The `@nx/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.
In order to use `@nx/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
## Set Up @nx/owners
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already
2. Install the package
```shell
nx add @nx/powerpack-owners
nx add @nx/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.
Configure the `@nx/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:
The `nx add @nx/owners` command should have registered the `@nx/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"]
"globalGenerators": ["@nx/owners:sync-codeowners-file"]
}
}
```

View File

@ -1,35 +0,0 @@
---
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](/nx-enterprise/activate-powerpack) if you haven't already. It only takes a minute.
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.

View File

@ -1,31 +1,47 @@
---
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
title: Overview of the Nx S3 Cache Plugin
description: The @nx/s3-cache plugin enables you to use an Amazon S3 bucket to host your remote cache for efficient build caching across your team.
---
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.
The `@nx/s3-cache` plugin enables you to self-host your remote cache on an [Amazon S3](https://aws.amazon.com/s3) bucket.
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="deepdive" title="Free managed remote cache with Nx Cloud" %}
{% 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).
Note, you can get started for free with a **fully managed remote caching powered by Nx Cloud**. It comes with a generous Hobby plan that is enough for most small teams. [Learn more here](/nx-cloud).
If you are an enterprise and **data privacy and security is a concern**, [reach out for an Enterprise trial](/enterprise/trial). It is fully SOC 2 type 1 and 2 compliant and comes with single-tenant, dedicated EU region hosting as well as on-premise.
**Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss).
{% /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 type="info" title="Self-hosted caching is now free" %}
Self-hosted caching is **now free for everyone** to use.
{% /callout %}
## Set Up @nx/powerpack-s3-cache
## Set Up @nx/s3-cache
### 1. Install the Package
1. [Activate Powerpack](/nx-enterprise/activate-powerpack) if you haven't already
2. Install the package
Run the following command:
```shell
nx add @nx/powerpack-s3-cache
nx add @nx/s3-cache
```
This will add the `@nx/s3-cache` NPM package and automatically configure it for your workspace. As part of this process you'll be guided to **generate a new activation key**. This is a fully automated process to register your plugin.
The key will be saved in your repository (`.nx/key/key.ini`) and should be committed so that every developer has access to it. If your repository is public (or in CI) you can also use an environment variable:
```{% fileName=".env" %}
NX_KEY=YOUR_ACTIVATION_KEY
```
If you didn't get an activation key or skipped that step, you can easily generate one at any time by running `nx register` in your terminal.
> Why require an activation key? It simply helps us know and support our users. If you prefer not to provide this information, you can also build your own cache server. [Learn more.](/recipes/running-tasks/self-hosted-caching)
### 2. Authenticate with AWS
There are four different ways to authenticate with AWS. They will be attempted in this order:
@ -48,7 +64,7 @@ There are four different ways to authenticate with AWS. They will be attempted i
Both the `AWS_ACCESS_KEY_ID` and the `AWS_SECRET_ACCESS_KEY` environment variables are required to use the environment variable authentication method.
Here's an example of using OICD in GitHub Actions to set the environment variables in CI:
Here's an example of using OIDC in GitHub Actions to set the environment variables in CI:
```yaml {% fileName=".github/workflows/ci.yml" %}
name: CI
@ -60,7 +76,7 @@ permissions:
jobs:
main:
env:
NX_POWERPACK_LICENSE: ${{ secrets.NX_POWERPACK_LICENSE }}
NX_KEY: ${{ secrets.NX_KEY }}
runs-on: ubuntu-latest
steps:
...
@ -121,13 +137,13 @@ Regardless of how you manage your AWS authentication, you need to configure your
| **Property** | **Description** |
| ----------------- | --------------------------------------------------------------------------------- |
| **region** | The id of the AWS region to use |
| **region** | The ID of the AWS region to use |
| **bucket** | The name of the S3 bucket to use |
| **encryptionKey** | Nx encryption key used to encrypt and decrypt artifacts from the cache (optional) |
#### S3 Compatible Providers
To use `@nx/powerpack-s3-cache` with S3 compatible providers ([MinIO](https://min.io/product/s3-compatibility), [LocalStack](https://www.localstack.cloud), [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces), [Cloudflare](https://www.cloudflare.com/developer-platform/solutions/s3-compatible-object-storage), etc..), `endpoint` will need to be provided. Some providers also need to have `forcePathStyle` set to true in the configuration.
To use `@nx/s3-cache` with S3 compatible providers ([MinIO](https://min.io/product/s3-compatibility), [LocalStack](https://www.localstack.cloud), [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces), [Cloudflare](https://www.cloudflare.com/developer-platform/solutions/s3-compatible-object-storage), etc.), `endpoint` will need to be provided. Some providers also need to have `forcePathStyle` set to true in the configuration.
Below is an example on how to connect to MinIO:
@ -146,7 +162,7 @@ Below is an example on how to connect to MinIO:
| **Property** | **Description** |
| ------------------- | --------------------------------------------------------------------------------------------------------- |
| **region** | The id of the S3 compatible storage region to use |
| **region** | The ID of the S3 compatible storage region to use |
| **bucket** | The name of the S3 compatible storage bucket to use |
| **forcePathStyle** | Changes the way artifacts are uploaded. Usually used for S3 compatible providers (MinIO, LocalStack, etc) |
| **endpoint** | The custom endpoint to upload artifacts to. If endpoint is not defined, the default AWS endpoint is used |
@ -169,7 +185,7 @@ Nx will only show warnings when the remote cache is not writable. You can disabl
}
```
The cache mode in CI can also be configured by setting `ciMode` to `read-only` or `no-cache` in the `nx.json` file. Or setting `NX_POWERPACK_CACHE_MODE` to `read-only` or `no-cache` in the CI environment.
The cache mode in CI can also be configured by setting `ciMode` to `read-only` or `no-cache` in the `nx.json` file. Or by setting `NX_POWERPACK_CACHE_MODE` to `read-only` or `no-cache` in the CI environment.
```jsonc {% fileName="nx.json" %}
{
@ -180,3 +196,9 @@ The cache mode in CI can also be configured by setting `ciMode` to `read-only` o
}
}
```
### Migrating from Custom Tasks Runners
Many people who are interested in Nx Powerpack have previously used custom task runners. Nx offers a new and simpler extension API designed to meet the same use cases as the now-deprecated custom task runners.
To learn more about migrating from custom task runners, [please refer to this detailed guide](/deprecated/custom-tasks-runner).

View File

@ -0,0 +1,54 @@
---
title: Overview of the Nx Shared File System Cache Plugin
description: The @nx/shared-fs-cache plugin enables you to use a shared file system directory to host your remote cache for efficient build caching across your team.
---
The `@nx/shared-fs-cache` plugin enables you to host your remote cache on a shared file system directory. While you're responsible for implementing the actual directory sharing mechanism, the plugin configures Nx to read from both your local cache and the shared directory.
{% callout type="warning" title="Potential Cache Poisoning" %}
Using a shared file system folder for remote caching introduces the risk of [cache poisoning](/troubleshooting/unknown-local-cache). To mitigate this risk, consider using [Nx Replay](/ci/features/remote-cache) instead.
{% /callout %}
{% callout type="deepdive" title="Free managed remote cache with Nx Cloud" %}
Note, you can get started for free with a **fully managed remote caching powered by Nx Cloud**. It comes with a generous Hobby plan that is enough for most small teams. [Learn more here](/nx-cloud).
If you are an enterprise and **data privacy and security is a concern**, [reach out for an Enterprise trial](/enterprise/trial). It is fully SOC 2 type 1 and 2 compliant and comes with single-tenant, dedicated EU region hosting as well as on-premise.
**Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss).
{% /callout %}
{% callout type="info" title="Self-hosted caching is now free" %}
Self-hosted caching is **now free for everyone** to use.
{% /callout %}
## Set Up @nx/shared-fs-cache
### 1. Install the Package
Run the following command:
```shell
nx add @nx/shared-fs-cache
```
This will add the `@nx/shared-fs-cache` NPM package and automatically configure it for your workspace. As part of this process, you'll be guided to **generate a new activation key**. This is a fully automated process to register your plugin.
The key will be saved in your repository (`.nx/key/key.ini`) and should be committed so that every developer has access to it. If your repository is public (or in CI), you can also use an environment variable:
```{% fileName=".env" %}
NX_KEY=YOUR_ACTIVATION_KEY
```
> Why require an activation key? It simply helps us know and support our users. If you prefer not to provide this information, you can also build your own cache server. [Learn more.](/recipes/running-tasks/self-hosted-caching)
### 2. Configure the Cache Directory
The `@nx/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/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.

View File

@ -1,6 +1,6 @@
---
title: Activate Nx Powerpack
description: Learn how to obtain and register an Nx Powerpack license to unlock enterprise features like conformance rules, code ownership, and custom caching solutions.
description: Learn how to obtain and register an Nx Powerpack license to unlock enterprise features like conformance rules and code ownership.
---
# Activate Powerpack
@ -9,52 +9,56 @@ Nx Powerpack unlocks features of Nx that are particularly useful for larger orga
- [Run language-agnostic conformance rules](/nx-enterprise/powerpack/conformance)
- [Define code ownership at the project level](/nx-enterprise/powerpack/owners)
- [Self-hosted remote cache storage](/nx-enterprise/powerpack/custom-caching)
{% callout type="deepdive" title="Looking for self-hosted caching?" %}
Self-hosted caching is now free for everyone. [Read more about remote caching options here](/recipes/running-tasks/self-hosted-caching).
{% /callout %}
Activating Powerpack is a two-step process.
## Get a License Key
## Step 1: Get an Activation Key
1. Small teams can [immediately get a free Nx Powerpack license for remote cache](https://cloud.nx.app/powerpack/request/free?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-free-license&utm_content=link&utm_term=free-license-for-remote-cache). _[Read more about who qualifies.](/nx-enterprise/powerpack/free-licenses-and-trials)_
2. Open-source projects can [register for a free OSS license](https://forms.gle/mWjQo6Vrv5Kt6WYh9) as well.
3. Larger teams can immediately [get a free trial license](https://cloud.nx.app/powerpack/request/trial?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-trial&utm_content=link&utm_term=free-trial-license-for-larger-teams). _[Read more about how trials work](/nx-enterprise/powerpack/free-licenses-and-trials)._
4. You can also [purchase a license](https://cloud.nx.app/powerpack/purchase?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-purchase&utm_content=link&utm_term=pruchase-license) online.
You can [purchase a license](https://cloud.nx.app/powerpack/purchase?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-purchase&utm_content=link&utm_term=purchase-license) online.
**If you are unsure how to proceed, starting with a trial process is recommended, and we will accommodate your organization's needs.**
If you're an existing Nx Cloud user, you can buy Nx Powerpack on [the Nx Cloud organization settings page](https://cloud.nx.app/go/organization/powerpack). The license will be available automatically.
## Register the License Key
{% callout type="deepdive" title="Need a trial?" %}
If you are unsure how to proceed, starting with a trial process is recommended, and we will accommodate your organization's needs. You can reach out here to [get a free trial license](https://cloud.nx.app/powerpack/request/trial?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-trial&utm_content=link&utm_term=free-trial-license-for-larger-teams) or read more [about how trials work](/nx-enterprise/powerpack/licenses-and-trials).
{% /callout %}
## Step 2: Register the Activation Key
{% tabs %}
{% tab label="Closed Source Repository" %}
To register the license key in your repository, run the `nx activate-powerpack` command.
To register the activation key in your repository, run the `nx register` command.
```shell
nx activate-powerpack YOUR_LICENSE_KEY
nx register YOUR_ACTIVATION_KEY
```
The license will be saved in your repository and should be committed so that every developer has access to the Powerpack features. **Only one developer needs to run this. The rest of the team will gain access to Nx Powerpack features once they pull the changes including the checked-in file.**
The key will be saved in your repository and should be committed so that every developer has access to the Powerpack features. **Only one developer needs to run this. The rest of the team will gain access to Nx Powerpack features once they pull the changes including the checked-in file.**
Another option is to register the license key as an environment variable in CI.
Another option is to use an environment variable in CI.
```{% fileName=".env" %}
NX_POWERPACK_LICENSE=YOUR_LICENSE_KEY
NX_KEY=YOUR_ACTIVATION_KEY
```
**Whether you use the `active-powerpack` command or set the environment variable, Nx Powerpack does not make any requests to external APIs. No data is collected or sent anywhere.**
**Whether you use the `nx register <your-key>` command or set the environment variable, Nx Powerpack does not make any requests to external APIs. No data is collected or sent anywhere.**
{% /tab %}
{% tab label="Open Source Repository" %}
Register the license key as an environment variable that is not committed to the repository.
Use an environment variable for your activation key such that it is not committed to the repository.
```{% fileName=".env" %}
NX_POWERPACK_LICENSE=YOUR_LICENSE_KEY
NX_KEY=YOUR_ACTIVATION_KEY
```
{% /tab %}
{% /tabs %}
### Buying and Registering Nx Powerpack When Using Nx Cloud
Nx Cloud users can buy Nx Powerpack on the organization settings page. The license will be available automatically.

View File

@ -0,0 +1,122 @@
---
title: Hook into the Task Running Lifecycle
description: Learn how to extend Nx's task running process with preTasksExecution and postTasksExecution hooks to implement custom logic before and after tasks run.
---
# Hook into the Task Running Lifecycle
Nx plugins can hook into the task running lifecycle to execute custom logic before and after tasks are run. This is useful for implementing custom analytics, environment validation, or any other pre/post processing that should happen when running tasks.
{% callout type="note" title="New API for deprecated custom task runners" %}
These task execution hooks are the new API that replaces the deprecated Custom Tasks Runners. This feature is available since Nx 20.4+. For information about migrating from Custom Tasks Runners to these hooks, see [Deprecating Custom Tasks Runner](/deprecated/custom-tasks-runner).
{% /callout %}
## Task Execution Hooks
Nx provides two hooks that plugins can register:
1. `preTasksExecution`: Runs before any tasks are executed
2. `postTasksExecution`: Runs after all tasks are executed
These hooks allow you to extend Nx's functionality without affecting task execution or violating any invariants.
## Creating Task Execution Hooks
To implement task execution hooks, create a plugin and export the `preTasksExecution` and/or `postTasksExecution` functions:
```typescript
// Example plugin with both pre and post execution hooks
// context contains workspaceRoot and nx.json configuration
export async function preTasksExecution(options: any, context) {
// Run custom logic before tasks are executed
console.log('About to run tasks!');
// You can modify environment variables
if (process.env.QA_ENV) {
process.env.NX_SKIP_NX_CACHE = 'true';
}
// You can validate the environment
if (!isEnvironmentValid()) {
throw new Error('Environment is not set up correctly');
}
}
// context contains workspaceRoot, nx.json configuration, and task results
export async function postTasksExecution(options: any, context) {
// Run custom logic after tasks are executed
console.log('All tasks have completed!');
// You can access task results for analytics
if (options.reportAnalytics) {
await fetch(process.env.ANALYTICS_API, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(context.taskResults),
});
}
}
function isEnvironmentValid() {
// Implement your validation logic
return true;
}
```
## Configuring Your Plugin
Configure your plugin in `nx.json` by adding it to the `plugins` array:
```json
{
"plugins": [
{
"plugin": "my-nx-plugin",
"options": {
"reportAnalytics": true
}
}
]
}
```
The options you specify in the configuration will be passed to your hook functions.
## Maintaining State Across Command Invocations
By default, every plugin initiates a long-running process, allowing you to maintain state across command invocations. This is particularly useful for gathering advanced analytics or providing cumulative feedback.
## Conditional Execution
You can implement conditional logic in your hooks to control when they run:
```typescript
export async function preTasksExecution(options, context) {
// Only run for specific environments
if (process.env.RUNNER !== 'production') return;
// Your pre-execution logic
}
export async function postTasksExecution(options, context) {
// Only run for specific task types
const hasAngularTasks = Object.keys(context.taskResults).some((taskId) =>
taskId.includes('angular')
);
if (!hasAngularTasks) return;
// Your post-execution logic
}
```
## Best Practices
1. **Keep hooks fast**: Hooks should execute quickly to avoid slowing down the task execution process
2. **Handle errors gracefully**: Ensure your hooks don't crash the entire execution pipeline
3. **Use environment variables** for configuration that needs to persist across tasks
4. **Leverage context data**: Use the context object to access relevant information about the workspace and task results
5. **Provide clear errors**: If throwing errors, make sure they are descriptive and actionable

View File

@ -0,0 +1,58 @@
---
title: 'Self-Host the Remote Cache'
description: 'Learn how to self-host Nx remote caching on AWS S3, Google Cloud, Azure, or shared drives, or build your own cache server for enhanced build performance in your monorepo.'
---
# Self-Host the Remote Cache
Nx offers different ways to enable self-hosted remote caching for your workspace that can be used starting with Nx version 19.8 and higher:
- **Using the official Nx packages** that come with ready-to-use adapters for AWS S3, GCP, Azure, and more.
- **Build your own cache server** by following the Nx Remote Caching OpenAPI spec.
{% callout type="note" title="Free managed remote cache with Nx Cloud" %}
Note, you can get started for free with a **fully managed remote caching powered by Nx Cloud**. It comes with a generous Hobby plan that is enough for most small teams. [Learn more here](/nx-cloud).
If you are an enterprise and **data privacy and security is a concern**, [reach out for an Enterprise trial](/enterprise/trial). It is fully SOC 2 type 1 and 2 compliant and comes with single-tenant, dedicated EU region hosting as well as on-premise.
**Are you an OSS project?** Nx Cloud is free for OSS. [Reach out here](/pricing#oss).
{% /callout %}
## Official Nx Self-Hosted Cache Packages
The official self-hosted cache packages are the easiest migration path if you've been using a community caching solution based on the old custom task runner API in the past. All of the packages are completely free but require an activation key. Getting a key is a fully automated and self-serving process that happens during the package installation.
The following remote cache adapters are available:
- [@nx/s3-cache](/nx-api/s3-cache): Cache is self-hosted on an Amazon S3 bucket
- [@nx/gcs-cache](/nx-api/gcs-cache): Cache is self-hosted on Google Cloud storage
- [@nx/azure-cache](/nx-api/azure-cache): Cache is self-hosted on Azure
- [@nx/shared-fs-cache](/nx-api/shared-fs-cache): Cache is self-hosted on a shared file system location
> Why require an activation key? It simply helps us know and support our users. If you prefer not to provide this information, you can also [build your own cache server](#build-your-own-caching-server).
### Migrating From Custom Tasks Runners
You might have used Nx's now deprecated custom task runners API in the following scenarios:
- to implement custom self-hosted caching: going forward, use the official self-hosted packages or alternatively [build your own caching server](#build-your-own-caching-server)
- to inject custom behavior before and after running tasks in Nx: for that purpose, we've built a new API exposing dedicated pre and post hooks.
To learn more about migrating from custom task runners, [please refer to this detailed guide](/deprecated/custom-tasks-runner).
## Build Your Own Caching Server
We have [published a new RFC](https://github.com/nrwl/nx/discussions/30548) detailing a custom self-hosted cache based on an OpenAPI specification. This will be available before Nx 21, ensuring a smooth migration path for those who are looking for full control.
## Why Switch to Nx Cloud
Nx Cloud is much more than just a remote caching solution; it provides a full platform for scaling monorepos on CI. It comes with:
- [fully managed remote caching with Nx Replay](/ci/features/remote-cache)
- [automated distribution of tasks across machines with Nx Agents](/ci/features/distribute-task-execution)
- [automated splitting of tasks (including e2e tests) with Nx Atomizer](/ci/features/split-e2e-tasks)
- [detection and re-running of flaky tasks](/ci/features/flaky-tasks)
{% call-to-action title="Connect to Nx Cloud" icon="nxcloud" description="Enable task distribution and Atomizer" url="/ci/intro/connect-to-nx-cloud" /%}

View File

@ -65,6 +65,7 @@
- [Change Cache Location](/recipes/running-tasks/change-cache-location)
- [Skip Task Caching](/recipes/running-tasks/skipping-cache)
- [Migrate to Inferred Tasks (Project Crystal)](/recipes/running-tasks/convert-to-inferred)
- [Self-Host the Remote Cache](/recipes/running-tasks/self-hosted-caching)
- [Adopting Nx](/recipes/adopting-nx)
- [NPM/Yarn/PNPM workspaces](/recipes/adopting-nx/adding-to-monorepo)
- [Migrate From Turborepo](/recipes/adopting-nx/from-turborepo)
@ -181,10 +182,9 @@
- [Enterprise](/nx-enterprise)
- [Activate Powerpack](/nx-enterprise/activate-powerpack)
- [Powerpack Features](/nx-enterprise/powerpack)
- [Free Licenses & Trials](/nx-enterprise/powerpack/free-licenses-and-trials)
- [Free Licenses & Trials](/nx-enterprise/powerpack/licenses-and-trials)
- [Run Language-Agnostic Conformance Rules](/nx-enterprise/powerpack/conformance)
- [Define Code Ownership at the Project Level](/nx-enterprise/powerpack/owners)
- [Self-Host the Remote Cache](/nx-enterprise/powerpack/custom-caching)
- [Showcase](/showcase)
- [Nx with your favorite tech](/showcase/example-repos)
- [Express](/showcase/example-repos/add-express)
@ -264,6 +264,7 @@
- [Create an Install Package](/extending-nx/recipes/create-install-package)
- [Infer Tasks or Projects](/extending-nx/recipes/project-graph-plugins)
- [Publish a Plugin](/extending-nx/recipes/publish-plugin)
- [Hook into the Task Running Lifecycle](/extending-nx/recipes/task-running-lifecycle)
- Ci
@ -820,35 +821,31 @@
- [ci-workflow](/nx-api/workspace/generators/ci-workflow)
- [infer-targets](/nx-api/workspace/generators/infer-targets)
- [migrations](/nx-api/workspace/migrations)
- [powerpack-azure-cache](/nx-api/powerpack-azure-cache)
- [documents](/nx-api/powerpack-azure-cache/documents)
- [Overview](/nx-api/powerpack-azure-cache/documents/overview)
- [powerpack-conformance](/nx-api/powerpack-conformance)
- [documents](/nx-api/powerpack-conformance/documents)
- [Overview](/nx-api/powerpack-conformance/documents/overview)
- [Create a Conformance Rule](/nx-api/powerpack-conformance/documents/create-conformance-rule)
- [executors](/nx-api/powerpack-conformance/executors)
- [bundle-rules](/nx-api/powerpack-conformance/executors/bundle-rules)
- [generators](/nx-api/powerpack-conformance/generators)
- [create-rule](/nx-api/powerpack-conformance/generators/create-rule)
- [powerpack-enterprise-cloud](/nx-api/powerpack-enterprise-cloud)
- [generators](/nx-api/powerpack-enterprise-cloud/generators)
- [init](/nx-api/powerpack-enterprise-cloud/generators/init)
- [powerpack-gcs-cache](/nx-api/powerpack-gcs-cache)
- [documents](/nx-api/powerpack-gcs-cache/documents)
- [Overview](/nx-api/powerpack-gcs-cache/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)
- [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)
- [azure-cache](/nx-api/azure-cache)
- [documents](/nx-api/azure-cache/documents)
- [Overview](/nx-api/azure-cache/documents/overview)
- [conformance](/nx-api/conformance)
- [documents](/nx-api/conformance/documents)
- [Overview](/nx-api/conformance/documents/overview)
- [Create a Conformance Rule](/nx-api/conformance/documents/create-conformance-rule)
- [executors](/nx-api/conformance/executors)
- [bundle-rules](/nx-api/conformance/executors/bundle-rules)
- [generators](/nx-api/conformance/generators)
- [create-rule](/nx-api/conformance/generators/create-rule)
- [owners](/nx-api/owners)
- [documents](/nx-api/owners/documents)
- [Overview](/nx-api/owners/documents/overview)
- [generators](/nx-api/owners/generators)
- [init](/nx-api/owners/generators/init)
- [sync-codeowners-file](/nx-api/owners/generators/sync-codeowners-file)
- [gcs-cache](/nx-api/gcs-cache)
- [documents](/nx-api/gcs-cache/documents)
- [Overview](/nx-api/gcs-cache/documents/overview)
- [s3-cache](/nx-api/s3-cache)
- [documents](/nx-api/s3-cache/documents)
- [Overview](/nx-api/s3-cache/documents/overview)
- [shared-fs-cache](/nx-api/shared-fs-cache)
- [documents](/nx-api/shared-fs-cache/documents)
- [Overview](/nx-api/shared-fs-cache/documents/overview)
- [generators](/nx-api/shared-fs-cache/generators)
- [init](/nx-api/shared-fs-cache/generators/init)

View File

@ -51,7 +51,7 @@ export default function NxPowerPackPage(): ReactElement {
<DefaultLayout headerCTAConfig={headerCTAConfig}>
<Hero />
<div className="mt-32 scroll-mt-32 lg:mt-56" id="features">
<div className="mt-16 scroll-mt-16" id="features">
<PowerpackFeatures />
</div>

View File

@ -0,0 +1,50 @@
import { CallToAction, DefaultLayout } from '@nx/nx-dev/ui-common';
import type { Metadata } from 'next';
import { type ReactElement } from 'react';
import { contactButton } from '../../lib/components/headerCtaConfigs';
import { Faq, RemoteCacheSolutions } from '@nx/nx-dev/ui-remote-cache';
export const metadata: Metadata = {
title: 'Nx - Remote Cache',
description:
'Free remote caching solutions for any team. Pick from Managed Remote Cache with Nx Cloud, Self-Hosted Cache Plugins, or Build Your Own with our OpenAPI specs.',
alternates: {
canonical: 'https://nx.dev/remote-cache',
},
openGraph: {
url: 'https://nx.dev/remote-cache',
title: 'Nx - Remote Cache',
description:
'Free remote caching solutions for any team. Pick from Managed Remote Cache with Nx Cloud, Self-Hosted Cache Plugins, or Build Your Own with our OpenAPI specs.',
images: [
{
url: 'https://nx.dev/socials/nx-media.png',
width: 800,
height: 421,
alt: 'Nx - Free remote caching solutions for any team.',
type: 'image/jpeg',
},
],
siteName: 'Nx',
type: 'website',
},
};
export default function NxRemoteCachePage(): ReactElement {
return (
<DefaultLayout headerCTAConfig={[contactButton]}>
<RemoteCacheSolutions />
<div className="mt-32 lg:mt-56">
<Faq />
</div>
<div className="mt-32 lg:mt-56">
<CallToAction
mainActionLinkText="Get started"
mainActionLink="https://cloud.nx.app/get-started/?utm_source=nx-dev&utm_medium=remote-cache-call-to-action&utm_campaign=self-hosted-cache&utm_content=get-started"
mainActionTitle="Get started with Nx Cloud"
/>
</div>
</DefaultLayout>
);
}

View File

@ -1178,7 +1178,7 @@ const enterpriseNxSection = {
'/features/powerpack/conformance': '/nx-enterprise/powerpack/conformance',
'/features/powerpack/owners': '/nx-enterprise/powerpack/owners',
'/features/powerpack/custom-caching':
'/nx-enterprise/powerpack/custom-caching',
'/recipes/running-tasks/self-hosted-caching',
'/recipes/installation/activate-powerpack':
'/nx-enterprise/activate-powerpack',
};
@ -1193,6 +1193,41 @@ const manualDTEUpdate = {
'/ci/recipes/enterprise/dte/jenkins-dte': '/ci/recipes/dte/jenkins-dte',
'/showcase/benchmarks/dte': '/showcase/benchmarks/nx-agents',
};
const powerpackRedirects = {
'/nx-enterprise/powerpack/custom-caching':
'/recipes/running-tasks/self-hosted-caching',
'/nx-enterprise/powerpack/free-licenses-and-trials':
'/nx-enterprise/powerpack/licenses-and-trials',
// Redirects for renamed powerpack packages
'/nx-api/powerpack-owners': '/nx-api/owners',
'/nx-api/powerpack-owners/documents/overview':
'/nx-api/owners/documents/overview',
'/nx-api/powerpack-conformance': '/nx-api/conformance',
'/nx-api/powerpack-conformance/documents/overview':
'/nx-api/conformance/documents/overview',
'/nx-api/powerpack-conformance/documents/create-conformance-rule':
'/nx-api/conformance/documents/create-conformance-rule',
'/nx-api/powerpack-azure-cache': '/nx-api/azure-cache',
'/nx-api/powerpack-azure-cache/documents/overview':
'/nx-api/azure-cache/documents/overview',
'/nx-api/powerpack-gcs-cache': '/nx-api/gcs-cache',
'/nx-api/powerpack-gcs-cache/documents/overview':
'/nx-api/gcs-cache/documents/overview',
'/nx-api/powerpack-s3-cache': '/nx-api/s3-cache',
'/nx-api/powerpack-s3-cache/documents/overview':
'/nx-api/s3-cache/documents/overview',
'/nx-api/powerpack-shared-fs-cache': '/nx-api/shared-fs-cache',
'/nx-api/powerpack-shared-fs-cache/documents/overview':
'/nx-api/shared-fs-cache/documents/overview',
};
/**
* Public export API
*/
@ -1228,4 +1263,5 @@ module.exports = {
marketing,
enterpriseNxSection,
manualDTEUpdate,
powerpackRedirects,
};

View File

@ -96,6 +96,9 @@ module.exports = {
'blockquote p:last-of-type::after': {
content: '',
},
s: {
'@apply text-gray-500': {},
},
},
},
},

View File

@ -248,7 +248,7 @@ export function DocumentationHeader({
<div className="hidden flex-shrink-0 xl:flex">
<nav
role="menu"
className="items-justified hidden justify-center space-x-2 text-sm lg:flex"
className="hidden items-center justify-center space-x-2 text-sm lg:flex"
>
<h2 className="sr-only">Main navigation</h2>
<Link
@ -300,6 +300,14 @@ export function DocumentationHeader({
)}
</Popover>
<div className="hidden h-6 w-px bg-slate-200 md:block dark:bg-slate-700" />
<Link
href="/remote-cache"
title="Nx Remote Cache"
className="hidden gap-2 px-3 py-2 font-medium leading-tight hover:text-blue-500 md:inline-flex dark:text-slate-200 dark:hover:text-sky-500"
prefetch={false}
>
Remote Cache
</Link>
<Link
href="/nx-cloud"
title="Nx Cloud"
@ -317,14 +325,6 @@ export function DocumentationHeader({
Pricing
</Link>
<div className="hidden h-6 w-px bg-slate-200 md:block dark:bg-slate-700" />
<Link
href="/powerpack"
title="Nx Powerpack"
className="hidden gap-2 px-3 py-2 font-medium leading-tight hover:text-blue-500 md:inline-flex dark:text-slate-200 dark:hover:text-sky-500"
prefetch={false}
>
Powerpack
</Link>
<Link
href="/enterprise"
title="Nx Enterprise"

View File

@ -161,6 +161,14 @@ export function Header({ ctaButtons }: HeaderProps): ReactElement {
)}
</Popover>
<div className="hidden h-6 w-px bg-slate-200 md:block dark:bg-slate-700" />
<Link
href="/remote-cache"
title="Nx Remote Cache"
className="hidden gap-2 px-3 py-2 font-medium leading-tight hover:text-blue-500 md:inline-flex dark:text-slate-200 dark:hover:text-sky-500"
prefetch={false}
>
Remote Cache
</Link>
<Link
href="/nx-cloud"
title="Nx Cloud"
@ -178,14 +186,6 @@ export function Header({ ctaButtons }: HeaderProps): ReactElement {
Pricing
</Link>
<div className="hidden h-6 w-px bg-slate-200 md:block dark:bg-slate-700" />
<Link
href="/powerpack"
title="Nx Powerpack"
className="hidden gap-2 px-3 py-2 font-medium leading-tight hover:text-blue-500 md:inline-flex dark:text-slate-200 dark:hover:text-sky-500"
prefetch={false}
>
Powerpack
</Link>
<Link
href="/enterprise"
title="Nx Enterprise"
@ -400,12 +400,12 @@ export function Header({ ctaButtons }: HeaderProps): ReactElement {
Pricing
</Link>
<Link
href="/powerpack"
title="Powerpack"
href="/remote-cache"
title="Nx Remote Cache"
className="flex w-full gap-2 py-4 font-medium leading-tight hover:text-blue-500 dark:text-slate-200 dark:hover:text-sky-500"
prefetch={false}
>
Powerpack
Remote Cache
</Link>
<Link
href="/enterprise"

View File

@ -6,7 +6,7 @@ import {
Transition,
} from '@headlessui/react';
import { ChevronDownIcon } from '@heroicons/react/24/outline';
import { SectionHeading } from '@nx/nx-dev/ui-common';
import { SectionHeading, Strong } from '@nx/nx-dev/ui-common';
import { cx } from '@nx/nx-dev/ui-primitives';
import { FAQPageJsonLd } from 'next-seo';
import Link from 'next/link';
@ -16,44 +16,125 @@ export function Faq(): ReactElement {
const faqs = [
{
question: 'Does Nx Powerpack activation require network access?',
answer:
answerJson:
'If you enable Nx Powerpack without Nx Cloud, no network requests will be created and no data will be collected.',
answerUi: (
<p>
If you enable Nx Powerpack without Nx Cloud, no network requests will
be created and no data will be collected.
</p>
),
},
{
question: 'Can I get an Nx Powerpack license for free?',
answer:
answerJson:
'Open source projects can get Powerpack for free, and small teams can get a remote cache only license for free. All licenses are perpetual and licenses can be updated as long as the organization still qualifies.',
answerUi: (
<p>
Open source projects can get Powerpack for free, and small teams can
get a remote cache only license for free. All licenses are perpetual
and licenses can be updated as long as the organization still
qualifies.
</p>
),
},
{
question: 'How do we define a small team?',
answer:
answerJson:
'We value small teams using Nx. That is why we provide a free, perpetual, remote cache only license to any company with fewer than 30 engineers using Nx. If you have a special case, reach out and we will help. Read more here: https://nx.dev/nx-enterprise/powerpack/free-licenses-and-trials',
answerUi: (
<p>
We value small teams using Nx. That is why we provide a free,
perpetual, remote cache only license to any company with fewer than 30
engineers using Nx. If you have a special case, reach out and we will
help.
<Link
href="https://nx.dev/nx-enterprise/powerpack/free-licenses-and-trials"
title="Free licenses and trials"
className="font-semibold"
>
Read more here.
</Link>
</p>
),
},
{
question: 'What can a large team do?',
answer:
answerJson:
'You can get a trial license immediately. Read more here: https://nx.dev/nx-enterprise/powerpack/free-licenses-and-trials',
answerUi: (
<p>
You can get a trial license immediately.{' '}
<Link
href="https://nx.dev/nx-enterprise/powerpack/free-licenses-and-trials"
title="Free licenses and trials"
className="font-semibold"
>
Read more here.
</Link>
</p>
),
},
{
question: 'Want to use Powerpack for OSS?',
answer:
'You can apply for a free OSS license here: https://nx.dev/powerpack/special-offer',
answerJson:
'You can get Powerpack for free for your open source projects. Learn more in the docs: https://nx.dev/nx-enterprise/powerpack/licenses-and-trials#powerpack-for-oss-projects',
answerUi: (
<p>
You can get Powerpack for free for your open source projects.{' '}
<Link
href="https://nx.dev/nx-enterprise/powerpack/licenses-and-trials#powerpack-for-oss-projects"
title="Powerpack for OSS projects"
className="font-semibold"
>
Learn more about it in our docs.
</Link>
</p>
),
},
{
question:
'Only interested in Nx Powerpack because of Custom Tasks Runner deprecation',
answer:
answerJson:
'We created a transition path from using Custom Tasks Runners to using the new plugins api hooks (preTasksExecution and postTasksExectution) and Nx Powerpack. Read more here: https://nx.dev/deprecated/custom-tasks-runner',
answerUi: (
<p>
We created a transition path from using Custom Tasks Runners to using
the new plugins api hooks (preTasksExecution and postTasksExectution)
and Nx Powerpack.{' '}
<Link
href="https://nx.dev/deprecated/custom-tasks-runner"
title="Custom Tasks Runner deprecation"
className="font-semibold"
>
Read more here.
</Link>
</p>
),
},
{
question: 'Is Nx Powerpack license perpetual?',
answer:
answerJson:
'Yes. The most recent version of Nx you can access while your license is still active will remain usable even after the license expires.',
answerUi: (
<p>
<Strong>Yes</Strong>. The most recent version of Nx you can access
while your license is still active will remain usable even after the
license expires.
</p>
),
},
{
question: 'Do Nx Enterprise customers have access to Nx Powerpack?',
answer:
answerJson:
'Nx Powerpack is provided at no additional cost for Nx Enterprise customers. Your DPE can help you get maximum value out of Nx Powerpack packages.',
answerUi: (
<p>
Nx Powerpack is provided at <Strong>no additional cost</Strong> for Nx
Enterprise customers. Your DPE can help you get maximum value out of
Nx Powerpack packages.
</p>
),
},
];
@ -75,7 +156,7 @@ export function Faq(): ReactElement {
title="Reach out to the team"
className="font-semibold"
>
Cant find the answer youre looking for?
Can't find the answer you're looking for?
</Link>
</p>
</header>
@ -83,7 +164,7 @@ export function Faq(): ReactElement {
useAppDir={true}
mainEntity={faqs.map((faq) => ({
questionName: faq.question,
acceptedAnswerText: faq.answer,
acceptedAnswerText: faq.answerJson,
}))}
/>
<div className="mt-12 lg:col-span-2 lg:mt-0">
@ -116,10 +197,11 @@ export function Faq(): ReactElement {
leaveFrom="transform translate-y-0 opacity-100"
leaveTo="transform -translate-y-6 opacity-0"
>
<DisclosurePanel as="dd" className="mt-2 pr-12">
<p className="text-base text-slate-500 dark:text-slate-400">
{faq.answer}
</p>
<DisclosurePanel
as="dd"
className="mt-2 pr-12 text-base text-slate-500 dark:text-slate-400"
>
{faq.answerUi}
</DisclosurePanel>
</Transition>
</>

View File

@ -117,7 +117,7 @@ export function GetStarted(): ReactElement {
</p>
<div className="mt-4 text-left">
<TerminalOutput
command="nx activate-powerpack {YOUR_LICENSE_KEY}"
command="nx activate-key {YOUR_ACTIVATION_KEY}"
path="~/my-workspace"
title=""
content=""
@ -138,13 +138,6 @@ export function GetStarted(): ReactElement {
</h4>
<p className="mt-2">
Install Powerpack plugins such as{' '}
<TextLink
href="/nx-enterprise/powerpack/custom-caching"
title="Self-hosted cache storage"
>
Self-hosted cache storage
</TextLink>
,{' '}
<TextLink
href="/nx-enterprise/powerpack/conformance"
title="Workspace conformance"

View File

@ -85,7 +85,7 @@ export function Hero(): ReactElement {
<div className="fixed inset-0 bg-black/25 backdrop-blur-sm" />
<div className="fixed inset-0 overflow-y-auto">
<div className="flex min-h-full items-center justify-center p-4 text-center">
<DialogPanel className="relative w-auto transform overflow-hidden rounded-2xl border border-slate-600 text-left align-middle shadow-xl transition-all focus:outline-none dark:border-slate-800">
<DialogPanel className="relative w-auto transform overflow-hidden rounded-2xl border border-slate-950 bg-slate-950 text-left align-middle shadow-xl transition-all focus:outline-none">
<iframe
width="812"
height="456"

View File

@ -16,7 +16,11 @@ import {
} from '@nx/nx-dev/ui-common';
import { cx } from '@nx/nx-dev/ui-primitives';
import { AnimatedCurvedBeam } from '@nx/nx-dev/ui-animations';
import { CircleStackIcon, ServerIcon } from '@heroicons/react/24/outline';
import {
CircleStackIcon,
ServerIcon,
XMarkIcon,
} from '@heroicons/react/24/outline';
import {
AmazonS3Icon,
AzureDevOpsIcon,
@ -31,8 +35,33 @@ export function PowerpackFeatures(): ReactElement {
return (
<section className="relative isolate">
<div className="mx-auto max-w-7xl px-6 lg:px-8">
<div className="relative flex justify-center">
<div className="pointer-events-auto w-fit justify-between gap-x-6 bg-slate-950 px-6 py-2.5 sm:rounded-xl sm:py-3 sm:pl-4 sm:pr-3.5 dark:bg-white">
<p className="text-sm/6 text-white dark:text-slate-950">
<strong className="font-semibold">
Looking for self-hosted caching?
</strong>
<svg
viewBox="0 0 2 2"
aria-hidden="true"
className="mx-2 inline size-0.5 fill-current"
>
<circle r={1} cx={1} cy={1} />
</svg>
It is now free for everyone&nbsp;
<Link
href="/remote-cache"
title="Self-hosted cache storage"
className="text-white dark:text-slate-950"
>
<span className="absolute inset-0" />
<span aria-hidden="true">&rarr;</span>
</Link>
</p>
</div>
</div>
<div className="mt-32 grid grid-cols-1 gap-8 lg:grid-cols-2">
<div className="flex max-w-full flex-col gap-16 bg-white/50 px-6 py-16 ring-1 ring-slate-200 sm:rounded-3xl sm:p-8 md:col-span-full lg:mx-0 lg:max-w-full lg:flex-row lg:items-center lg:py-16 xl:px-16 dark:bg-white/5 dark:ring-white/10">
{/*<div className="flex max-w-full flex-col gap-16 bg-white/50 px-6 py-16 ring-1 ring-slate-200 sm:rounded-3xl sm:p-8 md:col-span-full lg:mx-0 lg:max-w-full lg:flex-row lg:items-center lg:py-16 xl:px-16 dark:bg-white/5 dark:ring-white/10">
<div className="xl:max-w-xl">
<SectionHeading
as="h2"
@ -70,7 +99,7 @@ export function PowerpackFeatures(): ReactElement {
<div className="hidden w-full xl:block">
<CustomRemoteCacheAnimation />
</div>
</div>
</div>*/}
<div className="flex flex-col gap-16 bg-white/50 px-6 py-16 ring-1 ring-slate-200 sm:rounded-3xl sm:p-8 lg:mx-0 lg:max-w-none lg:justify-between lg:py-16 xl:px-16 dark:bg-white/5 dark:ring-white/10">
<div className="max-w-2xl">

View File

@ -0,0 +1,12 @@
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
],
"plugins": []
}

View File

@ -0,0 +1,18 @@
{
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}

View File

@ -0,0 +1,7 @@
# ui-remote-cache
This library was generated with [Nx](https://nx.dev).
## Running unit tests
Run `nx test ui-remote-cache` to execute the unit tests via [Jest](https://jestjs.io).

View File

@ -0,0 +1,9 @@
{
"name": "ui-remote-cache",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "nx-dev/ui-remote-cache/src",
"projectType": "library",
"tags": [],
"// targets": "to see all targets run: nx show project ui-remote-cache --web",
"targets": {}
}

View File

@ -0,0 +1,2 @@
export * from './lib/faq';
export * from './lib/remote-cache-solutions';

View File

@ -0,0 +1,222 @@
'use client';
import {
Disclosure,
DisclosureButton,
DisclosurePanel,
Transition,
} from '@headlessui/react';
import { ChevronDownIcon } from '@heroicons/react/24/outline';
import { SectionHeading, Strong } from '@nx/nx-dev/ui-common';
import { cx } from '@nx/nx-dev/ui-primitives';
import { FAQPageJsonLd } from 'next-seo';
import Link from 'next/link';
import { ReactElement } from 'react';
export function Faq(): ReactElement {
const faqs = [
{
question: 'How is a key different than the license?',
answerJson:
'Unlike a license, which outlined a commercial relationship between the code consumer and us, the key simply provides a free mechanism for us to gather insights into how our tools are used.',
answerUi: (
<p>
Unlike a license, which outlined a commercial relationship between the
code consumer and us, the key simply provides a free mechanism for us
to gather insights into how our tools are used.
</p>
),
},
{
question:
'I was using custom runners or a DIY self-hosted caching solution. What should I do?',
answerJson:
"It's important to note that not all custom task runner use-cases were caching related. If you want to execute some code before or after tasks are executed, we have a new API for you to leverage which is documented here: https://nx.dev/deprecated/custom-tasks-runner#deprecating-custom-tasks-runner.\n If you were leveraging the custom tasks runners API to facilitate remote caching then you now have the choice between the three remote caching options outlined on this page: Nx Cloud, Self-Hosted via Nx Plugins, and Self-Hosted via your own OpenAPI server.",
answerUi: (
<>
<p>
It's important to note that not all custom task runner use-cases
were caching related. If you want to execute some code before or
after tasks are executed, we have a new API for you to leverage
which is{' '}
<Link
href="/deprecated/custom-tasks-runner#deprecating-custom-tasks-runner"
title="See documentation"
className="font-semibold"
>
documented here.
</Link>
</p>
<p>
If you were leveraging the custom tasks runners API to facilitate
remote caching then you now have the choice between the three remote
caching options outlined on this page: Nx Cloud, Self-Hosted via Nx
Plugins, and Self-Hosted via your own OpenAPI server.
</p>
</>
),
},
{
question:
'How do I implement custom authentication for my self-hosted cache?',
answerJson:
'You implement custom authentication by using our OpenAPI solution',
answerUi: (
<p>
We have an OpenAPI spec to implement your own remote caching server,
thus giving you the flexibility to adapt it to your custom
authentication requirements.{' '}
<Link
href="/recipes/running-tasks/self-hosted-caching#build-your-own-caching-server"
title="Learn more"
className="font-semibold"
>
Learn more here.
</Link>
</p>
),
},
{
question: 'How will versioning be handled in the API specification?',
answerJson:
'Check out our RFC for more details: https://github.com/nrwl/nx/discussions/30548',
answerUi: (
<p>
Check out our RFC for more details:{' '}
<Link
href="https://github.com/nrwl/nx/discussions/30548"
title="See documentation"
className="font-semibold"
>
Nx Custom Self-Hosted Remote Cache
</Link>
</p>
),
},
{
question:
'What security measures does Nx Cloud offer beyond the official plugins and third party plugins?',
answerJson:
'Nx Cloud includes enterprise-grade security features designed to give organizations more control over access and data protection:\n\n' +
'- Access Management: Nx Cloud supports **individual user authentication tied to personal accounts, enabling precise control over who can access cached data. If a user leaves the company or changes roles, their access can be revoked immediately — without impacting others.\n' +
'- Personal Access Tokens: Teams can issue and revoke multiple access tokens, allowing fine-grained control over automation and integrations.\n' +
'- No Cache Overrides: Nx Cloud prevents unauthorized cache modifications.\n' +
'- SOC 2 Compliance: Nx Cloud is SOC 2 certified, demonstrating a high standard for security, availability, and confidentiality.\n' +
'- Secure Deployment Options: Nx Cloud though Nx Enterprise, includes single-tenant or on-prem options for teams needing full control over their data storage and access policies.',
answerUi: (
<>
<p>
Nx Cloud includes{' '}
<Strong>enterprise-grade security features</Strong> designed to give
organizations more control over access and data protection.
</p>
<ul className="mt-4 list-disc space-y-2 px-4">
<li>
<Strong>Access Management</Strong>: Nx Cloud supports{' '}
<Strong>individual user authentication</Strong> tied to personal
accounts, enabling precise control over who can access cached
data. If a user leaves the company or changes roles, their access
can be revoked immediately without impacting others.
</li>
<li>
<Strong>Personal Access Tokens</Strong>: Teams can issue and
revoke multiple access tokens, allowing fine-grained control over
automation and integrations.
</li>
<li>
<Strong>No Cache Overrides</Strong>: Nx Cloud prevents
unauthorized cache modifications.
</li>
<li>
<Strong>SOC 2 Compliance</Strong>: Nx Cloud is SOC 2 certified,
demonstrating a high standard for security, availability, and
confidentiality.
</li>
<li>
<Strong>Secure Deployment Options</Strong>: Nx Cloud though{' '}
<Strong>Nx Enterprise</Strong>, includes{' '}
<Strong>single-tenant or on-prem options</Strong> for teams
needing full control over their data storage and access policies.
</li>
</ul>
</>
),
},
];
return (
<section id="faq" className="scroll-mt-24">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="lg:grid lg:grid-cols-3 lg:gap-8">
<header>
<SectionHeading as="h2" variant="title">
Have questions?
</SectionHeading>
<SectionHeading as="p" variant="subtitle" className="mt-6">
Check out our most commonly asked questions.
</SectionHeading>
<p className="text-md mt-4 text-slate-400 dark:text-slate-600">
<Link
href="/contact"
title="Reach out to the team"
className="font-semibold"
>
Can't find the answer you're looking for?
</Link>
</p>
</header>
<FAQPageJsonLd
useAppDir={true}
mainEntity={faqs.map((faq) => ({
questionName: faq.question,
acceptedAnswerText: faq.answerJson,
}))}
/>
<div className="mt-12 lg:col-span-2 lg:mt-0">
<dl className="mt-6 space-y-6 divide-y divide-slate-100 dark:divide-slate-800">
{faqs.map((faq) => (
<Disclosure as="div" key={faq.question} className="pt-6">
{({ open }) => (
<>
<dt className="text-lg">
<DisclosureButton className="flex w-full items-start justify-between text-left text-slate-400">
<span className="font-medium text-slate-800 dark:text-slate-300">
{faq.question}
</span>
<span className="ml-6 flex h-7 items-center">
<ChevronDownIcon
className={cx(
open ? '-rotate-180' : 'rotate-0',
'h-6 w-6 transform transition-transform'
)}
aria-hidden="true"
/>
</span>
</DisclosureButton>
</dt>
<Transition
enter="transition duration-100 ease-out"
enterFrom="transform -translate-y-6 opacity-0"
enterTo="transform translate-y-0 opacity-100"
leave="transition duration-75 ease-out"
leaveFrom="transform translate-y-0 opacity-100"
leaveTo="transform -translate-y-6 opacity-0"
>
<DisclosurePanel
as="dd"
className="mt-2 pr-12 text-base text-slate-500 dark:text-slate-400"
>
{faq.answerUi}
</DisclosurePanel>
</Transition>
</>
)}
</Disclosure>
))}
</dl>
</div>
</div>
</div>
</section>
);
}

View File

@ -0,0 +1,267 @@
'use client';
import { ReactElement } from 'react';
import { CheckCircleIcon } from '@heroicons/react/24/solid';
import { ButtonLink, SectionHeading, Strong } from '@nx/nx-dev/ui-common';
import { sendCustomEvent } from '@nx/nx-dev/feature-analytics';
import Link from 'next/link';
export function RemoteCacheSolutions(): ReactElement {
return (
<section id="plans" className="scroll-mt-24">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<header className="mx-auto max-w-3xl text-center">
<SectionHeading as="h2" variant="display">
Nx Remote Cache
</SectionHeading>
<SectionHeading as="p" variant="subtitle" className="mt-6">
Free remote caching solutions for any team.
</SectionHeading>
</header>
<div className="mt-24 flow-root">
<div className="-mt-16 grid max-w-full grid-cols-1 gap-12 sm:mx-auto lg:mt-0 lg:grid-cols-3 xl:-mx-4">
{/* NX CLOUD */}
<div>
<div className="rounded-xl border border-slate-200 bg-white p-8 dark:border-slate-800 dark:bg-slate-950">
<div className="flex items-center gap-x-2">
<h4 className="text-xl font-semibold leading-8 text-slate-950 dark:text-white">
Managed remote cache
</h4>
</div>
<p className="mt-2 text-sm">
Easiest setup, high performance, secure, fully managed by Nx
Cloud.
</p>
<div className="my-8">
<ButtonLink
href="https://cloud.nx.app/get-started/?utm_source=nx-dev&utm_medium=remote-cache&utm_campaign=self-hosted-cache&utm_content=manage-remote-cache-with-nx-cloud"
aria-describedby="nx-cloud-remote-cache"
title="Start caching your builds with Nx Cloud"
size="default"
variant="primary"
onClick={() =>
sendCustomEvent(
'manage-remote-cache-with-nx-cloud',
'managed-remote-cache',
'remote-cache'
)
}
className="w-full"
>
Get started
</ButtonLink>
</div>
<ul className="mt-4 divide-y divide-slate-200 border-t border-slate-200 text-sm dark:divide-slate-800 dark:border-slate-800">
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>Free plans available, no credit card required</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>Zero configuration</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>
Hosted on Nx Cloud servers or on-premise with{' '}
<Link
href="/enterprise"
title="Learn about Nx Enterprise"
className="font-semibold underline"
>
Nx Enterprise
</Link>
</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>
Enterprise grade access management and key revocation
</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>Secure against cache poisoning</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>
SOC-2 compliant (
<a
href="https://security.nx.app/"
title="Check our SOC 2 security report"
className="font-semibold underline"
>
view report
</a>
)
</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>Support</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>
Includes access to advanced CI features: distributed task
execution, re-running flaky tasks and automatic tasks
splitting
</span>
</li>
</ul>
</div>
</div>
{/*OFFICIAL PLUGINS*/}
<div>
<div className="rounded-xl border border-slate-200 bg-white p-8 dark:border-slate-800 dark:bg-slate-950">
<div className="flex items-center gap-x-2">
<h4 className="text-xl font-semibold leading-8 text-slate-950 dark:text-white">
Self-hosted cache
</h4>
</div>
<p className="mt-2 text-sm">
Dedicated NPM packages for major storage providers, Nx
managed.
</p>
<div className="my-8">
<ButtonLink
href="/recipes/running-tasks/self-hosted-caching"
aria-describedby="official-plugins"
title="Free official remote cache plugins"
size="default"
variant="primary"
onClick={() =>
sendCustomEvent(
'learn-more-self-hosted-cache-plugins',
'self-hosted-cache',
'remote-cache'
)
}
className="w-full"
>
Learn more
</ButtonLink>
</div>
<ul className="mt-4 divide-y divide-slate-200 border-t border-slate-200 text-sm dark:divide-slate-800 dark:border-slate-800">
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>Free for all users</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>Supports Amazon S3, MinIO, GCP, Azure</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>Supports shared network drives</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>
Simple migration path from existing 3rd party plugins
</span>
</li>
<li className="flex items-start justify-start gap-x-2 py-2.5">
<CheckCircleIcon
aria-hidden="true"
className="h-6 w-5 flex-none text-blue-600 dark:text-sky-500"
/>
<span>
SOC-2 compliant (
<a
href="https://security.nx.app/"
title="Check our SOC 2 security report"
className="font-semibold underline"
>
view report
</a>
)
</span>
</li>
</ul>
</div>
</div>
{/*OPENAPI*/}
<div>
<div className="rounded-xl border border-slate-200 bg-white p-8 dark:border-slate-800 dark:bg-slate-950">
<div className="flex items-center gap-x-2">
<h4 className="text-xl font-semibold leading-8 text-slate-950 dark:text-white">
Build your own
</h4>
</div>
<p className="mt-2 text-sm">
API specs coming soon. See current{' '}
<Link
href="https://github.com/nrwl/nx/discussions/30548"
title="See RFC on GitHub"
className="italic underline"
>
RFC under review
</Link>
.
</p>
<div className="mt-8">
<ButtonLink
href="https://github.com/nrwl/nx/discussions/30548"
aria-describedby="open-api"
title="Remote cache api specs"
size="default"
variant="primary"
onClick={() =>
sendCustomEvent(
'build-your-own-openapi',
'build-your-own',
'remote-cache'
)
}
className="w-full"
>
Learn more
</ButtonLink>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
);
}

View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"allowJs": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
],
"extends": "../../tsconfig.base.json"
}

View File

@ -0,0 +1,23 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
},
"exclude": [
"jest.config.ts",
"src/**/*.spec.ts",
"src/**/*.test.ts",
"src/**/*.spec.tsx",
"src/**/*.test.tsx",
"src/**/*.spec.js",
"src/**/*.test.js",
"src/**/*.spec.jsx",
"src/**/*.test.jsx"
],
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
}

View File

@ -58,18 +58,26 @@ export function generateExternalPackageSchemas(): Promise<any> {
return Promise.all([]);
}
const sourcePackagesDirectory = 'libs/nx-packages';
const sourcePackagesNamePrefix = 'powerpack-';
const specificPackages = [
'azure-cache',
'conformance',
'owners',
'gcs-cache',
's3-cache',
'shared-fs-cache',
];
return generatePackageSchemas(
sourceRepositoryRelativePath,
sourcePackagesDirectory,
sourcePackagesNamePrefix
specificPackages
);
}
export function generatePackageSchemas(
sourceRepositoryRelativePath = '',
sourcePackagesDirectory = 'packages',
sourcePackagesNamePrefix = ''
specificPackages?: string[] | undefined
): Promise<void[]> {
console.log(`${chalk.blue('i')} Generating Package Schemas`);
const absoluteRoot = resolve(join(__dirname, '../../../'));
@ -83,7 +91,7 @@ export function generatePackageSchemas(
const packages = findPackageMetadataList(
sourceRepositoryRoot,
sourcePackagesDirectory,
sourcePackagesNamePrefix
specificPackages
).map((packageMetadata) => {
const getCurrentSchemaPath = pathResolver(absoluteRoot);
if (!!packageMetadata.executors.length) {

View File

@ -109,21 +109,36 @@ function getSchemaList(
export function findPackageMetadataList(
absoluteRoot: string,
packagesDirectory: string = 'packages',
prefix = ''
specificPackages?: string[] | undefined
): PackageData[] {
const packagesDir = resolve(join(absoluteRoot, packagesDirectory));
/**
* Get all the custom overview information on each package if available
*/
const additionalApiReferences: DocumentMetadata[] = DocumentationMap.content
.find((data) => data.id === 'additional-api-references')!
.itemList.map((item) => convertToDocumentMetadata(item));
let additionalApiReferences: DocumentMetadata[] = [];
const additionalApiReferencesItem = DocumentationMap.content.find(
(data) => data.id === 'additional-api-references'
);
if (additionalApiReferencesItem && additionalApiReferencesItem.itemList) {
additionalApiReferences = additionalApiReferencesItem.itemList.map((item) =>
convertToDocumentMetadata(item)
);
}
// Use specific packages if provided, otherwise get all packages
let packagePaths: string[];
if (specificPackages && specificPackages.length > 0) {
packagePaths = specificPackages.map((pkg) => `${packagesDir}/${pkg}`);
} else {
packagePaths = sync(`${packagesDir}/*`, {
ignore: [`${packagesDir}/cli`, `${packagesDir}/*-e2e`],
});
}
// Do not use map.json, but add a documentation property on the package.json directly that can be easily resolved
return sync(`${packagesDir}/${prefix}*`, {
ignore: [`${packagesDir}/cli`, `${packagesDir}/*-e2e`],
})
return packagePaths
.map((folderPath: string): PackageData => {
const folderName = folderPath.substring(packagesDir.length + 1);

View File

@ -117,6 +117,7 @@
"@nx/nx-dev/ui-pricing": ["nx-dev/ui-pricing/src/index.ts"],
"@nx/nx-dev/ui-primitives": ["nx-dev/ui-primitives/src/index.ts"],
"@nx/nx-dev/ui-references": ["nx-dev/ui-references/src/index.ts"],
"@nx/nx-dev/ui-remote-cache": ["nx-dev/ui-remote-cache/src/index.ts"],
"@nx/nx-dev/ui-sponsor-card": ["nx-dev/ui-sponsor-card/src/index.ts"],
"@nx/nx-dev/ui-theme": ["nx-dev/ui-theme/src/index.ts"],
"@nx/nx-dev/ui-video-courses": ["nx-dev/ui-video-courses/src/index.ts"],