diff --git a/docs/blog/2022-07-14-setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx.md b/docs/blog/2022-07-14-setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx.md index 13b61983859ad..833d92f00ac10 100644 --- a/docs/blog/2022-07-14-setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx.md +++ b/docs/blog/2022-07-14-setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx.md @@ -744,5 +744,5 @@ You can find an example of such setup on the **Nx Recipe GitHub repository**: - 🧠 [Nx Docs](/getting-started/intro) - πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) - πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) -- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io) +- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools) - πŸ₯š [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038) diff --git a/docs/blog/2022-08-02-nx-14-5-cypess-v10-output-globs-linter-perf-react-tailwind-support.md b/docs/blog/2022-08-02-nx-14-5-cypess-v10-output-globs-linter-perf-react-tailwind-support.md index cbf018526edf7..34bd298d57b1b 100644 --- a/docs/blog/2022-08-02-nx-14-5-cypess-v10-output-globs-linter-perf-react-tailwind-support.md +++ b/docs/blog/2022-08-02-nx-14-5-cypess-v10-output-globs-linter-perf-react-tailwind-support.md @@ -300,5 +300,5 @@ npx nx migrate --run-migrations - 🧠 [Nx Docs](/getting-started/intro) - πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) - πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) -- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io) +- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools) - πŸ₯š [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038) diff --git a/docs/blog/2022-08-18-helping-the-environment-by-saving-two-centuries-of-compute-time.md b/docs/blog/2022-08-18-helping-the-environment-by-saving-two-centuries-of-compute-time.md index 1c4af1686e465..24f8c6333a89c 100644 --- a/docs/blog/2022-08-18-helping-the-environment-by-saving-two-centuries-of-compute-time.md +++ b/docs/blog/2022-08-18-helping-the-environment-by-saving-two-centuries-of-compute-time.md @@ -94,5 +94,5 @@ How to enable it? [Read more on the Lerna docs](https://lerna.js.org/docs/featur - 🧠 [Nx Docs](/getting-started/intro) - πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) - πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) -- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io) +- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools) - πŸ₯š [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038) diff --git a/docs/blog/2022-10-14-whats-new-in-nx-15.md b/docs/blog/2022-10-14-whats-new-in-nx-15.md index 1d6dfb7464758..0e112595d8008 100644 --- a/docs/blog/2022-10-14-whats-new-in-nx-15.md +++ b/docs/blog/2022-10-14-whats-new-in-nx-15.md @@ -257,5 +257,5 @@ npx nx migrate --run-migrations - 🧠 [Nx Docs](/getting-started/intro) - πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) - πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) -- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io) +- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools) - πŸ₯š [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038) 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 08e405a226c60..57dd1888e74f1 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 @@ -185,5 +185,5 @@ So keep an eye on our [Twitter](https://twitter.com/nxdevtools), [Youtube](https - 🧠 [Nx Docs](/getting-started/intro) - πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) - πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) -- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io) +- πŸ“Ή [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools) - πŸ₯š [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038) diff --git a/docs/blog/2023-02-22-whats-new-with-lerna-6-5.md b/docs/blog/2023-02-22-whats-new-with-lerna-6-5.md index 3b0797926e7bd..5ec8866bbcdfc 100644 --- a/docs/blog/2023-02-22-whats-new-with-lerna-6-5.md +++ b/docs/blog/2023-02-22-whats-new-with-lerna-6-5.md @@ -124,4 +124,4 @@ You can find [a roadmap for all the features we plan to add in Lerna 7](https:// - [🧠 Lerna Docs](https://lerna.js.org/) - [πŸ‘©β€πŸ’» Lerna GitHub](https://github.com/lerna/lerna) - [πŸ’¬ Nx Official Discord Server](https://go.nx.dev/community) -- [πŸ“Ή Nrwl Youtube Channel](https://www.youtube.com/nrwl_io) +- [πŸ“Ή Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools) diff --git a/docs/blog/2025-01-09-who-gave-js-a-build-step.md b/docs/blog/2025-01-09-who-gave-js-a-build-step.md index 99724b548dd41..352644260e4c7 100644 --- a/docs/blog/2025-01-09-who-gave-js-a-build-step.md +++ b/docs/blog/2025-01-09-who-gave-js-a-build-step.md @@ -199,4 +199,4 @@ We have an input format we want to work with - and an output format that we want - 🧠 [Nx Docs](/getting-started/intro) - πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) - πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) -- πŸ“Ή [Nx Youtube Channel](https://www.youtube.com/nrwl_io) +- πŸ“Ή [Nx Youtube Channel](https://www.youtube.com/@nxdevtools) diff --git a/docs/blog/2025-01-28-managing-ts-pkgs-in-monorepos.md b/docs/blog/2025-01-28-managing-ts-pkgs-in-monorepos.md index 83e43b6a1008e..6a4c875861beb 100644 --- a/docs/blog/2025-01-28-managing-ts-pkgs-in-monorepos.md +++ b/docs/blog/2025-01-28-managing-ts-pkgs-in-monorepos.md @@ -672,4 +672,4 @@ Also check out our docs: - 🧠 [Nx Docs](/getting-started/intro) - πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) - πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) -- πŸ“Ή [Nx Youtube Channel](https://www.youtube.com/nrwl_io) +- πŸ“Ή [Nx Youtube Channel](https://www.youtube.com/@nxdevtools) diff --git a/docs/blog/2025-01-29-new-nx-experience.md b/docs/blog/2025-01-29-new-nx-experience.md index e441530572124..a1f16513b172a 100644 --- a/docs/blog/2025-01-29-new-nx-experience.md +++ b/docs/blog/2025-01-29-new-nx-experience.md @@ -380,4 +380,4 @@ If you're working in a large monorepo and **struggling with the performance issu - 🧠 [Nx Docs](/getting-started/intro) - πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) - πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) -- πŸ“Ή [Nx Youtube Channel](https://www.youtube.com/nrwl_io) +- πŸ“Ή [Nx Youtube Channel](https://www.youtube.com/@nxdevtools) diff --git a/docs/blog/2025-02-03-workspace-structure.md b/docs/blog/2025-02-03-workspace-structure.md index 58736bf83f14f..6e4a3b3832fdf 100644 --- a/docs/blog/2025-02-03-workspace-structure.md +++ b/docs/blog/2025-02-03-workspace-structure.md @@ -215,4 +215,4 @@ If you want more insight into this topic, here are other resources we recommend: - 🧠 [Nx Docs](/getting-started/intro) - πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) - πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) -- πŸ“Ή [Nx Youtube Channel](https://www.youtube.com/nrwl_io) +- πŸ“Ή [Nx Youtube Channel](https://www.youtube.com/@nxdevtools) diff --git a/docs/blog/2025-02-17-monorepos-are-ai-future-proof.md b/docs/blog/2025-02-17-monorepos-are-ai-future-proof.md new file mode 100644 index 0000000000000..104ae354066c0 --- /dev/null +++ b/docs/blog/2025-02-17-monorepos-are-ai-future-proof.md @@ -0,0 +1,143 @@ +--- +title: 'Monorepos are AI Future-Proof' +slug: monorepos-are-ai-future-proof +authors: ['Juri Strumpflohner'] +tags: ['nx'] +cover_image: +youtubeUrl: https://youtu.be/RNilYmJJzdk +--- + +Everyone is constantly pushing to be more productive: delivering more features, reducing overhead, and keeping up with increasing demands. Companies want to move faster, and engineering teams work toward the same goal, looking for ways to streamline development and ship more with fewer resources. LLMs offer a promising way to boost efficiency, whether by assisting individual developers or improving workflows across a team. + +However, the quality of an LLM’s response depends entirely on the data and context it has access to. Ask an LLM (in this case, GitHub Copilot with GPT-4o) about the structure of an NPM workspace monorepo, and you probably won’t be satisfied with the result: + +![nx-ai-before-workspace-structure.avif](/blog/images/articles/nx-ai-before-workspace-structure.avif) + +Now compare that result, using the exact same question, but with additional context provided to the LLM: + +![nx-ai-after-workspace-structure.avif](/blog/images/articles/nx-ai-after-workspace-structure.avif) + +The difference is huge. Copilot now understands the architectural structure of the workspace. It recognizes that there are apps and libraries, their types (such as "data access" libraries), and how each relates to other projects in the monorepo. + +![nx-ai-after-workspace-structure2.avif](/blog/images/articles/nx-ai-after-workspace-structure2.avif) + +**So what changed?** Let’s break it down. + +{% toc /%} + +## Monorepos Break Down Barriers + +When we (at Nx) [work with large enterprises](/enterprise), we often see patterns that lead to inefficiencies: + +- **Siloed knowledge** – Developers only have visibility into the areas they actively work on. Without a broader view, duplication increases, communication slows down, and collaboration suffers. +- **Fragmentation** – Code is spread across multiple repositories with little integration. LLMs don’t automatically understand how different projects connect or who owns what. +- **Lack of integration** – Many productivity bottlenecks come from friction at integration points between teams. + +LLMs face the same challenges. They operate on a small scope, usually a few files at a time, but **lack architectural awareness**. They don’t know how projects relate to each other, where the integration points are, or which team owns a given project. + +Monorepos solve visibility and fragmentation issues by consolidating related projects into a single repository. This gives teams a shared view, removes communication barriers, reduces duplication, and improves collaboration. + +**The same visibility that helps developers also helps an LLM.** Think about it: when you open your monorepo in VSCode or Cursor, you can see multiple related projects in one place. That’s very different from working across scattered repositories. + +The problem? Even though your entire codebase is accessible, an LLM still only sees files and their contents. It doesn’t understand which project a file belongs to or how that project interacts with others. It simply lacks that knowledge. + +This is where Nx comes in. + +## Nx Understands Your Monorepo + +Monorepos don’t come for free. While they improve visibility and collaboration, they introduce scaling challenges. This is where tools like Nx step in, helping you get the benefits of a monorepo while managing the complexity that comes with it. + +Over the years, we’ve built features like [Nx Replay](/ci/features/remote-cache) and [Nx Agents](/ci/features/distribute-task-execution) to keep CI fast, while [conformance rules](/nx-enterprise/powerpack/conformance), [ownership](/nx-enterprise/powerpack/owners), and [local repository automation](/extending-nx/intro/getting-started) help manage and scale a monorepo in the long run. + +To power these features, **Nx collects metadata about your workspace**, understanding relationships between projects, ownership, technology types, available tasks, and more. The [Nx daemon](/concepts/nx-daemon) runs in the background, keeping this metadata up to date and making sure Nx operates efficiently. + +**Nx understands project relationships down to the file level**, tracking dependencies. For example, in the image below, `src/app/app.tsx` imports a component from `@aishop/feat-create-order`, and Nx knows exactly how these projects connect. + +![nx-ai-project-relationships.avif](/blog/images/articles/nx-ai-project-relationships.avif) + +**Nx also tracks available targets for each project**. If you’re using [Code Owners](/nx-enterprise/powerpack/owners), it **knows who owns what within your monorepo**. + +![nx-ai-project-detail-view.avif](/blog/images/articles/nx-ai-project-detail-view.avif) + +It **identifies relevant files for each target** based on the input and output properties defined in the [cache configuration](/features/cache-task-results#finetune-caching-with-inputs-and-outputs). + +![nx-ai-cache-inputs.avif](/blog/images/articles/nx-ai-cache-inputs.avif) + +Nx also knows about **project tags, helping classify domains, project types, or any other custom attributes** you’ve applied. + +![nx-ai-project-tags.avif](/blog/images/articles/nx-ai-project-tags.avif) + +Nx plugins come with **[code generators](/features/generate-code)** that can scaffold entire projects. These generators have well-defined [schemas](https://github.com/nrwl/nx/blob/804df721a729da41d804c57a829828c96d265d79/packages/js/src/generators/library/schema.json) that describe the available properties, their descriptions, and which ones are required. This structured metadata makes them an ideal data source for LLMs, allowing them to provide more accurate and meaningful suggestions when interacting with your monorepo. + +![nx-ai-generator-schema.avif](/blog/images/articles/nx-ai-generator-schema.avif) + +These are just some examples of the metadata Nx maintains about your monorepo. + +Beyond that, the [Nx documentation already includes an AI-powered chat](/ai-chat), and its data can be injected directly into your LLM conversations as well. + +![nx-ai-docs-assistant.avif](/blog/images/articles/nx-ai-docs-assistant.avif) + +## Nx Makes Your LLM Way Smarter + +All of this data is a goldmine for enhancing your LLM. Luckily we're kinda obsessed with good DX which is why we had an editor for a long time: [Nx Console](/getting-started/editor-setup). + +While you could build your own chat-based LLM integration, the best approach is to make it work where developers already spend their time: inside the editor. Nx Console is the perfect fit for this. It already enhances your monorepo workflow by providing IntelliSense, running code generators, and [integrating with CI](/blog/nx-cloud-pipelines-come-to-nx-console). Now, we've taken it a step further. + +We extended Nx Console with an integration for Copilot that preprocesses Nx metadata and provides the LLM with details about: + +- The workspace structure, including applications and libraries. +- How projects are connected. +- A project’s technology stack. +- Tasks and which files are relevant for each task (e.g., spec files for test runs). +- Categorization via tags and dependency rules. +- Project ownership information. +- … + +The result: **your LLM just got significantly smarter**, moving beyond basic file-level reasoning to understanding your workspace at an architectural level. + +Let's go through some concrete examples. You can try these yourself by [installing Nx Console](/getting-started/editor-setup) or updating to the latest version. + +Here, we ask Copilot about projects, their dependencies, and ownership details: + +![nx-ai-example-project-data.avif](/blog/images/articles/nx-ai-example-project-data.avif) + +We can also go deeper, asking where to best implement certain types of functionality: + +![nx-ai-example-data-access-feature.avif](/blog/images/articles/nx-ai-example-data-access-feature.avif) + +In a larger enterprise, this also means you can ask about who to talk to when implementing or planning a new feature. Thanks to Nx metadata, the LLM understands ownership: + +![nx-ai-example-ownership.avif](/blog/images/articles/nx-ai-example-ownership.avif) + +And since we made the LLM aware of [Nx generators](/features/generate-code), we can ask it to help set up a new project. Notice how it not only suggests the correct command but also places the new project in the `packages/products` subfolder. We even added action buttons to either run the command immediately or open it in [Nx Console's generator UI](/recipes/nx-console/console-generate-command). + +![nx-ai-example-generate-code.avif](/blog/images/articles/nx-ai-example-generate-code.avif) + +Beyond that, since we also feed documentation data into the LLM, it can now answer questions about Nx itself: + +![nx-ai-example-cache-config.avif](/blog/images/articles/nx-ai-example-cache-config.avif) + +## Nx Monorepos Are AI Future-Proof + +Right now, most LLM editor extensions operate at the file level, unless you manually feed them additional context. But this is going to change. LLMs will continue to improve, and most importantly, their context windows will grow. + +That's why **we strongly believe monorepos are AI future-proof**. They provide a consolidated view of multiple projects, and when enhanced with Nx metadata, they allow an LLM to reason at a higher architectural level. Instead of just answering file-specific questions, it can assist with broader development workflows, project structure, and cross-project interactions. + +And this is just the beginning. While Nx already understands your local monorepo, [Nx Cloud](/nx-cloud) holds valuable CI-related data, tracking which tasks take the longest, where failures are most common, identifying flaky tasks, and even mapping project relationships beyond a single monorepo. Combining local workspace metadata with Nx Cloud insights creates an even richer foundation for LLMs, unlocking more meaningful suggestions and optimizations. + +## Wanna Try It Yourself? + +If you want to test this out, [create a new Nx workspace](/getting-started/intro#try-nx-yourself) and make sure you have [Nx Console](/getting-started/editor-setup) installed or updated to the latest version. + +> If you already have an existing NPM/Yarn/PNPM workspace, you can add Nx with `nx init`. Check out [our free course](/courses/pnpm-nx-next) to learn more. + +While Nx Console is also available for WebStorm, the AI-powered extensions currently only work with VSCode and Copilot. + +--- + +Learn more: + +- 🧠 [Nx Docs](/getting-started/intro) +- πŸ‘©β€πŸ’» [Nx GitHub](https://github.com/nrwl/nx) +- πŸ’¬ [Nx Official Discord Server](https://go.nx.dev/community) +- πŸ“Ή [Nx Youtube Channel](https://www.youtube.com/@nxdevtools) diff --git a/docs/blog/images/articles/nx-ai-after-workspace-structure.avif b/docs/blog/images/articles/nx-ai-after-workspace-structure.avif new file mode 100644 index 0000000000000..cb692e400b1b4 Binary files /dev/null and b/docs/blog/images/articles/nx-ai-after-workspace-structure.avif differ diff --git a/docs/blog/images/articles/nx-ai-after-workspace-structure2.avif b/docs/blog/images/articles/nx-ai-after-workspace-structure2.avif new file mode 100644 index 0000000000000..ad0d8bcdebc13 Binary files /dev/null and b/docs/blog/images/articles/nx-ai-after-workspace-structure2.avif differ diff --git a/docs/blog/images/articles/nx-ai-before-workspace-structure.avif b/docs/blog/images/articles/nx-ai-before-workspace-structure.avif new file mode 100644 index 0000000000000..64512f705242a Binary files /dev/null and b/docs/blog/images/articles/nx-ai-before-workspace-structure.avif differ diff --git a/docs/blog/images/articles/nx-ai-cache-inputs.avif b/docs/blog/images/articles/nx-ai-cache-inputs.avif new file mode 100644 index 0000000000000..26d3c3de455cb Binary files /dev/null and b/docs/blog/images/articles/nx-ai-cache-inputs.avif differ diff --git a/docs/blog/images/articles/nx-ai-docs-assistant.avif b/docs/blog/images/articles/nx-ai-docs-assistant.avif new file mode 100644 index 0000000000000..4c9c3a06a0fa2 Binary files /dev/null and b/docs/blog/images/articles/nx-ai-docs-assistant.avif differ diff --git a/docs/blog/images/articles/nx-ai-example-cache-config.avif b/docs/blog/images/articles/nx-ai-example-cache-config.avif new file mode 100644 index 0000000000000..0d46dc2c57a20 Binary files /dev/null and b/docs/blog/images/articles/nx-ai-example-cache-config.avif differ diff --git a/docs/blog/images/articles/nx-ai-example-data-access-feature.avif b/docs/blog/images/articles/nx-ai-example-data-access-feature.avif new file mode 100644 index 0000000000000..e20305482468a Binary files /dev/null and b/docs/blog/images/articles/nx-ai-example-data-access-feature.avif differ diff --git a/docs/blog/images/articles/nx-ai-example-generate-code.avif b/docs/blog/images/articles/nx-ai-example-generate-code.avif new file mode 100644 index 0000000000000..01430e8505dcf Binary files /dev/null and b/docs/blog/images/articles/nx-ai-example-generate-code.avif differ diff --git a/docs/blog/images/articles/nx-ai-example-ownership.avif b/docs/blog/images/articles/nx-ai-example-ownership.avif new file mode 100644 index 0000000000000..53cf50c9d477b Binary files /dev/null and b/docs/blog/images/articles/nx-ai-example-ownership.avif differ diff --git a/docs/blog/images/articles/nx-ai-example-project-data.avif b/docs/blog/images/articles/nx-ai-example-project-data.avif new file mode 100644 index 0000000000000..0b66e20311cae Binary files /dev/null and b/docs/blog/images/articles/nx-ai-example-project-data.avif differ diff --git a/docs/blog/images/articles/nx-ai-generator-schema.avif b/docs/blog/images/articles/nx-ai-generator-schema.avif new file mode 100644 index 0000000000000..d0d624c168dc4 Binary files /dev/null and b/docs/blog/images/articles/nx-ai-generator-schema.avif differ diff --git a/docs/blog/images/articles/nx-ai-project-detail-view.avif b/docs/blog/images/articles/nx-ai-project-detail-view.avif new file mode 100644 index 0000000000000..c158244a8aa40 Binary files /dev/null and b/docs/blog/images/articles/nx-ai-project-detail-view.avif differ diff --git a/docs/blog/images/articles/nx-ai-project-relationships.avif b/docs/blog/images/articles/nx-ai-project-relationships.avif new file mode 100644 index 0000000000000..4147b761b648f Binary files /dev/null and b/docs/blog/images/articles/nx-ai-project-relationships.avif differ diff --git a/docs/blog/images/articles/nx-ai-project-tags.avif b/docs/blog/images/articles/nx-ai-project-tags.avif new file mode 100644 index 0000000000000..a1735c710e06c Binary files /dev/null and b/docs/blog/images/articles/nx-ai-project-tags.avif differ