diff --git a/docs/blog/2022-05-02-nx-v14-is-out-here-is-all-you-need-to-know.md b/docs/blog/2022-05-02-nx-v14-is-out-here-is-all-you-need-to-know.md index 320afbb21d..2bd0976f33 100644 --- a/docs/blog/2022-05-02-nx-v14-is-out-here-is-all-you-need-to-know.md +++ b/docs/blog/2022-05-02-nx-v14-is-out-here-is-all-you-need-to-know.md @@ -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 diff --git a/docs/blog/2022-12-06-nx-15-3-standalone-projects-vite-task-graph-and-more.md b/docs/blog/2022-12-06-nx-15-3-standalone-projects-vite-task-graph-and-more.md index 45f326c795..648147a0c9 100644 --- a/docs/blog/2022-12-06-nx-15-3-standalone-projects-vite-task-graph-and-more.md +++ b/docs/blog/2022-12-06-nx-15-3-standalone-projects-vite-task-graph-and-more.md @@ -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 diff --git a/docs/blog/2023-02-16-nx-15-7-node-support-angular-lts-lockfile-pruning.md b/docs/blog/2023-02-16-nx-15-7-node-support-angular-lts-lockfile-pruning.md index 57dd1888e7..845663cb0d 100644 --- a/docs/blog/2023-02-16-nx-15-7-node-support-angular-lts-lockfile-pruning.md +++ b/docs/blog/2023-02-16-nx-15-7-node-support-angular-lts-lockfile-pruning.md @@ -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 diff --git a/docs/blog/2023-09-06-nx-16-8-release.md b/docs/blog/2023-09-06-nx-16-8-release.md index 4b70569de3..e9435fb273 100644 --- a/docs/blog/2023-09-06-nx-16-8-release.md +++ b/docs/blog/2023-09-06-nx-16-8-release.md @@ -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 diff --git a/docs/blog/2023-11-21-ai-assistant.md b/docs/blog/2023-11-21-ai-assistant.md index f8c4cd8ac8..636056b929 100644 --- a/docs/blog/2023-11-21-ai-assistant.md +++ b/docs/blog/2023-11-21-ai-assistant.md @@ -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 Supabase’s Vector Search example [(https://supabase.com/docs/guides/ai/examples/nextjs-vector-search)](https://supabase.com/docs/guides/ai/examples/nextjs-vector-search). -It’s 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 user’s question, and the model creates a coherent answer to the question. It’s basically like pasting in ChatGPT a docs page and asking it “how do I do that?”. Except in this case, we’re 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. +It’s 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 user’s question, and the model creates a coherent answer to the question. It’s basically like pasting in ChatGPT a docs page and asking it “how do I do that?”. Except in this case, we’re 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 diff --git a/docs/blog/2023-12-28-highlights-2023.md b/docs/blog/2023-12-28-highlights-2023.md index eb4393b30c..230ddbd17e 100644 --- a/docs/blog/2023-12-28-highlights-2023.md +++ b/docs/blog/2023-12-28-highlights-2023.md @@ -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 diff --git a/docs/blog/2024-09-25-evolving-nx.md b/docs/blog/2024-09-25-evolving-nx.md index 16bd7ec5e6..839035071e 100644 --- a/docs/blog/2024-09-25-evolving-nx.md +++ b/docs/blog/2024-09-25-evolving-nx.md @@ -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 diff --git a/docs/blog/2024-09-25-introducing-nx-powerpack.md b/docs/blog/2024-09-25-introducing-nx-powerpack.md index 10b5875bd8..e4977be5c2 100644 --- a/docs/blog/2024-09-25-introducing-nx-powerpack.md +++ b/docs/blog/2024-09-25-introducing-nx-powerpack.md @@ -4,17 +4,22 @@ 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. - No, we're **not placing existing features behind a paywall**. Nx Powerpack introduces new features on top of Nx (more about that below). - Yes, we still **strongly believe in OSS and our community**, and we will keep improving Nx more than ever; if anything, Powerpack will help us fund our OSS work on Nx core and ensure its long-term sustainability. -### What about my open-source repo ? +### 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). @@ -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 +npx nx register ``` ## 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', diff --git a/docs/blog/2025-01-06-nx-update-20-3.md b/docs/blog/2025-01-06-nx-update-20-3.md index 55558b097b..8e8c461a4a 100644 --- a/docs/blog/2025-01-06-nx-update-20-3.md +++ b/docs/blog/2025-01-06-nx-update-20-3.md @@ -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: diff --git a/docs/blog/2025-02-06-hetzner-cloud-success-story.md b/docs/blog/2025-02-06-hetzner-cloud-success-story.md index fa812a0b99..b01831839d 100644 --- a/docs/blog/2025-02-06-hetzner-cloud-success-story.md +++ b/docs/blog/2025-02-06-hetzner-cloud-success-story.md @@ -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. diff --git a/docs/blog/2025-03-31-custom-runners-and-self-hosted-caching.md b/docs/blog/2025-03-31-custom-runners-and-self-hosted-caching.md new file mode 100644 index 0000000000..a89b6d40a4 --- /dev/null +++ b/docs/blog/2025-03-31-custom-runners-and-self-hosted-caching.md @@ -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! diff --git a/docs/blog/images/articles/bg-self-hosted-caching-article.jpg b/docs/blog/images/articles/bg-self-hosted-caching-article.jpg new file mode 100644 index 0000000000..7bb8a76088 Binary files /dev/null and b/docs/blog/images/articles/bg-self-hosted-caching-article.jpg differ diff --git a/docs/external-generated/packages-metadata.json b/docs/external-generated/packages-metadata.json index 6516e7aaa6..23c20e7940 100644 --- a/docs/external-generated/packages-metadata.json +++ b/docs/external-generated/packages-metadata.json @@ -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" } ] diff --git a/docs/shared/packages/powerpack-azure-cache/powerpack-azure-cache-plugin.md b/docs/external-generated/packages/azure-cache/documents/overview.md similarity index 60% rename from docs/shared/packages/powerpack-azure-cache/powerpack-azure-cache-plugin.md rename to docs/external-generated/packages/azure-cache/documents/overview.md index 749ba431c7..a74d8ec7b1 100644 --- a/docs/shared/packages/powerpack-azure-cache/powerpack-azure-cache-plugin.md +++ b/docs/external-generated/packages/azure-cache/documents/overview.md @@ -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 diff --git a/docs/shared/packages/powerpack-conformance/create-conformance-rule.md b/docs/external-generated/packages/conformance/documents/create-conformance-rule.md similarity index 91% rename from docs/shared/packages/powerpack-conformance/create-conformance-rule.md rename to docs/external-generated/packages/conformance/documents/create-conformance-rule.md index 689ba6532a..3ac33a858a 100644 --- a/docs/shared/packages/powerpack-conformance/create-conformance-rule.md +++ b/docs/external-generated/packages/conformance/documents/create-conformance-rule.md @@ -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'; diff --git a/docs/external-generated/packages/powerpack-conformance/documents/overview.md b/docs/external-generated/packages/conformance/documents/overview.md similarity index 84% rename from docs/external-generated/packages/powerpack-conformance/documents/overview.md rename to docs/external-generated/packages/conformance/documents/overview.md index 446120a35d..e36d4e7b7c 100644 --- a/docs/external-generated/packages/powerpack-conformance/documents/overview.md +++ b/docs/external-generated/packages/conformance/documents/overview.md @@ -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) diff --git a/docs/external-generated/packages/powerpack-conformance/executors/bundle-rules.json b/docs/external-generated/packages/conformance/executors/bundle-rules.json similarity index 80% rename from docs/external-generated/packages/powerpack-conformance/executors/bundle-rules.json rename to docs/external-generated/packages/conformance/executors/bundle-rules.json index 5619c96f9f..21cadf47e7 100644 --- a/docs/external-generated/packages/powerpack-conformance/executors/bundle-rules.json +++ b/docs/external-generated/packages/conformance/executors/bundle-rules.json @@ -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" } diff --git a/docs/external-generated/packages/powerpack-conformance/generators/create-rule.json b/docs/external-generated/packages/conformance/generators/create-rule.json similarity index 90% rename from docs/external-generated/packages/powerpack-conformance/generators/create-rule.json rename to docs/external-generated/packages/conformance/generators/create-rule.json index c2a30f6b4b..2669192c4d 100644 --- a/docs/external-generated/packages/powerpack-conformance/generators/create-rule.json +++ b/docs/external-generated/packages/conformance/generators/create-rule.json @@ -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" } diff --git a/docs/shared/packages/powerpack-gcs-cache/powerpack-gcs-cache-plugin.md b/docs/external-generated/packages/gcs-cache/documents/overview.md similarity index 57% rename from docs/shared/packages/powerpack-gcs-cache/powerpack-gcs-cache-plugin.md rename to docs/external-generated/packages/gcs-cache/documents/overview.md index 01a00d522e..bd39e88874 100644 --- a/docs/shared/packages/powerpack-gcs-cache/powerpack-gcs-cache-plugin.md +++ b/docs/external-generated/packages/gcs-cache/documents/overview.md @@ -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" %} { diff --git a/docs/external-generated/packages/powerpack-owners/documents/overview.md b/docs/external-generated/packages/owners/documents/overview.md similarity index 85% rename from docs/external-generated/packages/powerpack-owners/documents/overview.md rename to docs/external-generated/packages/owners/documents/overview.md index 3b6a7f8ed2..04abc8e230 100644 --- a/docs/external-generated/packages/powerpack-owners/documents/overview.md +++ b/docs/external-generated/packages/owners/documents/overview.md @@ -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"] } } ``` diff --git a/docs/external-generated/packages/powerpack-owners/generators/init.json b/docs/external-generated/packages/owners/generators/init.json similarity index 74% rename from docs/external-generated/packages/powerpack-owners/generators/init.json rename to docs/external-generated/packages/owners/generators/init.json index 57d6a2a763..c134f46070 100644 --- a/docs/external-generated/packages/powerpack-owners/generators/init.json +++ b/docs/external-generated/packages/owners/generators/init.json @@ -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" } diff --git a/docs/external-generated/packages/powerpack-owners/generators/sync-codeowners-file.json b/docs/external-generated/packages/owners/generators/sync-codeowners-file.json similarity index 71% rename from docs/external-generated/packages/powerpack-owners/generators/sync-codeowners-file.json rename to docs/external-generated/packages/owners/generators/sync-codeowners-file.json index ce40358c38..a704081a43 100644 --- a/docs/external-generated/packages/powerpack-owners/generators/sync-codeowners-file.json +++ b/docs/external-generated/packages/owners/generators/sync-codeowners-file.json @@ -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" } diff --git a/docs/external-generated/packages/powerpack-conformance/executors/bundle-rule.json b/docs/external-generated/packages/powerpack-conformance/executors/bundle-rule.json deleted file mode 100644 index 297e07d7ba..0000000000 --- a/docs/external-generated/packages/powerpack-conformance/executors/bundle-rule.json +++ /dev/null @@ -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" -} diff --git a/docs/external-generated/packages/powerpack-enterprise-cloud/generators/init.json b/docs/external-generated/packages/powerpack-enterprise-cloud/generators/init.json deleted file mode 100644 index f88d65e804..0000000000 --- a/docs/external-generated/packages/powerpack-enterprise-cloud/generators/init.json +++ /dev/null @@ -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" -} diff --git a/docs/external-generated/packages/powerpack-gcs-cache/documents/overview.md b/docs/external-generated/packages/powerpack-gcs-cache/documents/overview.md deleted file mode 100644 index 86fe8dc775..0000000000 --- a/docs/external-generated/packages/powerpack-gcs-cache/documents/overview.md +++ /dev/null @@ -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" - } -} -``` diff --git a/docs/external-generated/packages/powerpack-s3-cache/generators/init.json b/docs/external-generated/packages/powerpack-s3-cache/generators/init.json deleted file mode 100644 index 8f7b97f8fe..0000000000 --- a/docs/external-generated/packages/powerpack-s3-cache/generators/init.json +++ /dev/null @@ -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" -} diff --git a/docs/external-generated/packages/powerpack-shared-fs-cache/documents/overview.md b/docs/external-generated/packages/powerpack-shared-fs-cache/documents/overview.md deleted file mode 100644 index 643bf1c831..0000000000 --- a/docs/external-generated/packages/powerpack-shared-fs-cache/documents/overview.md +++ /dev/null @@ -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. diff --git a/docs/shared/packages/powerpack-s3-cache/powerpack-s3-cache-plugin.md b/docs/external-generated/packages/s3-cache/documents/overview.md similarity index 74% rename from docs/shared/packages/powerpack-s3-cache/powerpack-s3-cache-plugin.md rename to docs/external-generated/packages/s3-cache/documents/overview.md index 1363da077d..e3ab7ce84c 100644 --- a/docs/shared/packages/powerpack-s3-cache/powerpack-s3-cache-plugin.md +++ b/docs/external-generated/packages/s3-cache/documents/overview.md @@ -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: ... @@ -86,7 +102,7 @@ Nx can read the active access token [created after running `aws sso login`](http #### Credentials in `nx.json` File -Storing your credentials in the `nx.json` file is the least secure of the 4 authentication options, since anyone with read access to your code base will have access to your AWS credentials. +Storing your credentials in the `nx.json` file is the least secure of the 4 authentication options, since anyone with read access to your codebase will have access to your AWS credentials. ```jsonc {% fileName="nx.json" %} { @@ -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" %} { diff --git a/docs/external-generated/packages/shared-fs-cache/documents/overview.md b/docs/external-generated/packages/shared-fs-cache/documents/overview.md new file mode 100644 index 0000000000..f5b7ef6cd8 --- /dev/null +++ b/docs/external-generated/packages/shared-fs-cache/documents/overview.md @@ -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. diff --git a/docs/external-generated/packages/powerpack-shared-fs-cache/generators/init.json b/docs/external-generated/packages/shared-fs-cache/generators/init.json similarity index 65% rename from docs/external-generated/packages/powerpack-shared-fs-cache/generators/init.json rename to docs/external-generated/packages/shared-fs-cache/generators/init.json index 50924a5b91..410e133124 100644 --- a/docs/external-generated/packages/powerpack-shared-fs-cache/generators/init.json +++ b/docs/external-generated/packages/shared-fs-cache/generators/init.json @@ -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" } diff --git a/docs/generated/manifests/extending-nx.json b/docs/generated/manifests/extending-nx.json index 6703ef0f3b..d8a20e7998 100644 --- a/docs/generated/manifests/extending-nx.json +++ b/docs/generated/manifests/extending-nx.json @@ -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"] } } diff --git a/docs/generated/manifests/menus.json b/docs/generated/manifests/menus.json index 2d19cc0314..2e47b5818d 100644 --- a/docs/generated/manifests/menus.json +++ b/docs/generated/manifests/menus.json @@ -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, diff --git a/docs/generated/manifests/nx-api.json b/docs/generated/manifests/nx-api.json index 32747428f9..03bf6a3890 100644 --- a/docs/generated/manifests/nx-api.json +++ b/docs/generated/manifests/nx-api.json @@ -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" } } diff --git a/docs/generated/manifests/nx.json b/docs/generated/manifests/nx.json index 190f9d2536..70cf98c037 100644 --- a/docs/generated/manifests/nx.json +++ b/docs/generated/manifests/nx.json @@ -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", diff --git a/docs/generated/manifests/tags.json b/docs/generated/manifests/tags.json index 378c5050ac..4c68a40bf5 100644 --- a/docs/generated/manifests/tags.json +++ b/docs/generated/manifests/tags.json @@ -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.", diff --git a/docs/map.json b/docs/map.json index 28e55deb6a..074ab8183a 100644 --- a/docs/map.json +++ b/docs/map.json @@ -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" } ] }, diff --git a/docs/nx-cloud/concepts/cache-security.md b/docs/nx-cloud/concepts/cache-security.md index 67785337c4..b68d37f547 100644 --- a/docs/nx-cloud/concepts/cache-security.md +++ b/docs/nx-cloud/concepts/cache-security.md @@ -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 diff --git a/docs/nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud.md b/docs/nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud.md index e2213d709c..d9bc22f130 100644 --- a/docs/nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud.md +++ b/docs/nx-cloud/enterprise/conformance/publish-conformance-rules-to-nx-cloud.md @@ -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" diff --git a/docs/shared/deprecated/custom-tasks-runner.md b/docs/shared/deprecated/custom-tasks-runner.md index 562c22214e..bafadb8b3c 100644 --- a/docs/shared/deprecated/custom-tasks-runner.md +++ b/docs/shared/deprecated/custom-tasks-runner.md @@ -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). diff --git a/docs/shared/deprecated/legacy-cache.md b/docs/shared/deprecated/legacy-cache.md index 25d0dd5bda..103aca3ad0 100644 --- a/docs/shared/deprecated/legacy-cache.md +++ b/docs/shared/deprecated/legacy-cache.md @@ -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) diff --git a/docs/shared/features/cache-task-results.md b/docs/shared/features/cache-task-results.md index 91b2064408..664240f8fc 100644 --- a/docs/shared/features/cache-task-results.md +++ b/docs/shared/features/cache-task-results.md @@ -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 diff --git a/docs/shared/features/powerpack/conformance.md b/docs/shared/features/powerpack/conformance.md index 8059b2a79f..ecddd51e67 100644 --- a/docs/shared/features/powerpack/conformance.md +++ b/docs/shared/features/powerpack/conformance.md @@ -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. diff --git a/docs/shared/features/powerpack/custom-caching.md b/docs/shared/features/powerpack/custom-caching.md deleted file mode 100644 index 33b14e61df..0000000000 --- a/docs/shared/features/powerpack/custom-caching.md +++ /dev/null @@ -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" /%} diff --git a/docs/shared/features/powerpack/free-licenses-and-trials.md b/docs/shared/features/powerpack/free-licenses-and-trials.md deleted file mode 100644 index 8a0ff458ee..0000000000 --- a/docs/shared/features/powerpack/free-licenses-and-trials.md +++ /dev/null @@ -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) diff --git a/docs/shared/features/powerpack/index.md b/docs/shared/features/powerpack/index.md index 52df7a5eaa..00c42ba09f 100644 --- a/docs/shared/features/powerpack/index.md +++ b/docs/shared/features/powerpack/index.md @@ -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 %} diff --git a/docs/shared/features/powerpack/licenses-and-trials.md b/docs/shared/features/powerpack/licenses-and-trials.md new file mode 100644 index 0000000000..f964cdc6bf --- /dev/null +++ b/docs/shared/features/powerpack/licenses-and-trials.md @@ -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. diff --git a/docs/shared/features/powerpack/owners.md b/docs/shared/features/powerpack/owners.md index ff46ef25ec..4e5e3fcbff 100644 --- a/docs/shared/features/powerpack/owners.md +++ b/docs/shared/features/powerpack/owners.md @@ -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" %} diff --git a/docs/shared/features/remote-cache.md b/docs/shared/features/remote-cache.md index ccf4b85004..ce71690675 100644 --- a/docs/shared/features/remote-cache.md +++ b/docs/shared/features/remote-cache.md @@ -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). diff --git a/docs/shared/guides/unknown-local-cache.md b/docs/shared/guides/unknown-local-cache.md index 8bc05b5679..6df36bf02f 100644 --- a/docs/shared/guides/unknown-local-cache.md +++ b/docs/shared/guides/unknown-local-cache.md @@ -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. diff --git a/docs/external-generated/packages/powerpack-azure-cache/documents/overview.md b/docs/shared/packages/azure-cache/azure-cache-plugin.md similarity index 53% rename from docs/external-generated/packages/powerpack-azure-cache/documents/overview.md rename to docs/shared/packages/azure-cache/azure-cache-plugin.md index 69531baf02..a74d8ec7b1 100644 --- a/docs/external-generated/packages/powerpack-azure-cache/documents/overview.md +++ b/docs/shared/packages/azure-cache/azure-cache-plugin.md @@ -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. diff --git a/docs/shared/packages/powerpack-conformance/powerpack-conformance-plugin.md b/docs/shared/packages/conformance/conformance-plugin.md similarity index 84% rename from docs/shared/packages/powerpack-conformance/powerpack-conformance-plugin.md rename to docs/shared/packages/conformance/conformance-plugin.md index 446120a35d..e36d4e7b7c 100644 --- a/docs/shared/packages/powerpack-conformance/powerpack-conformance-plugin.md +++ b/docs/shared/packages/conformance/conformance-plugin.md @@ -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) diff --git a/docs/external-generated/packages/powerpack-conformance/documents/create-conformance-rule.md b/docs/shared/packages/conformance/create-conformance-rule.md similarity index 90% rename from docs/external-generated/packages/powerpack-conformance/documents/create-conformance-rule.md rename to docs/shared/packages/conformance/create-conformance-rule.md index 4eb7718ac5..3ac33a858a 100644 --- a/docs/external-generated/packages/powerpack-conformance/documents/create-conformance-rule.md +++ b/docs/shared/packages/conformance/create-conformance-rule.md @@ -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'; diff --git a/docs/shared/packages/gcs-cache/gcs-cache-plugin.md b/docs/shared/packages/gcs-cache/gcs-cache-plugin.md new file mode 100644 index 0000000000..bd39e88874 --- /dev/null +++ b/docs/shared/packages/gcs-cache/gcs-cache-plugin.md @@ -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" + } +} +``` diff --git a/docs/shared/packages/powerpack-owners/powerpack-owners-plugin.md b/docs/shared/packages/owners/owners-plugin.md similarity index 85% rename from docs/shared/packages/powerpack-owners/powerpack-owners-plugin.md rename to docs/shared/packages/owners/owners-plugin.md index 3b6a7f8ed2..04abc8e230 100644 --- a/docs/shared/packages/powerpack-owners/powerpack-owners-plugin.md +++ b/docs/shared/packages/owners/owners-plugin.md @@ -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"] } } ``` diff --git a/docs/shared/packages/powerpack-shared-fs-cache/powerpack-shared-fs-cache-plugin.md b/docs/shared/packages/powerpack-shared-fs-cache/powerpack-shared-fs-cache-plugin.md deleted file mode 100644 index afe1b940fb..0000000000 --- a/docs/shared/packages/powerpack-shared-fs-cache/powerpack-shared-fs-cache-plugin.md +++ /dev/null @@ -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. diff --git a/docs/external-generated/packages/powerpack-s3-cache/documents/overview.md b/docs/shared/packages/s3-cache/s3-cache-plugin.md similarity index 71% rename from docs/external-generated/packages/powerpack-s3-cache/documents/overview.md rename to docs/shared/packages/s3-cache/s3-cache-plugin.md index 29395a60ff..e3ab7ce84c 100644 --- a/docs/external-generated/packages/powerpack-s3-cache/documents/overview.md +++ b/docs/shared/packages/s3-cache/s3-cache-plugin.md @@ -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: ... @@ -86,7 +102,7 @@ Nx can read the active access token [created after running `aws sso login`](http #### Credentials in `nx.json` File -Storing your credentials in the `nx.json` file is the least secure of the 4 authentication options, since anyone with read access to your code base will have access to your AWS credentials. +Storing your credentials in the `nx.json` file is the least secure of the 4 authentication options, since anyone with read access to your codebase will have access to your AWS credentials. ```jsonc {% fileName="nx.json" %} { @@ -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). diff --git a/docs/shared/packages/shared-fs-cache/shared-fs-cache-plugin.md b/docs/shared/packages/shared-fs-cache/shared-fs-cache-plugin.md new file mode 100644 index 0000000000..f5b7ef6cd8 --- /dev/null +++ b/docs/shared/packages/shared-fs-cache/shared-fs-cache-plugin.md @@ -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. diff --git a/docs/shared/recipes/installation/activate-powerpack.md b/docs/shared/recipes/installation/activate-powerpack.md index 5c6abb30c2..0b22e84af6 100644 --- a/docs/shared/recipes/installation/activate-powerpack.md +++ b/docs/shared/recipes/installation/activate-powerpack.md @@ -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 ` 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. diff --git a/docs/shared/recipes/plugins/task-running-lifecycle.md b/docs/shared/recipes/plugins/task-running-lifecycle.md new file mode 100644 index 0000000000..ba08fb93d4 --- /dev/null +++ b/docs/shared/recipes/plugins/task-running-lifecycle.md @@ -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 diff --git a/docs/shared/recipes/running-tasks/self-hosted-caching.md b/docs/shared/recipes/running-tasks/self-hosted-caching.md new file mode 100644 index 0000000000..e370b783e6 --- /dev/null +++ b/docs/shared/recipes/running-tasks/self-hosted-caching.md @@ -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" /%} diff --git a/docs/shared/reference/sitemap.md b/docs/shared/reference/sitemap.md index fbcbf9470d..ac5644707d 100644 --- a/docs/shared/reference/sitemap.md +++ b/docs/shared/reference/sitemap.md @@ -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) diff --git a/nx-dev/nx-dev/app/powerpack/page.tsx b/nx-dev/nx-dev/app/powerpack/page.tsx index c426c862ca..ecd47e51d5 100644 --- a/nx-dev/nx-dev/app/powerpack/page.tsx +++ b/nx-dev/nx-dev/app/powerpack/page.tsx @@ -51,7 +51,7 @@ export default function NxPowerPackPage(): ReactElement { -
+
diff --git a/nx-dev/nx-dev/app/remote-cache/page.tsx b/nx-dev/nx-dev/app/remote-cache/page.tsx new file mode 100644 index 0000000000..3d6cb175f3 --- /dev/null +++ b/nx-dev/nx-dev/app/remote-cache/page.tsx @@ -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 ( + + +
+ +
+
+ +
+
+ ); +} diff --git a/nx-dev/nx-dev/redirect-rules.js b/nx-dev/nx-dev/redirect-rules.js index 854ce1c4fe..02ee939403 100644 --- a/nx-dev/nx-dev/redirect-rules.js +++ b/nx-dev/nx-dev/redirect-rules.js @@ -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, }; diff --git a/nx-dev/nx-dev/tailwind.config.js b/nx-dev/nx-dev/tailwind.config.js index 1933f0db6d..5e35e9cb4f 100644 --- a/nx-dev/nx-dev/tailwind.config.js +++ b/nx-dev/nx-dev/tailwind.config.js @@ -96,6 +96,9 @@ module.exports = { 'blockquote p:last-of-type::after': { content: '', }, + s: { + '@apply text-gray-500': {}, + }, }, }, }, diff --git a/nx-dev/ui-common/src/lib/headers/documentation-header.tsx b/nx-dev/ui-common/src/lib/headers/documentation-header.tsx index 59148dd4a2..251fba4570 100644 --- a/nx-dev/ui-common/src/lib/headers/documentation-header.tsx +++ b/nx-dev/ui-common/src/lib/headers/documentation-header.tsx @@ -248,7 +248,7 @@ export function DocumentationHeader({