docs(core): local links should not use nx.dev (#23380)
Ensure that local links start with `/` instead of `https://nx.dev/`
This commit is contained in:
parent
9122b85616
commit
6c0ba0ee3a
@ -75,7 +75,7 @@ In addition to the GitHub, we expanded our Nx Cloud live status updates to work
|
||||
|
||||

|
||||
|
||||
We have extensive experience working with Fortune 500 companies, helping them scale their development using monorepos. This has given us valuable insight into the unique security requirements of these companies. Our [Enterprise plan](https://nx.dev/enterprise) reflects that allowing organizations to have a **fully self-contained version of Nx Cloud** that can be **hosted on their own servers** and comes with dedicated support from the Nx and Nx Cloud core team.
|
||||
We have extensive experience working with Fortune 500 companies, helping them scale their development using monorepos. This has given us valuable insight into the unique security requirements of these companies. Our [Enterprise plan](/enterprise) reflects that allowing organizations to have a **fully self-contained version of Nx Cloud** that can be **hosted on their own servers** and comes with dedicated support from the Nx and Nx Cloud core team.
|
||||
|
||||
We’ve recently made a couple of improvements to our enterprise offering.
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ cover_image: '/blog/images/2023-08-15/featured_img.png'
|
||||
tags: [nx, changelog, release]
|
||||
---
|
||||
|
||||
In the ever-evolving web development landscape, efficiency and modularity have become paramount. This is where [Nx](https://nx.dev) and [Qwik](https://qwik.dev/) come into play.
|
||||
In the ever-evolving web development landscape, efficiency and modularity have become paramount. This is where [Nx]() and [Qwik](https://qwik.dev/) come into play.
|
||||
|
||||
Qwik is a modern web framework that focuses on application performance by reducing the amount of JavaScript that needs to be shipped to the browser. You can learn more about how Qwik achieves this with [Resumability in their docs](https://qwik.dev/docs/concepts/resumable/).
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ And you’ll have access to Nx generators so that you can generate Vue applicati
|
||||
|
||||
We’re very excited for this support to land, and we’re eager to get it into our user’s hands and see what Nx can do to help Vue developers so we can continue to refine our support and make Vue with Nx an excellent developer experience.
|
||||
|
||||
If you’re eager to learn more, make sure to check out our new [Vue standalone tutorial](https://nx.dev/getting-started/tutorials/vue-standalone-tutorial).
|
||||
If you’re eager to learn more, make sure to check out our new [Vue standalone tutorial](/getting-started/tutorials/vue-standalone-tutorial).
|
||||
|
||||
## Enhancements to Module Federation Support
|
||||
|
||||
@ -141,7 +141,7 @@ Finally, generators will now factory in your current working directory, so you c
|
||||
|
||||
## The NEW Nx AI ChatBot
|
||||
|
||||
We’ve added a new AI ChatBot to our docs site. You can access it now at [https://nx.dev/ai-chat](https://nx.dev/ai-chat).
|
||||
We’ve added a new AI ChatBot to our docs site. You can access it now at [https://nx.dev/ai-chat](/ai-chat).
|
||||
|
||||

|
||||
|
||||
@ -170,9 +170,9 @@ We’ve also removed the need to specify `cacheableOperations` at the task-runne
|
||||
}
|
||||
```
|
||||
|
||||
If you use the `nx migrate` command, all updates will be handled for you using the `targetDefaults` in your `nx.json` file. [More in the docs.](https://nx.dev/features/cache-task-results)
|
||||
If you use the `nx migrate` command, all updates will be handled for you using the `targetDefaults` in your `nx.json` file. [More in the docs.](/features/cache-task-results)
|
||||
|
||||
We’ve been working hard at reducing and simplifying all the configuration required for your Nx workspaces. Checkout our latest guide on how to [Reduce Repetitive Configuration](https://nx.dev/recipes/running-tasks/reduce-repetitive-configuration) for more, and stay tuned as we’ve got new efforts underway to make this simplification even more appealing!
|
||||
We’ve been working hard at reducing and simplifying all the configuration required for your Nx workspaces. Checkout our latest guide on how to [Reduce Repetitive Configuration](/recipes/running-tasks/reduce-repetitive-configuration) for more, and stay tuned as we’ve got new efforts underway to make this simplification even more appealing!
|
||||
|
||||
## Nx Repo Dog-Fooding Nx Workflows
|
||||
|
||||
@ -226,15 +226,15 @@ In Nx 17, we removed any remaining traces of `tslint` from our linter package, s
|
||||
|
||||
As we solidify this command, we intend to bring robust support for various versioning and publishing strategies, as well as built-in support for publishing packages or modules to a variety of languages, registries, and platforms.
|
||||
|
||||
For more [checkout our API docs](https://nx.dev/nx-api/nx/documents/release), and be sure to catch James Henry’s announcement of this new command at [Nx Conf](https://dev.to/nx/nx-conf-2023-recap-53ep):
|
||||
For more [checkout our API docs](/nx-api/nx/documents/release), and be sure to catch James Henry’s announcement of this new command at [Nx Conf](https://dev.to/nx/nx-conf-2023-recap-53ep):
|
||||
|
||||
{% youtube src="https://www.youtube.com/embed/p5qW5-2nKqI?si=FzpGMJwPVINc1hgL" /%}
|
||||
|
||||
## Experimental: Nx Project Inference API v2
|
||||
|
||||
At Nx, we’re OBSESSED with building a better, more robust experience for our developers. Towards this end, we’re now in [v2 of our Project Inference API](https://nx.dev/extending-nx/recipes/project-graph-plugins).
|
||||
At Nx, we’re OBSESSED with building a better, more robust experience for our developers. Towards this end, we’re now in [v2 of our Project Inference API](/extending-nx/recipes/project-graph-plugins).
|
||||
|
||||
This API is a way of extending the Nx project graph, which can be particularly helpful for extending Nx to support other languages, allowing Nx to determine where to find and draw boundaries around projects in your workspace. A great example is our very own [Vue plugin](https://nx.dev/getting-started/tutorials/vue-standalone-tutorial).
|
||||
This API is a way of extending the Nx project graph, which can be particularly helpful for extending Nx to support other languages, allowing Nx to determine where to find and draw boundaries around projects in your workspace. A great example is our very own [Vue plugin](/getting-started/tutorials/vue-standalone-tutorial).
|
||||
|
||||
Interestingly, v2 includes support for dynamic targets as well. This opens up exciting new doors to reducing configuration, and we hope to expand on this to better support our first-party plugins in the near future.
|
||||
|
||||
@ -244,7 +244,7 @@ For most developers, the main thing you need to know is that plugins may now add
|
||||
> nx show project <project_name>
|
||||
```
|
||||
|
||||
For plugin authors, check out the [v2 documentation](https://nx.dev/extending-nx/recipes/project-graph-plugins) to see how you can take advantage of the new API to deliver a better experience to your users.
|
||||
For plugin authors, check out the [v2 documentation](/extending-nx/recipes/project-graph-plugins) to see how you can take advantage of the new API to deliver a better experience to your users.
|
||||
|
||||
## 20k Github Stars!!
|
||||
|
||||
@ -254,7 +254,7 @@ Nx is SOOO CLOSE to 20,000 stars on github! If Nx has been helpful to you, [plea
|
||||
|
||||
## How to Update Nx
|
||||
|
||||
Nx is known to [help you automatically migrate](https://nx.dev/features/automate-updating-dependencies) to the new version (including potentially breaking changes). To update simply run:
|
||||
Nx is known to [help you automatically migrate](/features/automate-updating-dependencies) to the new version (including potentially breaking changes). To update simply run:
|
||||
|
||||
```shell
|
||||
> npx nx migrate latest
|
||||
|
||||
@ -5,7 +5,7 @@ cover_image: '/blog/images/2023-11-22/featured_img.webp'
|
||||
tags: [nx, unit testing]
|
||||
---
|
||||
|
||||
In my latest [blog](https://dev.to/nx/step-by-step-guide-to-creating-an-expo-monorepo-with-nx-3b17), I successfully navigated through the steps of setting up an Expo Monorepo with [Nx](https://nx.dev). The next challenge? Testing! This blog dives into:
|
||||
In my latest [blog](https://dev.to/nx/step-by-step-guide-to-creating-an-expo-monorepo-with-nx-3b17), I successfully navigated through the steps of setting up an Expo Monorepo with [Nx](). The next challenge? Testing! This blog dives into:
|
||||
|
||||
- Crafting effective unit tests for Expo components utilizing Jest
|
||||
- Addressing common issues encountered during unit testing
|
||||
|
||||
@ -31,7 +31,7 @@ It is that time again: getting flooded by Year of Review blog posts. We did it l
|
||||
|
||||
## Top 10 Nx Highlights of 2023
|
||||
|
||||
We shipped a ton of features in 2023. You can find all our release blog posts and release-related info here: [https://nx.dev/changelog](https://nx.dev/changelog) or check out our [Dev.to collection](https://dev.to/nx).
|
||||
We shipped a ton of features in 2023. You can find all our release blog posts and release-related info here: [https://nx.dev/changelog](/changelog) or check out our [Dev.to collection](https://dev.to/nx).
|
||||
|
||||
We've picked out 10 highlights for you.
|
||||
|
||||
@ -45,7 +45,7 @@ Following this, we revamped the TypeScript dependency resolution, observing an a
|
||||
|
||||
{% tweet url="https://twitter.com/juristr/status/1726977598218199302" /%}
|
||||
|
||||
Such enhancements are especially crucial for the efficient [project graph calculation](https://nx.dev/features/explore-graph). As we continue to evolve Nx, Rust will play a key role in optimizing performance-critical components. This strategic use of Rust complements our ongoing commitment to TypeScript, ensuring Nx remains as extensible and powerful as ever.
|
||||
Such enhancements are especially crucial for the efficient [project graph calculation](/features/explore-graph). As we continue to evolve Nx, Rust will play a key role in optimizing performance-critical components. This strategic use of Rust complements our ongoing commitment to TypeScript, ensuring Nx remains as extensible and powerful as ever.
|
||||
|
||||
### First Class Vite Support
|
||||
|
||||
@ -55,7 +55,7 @@ Our collaboration with our friends in the Vite core team has been incredibly fru
|
||||
|
||||

|
||||
|
||||
We also built some powerful code generators that not only facilitate a seamless [transition from Webpack to Vite](https://nx.dev/nx-api/vite/generators/configuration#nxviteconfiguration) but also pave the way for an effortless [migration from a CRA-based setup](https://nx.dev/recipes/adopting-nx/adding-to-existing-project) to a modern Nx + Vite based workspace. To see this process in action, [check out this short video](https://www.youtube.com/watch?v=zvYb7XCLQzU).
|
||||
We also built some powerful code generators that not only facilitate a seamless [transition from Webpack to Vite](/nx-api/vite/generators/configuration#nxviteconfiguration) but also pave the way for an effortless [migration from a CRA-based setup](/recipes/adopting-nx/adding-to-existing-project) to a modern Nx + Vite based workspace. To see this process in action, [check out this short video](https://www.youtube.com/watch?v=zvYb7XCLQzU).
|
||||
|
||||
[AnalogJS](https://analogjs.org/) — the fullstack Angular meta-framework which also heavily builds on top of Vite — is using the `@nx/vite` plugin to power its Angular and Nx based workspaces.
|
||||
|
||||
@ -65,7 +65,7 @@ We also spoke at both editions of [ViteConf](https://viteconf.org/23/). If you
|
||||
|
||||
Open source libraries and frameworks share a common necessity: the need to develop multiple packages cohesively and efficiently while managing their versioning and publishing to NPM. Nx has emerged as a go-to choice for handling such open source monorepos (as we’ll explore further in the next section of this blog post). Until recently, one area Nx did not address directly was versioning and release management. Traditionally, this gap has been filled with tools like [release-it](https://github.com/release-it/release-it), [changesets](https://github.com/changesets/changesets), or custom Node scripts, similar to our approach in the Nx repository.
|
||||
|
||||
However, many in our community have expressed a desire for a more native, integrated experience for versioning and publishing, akin to what Lerna offers. In response to this feedback, we’ve introduced [the “nx release” command](https://nx.dev/features/manage-releases), a solution designed to seamlessly integrate these processes into the Nx workflow.
|
||||
However, many in our community have expressed a desire for a more native, integrated experience for versioning and publishing, akin to what Lerna offers. In response to this feedback, we’ve introduced [the “nx release” command](/features/manage-releases), a solution designed to seamlessly integrate these processes into the Nx workflow.
|
||||
|
||||
James Henry gave a deep dive talk of an early version of it at this year’s Nx Conf:
|
||||
|
||||
@ -76,7 +76,7 @@ Since its introduction, the “nx release” feature has significantly evolved,
|
||||
- Versioning packages offering support for both independent and “locked” versioning strategies.
|
||||
- Releasing packages in the correct sequence, ensuring dependency integrity.
|
||||
|
||||
Beyond these core functionalities, the feature also includes a robust grouping mechanism, supports semantic versioning, and changelog generation. Additionally, it provides various release targets, such as GitHub and NPM. For those having special requirements, the [programmatic API](https://nx.dev/features/manage-releases#using-the-programmatic-api-for-nx-release) offers maximum flexibility.
|
||||
Beyond these core functionalities, the feature also includes a robust grouping mechanism, supports semantic versioning, and changelog generation. Additionally, it provides various release targets, such as GitHub and NPM. For those having special requirements, the [programmatic API](/features/manage-releases#using-the-programmatic-api-for-nx-release) offers maximum flexibility.
|
||||
|
||||
### Improved Node Backend Development: Fastify and Docker
|
||||
|
||||
@ -192,7 +192,7 @@ Here’s a video that walks you through:
|
||||
|
||||
{% youtube src="https://www.youtube.com/embed/Vy4d0-SF5cY?si=mHatqRPRqHAK0X9o" /%}
|
||||
|
||||
But we wouldn’t be talking about Nx if we didn’t also look into speeding up TypeScript compilation for large monorepos. We called it “[batch mode](https://nx.dev/showcase/benchmarks/tsc-batch-mode)”. When enabling batch mode, Nx leverages the underlying [project graph](https://nx.dev/features/explore-graph) to generate TypeScript project references behind the scenes for you, to fully leverage TS incremental building. The results are amazing. According to [our benchmarks](https://github.com/nrwl/large-ts-monorepo), batch mode has the potential to speed up Typescript compilation by up to 5x for large monorepos.
|
||||
But we wouldn’t be talking about Nx if we didn’t also look into speeding up TypeScript compilation for large monorepos. We called it “[batch mode](/showcase/benchmarks/tsc-batch-mode)”. When enabling batch mode, Nx leverages the underlying [project graph](/features/explore-graph) to generate TypeScript project references behind the scenes for you, to fully leverage TS incremental building. The results are amazing. According to [our benchmarks](https://github.com/nrwl/large-ts-monorepo), batch mode has the potential to speed up Typescript compilation by up to 5x for large monorepos.
|
||||
|
||||

|
||||
|
||||
@ -218,17 +218,17 @@ And you’ll then have access to Nx generators so you can create Vue application
|
||||
|
||||

|
||||
|
||||
Checkout out our [Vue standalone tutorial](https://nx.dev/getting-started/tutorials/vue-standalone-tutorial) for more, as well as our [Vue API docs](https://nx.dev/nx-api/vue), and stay tuned as Nx prepares to offer more Vue support (including support for [Nuxt](https://nuxt.com/), a full-stack framework built around Vue) in the near future!
|
||||
Checkout out our [Vue standalone tutorial](/getting-started/tutorials/vue-standalone-tutorial) for more, as well as our [Vue API docs](/nx-api/vue), and stay tuned as Nx prepares to offer more Vue support (including support for [Nuxt](https://nuxt.com/), a full-stack framework built around Vue) in the near future!
|
||||
|
||||
### Extending Nx: Local Generators, Build your Own CLI, Verdaccio Support
|
||||
|
||||
Extensibility is at the heart of Nx, serving as the cornerstone of its flexibility. It enables the Nx core team to continually expand capabilities through dedicated plugins and simultaneously paves the way for a rich array of [community plugin contributions](https://nx.dev/plugin-registry). Furthermore, Nx’s adaptable nature is particularly beneficial for large enterprises, as it allows for the creation of custom automation solutions, specifically tailored to meet their unique organizational needs.
|
||||
Extensibility is at the heart of Nx, serving as the cornerstone of its flexibility. It enables the Nx core team to continually expand capabilities through dedicated plugins and simultaneously paves the way for a rich array of [community plugin contributions](/plugin-registry). Furthermore, Nx’s adaptable nature is particularly beneficial for large enterprises, as it allows for the creation of custom automation solutions, specifically tailored to meet their unique organizational needs.
|
||||
|
||||
In 2023 we kept improving Nx’s extensibility, unifying the Nx plugin development model and how you develop workspace-local automations. You can now scaffold a new plugin into your Nx workspace and run it right away which makes it an interesting approach to automate your monorepo.
|
||||
|
||||
{% youtube src="https://www.youtube.com/embed/myqfGDWC2go?si=q6_9JReS1nF8d3pZ" /%}
|
||||
|
||||
When creating automations with Nx you cannot just enhance existing Nx workspaces, but also develop a complete [Nx preset](https://nx.dev/extending-nx/recipes/create-preset) that controls the entire appearance of an Nx workspace. Basically your own, personalized `create-nx-workspace`. You can publish and then use your preset like:
|
||||
When creating automations with Nx you cannot just enhance existing Nx workspaces, but also develop a complete [Nx preset](/extending-nx/recipes/create-preset) that controls the entire appearance of an Nx workspace. Basically your own, personalized `create-nx-workspace`. You can publish and then use your preset like:
|
||||
|
||||
```shell
|
||||
npx create-nx-workspace myrepo --preset=@yourpkg/nx-preset
|
||||
@ -250,7 +250,7 @@ Simply put, Module Federation allows a Javascript application running in a brows
|
||||
|
||||
This is an exciting development as it allows a paradigm shift in how you can architect, build, and deploy Javascript applications! And this is especially exciting for monorepo fans, as Nx has best-in-class support for module federation that makes a Module Federation approach easy to adopt and simple to understand!
|
||||
|
||||
Currently, our `@nx/angular` and `@nx/react` plugins both have generators to [create a “host” application](https://nx.dev/recipes/module-federation/create-a-host) that will load and consume federated modules from [“remote” applications](https://nx.dev/recipes/module-federation/create-a-remote), which you can also generate using Nx. Then, by running a simple command with Nx, you can serve all applications required for your host application with the command:
|
||||
Currently, our `@nx/angular` and `@nx/react` plugins both have generators to [create a “host” application](/recipes/module-federation/create-a-host) that will load and consume federated modules from [“remote” applications](/recipes/module-federation/create-a-remote), which you can also generate using Nx. Then, by running a simple command with Nx, you can serve all applications required for your host application with the command:
|
||||
|
||||
```shell
|
||||
nx serve host-application --devRemotes=remote-application
|
||||
@ -258,9 +258,9 @@ nx serve host-application --devRemotes=remote-application
|
||||
|
||||
Where in the example above your host application is named “host-application” and a remote application that you want live updates on as you’re developing is named “remote-application”.
|
||||
|
||||
Throughout 2023, we’ve continued to increase Nx’s support and general dev experience around Module Federation, including [adding a generator to federate an existing module](https://nx.dev/recipes/module-federation/federate-a-module), improving the local developer experience by improving local webserver performance, and introducing the concept of [Dynamic Module Federation](https://nx.dev/recipes/angular/dynamic-module-federation-with-angular#advanced-angular-micro-frontends-with-dynamic-module-federation) which will allow you to dynamically specify the location of your remote applications via a “module-federation.manifest.json” file!
|
||||
Throughout 2023, we’ve continued to increase Nx’s support and general dev experience around Module Federation, including [adding a generator to federate an existing module](/recipes/module-federation/federate-a-module), improving the local developer experience by improving local webserver performance, and introducing the concept of [Dynamic Module Federation](/recipes/angular/dynamic-module-federation-with-angular#advanced-angular-micro-frontends-with-dynamic-module-federation) which will allow you to dynamically specify the location of your remote applications via a “module-federation.manifest.json” file!
|
||||
|
||||
At Nx, we’re excited about the Module Federation support we offer for our users, and think that it has many interesting applications when paired with Nx’s CI capabilities, in particular allowing for [much shorter build times](https://nx.dev/concepts/module-federation/faster-builds-with-module-federation#faster-builds-with-module-federation) especially for larger Angular applications.
|
||||
At Nx, we’re excited about the Module Federation support we offer for our users, and think that it has many interesting applications when paired with Nx’s CI capabilities, in particular allowing for [much shorter build times](/concepts/module-federation/faster-builds-with-module-federation#faster-builds-with-module-federation) especially for larger Angular applications.
|
||||
|
||||
## Many OSS repos adopt Nx
|
||||
|
||||
@ -281,11 +281,11 @@ I picked out some of the more well-known OSS repos that started using Nx this ye
|
||||
|
||||
[**RxJS**](https://github.com/ReactiveX/rxjs) — The library for reactive programming in JavaScript. It is widely popular, with over 40 million downloads/week on NPM. RxJS only recently adopted Nx, not only leveraging speed improvements via caching, but also leveraging Nx’s latest `nx release` feature to publish packages to NPM.
|
||||
|
||||
[**AnalogJS**](https://analogjs.org/) — Analog is a full-stack Angular meta-framework that brings exciting features to Angular, like faster Vite setup, support for both server-side and static rendering, and easy file-based routing. Analog uses an Nx monorepo for its development and also uses [Nx’s DevKit](https://nx.dev/extending-nx/intro/getting-started) to create tools that work great in both Nx and Angular CLI workspaces.
|
||||
[**AnalogJS**](https://analogjs.org/) — Analog is a full-stack Angular meta-framework that brings exciting features to Angular, like faster Vite setup, support for both server-side and static rendering, and easy file-based routing. Analog uses an Nx monorepo for its development and also uses [Nx’s DevKit](/extending-nx/intro/getting-started) to create tools that work great in both Nx and Angular CLI workspaces.
|
||||
|
||||
[**Qwikifier**](https://github.com/qwikifiers/qwik-nx) — The Qwikifiers community built a dedicated Nx plugin to combine the power of Qwik and Nx. Their repo is a great example of building Nx plugins and [using Nx to build your own CLI](https://nx.dev/extending-nx/recipes/create-install-package).
|
||||
[**Qwikifier**](https://github.com/qwikifiers/qwik-nx) — The Qwikifiers community built a dedicated Nx plugin to combine the power of Qwik and Nx. Their repo is a great example of building Nx plugins and [using Nx to build your own CLI](/extending-nx/recipes/create-install-package).
|
||||
|
||||
[**Builder.io Mitosis**](https://github.com/BuilderIO/mitosis) — [BuilderIO](https://www.builder.io/) has an ambitious compiler project that allows you to write a component once and then compile it to different frameworks. Check out their [mind-blowing demo page](https://mitosis.builder.io/?outputTab=G4VwpkA%3D). They adopted Nx to [coordinate task dependencies](https://nx.dev/concepts/task-pipeline-configuration) and speed up their CI builds.
|
||||
[**Builder.io Mitosis**](https://github.com/BuilderIO/mitosis) — [BuilderIO](https://www.builder.io/) has an ambitious compiler project that allows you to write a component once and then compile it to different frameworks. Check out their [mind-blowing demo page](https://mitosis.builder.io/?outputTab=G4VwpkA%3D). They adopted Nx to [coordinate task dependencies](/concepts/task-pipeline-configuration) and speed up their CI builds.
|
||||
|
||||
[**Ghost**](https://github.com/TryGhost/Ghost) — Are you into blogging? You might want to look at [Ghost](https://ghost.org/). They were using Lerna in the past and migrated to a fully Nx-powered workspace.
|
||||
|
||||
@ -293,13 +293,13 @@ And these are just some of them that joined in 2023. If I missed some cool ones
|
||||
|
||||
## Nx Community
|
||||
|
||||
Nx has a huge community! We’re lucky to have so many folks rooting for Nx, whether on socials, talking at conferences, writing blog posts or [creating awesome plugins](https://nx.dev/plugin-registry).
|
||||
Nx has a huge community! We’re lucky to have so many folks rooting for Nx, whether on socials, talking at conferences, writing blog posts or [creating awesome plugins](/plugin-registry).
|
||||
|
||||
**Nx Champions** — This year we finally launched which we had planned for a long time. Our [Nx Champions](https://nx.dev/community) program.
|
||||
**Nx Champions** — This year we finally launched which we had planned for a long time. Our [Nx Champions](/community) program.
|
||||
|
||||

|
||||
|
||||
These are individuals who stood out for their contributions and passion for helping within the Nx community. We wanted to build a more connected relationship with these folks and have a channel to gather more direct feedback as well. Get to know [all of our champions](https://nx.dev/community).
|
||||
These are individuals who stood out for their contributions and passion for helping within the Nx community. We wanted to build a more connected relationship with these folks and have a channel to gather more direct feedback as well. Get to know [all of our champions](/community).
|
||||
|
||||
**New Discord server** — Around September we also switched over from our previous Nx Slack community to a brand new [**Nx community Discord**](https://go.nx.dev/community), which is already 2,600 members and counting. Discord is popular among OSS communities and allows new folks to join easily. In addition, we now have a dedicated forum integrated, as well as a couple of useful automations. More coming next year!
|
||||
|
||||
@ -309,16 +309,16 @@ Make sure [you join](https://go.nx.dev/community)!
|
||||
|
||||
Our [Youtube channel](https://www.youtube.com/@nxdevtools) has grown to over 15k subscribers and peaks of 65k views a month. We love to provide educational video content, so make sure to subscribe! It got a little silent towards the end of the year, but we’ve been working a lot behind the scenes. So stay tuned!
|
||||
|
||||
We also poured a lot of [effort into the docs](https://nx.dev/getting-started/intro). We restructured them following the [Diataxis](https://diataxis.fr/) to make pages less overwhelming and more structured based on their type of content. You’ll find
|
||||
We also poured a lot of [effort into the docs](/getting-started/intro). We restructured them following the [Diataxis](https://diataxis.fr/) to make pages less overwhelming and more structured based on their type of content. You’ll find
|
||||
|
||||
- [**Concept docs**](https://nx.dev/concepts) — which explain some of the inner workings and mental model behind certain features. Like [how caching works](https://nx.dev/concepts/how-caching-works).
|
||||
- [**Recipes**](https://nx.dev/recipes) — which are solution oriented. You already know how to cook, we provide the exact recipe for it.
|
||||
- [**Tutorials**](https://nx.dev/getting-started/tutorials) — for when you just want to sit down and follow along, step by step to learn how to use Nx in a certain context.
|
||||
- [**Reference**](https://nx.dev/reference) and [**API docs**](https://nx.dev/nx-api) — pure, raw and to the point.
|
||||
- [**Concept docs**](/concepts) — which explain some of the inner workings and mental model behind certain features. Like [how caching works](/concepts/how-caching-works).
|
||||
- [**Recipes**](/recipes) — which are solution oriented. You already know how to cook, we provide the exact recipe for it.
|
||||
- [**Tutorials**](/getting-started/tutorials) — for when you just want to sit down and follow along, step by step to learn how to use Nx in a certain context.
|
||||
- [**Reference**](/reference) and [**API docs**](/nx-api) — pure, raw and to the point.
|
||||
|
||||
We created a brand new [“Why Nx”](https://nx.dev/getting-started/why-nx) page explaining the overall architecture of Nx including a [brand new video](https://www.youtube.com/watch?v=-_4WMl-Fn0w) giving you a holistic overview of what Nx is capable of.
|
||||
We created a brand new [“Why Nx”](/getting-started/why-nx) page explaining the overall architecture of Nx including a [brand new video](https://www.youtube.com/watch?v=-_4WMl-Fn0w) giving you a holistic overview of what Nx is capable of.
|
||||
|
||||
We also refreshed our [entry pages](https://nx.dev/getting-started/intro), including dedicated examples of using Nx with popular stacks:
|
||||
We also refreshed our [entry pages](/getting-started/intro), including dedicated examples of using Nx with popular stacks:
|
||||
|
||||

|
||||
|
||||
@ -328,19 +328,19 @@ You can also browse them in the [nx-recipes](https://github.com/nrwl/nx-recipes)
|
||||
|
||||
{% tweet url="https://twitter.com/juristr/status/1726977598218199302" /%}
|
||||
|
||||
And obviously, we jumped on the AI train as well. A couple of months ago, we added the [Nx Assistant](https://nx.dev/ai-chat). A ChatGPT-powered interface trained on our docs. [Katerina](https://twitter.com/psybercity) wrote about it [on our blog](https://blog.nrwl.io/nx-docs-ai-assistant-433d238e45d4). 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 on our docs. [Katerina](https://twitter.com/psybercity) wrote about it [on our blog](https://blog.nrwl.io/nx-docs-ai-assistant-433d238e45d4). 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
|
||||
|
||||
Nx stands out for its flexibility, accommodating for both monorepo and non-monorepo project structures. This approach allows users to begin with simpler project configurations, leveraging the benefits of Nx’s robust tooling, and later, when the need arises, seamlessly [migrate to a monorepo](https://nx.dev/recipes/tips-n-tricks/standalone-to-integrated).
|
||||
Nx stands out for its flexibility, accommodating for both monorepo and non-monorepo project structures. This approach allows users to begin with simpler project configurations, leveraging the benefits of Nx’s robust tooling, and later, when the need arises, seamlessly [migrate to a monorepo](/recipes/tips-n-tricks/standalone-to-integrated).
|
||||
|
||||
However, Nx’s true strength becomes most apparent at scale, typically within a monorepo setup. We wanted to capture it in our new tagline: **Smart Monorepos — Fast CI**.
|
||||
|
||||
{% twitter url="https://twitter.com/juristr/status/1734558895547568634" /%}
|
||||
|
||||
Setting up an efficient and maintainable CI process for monorepos can be a complex task, so we’ve also made it a focal point in our new tagline. Nx expands beyond the local development experience, helping you set up an efficient CI process. We’re publicly launching [Nx Agents](https://nx.dev/ci/features/distribute-task-execution) to add seamless distribution to your CI pipeline, and more are coming in 2024.
|
||||
Setting up an efficient and maintainable CI process for monorepos can be a complex task, so we’ve also made it a focal point in our new tagline. Nx expands beyond the local development experience, helping you set up an efficient CI process. We’re publicly launching [Nx Agents](/ci/features/distribute-task-execution) to add seamless distribution to your CI pipeline, and more are coming in 2024.
|
||||
|
||||
As part of that, we also restructured our docs to have a section entirely dedicated to CI: [https://nx.dev/ci](https://nx.dev/ci/intro/ci-with-nx).
|
||||
As part of that, we also restructured our docs to have a section entirely dedicated to CI: [https://nx.dev/ci](/ci/intro/ci-with-nx).
|
||||
|
||||
## Nx Conf
|
||||
|
||||
@ -360,8 +360,8 @@ Legacy CI systems are a performance and productivity bottleneck if you use a pow
|
||||
|
||||
It has three components:
|
||||
|
||||
- [**Nx Cach**](https://nx.dev/ci/features/remote-cache): Built-in local and remote caching to speed up your tasks and save you time and money. Available now.
|
||||
- [**Nx Agents**](https://nx.dev/ci/features/distribute-task-execution): A single line to enable distributed computation, across multiple machines. Fully managed agents, dynamically allocated based on PR size. Available early Feb.
|
||||
- [**Nx Cach**](/ci/features/remote-cache): Built-in local and remote caching to speed up your tasks and save you time and money. Available now.
|
||||
- [**Nx Agents**](/ci/features/distribute-task-execution): A single line to enable distributed computation, across multiple machines. Fully managed agents, dynamically allocated based on PR size. Available early Feb.
|
||||
- **Nx Workflows**: Next generation, fully managed CI solution with distribution at its core, designed from the ground up for monorepos. _Available later in 2024._
|
||||
|
||||
Optimal parallelization and distribution, using the right numbers of agents for each PR, rerunning flaky tests, splitting and distributing large test suites, handling dependencies between tasks across machines — are just some of the things we can now handle automatically for you. Turn it on and enjoy the speed.
|
||||
@ -374,7 +374,7 @@ We took inspiration from VSCode. Any project you open in VSCode will work right
|
||||
|
||||
The whole team is excited about it as the new experience feels much more elegant.
|
||||
|
||||
As always, we try very hard not to break folks, so all your current workspaces will keep working, and we will [provide automatic migrations](https://nx.dev/features/automate-updating-dependencies) to bring you to this new way of using Nx.
|
||||
As always, we try very hard not to break folks, so all your current workspaces will keep working, and we will [provide automatic migrations](/features/automate-updating-dependencies) to bring you to this new way of using Nx.
|
||||
|
||||
Exciting stuff! So keep an eye on our channels, and subscribe if you haven’t already ;)
|
||||
|
||||
@ -382,7 +382,7 @@ Exciting stuff! So keep an eye on our channels, and subscribe if you haven’t a
|
||||
|
||||
## Learn more
|
||||
|
||||
- [Nx Docs](https://nx.dev/getting-started/intro)
|
||||
- [Nx Docs](/getting-started/intro)
|
||||
- [X/Twitter](https://twitter.com/nxdevtools)
|
||||
- [LinkedIn](https://www.linkedin.com/company/nrwl/)
|
||||
- [Nx GitHub](https://github.com/nrwl/nx)
|
||||
|
||||
@ -169,7 +169,7 @@ The spirit of this post is similar to Alan Kay's quote, "A change of perspective
|
||||
|
||||
---
|
||||
|
||||
You can learn more about Nx Cloud on [nx.app](https://nx.app) and Nx open source on [nx.dev](https://nx.dev).
|
||||
You can learn more about Nx Cloud on [nx.app](https://nx.app) and Nx open source on [nx.dev]().
|
||||
|
||||
**Nx Cloud Pro includes a 2-month free trial** that is definitely worth trying out if you're curious what Cloud Pro can do for your CI. You can try out Nx Agents, e2e test splitting, deflaking and more. [Learn more about Nx Cloud Pro.](https://nx.app/campaigns/pro)
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ This blog will show you:
|
||||
|
||||
Before we start, let’s answer this question: what is Nx and why should we use it?
|
||||
|
||||
From [nx.dev](https://nx.dev): “Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.” It sounds good, what benefits does it bring?
|
||||
From [nx.dev](): “Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.” It sounds good, what benefits does it bring?
|
||||
|
||||
Nx adds the following features to your workspace:
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ We've got some cool stats to share from our users regarding the benefits of [Nx
|
||||
- **cost**: Reported 40% - 75% reduction in CI costs
|
||||
- **reliability**: Nx Cloud's automatic detection and retrying of flaky tests makes the issue of flaky tests largely go away entirely. You can read more on [our thoughts on reliability here](/blog/2024-03-21-reliable-ci).
|
||||
|
||||
In February, we launched two big enhancements to Nx Cloud: the [Atomizer](https://nx.dev/ci/features/split-e2e-tasks) and [Nx Agents](https://nx.app/products/agents#content).
|
||||
In February, we launched two big enhancements to Nx Cloud: the [Atomizer](/ci/features/split-e2e-tasks) and [Nx Agents](https://nx.app/products/agents#content).
|
||||
|
||||
Since then, the Atomizer has received a nice UI update (as we had seen earlier):
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Nx 18
|
||||
|
||||
We were so excited about the features in Nx 18 that we created a whole [Launch Nx Week](https://nx.dev/launch-nx) to share our excitement with you. During the launch week, we made the following announcements:
|
||||
We were so excited about the features in Nx 18 that we created a whole [Launch Nx Week](/launch-nx) to share our excitement with you. During the launch week, we made the following announcements:
|
||||
|
||||
- [Project Crystal](https://blog.nrwl.io/what-if-nx-plugins-were-more-like-vscode-extensions-dcdad140ae09?source=friends_link&sk=ade76fe8d50d44aafb4d4d89ab882e24&__hstc=221401095.5d21139e33f975ecef01c1783a7523db.1673975383152.1708023233215.1708026196201.468&__hssc=221401095.2.1708026196201&__hsfp=589919331) allows you to use inferred tasks
|
||||
- A new [`@nx/nuxt`](https://blog.nrwl.io/introducing-nx-nuxt-enhanced-nuxt-js-support-in-nx-01eac78034fc?source=friends_link&sk=91582cdbd0719dc23375338ad92afa9b&__hstc=221401095.5d21139e33f975ecef01c1783a7523db.1673975383152.1708023233215.1708026196201.468&__hssc=221401095.2.1708026196201&__hsfp=589919331) plugin is available
|
||||
|
||||
@ -155,7 +155,7 @@ secret:
|
||||
We send out emails with every new Nx Cloud release to all our Enterprise customers:
|
||||
|
||||
1. You can view your current version at the `/version` route: https://your-nx-cloud-url.com/version
|
||||
2. [And these are the latest Nx Cloud releases](https://nx.dev/ci/reference/release-notes#docker-containers)
|
||||
2. [And these are the latest Nx Cloud releases](/ci/reference/release-notes#docker-containers)
|
||||
|
||||
To upgrade to a newer version, add the below line to your `myconfiguration.yml` file:
|
||||
|
||||
|
||||
@ -58,16 +58,16 @@ This includes events such as when a workspace was created, when a new VCS integr
|
||||
|
||||
### 2402.27.3
|
||||
|
||||
With this version you can take advantage of most features announced during our recent [launch week](https://nx.dev/launch-nx).
|
||||
With this version you can take advantage of most features announced during our recent [launch week](/launch-nx).
|
||||
|
||||
##### Nx Agents
|
||||
|
||||
This release contains everything needed to run [Nx Agents](https://nx.dev/ci/features/distribute-task-execution) on-prem. While the on-prem configuration is still experimental, we are actively running Nx Agents trials at the moment, and if you'd like to take part please reach out to your DPE.
|
||||
This release contains everything needed to run [Nx Agents](/ci/features/distribute-task-execution) on-prem. While the on-prem configuration is still experimental, we are actively running Nx Agents trials at the moment, and if you'd like to take part please reach out to your DPE.
|
||||
|
||||
If you already running DTE, there are a few advantages to upgrading to Agents:
|
||||
|
||||
- simplified CI config: you will need to maintain just a single, main CI job config. NxCloud will create needed CI agents for you as needed.
|
||||
- [dynamic agent allocation based on PR size](https://nx.dev/ci/features/dynamic-agents): instead of always launching all your agents NxCloud will now launch different number of agents dynamically based on your PR size
|
||||
- [dynamic agent allocation based on PR size](/ci/features/dynamic-agents): instead of always launching all your agents NxCloud will now launch different number of agents dynamically based on your PR size
|
||||
- access to [Spot instances](https://aws.amazon.com/ec2/spot/): if you are running your clusters on any of the popular cloud providers (AWS, Google Cloud, Azure etc.), you can now use their Spot instances for running your CI job. This is possible due to NxCloud's distribution model, which allows work on a reclaimed node to be re-distributed to the remaining agents.
|
||||
|
||||
We will shortly make available a new Helm chart that will allow you to deploy a separate Agents cluster to launch workflows: [https://github.com/nrwl/nx-cloud-helm](https://github.com/nrwl/nx-cloud-helm).
|
||||
@ -76,11 +76,11 @@ We will shortly make available a new Helm chart that will allow you to deploy a
|
||||
|
||||
##### Task Atomizer and task retries
|
||||
|
||||
If you combine this release + upgrade to the latest Nx 18, you will have access to both the [task atomizer](https://nx.dev/ci/features/split-e2e-tasks) (which allows your e2e to be distributed among agents PER FILE, instead of previously per project) and the [flaky task retry functionality](https://nx.dev/ci/features/flaky-tasks).
|
||||
If you combine this release + upgrade to the latest Nx 18, you will have access to both the [task atomizer](/ci/features/split-e2e-tasks) (which allows your e2e to be distributed among agents PER FILE, instead of previously per project) and the [flaky task retry functionality](/ci/features/flaky-tasks).
|
||||
|
||||
##### CIPE page improvements
|
||||
|
||||
Along with all the UI changes to support agents (following their logs and track how tasks get distributed,details of which you'll find demoed on [this page](https://nx.dev/ci/features/distribute-task-execution)) this release also brings all the new improvements to the CI pipeline execution page, including the commit info panel at the top:
|
||||
Along with all the UI changes to support agents (following their logs and track how tasks get distributed,details of which you'll find demoed on [this page](/ci/features/distribute-task-execution)) this release also brings all the new improvements to the CI pipeline execution page, including the commit info panel at the top:
|
||||
|
||||

|
||||
|
||||
@ -148,7 +148,7 @@ To enable the light runner feature, make sure you:
|
||||
|
||||
##### Nx Agents
|
||||
|
||||
This release is also the first one to support ["Nx Agents"](https://nx.dev/ci/features/distribute-task-execution#managed-agents-seamless-configuration).
|
||||
This release is also the first one to support ["Nx Agents"](/ci/features/distribute-task-execution#managed-agents-seamless-configuration).
|
||||
|
||||
While currently experimental and disabled by default for on-prem users, we are looking for more on-prem workspaces to try it out with
|
||||
so please reach out to your DPE contact or to [cloud-suppport@nrwl.io](mailto:cloud-support@nrwl.io) if you are interested in helping us shape this according to your needs!
|
||||
|
||||
@ -6,17 +6,17 @@
|
||||
|
||||
Nx Cloud is not aware of any more tasks to distribute. This can occur if Nx Cloud thinks it is done receiving tasks to distribute and all existing tasks have been completed.
|
||||
|
||||
If you are receiving this error before your full pipeline has completed, consider using [--stop-agents-after](https://nx.dev/ci/reference/nx-cloud-cli#stopagentsafter) with the target set to the last target run in your pipeline.
|
||||
If you are receiving this error before your full pipeline has completed, consider using [--stop-agents-after](/ci/reference/nx-cloud-cli#stopagentsafter) with the target set to the last target run in your pipeline.
|
||||
|
||||
### The Nx Cloud heartbeat process failed to report its status in time
|
||||
|
||||
While running in CI environments, Nx Cloud spawns a background process called the "heartbeat" to help maintain status synchronization between itself and external platforms. When the heartbeat process does not report to Nx Cloud for 30 seconds or longer, Nx Cloud assumes something has gone wrong and terminates the current CI Pipeline Execution.
|
||||
|
||||
This behavior can be disabled by setting the [--require-explicit-completion](https://nx.dev/ci/reference/nx-cloud-cli#requireexplicitcompletion) flag to `true` on your `nx-cloud start-ci-run` command.
|
||||
This behavior can be disabled by setting the [--require-explicit-completion](/ci/reference/nx-cloud-cli#requireexplicitcompletion) flag to `true` on your `nx-cloud start-ci-run` command.
|
||||
|
||||
### A command was issued to stop all Nx Cloud agents
|
||||
|
||||
Nx Cloud provides two commands to forcibly stop agents, [stop-all-agents and complete-ci-run](https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-stopallagents).
|
||||
Nx Cloud provides two commands to forcibly stop agents, [stop-all-agents and complete-ci-run](/ci/reference/nx-cloud-cli#npx-nxcloud-stopallagents).
|
||||
|
||||
Once these commands are invoked, the current CI Pipeline Execution is closed and can no longer receive new work.
|
||||
|
||||
@ -24,7 +24,7 @@ Once these commands are invoked, the current CI Pipeline Execution is closed and
|
||||
|
||||
Nx Cloud detected a failed task in the current CI Pipeline Execution and has halted further execution.
|
||||
|
||||
This behavior can be disabled by setting the [--stop-agents-on-failure](https://nx.dev/ci/reference/nx-cloud-cli#stopagentsonfailure) flag to `false` on your `nx-cloud start-ci-run` command.
|
||||
This behavior can be disabled by setting the [--stop-agents-on-failure](/ci/reference/nx-cloud-cli#stopagentsonfailure) flag to `false` on your `nx-cloud start-ci-run` command.
|
||||
|
||||
## Nx Agents-Related
|
||||
|
||||
|
||||
@ -292,7 +292,7 @@ To analyze the size of your bundles, run build with `--statsJson` and use a tool
|
||||
like [`webpack-bundle-analyzer`](https://www.npmjs.com/package/webpack-bundle-analyzer).
|
||||
|
||||
If you have any feedback regarding this feature, we'd love to hear from you--check
|
||||
our [community page](https://nx.dev/community) for links to our Discord and Twitter.
|
||||
our [community page](/community) for links to our Discord and Twitter.
|
||||
{% /callout %}
|
||||
|
||||
## Remote computation caching with Nx Cloud
|
||||
|
||||
@ -137,7 +137,7 @@ Nx helps with these by using plugins and the Nx Cloud web app. For example, you
|
||||
At this point, Turborepo doesn’t do any of that. So for a monorepo of any non-trivial size you will have to implement all of those things using some other tools.
|
||||
|
||||
Nx is like the **VSCode of build tools**. In VSCode you can get started with the plain, core VSCode setup and it would be fine. But if you want to enhance your experience, there's the option to add extensions for managing Git, Docker, Mongo etc. Similarly, **you don’t have to use all the Nx plugins or, say, the Nx Cloud GitHub integration.**
|
||||
Nx doesn’t replace any of your tools, and it’s not “all in”. You can start without any Nx plugins and Nx Cloud affordances, as with Turborepo. Or you can add them in as you go, both natively supported plugins by Nx as well as our growing [set of community plugins](https://nx.dev/community). **Turborepo isn’t pluggable**, so if you use the same analogy, you would have to use different tools (GitTower, DataGrip, Mongo Compass) to meet the same needs.
|
||||
Nx doesn’t replace any of your tools, and it’s not “all in”. You can start without any Nx plugins and Nx Cloud affordances, as with Turborepo. Or you can add them in as you go, both natively supported plugins by Nx as well as our growing [set of community plugins](/community). **Turborepo isn’t pluggable**, so if you use the same analogy, you would have to use different tools (GitTower, DataGrip, Mongo Compass) to meet the same needs.
|
||||
|
||||
## Tech and Performance
|
||||
|
||||
@ -172,7 +172,7 @@ Nx was released in 2016. Turborepo was open sourced in December of 2021. Turbore
|
||||
|
||||
- There are about [4 million downloads per week](https://www.npmjs.com/package/nx).
|
||||
- There are about 1 million+ unique [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console) (a plugin for VSCode) installations.
|
||||
- There is a rich ecosystem of [third-party plugins](https://nx.dev/plugin-registry).
|
||||
- There is a rich ecosystem of [third-party plugins](/plugin-registry).
|
||||
|
||||
From day 1 Nx has always been an **MIT-licensed open source project**, and we did everything to make sure companies using Nx won’t end up in the vendor lock-in. We clearly separated Nx the open source project and Nx Cloud the SAAS product. For instance, Nx Cloud is built using the public APIs Nx provides (you can build your own and some companies do). Nx Cloud docs are on a separate domain etc.
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ If you want to add Nx to an existing repository run:
|
||||
npx nx@latest init
|
||||
```
|
||||
|
||||
You can also manually install the nx NPM package and create a [nx.json](https://nx.dev/reference/nx-json) to configure it. Learn more about [adopting Nx in an existing project](/recipes/adopting-nx)
|
||||
You can also manually install the nx NPM package and create a [nx.json](/reference/nx-json) to configure it. Learn more about [adopting Nx in an existing project](/recipes/adopting-nx)
|
||||
|
||||
## Installing Nx Globally
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ You can then use these variables in your application code like so: `import.meta.
|
||||
|
||||
When using Nx with Vite, you may encounter an issue related to loading environment variables that can lead to unexpected behavior. This issue arises due to the way Nx and Vite handle environment files and configuration settings.
|
||||
|
||||
1. **Nx Environment Variable Loading**: Nx loads environment variables from configuration names using the `--configuration` flag. This is the preferred method in Nx, especially when you have a default configuration specified in your `project.json` file for most targets. In our [guide on how to define environment variables](https://nx.dev/recipes/tips-n-tricks/define-environment-variables), you can see that if you're using the `configuration` option, then Nx will load `.env.[configuration-name]` files.
|
||||
1. **Nx Environment Variable Loading**: Nx loads environment variables from configuration names using the `--configuration` flag. This is the preferred method in Nx, especially when you have a default configuration specified in your `project.json` file for most targets. In our [guide on how to define environment variables](/recipes/tips-n-tricks/define-environment-variables), you can see that if you're using the `configuration` option, then Nx will load `.env.[configuration-name]` files.
|
||||
|
||||
2. **Vite Environment Variable Loading**: Vite loads environment files named `.env.[mode]` using the `--mode` flag.
|
||||
|
||||
@ -25,7 +25,7 @@ The root cause of this issue is that Nx has already loaded variables from `.env.
|
||||
|
||||
#### Solution
|
||||
|
||||
We recommend that developers adapt to the Nx way of handling environment variables and refer to our [documentation on defining environment variables](https://nx.dev/recipes/tips-n-tricks/define-environment-variables). This will help ensure consistent behavior and prevent conflicts when using Nx with Vite.
|
||||
We recommend that developers adapt to the Nx way of handling environment variables and refer to our [documentation on defining environment variables](/recipes/tips-n-tricks/define-environment-variables). This will help ensure consistent behavior and prevent conflicts when using Nx with Vite.
|
||||
|
||||
However, if you still want to use Vite's `mode`, you still can. To ensure seamless integration between Nx and Vite environment variables, you can establish a clear distinction between `configuration` and `mode` names. By assigning distinct names to both `configuration` and `mode`, you can eliminate any potential conflicts that may arise during environment variable loading. Additionally, consider defining custom configurations in your Nx workspace, each with a corresponding `mode` option. For example, you can create configurations like `development`, `production`, and `staging`, each with its respective `mode` set, like this:
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ In order to share a module, it must be _federated_. This means that the module m
|
||||
|
||||
{% callout type="info" title="Assumption" %}
|
||||
With this recipe we assume that you have already created a workspace with at least one React or Angular Module Federation host application.
|
||||
If you haven't, you can follow the [Create a Host Recipe](https://nx.dev/recipes/module-federation/create-a-host).
|
||||
If you haven't, you can follow the [Create a Host Recipe](/recipes/module-federation/create-a-host).
|
||||
{% /callout %}
|
||||
|
||||
## Step 1: Create the module
|
||||
|
||||
@ -14,7 +14,7 @@ function readFileContents(path: string): string {
|
||||
return readFileSync(path, 'utf-8');
|
||||
}
|
||||
function isLinkInternal(linkPath: string): boolean {
|
||||
return linkPath.startsWith('/');
|
||||
return linkPath.startsWith('/') || linkPath.startsWith('https://nx.dev');
|
||||
}
|
||||
function isNotAsset(linkPath: string): boolean {
|
||||
return !linkPath.startsWith('/assets');
|
||||
@ -34,7 +34,7 @@ function removeAnchors(linkPath: string): string {
|
||||
return linkPath.split('#')[0];
|
||||
}
|
||||
function extractAllLinks(basePath: string): Record<string, string[]> {
|
||||
return glob.sync(`${basePath}/**/*.md`).reduce((acc, path) => {
|
||||
return glob.sync(`${basePath}/*/**/*.md`).reduce((acc, path) => {
|
||||
const fileContents = readFileContents(path);
|
||||
const cardLinks = (fileContents.match(/url="(.*?)"/g) || []).map((v) =>
|
||||
v.slice(5, -1)
|
||||
@ -101,9 +101,12 @@ const sitemapLinks = readSiteMapIndex(
|
||||
'sitemap.xml'
|
||||
).flatMap((path) => readSiteMapLinks(path));
|
||||
const errors: Array<{ file: string; link: string }> = [];
|
||||
const localLinkErrors: Array<{ file: string; link: string }> = [];
|
||||
for (let file in documentLinks) {
|
||||
for (let link of documentLinks[file]) {
|
||||
if (!sitemapLinks.includes(['https://nx.dev', link].join(''))) {
|
||||
if (link.startsWith('https://nx.dev')) {
|
||||
localLinkErrors.push({ file, link });
|
||||
} else if (!sitemapLinks.includes(['https://nx.dev', link].join(''))) {
|
||||
errors.push({ file, link });
|
||||
}
|
||||
}
|
||||
@ -119,11 +122,21 @@ for (let file in imageLinks) {
|
||||
}
|
||||
|
||||
console.log(`i/ Internal Link Check`);
|
||||
if (errors.length) {
|
||||
console.log(`ERROR\n${errors.length} links are pointing to nowhere:`);
|
||||
errors.forEach((error) =>
|
||||
console.error(`⚠ File:${error.file}\n -> ${error.link}\n`)
|
||||
);
|
||||
if (errors.length || localLinkErrors.length) {
|
||||
if (errors.length) {
|
||||
console.log(`ERROR\n${errors.length} links are pointing to nowhere:`);
|
||||
errors.forEach((error) => {
|
||||
console.error(`⚠ File:${error.file}\n -> ${error.link}\n`);
|
||||
});
|
||||
}
|
||||
if (localLinkErrors.length) {
|
||||
console.log(
|
||||
`ERROR\n${localLinkErrors.length} local links should not include the domain:`
|
||||
);
|
||||
localLinkErrors.forEach((error) => {
|
||||
console.error(`⚠ File:${error.file}\n -> ${error.link}\n`);
|
||||
});
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(`i/ No internal 404 link detected.`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user