Compare commits

...

925 Commits

Author SHA1 Message Date
FrozenPandaz b708623fab fix(core): ensure that run-commands processes are cleaned up 2025-05-16 15:33:22 -04:00
Jonathan Cammisuli eaf21e9854 feat(core): add ai rule files to gitignore (#31238)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Rule files are created by Nx Console, and gitignore updates are done
there.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Rule files are still created by Nx Console, but there is now a migration
to add those files to the gitignore rules on migration and new
workspaces.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-16 14:13:51 -04:00
Benjamin Cabanes ccfcc4097f docs(nx-dev): add solutions sections and components (#31239)
It adds a new "Solutions" section to the Nx Dev website with three targeted landing pages for different audiences: engineering teams, management teams platform teams, and leadership.

It creates three new page files (engineering.tsx, management.tsx, leadership.tsx, platform.tsx) that showcase Nx's benefits through various UI components like heroes, testimonials, feature sections, and FAQs. Each page highlights specific value propositions - engineering focuses on developer efficiency and standards, platform emphasizes reliable CI/CD scaling, and leadership addresses ROI and risk reduction.

The navigation is updated with a new "Solutions" dropdown menu in both desktop and mobile views, with corresponding menu items defined. The solutions pages include consistent sections like customer logos, calls-to-action, testimonials, and feature breakdowns that highlight Nx's capabilities for different stakeholders.
2025-05-16 13:55:47 -04:00
laney a5ccd13f92 feat(core): update getTouchedProjectsFromLockFile to detect which projects were changed from pnpm lock file diff (#31091)
…jects were changed from pnpm lock file diff

Closes #29986

## Current Behavior

Nx projects that use pnpm catalogs cannot take advantage of the
`projectsAffectedByDependencyUpdates` `“auto”` setting because updating
catalog versions does not touch project files.

## Expected Behavior

When `projectsAffectedByDependencyUpdates` is set to `“auto”`, updating
a catalog dependency version should result in all projects that use it
getting marked as affected.

A catalog version update and the affected projects can be detected from
a changed pnpm lock file. This PR updates the
`getTouchedProjectsFromLockFile` logic to check the lock file for pnpm
monorepos.

Example pnpm lock file diff after catalog dependency update:

```diff
# pnpm-lock.yaml

# ...

catalogs:
  default:
    '@aws-sdk/client-s3':
-      specifier: ^3.535.0
-      version: 3.535.0
+      specifier: ^3.797.0
+      version: 3.797.0

importers:

  apps/app1:
    dependencies:
      '@aws-sdk/client-s3':
        specifier: 'catalog:'
-        version: 3.535.0
+        version: 3.797.0

# ...
```

## Related Issue(s)

https://github.com/nrwl/nx/issues/29986

Fixes #29986

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-05-16 13:17:45 -04:00
Jason Jean a45ec7e0bd fix(core): restore older nx core migrations for repair (#31254)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

These migrations should not have been removed as part of the Nx 21
update

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The migrations are restored

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-16 13:01:56 -04:00
Jason Jean e724eedc5e fix(core): record task runs via the queue (#31253)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Recording task runs does not send via the queue so the daemon could hang
without handling the response properly.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Recording task runs sends via the queue and does not hang

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-16 12:01:43 -04:00
Nicolas Marien bd88b0efe4 feat(devkit): allow requiring cts config files (#31103)
When migrating our project to esm, we encountered an issue with the
playright plugin, but more generally with the `loadConfigFile` from the
devkit.
Our configuration is a `.cts` file, but it's not treated as commonjs:
`__dirname` and `__filename` are not available.

![CleanShot 2025-05-07 at 15 31
04@2x](https://github.com/user-attachments/assets/e8299b4e-153b-4cb4-98b7-d806e537ab12)

## Expected Behavior
`.cts` files are interpreted as commonJS files when in a module context.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-05-16 11:58:34 -04:00
Nicholas Cunningham 1709b107bb fix(core): Update e2e nightly test to not hang (#31218)
Currently, the nightly tests are broken in a few ways this PR addresses
some of those issues but ultimately ensures that each step has a timeout
to handle the work case scenario i.e. unable to complete.

- Add bun installation and split e2e runners for macos, linux and
windows
- Add rust installation
- Add timeout for e2e tests 

Here is the result of a previous run:
https://github.com/nrwl/nx/actions/runs/14999368644
The most latest run can be found here:
https://github.com/nrwl/nx/actions/runs/15027418322

**Note**: The final result will be _failure_ because many tests still
need to be addressed, so that is expected.
2025-05-16 11:07:49 -04:00
Jack Hsu 840f5f445b fix(core): ensure that global nx works with dot-nx workspace after init (#31249)
This PR fixes an issue with the global `nx` command, where running `nx
init` in a non-JS folder (i.e. using dot-nx setup) results in a
workspace that doesn't work with the global command.

e.g.

```
brew install nx
cd some-java-project
nx init
nx report
```

https://www.loom.com/share/e8dbb2fb7a084300a4dd1e5dff2c0db1

## Current Behavior
`nx report` or any other command fails

## Expected Behavior
`nx` commands should work

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-16 10:57:08 -04:00
James Henry fcd630ddd9 fix(core): remove engines field, improve compatibility documentation (#31245) 2025-05-16 10:00:00 -04:00
pawel-twardziak c4cb96c2e7 fix(linter): handle the flat config in workspace rule generators (#29253)
Closes #29252

## Current Behavior
See #29252

## Expected Behavior
See #29252

## Related Issue(s)
See #29252

Fixes #
See #29252

---------

Co-authored-by: Miroslav Jonaš <missing.manual@gmail.com>
2025-05-16 09:39:34 +02:00
Jason Jean 7db44a855a fix(core): do not set tasks which cannot be interactive to interactive (#31240)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Some tasks cannot be interactive because of the way they are
implemented. At the moment, those tasks can be set to interactive mode.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Tasks which cannot be interactive are not set as interactive

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-15 18:16:40 -04:00
Jason Jean 8ff47e0cb0 chore(repo): add debug logging to running tasks service (#31224)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

There are very few logs for the running task service.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There are logs for the running task service.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-15 16:57:56 -04:00
Nicholas Cunningham d3ecffedc1 feat(vite): add ajv dev dependency for vite-plugin-dts (#31107)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, when we generate a vite library that uses `vite-plugin-dts`
it breaks the project graph and all nx commands fail.
It happens because the wrong version of `ajv` is being hoisted in
`node_modules/ajv` so the expected module path required from
`vite-plugin-dts` is not found.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Nx commands should work out of the box when we generate a library with
vite.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-15 15:44:53 -04:00
Isaac Mann 3873fee587 chore(core): update inputs for rust tasks (#31184)
- Adds `native` inputs to rust tasks
- Adds `rustc --version` runtime input to `native` named input
2025-05-15 13:55:15 -04:00
Jason Jean 4d3fea7f9d chore(repo): update nx to 21.1.0-beta.1 2025-05-15 10:05:16 -04:00
Colum Ferry d61683efc6 feat(angular): migrate to angular rspack 21 (#31216)
## Current Behavior
The Angular plugin currently uses Angular Rspack at `^20.7.0`.
The latest release of Angular Rspack is `21.0.0`

## Expected Behavior
Use the latest version of Angular Rspack
2025-05-15 13:13:02 +01:00
Jonathan Cammisuli 81ecb22abe feat(core): add nx console messaging to TUI (#31148)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
There is no communication between Nx CLI and Nx Console

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This enables a connection between the Nx TUI app and Nx Console so that
we can send messages to console. This is used to update MCP tools on Nx
Console to assist with LLMs

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-14 15:58:30 -04:00
Michal Jez 47b9b51dd3 docs(nx-cloud): add tip to check for non-unique NX_CI_EXECUTION_ID on DTE failures (#27573)
I ran into this issue the other day with my CI pipeline when the build
number got reset

Co-authored-by: Altan Stalker <altan@nrwl.io>
2025-05-14 17:39:33 +00:00
Henry Ing-Simmons f6d69baf14 chore(core): replace red in console with blue (#29026)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Red is used as a colour when running multiple processes in the command
line. This causes confusion as red is universally the colour for
danger/errors.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Red should not be a colour in the console and blue should be used
instead.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #19901
2025-05-14 16:08:06 +00:00
Jason Jean 5105d39117 chore(repo): update nx to 20.1.0-beta.0 (#31215)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `21.0.2`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `21.1.0-beta.0`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-14 12:04:14 -04:00
Tyler Hendrickson 21bdb35a07 fix(esbuild): update peerDep range (#30402)
## Current Behavior
`esbuild` has a [security
advisory](https://github.com/advisories/GHSA-67mh-4wv8-2f99) for
versions older than 0.25.0. `@nx/esbuild` does not allow versions
greater than 0.19.2 due to the range specified in peer dependencies.

A fix for this was attempted in #30167, but it still does not allow any
versions greater than 0.19.x due to the way [0.x.x releases are
handled](https://github.com/npm/node-semver#caret-ranges-123-025-004).

## Expected Behavior
`@nx/esbuild` allows any version from the current 0.19.2 onwards, not
including a future 1.x.x version. This will allow non-vulnerable
versions of `esbuild` to be used.

## Related Issue(s)
Fixes #30009 
Fixes #30370
2025-05-14 16:00:34 +00:00
Nicholas Cunningham cc22a07601 fix(nx-dev): Add docs for disableChecksum option for s3-cache (#31199)
Add documentation for `disableChecksum` flag for AWS S3 storage options
so users can opt out of validating checksum while retrieving remote
cache.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-14 11:32:20 -04:00
Juri 3e83c2ae1f docs(core): update enhance LLM feature page 2025-05-14 16:58:18 +02:00
Colum Ferry 9aee5b7adf feat(angular): handle prerender and appshell in covert to rspack (#31210)
## Current Behavior
The `convert-to-rspack` generator does not handle projects that use
Prerendering or App Shell

## Expected Behavior
The generator sets up Prerendering and App Shell

Fixes https://github.com/nrwl/angular-rspack/issues/88
2025-05-14 15:26:41 +01:00
Jonathan Gelin 3be687bf95 fix(module-federation): generalize the check of the remote project specified in the buildTarget (#31211)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30808
2025-05-14 15:00:44 +01:00
Emily Xiong e15e2ed106 fix(gradle): make ci inputs same as test inputs (#31198)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

current ci test target does not contain inputs of test, it just contains
the test source file

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
change the ci targets to contain inputs of test
<img width="903" alt="Screenshot 2025-05-13 at 1 31 22 PM"
src="https://github.com/user-attachments/assets/d73de232-440a-439b-adb8-e22fc3fe3d8a"
/>


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-14 10:00:08 -04:00
Isaac Mann 514cdd890d chore(core): disable flaky e2e tests (#31200)
Disable flaky `e2e-release` tasks
2025-05-14 09:58:39 -04:00
Isaac Mann 552d6b1ea8 docs(core): add webinar info for 2025-05-28 (#31201)
Adds a May 28th webinar info and notifier
2025-05-14 07:01:17 -04:00
Jonathan Cammisuli 889dee0854 chore(core): update rust to 2024 edition (#31156)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently using 2021 edition of rust

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Updates to 2024 edition to support more features that are coming in
other PRs

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-13 18:11:05 -04:00
Jason Jean 3d73fd30a0 fix(core): make running a single task more transparent (#31163)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Running a single task is in this uncanny framed state and doesn't exit
immediately.

<img width="1317" alt="image"
src="https://github.com/user-attachments/assets/13e7463f-9eb0-48db-95f2-c09e203d494f"
/>

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Running a single task isn't framed and exits immediately.

This also fixes scrolling in interactive mode based on whether or not
the underlying terminal is in application cursor mode or not.


![image](https://github.com/user-attachments/assets/c32c85e7-edd6-4aba-9a15-bc75cc9ee5ba)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: JamesHenry <james@henry.sc>
2025-05-13 21:09:39 +00:00
Jack Hsu a31226437e docs(misc): update conformance rule options (#31183)
This PR updates our conformance rule that enforces module boundaries.
See here for more details: https://github.com/nrwl/ocean/pull/7377
2025-05-13 09:59:27 -06:00
Yiheng cd59a6678e feat(core): run parallel based on the number of cpu cores (#31011) 2025-05-13 16:19:16 +02:00
Juri 3f5fd896a1 feat(nx-dev): replace monorepo world link with office hours 2025-05-13 13:27:21 +02:00
Juri 70012ee082 docs(nx-dev): new blog post about integrating LLMs with Nx generate UI 2025-05-13 13:27:10 +02:00
Leosvel Pérez Espinosa e1c0be3d2d fix(angular): install @angular/build when using vitest test runner (#31169)
## Current Behavior

The application and library generators do not install the
`@angular/build` package when using the `vitest` test runner. This can
cause resolution issues depending on the package manager because the
package is a peer dependency of the `@analogjs/vite-plugin-angular`
package.

## Expected Behavior

The application and library generators should install the
`@angular/build` package when using the `vitest` test runner.

## Related Issue(s)

Fixes #30646
2025-05-13 13:22:49 +02:00
Austin Fahsl 8cf4b55174 docs(core): add Nx 21 to supported versions (#31182)
Update the supported Nx versions documentation to include Nx 21
2025-05-12 17:30:16 -04:00
Nicholas Cunningham f20b2e6a02 fix(nextjs): Update glob for cache output (#31177)
This PR refines the Next.js package plugin’s output glob to exclude the
.next/cache directory. Caching that path via AWS S3 leads to checksum
mismatches when restoring from the remote cache, so it’s now omitted.

related: https://github.com/nrwl/nx/issues/30338
2025-05-12 16:42:07 -04:00
Emily Xiong 5677831b17 fix(gradle): return success false for failed task (#31178)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-12 15:30:59 -04:00
Isaac Mann 07474a4092 Revert "docs(core): publish tutorial kit tutorials (#30973)" (#31179)
This reverts commit 2cb0fa2b55.

Removes the tutorialkit tutorials.
2025-05-12 15:23:41 -04:00
James Henry 07c8b4f41b fix(core): improve pinned tasks annotation on narrow width (#31175)
This is intended to be a super quick improvement until I can work on
something a bit more substantial.

## Current Behavior
<!-- This is the behavior we have today -->

We always try and render `[Pinned output {}]`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

We only render `[{}]` on narrow widths.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-12 19:06:14 +00:00
Jason Jean 29d9d154e9 chore(repo): add verbose logging when releasing (#31158)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Not much info is shown for errors.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

More info is shown when publishing

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-11 16:06:42 +04:00
Ian Luca cbb2619325 fix(core): do not follow symlinks when creating remote cache tarball (#31138)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior

Symlinks in the remote cache tarball are "followed". That modifies the
output of Next.js projects using pnpm, causing a restored cache not to
work in production.

## Expected Behavior

Symlinks are added to the tarball, instead of being followed. I.e. the
cache output is not modified.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Should fix #31085.
2025-05-09 20:48:35 -04:00
Jonathan Cammisuli ce1d6b2e6e fix(core): change default native logging to "OFF" (#31161)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
"ERROR" is set as the default logging level when using native logging.
This causes issues with the new function of calling the native logger
from the JS side.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
"OFF" is set as the default so that no logs appear on stdout if there
was no explicit opt-in.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-09 23:59:10 +00:00
Craigory Coppola bf1eec5eca feat(core): focus single tasks (#31159)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
When running a single task it is automatically focused, but the tasks
list is visible and the task is not interactive

## Expected Behavior
When running a single task, the tui is minimal without a tasks list and
with interactivity by default

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-09 22:44:06 +00:00
Jack Hsu 5aa0c4050f fix(core): handle npm scope when matching project substring (#31160)
This PR fixes an issue if a JS project uses the same name as the npm
scope.

For example, if you have `@acme/acme` and `@acme/acme-e2e` projects,
then running `nx lint acme` will fail with an error:

```
 NX   Multiple projects matched:

@acme/acme-e2e
@acme/acme
```
## Current Behavior
Nx fails to run the task

## Expected Behavior
Nx should find the project to run the task for (ignoring scope)

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-09 18:43:36 -04:00
Jason Jean b620ea7dc1 fix(core): show all native logs for debug mode (#31154)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

TUI debug mode only shows native logs since the TUI launched.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

TUI debug mode shows logs even before the TUI launched such as task
hashing logs and more.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-09 20:26:38 +00:00
Jonathan Cammisuli f5cc2d51b0 fix(core): simplify action dispatch, use mutex locking, and avoid unnecessary clones (#31157)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
* There are many unwraps that we can avoid by using `parking_lot::mutex`
* There is an unnecessary `task::spawn` to dispatch actions. The channel
is non-blocking and this is wasted cycles
* There are a bunch of clones that are happening with the PtyInstances

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
* Uses `parking_lot::Mutex` and removes `unwraps()`
* Dispatches actions directly without going into tasks
* Uses tuple derefs to avoid clones, and uses 2 instead of 4

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-09 15:40:07 -04:00
Mike Hartington 8082184dc7 docs(misc): fix blog posts for nx 21 (#31155)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-09 14:49:06 -04:00
Jason Jean 0a2553aa2c chore(core): add debug mode for tui (#31115)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Debugging the TUI is a chore

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Debugging the TUI is a little better..

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-09 11:57:32 -04:00
Stanislas Bernard cdba055744 fix(docs): typo in introduction.md (#31145)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

There's a typo.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Typo is fixed.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-09 10:39:29 -04:00
Philip Fulcher aef67bdc9f docs(nx-dev): add continuous tasks and terminal ui articles (#31092)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2025-05-09 16:32:45 +02:00
Nicholas Cunningham 124eba7557 fix(core): Update React,Vue and Node generators applications for CNW (#31059)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
- Currently, when we create a React, Vue or Node app we add the app name
inside `package.json` under the nx
```
{
  "name": "@myworkspace/acme",
  "version": "0.0.1",
  "private": true,
  "nx": {
    "name": "acme"
  }
}

```

- When we create a publishable library using React/JS generator inside a
ts project references workspace the `--importPath` option.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- Since the original intention is not known we should not automatically
add this to the project's `package.json`
- `importPath` option should not be required when using ts project
references.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
For workspaces that are not using TS project references the result
remains unchanged.

Fixes #
2025-05-09 08:23:38 -04:00
Juri 00af9748ad docs(core): add Terminal UI video 2025-05-09 13:37:39 +02:00
Jason Jean 8c50b7f3af fix(core): only cleanup db connection on exit (#31137)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

db connections are cleaned up on SIGTERM, SIGHUP, SIGINT, AND exit. On
SIGTERM, SIGHUP, and SIGINT, the process exits there.. which short
circuits other SIGTERM, SIGHUP, and SIGINT handlers.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

db connections are only cleaned up when the process actually exits. It
does not exit the process here in response to any signals.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-08 22:35:01 +00:00
Emily Xiong f339a1ab40 fix(gradle): fix gradle tests (#30879)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
currently, because it requires to sign locally, so i thought run command
like
`:project-graph:publishToMavenLocal -x
:project-graph:signNxProjectGraphPluginPluginMarkerMavenPublication -x
:project-graph:signPluginMavenPublication -x
:project-graph:publishNxProjectGraphPluginPluginMarkerMavenPublicationToMavenLocal
-x :project-graph:publishPluginMavenPublicationToMavenLocal` would
publish the plugin locally, but it actually does not. it does not throw
an error, but does not do anything at all.
so for e2e tests, it is actually pulling the latest published gradle
plugin from maven rather than test local code, hence the e2e errors.

also, currently project graph build for java version 21, we change it to
java 17 to be used by ocean repo.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
change the command to `./gradlew :project-graph:publishToMavenLocal
-PskipSign=true` and not apply signing when skip sign is true, so this
should be able to publish plugin to local repository.

work with java 17

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-08 17:29:10 -04:00
Emily Xiong 468ec023c5 fix(gradle): specify idle timeout for gradle batch runner (#31009)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
there is no idle timeout set for gradle, by default is 3 hours.
when running gradle in DTE, it seems to run into memory issue. Even
through using tooling api, the connection is closed when batch is done,
but i think the gradle daemon is still active in the background. when
running the next batch, it is going to start a new gradle daemon and i
got an error like
```
Starting a Gradle Daemon, 2 busy and 200 stopped Daemons could not be reused, use --status for details
```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
add idle timeout for 10s.
this inline command will make gradle daemon to stop itself after 10s.


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-08 17:26:16 -04:00
Jason Jean aea60e1a5e fix(core): handle process killing more robustly (#31131)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Cleanup is happening on SIGTERM, SIGINT, and SIGHUP signals and on
exit....

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Cleanup is mostly done on exit.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-08 15:25:33 -04:00
Isaac Mann b6dc0d9e8e docs(core): render links in command descriptions (#30832)
Render links as links in command descriptions
- in the terminal, links are listed as text
- on the docs site, links are rendered as markdown links
2025-05-08 13:37:17 -04:00
Colum Ferry 0bf114eb11 docs(nx-dev): blog post for improved module federation experience (#31072)
Add a blog post detailing the new module federation experience

---------

Co-authored-by: Philip Fulcher <philip@nrwl.io>
Co-authored-by: Mike Hartington <mhartington@users.noreply.github.com>
2025-05-08 10:16:29 -06:00
James Henry 76b3f57823 chore(repo): update to nx 21.0.2 (#31118) 2025-05-08 10:55:47 -04:00
Jonathan Cammisuli 525bcca0a0 fix(core): replace posix.relative with relative for path resolution (#30783)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Whenever using the new Typescript style repos (using package.json
instead of project.json for typescript projects), we get incorrect paths
when using `resolveImportWithRequire` on Windows. Currently when trying
to find a path, we end up with a path similar to
`../C:\\dev\\nx\\file.ts` which is incorrect.

## Expected Behavior
Changing `posix.relative` to just relative, allows us to get the proper
path on Windows like so: `.\\file.ts`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-05-08 13:49:13 +00:00
Leosvel Pérez Espinosa 6176d3a504 chore(repo): update self hosted cache packages (#31120)
## Current Behavior

Running commands in the Nx repo panic due to a wrong published version
of `@nx/powerpack-license` package.

## Expected Behavior

Running commands in the Nx repo should not panic.

## Related Issue(s)

Fixes #
2025-05-08 13:05:58 +00:00
Jason Jean c19e6b8ce0 chore(repo): update to v2 of self hosted cache packages (#31094) 2025-05-08 12:15:21 +04:00
Jason Jean d8ad991ae7 chore(repo): enforce clippy (#31093) 2025-05-08 11:29:18 +04:00
Craigory Coppola 98d3354855 fix(core): tui summary should capture more terminal outputs (#31113)
## Current Behavior
Some task outputs are missing in terminal outputs

## Expected Behavior
Task outputs are present

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-07 18:37:21 -04:00
Jason Jean 6f9cce78ac fix(core): tui should not exit when underlying process is cancelled (#31112)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Entire TUI exits when any process exits with a SIGINT

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

TUI stays alive when a process exits with a SIGINT

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-07 20:52:40 +00:00
Jason Jean 0d53604b5a fix(core): clearer tui colors on light themes (#31095)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Light themes are not super clear with the new TUI.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Light themes are much clearer with the new TUI.

Internal loom shared on slack for full details.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: JamesHenry <james@henry.sc>
2025-05-07 16:29:36 -04:00
Robby Rabbitman b65216387e chore(core): nx plugin submission @robby-rabbitman/nx-plus-web-test-runner (#30419)
<!-- 
_[Please make sure you have read the submission guidelines before
posting an
PR](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#submit-pr)_

# Community Plugin Submission

Thanks for submitting your Nx Plugin to our community plugins list. Make
sure to follow these steps to ensure that your PR is approved in a
timely manner.

## Plugin Requirements

Before you submit your plugin to be listed in our registry, it needs to
meet the following requirements:
- Run some kind of automated e2e tests in your repository
- Include `@nx/devkit` as a `dependency` in the plugin's `package.json`
- List a `repository.url` in the plugin's `package.json`

i.e.

```
{
  "repository": {
    "type": "git",
    "url": "https://github.com/nrwl/nx.git",
    "directory": "packages/web"
  }
}
```

Note: We reserve the right to remove unmaintained plugins from the
registry. If the plugins become maintained again, they can be
resubmitted to the registry.

## Steps to Submit Your Plugin
- Use the following commit message template: `chore(core): nx plugin
submission [PLUGIN_NAME]`
- Update the `community/approved-plugins.json` file with a new entry for
your plugin that includes `name`, `url`, `description`:

Example:

```json
// community/approved-plugins.json

[{
    "name": "@community/plugin",
    "url": "https://github.com/community/plugin",
    "description": "This plugin provides the following capabilities."
}]
```

Once merged, your plugin will be available when running the `nx list`
command, and will also be available in the Plugin Registry on
[nx.dev](https://nx.dev/plugin-registry)
-->

# Community Plugin Submission

## @robby-rabbitman/nx-plus-web-test-runner

A plugin to infer [Web Test
Runner](https://modern-web.dev/docs/test-runner/overview) in a Nx
workspace.

<!-- 
Describe what your plugin is and what is its goal or issues it
addresses. If you don't provide a description, we will not merge your
PR.
Is it focused on a technology, tooling or behaviour? Does the plugin
provide generators, executors or graph support?
Do you know who is already using the plugin? Mention who is the author
of the plugin.
-->

Co-authored-by: robby rabbitman <robby.rabbitman@gmail.com>
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2025-05-07 19:25:16 +00:00
James Henry 9b2eed2662 fix(core): resolve excessive CPU consumption via child_process.rs (#31110)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-07 15:05:16 -04:00
Jason Jean 68426f6adb fix(core): run script should exit the process when kill signals are r… (#31109) 2025-05-07 13:42:27 -04:00
Nicholas Cunningham 3b3b320ff7 fix(core): add keepExistingVersions to jest option to preserve dependency versions (#30652)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, when we use the jest configuration generator it will forcibly
update the jest version if the package already exist.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Now, the jest version will be preserved unless the option is passed to
update the version.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-07 10:01:10 -06:00
Jason Jean 480a20e3c5 fix(core): explicitly cleanup forked process task runner (#31106)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Forked process task runner cleanup is not explicitly invoked.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Forked process task runner cleanup is explicitly invoked.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-07 11:29:35 -04:00
Jack Hsu 3b19cf6811 docs(misc): add blog post for migrate ui (#31086)
This PR adds a blog post for the new Migrate UI.

Preview:
https://nx-dev-git-blog-migrate-ui-nrwl.vercel.app/blog/migrate-ui

---------

Co-authored-by: Philip Fulcher <philip@nrwl.io>
2025-05-07 15:29:13 +00:00
Caleb Ukle e118210e7f docs(nx-dev): add Nx Cloud terms link in footer (#31105)
before: no link to nx cloud terms in footer

after: 
make terms easier to find for people by adding a link in the docs footer
![WKMac
2025-05-07T13-54-56](https://github.com/user-attachments/assets/74c618c1-aa0b-4c98-8a69-fad2fb5f1f3c)
2025-05-07 10:54:14 -04:00
Leosvel Pérez Espinosa e6a3d77db3 fix(js): handle ${configDir} in tsconfig files when inferring tasks (#31098)
## Current Behavior

The `${configDir}` template variable in tsconfig files is incorrectly
handled when inferring tasks with the `@nx/js/typescript` plugin.

## Expected Behavior

The `${configDir}` template variable in tsconfig files should be
correctly handled when inferring tasks with the `@nx/js/typescript`
plugin.

## Related Issue(s)

Fixes #30883
2025-05-07 10:15:56 +00:00
Isaac Mann 30a7709d71 chore(nx-dev): block linking to preview urls (#31081)
Catch links to preview urls
2025-05-06 18:43:57 -04:00
Nicolas Beaussart a944c8cd54 fix(core): fail nx release cli when publish step fails (#31088) 2025-05-06 19:17:10 +00:00
Benjamin Cabanes 05c9d0d24f docs(nx-dev): set new GTM ID (#31090)
Replaced the GA Measurement ID with the new GTM Measurement ID.
2025-05-06 14:13:44 -04:00
Benjamin Cabanes 42a9a2c51a docs(nx-dev): clarify enterprise security (#31089)
Updated content to specify vulnerabilities in community-built and Nx self-hosted cache solutions, highlighting risks like cache poisoning and lack of compliance with regulated industry security standards.
2025-05-06 18:12:31 +00:00
James Henry 71de122579 fix(core): send up and down arrows to pty in interactive mode (#31084) 2025-05-06 15:58:47 +00:00
Colum Ferry ba6d324645 docs(angular): update angular rspack docs to reflect recent updates (#31074)
## Current Behavior
The docs on Angular Rspack's supported features are outdated

## Expected Behavior
Update the supported features for Angular Rspack
2025-05-06 16:33:21 +01:00
Isaac Mann ea40d04e70 fix(nx-dev): webinar list page shows event date (#30953)
/webinar page should show the event date not the publish date
2025-05-06 11:24:58 -04:00
Nacho Vazquez 9ae68a7c0d chore(core): nx plugin submission @naxodev/gonx (#31034)
# Community Plugin Submission

Thanks for submitting your Nx Plugin to our community plugins list. Make
sure to follow these steps to ensure that your PR is approved in a
timely manner.

## Plugin Requirements

Before you submit your plugin to be listed in our registry, it needs to
meet the following requirements:
- Run some kind of automated e2e tests in your repository
- Include `@nx/devkit` as a `dependency` in the plugin's `package.json`
- List a `repository.url` in the plugin's `package.json`

i.e.

```
{
  "repository": {
    "type": "git",
    "url": "https://github.com/nrwl/nx.git",
    "directory": "packages/web"
  }
}
```

Note: We reserve the right to remove unmaintained plugins from the
registry. If the plugins become maintained again, they can be
resubmitted to the registry.

## Steps to Submit Your Plugin
- Use the following commit message template: `chore(core): nx plugin
submission [PLUGIN_NAME]`
- Update the `community/approved-plugins.json` file with a new entry for
your plugin that includes `name`, `url`, `description`:

Example:

```json
// community/approved-plugins.json

[{
    "name": "@community/plugin",
    "url": "https://github.com/community/plugin",
    "description": "This plugin provides the following capabilities."
}]
```

Once merged, your plugin will be available when running the `nx list`
command, and will also be available in the Plugin Registry on
[nx.dev](https://nx.dev/plugin-registry)
-->

# Community Plugin Submission

## @naxodev/gonx

GoNx is an opinionated Nx plugin for Go/Golang development, forked from
the original nx-go plugin. It enables developers to manage Go projects
within an Nx ecosystem through a non-invasive approach that heavily
relies on inferred tasks and modern Nx features.

The plugin provides generators for applications and libraries with
customizable module setup, executors for building, testing, running, and
managing dependencies, and full Nx integration, including cacheable
tasks, GraphV2 support, and release capabilities. GoNx utilizes official
Go commands in the background, delivering efficient caching and
dependency graph tools for Go projects.
2025-05-06 10:16:08 -04:00
Colum Ferry 678965da21 feat(rspack): upgrade to version 1.3.8 (#31070)
## Current Behavior
We currently install Rspack at `^1.2`. The latest version of Rspack is
`1.3.8`
Angular Rspack now requires at least `1.3.5`

## Expected Behavior
Rspack installations should use latest version of `1.3.8`
2025-05-06 09:30:01 -04:00
Philip Fulcher d8cf187dbc docs(nx-dev): add link to release notes in nx21 article (#31079) 2025-05-06 13:06:26 +00:00
Colum Ferry ee276413b8 docs(gradle): fix link in overview doc (#31073)
## Current Behavior
The link to Continuous Tasks is pointing to a preview site.

## Expected Behavior
The link should remain on the production site.
2025-05-06 08:50:17 -04:00
Philip Fulcher a36aaacef6 docs(nx-dev): add nx 21 release article (#31036)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2025-05-06 06:44:42 -06:00
Isaac Mann 72a0ef541f chore(core): fix docs release script for single version (#31060)
Fixes an issue with the docs release script when there is only one
version in a particular major version.

The `npm show [version] --json` command normally returns an array of
strings, but if there is only one version returned, it tries to be
helpful by returning a string instead. This fix normalizes that
behavior.
2025-05-05 20:34:01 -04:00
Jack Hsu 382bd6eb2c docs(misc): update version picker to include v21 (#31053)
This PR updates docs to show v21 in the version picker.

Currently, it shoulds v17, v18, v19, and v20.

<img width="611" alt="Screenshot 2025-05-05 at 3 34 26 PM"
src="https://github.com/user-attachments/assets/baee6f00-8db2-4300-ac80-944b8a6b760a"
/>

It should show v21, v20, and v19 according to our LTS policy.
2025-05-05 16:16:45 -04:00
Jason Jean 5eefe8575a chore(repo): update nx to 21.0.0-rc.4 (#31046)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx 21.0.0-rc.3

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx 21.0.0-rc.4

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-05 15:59:37 -04:00
Jason Jean 5cd09f97ff fix(core): kill tasks run via run-commands (#31045)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Tasks run via `run-commands` are not cleaned up properly.

`nx serve-docs nx-dev` in this repo did not cleanup the running server
when cancelled.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Tasks run via `run-commands` are cleaned up properly.

`nx serve-docs nx-dev` in this repo does clean up the running server
when cancelled.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-05 13:47:18 -04:00
James Henry e2b27b849b fix(core): switch to tui-term fork to support dimmed content (#31044) 2025-05-05 17:30:34 +00:00
Nicholas Cunningham 265bb0b4bb fix(core): update ci-workflow generator package manager installation (#31018)
This pull request updates the CI workflow configuration to replace the
use of `pnpm/action-setup` with `corepack enable` for package manager
setup.

- NPM versions greater than 8 has an error which has been [fixed in Node
22.5.1](https://github.com/npm/cli/issues/7639), since we are still
using Node 20 we need to pin the installed npm version to 8.
- Now we are conditionally handling different package managers based on
how the repo has been configured.
Should the repository specify the package manager's version for `pnpm`
and `yarn` those versions will be respected, else it will fallback to a
`9.8` for `pnpm` and `1.22` for `yarn`.

---------

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-05-05 16:25:36 +00:00
James Henry 37dea94062 fix(core): improve tui selected task contrast (#31039) 2025-05-05 12:11:01 -04:00
James Henry 0402e85d87 fix(core): q should exit tui immediately if all tasks complete (#31040) 2025-05-05 12:08:55 -04:00
Craigory Coppola 9fe487c0f3 fix(core): tui summary should show cancelled when interrupting dev server (#31042)
## Current Behavior
Interrupting a serve task with `Control + C` displays a "Success"
message, which isn't quite accurate.

<img width="1077" alt="image"
src="https://github.com/user-attachments/assets/b7e7086d-2725-4c65-b1f6-9f8a5db5196a"
/>


## Expected Behavior
Interrupting a serve task displays a "Cancelled" message

<img width="1077" alt="image"
src="https://github.com/user-attachments/assets/698e6e43-a376-473a-ab4f-7d514026ff02"
/>


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-05 12:08:02 -04:00
Nicholas Cunningham ce64f85069 fix(core): Disable e2e matrix as macos is still hanging at install (#31041)
Disabling the schedule run for e2e matrix job as macos is still hanging.
 
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-05 09:56:48 -04:00
Jordan fb6c2ca5f0 docs(core): add briebug to partners and update pushbased (#30904)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
- Adds Briebug as an Nx Partner
- Updates Pushbased partner slogan and tags

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-05 08:35:45 -04:00
Jason Jean cc1f655e99 chore(repo): update nx to 21.0.0-rc.3 (#31035)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `21.0.0-rc.2`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `21.0.0-rc.3`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-05 07:59:36 +00:00
Jason Jean 02ba546ad7 fix(core): exit the command with sigint if it is interrupted (#31028)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When tasks are still running but the user exits the TUI, Nx returns exit
code 0 (success)

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When tasks are still running but the user exits the TUI, Nx returns exit
code 130 (SIGINT)

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-05 03:45:22 -04:00
Isaac Mann 2cb0fa2b55 docs(core): publish tutorial kit tutorials (#30973)
- Migrate Gradle tutorial to tutorial kit section (not as an interactive
tutorial)
- remove `npx` from online tutorial instructions
- Update sidebar tutorial links to point to new tutorials

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-05-03 10:58:02 -04:00
Josh VanAllen 675e6ed8ec docs(nx-cloud): add gradle references (#31025)
Update references in "task splitting" to link the Gradle testing task
splitting.
2025-05-02 19:24:02 -06:00
Emily Xiong 70cec4b41a fix(gradle): fix workflow to run assemble check with batch (#31022)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
currently, the command in ci workflow is `nx affected -t build`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
change to run `nx affected -t assemble, check` with batch turned on for
gradle

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-02 19:55:12 -04:00
Craigory Coppola 6e12a821df feat(core)!: remove outputStyle=compact (#31016) 2025-05-02 23:05:59 +00:00
Craigory Coppola c2321a3489 fix(core): more tui summary updates and unit tests (#31019) 2025-05-02 18:34:49 -04:00
Craigory Coppola b95621f42e fix(core): nx init should configure plugins for encapsulated workspaces (#31020) 2025-05-02 18:17:20 -04:00
Craigory Coppola 32ec0aee0c fix(core): reset should clear cloud light client (#31021) 2025-05-02 18:01:57 -04:00
Nicholas Cunningham 90d4446f1a fix(core): enable E2E tests for macOS in CI workflow (#30986)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-02 17:52:22 -04:00
Nicholas Cunningham 516febf436 fix(core): Update nightly tests to work with continuous local-registry (#31007)
Currently, when the Nightly E2E Matrix job is ran it gets stuck at:
```
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
```

Which blocks other jobs and they will be queued for an unnecessary long
period.

![image](https://github.com/user-attachments/assets/bc9e0993-423b-4fb6-9fa0-4e4a1d0a5bb7)

This change should ensure that the local-registry is ran first before
attempting to run the test suite.

Results:
https://github.com/nrwl/nx/actions/runs/14799474928/job/41554727471
No longer hanging.
2025-05-02 17:30:12 -04:00
Jack Hsu e30b5fa7d4 chore(repo): mark vite as cacheable (#31017)
This PR makes sure that `vite:build-base` is cacheable. It's a
long-standing issue because vite is the only package using SWC to build,
thus the `targetDefaults` using TSC is not being applied. We don't
actually need to specify the executor, as `build-base` using
`@nx/next:build` (nx-dev) and `@nx/js:swc` (vite) are both cacheable.
2025-05-02 16:48:34 -04:00
James Henry 8b3e9f7d5b fix(release): only error on missing manifestsToUpdate if a project is being directly processed (#31004) 2025-05-02 16:37:06 -04:00
Leosvel Pérez Espinosa ada3f47338 fix(vue): install @typescript-eslint/parser when generating project using it (#31008)
## Current Behavior

Vue and Nuxt projects using ESLint with flat config generate projects
using the `@typescript-eslint/parser` but don't install the package.
This can result in an error if the package has not been installed
before.

## Expected Behavior

Vue and Nuxt project generators should install the
`@typescript-eslint/parser` if they generate ESLint configuration that
uses it.

## Related Issue(s)

Fixes #
2025-05-02 16:36:41 -04:00
James Henry 49e71817f2 fix(core): ensure the terminal is restored when cloud exits (#31013) 2025-05-02 16:36:06 -04:00
Jack Hsu d57086b5ab fix(testing): ignore test outputs from playwright when linting (#31015)
Currently if Playwright runs with trace on, it'll generate `.js` files
in `test-output` folder. Trace is turned on automatically whenever a e2e
test retries, or if the user sets `trace: 'on'`, or if `--trace on` is
passed to the CLI.

These trace `.js` files are being linted, and is failing the lint task.

## Current Behavior
Lint fails when trace is on

## Expected Behavior

Lint should ignore trace files
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-02 16:35:31 -04:00
Craigory Coppola 0a4f682ef7 fix(core): tui summary should not show canceled during run-one because tasks are skipped (#31014) 2025-05-02 16:17:53 -04:00
Craigory Coppola 6e1f304898 fix(core): skip vt100 parsing if tui disabled (#31010) 2025-05-02 14:35:03 -04:00
Jason Jean 7059d6f17b chore(repo): update nx to 20.8.0-rc.2 (#31006)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `21.0.0-rc.1`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `21.0.0-rc.2`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-02 12:58:37 -04:00
Nicholas Cunningham 1191caa203 fix(core): remove unnecessary corepack defaults (#30992)
These defaults are unnecessary and can be removed.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-02 12:20:04 -04:00
Jack Hsu a5c104406b docs(core): add a callout that Windows support for TUI is coming soon (#31005)
This PR updates the TUI page to mention Windows support is coming soon.

Preview:
https://nx-dev-git-docs-tui-windows-nrwl.vercel.app/recipes/running-tasks/terminal-ui
2025-05-02 12:04:35 -04:00
Jack Hsu aa92b3361c fix(core): update fork task runner so it propagates exit signals (#30998)
This is a fix when using the TUI `forked process-task-runner`. The
`SIGINT` and other signals are not handled, which causes the underlying
process (in this case `run-executor`) to be left hanging.

## Current Behavior
TUI leaves processes hanging when using `forked-process-task-runner`

## Expected Behavior

TUI should kill processes
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-02 13:52:58 +00:00
James Henry ed3788fd2b fix(core): improve tui task_list bottom section responsive design (#30993) 2025-05-02 09:30:54 -04:00
James Henry 87a00da7e5 docs(core): add terminal-ui recipe (#30918) 2025-05-02 16:55:55 +04:00
Jack Hsu 3688ef58b9 chore(misc): fix npm version badge in generated readme files (#30996)
This PR fixes the badge on package readmes, e.g.
https://www.npmjs.com/package/nx.

It currently shows the latest for `@nrwl/workspace`, which is `19.8.4`,
but we should show the latest nx (`20.8.1`).
2025-05-02 08:36:30 -04:00
Leosvel Pérez Espinosa 80e6edd707 fix(testing): use correct server process reference when killing the server in the cypress preset (#30994)
## Current Behavior

Cypress e2e tasks fail when trying to kill the web server with:

```bash
TypeError: Cannot read properties of undefined (reading 'childProcess')
    at /<repo path>/node_modules/@nx/cypress/plugins/cypress-preset.js:65:30
    ...
```

## Expected Behavior

Cypress e2e tasks should not fail when trying to kill the web server.

## Related Issue(s)

Fixes #
2025-05-02 10:43:03 +00:00
Jason Jean 51168a7c38 chore(repo): update nx to 21.0.0-rc.1 (#30989)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx 21.0.0-beta.12

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx 21.0.0-rc.1

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-02 05:09:40 +00:00
Josh VanAllen 2db85fc8b0 docs(gradle): polish gradle docs (#30983)
Updating docs to reflect the new way approach in the gradle plugin
2025-05-01 23:44:12 -04:00
Jason Jean cd2e35d402 fix(core): run discrete tasks using batches if possible (#30991)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Discrete tasks are not run with batches.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Discrete tasks are run as batches if possible.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-02 03:37:47 +00:00
Jason Jean 110614da07 fix(core): fix windows native build (#30990)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Native build is broken on Windows.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Native build is fixed on windows.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-02 02:35:56 +00:00
Nicholas Cunningham 54cbbb9135 feat(core): add continuous option to targets for Detox, Expo, and React Native (#30988)
Adds continuous support for Detox, Expo and React Native
 
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 20:58:25 -04:00
Craigory Coppola e29909e71f fix(core): send signals when killing child process on unix (#30987)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
rspack and next do not get killed when using the tui. This appears to be
caused by them not responding correctly to SIGTERM, so we need a way to
pass signals with our `kill` call.

## Expected Behavior
We properly shutdown rspack and next servers

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 20:48:52 -04:00
Colum Ferry 5f488947dc feat(remix)!: remove deprecated static-serve target name from inferred targets (#30982)
This commit also contains various changes to ensure serve-static tasks
depend on their build.

BREAKING CHANGE: Remove deprecated static-serve target name from Remix
Inferred Tasks in favour of serve-static.
2025-05-01 18:52:57 -04:00
Nicholas Cunningham f9d461e663 feat(react-native): update executor and schema files for expo and react-native to be continuous (#30985)
WIP

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 18:47:35 -04:00
James Henry 157a1f1168 chore(core): tui polish and tasks_list unit tests (#30972) 2025-05-01 18:42:32 -04:00
Nicholas Cunningham e013125136 fix(core): Disable the macOS job to prevent PRs from being blocked by its long runtime. (#30984)
MacOs CI job is taking a lot longer than expected and it blocks PRs
statues from being generated.

We should keep working on it so it can be re-enabled.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 18:39:40 -04:00
Craigory Coppola 79b89fb7a7 fix(misc)!: only provide default value for object properties if object already has value (#28838)
Defaults causing an object to be defined causes some confusing behavior
when a schema has defaults and required properties for a given object
prop. If the required prop doesn't have a default value, and another
property does, it becomes invalid to not pass the object when it would
be valid had that default not been specified.

BREAKING CHANGE: Currently if an executor's schema provides some default
values for an object's properties, those defaults cause the object to be
defined. This changes that, such that the defaults are only applied if
the object exists in the first place.

Fixes #23153
2025-05-01 20:37:50 +00:00
Jack Hsu 7b9add5582 fix(core): use process#kill instead of tree-kill for windows and macos (#30976)
Prefer `process#kill` instead of `tree-kill` for Mac and Windows. This
fixes an issue on Windows where the `taskkill` is unsuccessful.

## Current Behavior
Windows does not always run successfully

## Expected Behavior
Windows runs successfully

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 16:35:22 -04:00
MaxKless 1029ecb9fd fix(graph): make migrate ui future migration circles cleaner (#30898)
we put a lot of focus on making the migrate ui clean and easy to parse. 
The repeated icons were more distracting than valuable so let's remove
them.
2025-05-01 16:19:43 -04:00
Benjamin Cabanes 413a01159f docs(nx-dev): remove unused external script loader (#30978)
Removed the external JS script loader for a third-party B2B script as it is no longer required. This simplifies the `_app.tsx` file and avoids unnecessary script management during route changes.
2025-05-01 20:13:31 +00:00
Benjamin Cabanes a3415309b9 docs(nx-dev): add Google Tag Manager script (#30977)
Integrated Google Tag Manager (GTM) with both script and noscript tags for analytics tracking. Ensured the script uses `afterInteractive` loading strategy and includes dynamic `gaMeasurementId` for proper configuration.
2025-05-01 20:07:08 +00:00
Craigory Coppola 95652aef88 fix(core): prioritize --output-style flag over tui env vars (#30969)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-01 16:00:59 -04:00
Jason Jean e5dc244e66 feat(core): bump devkit support range and remove some deprecated APIs (#30840) 2025-05-01 14:48:40 -04:00
Craigory Coppola ac6d2beac0 feat(core): support reading NX_TUI_AUTO_EXIT env var (#30971)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
--tuiAutoExit doesn't support env vars

## Expected Behavior
NX_TUI_AUTO_EXIT can set --tuiAutoExit

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 14:08:28 -04:00
Craigory Coppola 958985a182 fix(core): don't display fork script path in tui (#30970)
## Current Behavior
The tui displays the path to the fork script in the pty pane

## Expected Behavior
The tui displays a command that would be "close enough" to what is being
ran in the pty pane

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 14:03:43 -04:00
Emily Xiong 3877a43a47 fix(gradle): add gradle migration to change ciTargetName (#30965)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
this pr address comments in https://github.com/nrwl/nx/pull/30457

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- update executor description
- use pseudo terminal when run batch command
- add an e2e test to run gradle command in batch
- add migration script to change ciTargetName to ciTestTargetName

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 13:21:39 -04:00
Colum Ferry 11ca6fc685 fix(angular): convert-to-rspack should ensure zone.js is not treated as local file (#30966)
## Current Behavior
The `@nx/angular:convert-to-rspack` relies on `require.resolve` to check
if entries listed in the `polyfills` array is an npm package.
However, in some circumstances such as generating a new app, `zone.js`
is not yet installed and therefore require.resolve will not resolve the
package.

## Expected Behavior
Ensure that `zone.js` is special cased as it is a polyfill that is
always needed to be treated as a package.
This is also the only polyfill that is set during generation of an app
and therefore is the only package that should run into this issue.
2025-05-01 13:18:32 -04:00
Juri Strumpflohner e239a15052 docs(nx-dev): write blog post about integrating Nx MCP with Nx Cloud (#30948)
adds a new blog post draft for the Nx MCP + Cloud integration.

https://nx-dev-git-blog-nx-mcp-integrates-ci-nrwl.vercel.app/blog/nx-editor-ci-llm-integration
2025-05-01 11:36:49 -04:00
Emily Xiong d13e4df147 feat(gradle): set gradle task continuous for bootRun (#30931)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
non of the gradle tasks is set as continuous

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
set only bootRun task as continuous

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 10:47:14 -04:00
Craigory Coppola 981dd94671 chore(core): format rust code (#30954)
## Current Behavior
Rust formatting isn't checked in CI

## Expected Behavior
Rust formatting is checked in CI

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 12:49:50 +00:00
Tine Kondo d9cb931116 chore(repo): remove bun's workaround to make it work with verdaccio (#30468) 2025-05-01 12:16:25 +04:00
James Garbutt da8baa95da cleanup(misc): migrate to picomatch (#30485) 2025-05-01 11:07:06 +04:00
James Garbutt 1ab8bdbe98 cleanup(vite): migrate to picomatch (#30484) 2025-05-01 11:06:39 +04:00
James Garbutt 6d36be0d24 cleanup(vue): migrate to picomatch (#30483) 2025-05-01 11:05:48 +04:00
Prasanth Louis 0eef86ee20 docs(core): update sync-generators.md (#30812) 2025-05-01 11:04:30 +04:00
Mahtis Michel 545405ac26 chore(nx): fixed typo (#30941) 2025-05-01 11:03:30 +04:00
Nicholas Cunningham 28ddb8e9e7 feat(core)!: drop support for node versions prior to 20.19.0 (#30818)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

BREAKING CHANGE: We are updating our minimum node version to `20.19.0`
which drops support for all prior versions.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-05-01 02:13:50 -04:00
Jason Jean 06873bba25 chore(repo): update nx to 21.0.0-beta.11 (#30959)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `21.0.0-beta.10`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `21.0.0-beta.11`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 03:30:53 +00:00
Jack Hsu 8f503581b6 fix(react): migration for babel supports configs that do not use @nx/react/babel (#30962)
This PR fixes an issue where the updated `.babelrc` is undefined if the
`@nx/react/babel` preset is missing.
2025-04-30 22:04:27 -04:00
Craigory Coppola 5222a067b4 feat(core): disable tui when output style is set to an incompatible style (#30873) 2025-05-01 01:00:46 +00:00
Jason Jean 912a257982 fix(core): return results after NodeChildProcessWithNonDirectOutput has already exited (#30943)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

For some mysterious reason, calling `getResults` after killing a
continuous task causes the DTE agent process.. to exit.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

For some mysterious reason, allowing `getResults` to return results
after the Task has completed fixes the DTE agent process exiting.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-01 00:25:22 +00:00
Craigory Coppola 91f5249fbf fix(core): error when restoring http cache with no outputs (#30961) 2025-05-01 00:19:45 +00:00
Craigory Coppola cf81286421 fix(core): include nx version in native file cache (#30963)
## Current Behavior
The native file cache doesn't check NX_VERSION when determining its key

## Expected Behavior
The native cache is invalidated when updating Nx

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30940
Fixes #29184
2025-04-30 23:58:52 +00:00
Jason Jean fa92c4025e fix(core): fix terminal output for non-tui (#30957)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

vt100 does not work for non TUI

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

do not use vt100 for printing to stdout. vt100 is still used for the TUI
terminal panes.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-30 18:43:01 -04:00
James Henry 0f4c085297 chore(core): add tui layout manager (#30947) 2025-05-01 01:43:11 +04:00
Juri d6ea3ab45f fix(nx-dev): update blog posts with avif cover images 2025-04-30 23:12:17 +02:00
Juri 5651270b33 feat(nx-dev): add conformance rule to verify blog post cover images 2025-04-30 23:12:17 +02:00
Jacob Ley 6610f3d632 fix(core)!: respect packageManager field in package.json when detecting version (#29249)
Attept to read package manager version from config before invoking
package manager CLI

BREAK CHANGE: If you have a mismatch between the `packageManager` field
in `package.json` and the actual version installed in the environment,
it may lead to unexpected behavior when installing. This should not be a
problem if you are using corepack already.

## Related Issue(s)
https://github.com/nrwl/nx/issues/29244

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-04-30 16:59:24 -04:00
Craigory Coppola d89b7743c6 chore(repo): cleanup nx setup around lint-lockfile (#30861) 2025-04-30 14:34:49 -04:00
Jason Jean 7a62c7374b fix(core): fix logging when directory does not exist (#30944) 2025-04-30 14:34:36 -04:00
Jack Hsu 766d1b32e0 docs(misc): remove installation instructions for Nx < 18 (#30950)
This PR removes installation instructions for Nx < 18 since it has
fallen out of support window. Users can always `npm install <plugin>` as
usual if they are on an unsupported Nx version, but the docs will assume
`nx add` moving forward.

The changes are on the plugin overview page:
https://nx-dev-git-docs-remove-nx-pre-18-install-nrwl.vercel.app/nx-api
2025-04-30 14:34:28 -04:00
Benjamin Cabanes cdbd97e98e docs(nx-dev): disable display of webinar banner (#30951)
Commented out the `WebinarNotifier` in `_app.tsx` and removed the live event banner in the `hero.tsx` component.
2025-04-30 13:34:51 -04:00
Craigory Coppola d1f5a570f9 chore(repo): bump @monodon/rust to latest (#30928)
## Current Behavior
`@monodon/rust` is outdated

## Expected Behavior
`@monodon/rust` is updated

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-04-30 13:13:14 -04:00
Craigory Coppola e273dec53f chore(repo): adjust concurrency to use unique groups for push events (#30946) 2025-04-30 12:50:10 -04:00
Benjamin Cabanes bd27fb00f3 docs(nx-dev): normalize casing in text for consistency (#30945)
Updated "Learn more" to "learn more" and "SOC-2" to "SOC 2" to ensure uniform text formatting and alignment with standard practices.
2025-04-30 12:46:28 -04:00
Edouard Maleix 1d1d32c0f1 chore(core): nx plugin submission @getlarge/nx-node-sea plugin (#30323)
# Community Plugin Submission

## @getlarge/nx-node-sea
2025-04-30 12:28:14 -04:00
Craigory Coppola 8f2c11c9ee fix(core): dont cache default plugins as all plugins if loading plugins fails (#30927) 2025-04-30 15:54:58 +00:00
Jack Hsu dcef5c7cf2 feat(graph): show next steps for successful migrations (#30934)
This PR updates Migration UI to display "next steps" when they are
provided by a migration. This works by writing `nextSteps` into the Nx
Console meta in `migrations.json`.

If the `nextSteps` is missing or it's empty, then nothing will be shown.

<img width="1555" alt="Screenshot 2025-04-29 at 5 16 49 PM"
src="https://github.com/user-attachments/assets/88491632-9b33-421a-887a-b6fbb5676098"
/>

See: https://www.loom.com/share/c0a4a7dce9df46b5b023fce5e0a3bd2f
2025-04-30 08:16:30 -04:00
James Henry 9dcab79b10 feat(release)!: support gitlab releases (#30802) 2025-04-30 12:41:03 +04:00
Jason Jean d5a1918eb6 fix(core): write keybindings with control to terminal panes in intera… (#30938)
…ctive mode

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Ctrl Keybindings are not sent to terminal panes when it's interactive
mode, only single key presses are sent.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Ctrl Keybindings are sent to the terminal panes when it is in
interactive mode. This means that editors like `nano` and `nvim`
somewhat work in interactive mode. The rendering is still broken right
now but the keypresses work.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-30 12:36:23 +04:00
Leosvel Pérez Espinosa e75eeabac5 cleanup(angular): update ng-packagr nested import paths (#30897)
Update the nested import paths from `ng-packagr` to handle the different
paths in the upcoming Angular v20.

We must update and release `@nx/angular` and update the Nx repo with the
new version to handle the path changes in the upcoming `ng-packagr` v20
before updating the version in the Angular v20 branch. Otherwise, a
compilation error is thrown when building the v20 branch because the
installed `@nx/angular` version does not support the new paths needed in
`ng-packagr` v20.
2025-04-30 10:28:11 +02:00
Jason Jean 07b881d9ed fix(core): kill child processes when pseudo terminal shutsdown (#30935)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The PseudoTerminal does not kill it's child processes when it shuts
down.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The PseudoTerminal will kill it's child processes when it shuts down.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-29 20:58:36 -04:00
Jason Jean 94803fbf53 chore(module-federation): disable test that is causing agents to run … (#30936)
…out of memory

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Many pipelines are stuck because this task is causing agents to run out
of memory.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This test is disabled so that pipelines can complete.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-29 23:30:37 +00:00
Jason Jean 84c4dc55d2 fix(core): throw errors when task graph has invalid continuous tasks (#30924)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

1. The continuous property is not present in the nx.json schema.
2. When tasks which do not support parallelism depend on a continuous
task, task execution is deadlocked.
3. Circular dependencies between continuous dependencies are allowed.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

1. The continuous property is added to the nx.json schema.
2. An error is thrown when tasks which do not support parallelism
depends on a continuous task.
3. Circular dependencies between continuous tasks are caught and thrown
as an error.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-29 18:51:52 -04:00
Craigory Coppola 15d20f925c chore(repo): move concurrency check and add debug logs (#30929)
Concurrency still isn't quite right
2025-04-29 17:10:32 -04:00
Jack Hsu 6451f66492 Revert "feat(graph): show next steps for successful migrations" (#30933)
This reverts commit 307c45542a.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-29 17:09:19 -04:00
Emily Xiong 624f0359e3 feat(gradle): add batch runner (#30457)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Gradle tasks are run by invoking the Gradle CLI

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Gradle tasks are run through the Gradle Tooling API and is more
performant.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-04-29 16:57:16 -04:00
Colum Ferry 57724d3df9 feat(nuxt): enable continuous tasks (#30925)
## Current Behavior
The tasks inferred by the `@nx/nuxt/plugin` do not set `continuous:true`
for serve-like tasks.

## Expected Behavior
The tasks should be correctly inferred with `continuous:true`.
2025-04-29 16:44:00 -04:00
Jack Hsu 307c45542a feat(graph): show next steps for successful migrations 2025-04-29 16:29:52 -04:00
Jack Hsu 13f57d6c04 docs(core): add continuous task to task pipeline and project config pages (#30919)
This PR adds information about `continuous` option for tasks. Also
removes references to Nx <16 examples on the project configuration page.

**Preview:**
-
https://nx-dev-git-docs-continuous-tasks-nrwl.vercel.app/recipes/running-tasks/defining-task-pipeline#continuous-task-dependencies
- Add a section on continuous task and links to the project
configuration reference page (below)
-
https://nx-dev-git-docs-continuous-tasks-nrwl.vercel.app/reference/project-configuration#continuous
- Add section on continuous task with example of `e2e -> serve`
dependency
- Add a callout on `dependsOn` section for continuous/long-running tasks
(long-running is mentioned so it appears in the search)
  - Remove Nx <16 examples

**TODO:**
- [x] Update PDV that show e2e and serve targets
2025-04-29 15:44:05 -04:00
Benjamin Cabanes 5fc641012d docs(nx-dev): add nx cloud logos (#30926)
This commit introduces new SVG files with single color for Nx Cloud.
2025-04-29 15:28:23 -04:00
Benjamin Cabanes b3e7eee063 docs(nx-dev): add nx cloud logo (#30922)
This commit introduces a new SVG file, `nx-cloud-full.svg`, to the favicon directory.
2025-04-29 14:34:51 -04:00
Isaac Mann 13ebf4359a docs(core): tutorial preview bug (#30903)
- Fix tutorial bug with the preview pane
- Bump Nx version to 20.8 for all 3 tutorials
2025-04-29 13:49:03 -04:00
Jason Jean c1d375883f chore(repo): update nx to 21.0.0-beta.10 (#30906)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx 21.0.0-beta.8.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx 21.0.0-beta.10

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-29 13:32:48 -04:00
Leosvel Pérez Espinosa f39c1f991e cleanup(linter): deprecate the Linter enum (#30875)
Properly deprecate the `Linter` enum in favor of the `LinterType` union
type and remove unneeded internal usages.
2025-04-29 12:39:36 -04:00
Benjamin Cabanes 8028eea824 docs(nx-dev): add NX Cloud favicon (#30921)
Introduce a new favicon specifically for NX Cloud in SVG format.
2025-04-29 12:09:49 -04:00
Leosvel Pérez Espinosa 8d0c7f6349 feat(testing): remove tsConfig and copyFiles options from the @nx/cypress:cypress executor (#30870)
Removes the previously deprecated and unused `tsConfig` and `copyFiles`
options from the `@nx/cypress:cypress` executor.

BREAKING CHANGE: The previously deprecated and unused `tsConfig` and
`copyFiles` options from the `@nx/cypress:cypress` executor were
removed.
2025-04-29 11:12:47 -04:00
Leosvel Pérez Espinosa 9ae691ede8 feat(testing): remove tsConfig option from the @nx/jest:jest executor (#30888)
Removes the previously deprecated and unused `tsConfig` option from the
`@nx/jest:jest` executor.

BREAKING CHANGE: The previously deprecated and unused `tsConfig` option
from the `@nx/jest:jest` executor was removed.
2025-04-29 11:08:59 -04:00
Craigory Coppola c8d89e2f2a feat(core)!: remove legacy cache flag from nx.json (#30787) 2025-04-29 10:39:36 -04:00
Louie Weng 4cca2ba062 docs(nx-cloud): address typos in assignment rules docs (#30901)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

1. remove unnecessary references to `runs-on`
2. fix ordering of rule precedence example so that it matches the
explanatory paragraph
3. modify the matrix github actions example so that agents of different
types do not have the same name

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-29 14:11:35 +00:00
Craigory Coppola 4b9eab994a fix(core): tui summary should handle in progress tasks properly (#30905)
## Current Behavior
When running via run-many failures that include a continuous task are
indicated as a cancellation on the tui summary

## Expected Behavior
Failures that run to completion are not cancelled, and should be
displayed as a failure

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-29 10:00:54 -04:00
Jack Hsu 147d0e1345 chore(js): bump some v21 removal to v22 (#30911)
This PR bumps two v21 removals to v22:
1. SWC inline feature -- some people still use it even though it's
experimental. We should rethink how to remove this.
2. Cypress component testing not relying on `@nx/webpack:webpack`
executor -- we need a separate `webpack.cy.config.js` that only
configures the plugins needed Cypress CT.

This PR also keeps the Webpack plugin exports of `@nx/react` and
`@nx/webpack` packages. The `convert-to-inferred` and app generators
have been using the `@nx/react/webpack-plugin` and
`@nx/webpack/app-plugin` already for a while, there's no harm to keep
the exports in the index for older projects if they haven't been
updated.
2025-04-29 09:58:06 -04:00
Jack Hsu e1b56f7c0a feat(webpack): remove isolatedConfig option for @nx/webpack:webpack (#30910)
This PR removes the `isolatedConfig` option that has been deprecated
since v17. Back when it was deprecated, we had a migration to remove the
option and set `webpackConfig` with a generate config file that matches
the executor's built-in behavior. Now that we're removing the option, a
similar migration is added to generate the config files for any projects
that skipped the migration the first time.
2025-04-29 09:57:24 -04:00
Jack Hsu e21c1a6010 feat(react): replace deprecated babel classProperties.loose option in .babelrc files (#30912)
This PR updates all `.babelrc` file that still uses the deprecated
`classProperties.loose` (deprecated since v18). The top-level `loose`
option does the same thing -- previously the two options handled
different cases because `@babel/preset-env` did not include class
properties.
2025-04-29 09:57:16 -04:00
Jack Hsu 9234fb30a6 feat(react): undeprecate svgr option for Next.js apps since --turbo supports it (#30909)
This PR delays deprecation of `svgr` for `@nx/next`, as Turbopack
supports it now.

This PR also deprecates all SVGR support for v22. It is not a well-used
feature, and the webpack plugin is not maintained. We'll ensure in v22
to add the SVGR webpack plugin to userland configs, but we'll not
maintain it ourselves moving forward.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-29 08:44:21 -04:00
Jason Jean cf4a1f35e9 chore(repo): make local-registry continuous (#30789)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

No continuous tasks are used in CI.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The local-registry is a continuous task and it is used in CI.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-28 20:45:34 -04:00
Benjamin Cabanes a3a17531d0 docs(nx-dev): update remote cache page (#30902)
Updates texts and remote cache UI with "recommended" label.
2025-04-28 16:20:17 -04:00
Craigory Coppola eb54b1d249 feat(core)!: drop support for create nodes v1 in favor of only calling create nodes v2 (#30616) 2025-04-28 15:47:44 -04:00
Emily Xiong bb8c727681 chore(gradle): disable gradle import (#30900)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
gradle import e2e failed from time to time. i think it is flaky test
because it passed before.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
disable this e2e test for now. will enable it later.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-28 12:21:56 -04:00
Jason Jean 87e5e6bef8 fix(core): properly print errors coming from js when tui is enabled (#30885)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When the TUI is enabled, JS errors during task running cause the process
to exit without printing out information about the error and also leave
the terminal in a broken state.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

JS errors are printed before the process exits and the terminal is
restored to a good state.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-28 11:58:59 -04:00
Jason Jean 2c8aba2fc2 feat(core): add enter and q keybindings (#30786)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The TUI is missing some standard keybindings:

Q to quit
Enter to show task output

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Q now triggers a confirmation to exit. Because Q is close to 1, users
might often accidentally hit Q so this gives them a chance to cancel the
exit.
Enter will show the task output.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-28 10:40:34 -04:00
Jason Jean 85bc540a15 fix(core): quick fix to support trailing commas when reading hoisted … (#29436)
…versions

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Graph fails when there is a trailing comma in a package.json

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Graph does not fail and works when there is a trailing comma in a
package.json

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-27 00:12:44 +00:00
François da4f55bca3 fix: check if dependencies & devDependencies exist before deleting dep (#30224)
## Current Behavior
`removeDependenciesFromPackageJson` tries to delete dep from `undefined`
if there is no `dependencies` or `devDependencies` in package.json

## Expected Behavior
First check if `dependencies` or `devDependencies` exists

## Related Issue(s)
Fixes #30222

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-04-25 23:42:31 +00:00
Jack Hsu bde7315b0f docs(graph): update Migrate UI docs and link from the feature page (#30881)
This PR updates the Migrate UI recipe to match the experience.
Screenshots are added to provide previews of what it looks like prior to
users trying, and also makes the recipe easier to follow.

Future: It would be great to have a short video going over the process
rather than just text and screenshots. This is good enough for first
iteration, and we'll do a follow up on this.

Preview:
https://nx-dev-git-docs-migrate-ui-nrwl.vercel.app/recipes/nx-console/console-migrate-ui
Also updates:
https://nx-dev-git-docs-migrate-ui-nrwl.vercel.app/features/automate-updating-dependencies
2025-04-25 16:52:01 -04:00
Jack Hsu 0dc4dbf499 feat(graph): add undo migration option when one is pending approval (#30878)
This PR adds a button for user to undo a migration that's already been
applied and pending approval.

See: https://www.loom.com/share/97286bdc80ea4538af76a914ef8f0f8b

Also, fixes an existing issue where `migrations.json` did not record the
correct git sha for each commit.


## Current Behavior
When a migration is pending approval, the only option is to accept it.

## Expected Behavior
Allow user to undo a migration if they don't want the changes.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 16:20:17 -04:00
Benjamin Cabanes 3b0c456bbe docs(nx-dev): add enterprise security page (#30852)
Introduce a new enterprise security page highlighting key features like cache poisoning protection, CI access, and personal access control.
2025-04-25 15:22:02 -04:00
Jason Jean 73da211694 feat(misc): remove migrations prior to v19 in preparation for v21 (#30839)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Users migrating from Nx 17 can go up to Nx 20. 

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Users migrating from Nx 19 can go up to Nx 21. Users migrating from Nx
17 or 18 should go to Nx 19 first.. then go to Nx 21.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 15:06:02 -04:00
Craigory Coppola c17d43c6a4 fix(repo): don't cancel running jobs on master when new branch merged (#30871) 2025-04-25 14:01:18 -04:00
Craigory Coppola c21b606120 fix(core): error message when failing to fetch migrations is no good (#30874)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
We error when failing to find a package version via the install step,
but meant to warn. Additionally, the warning is hard to see.

## Expected Behavior
We don't error when failing to install the package, but the warning is
more visible.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 13:40:10 -04:00
Jonathan Cammisuli 2f739e9fbf fix(core): do not clone screen on every render loop of the TUI (#30872)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Everytime the TUI is rendered with a terminal pane opened, we clone the
screen. This cloning is resource intensive as we would be creating a new
screen every couple of milliseconds.
 
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This has changes so that we can pass a reference to the screen to be
used in places where its needed. This avoids the cloning the screen.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 17:25:53 +00:00
Jason Jean 8214ab49f2 chore(repo): assign proper outputs to build targets (#30865)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`nx:build` cannot be run in parallel with any other tasks. It was an
improper fix for an issue we were facing in our task graph. This is also
not workable if any continuous tasks are running.. which I want
`local-registry` to be running while things are built.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The proper outputs are set on `build` targets. Most of them only need
`README.md` as the output. `nx`, `create-nx-workspace`, and
`create-nx-plugin` are different and need a few more files.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 13:23:44 -04:00
Leosvel Pérez Espinosa 840aef802f feat(core): remove deprecated readWorkspaceConfig (#30868)
Remove the deprecated function `readWorkspaceConfig` from
`@nx/workspace`.

BREAKING CHANGE: The previously deprecated `readWorkspaceConfig`
function from `@nx/workspace` was removed.
2025-04-25 15:28:37 +00:00
Hyun Don Moon 858eb69207 docs(misc): fix typo in microfrontend architecture article (#29911)
## Current Behavior
There's a typo in the [microfrontend architecture
article](https://nx.dev/concepts/module-federation/micro-frontend-architecture#shared-libraries)
under the "Shared Libraries" section.

`The default the Nx setup configures`

## Expected Behavior
Should be `The default Nx setup configures`

Fixes #
2025-04-25 11:02:41 -04:00
Petr Plenkov cb5e7a24be docs(core): declarationMaps -> declarationMap typo fix (#29981)
Just fixing a typo in a docs.

declarationMaps ->
[declarationMap](https://www.typescriptlang.org/tsconfig/#declarationMap)
2025-04-25 11:01:48 -04:00
Colum Ferry 0c63624407 fix(module-federation): check the remote project targets for buildTarget to use #30808 (#30867)
## Current Behavior
Module Federation collectRemotes util looks for a hardcoded `build`
target.

## Expected Behavior
Read the remote's targets and find the correct `buildTarget` option for
the module-federation-dev-server to use

## Related Issue(s)

Fixes #30808
2025-04-25 16:00:00 +01:00
Yong-Yuan Chen 7affa87af9 docs(nx-dev): fix typo to prevent misleading the definition of production (#30244)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
A small typo to make reader misunderstand the definition of `production`
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 10:40:51 -04:00
James Henry c0426c1b35 fix(release): ensure versionData is always populated even when no bumps (#30866) 2025-04-25 09:13:37 -04:00
Leosvel Pérez Espinosa 73077fec66 feat(core): remove usage of cli property from migration definitions (#30855)
Removes the usage of the `cli` property from migration definitions.

BREAKING CHANGE: The `cli` property from migration generator definitions
is no longer used. The CLI to run the migration generator will be
identified based on whether the definition is contained in `generators`
(Nx) or `schematics` (Angular CLI).
2025-04-25 09:13:01 -04:00
Leosvel Pérez Espinosa c0aa245d9c feat(testing): remove deprecated getJestProjects (#30844)
Remove the deprecated function `getJestProjects`.

BREAKING CHANGE: The previously deprecated `getJestProjects` function
was removed in favor of `getJestProjectsAsync`.
2025-04-25 09:12:13 -04:00
Thomas Dekiere 69ea6327d3 fix(release): ensure generatorOptions and rootVersionActionsOptions are passed to updateLockfile function (#30796) 2025-04-25 12:41:03 +00:00
Miroslav Jonaš cd55dfcb3e feat(linter): add support for package based secondary entry points (#30809)
This PR adds support for package.json based secondary entry points and
implements fix for situation when package imports base entry point as
dynamic dependency and secondary entry point as static dependency.

## Current Behavior
When the package is imported from itself, check for a secondary entry
point checks only Angular-style secondary entry points.

When package is importing from the same library as dynamic import from
root and static import from secondary entry point we still get linter
errror.

## Expected Behavior
Check for secondary entry points should also support standard
package.json-based entry points.

Importing from the same library as dynamic import from root and static
import from secondary entry point should be allowed.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #18552
2025-04-25 14:31:33 +02:00
Jason Jean dda740fd2d fix(core): handle skipped tasks and trigger finished state (#30864)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When tasks are skipped due to a dependent task's failure, the TUI does
not recognize that the command is concluded and leaves the user in a
confusing state where Nx seems like it is still waiting for tasks.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When tasks are skipped due to a dependent task's failure, the TUI shows
that the command has concluded.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 12:15:43 +00:00
Colum Ferry a65f0f421b feat(rspack): use custom WriteIndexHtmlPlugin to handle variable interpolation (#30805)
## Current Behavior
The `HtmlRspackPlugin` does not support interpolation of %VAR% in the
index.html.
This is supported with a custom Webpack Plugin for `@nx/webpack` for
generating index.html files.

## Expected Behavior
The `@nx/rspack` plugin should support the same feature set as webpack
for seamless migration.
Add a new `WriteIndexHtmlPlugin` for Rspack to support this.
It should only be used when `useLegacyHtmlPlugin` is set to true
2025-04-25 09:58:21 +01:00
Jason Jean 851196aaa5 chore(repo): update nx to 21.0.0-beta.8 (#30863)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo is using Nx `21.0.0-beta.7`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo is using Nx `21.0.0-beta.8`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-25 00:16:20 -04:00
James Henry ee097a8e10 feat(release)!: useLegacyVersioning is false by default, migrate config (#30838)
This PR updates `nx release` to use the revamped versioning
implementation by default. It also updates and adds relevant
documentation, and provides an automated migration for the new
configuration structure.

For anyone exclusively versioning TS/JS packages, there should be no
real difference to your experience (although a number of bugs have been
fixed and new features around updating multiple `package.json` files at
once are now available to you with this change).

For the lifecycle of Nx v21, `release.version.useLegacyVersioning` will
remain as a option that can be set to `true` to revert to the old
behavior and configuration structure.

NOTE: This should only be a temporary solution, for example if one of
the plugins you use does provide a `VersionActions` based versioning
implementation yet. The option and legacy implementation will be removed
entirely in Nx v22 (in ~6 months).

BREAKING CHANGE:

**⚠️ For any early adopters of `VersionActions` in Nx 20.8 when it was
opt-in, there are breaking changes to the abstract class here as well.**

`manifestRootsToUpdate` has gone from `string[]` to `manifestsToUpdate:
{ manifestPath: string; preserveLocalDependencyProtocols: boolean; }[]`
to support controlling the local dependency updates per manifest in
order to support advanced source vs dist scenarios, and correspondingly
`isLocalDependencyProtocol` has been removed from the abstract class and
the method will no longer be called from the core logic. It should be
thought of as an implementation detail of `updateProjectDependencies`
instead.
2025-04-24 22:09:38 -04:00
Jason Jean 053fc67e90 fix(core): ensure task environments are processed properly in dte (#30862)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The new DTE APIs are missing a few things related to task environments.
Firstly, even though it processes task envs.. they are not stored on the
`processedTasks` map. Thus, the task env is not actually used to run
tasks. Secondly, some environment variables are not set during dte..
which used to.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The.2 things that are missing are now back. The map is populated with
the task envs and the environment variables are set based on the args.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-24 20:08:34 -04:00
Craigory Coppola 4323302188 chore(repo): set concurrency group for macos (#30858)
## Current Behavior
macos ci runs are not cancelled on new CI push

## Expected Behavior
macos ci runs are cancelled on new CI push

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-24 18:20:23 -04:00
Jack Hsu 8397a95a7e fix(graph): disable primary CTA for Migrate UI when approval is required first (#30836)
This PR updates the Migrate UI such that the primary CTA always performs
an action. Previously, when there is a migration to approve, the primary
CTA says `Run Migrations`, but clicking it does nothing since we're
already in the middle of running migrations.

<img width="1093" alt="Screenshot 2025-04-23 at 9 36 05 AM"
src="https://github.com/user-attachments/assets/4d55e3d0-d16b-4c4b-9b16-551690be60ab"
/>

Now, with this PR, the primary CTA will be disabled and tell the user to
approve the current migration before continuing.

## Current Behavior
Primary CTA in Migrate UI does nothing when there is a migration to
approve

## Expected Behavior
Primary CTA should reflect the current action that the user must take,
in this case to approve the migration

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2025-04-24 17:31:13 -04:00
Jason Jean 4254c4bcce feat(core): allow executors to specify if they are continuous (#30821)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The only way to set if a task is continuous is either directly in
`project.json` or via Project Graph Plugins.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Executors know if they are definitely continuous or not. Plenty of
existing continuous tasks are using executors. Executors are now able to
define if they are continuous in their `schema.json` files. Thus,
existing tasks configured with certain executors will automatically
become continuous.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-24 16:41:17 -04:00
Jason Jean eb5138e858 fix(core): add continuous to the project.json schema (#30853)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The `project.json` schema is missing `continuous`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `project.json` schema has `continuous` defined.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-24 15:53:54 -04:00
Jason Jean 5fb9def379 chore(repo): ensure nx build does not run with other tasks (#30857)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`nx:build` has `build/packages/nx` as an output. At the same time,
`build-base` tasks which depend on Nx.. are compiling based on
`build/pacakges/nx`. When `nx:build` is being restored from cache..
`build/packages/nx` gets deleted.. and then restored. While it is
deleted, `tsc` tasks are unable to find modules from `nx`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This isn't necessarily the correct solution, but `nx:build` will no
longer support parallelism ensuring that it does not get restored from
the cache while other `build-base` `tsc` tasks are running. The proper
fix is to fix the outputs of `nx:build` to be more specific about the
files that it is actually modifying.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-24 14:19:57 -04:00
Nicholas Cunningham 939cc732de fix(module-federation): remove disabling runtimeChunk (#30637)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When using Module Federation with an app that defines styles as a
separate entry point, HMR fails to update in the browser. Instead of
updating automatically, a warning is shown in the console related to a
missing chunk. A full-page reload is typically required, which is not
the intended behaviour.


## Expected Behavior
<!-- This is the behaviour we should expect with the changes in this PR
-->
HMR should work with styles as an entrypoint.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
The default is for `runtimeChunk` is `config.optimization.runtimeChunk =
{name: 'runtime'}` it is _not_ the same as `single` but the naming will
be the same.

Fixes #9582
2025-04-24 12:08:35 -06:00
Jason Jean 581291ced2 chore(repo): update nx to 21.0.0-beta.7 (#30845)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `21.0.0-beta.6`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `21.0.0-beta.7`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-24 11:42:29 -04:00
MaxKless ceddd44b8e fix(gradle): make sure v1 hash file is named differently to prevent compatability errors (#30846) 2025-04-24 16:57:32 +02:00
Benjamin Cabanes abd40db6bf docs(nx-dev): remove deprecated RFC references & update link (#30849)
Removed outdated references to RFC #30548 in FAQ and remote cache solutions components. Updated the link to point to the relevant documentation on building a custom caching server.
2025-04-24 14:44:49 +00:00
Benjamin Cabanes 1413abcff3 docs(nx-cloud): remove redundant max-lg rounded styles from CI cards (#30847)
The `max-lg` rounded styles were unnecessary as they were being overridden by `lg` styles.
2025-04-24 10:36:07 -04:00
Craigory Coppola 2961bce152 feat(core): add flaky task detection to tui summary (#30835)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Flaky tasks are only shown when not using the tui

## Expected Behavior
Flaky tasks are printed at the end of the summary view
<img width="1053" alt="image"
src="https://github.com/user-attachments/assets/4b068a52-72c3-415e-af91-481c12bb3f12"
/>

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-24 01:14:05 -04:00
Jason Jean e23b25fcaf chore(repo): disable failing gradle test (#30841) 2025-04-23 21:09:17 -04:00
Jason Jean f40d015488 chore(repo): update nx to 21.0.0-beta.6 (#30837)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `21.0.0-beta.4`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `21.0.0-beta.6`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-23 17:41:33 -04:00
Jason Jean 2e1896e9f7 feat(core): stream task output for all tasks except for direct output… (#30822)
… tasks

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Currently, only running tasks which are a PseudoTTYProcess stream
outputs to the TUI.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Most running tasks have `onOutput` even if they are not a
`PseudoTTYProcess`. This method is used to stream outputs to the TUI.
The only sort of running task which does not have this `onOutput` are
tasks with direct output... Those remain unhandled.. for now.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-23 17:41:14 -04:00
Isaac Mann 0e16f98c27 feat(nx-dev): tutorial landing page and improvements (#30757)
Updates the online tutorial experience

- Adds a landing page at
[/tutorials](https://nx-dev-git-docs-tutorial-landing-page-nrwl.vercel.app/tutorials)
- Terminal code blocks get a "run in terminal" button
- Code blocks get an "Apply file changes" button
- The apply file changes button currently only works for code blocks
that are showing the new file results (not showing the old file with
lines marked for deletion). There is nothing technical blocking this,
just time.
- Previous and next buttons do not go between tutorials
- The preview panel can be completely minimized
- Git is stubbed out
2025-04-23 15:08:51 -04:00
Altan Stalker 53ef31e18f fix(core): allow disabling output streaming with NX_STREAM_OUTPUT (#30834)
Previously NX_STREAM_OUTPUT only influenced the streaming behavior if it
were set to 'true', this ensures the negated case is also handled
2025-04-23 18:39:26 +00:00
Altan Stalker e70f64b290 chore(core): enable output flag for cloud (#30833)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Flag not on

## Expected Behavior
Flag on

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-23 17:38:41 +00:00
Emily Xiong b377c96d99 feat(java): add gradle kotlin plugin (#29464)
- [x] change init to create `createNodes` instead
- [x] unit tests
- [x] test-ci
- [x] test on windows
- [x] help metadata
- [x] external nodes

TODO:
- add publish executor?
- publish to maven central?

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
currently, it uses [project report
plugin](https://docs.gradle.org/current/userguide/project_report_plugin.html).
- pro: no need to maintain this plugin
- con: this plugin gives limited information

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
change the project report plugin to @nxn/gradle/plugin-v1
now the @nx/gradle plugin will use project graph plugin
(dev.nx.gradle.project-graph) created in this pr.
this plugin will create json file that is exactly what nx project grpah
expected.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-23 13:13:25 -04:00
Nicholas Cunningham 296f326b94 docs(nx-dev): fix node support matrix (#30829) 2025-04-23 20:34:17 +04:00
James Henry 8c4e8105e2 chore(core): add maxRetries to temp-fs cleanup (#30828) 2025-04-23 12:00:55 -04:00
Jack Hsu 121a42a417 fix(js): remove check that ts plugin is used for ts sync generator (#30743)
This PR ensures that when `@nx/js/typescript` is not used, we do not add
`@nx/js:typescript-sync` sync generator to targets such as build, serve,
etc.

It resolves issues where `nx init` into a repo that is compatible with
TS solution will add the sync generator, even if the plugin is unused.
It leads to errors everytime users run a task like build. The error is
like this:

```
[@nx/js:typescript-sync] The `@nx/js/typescript` plugin is not registered

...

> Would you like to ignore the sync failures and continue running the task?
Yes
No
```

It makes it confusing for users, especially new users that don't know
what sync generators are. They will always run into the error and have
to choose to continue despite the failure.

**Note:** In a future follow-up, we could consider adding better info
and prompts so we can let users know that Nx also helps keep workspace
up to date, and can learn more about it.

## Current Behavior
Users see an error when running `nx add @nx/vite` and then `nx build
<project>`.

## Expected Behavior


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-23 08:10:00 -04:00
Juri d506c727d3 docs(nx-dev): add JPG version of hero img for social media 2025-04-23 12:00:54 +02:00
Juri Strumpflohner b11124a40d docs(nx-dev): some adjustments to the test splitting article (#30823)
quick updates to an upcomign blog post:
https://nx-dev-git-blog-fix-splitting-techniques-article-nrwl.vercel.app/blog/test-splitting-techniques
2025-04-23 10:27:21 +02:00
Jason Jean 16fc5517f0 fix(core): fix issue with summary missing outputs (#30819)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Some tasks end but don't have their terminal outputs printed. When that
is the case, an error occurred where task terminal output was attempted
to be printed but did not exist.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Tracking terminal outputs is restored to being part of printing task
terminal output.. and printing task terminal output is guaranteed when
pseudo terminal is used.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-22 21:47:42 -04:00
Jason Jean 59d92af548 fix(core): wait for exit before getting terminal output (#30816)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

An error is occurring where it cannot find the terminal output for a
task. Turns out this is because it is trying to get terminal output
basically immediately after the task has started instead of after it has
exited.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Terminal output is retrieved after the task has exited. At this point,
terminal output is available.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-22 21:43:38 -04:00
Colum Ferry 745abdaecf fix(angular): convert-to-rspack correctly migrating existing custom webpack configs (#30778)
## Current Behavior
The `createConfig` helper from `@nx/angular-rspack` became an async
function.
This meant that the handling of custom webpack configs in the migration
done by `convert-to-rspack` was incorrect.

## Expected Behavior
Ensure the migration is handled correctly.
Ensure that Module Federation migrations work correctly.

## Related Issues
Fixes https://github.com/nrwl/angular-rspack/issues/53
2025-04-22 15:54:51 +01:00
Nicholas Cunningham 3f2a40ffec chore(rspack): update convert inferred generator description (#30799)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, the `convert-to-inferred` generator description inside the
rspack package references Webpack when it should reference Rspack
instead.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `convert-to-inferred` generator description should reference Rspack
instead of Webpack.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes
2025-04-22 08:12:24 -06:00
Jason Jean 4e68270efd feat(core): clean up unneeded continuous tasks after tasks are done (#30746)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Continuous tasks go until the process is done.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Continuous tasks are cleaned up after they're no longer needed. AKA once
their dependent tasks are done.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-22 09:52:51 -04:00
D. Ror. 99d45a3dcd docs(misc): update add-dotnet.md (#27540)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

See
https://github.com/nx-dotnet/nx-dotnet/blob/1ff848c54bc2207a9c77fc31c7a9a62489a30a88/packages/core/src/generators/init/generator.ts#L30-L41

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Co-authored-by: Miroslav Jonaš <missing.manual@gmail.com>
2025-04-22 12:04:33 +00:00
Miroslav Jonaš 65f8e7fa80 docs(nx-dev): add blog post for test splitting techniques (#30621)
This PR creates a new enterprise blog post for test task-splitting
techniques

<img width="876" alt="image"
src="https://github.com/user-attachments/assets/1fe26716-e947-4c46-974c-d4d286e50d4e"
/>


## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Juri <juri.strumpflohner@gmail.com>
Co-authored-by: Isaac Mann <isaacplmann@gmail.com>
2025-04-22 13:50:34 +02:00
Philip Fulcher 7735cc2b12 docs(nx-dev): adjusting publish date 2025-04-22 11:24:18 +02:00
Philip Fulcher 117d655398 docs(nx-dev): updating youtube link for nx cloud update 2025-04-22 11:24:18 +02:00
Philip Fulcher e4793ee011 docs(nx-dev): fixing typoes in Nx Cloud update post 2025-04-22 11:24:18 +02:00
Philip Fulcher 54934de162 docs(nx-dev): add nx cloud update for april 2025 2025-04-22 11:24:18 +02:00
mauicode26 50a7859cc6 docs(core): update typo in mental-model.md (#30797)
## Current Behavior
Typo in `mental-model.md`.

## Expected Behavior
No typos in `mental-model.md`.

## Related Issue(s)
N/A
2025-04-22 11:08:11 +02:00
Jack Hsu 8619c1de90 fix(core): migrate-ui-api should always use its own migrate module (#30779)
This PR fixes an issue if the user is not updated to an Nx version that
provides the new Migrate UI API, then it will load the run version and
error out.

<img width="2672" alt="Screenshot 2025-04-17 at 10 18 45 AM"
src="https://github.com/user-attachments/assets/2720922b-6ef5-4162-a3f1-d1ccedb60acd"
/>

The fix is to always use the local `migrate.js` module.

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
Migrate UI is broken if the migrated version does not have the new API

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Migrate UI should always work

Fixes #
2025-04-17 15:53:12 -04:00
Benjamin Cabanes 1a267aded9 docs(nx-dev): update nx in brand kits (#30781)
Replaced the existing nx-logos-assets.zip file with a new version.
2025-04-17 12:21:40 -04:00
Juri e73889f6b4 docs(nx-dev): add webinar link to AI article 2025-04-17 17:30:10 +02:00
Juri 4dbc3c7156 fix(nx-dev): toc should only include headings from the article body 2025-04-17 16:52:53 +02:00
Jack Hsu 178e6ef3c7 fix(react): mark react-router dev/start targets as continuous (#30776)
This PR marks dev/start from `@nx/react/router-plugin` as continuous.
Otherwise, running e2e will hang.

Repro: 
- `npx create-nx-workspace@next org --preset=react-monorepo
--appName=demo --e2eTestRunner=playwright` and pick RR For SSR
- Run `nx e2e demo-e2e`




## Current Behavior
<!-- This is the behavior we have today -->

e2e hangs because dev does not finish, and it is not marked as
continuous

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
dev and start from RR should work with e2e

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-17 10:27:48 -04:00
Jack Hsu 26489d1f50 fix(graph): ensure deps from graph-client->migrate-ui exists so taliwind styles are compiled correctly (#30762)
This PR removes the `// nx-ignore-next-line` from graph client to the
migrate lib import. Without the dep being there, the tailwind styles
will not include classes used by migrate UI.


<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Styles are broken for migrate UI

## Expected Behavior
Styles should work

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-17 10:27:40 -04:00
Isaac Mann b67fa37598 docs(core): fix broken links (#30775)
Fix broken link to react router github repo
2025-04-17 13:58:37 +00:00
Leosvel Pérez Espinosa 3eb9f6a822 feat(angular): remove deprecated functionalities for v21 (#30769)
Remove the deprecated functionalities scheduled to be removed in Nx v21.

BREAKING CHANGE: Remove the deprecated data persistence operators
previously exported in `@nx/angular` and the deprecated testing utils
previously exported in `@nx/angular/testing`.
2025-04-17 09:12:32 -04:00
Jack Hsu 5c30d1b95a chore(repo): remove vite paths plugin from our own Storybook files (#30756)
This PR fixes an issue that blocks FreeBSD release for some reason.

When we use the `@nx/vite/plugins/nx-tsconfig-paths.plugin` plugin and
both `CI=1` and `NX_PREFER_TS_NODE=true` are set, then the graph fails
to compute. For example, running this will error out:

```shell
CI=1 NX_DAEMON=false NX_CACHE_PROJECT_GRAPH=false NX_PREFER_TS_NODE=true nx report
```

The error is like this:

```shell
⚠️ Unable to construct project graph.
Failed to process project graph.
     - graph/migrate/.storybook/main.ts: TypeError: Cannot set property level of [object Object] which has only a getter
      at Object.<anonymous> (/Users/jack/projects/nx/packages/nx/src/utils/output.ts:38:23)
      at Module._compile (node:internal/modules/cjs/loader:1554:14)
      at Module.m._compile (/Users/jack/projects/nx/node_modules/.pnpm/ts-node@10.9.1_@swc+core@1.5.7_@swc+helpers@0.5.11__@types+node@20.16.10_typescript@5.7.3/node_modules/ts-node/src/index.ts:1618:23)
      at node:internal/modules/cjs/loader:1706:10
      at Object.require.extensions.<computed> [as .ts] (/Users/jack/projects/nx/node_modules/.pnpm/ts-node@10.9.1_@swc+core@1.5.7_@swc+helpers@0.5.11__@types+node@20.16.10_typescript@5.7.3/node_modules/ts-node/src/index.ts:1621:12)
      at Module.load (node:internal/modules/cjs/loader:1289:32)
      at Function._load (node:internal/modules/cjs/loader:1108:12)
      at TracingChannel.traceSync (node:diagnostics_channel:322:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
      at Module.require (node:internal/modules/cjs/loader:1311:12)
   - graph/ui-code-block/.storybook/main.ts: TypeError: Cannot set property level of [object Object] which has only a getter
      at Object.<anonymous> (/Users/jack/projects/nx/packages/nx/src/utils/output.ts:38:23)
      at Module._compile (node:internal/modules/cjs/loader:1554:14)
      at Module.m._compile (/Users/jack/projects/nx/node_modules/.pnpm/ts-node@10.9.1_@swc+core@1.5.7_@swc+helpers@0.5.11__@types+node@20.16.10_typescript@5.7.3/node_modules/ts-node/src/index.ts:1618:23)
      at node:internal/modules/cjs/loader:1706:10
      at Object.require.extensions.<computed> [as .ts] (/Users/jack/projects/nx/node_modules/.pnpm/ts-node@10.9.1_@swc+core@1.5.7_@swc+helpers@0.5.11__@types+node@20.16.10_typescript@5.7.3/node_modules/ts-node/src/index.ts:1621:12)
      at Module.load (node:internal/modules/cjs/loader:1289:32)
      at Function._load (node:internal/modules/cjs/loader:1108:12)
      at TracingChannel.traceSync (node:diagnostics_channel:322:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
      at Module.require (node:internal/modules/cjs/loader:1311:12)
   - graph/ui-project-details/.storybook/main.ts: TypeError: Cannot set property level of [object Object] which has only a getter
      at Object.<anonymous> (/Users/jack/projects/nx/packages/nx/src/utils/output.ts:38:23)
      at Module._compile (node:internal/modules/cjs/loader:1554:14)
      at Module.m._compile (/Users/jack/projects/nx/node_modules/.pnpm/ts-node@10.9.1_@swc+core@1.5.7_@swc+helpers@0.5.11__@types+node@20.16.10_typescript@5.7.3/node_modules/ts-node/src/index.ts:1618:23)
      at node:internal/modules/cjs/loader:1706:10
      at Object.require.extensions.<computed> [as .ts] (/Users/jack/projects/nx/node_modules/.pnpm/ts-node@10.9.1_@swc+core@1.5.7_@swc+helpers@0.5.11__@types+node@20.16.10_typescript@5.7.3/node_modules/ts-node/src/index.ts:1621:12)
      at Module.load (node:internal/modules/cjs/loader:1289:32)
      at Function._load (node:internal/modules/cjs/loader:1108:12)
      at TracingChannel.traceSync (node:diagnostics_channel:322:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
      at Module.require (node:internal/modules/cjs/loader:1311:12)
```

This is an issue for us only because we are pointing
`@nx/vite/plugins/nx-tsconfig-paths.plugin` to source. Normally, this
would already be in JS, and not need to go through `ts-node` or SWC.

I'm unsure what the exact cause is. There was nothing obvious in how we
register `ts-node`, and nothing in `ts-node` to suggest different
behavior with `CI=1`.

## Current Behavior
FreeBSD release is blocked

See: https://github.com/nrwl/nx/actions/runs/14500499978/job/40678818950

## Expected Behavior
FreeBSD release works

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-17 09:08:45 -04:00
Isaac Mann ca4c0762da docs(core): add april webinar (#30773)
Adds the 2025 April webinar to the webinar listing
2025-04-17 13:07:47 +00:00
Isaac Mann cd913a9221 docs(core): add migrate keyword to feature page (#30771)
Add migrate keyword to Automate Update Dependencies feature page
2025-04-17 08:42:16 -04:00
Leosvel Pérez Espinosa 46bd9e5eb4 chore(nx-dev): ignore the public directory in the eslint configuration (#30770)
## Current Behavior

The `nx-dev:lint` task is processing the `public` directory. That
directory is meant to contain assets that ESLint shouldn't process. It
results in extra time being spent linting the project, and it could
result in some errors due to linting some generated output that's copied
there (e.g. `documentation` and `tutorials` directories).

## Expected Behavior

The `nx-dev:lint` task should not process the `public` directory.

## Related Issue(s)

Fixes #
2025-04-17 07:59:45 -04:00
Colum Ferry 0749b76e50 docs(angular): add getting started document for angular-rspack (#30767)
## Current Behavior
There is no Getting Started document for helping people to get up and
running quickly with Angular Rspack applications.
There is only a blog post about scaffolding the applications.

## Expected Behavior
Add a Getting Started document to help people get up and running
2025-04-17 12:40:13 +01:00
Juri 701bbb1401 docs(nx-dev): article about Nx and AI 2025-04-17 13:35:58 +02:00
Leosvel Pérez Espinosa fed4da8651 feat(misc): remove generation of target defaults for atomized e2e tasks (#30730)
## Current Behavior

A target default (`dependsOn: [^build]`) for atomized e2e tasks is
always generated to work around a previous limitation where tasks
couldn't depend on continuous tasks. That meant we couldn't add the
dependency to the app's serve task and had to add it to the build task.

With continuous tasks now working, that limitation no longer exists.
We're now able to correctly infer the task dependency on the app's serve
task, and therefore, we can and need to remove the generation of
`dependsOn: [^build]` in target defaults so it doesn't override what the
Cypress and Playwright plugins infers.

## Expected Behavior

A target default (`dependsOn: [^build]`) for atomized e2e tasks should
not be generated. Instead, the Cypress and Playwright plugins will infer
the correct `dependsOn` for the task(s) run in the configured web server
command.

## Related Issue(s)

Fixes #
2025-04-17 13:27:24 +02:00
Benjamin Cabanes 1dd7d569e3 docs(nx-dev): enable WebinarNotifier for April 30th event (#30759)
Reactivated the `WebinarNotifier` component and updated references to reflect the new webinar scheduled for April 30th, 2025.
2025-04-16 21:55:20 +00:00
Jason Jean 9c9ddb571e fix(core): disable tui when CI=true (#30754)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When `CI=true`, the TUI is still enabled by default.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When `CI=true`, the TUI is disabled unless it is explicitly enabled with
`NX_TUI=true`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-16 17:21:11 -04:00
Nicholas Cunningham 8dc057519f chore(misc): remove Node.js 18 version from nightly matrix (#30758)
This PR updates our nightly test configuration to align with the current
Node.js ecosystem.

Node.js v18 has reached end-of-life, so we're updating our nightly tests
to ensure compatibility with actively maintained Node.js versions.
2025-04-16 17:00:34 -04:00
Nicholas Cunningham 8b02fd48f7 fix(core): improve flaky ci test (#30738)
This PR updates `lerna-smoke-tests.test.ts` test file to improve the
consistency of the snapshots.
The serializer has been updated to reduce flakiness from spacing and
line breaks.
2025-04-16 15:08:16 -04:00
Colum Ferry 4b4226d2e0 docs(angular): add guide on i18n for Angular Rspack (#30732)
## Current Behavior
There is currently no documetation on how to configure i18n for Angular
Rspack applications

## Expected Behavior
Add documetation giving details on how to configure i18n for Angular
Rspack applications
2025-04-16 18:38:22 +01:00
Nicholas Cunningham a911318017 feat(graph): Create Migrate UI (#30734)
This PR introduces a new UI in Nx Console designed to assist users with
managing migrations more effectively.

Each migration is now presented with its status and actions, allowing
users to interact directly.
If any issues arise, users can address them in isolation without
disrupting the overall flow. The migrate ui provides a clear overview of
the migration state, helping users track progress and understand what
actions are required at each step.
2025-04-16 12:40:37 -04:00
Colum Ferry 67732d6217 feat(angular): update angular-rspack to 20.7 (#30737) 2025-04-16 11:59:21 -04:00
Colum Ferry c37007ec6c fix(angular): handle ssr with convert-to-rspack (#30752)
## Current Behavior
The `convert-to-rspack` generator for `@nx/angular` does not currently
handle SSR Webpack applications correctly.

## Expected Behavior
Ensure that the `convert-to-rspack` generator handles SSR correctly.
2025-04-16 16:31:51 +01:00
Juri 4f8b407a75 feat(nx-dev): add course preview component 2025-04-16 17:02:54 +02:00
MaxKless 5dcec84e63 docs(react): update react lib generator (#30527)
the examples are outdated, the new ones make more sense
2025-04-16 11:01:24 -04:00
Juri 8844e245fb docs(nx-dev): update PNPM article linking to Nx PNM course 2025-04-16 15:22:38 +02:00
Mike Hartington 68c481f7d1 feat(nx-dev): add React landing page (#30612)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2025-04-16 07:59:43 -04:00
Colum Ferry 6b081363c1 feat(webpack): set default sassImplementation to sass-embedded (#30580)
## Current Behavior
The `sassImplementation` option for Webpack and Rspack is set to `sass`
by default.
`sass-embedded` offers a faster alternative.

## Expected Behavior
Switch the default `sassImplementation` option to `sass-embedded`.
2025-04-16 11:06:57 +01:00
Jason Jean caa26a781d chore(repo): update nx to 21.0.0-beta.4 (#30710)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx 20.8.0-rc.0

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx 21.0.0-beta.4

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 19:10:16 +00:00
Jason Jean 06eaf7a4fb fix(nx-dev): refer to the youtube video instead of storing the videos… (#30739)
… again ourselves

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This article has parts of a youtube video baked into it as mp4 files.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The article points to the youtube video instead of baking in mp4 files.


https://nx-dev-git-fix-docs-nrwl.vercel.app/blog/nx-made-cursor-smarter#lets-see-it-in-action


![image](https://github.com/user-attachments/assets/35ae025e-2632-4c32-9d1d-a6420d97d229)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 18:16:44 +00:00
Jason Jean 31548a1282 fix(core): only register forced shutdown when tui is enabled (#30735)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The `registerForcedShutdownCallback` lifecycle hook does not exist if
the TUI is not enabled as it is not on CI. But Nx tries to invoke it
anyways so it causes an error in CI:
https://github.com/nrwl/nx/actions/runs/14471341199/job/40585817051?pr=30710#step:11:31

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `registerForcedShutdownCallback` is only utilized when the TUI is
enabled so it will not be invoked on CI where it does not exist.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 16:13:01 +00:00
Isaac Mann e5ed477c5a docs(core): partners page (#30376)
Creates a
[/partners](https://nx-dev-git-nx-dev-partners-nrwl.vercel.app/partners)
page

---------

Co-authored-by: Jordan Powell <jordan@jpdesigning.com>
2025-04-15 11:54:03 -04:00
Leosvel Pérez Espinosa 1bd105256e docs(core): fix package manager workspaces' patterns in typescript project linking concept page (#30729)
## Current Behavior

The "Typescript Project Linking" concept page shows package manager
workspaces' patterns like `apps/**`. While this could be correct, it's
not what Nx generators will generate, and it can result in some nested
and non-expected directories being matched (e.g., fixtures).

## Expected Behavior

The "Typescript Project Linking" concept page should show package
manager workspaces' patterns like `apps/*` so it's aligned with what Nx
generators will generate. It would be a safer example, so it doesn't
match potentially undesired directories.

## Related Issue(s)

Fixes #
2025-04-15 17:07:02 +02:00
Jack Hsu 9ce301f30c fix(testing): fix cypress and playwright atomized targetDefaults so they match correctly (#30717)
Currently, we provide `targetDefaults` for atomized targets (e.g.
`e2e-ci`) with a glob pattern that may not match nested paths.

i.e.

```
"e2e-ci--**/*": {
  "dependsOn": [
    "^build",
  ],
},
```

The `e2e-ci--**/*` pattern should be `e2e-ci--**/**`.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
The generated `e2e-ci` pattern in `nx.json` does not match nested paths
for split tasks.

## Expected Behavior
The generated `e2e-ci` pattern should apply to all split tasks.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28842
2025-04-15 11:03:52 -04:00
Colum Ferry be326624b7 docs(angular): add blog post for scaffolding angular rspack apps (#30667)
Add blog post on scaffolding new Angular Rspack applications
2025-04-15 15:52:30 +01:00
Juri de765b4fa7 docs(nx-dev): add blog post about MCP support for VSCode 2025-04-15 16:35:09 +02:00
Colum Ferry 4f14f9d5af fix(angular): remove deprecated standaloneConfig from generators (#30578)
## Current Behavior
The `standaloneConfig` option has long been deprecated as it is the only
behaviour that Nx now provides.
Using it is a no-op.

## Expected Behavior
Remove the `standaloneConfig` option.
2025-04-15 15:04:49 +01:00
Leosvel Pérez Espinosa 5aab4eb420 cleanup(testing): fix outdated test snapshot in cypress graph plugin tests (#30728)
## Current Behavior

A couple of unit tests for the `@nx/cypress` graph plugin are failing
due to outdated snapshots.

## Expected Behavior

The `@nx/cypress` graph plugin tests should succeed. The test snapshots
should be updated to match the new behavior.

## Related Issue(s)

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean 016e5fda2a chore(core): fix command info (#30720)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

"Printing" the command info before output causes `run-script` to hang
and not run. In addition, the screen was cleared.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The command in run-script runs without issues. The screen is not
cleared.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
Leosvel Pérez Espinosa 9a60dec0de feat(testing): support continuous tasks (#30632)
## Current Behavior

The Cypress and Playwright graph plugins do not infer tasks configured
to take advantage of continuous tasks (do not add the task they run to
start the app/server as a dependency of the e2e task).

## Expected Behavior

The Cypress and Playwright graph plugins should infer tasks configured
to take advantage of continuous tasks.

## Related Issue(s)

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean 46888b294c fix(core): use dev tty for crossterm (#30696)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`git push -u origin HEAD` causes the following panic when the TUI is
enabled on macos:

```
Backtrace (most recent call last):
  File "<unknown>:0", in __pthread_cond_wait
  File "<unknown>:0", in std::sys::pal::unix::thread::Thread::new::thread_start
  File "<unknown>:0", in core::ops::function::FnOnce::call_once{{vtable.shim}}
  File "<unknown>:0", in std::sys::backtrace::__rust_begin_short_backtrace
  File "<unknown>:0", in tokio::runtime::task::raw::poll
  File "<unknown>:0", in tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  File "<unknown>:0", in tokio::runtime::task::raw::poll
  File "<unknown>:0", in tokio::runtime::task::core::Core<T,S>::poll
  File "<unknown>:0", in nx::native::tui::tui::Tui::start::{{closure}}
  File "<unknown>:0", in core::option::expect_failed

The application panicked (crashed).
  reader source not set
in /Users/jason/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossterm-0.29.0/src/event/read.rs:39
thread: tokio-runtime-worker

```

This is due to the fact that crossterm until recently did not use
/dev/tty on mac and thus could not read events correctly when forwarded
from another program such as husky.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This adds the `use-dev-tty` features so that `crossterm` utilizes
`/dev/tty` and works when forwarded from other programs such as husky on
macos.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean 9359490326 chore(core): fix wasm build (#30684)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Wasm build is broken.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Wasm build is fixed.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
James Henry 3f9f2a78b7 fix(core): improve tui exit consistency and summary (#30678)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

- When a user presses `ctrl+c` to force kill the TUI/Nx, continuous
tasks that are running are not killed, and the terminal can get stuck or
leave the cursor hidden
- The summary is incomplete and messy

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

- When a user presses `ctrl+c` to force kill the TUI/Nx, continuous
tasks that are running are appropriately killed and everything in the
user's terminal is restored back to a good state.
- The summary looks good and contains the in progress logs for
continuous tasks that were killed

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean 285211f98c feat(core): add shared status for tui (#30679)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Shared continuous tasks are not shown as running in the TUI

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There is a special status for Shared continuous tasks for the TUI where
it will say that it is running in a different nx process

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
Colum Ferry e5c7f6db18 feat(testing): add continuous tasks support for jest e2e with node (#30675)
## Current Behavior
When generating `node` projects with an `e2e` project using Jest, we do
not supply any method for the node application to actually be started
before running the tests.

## Expected Behavior
Using Continuous Tasks, have the e2e project dependOn the serve of the
`node` project such that it is available for the e2e tests to run
against it.
2025-04-15 09:23:45 -04:00
Leosvel Pérez Espinosa a1cd4e31ad fix(core): schedule tasks and release waiting threads when continuous task is already running (#30673)
## Current Behavior

When a continuous task is already running, parent tasks are not
scheduled.

## Expected Behavior

When a continuous task is already running, the task orchestrator should
schedule the next tasks and release the waiting threads so parent tasks
can be scheduled.

## Related Issue(s)

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean 48a5d1987e feat(core): enable dte to execute continuous tasks (#29993)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Continuous tasks are not supported in DTE and there is no good API for
Agents to utilize

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There is an API for agents to utilize to run continuous tasks.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
FrozenPandaz 87badb0486 chore(core): regen native typings 2025-04-15 09:23:45 -04:00
James Henry 6541751aab feat(core): add the experimental Terminal UI for tasks (#30565) 2025-04-15 09:23:45 -04:00
Colum Ferry 3794c2f256 docs(module-federation): add sections covering continuous tasks change (#30645)
## Current Behavior
Module Federation Documentation talks about using `--devRemotes`
exclusively for serving remote applications that feature teams are
working on.
With Continuous Tasks this is no longer the case

## Expected Behavior
Add section mentioning Continuous Tasks and the change to the `serve`
flow
2025-04-15 09:23:45 -04:00
Colum Ferry 5f26c6811e feat(module-federation): add continuous tasks support to react rspack (#30644)
## Current Behavior
Continuous tasks are not set up for React Rspack Module Federation
Remote projects.
This is important because `--dev-remotes` is no longer supported with
Crystal Module Federation usage.

## Expected Behavior
Add Continuous Tasks support for React Rspack Module Federation Remote
Projects.
This replaces the need for `nx serve shell --dev-remotes=remote1`.

Instead, the command is simply `nx serve remote1` and continuous tasks
means that the `shell:serve` task is executed correctly.
2025-04-15 09:23:45 -04:00
Jason Jean c5fb467118 feat(core): share continuous tasks (#29901)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

<!-- This is the behavior we have today -->

<!-- This is the behavior we should expect with the changes in this PR
-->

<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-04-15 09:23:45 -04:00
Jason Jean dee4906f5e chore(repo): fix unit tests (#30431)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Unit tests are broken after rebase

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Unit tests are passing

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
Colum Ferry 0d38ec4454 feat(node): generate new apps with continuous: true (#30148)
## Current Behavior
Node applications rely on the `@nx/js:node` executor to handle serving. 
Unfortunately, it can not be determined if existing usage of the
executor is used for a continuous or finite task.

## Expected Behavior
Generate new node applications with `continuous: true` for their serve
targets
2025-04-15 09:23:45 -04:00
Colum Ferry f5e124972a feat(storybook): infer continuous tasks for storybook serve and serve-static (#30069)
## Current Behavior
The `@nx/storybook/plugin` does not set `continuous:true` for serve-like
targets.

## Expected Behavior
The plugin should correctly set `continuous: true` for `serve` and
`serve-static`.
2025-04-15 09:23:45 -04:00
Colum Ferry 7989e39461 feat(vite): infer continuous tasks for dev (#30043)
## Current Behavior
The `dev`, `serve`, `preview` and `serve-static` targets inferred by the
`@nx/vite/plugin` do not infer `continuous:true` indicating to Nx that
these tasks are continuous.


## Expected Behavior
Infer `continuous: true` for the serve-like targets for Vite.
2025-04-15 09:23:45 -04:00
Colum Ferry 63282bc070 feat(webpack): add continuous inference support (#29974)
## Current Behavior
Webpack Inference Plugin does not currently infer `continuous` for
`serve, preview, serve-static` targets.

## Expected Behavior
Webpack Inference Plugin correctly infers `continuous: true`
2025-04-15 09:23:45 -04:00
Colum Ferry 9fc7ffdaf3 feat(rspack): add continous inference support (#29973)
## Current Behavior
Rspack and Rsbuild Inference Plugins do not infer `continuous` for serve
tasks.

## Expected Behavior
Correctly infer `continuous` true.
2025-04-15 09:23:45 -04:00
Colum Ferry 2cd3252365 feat(js): infer continuous for watch-deps task (#29976)
## Current Behavior
The `@nx/js` plugin exposes a helper to generate `build-deps` and
`watch-deps` tasks for inference plugins.
It does not currently infer `continuous` for the `watch-deps` task.

## Expected Behavior
Ensure `watch-deps` is infered with `continuous: true`
2025-04-15 09:23:45 -04:00
Colum Ferry 229cf28198 feat(remix): add continuous task support (#29905)
## Current Behavior
When `serve, dev, start` targets are inferred by the `@nx/remix` plugin,
they are not inferring `continuous`.


## Expected Behavior
When `NX_CONTINUOUS_TASKS_PREVIEW` env var exists, infer the
`continuous` property.
2025-04-15 09:23:45 -04:00
Jason Jean f326bfe52e feat(core): introduce continuous tasks (#29750)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

An RFC about this feature is happening here: #29025. This has the most
information about this feature.

<!-- This is the behavior we have today -->

Nx currently does not explicitly handle tasks which run continuously
until they are terminated.

<!-- This is the behavior we should expect with the changes in this PR
-->

This PR adds the initial support for continuous tasks which run
continuously until they are terminated. This adds the ability to depend
on continuous tasks. There is some more work to be done but this will be
enough as an MVP.

<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
Leosvel Pérez Espinosa 0082d939eb fix(linter): remove empty entry in typescript eslint flat config (#30727)
## Current Behavior

The `flat/typescript` config contains a config block with the `files`
containing an invalid empty entry.

## Expected Behavior

The `flat/typescript` config should be correct.

## Related Issue(s)

Fixes #30725
2025-04-15 08:08:17 -04:00
Jack Stevenson bc685ce3c5 chore(core): nx plugin submission @aws/nx-plugin (#30545)
<!-- 
_[Please make sure you have read the submission guidelines before
posting an
PR](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#submit-pr)_

# Community Plugin Submission

Thanks for submitting your Nx Plugin to our community plugins list. Make
sure to follow these steps to ensure that your PR is approved in a
timely manner.

## Plugin Requirements

Before you submit your plugin to be listed in our registry, it needs to
meet the following requirements:
- Run some kind of automated e2e tests in your repository
- Include `@nx/devkit` as a `dependency` in the plugin's `package.json`
- List a `repository.url` in the plugin's `package.json`

i.e.

```
{
  "repository": {
    "type": "git",
    "url": "https://github.com/nrwl/nx.git",
    "directory": "packages/web"
  }
}
```

Note: We reserve the right to remove unmaintained plugins from the
registry. If the plugins become maintained again, they can be
resubmitted to the registry.

## Steps to Submit Your Plugin
- Use the following commit message template: `chore(core): nx plugin
submission [PLUGIN_NAME]`
- Update the `community/approved-plugins.json` file with a new entry for
your plugin that includes `name`, `url`, `description`:

Example:

```json
// community/approved-plugins.json

[{
    "name": "@community/plugin",
    "url": "https://github.com/community/plugin",
    "description": "This plugin provides the following capabilities."
}]
```

Once merged, your plugin will be available when running the `nx list`
command, and will also be available in the Plugin Registry on
[nx.dev](https://nx.dev/plugin-registry)
-->

# Community Plugin Submission

## Nx Plugin for AWS (@aws/nx-plugin)

<!-- 
Describe what your plugin is and what is its goal or issues it
addresses. If you don't provide a description, we will not merge your
PR.
Is it focused on a technology, tooling or behaviour? Does the plugin
provide generators, executors or graph support?
Do you know who is already using the plugin? Mention who is the author
of the plugin.
-->
This plugin is for building cloud-native applications with AWS. At
present it provides the following generators:

- `ts#project` - Generate a new TypeScript library.
- `ts#infra` - Generate a Typescript AWS CDK infrastructure project for
your application.
- `ts#cloudscape-website` - Generate a new Cloudscape/React/Vite based
web application.
- `ts#cloudscape-website#auth` - Add AWS Cognito authentication to your
Cloudscape website.
- `ts#trpc-api` - Generate a tRPC backend service with Amazon API
Gateway/AWS Lambda integration and [AWS
Powertools](https://github.com/aws-powertools/powertools-lambda-typescript)
pre-configured.
- `py#project` - Generate a uv based Python project.
- `py#fast-api` - Generate a FastAPI backend service with [AWS
Powertools](https://github.com/aws-powertools/powertools-lambda-python)
pre-configured.
- `api-connection` - Connect frontend applications to backend APIs.
- `license` - Automatically manage LICENSE files and source code headers
in your workspace.

(Note that the ts/py project generators are our simplified/opinionated
generators for base projects in TypeScript and Python, eg enforcing ESM
for TypeScript etc)

Our prototyping organisation here at AWS uses the plugin to quickly
bootstrap and build prototypes for various AWS customers in different
industries.

The primary authors are Adrian Dimech @agdimech and myself (Jack
Stevenson).
2025-04-14 10:55:17 -04:00
Josh VanAllen 5f3e94655d docs(misc): add josh vanallen to company list (#30680)
Add myself to the company list as a DPE

Signed-off-by: Josh VanAllen <5290334+joshvanallen@users.noreply.github.com>
2025-04-14 10:52:40 -04:00
Leosvel Pérez Espinosa b3c1404b02 fix(testing): unset customConditions when running cypress tasks (#30709)
## Current Behavior

Cypress e2e tasks in a workspace with the `customConditions` TypeScript
compiler option set, fail with the error:

```bash
TSError: ⨯ Unable to compile TypeScript:
error TS5098: Option 'customConditions' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'.
```

This happens because Cypress forces ts-node to use `module: commonjs`
and `moduleResolution: node10`, which is not compatible with the
`customConditions` TypeScript compiler option.

## Expected Behavior

Cypress e2e tasks in a workspace with the `customConditions` TypeScript
compiler option set should work as expected.

## Related Issue(s)

Fixes #
2025-04-14 09:17:34 -04:00
Leosvel Pérez Espinosa 70f1e660c8 fix(rspack): do not reuse existing ts-node compiler options when inferring tasks (#30703)
## Current Behavior

The `@nx/rspack` graph plugin reuses the potentially existing
`TS_NODE_COMPILER_OPTIONS` to set the `env` property of the inferred
tasks for a TS config file. This is not correct since the env var could
have a different value (or not exist at all) when running tasks compared
to when the graph plugin runs.

## Expected Behavior

The `@nx/rspack` graph plugin should not reuse any existing
`TS_NODE_COMPILER_OPTIONS` when inferring tasks for a TS config file.

## Related Issue(s)

Fixes #
2025-04-14 14:36:20 +02:00
Jan Vincent Liwanag 4cc3a39794 doc(misc): fix declarationMap config (#30700)
Fixes a typo where `declarationMaps` should be `declarationMap`.
2025-04-13 12:02:35 +02:00
Emily Xiong 65752addb5 fix(core): clean up batch process after post run (#30687)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
currently, the batch process is not being cleanup

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
need to kill the batch process after post run in task orchestrator,
otherwise, when kill it during the post run (store the output to cache),
it will cause the process to hang in DTE

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-12 08:36:45 -04:00
Jason Jean 07ad2d7b4a chore(repo): update nx to 20.8.0-rc.0 (#30697)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses `20.8.0-beta.2`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses `20.8.0-rc.0`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-12 02:35:14 +00:00
Jason Jean d66b663879 fix(core): copy native file atomically to avoid hanging graph creation (#30695)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When copying the native file out of node_modules into tmp from multiple
processes (aka plugin workers)... this can result in Node deadlocking.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Copying the native file out of node_modules into tmp from multiple
processes will first copy to unique places in `/tmp` but then atomically
rename to the final location where it is still loaded from.

This at least fixes a flaky test in `nx:test` where the explicit
dependencies tests were timing out after 35 seconds

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-11 19:21:14 -04:00
Jason Jean b56df7ba7a chore(repo): update nx to 20.8.0-beta.2 (#30694)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx 20.7.0-beta.3

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx 20.8.0-beta.2

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-11 19:18:50 -04:00
Leosvel Pérez Espinosa ce41dedf01 fix(js): ensure the tsconfig files cache is correctly busted when implementation changes (#30689)
## Current Behavior

The `@nx/js/typescript` plugin sometimes throws an error due to a
mismatch between the cached information for the tsconfig files and a
newer implementation.

## Expected Behavior

The `@nx/js/typescript` plugin should correctly invalidate the cached
tsconfig files when the implementation changes.

## Related Issue(s)

Fixes #
2025-04-11 18:12:22 -04:00
Jason Jean f3013ccafe fix(testing): do not inherit existing env (#30688)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Inheriting the existing environment variable here causes tests to fail
for some reason.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This reverts it to how it functioned before and fixes the failing tests.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-11 14:25:49 -04:00
Jason Jean f839b070f0 fix(core): ensure fileworker is cleaned up when workspace context is … (#30683)
…dropped

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The file worker was holding onto `nx_files.nxt` causing our tempFs to
not clean up properly.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When the node cleans up workspace context, the file worker will be
dropped and release the `nx_files.nxt`. TempFs will thus be able to
clean up the temp directory properly.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-11 17:44:16 +00:00
Rares Matei a8762fb8ca docs(nx-cloud): update release notes (#30690)
- **docs(nx-cloud): update release notes**
- **docs(nx-cloud): format files**

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-11 17:21:25 +00:00
Leosvel Pérez Espinosa 259561ff9a fix(testing): enforce commonjs module for ts-jest (#30681)
## Current Behavior

The `@nx/jest` graph plugin and the `@nx/jest:jest` executor correctly
force the `moduleResolution: node10` to be used by `ts-node` (used by
`ts-jest`), but don't force using `module: commonjs`, which can result
in issues due to incompatible `module`/`moduleResolution` pair.

## Expected Behavior

The `@nx/jest` graph plugin and the `@nx/jest:jest` executor should
force the `moduleResolution: node10` and `module: commonjs` compiler
options to be used by `ts-node`.

## Related Issue(s)

Fixes #
2025-04-11 14:47:34 +00:00
Miroslav Jonaš baf663729c feat(core): allow globs in project config to extend atomized targets (#30630)
## TL;DR;

This PR enabled mapping glob patterns in target names within the project
config to match and extend atomized targets.

## Problem statement

The project configuration (via project.json or package.json) enables us
to override target defaults set via inferred plugins and/or
targetDefaults.

However, this is only possible for fixed targets. Overriding
atomized/dynamic targets would require listing them all explicitly,
which would create a lot of overhead and would break the dynamicity and
automation of the atomized targets.

## Why not use targetDefaults?

The targetDefaults already support globbing to match a range of targets
like e2e-ci-**/* so we can use the same logic on the project level.

We often need to make modifications on project level, rather than the
entire monorepo. E.g. all atomized targets running on a feature lib
checkout should have an implicit dependency on build target of
dependency as stated by "dependsOn": ["^build"] but they also should
have a dependency on app:build - the application which e2e tests are
serving, although there is no direct or indirect dependency between
checkout-e2e and app. This is significant to retain the lean affected
graph.

## Solution 

We can use the same globbing logic from targetDefaults and will apply in
mergeProjectConfigurationIntoRootMap function to match glob patterns to
range of targets instead of searching for the explicit target name only.

When the glob pattern doesn't match any targets, the fallback is still
the existing functionality.

This is possible given the fact that plugins' targets get applied before
we start parsing the project configurations, as they have priority over
generic plugin definitions and `targetDefaults.`

Override would look like this:
```jsonc
{
  "name": "users-e2e",
  "implicitDependencies": ["users"],
  "targets": {
    "e2e": {
      "dependsOn": ["^build", { "target": "build", "projects": "app" }]
    },
    "e2e-ci--**/*": {
      "dependsOn": ["^build", { "target": "build", "projects": "app" }]
    }
  }
}
```

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-11 11:26:13 +02:00
Nicholas Cunningham ff53b006e4 fix(bundling): Lock webpack version to be compatible with @angular-devkit (#30676)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, when we have `^` it forces an update to webpack version
`5.99.x` which is incompatible at the moment with `@angular-devkit`
which is locked to webpack version `5.98.0`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Nx should be compatible with the migration provided by it's own package
`@nx/webpack`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-10 19:03:05 +00:00
Jason Jean 9fe73eaf31 chore(core): fix publish for linux (#30669)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Publish is failing for linux workflows missing openssl.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Publish passes as reqwest will use `rustls-tls`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-10 11:55:29 -04:00
Leosvel Pérez Espinosa 136e721d58 fix(js): handle when there are no package manager workspaces' patterns (#30666)
## Current Behavior

The helper to add a project to the package manager workspaces'
configuration doesn't handle correctly when there are no patterns and
this results in the error `Invalid glob pattern` being thrown.

## Expected Behavior

The helper to add a project to the package manager workspaces'
configuration should handle when there are no patterns.

## Related Issue(s)

Fixes #
2025-04-10 13:16:43 +00:00
Leosvel Pérez Espinosa 77e60c329f fix(core): log more information when ProjectConfigurationsError is thrown (#30661)
## Current Behavior

When the `ProjectConfigurationsError` is thrown, no helpful information
is logged.

## Expected Behavior

When the `ProjectConfigurationsError` is thrown, helpful information
should be logged.

It replicates the handling previously done for `ProjectGraphError`.

## Related Issue(s)

Fixes #
2025-04-10 13:34:12 +02:00
Colum Ferry c71a7832b9 fix(angular): ensure crystal targets for testing when bundler=rspack (#30631)
## Current Behavior
Angular Rspack relies on Inferred Targets however, when scaffolding the
application, the unit test runners are being set up with executors.

## Expected Behavior
Ensure that when `bundler=rspack` unit test runners are being set up
with inference plugins
2025-04-10 11:06:15 +01:00
Miroslav Jonaš d4ebf82ac8 feat(core): add filter for git checkouts in generated pipelines and docs (#30547)
This PR adds Git filter `tree:0` to Azure and GitHub pipelines to avoid
fetching the full history content because of the affected command.

The change is made to:
- `ci-workflow` generator in `workspace` project for Azure and GitHub
- `ci-workflow` generator in `gradle` project for GitHub
- this repo's  main pipeline -`ci.yaml`
- all documentation occurrences where fetch depth 0 is used on Azure or
GitHub

More info on reasoning here:
https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-10 11:33:31 +02:00
Miroslav Jonaš b82f29bd56 chore(repo): update gh actions version (#30561)
This PR bumps the versions of `actions/*` GH actions to latest v4.

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-10 11:33:13 +02:00
Juri ee43b8b945 docs(nx-dev): add article about vibe-exploring the codebase 2025-04-10 09:43:01 +02:00
Craigory Coppola 7c22d2d969 chore(repo): fix ts compilation of issues-scraper (#30656)
## Current Behavior
Issues reporter is not running

## Expected Behavior
Issues reporter is running

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-09 20:53:49 -04:00
Craigory Coppola 3ad8082a39 fix(core): wasm build should build (#30655)
## Current Behavior
There are warnings as well as an error and wasm does not build

## Expected Behavior
wasm. builds
2025-04-09 18:18:39 -04:00
Leosvel Pérez Espinosa 5feafd64d4 feat(testing): add support for cypress v14 (#30618)
## Current Behavior

Cypress v14 is not supported.

## Expected Behavior

Cypress v14 is supported.

## Related Issue(s)

Fixes #30097
2025-04-09 17:12:39 -04:00
Isaac Mann 3b91e0b32d docs(core): add search keywords (#30636)
Adds keywords to improve search indexing
2025-04-09 15:47:49 -04:00
Craigory Coppola 0525426a51 feat(core): add support for http based caches (#30593)
Implements http based remote caches per the RFC here:
https://github.com/nrwl/nx/discussions/30548
2025-04-09 19:25:03 +00:00
Colum Ferry 494f150a69 fix(core): angular rspack should not prompt for SSG (#30647)
## Current Behavior
Create Nx Workspace will prompt for SSG when `Rspack` is chosen as a
bundler option for Angular.
SSG is currently not supported by Angular Rspack.

## Expected Behavior
Do not mention SSG when prompting for SSR with Angular Rspack
2025-04-09 16:17:56 +00:00
Juri d1ee41793f fix(nx-dev): update markdoc component to exclude h1 headers 2025-04-09 14:13:55 +02:00
Isaac Mann 1d9d91110d feat(nx-dev): tutorialkit project (#29992)
Adds a tutorial project under nx-dev
The tutorials are run in browser and can be accessed here:

[/tutorials](https://nx-dev-git-nx-dev-tutorialkit-nrwl.vercel.app/tutorials)

The tutorials include:
- TypeScript Packages
- React Monorepo
- Angular Monorepo

In the future, we will link directly from the sidebar to the in-browser
tutorials.
2025-04-09 07:14:19 -04:00
James Henry 7b85d912ba feat(release): revamped nx release version implementation (#30418) 2025-04-08 18:17:19 +04:00
Jason Jean dbd86480c8 chore(core): regen native typings (#30633)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Native typings are out of date.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

native typings are updated

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-08 14:02:34 +00:00
Jason Jean da4201b0d1 chore(repo): publish for freebsd in canary and pr releases (#30624)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

FreeBSD artifacts are not published as part of PR and canary releases
because it was unstable. Now it seems it's pretty stable though.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

FreeBSD artifacts are published as part of PR and canary releases. Those
releases can be used in this repo (which requires FreeBSD) support.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-08 09:28:01 -04:00
Craigory Coppola e329acaf77 docs(core): fix invalid markup in max cache size docs (#30628)
Small typo in docs
2025-04-08 09:14:46 -04:00
Leosvel Pérez Espinosa 220023de62 fix(core): do not run sync generators when running tasks in ci (#30591)
## Current Behavior

When running tasks, Nx will run and check the sync generators associated
with the task graph. While locally this is desirable to ensure the code
is always up to date while making changes, in CI, we don't make changes
that need to be synced or checked for every task. This is suboptimal,
and it results in duplicate processing.

## Expected Behavior

Sync generators should not run when running tasks in CI. To validate the
sync status, it is recommended to have a dedicated early step in the CI
pipeline that runs `nx sync:check` once.

## Related Issue(s)

Fixes #
2025-04-08 09:08:32 -04:00
Rares Matei b34ab953c5 docs(nx-dev): update gitlab access token permissions (#30625)
Update gitlab access token permissions to specify `read_repository`,
which is required for Nx Agents get files and checkout the repo.
2025-04-08 14:47:22 +02:00
Joshua Carter 2fd964fd3f fix(js): Use correctly resolved path to tsconfig in readTsConfigWithRemappedPaths() (#30156)
## Current Behavior
When `buildLibsFromSource: false`, webpack fails to resolve custom
entries in the tsconfig `paths`

## Expected Behavior
The tsconfig paths will be correctly loaded by webpack and resolved.

## Related Issue(s)

Fixes #30155.

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-04-08 14:39:56 +02:00
Colum Ferry 64030f55b5 feat(core): add --bundler=rspack option to angular stack cnw (#30629)
## Current Behavior
There is currently no way to generate an Angular Rspack app when
creating a new Nx Workspace.

## Expected Behavior
Add support for `--bundler=rspack` in `create-nx-workspace` including
adding `Rspack` as a prompt option when asking for bundler.
2025-04-08 13:29:20 +01:00
Jonathan Cammisuli 17a543f2c4 chore(core): update cargo deps, fix warnings (#30570) 2025-04-08 15:21:41 +04:00
Josh VanAllen 81d53d4449 docs(misc): removing Josh VanAllen from Champions (#30626)
Removing myself because I'm an employee.

Signed-off-by: Josh VanAllen <5290334+joshvanallen@users.noreply.github.com>
2025-04-08 04:57:17 -04:00
Colum Ferry 27d40a9270 feat(angular): add --bundler=rspack option to app generator (#30623)
## Current Behavior
The `@nx/angular` app generator currently does not support generating an
Angular Rspack application. This makes it slightly more difficult for
users to get up and running with Angular Rspack


## Expected Behavior
Add `rspack` as a supported `--bundler` option allowing for easy
generationg of new Angular Rspack apps.
2025-04-08 09:41:59 +01:00
Nicholas Cunningham 32b48a3a04 feat(rspack): add support for non-buildable libraries in external dependencies (#30606)
Parity with https://github.com/nrwl/nx/pull/30538
2025-04-04 07:41:22 -06:00
Rares Matei 4015d4cfe2 docs(nx-cloud): add release notes (#30611)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-04 07:29:30 -06:00
Nicholas Cunningham 074da70ada fix(webpack): enable legacy decorators and metadata in base config for compatibility (#30605)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
This PR fixes a runtime error in our NestJS application:

```
TypeError: Cannot read properties of undefined (reading 'get')
```
The root cause was that services were not being injected correctly due
to missing metadata reflection, which NestJS relies on for its
dependency injection system to resolve services.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We now fully support NestJS's DI system by adding:

```ts
transform: {
  legacyDecorator: true,
  decoratorMetadata: true,
}
```
This restores proper behavior, and services are injected as expected.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29136
2025-04-04 07:25:16 -06:00
Nicholas Cunningham 6e50a011e7 fix(nextjs): add eslint plugin dependencies in application and library generators (#30592) 2025-04-02 18:04:40 +00:00
Colum Ferry 27b78cd7ae fix(webpack): migrate to latest version to prevent security vulnerabilities #29755 (#30590)
## Current Behavior
The `@nx/webpack` depends on `webpack` at version `^5.80.0`. Despite the
`^` allowing it to resolve to a higher minor, there has been no
migration to force users onto a higher version.
There is a security vulnerability with version `5.88.0`.

## Expected Behavior
Ensure users are migrated to a version where the security vulnerability
has been fixed.

## Related Issue(s)

Fixes #29755
2025-04-02 12:32:24 -04:00
Louie Weng fd337bb5e3 chore(repo): fix assignment rules to prevent early termination (#30382)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today --> 

We set assignment rules to default all tasks to medium, which meant that
after the `linux-large` agent was complete, it would terminate since no
tasks would be assigned to it. This fixes the rules to ensure that tasks
can also be assigned to the linux-large agent.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-02 12:27:35 -04:00
Colum Ferry 9a7a4764bf docs(module-federation): add documentation on NxModuleFederationPlugin (#30518)
## Current Behavior
The `NxModuleFederationPlugin` and `NxModuleFederationDevServerPlugin`
are currently undocumented on `nx.dev`.


## Expected Behavior
Add documentation for the two plugins including what they do, how to use
them and an API Reference
2025-04-02 16:58:54 +01:00
Colum Ferry 9669dfdb62 feat(react): add crystal mf support to host and remote (#30424)
## Current Behavior
The `@nx/react` `host` and `remote` generators currently use executors
to support Module Federation


## Expected Behavior
When `bundler=rspack` use Crystal Module Federation with no executors
for Module Federation

## Related Issues
#30391
2025-04-02 16:58:45 +01:00
Colum Ferry 176e8f985a fix(vue): upgrade vite plugin vue to v5 to avoid install errors (#30559)
## Current Behavior
After the migration to Vite 6 - The `@vitejs/plugin-vue` was not updated
to v5.
This has led to an incorrect peer dependency.

## Expected Behavior
Upgrade `@vitejs/plugin-vue` to version 5 to remove peer dependency
issues

## Related Issue(s)

Fixes #30326
2025-04-02 16:13:21 +01:00
Nicholas Cunningham a9a486aa21 fix(webpack): nestjs workspace libs referencing when using ts solution (#30538)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, when you have a Nest app that imports a Nest Lib that is not
buildable inside a TS solution workspace the serving that application
fails because the library is marked as external.

Before we would include these projects as a part of
`tsconfig.compilerOptions.paths`. However, this is no longer possible as
it would not be a valid TS solution setup.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
If a library is not buildable it should be able to be resolved
regardless if we are using TS solutions or the legacy paths.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

closes: #30492, #30410, #30544
2025-04-02 08:55:37 -06:00
Jack Hsu 538fd8cbf6 fix(js): update @swc/cli version to fix vulnerability (#30575)
The `@swc/cli` version we're currently using has a security
vulnerability due to dependency on `cross-spawn`. This PR updates it to
the version that fixes the vulnerability.

Advisory: https://github.com/advisories/GHSA-3xgq-45jj-v275


## Current Behavior
Existing and new JS workspaces have a high security warning.

## Expected Behavior
No high security warning for new workspaces, and existing ones are
updated.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-02 09:51:36 -04:00
Colum Ferry 962aa7606a feat(storybook): migrate to latest storybook 8 version (#30584)
## Current Behavior
There is an issue in the most recent versions of Storybook 8.4 where
expected symbols are not exported correctly.

## Expected Behavior
Migrate to latest Storybook 8.6 to ensure these symbols are correctly
exported to ensure Storybook runs smoothly
2025-04-02 13:31:14 +01:00
Colum Ferry 985107cac3 fix(vite): ensure nxCopyAssetsPlugin outputs assets to correct location #28786 (#30585)
## Current Behavior
The `nxCopyAssetsPlugin` from `@nx/vite` does not output the asset files
to the correct location.
It prepends the `rootDir` even when the `outDir` in the `vite.config`
resolves to contain the `rootDir`.

## Expected Behavior
Only prepend the `rootDir` when it does not already exist

## Related Issue(s)

Fixes #28786
2025-04-02 13:30:55 +01:00
Juri ebd39bb2ae fix(nx-dev): nx homebrew install cmd 2025-04-02 13:53:02 +02:00
Leosvel Pérez Espinosa ac103fa109 cleanup(js): fix outdated unit test snapshot (#30582)
## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-04-02 10:09:43 +00:00
Chau Tran 68c9653f25 fix(graph): focus via --focus command should work (#30576) 2025-04-02 11:13:29 +02:00
Leosvel Pérez Espinosa b3c6d2d417 fix(core): resolve subpath patterns in package exports correctly when constructing graph (#30511)
## Current Behavior

When a package has a subpath pattern like the following:

```json
{
  "exports": {
    "./*": {
      "types": "./dist/lib/*/index.d.ts",
      "import": "./dist/lib/*/index.js",
      "default": "./dist/lib/*/index.js"
    }
  }
}
```

When constructing the graph the project is not picked as a dependency of
others projects that import from the package using a path that matches
that subpath pattern. This is currently happening because the current
resolution is wrongly using `minimatch` to match those patterns instead
of the [Node.js spec for resolving subpath
patterns](https://nodejs.org/docs/latest-v22.x/api/esm.html#resolution-algorithm-specification).

## Expected Behavior

Subpath patterns should be processed after the [Node.js
spec](https://nodejs.org/docs/latest-v22.x/api/esm.html#resolution-algorithm-specification)
and the graph should pick up dependencies when used.

## Related Issue(s)

Fixes #30342
2025-04-02 10:29:47 +02:00
Colum Ferry 2dbff35de9 fix(rspack): allow typechecking during serve #29267 (#30558)
## Current Behavior
The `NxRspackAppPlugin` and `NxWebpackAppPlugin` will not provide
typechecking if using TS Solution setup because it already has a
typecheck target.
However, this means that typechecking will not be run during serve.

## Expected Behavior
Allow typechecking to run during serve even with TS Solution setup

## Related Issue(s)

Fixes #29267
2025-04-02 09:26:35 +01:00
Leosvel Pérez Espinosa 8dceb6c17d fix(misc): update project directory validation to only account for the derived name (#30532)
## Current Behavior

The helper to normalize the project name and directory for project
generators validates the provided full directory with a regex pattern
intended to only validate the name.

## Expected Behavior

The helper to normalize the project name and directory for project
generators should only validate the provided name or the name portion of
the provided directory.

## Related Issue(s)

Fixes #28801
2025-04-02 10:09:11 +02:00
Leosvel Pérez Espinosa b911ddbdac fix(core): update resolution of ts path mappings with patterns in target project locator (#30533)
## Current Behavior

The `TargetProjectLocator` logic for matching TS path mapping patterns
is incorrect and doesn't handle a few scenarios.

## Expected Behavior

The `TargetProjectLocator` logic for matching TS path mapping patterns
should match the TS resolution and handle all valid scenarios.

## Related Issue(s)

Fixes #30172
2025-04-02 10:08:56 +02:00
Leosvel Pérez Espinosa 9b84926d0b fix(js): handle extending from multiple config files and from local workspace packages in plugin (#30486)
## Current Behavior

The `@nx/js/typescript` plugin doesn't handle [extending from multiple
tsconfig
files](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#supporting-multiple-configuration-files-in-extends).
It also identifies local workspace packages linked by the package
manager as external dependencies.

## Expected Behavior

The `@nx/js/typescript` plugin should support extending from multiple
tsconfig files. It should also identify local workspace packages linked
by the package manager correctly and add their resolved path to the task
inputs (not as external dependencies).

## Related Issue(s)

Fixes #29678
2025-04-02 10:08:02 +02:00
Jack Hsu 2d210b8d0e fix(bundling): webpack and rspack builds respect output.clean config option (#30573)
This PR fixes and issue where the standard `output.clean` option is
ignored and replaced by the Nx-specific `deleteOutputPath` option on the
`NxAppWebpackPlugin` and `NxAppRspackPlugin` plugins.

We want to allow users to use standards over our own features, so if we
see that `output.clean` is set in webpack/rspack config, then we use
that value.

For example, an Rspack config could be:

```js
const { NxAppRspackPlugin } = require("@nx/rspack/app-plugin");
const { join } = require("path");

module.exports = {
  output: {
    path: join(__dirname, "dist/demo"),
    clean: false, // <-- THIS DOES NOT WORK!
  },
  plugins: [
    new NxAppRspackPlugin({
      // ...
    }),
  ],
};
```

But even though `output.clean` is `false`, each build will still delete
`dist`. The only way to disable that behavior is to use the Nx-specific
option like this:

```js
const { NxAppRspackPlugin } = require("@nx/rspack/app-plugin");
const { join } = require("path");

module.exports = {
  output: {
    path: join(__dirname, "dist/demo"),
  },
  plugins: [
    new NxAppRspackPlugin({
      deleteOutputPath: false,
      // ...
    }),
  ],
};
```


## Current Behavior

Setting `output.clean` in Webpack/Rspack config does nothing, and we
always default our own `deleteOutputPath` to `true`.

## Expected Behavior
Setting `output.clean` standard option is respected.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-01 21:16:05 -04:00
Craigory Coppola 75521bb64d fix(misc): add missing flag to azure devops ci workflow generator (#30482)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
`-t` is missing in the azure pipelines ci workflow

## Expected Behavior
`nx affected` is called with `-t`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30331
2025-04-01 20:17:07 -04:00
Jack Hsu 41cc04d070 fix(nextjs): update Next.js versions to patch vulnerability (#30574)
There is a critical vulnerability with Next.js. This PR updates both the
v14 and v15 versions to ensure users are on the latest patched versions.

For new projects, it should already be using the latest patch within the
minor version, since we default to `~` range. This will ensure that
existing projects that did not update yet is updated to the secure
versions.

See: https://github.com/advisories/GHSA-f82v-jwr5-mffw

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Next.js versions for existing projects may be using vulnerable versions.

## Expected Behavior
Migrate existing Next.js projects to patched and secure versions.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-01 18:28:00 -04:00
Craigory Coppola f5d3ba5dcd docs(core): add some docs for maxCacheSize (#30569)
## Current Behavior
`maxCacheSize` is not documented

## Expected Behavior
`maxCacheSize` is documented

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-01 16:35:44 -04:00
Isaac Mann b50727adb4 docs(core): brew install nx (#30571)
Adds instructions to install Nx globally with Homebrew
2025-04-01 20:34:05 +00:00
Craigory Coppola 85bb61f9e0 fix(core): ensure rust code is able to handle null terminal outputs (#30494)
## Current Behavior
Somewhere in the ts side we are passing a value as null for terminal
outputs. The rust code bails when this happens.

## Expected Behavior
The rust side is able to handle it.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-01 15:06:58 -04:00
Miroslav Jonaš 093b13fed9 feat(core): handle yarn resolutions and patches when parsing and pruning lock file (#30546)
This PR introduces support for `resolutions` and `patches` for yarn lock
file parsing and pruning.

Additionally, it fixes the correct dependency matching when the version
has one of the two forms:
- fluid version range (e.g. `npm:*`)
- union version range (e.g. `1 || 2 || 3`)

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-01 12:39:59 -04:00
Isaac Mann 028b5768ff docs(core): correct kevin's twitter account (#30563)
Fix Kevin Oliveira's twitter account
2025-04-01 08:48:40 -04:00
Colum Ferry 3afa91a502 fix(angular): use latest version of @analogjs/vitest-angular #30423 (#30560)
## Current Behavior
The version of `@analogjs/vitest-angular` and
`@analogjs/vite-plugin-angular` that is installed is `1.10.0`
The latest version is `1.14.1`.

## Expected Behavior
Upgrade to the latest version of the packages.

## Related Issue(s)

Fixes #30423
2025-04-01 11:35:52 +01:00
Dron Bhattacharya b8e4325528 fix(nextjs): bumped to eslintConfigNextVersion to v15 (#30537)
Closes #30536

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
The current version of eslint-config-next (v14.2.16) has peer dependency
conflicts with the latest versions of ESLint (v9.x). This issue causes
npm install to fail in projects using eslint-config-next.

## Expected Behavior
`npm install` should succeed without dependency conflicts.

## Related Issue(s)


Fixes #30536

---------

Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2025-03-31 16:58:05 -06:00
Juri Strumpflohner 6ba90cdbb1 docs(misc): minor self-hosted cache docs fixes (#30554)
Minor updates to wording for the self-hosted cache pages
2025-03-31 15:35:48 -04:00
Jack Hsu 29a2b18fb7 fix(nx-dev): fix blog post links (#30553)
Currently, links are broken to the latest Remote Caching blog post on
these two pages:
- https://nx.dev/blog/evolving-nx
- https://nx.dev/blog/introducing-nx-powerpack
<img width="885" alt="Screenshot 2025-03-31 at 2 39 38 PM"
src="https://github.com/user-attachments/assets/2c6b3667-496a-4c40-b3de-8c7e911e4608"
/>


This PR fixes those and updates the timestamp to the correct date.
2025-03-31 14:48:31 -04:00
Juri Strumpflohner a22f4fce49 docs(misc): new self-hosted cache updates (#30550)
Adds the new updates around self-hosted caching possibilities.
2025-03-31 13:28:42 -04:00
Leosvel Pérez Espinosa 5974851c24 fix(js): infer dependency between typecheck and build tasks and more granular outputs for typecheck (#30549)
## Current Behavior

There is no dependency between the inferred `typecheck` and `build`
tasks. Depending on their run order, this can result in duplicated
processing (type-checking, `.d.ts` generation). Given there's no
explicit dependency, the order would be non-deterministic.

Additionally, when `outDir` is set in the tsconfig files, it's used
as-is in the currently inferred outputs for `typecheck`. This can result
in extra files being cached for the task.

## Expected Behavior

For optimum performance, the inferred `typecheck` task should depend on
the `build` task. The `typecheck` task's outputs should be more granular
so that only the relevant files (declaration files and declaration map
files if enabled) are cached.

### Explanation

Consider a typical setup with specific tsconfig file for files with
different concerns:

- tsconfig.lib.json: TS configuration for the library runtime files
- tsconfig.spec.json: TS configuration for the unit test files
- tsconfig.json: TS solution configuration, a solution file that
references the specific config files above

When running `tsc -b tsconfig.lib.json --verbose` (build), we can see
how the `tsconfig.lib.json` TS project is built:

```bash
Projects in this build:
    * tsconfig.lib.json

Project 'tsconfig.lib.json' is out of date because output file 'dist/tsconfig.lib.tsbuildinfo' does not exist

Building project '<workspace root>/packages/pkg1/tsconfig.lib.json'...
```

After that, if we run `tsc -b tsconfig.json --emitDeclarationOnly
--verbose` (typecheck), we'll see how the `tsc` output for
`tsconfig.lib.json` is reused:

```bash
Projects in this build: 
    * tsconfig.lib.json
    * tsconfig.spec.json
    * tsconfig.json

Project 'tsconfig.lib.json' is up to date because newest input 'src/lib/file.ts' is older than output 'dist/tsconfig.lib.tsbuildinfo'

Project 'tsconfig.spec.json' is out of date because output file 'out-tsc/jest/tsconfig.spec.tsbuildinfo' does not exist

Building project '<workspace root>/packages/pkg1/tsconfig.spec.json'...
```

The relevant bit above is `Project 'tsconfig.lib.json' is up to date
because newest input 'src/lib/file.ts' is older than output
'dist/tsconfig.lib.tsbuildinfo'`. Because the initial `build` task
already typechecks and produces `.d.ts` files for the
`tsconfig.lib.json`, when the `typecheck` task runs, `tsc` identifies
that the outputs for that config files were already produced and can be
reused.

If we were to run the tasks in the inverse order, the results would be
different:

```bash
> npx tsc -b tsconfig.json --emitDeclarationOnly --verbose
Projects in this build: 
    * tsconfig.lib.json
    * tsconfig.spec.json
    * tsconfig.json

Project 'tsconfig.lib.json' is out of date because output file 'dist/tsconfig.lib.tsbuildinfo' does not exist

Building project '<workspace root>/packages/pkg1/tsconfig.lib.json'...

Project 'tsconfig.spec.json' is out of date because output file 'out-tsc/jest/tsconfig.spec.tsbuildinfo' does not exist

Building project '<workspace root>/packages/pkg1/tsconfig.spec.json'...

> npx tsc -b tsconfig.lib.json --verbose
Projects in this build: 
    * tsconfig.lib.json

Project 'tsconfig.lib.json' is out of date because buildinfo file 'dist/tsconfig.lib.tsbuildinfo' indicates there is change in compilerOptions

Building project '<workspace root>/packages/pkg1/tsconfig.lib.json'...
```

Note how when the `build` task is run, `tsc` identifies that there was a
change in `compilerOptions` (`--emitDeclarationOnly`) and it requires
building the project. This is because the `typecheck` task only
generates declaration files and the `build` task must also emit the
transpiled `.js` files.

### Benchmark

Running those two different flows in a simple (non-Nx) project with a TS
configuration structure like the one mentioned above and with 5000 TS
files split in half for runtime and test files yields the following:

```bash
hyperfine -r 5 -p "rm -rf dist out-tsc" \
-n "build => typecheck" "npx tsc -b tsconfig.lib.json && npx tsc -b --emitDeclarationOnly" \
-n "typecheck => build" "npx tsc -b tsconfig.json --emitDeclarationOnly && npx tsc -b tsconfig.lib.json"
Benchmark 1: build => typecheck
  Time (mean ± σ):      6.832 s ±  0.094 s    [User: 11.361 s, System: 1.060 s]
  Range (min … max):    6.734 s …  6.985 s    5 runs
 
Benchmark 2: typecheck => build
  Time (mean ± σ):      8.789 s ±  0.015 s    [User: 14.817 s, System: 1.267 s]
  Range (min … max):    8.771 s …  8.812 s    5 runs
 
Summary
  build => typecheck ran
    1.29 ± 0.02 times faster than typecheck => build
```

## Related Issue(s)

Fixes #
2025-03-31 19:05:52 +02:00
MaxKless e29f8f0d46 chore(nx-dev): add todo comment for moving endpoint to nx api (#30286) 2025-03-31 16:22:01 +02:00
Leosvel Pérez Espinosa f3d2761869 fix(core): handle windows drive letter in a case-insensitive manner when normalizing paths (#30535)
## Current Behavior

The Windows drive letter in paths could have different casing in certain
circumstances. The `normalizePath` helper only considers it as
PascalCase, which can result in issues when the path drive letter is
actually in lowercase.

## Expected Behavior

The `normalizePath` should correctly handle the Windows drive letter
regardless of the casing.

## Related Issue(s)

Fixes #28798
2025-03-31 11:26:59 +02:00
Nicholas Cunningham bf8848da95 fix(webpack): add extension alias support for handling ESM libs (#30513)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, if you have a webpack application that uses out
NxWebpackAppPlugin and has a non-buildable lib that has exports with
extension enabled for example:`export * from './lib/lib8446520.js';`.
The app fails to build.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When using webpack and including libraries that contain extension it
should resolve.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30492
2025-03-28 11:51:20 -06:00
Leosvel Pérez Espinosa 90ff03d42d fix(angular): include @angular/google-maps in package updates (#30530)
## Current Behavior

The `@angular/google-maps` package version is not updated when running
`nx migrate`.

## Expected Behavior

The `@angular/google-maps` package version should be updated when
running `nx migrate`.

## Related Issue(s)

Fixes #30523
2025-03-28 12:22:37 +01:00
Nicholas Cunningham 4a3a8241c3 fix(nx-dev): add data-document attribute to improve search (#30524) 2025-03-27 15:19:07 -06:00
Mike Hartington d194248f53 docs(nx-dev): update install steps for java (#30526)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Update the install instructions for the new java landing page

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-27 20:03:28 +00:00
Juri Strumpflohner ea04a2ed72 feat(nx-dev): add java landing page (#30508)
## Current Behavior
<!-- This is the behavior we have today -->

Nothing there.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Adds a new
[/java](https://nx-dev-git-nxdev-gradle-landing-page-nrwl.vercel.app/java)
landing page

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Mike Hartington <mikehartington@gmail.com>
Co-authored-by: Mike Hartington <mhartington@users.noreply.github.com>
2025-03-27 15:01:00 -04:00
Craigory Coppola 3587aeabb7 fix(core): fixup error handling for get generator info (#30525)
Some error handling is missing after #30501
2025-03-27 18:59:36 +00:00
Craigory Coppola 4039970495 fix(misc): init should prompt for cloud when using dot nx folder (#30501)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
When nx is installed in the `.nx` directory the init flow is
substantially different. This changes how some prompting works as well
as how plugin installation flows.

## Expected Behavior
The two flows operate in a similar manner.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-27 12:08:57 -04:00
Nicholas Cunningham 415979e554 fix(nextjs): update documentation for buildable libraries and bundler configuration (#30500)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, the docs does not differentiate between inferred target
outputs and executor outputs.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Since the outputs differ we should highlight the difference in our docs.
Also, if we pass a bundler to the Next.js lib app generator it should
respect that option.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-27 09:50:46 -06:00
Colum Ferry c8e4e0f9ef fix(rspack): remove unused plugin-minify (#30521)
## Current Behavior
`@nx/rspack` set ups currently install `@rspack/plugin-minify` which has
been deprecated. It is also unused in the configurations that are
generated.

## Expected Behavior
Remove unused the unused `@rspack/plugin-minify`

## Related Issue(s)

Fixes #30318
2025-03-27 13:18:59 +00:00
Colum Ferry d12a4f4b12 fix(module-federation): the module federation package depends on rspack (#30520)
## Current Behavior
The `@nx/module-federation` depends on the `@rspack/core` package but it
is currently only set as a `peerDep` meaning users need to install the
package manually.

## Expected Behavior
As the package depends on `@rspack/core`, make sure it is set as a
dependency

## Related Issue(s)

Fixes #30307
2025-03-27 13:18:37 +00:00
Colum Ferry e08f3479e6 fix(webpack): allow baseHref to not be set #30291 (#30519)
## Current Behavior
The `NxAppWebpackPlugin` and `NxAppRspackPlugin` both always set `<base
href="` even when it is set to undefined.

## Expected Behavior
If `baseHref` is set to false, do not set `<base href`.

## Related Issues
#30291
2025-03-27 13:18:16 +00:00
Jack Stevenson 9fa8930afe fix(vite): ensure test target dependency is not duplicated (#30289)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Every time the vitest generator was run a new duplicate '^build'
dependency was added to the target defaults for the test task.

## Expected Behavior
No duplicate entries added!

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30288

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-03-27 12:46:07 +00:00
Leosvel Pérez Espinosa bae3acd48e fix(misc): handle outputs with globs when normalizing tsconfig path mappings for buidable libraries (#30506)
## Current Behavior

If a buildable library depends on another buildable library that has
`outputs` using globs the build fails when using an executor that remaps
the dependency TypeScript path mappings to the build outputs.

## Expected Behavior

Building a buildable library using an executor that remaps the
dependency TypeScript path mappings to the build outputs should succeed.
The remapping logic should identify and replace the glob patterns and
keep the fixed part of the pattern (no segment with wildcards).

Note: additionally, an obsolete check was removed from the
`@nx/angular:package` and `@nx/angular:delegate-build`.

## Related Issue(s)

Fixes #30041
2025-03-27 10:31:53 +01:00
Leosvel Pérez Espinosa e4e9973db3 fix(js): infer typecheck task for buildable libraries with tsc (#30505)
## Current Behavior

Buildable libraries using `tsc` for `build` don't get a `typecheck`
task, which results in test files not being type-checked.

## Expected Behavior

The `typecheck` task should be inferred, and test files should be
type-checked.

## Related Issue(s)

Fixes #
2025-03-27 09:35:17 +01:00
Nicholas Cunningham 1a235d7236 fix(react): react-router should work with jest out of the box (#30487)
Jest should be compatible with react-router out of the box.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, there are two issues when using `jest` with react-router out
of the box

1. Test files are not included from `tsconfig`
2. While running the test `jsdom` is missing Node's `TextEncoder` and
`TextDecoder` so compilation fails.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Running a test should work without issues when you create a react-router
app with Jest.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30387
2025-03-26 10:44:28 -06:00
Isaac Mann b371512462 docs(core): add champions (#30498)
Add Kevin Oliveira and Guilherme Siqinelli to the champions list
2025-03-26 11:28:49 -04:00
Isaac Mann b21af21657 docs(core): api icons fallback (#30499)
Add rsbuild icon and update rspack icon. `nx-api` icons default to Nx
icon if none is specified.
2025-03-26 11:28:37 -04:00
Jonathan Cammisuli e6d8b3913b fix(core): add more detection for ci platforms (#30507) 2025-03-26 15:16:32 +00:00
Leosvel Pérez Espinosa ab311c0f07 fix(js): normalize tsconfig include paths correctly in @nx/js/typescript plugin (#30496)
## Current Behavior

The `@nx/js/typescript` plugin infers incorrect inputs for tsconfig
`include` patterns when their last segment doesn't contain a wildcard or
an extension (e.g. `"include": ["src"]`).

## Expected Behavior

The `@nx/js/typescript` plugin should [normalize such `include`
patterns](https://www.typescriptlang.org/tsconfig/#include) and infer
valid inputs.

## Related Issue(s)

Fixes #30014
2025-03-26 15:26:05 +01:00
Richard Roozenboom 9cd7579040 fix(core): ensure local plugin is transpiled when using index files (#30133)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
In some use cases the local plugins generators and executors are not
transpiled, which causes an error when you execute them. see for example
![Screenshot 2025-02-21 at 09 07
10](https://github.com/user-attachments/assets/1fd03a4b-1ac4-4827-b240-b4ea88d491a2)

This issue is introduced by this PR #29539 and is actually a regression
of an error we had in NX 18, see #22958

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This PR fixes this issue by updating the if statement to register the
typescript transpiler when this is not done yet.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30132
2025-03-26 10:00:26 -04:00
Leosvel Pérez Espinosa 4bd64770a5 feat(linter): support eslint-config-prettier v10 (#30480)
Add support for `eslint-config-prettier` v10.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #30145
2025-03-26 07:45:46 -04:00
Craigory Coppola 9dd4766059 fix(core): init should use pr version when specified (#30497)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
`nx init` always either installs `next` or `latest` versions of Nx. The
intent here is that running `npx nx init` should always provide the
latest version of Nx, and we added a condition to use `next` if we
detected a beta version of Nx was running to facilitate easier testing
of RC and beta releases. The full logic to determine which version of Nx
to setup is below:

```ts
const version =
    process.env.NX_VERSION ?? (prerelease(nxVersion) ? 'next' : 'latest');
```

The goal here was to avoid hitting the `npx` cache and accidentally
creating new workspaces with an older Nx version. This logic falls apart
a bit when considering prereleases though, as `npx nx@next init` would
always check the tag to make sure its up to date rather than using a
cached version. This is the case when providing **_any_** tag to `npx`.

A bad side effect of the above is that when trying to test PR builds and
the like, `nx init` will never setup the PR build when running `npx
nx@0.0.0-pr....` opting instead to setup `next`.

## Expected Behavior
Running `npx nx@0.0.0-pr.... init` sets up an nx workspace using the
specified PR release.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-25 20:36:15 -04:00
Juri 50561ff009 fix(nx-dev): adjust alignment on the pricing addon descriptions 2025-03-25 16:32:57 +01:00
Leosvel Pérez Espinosa 5dbe040374 fix(misc): override customConditions when using an incompatible module resolution (#30477)
## Current Behavior

In a few different places (Crystal plugins, executors, generators,
helpers) where `ts-node` compiler options are overridden and
`moduleResolution` is being set to something other than `node16`,
`nodenext`, or `bundler`, an error can occur if the `customConditions`
compiler option is being used.

## Expected Behavior

When overriding the `ts-node` compiler options and changing forcing
`moduleResolution` to have a value that's incompatible with
`customConditions`, the latter should be unset (set to `null`) to avoid
errors.

## Related Issue(s)

Fixes #
2025-03-25 07:51:02 -04:00
Miroslav Jonaš 30781f7fe3 feat(repo): replace explicit matrix with dynamic parsed from json (#30120)
This PR replaces the cumbersome explicit matrix in `e2e-matrix.yml` with
a dynamic matrix built from the input JSON data.

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-24 11:56:47 -04:00
Nicholas Cunningham 2c55685492 fix(react): update react router logic with selected bundler (#30399)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, when you generate a react app and select `--use-react-router`
and `--bundler=` any other bundler except `vite` you would be forced
into using `vite`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When you generate a React app and opt into using `--use-react-router`
with `--bundler=webpack` (for example) you will get an error stating the
React Router can only be used with `vite`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-24 09:45:23 -06:00
Leosvel Pérez Espinosa cfe32c2560 feat(misc): add --useProjectJson flag to CNW (#30475)
## Current Behavior

Creating new workspaces since Nx 20.6.0 will generate the Nx
configuration in `package.json` files. This is intended, given that it
is part of the new setup using TypeScript Project References and Package
Manager Workspaces, but there's no way to choose to generate the Nx
configuration in `project.json` files. Project generators do allow to
choose but there's no way to do it when creating a new workspace. This
forces users who want to use `project.json` files to generate an empty
workspace and then use a project generator.

## Expected Behavior

When creating a new Nx workspace, users can provide an option
(`--use-project-json`) to generate the Nx configuration in
`project.json` files.

## Related Issue(s)

Fixes #30464
2025-03-24 08:42:18 -04:00
Nicolas Beaussart 3d710ce923 fix(react): only add release config for publishable librarires (#30474) 2025-03-24 13:48:28 +04:00
Tine Kondo cecd60710b fix(core): fix local registry not being considered when using bun (#30459) 2025-03-23 22:29:31 +04:00
James Henry 3be73ede0f chore(repo): fix lockfile (#30467) 2025-03-23 13:59:11 +04:00
Jordan 12af01453a docs(core): improve grammar of keep-nx-versions-in-sync (#30308) 2025-03-22 15:51:36 +04:00
James Garbutt 8575fa1495 cleanup(angular): migrate to picomatch (#30081) 2025-03-22 15:48:22 +04:00
Nate Kidwell 013da9ea1c chore: include bun mention in bug.yml (#30306) 2025-03-22 15:46:36 +04:00
Jason Jean 1c238c0a74 fix(core): pass the project graph into the batch instead of recreating (#30455)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Running a batch executor recreates the project graph

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The project graph is passed in when running a batch executor so that it
doesn't have to get recreated.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-21 22:07:24 +00:00
Leosvel Pérez Espinosa 176c792e34 feat(misc): set a development conditional export for buildable libraries when using the ts solution setup (#30451)
Update library generators to set a `development` conditional export for
buildable libraries' `package.json` files and set the
`customConditions` compiler options in `tsconfig.base.json`. This will
only be done for workspaces using the TS solution setup.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-21 17:00:25 -04:00
Jack Hsu 533e9ffc25 docs(react): update react monorepo tutorial (#30454)
This PR updates the React monorepo tutorial.

- Remove video embeds since the content is outdated (e.g. shows old TS
setup) -- we have a separate task to update and add back later
- Update the generated files to ensure they are in sync
- Update to show Playwright instead of Cypress since that is the default
- Remove one mention of `project.json` for configuration, and point to
the Inferred Tasks page instead to learn how tasks are automatically
configured
- Update code example for `apps/react-store/src/app/app.tsx` to render
`Welcome react-store` instead of `Home` so that unit and e2e tests still
pass without having to update those as well (better for the flow of the
tutorial)
2025-03-21 16:45:43 -04:00
Colum Ferry 487aa6fa78 feat(module-federation): add ssr support to rspack crystal plugin (#30437)
## Current Behavior
The current `NxModuleFederationPlugin` does not support SSR


## Expected Behavior
The current `NxModuleFederationPlugin` supports SSR
2025-03-21 15:17:45 +00:00
Jack Hsu 32f0acab42 feat(bundling): add buildLibsFromSource option to @nx/rollup:rollup executor (#30417)
Add `buildLibsFromSource` to the `@nx/rollup:rollup` executor to bring
it to parity with Webpack/Rspack/Vite. This allows the bundle to point
to dist if `buildLibsFromSource: false` is set, which enables
incremental builds.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

Note: This only applies to workspaces using tsconfig paths, as that
linking mechanism is assumed by `buildLibsFromSource`. For NPM
workspaces, whatever is defined in `package.json` exports is used as we
use Node resolution in the new setup.

## Current Behavior
`buildLibsFromSource` does not exist

## Expected Behavior
`buildLibsFromSource exists

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-21 09:30:53 -04:00
Colum Ferry dae1c97814 fix(nx-dev): sidebar should not always show angular-rs* links (#30448)
## Current Behavior
The `angular-rspack` and `angular-rsbuild` packages links are always
shown on the menu after navigating to the API section

## Expected Behavior
The links for these packages should only display on the `API` page
2025-03-21 08:34:22 -04:00
Benjamin Cabanes cad4d26dcd docs(nx-dev): improve enterprise design & animations (#30446)
In the nx-dev pages, adjust the interface to utilize 'EnterpriseLayout'
instead of 'DefaultLayout'. The duration of the transition in
'customer-logos.tsx' has been reduced from 500 to 200 to boost
responsiveness.

The 'enterprise-layout.tsx' file was added and contains new animation
elements to enhance end-user experience. Updates were made to
'hero.tsx', simplifying and enhancing SVG animation.
2025-03-20 15:52:54 -04:00
Mike Hartington f60803cfa4 docs(misc): fix angular book blog (#30445)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-20 15:46:58 -04:00
James Henry 00f16aae0f fix(devkit): formatFiles should check for root prettier config before using prettier (#30426) 2025-03-20 22:02:34 +04:00
Mike Hartington b83e5949c6 docs(misc): add angular book blog (#30440)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-20 13:24:17 -04:00
Craigory Coppola 3e8ba40bb1 fix(core): legacy cache users should get artifacts when remote cache is hit (#30442)
## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
Legacy cache users should get artifacts when remote cache is hit

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30429
2025-03-20 13:15:23 -04:00
Benjamin Cabanes f9c8dbeb54 docs(nx-dev): remove webinar notification (#30438)
Disabled the `WebinarNotifier` component in `_app.tsx` and removed the
live event link in the `hero.tsx` file by commenting out the code.
2025-03-20 09:11:32 -06:00
Juri 27d02e43ff docs(nx-dev): pin mcp post 2025-03-20 14:15:39 +01:00
Roman Lorenzo Balayan 2a0d89ddc3 fix(gradle): build nx graph for gradle projects regardless of build gradle file location (#29783) (#29802)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
With a project structure where build.gradle.kts is defined in a separate
buildSrc directory, and not in the root project directory where
`gradlew` is defined, the gradle project is not included in nx project
graph. This is a valid gradle project configuration, with project-report
tasks configured. Running ./gradlew projectReport works and builds the
projectReport.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

With the fix, as long as expected tasks - projectReport or
projectReportAll - is defined, nx should be able to build the nx graph
regardless of the location of the `build.gradle` or `build.gradle.kts`
file.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29783
2025-03-19 13:35:27 -04:00
Mike Hartington e4ea6b90df docs(misc): update rspack social image (#30428)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-19 12:51:02 -04:00
Jason Jean 3a3ba0dde7 chore(repo): update nx to 20.7.0-beta.3 (#30427)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `20.5.0-rc.4`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `20.7.0-beta.3`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-19 12:33:34 -04:00
Jack Hsu e0cae539d6 fix(js): update tinyglobby to speed up shallow file matching (#30415)
`tinyglobby` at `0.2.10` (what we use now) is slow on shallow files, but
the latest version `0.2.12` is fast due to this PR
https://github.com/SuperchupuDev/tinyglobby/pull/69/files.

This PR updates both the js and esbuild plugins to use the newest
versions, but also adds `tinyglobby@^0.2.12` to our root `package.json`
so we get the speed increase right away. I removed `fast-glob` in our
repo scripts and replaced it with `tinyglobby`.

## Current Behavior
Asset handling is slow for shallow files like `LICENSE` but is fine for
scoped patterns like `src/**/*.ts`.

## Expected Behavior
Asset handling should be fast for shallow files.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-19 09:20:18 -04:00
Colum Ferry 851138cabd docs(angular): blog post for using angular with rspack (#30380)
- docs(angular): blog post for using angular with rspack
- docs(angular): apply review feedback

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-19 08:40:35 -04:00
Juri 59624c2add docs(core): remove workspaceLayout which is deprecated 2025-03-18 21:20:43 +01:00
Nicholas Cunningham edf2c1ec0e docs(react): add React Router with Nx documentation to surface the support for React Router (#30384)
This PR introduces a guide for using React Router with Nx and updates
the Remix guide to reflect the transition to React Router.
2025-03-18 13:47:42 -06:00
Colum Ferry 68ad76f829 docs(angular): add angular rspack version matrix 2025-03-18 16:08:37 +01:00
Colum Ferry 04005515ef docs(angular): add angular-rspack missing features and benchmarks (#30407)
## Current Behavior
We do not have the missing features and limitations listed on the docs
for angular rspack
We do not have the benchmarks listed on the docs

## Expected Behavior
Add the missing features and limitations
Add the benchmarks
2025-03-18 13:41:24 +00:00
Juri Strumpflohner f1b5e5815c feat(nx-dev): add angular architecture blog post (#30400)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-18 09:21:46 -04:00
Jonathan Cammisuli f248d16d48 fix(core): simplify key registration process (#30405)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-17 22:19:04 +00:00
Craigory Coppola 46d55adf9f fix(core): handle null outputs in native cache (#30398)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
`cache.rs` expects outputs to always be an array

## Expected Behavior
`cache.rs` is able to handle null

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-17 17:19:31 +00:00
Mike Hartington 3a2c245b08 docs(misc): add missing link in blog post 2025-03-17 16:44:04 +01:00
Mike Hartington 6d2e41b3f0 docs(misc): fix cover image for testing post (#30395)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-17 15:00:26 +00:00
Colum Ferry e38147d27f docs(angular): add modern angular testing with nx blog (#30375)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-17 09:54:59 -04:00
Emily Xiong 013d33f664 fix(gradle): exlude htmlDependencyReport (#30300)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-17 01:31:11 -04:00
FrozenPandaz 214552ed98 Reapply "fix(core): make 'key' parameter optional in register command (#30365)"
This reverts commit 9c95ecaf80.
2025-03-14 19:15:49 -04:00
FrozenPandaz a2e05c95da Reapply "feat(core): add nx register (#30321)"
This reverts commit 50e990c50c.
2025-03-14 19:15:49 -04:00
FrozenPandaz 50e990c50c Revert "feat(core): add nx register (#30321)"
This reverts commit 77c1dda9e8.
2025-03-14 15:12:53 -04:00
FrozenPandaz 9c95ecaf80 Revert "fix(core): make 'key' parameter optional in register command (#30365)"
This reverts commit b06007954e.
2025-03-14 15:12:53 -04:00
Nicholas Cunningham 363088a8ae feat(react): Add react-router to create-nx-workspace and react app generator (#30316)
This pull request introduces improvements to React Router integration
and removes the Remix preset.

## Key Changes:
- Updated `create-nx-workspace` to support React Router.
- Removed the Remix option from `create-nx-workspace`, but the package
remains to support existing users.

## SSR & React Router Support
- New users who want SSR in their React apps can enable it via the React
option and select React Router for SSR support.
- The ecosystem has shifted to migrating from Remix to React Router for
SSR needs.
- This option is only available for plain React apps and uses Vite.
Other types of React apps (Micro Frontends, Webpack, Rspack, etc.)
remain unaffected.

## Default Routing Behavior
`--routing` is now enabled by default when creating a React app using
`create-nx-workspace`, aligning with Angular’s default behaviour.
2025-03-14 15:06:54 -04:00
Jason Jean 50802e7591 fix(misc): update axios and webpack (#30379)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The current versions of Axios and webpack packages have vulnerabilities

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Versions of axios and webpack have no known vulnerabilities

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-14 17:52:08 +00:00
Colum Ferry 0082081d5c feat(angular): add convert-to-rspack generator (#29860)
## Current Behavior
Nx currently does not offer an automated method for switching from an
Angular Webpack build to an Angular Rspack build.

## Expected Behavior
Provide a generator `convert-to-rspack` in `@nx/angular` that will allow
conversion from an Angular Webpack build to an Angular Rspack build.

Usage: `nx g convert-to-rspack --project=myapp`

## TODO
- [x] handle more builder options
- [x] take existing custom webpack configs and migrate into the rspack
config that is created
2025-03-14 17:11:21 +00:00
Nicholas Cunningham f40873ffbe feat(react): add react-router plugin (#29965)
This PR introduces the React Router plugin in Nx. 
The new functionality adds a react-router plugin entry into `nx.json`,
projects that are React-Router V7 via `react-router.config.(m|c)?[jt]s`
will have their targets inferred.


### Changes
Update the React plugin to have a react-router (RR V7) plugin export.
The RR V7 will only infer targets if we have a
`react-router.config.(m|c)?[jt]s` and also a `vite.config.(m|c)?[jt]s`.

Under the hood the RR V7 CLI uses vite for compilation. 
That being said, apps are not limited to only use vite for RR V7. Should
you choose to use it the compilation will not be done via RR V7 CLI.
2025-03-14 13:08:21 -04:00
Colum Ferry a72ffcbe70 docs(angular): add angular rspack documentation (#30269)
## Current Behavior
Docs for Angular Rspack currently live on angular-rspack.dev

## Expected Behavior
Migrate docs for Angular Rspack to nx.dev
2025-03-14 16:46:27 +00:00
Leosvel Pérez Espinosa 2d69aa12bf feat(misc): enable ts solution setup by default for new workspaces (#30372)
## Current Behavior

To create a new workspace that uses the new TS solution setup the
`--workspaces` flag must be provided (Node, React, and Vue stacks).

## Expected Behavior

New workspaces should be created by default using the new TS solution
setup (Node, React, and Vue stacks). Users can opt out of it by
providing the `--no-workspaces` flag.

## Related Issue(s)

Fixes #
2025-03-14 17:42:31 +01:00
Philip Fulcher 398ab354e5 docs(nx-dev): add video to 20.5 post (#30374) 2025-03-14 09:27:51 -06:00
Colum Ferry beb178430e feat(rspack): alias convert-webpack to convert-to-rspack (#30367)
## Current Behavior
`convert-webpack` generator is offered by `@nx/rspack` plugin.

## Expected Behavior
Add an alias of `convert-to-rspack` to make it clearer
2025-03-13 17:50:06 -04:00
Jonathan Cammisuli b06007954e fix(core): make 'key' parameter optional in register command (#30365)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Calling `nx register` requires users to enter a key.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Calling `nx register` should work without having users enter a key.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-13 19:12:18 +00:00
Craigory Coppola fe49308c78 feat(core): provide default value for max cache size (#30351)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
The max cache size is disabled by default

## Expected Behavior
Max cache size is set to 10% of the current disk by default, and can be
disabled by specifying 0. Information about this shows up in `nx
report`.

<img width="331" alt="image"
src="https://github.com/user-attachments/assets/ee937101-9915-49d1-b3f1-c2f0d929c140"
/>


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-13 19:07:26 +00:00
Jason Jean cc9e993e88 fix(core): only add keep existing versions if init generator supports it (#30352)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Nx plugins which do not support `keepExistingPackages` fail to
initialize via `nx init` or `nx add`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Nx plugins which do not support `keepExistingPackages` initializes
properly via `nx init` and `nx add`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-13 13:38:53 -04:00
Jonathan Cammisuli 77c1dda9e8 feat(core): add nx register (#30321) 2025-03-13 09:10:46 -04:00
Mike Hartington 6770636bae fix(angular): directory type is not optional (#30354)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The `directory` option for the ngrx feature store generator is currently
marked as optional. With that, if you try to run the generator and do
not pass a directory, it will throw an error.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`directory` needs to be a required option. The Nx Console already
handles this by pre-populating the option, this just adjusts things
appropriately for those not using the console, or calling the generator
programatically.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-13 12:20:01 +00:00
Colum Ferry 598f4bc52e chore(angular): skip failing vitest test (#30361)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-13 11:53:38 +00:00
Max Kless 4e61793371 docs(misc): mention new AI features & more on Nx Console getting started page 2025-03-13 08:37:18 +01:00
Leosvel Pérez Espinosa 7f1e1cfa78 feat(rspack): infer ts-node compiler options in rspack task env when using a typescript config file (#30345)
Infer the relevant ts-node compiler options to support an Rspack config
file using TypeScript as per https://rspack.dev/config/#using-ts-node.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-12 14:30:11 +00:00
Benjamin Cabanes af1b16a6ca docs(nx-dev): add march 19th webinar notifier (#30344)
Added the `WebinarNotifier` component and updated the date, description,
and link to reflect the March 19th webinar.
2025-03-12 09:52:56 -04:00
Craigory Coppola e4f5224e9e feat(core): add maxCacheSize option to limit local artifact size (#29654)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Cache artifacts are removed based on age at a random interval. There is
not a way to set a max size for the cache, so it can grow quite large in
certain repos

## Expected Behavior
Cache size can be controlled via `maxCacheSize` in `nx.json`. Cache
artifacts are removed based on usage until the limit has been reached.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2025-03-11 18:41:29 -04:00
Louie Weng c57932ef66 docs(nx-cloud): update assignment rules pages with new model (#30077)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2025-03-11 10:50:34 -07:00
Leosvel Pérez Espinosa cbf80c18d1 feat(misc): add useProjectJson flag to project generators (#30319)
Add a `useProjectJson` option to project generators to allow users to
opt in/out of generating the Nx configuration in a `project.json` file.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-11 12:12:03 -04:00
Leosvel Pérez Espinosa 432a645d21 fix(core): handle package manager workspaces configuration in move generator (#30268)
## Current Behavior

Moving a project included in the package manager workspaces setup to a
new destination that's not matched by that configuration results in the
project not included in the package manager workspaces setup.

## Expected Behavior

Moving a project included in the package manager workspaces setup to a
new destination that's not matched by that configuration should result
in the new destination included in the workspaces setup.

## Related Issue(s)

Fixes #
2025-03-11 14:05:30 +01:00
alisson d1a7ac96ce docs(angular): fix typo in dynamic mfe section (#30311)
The documentation currently states:  
> "Add a `module-federation.manifest.json` file to the `src/public/`
folder in our Dashboard application..."

However, the correct location for the file is `public/` and **not**
`src/public/`. This could lead to confusion when implementing the
example, as the folder structure may differ.

So I fixed it to public/

This issue was reported here: [Issue
#30020](https://github.com/nrwl/nx/issues/30020).
2025-03-10 17:44:43 +00:00
MaxKless 6c43fb8966 fix(graph): fix target details header tooltips in collapsed state (#30287) 2025-03-10 17:40:46 +01:00
Philip Fulcher 02e29ac4ed docs(nx-dev): add 20.5 release post (#30310) 2025-03-10 10:30:35 -06:00
Louie Weng a95a60cfe5 chore(repo): use parallelism on assignment rules (#30196)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Currently we set the parallelism at the DTE level and it applies to all
tasks executed for that DTE.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

We can set parallelism on our assignment rules and dynamically set the
parallelism of tasks as they are being scheduled.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-07 15:11:55 -05:00
Juri e7bcbe95d5 docs(nx-dev): link video course in blog post 2025-03-07 17:13:49 +01:00
Juri 8fa50e7f0d docs(core): add MCP video link to enhance AI docs 2025-03-07 17:13:35 +01:00
Rares Matei 4eb3267100 docs(nx-cloud): update release notes (#30293)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-07 11:42:51 +00:00
Jason Jean 4f3118d5f8 chore(repo): update nx to 20.5.0-rc.4 (#30296)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `20.5.0-rc.3`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `20.5.0-rc.4`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-06 21:13:05 +00:00
Isaac Mann 15c67cf45f docs(core): ai webinar (#30297)
- Adds the march webinar
- Adds an `eventDate` frontmatter property for webinars
- Orders webinars by publish date in the `/blog` list (not event date)
- Adds a CTA to the Cursor blog post that points to the March webinar
2025-03-06 15:55:53 -05:00
Jonathan Cammisuli 442058a27b Revert "feat(core): add activate key (#30250)" (#30295) 2025-03-06 18:47:23 +00:00
pmariglia 2057df57ed docs(nx-dev): Update ARM resource classes (#30294)
Updates nx.dev docs for ARM resource classes
2025-03-06 13:16:05 -05:00
Juri 7ed00c0dc9 docs(nx-dev): cursor integration article 2025-03-06 18:52:26 +01:00
MaxKless ebac21df16 docs(misc): add info & installation instructions for new MCP (#30205) 2025-03-06 17:47:10 +01:00
Benjamin Cabanes 0ca030f9d4 docs(nx-dev): update teams section (#30290)
Revised the job title for Joe Johnson to accurately reflect his new role
as VP of Customer Success.
2025-03-06 15:25:04 +00:00
Craigory Coppola 883476e7e3 chore(repo): bump nx to 20.5.0-rc.3 (#30282)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-06 15:14:45 +00:00
Leosvel Pérez Espinosa 2d872a34ee cleanup(node): fix outdated e2e test expectation (#30285)
Update an e2e test expectation that got outdated after two different
changes were merged.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-06 10:07:22 +00:00
Leosvel Pérez Espinosa ada8be473d fix(misc): fix misc issues in project generators for the ts solution setup (#30111)
The following are the main changes in the context of the TS solution
setup:

- Ensure `name` in `package.json` files is set to the import path for
all projects
- Set `nx.name` in `package.json` files when the user provides a name
different than the package name (import path)
- Clean up project generators so they don't set the `nx` property in
`package.json` files unless strictly needed
- Fix `@nx/vue:application` generator so it creates the Nx config in a
`package.json` file for e2e projects
- Ensure `@types/node` is installed in `vitest` generator
- Fix generated Vite config typing error (surfaced with Vite 6)
- Ensure `jsonc-eslint-parser` is installed when the
`@nx/dependency-checks` rule is added to the ESLint config
- Misc minor alignment changes

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-05 20:08:10 -05:00
Jason Jean 121d9973a8 fix(core): run init generators from extended collections during nx add (#30280)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When the `init` generator is in an extended collection, `nx add` will
not run it.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When the `init` generator is in an extended collection, `nx add` will
run it.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-05 18:32:44 -05:00
Jonathan Cammisuli 5b034965d8 feat(core): add activate key (#30250)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-03-05 16:23:49 -05:00
Nicholas Cunningham 7da48d6471 fix(bundling): fix esbuild to work with ts project references (#30230)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
If we are using `esbuild` as our bundler and ts project references
(`--workspaces`) local libraries are not building are not resolved in
the build artifacts.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When using ts project references with esbuild all types libraries
(buildable / non-buildable) should work out of the box.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-05 13:49:00 -07:00
Nicholas Cunningham 1c323131f8 fix(nextjs): enhance glob pattern (#30260) 2025-03-05 14:13:23 -05:00
Colum Ferry 648129fc48 fix(bundling): remove migration always adding sass-embedded (#30276)
## Current Behavior
There is a migration that always adds `sass-embedded` for Rspack and
Webpack for 20.5

## Expected Behavior
`sass-embedded` is already a dependency of Rspack and Webpack and
therefore does not need to be added to users package.json - especially
as they may not be using it.
2025-03-05 14:12:33 -05:00
Nicholas Cunningham 7ba707e7b3 docs(linter): add support for esm in eslint api docs (#30277) 2025-03-05 11:46:26 -07:00
Benjamin Cabanes 00e970a0bb docs(nx-dev): update team members (#30272)
Updated titles for existing team members to reflect current roles. Added
new team members, Nate Bohn and Steven Nance, along with their
corresponding images.
2025-03-05 09:59:43 -05:00
Leosvel Pérez Espinosa e4f7e56e3c fix(core): handle nx config in package.json in move generator (#30270)
## Current Behavior

When the Nx configuration is in `package.json#nx` and not in
`project.json`, the move generator creates a `project.json` file in the
new destination.

## Expected Behavior

When the Nx configuration is in `package.json#nx` and not in
`project.json`, the move generator should not create a `project.json`
file in the new destination and should update the `nx` entry in the
`package.json` file.

## Related Issue(s)

Fixes #
2025-03-05 14:01:21 +00:00
Emily Xiong e8acab6ae0 feat(vue): add release option to vue publishable libraries (#29867) 2025-03-05 14:29:07 +04:00
Craigory Coppola 2c0b5d3c8e fix(core): annotate daemon logs w/ nx version (#30262)
## Current Behavior
Daemon log is annotated by time only

## Expected Behavior
Daemon log is annotated by time and nx version

```
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.417Z - Started listening on: /tmp/c31c3bdb2db26a7fdd62/d.sock
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.419Z - [WATCHER]: Subscribed to changes within: /tmp/testing/test-daemon-shutdown (native)
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.421Z - Established a connection. Number of open connections: 1
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.423Z - Closed a connection. Number of open connections: 0
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.694Z - Time taken for 'Load Nx Plugin: /tmp/testing/test-daemon-shutdown/node_modules/nx/src/plugins/project-json/build-nodes/project-json' 172.34599799999998ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.704Z - Time taken for 'Load Nx Plugin: /tmp/testing/test-daemon-shutdown/node_modules/nx/src/plugins/package-json' 182.822698ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.710Z - Time taken for 'loadDefaultNxPlugins' 189.074698ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.747Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.747Z - [REQUEST]: 
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.747Z - [REQUEST]: 
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.751Z - Time taken for 'loadSpecifiedNxPlugins' 226.801397ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.931Z - Time taken for 'build-project-configs' 171.525398ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.932Z - Time taken for '@nx/js/typescript:createDependencies' 1.57650000000001ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.956Z - [SYNC]: collect registered sync generators
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:40.957Z - Time taken for 'total execution time for createProjectGraph()' 25.567300000000046ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:45.422Z - [WATCHER]: Stopping the watcher for /tmp/testing/test-daemon-shutdown (sources)
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:45.422Z - [WATCHER]: Stopping the watcher for /tmp/testing/test-daemon-shutdown (outputs)
[NX v20.5.0 Daemon Server] - 2025-03-04T21:07:45.424Z - Server stopped because: "5000ms of inactivity"
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.567Z - Started listening on: /tmp/c31c3bdb2db26a7fdd62/d.sock
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.570Z - [WATCHER]: Subscribed to changes within: /tmp/testing/test-daemon-shutdown (native)
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.574Z - Established a connection. Number of open connections: 1
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.575Z - Closed a connection. Number of open connections: 0
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.824Z - Time taken for 'Load Nx Plugin: /tmp/testing/test-daemon-shutdown/node_modules/nx/src/plugins/js' 151.981699ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.838Z - Time taken for 'Load Nx Plugin: /tmp/testing/test-daemon-shutdown/node_modules/nx/src/plugins/project-json/build-nodes/project-json' 165.931999ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.839Z - Time taken for 'loadDefaultNxPlugins' 167.35379900000004ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.856Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.856Z - [REQUEST]: 
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.856Z - [REQUEST]: 
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.864Z - Time taken for 'loadSpecifiedNxPlugins' 184.725799ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.879Z - Time taken for 'build-project-configs' 9.32310000000001ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.880Z - Time taken for '@nx/js/typescript:createDependencies' 1.6195999999999913ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.886Z - [SYNC]: collect registered sync generators
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:04.886Z - Time taken for 'total execution time for createProjectGraph()' 9.240700000000004ms
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:09.575Z - [WATCHER]: Stopping the watcher for /tmp/testing/test-daemon-shutdown (sources)
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:09.575Z - [WATCHER]: Stopping the watcher for /tmp/testing/test-daemon-shutdown (outputs)
[NX v20.5.0 Daemon Server] - 2025-03-04T21:08:09.577Z - Server stopped because: "5000ms of inactivity"
```

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-04 18:26:03 -05:00
Caleb Ukle 30b5043a4c docs(nx-dev): consistency updates for team members (#30265)
correct capitalization of names and full titles
2025-03-04 22:57:19 +00:00
Emily Xiong 04cf098d59 fix(core): change graph node type and name to string (#29610)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-03-04 16:41:11 -05:00
Juri 437bad4aac docs(misc): add description frontmatter for better SEO 2025-03-04 16:58:14 +01:00
Juri d428eec060 feat(nx-dev): update workspace conformance rule to check md files in general 2025-03-04 16:58:14 +01:00
Isaac Mann c698b1ef9c docs(core): maintain ts monorepos feature (#30256)
Adds the Maintain TypeScript Monorepos feature page
2025-03-04 10:06:24 -05:00
Nicholas Cunningham 8e6c00719b fix(vite): correct mapping for reportsDirectory when using executors (#30232)
Using vitest whenever we merge configs from executors and the config
file. The executors should override the option which has be set inside
of the config file.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The `reportsDirectory` option which can be set when using
`@nx/vite:test` is not override the generated coverage directory path.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When the `@nx/vite:test` executor runs the option `reportsDirectory`
should override the option set inside `vite.config`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30223
2025-03-03 19:01:45 -07:00
Benjamin Cabanes 6678c74f24 docs(nx-dev): add Jordan to the team section (#30249)
Adds Jordan Powell as a Senior Engineer in the team list.
2025-03-03 15:22:14 +00:00
Craigory Coppola bf10eae48e fix(angular): correct nx angular migration requirement for 19.2 (#30234)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Angular migrations require @angular/core@19.2.0, to update to 19.2.0

## Expected Behavior
Angular migrations require @angular/core@19.1.0 to update to 19.2.0

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2025-03-03 10:16:26 -05:00
Leosvel Pérez Espinosa 61ff25fc08 feat(angular): update angular eslint packages (#30245)
Update Angular ESLint packages to 19.2.0.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-03 09:23:47 -05:00
Leosvel Pérez Espinosa 1407152b70 feat(js): add typecheck task to generated ci workflow file when using the ts solution setup (#30219)
## Current Behavior

When generating a CI workflow (via creating a new workspace or invoking
the `ci-workflow` generator directly) in a workspace using the TS
solution setup, the `typecheck` task is not present in the affected
command that is generated in the CI workflow file.

## Expected Behavior

When generating a CI workflow in a workspace using the TS solution
setup, the `typecheck` task should be present in the affected command
that is generated in the CI workflow file.

## Related Issue(s)

Fixes #
2025-02-28 18:19:51 -05:00
Nicholas Cunningham 2b98830b3a docs(core): remove include command from nx-graph (#30233)
When we run `nx graph --help` we see that the `--include` commands is
not available.
So the docs should also reflect the current options.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30212
2025-02-28 18:18:11 -05:00
Jason Jean 04bd26f6c0 chore(repo): update nx to 20.5.0-rc.0 (#30210)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `20.5.0-beta.2`. 

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `20.5.0-rc.0`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-28 17:05:32 -05:00
Emily Xiong e57df6f6be fix(react-native): change build target to be crystalized (#30151)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-28 16:20:05 -05:00
Leosvel Pérez Espinosa a5d20030db fix(js): update outDir in runtime tsconfig files to match types export in package.json (#30217)
## Current Behavior

In the TS solution setup, several project generators produce the runtime
tsconfig files (e.g. `tsconfig.lib.json`) with the `outDir` set to
`out-tsc/<project name>`. This causes issues with the inferred
`typecheck` task because the project `package.json` has the `types`
export pointing to `dist/...`, which wouldn't be produced by
`typecheck`.

## Expected Behavior

In the TS solution setup, project generators should produce the runtime
tsconfig files (e.g. `tsconfig.lib.json`) with the `outDir` set to a
path (`dist`) that matches the value in the project `package.json`'s
`types` export.

## Related Issue(s)

Fixes #
2025-02-28 16:10:58 -05:00
Jack Hsu b992e2586b fix(js): do not add typecheck target if tsc is used for build (#30211)
This PR adds support for skipping `typecheck` targets when using
`@nx/js/typescript`. Inside `tsconfig.json` for each project, you can
set `nx.addTypecheckTarget` to `false` to not infer `typecheck`.

This allows use to skip `typecheck` for JS projects using `tsc` to
build. Since `tsc` is already used during build, we don't need to run
`typecheck` that is just duplicated work.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
JS libs using `tsc` to build will do typechecking twice. Once during
`build` and once during `typecheck`.

## Expected Behavior
JS libs using `tsc` do not infer `typecheck` by default. And users can
change this behavior by setting `nx.addTypecheckTarget` in
`tsconfig.json`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-02-28 16:08:45 -05:00
Rares Matei bd78ac25b8 docs(nx-cloud): parallel steps (#30218)
Updates the custom launch template docs with info on:
- step groups and parallel steps
- using yaml anchors to extract repetitive config blocks
2025-02-28 19:09:29 +00:00
Jonathan Cammisuli d2a9cbc97d feat(core): display perpetual version information in nx report for powerpack (#30110)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
No information on Powerpack perpetual Nx versions is displayed

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Perpetual Nx versions is displayed when running `nx report`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-02-28 13:59:26 -05:00
Samy M. 977e72b68c docs(nx-dev): update version of supported versions (#30046) (#30231)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
The documentation currently states that `v16` is still supported, while
the correct version is `v17`.

## Expected Behavior
After this update, the documentation will correctly display `v17` as the
supported version instead of `v16`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30046 (if applicable).
2025-02-28 11:45:01 -07:00
Craigory Coppola 5382c8af65 fix(core): ensure daemon enabled check is unchanged (#30228) 2025-02-28 17:13:19 +00:00
Isaac Mann 2986a02dc9 docs(core): update webinar status based on date (#30227)
Treats the webinar date as more important than the webinar status. So an
"upcoming" webinar that has a date in the past will not display as
upcoming.
2025-02-28 15:53:34 +00:00
Leosvel Pérez Espinosa 914b1cc1db fix(js): handle plugin correctly for non-buildable libs and don't add duplicated pattern to workspaces config (#30209)
## Current Behavior

- Generating a non-buildable library in a workspace using the TS
solution setup where a plugin registration for `@nx/js/typescript`
already exists and doesn't configure a build target, results in that
plugin registration being updated excluding the new project and a new
registration being added including the project but inferring the build
target.
- Generating a library in a sub-directory that matches a pattern in the
package manager workspaces configuration, results in a more specific
pattern being added to the workspace configuration.

## Expected Behavior

- Generating a non-buildable library in a workspace using the TS
solution setup where a plugin registration for `@nx/js/typescript`
already exists and doesn't configure a build target, should not modify
that plugin registration and it should not add an extra one.
- Generating a library in a sub-directory that matches a pattern in the
package manager workspaces configuration, should not add a more specific
pattern.

## Related Issue(s)

Fixes #
2025-02-28 14:41:46 +01:00
Juri Strumpflohner 651f16cdb9 chore(repo): ignore .cursor config files (#30215)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Make sure Cursor specific files are not git indexed as MCP servers might
be custom. If we ever continue adding cursorfiles etc that are shared
for the repo we can have a more fine-grained ignoring.


![image](https://github.com/user-attachments/assets/30343b8e-48bc-4d12-b71b-f7c911f7808d)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-28 08:26:35 -05:00
Leosvel Pérez Espinosa 9faafe5d7d fix(js): normalize paths correctly in @nx/js/typescript plugin (#30216)
## Current Behavior

The tsconfig files cache contains invalid relative paths when run on
Windows.

Failure logs (Windows):
https://github.com/nrwl/nx-console/actions/runs/13573129754/job/37942898562?pr=2415#step:11:29

## Expected Behavior

The tsconfig files cache should contain valid Unix-based paths.

Success logs (Windows):
https://github.com/nrwl/nx-console/actions/runs/13586015039/job/37981054104#step:11:49
(the job failed but due to a separate thing, note the project graph was
computed correctly)

## Related Issue(s)

Fixes #
2025-02-28 12:49:41 +01:00
Colum Ferry 30f5a52d96 fix(vite): copy assets plugin not copying files in watch mode #30141 (#30208)
## Current Behavior
Copy assets plugin for Vite is not copying files in watch mode when
those files are changed.

This is due to the path being incorrect after calculation.
There is also no indication to the user that the copy completed at all.

## Expected Behavior
Fix path calculation to allow copy to occur correctly

Output the relative dest of the file after copy completed.

## Related Issue(s)

Fixes #30141
2025-02-28 11:07:34 +00:00
Jack Hsu e8647df08a fix(storybook): fix package.json updates so @storybook packages are in sync during migration (#30191)
This PR is the same as https://github.com/nrwl/nx/pull/30187 but for
`@storybook` packages. We want to make sure that workspaces that have
other `@storybook/*` packages installed have their versions updated
along with the packages we use. Otherwise version mismatches can lead to
errors due to changing APIs.

This PR also adds a conformance rule that prevents mistakes from going
out in future migrations.
2025-02-27 16:50:32 -05:00
Isaac Mann 8b11d8bfe5 docs(core): add migrations docs for 20.x (#30186)
Adds migration docs for all 20.0 through 20.4 migrations
2025-02-27 15:58:41 -05:00
Colum Ferry 6fcb310e54 fix(vite): environments api support in executor (#30183)
## Current Behavior
`@nx/vite:build` executor does not support Vite 6 Environments API

## Expected Behavior
`@nx/vite:build` executor builds all environments when Vite 6 is
detected
2025-02-27 17:02:19 +00:00
Benjamin Cabanes 320709f66f docs(nx-dev): disable WebinarNotifier & remove live event link
Commented out the `WebinarNotifier` component and the live event link section, likely for deprecation or temporary removal.
2025-02-27 18:01:46 +01:00
Colum Ferry a58b7aba8a fix(vite): ensure paths with explicit extensions are resolved #29948 (#30202)
## Current Behavior
When TS Path Mappings are combined with an explicit extension of the
build outcome of a file, the `nxViteTsPaths` plugin cannot resolve the
file.

e.g.

```ts

import {something} from '@mylib/file.js';


// tsconfig paths

"@mylib/*": ["mylib/src/*"]
```

In this case, we fallback to the file system to try find the file, and
we do it by adding extensions to the end of the path.

e.g.

```ts
@mylib/file.js.js
@mylib/file.js.ts
@mylib/file.js.mts
etc
```

## Expected Behavior
Perform the usual logic first to try find the file in the file system.

If the file is still not resolved AND the path ends with an `extname`
that we support in `options.extensions`, strip the extension from the
path and try append the different extensions again and resolve against
the filesystem.

This allows for the case where someone has a file in their file system
that _is_ `file.js.js` to be resolve via `@mylib/file.js` as well as
when the explicit path is provided.


## Related Issues

Fixes #29948
2025-02-27 16:27:20 +00:00
Colum Ferry 4fe4fe95fa fix(vite): allow force ignore of logs from nxViteTsPaths plugin #29320 (#30200)
## Current Behavior
When Vite build is run where:
- `nxViteTsPaths` plugin is enabled
- `--verbose` or `NX_VERBOSE_LOGGING=true` is set

The resulting logs can be quite noisy.

## Expected Behavior
When `debug` is explicitly set to false, ignore logs even when
`--verbose` is passed.

Usage:

```ts
nxViteTsPaths({ debug: false })
```

## Related Issue(s)

Fixes #29320

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-02-27 14:53:57 +00:00
Leosvel Pérez Espinosa 7a73e8a006 fix(linter): restore package update group for @typescript-eslint/eslint-plugin requirement (#30204)
Restores a package update group with a `requires` entry to handle
workspaces using `@typescript-eslint/eslint-plugin` and not
`typescript-eslint`.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-02-27 09:48:56 -05:00
Leosvel Pérez Espinosa 811bac5cf7 feat(angular): support angular 19.2.0 (#30088)
Add support for Angular 19.2.0.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-02-27 08:55:45 -05:00
Nicholas Cunningham 6d40b6a6ca fix(nextjs): add setup generator for Tailwind CSS fixes absolute pathing (#30192)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When we generate a Next.js application with tailwindcss running with
`--turbo` fails due to how the globs are defined inside
`tailwind.config.js`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Relative paths a singular globs are required with this change tailwind
should work with HMR using `--turbo`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29946
2025-02-26 14:55:09 -07:00
Jack Hsu 321a63aac3 feat(nx-dev): allow sampling rate to be configured through env var (#30193)
The current sample rate for Grafana Faro is the default 100% and is
currently around $200 for the month. We want to be able to make changes
to it without needing code changes. Once this PR is merged, we can just
update the env var, and then redeploy.
2025-02-26 15:46:35 -05:00
Nicholas Cunningham 0ae4925e43 fix(nextjs): add support for @testing-library/dom in application and library generators (#30189)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
After creating a new Next.js application and running the spec file it
fails OOTB.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Running the spec file after creating a new Next.js application should
work.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-26 14:23:50 -05:00
Jack Hsu 09ebf5f2da fix(eslint): ensure that packages in the same group as updated together (#30187)
This PR updates `migrations.json` for `@nx/eslint` and `@nx/angular` so
that `@typescript-eslint/*` and `@angular-eslint/*` packages that are
installed in the workspaces are updated to the same version.

I've updated it for v20 and v19, but if we need to go back further we
could. This will also require patch versions for each major that we want
to fix.

**Note:** Previously there were two entries for `@nx/esilnt@20.4.0` that
handles cases where one of `typescript-eslint` or
`@typescript-eslint/eslint-plugin` are > 8. The packages in both entries
overlap, so I collapsed them down to one entry that checks
`typescript-eslint > 8`.

## Current Behavior
If user has `@typescript-eslint/rule-tester` or
`@angular-eslint/test-utils` installed, our migrations do not update
these versions. This makes them out of sync with
`@typescript-eslint/utils`, etc. which can lead to problems.

## Expected Behavior
Packages in the same `@typescript-eslint/*` and `@angular-eslint/*` are
updated together. If they are not installed, we don't add them to the
workspace.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-26 14:07:03 -05:00
Nicholas Cunningham f156ea932d fix(core): standardize useGitHub param (#30173)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, when `--useGitHub` is passed the option is ignored so the
user is asked if they would like to use GitHub.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
With this change if the `--useGitHub` flag is passed it will be
respected.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29722
2025-02-26 11:32:12 -05:00
Philip Fulcher 7de6a7b0d7 docs(misc): update Custom DTE to Manual DTE (#30180)
## Current Behavior
* Using your own CI provider to distribute tasks is referred to in
multiple ways
* DTE configuration is beneath the Enterprise section of CI docs

## Expected Behavior
* Using your own CI provider to distribute tasks is referred to
consistently as "Manual DTE"
* DTE configuration is its own recipes section
 
## Related Issue(s)

---------

Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2025-02-26 09:16:55 -07:00
Tristan Zander 1738d79ca5 fix(release): properly terminate case in switch statement (#30114) 2025-02-26 13:28:51 +04:00
Steven Nance 44e7b41c4f docs(release): document __INVALID__ conventional commit type (#30124) 2025-02-26 13:24:59 +04:00
Jack Hsu 202b49bdbe fix(core): re-enable CRA migration to Vite (#30082)
This PR brings back the CRA migration that was missing since Nx 18.

## Current Behavior
<!-- This is the behavior we have today -->
`nx init` does not migrate CRA apps 

## Expected Behavior
`nx init` migrates CRA apps to Vite since CRA is deprecated

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-25 14:08:13 -05:00
Colum Ferry 32341d5efc fix(module-federation): handle parsing static remote config correctly (#30168)
## Current Behavior
When the dist for a project lives in the projectRoot, the
`parseStaticRemotesConfig` util function for executors is not correctly
handling the outputPath and urlSegment

## Expected Behavior
Ensure that the parsed config is correct regardless of whether the dist
is in the projectRoot or not

## Related Issue(s)

Fixes #30138
2025-02-25 15:18:58 +00:00
Colum Ferry 9cbd476193 fix(esbuild): update peerDep range (#30167)
## Current Behavior
`esbuild` has a security advisory for versions up to 0.24. 
If users attempted to install a version greater than 0.19, they would
face peer dep issues with the `@nx/esbuild` package.


## Expected Behavior
Expand the peerDep range for `esbuild` on the `@nx/esbuild` package to
allow users to upgrade.
Keep the base version at a lower version to support older OS and VMs
which are unsupported by newer versions of `esbuild`.

Closes #30009
2025-02-25 13:54:36 +00:00
James Garbutt c35862d4b8 cleanup(js): switch to picomatch (#30079) 2025-02-25 16:26:33 +04:00
Kevin Hallmark c02719d2df feat(module-federation): Update to the latest version of @module-federation (#30147) 2025-02-25 15:49:19 +04:00
MisterPandaPooh 4fc52cf836 fix(js): use absolute filetorun path (#30091)
Fix a bug introduced in #30087

#### Current Behavior
The `@nx/js` plugins throw an error when the project is served in the
project root but not in the workspace root.

#### Expected Behavior
Ensure that `nx run $project:serve` works correctly both in the
workspace root and the project root, restoring the previous behavior.

#### Related Issue(s)
Fixes #30087
2025-02-25 11:44:51 +00:00
Petr Plenkov 2fc1945615 fix(bundling): use projectRoot for assets (#29978)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior

When bundling rollup copies wrong readme which ends up in publishing a
root monorepo readme, not a package one

## Expected Behavior

It shoud take the right Readme.md

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29975
2025-02-25 10:41:42 +00:00
Petr Plenkov 63cb68d1b6 feat(bundling): support rollup.config.ts (#29983)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Error when using rollup.config.ts
```
NX   Failed to process project graph.

2 errors occurred while processing files for the @nx/rollup/plugin plugin.
  - packages/codygen/rollup.config.cts: Unknown file extension ".cts" for /workspaces/codygen/packages/codygen/rollup.config.cts
  - sample3/rollup.config.ts: Unknown file extension ".ts" for /workspaces/codygen/sample3/rollup.config.ts 
```


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Plugin should be able to load rollup.config.ts

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29982
2025-02-25 10:39:19 +00:00
Gustavo Perdomo b063fcd3b1 fix(nest): fix library generator (#30157)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Nest library generator fails because `readProjectConfiguration` is not
returning targets property:
```
 NX  Generating @nx/nest:library


 NX   Cannot set properties of undefined (setting 'build')

Pass --verbose to see the stacktrace.


 *  The terminal process "/bin/zsh '-l', '-c', 'npx nx generate @nx/nest:library --directory=packages/backend/feature-typeahead --buildable=true --linter=eslint --unitTestRunner=jest --controller=true --importPath=@listing-experience/feature-typeahead --name=feature-typeahead --service=true --tags=type:lib,scope:nest --no-interactive --dry-run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 
 ```

## Expected Behavior
The library should be generated without issues
2025-02-25 09:54:41 +00:00
Isaac Mann cd361ef0ef docs(core): react tutorial with workspaces (#30149)
Updates the react monorepo tutorial to use `--workspaces`
Small updates to the angular monorepo tutorial
2025-02-24 14:10:48 -05:00
Colum Ferry 82169ace03 feat(webpack): use sass-embedded and modern-compiler for sass (#29999)
## Current Behavior
Webpack and Rspack currently use `sass` and its Legacy API with
`sass-loader`.
There is also no method to pass stylePreprocessorOptions other than
`includePaths` to the loaders.


## Expected Behavior
Switch to using `modern-compiler` api to remove deprecation warnings and
improve build performance.
Allow users to choose between `sass` and `sass-embedded` for sass
compiler implementation.

Expand the `stylePreprocesserOptions` interface to accept
`includePaths`, `sassOptions` and `lessOptions` that will be passed to
the appropriate loader.
2025-02-24 12:44:19 -05:00
Denis Akiyakov 75a69d93d0 fix(core): improve packages recognition when the package version is an external package (#29529)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
After updating from nx@20.0.12 to nx@20.3.0 our docusaurus dep starts
blocking us from running any nx command because of the error described
in the linked issue

```bash
The "nx/js/dependencies-and-lockfile" plugin threw an error while creating dependencies: Target project does not exist: npm:react-helmet-async@npm:@slorber/react-helmet-async@*
```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Packages with such deps, like: `"react-helmet-async":
"npm:@slorber/react-helmet-async@*"` shouldn't break any nx command

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->


Fixes #27285
2025-02-24 15:13:14 +00:00
Philip Fulcher 4367352a0a docs(nx-dev): add updated graphql article (#30116) 2025-02-21 10:00:04 -07:00
Jack Hsu 5bfcc77b74 fix(core): task runner should match on full segments (e.g. foo does not match foo-e2e) (#30129)
This PR fixes project matching such that the name must match on `-` as
well. For example, given two projects with the following names:

- `@acme/foo`
- `@acme/foo-e2e`

Running `nx serve foo` shoud match `@acme/foo`. Currently it will error
out because it matches both projects.

## Current Behavior
Project names can partially match, so `foo` matches `@acme/foo-e2e`.

## Expected Behavior
Project names must match the segment fully, including `-`, so `foo` does
not match `@acme/foo-e2e`, but `foo-e2e` does.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-21 09:55:58 -05:00
Jason Jean b9221bfe5d fix(core): fix typescript dependency calculation (#30131) 2025-02-20 17:29:36 -05:00
Colum Ferry 251959c6b0 feat(rspack): use ts-checker-rspack-plugin instead of fork-ts-checker-webpack-plugin (#30121)
## Current Behavior
Our Rspack support currently leverages `fork-ts-checker-webpack-plugin`
to handle typechecking during build.

## Expected Behavior
Switch to using `ts-checker-rspack-plugin` for better memory management
and typecheck support.
2025-02-20 15:54:18 -05:00
Colum Ferry e643899a57 fix(module-federation): handle remote output paths (#30119)
## Current Behavior
`parseRemotesConfig` is naively handling detection of remote output
paths needed for standing up the single file server.


## Expected Behavior
Provide better detection of remote output paths that covers inference
and executor usage with fallback behaviour
2025-02-20 15:54:01 -05:00
Colum Ferry 46e5dcefb0 fix(js): use uuid when generating tmp tsconfig (#30118)
## Current Behavior
When multiple processes/tasks are running in parallel for a single
project that produce tmp tsconfig files for buildable libraries, they
can clobber each other.
 

## Expected Behavior
Ensure the config file is generated with a unique id to prevent
clobbering
2025-02-20 15:53:44 -05:00
Isaac Mann a90de969ab docs(core): remove standalone tutorials (#30125)
Remove standalone tutorials
2025-02-20 15:47:04 -05:00
Miroslav Jonaš 639d748b70 chore(repo): remove outdated flags from ci pipeline (#30122)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-20 12:06:28 -05:00
James Henry 2a8200940a docs(core): bring dependency management docs up to date with reality (#30123) 2025-02-20 18:47:48 +04:00
Miroslav Jonaš a94bc7618a docs(nx-dev): update troubleshoot-cache-misses.md (#28292)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-20 12:18:02 +00:00
Rares Matei 320536b401 chore(repo): remove manual shell setup step (#30109) 2025-02-19 23:17:00 +04:00
MaxKless ecfc35ea2a feat(nx-dev): expose docs embedding search via endpoint (#30050) 2025-02-19 14:38:43 +01:00
Juri Strumpflohner 77c9e3abee fix(core): update custom task runner deprecation message (#30093)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

<img width="561" alt="image"
src="https://github.com/user-attachments/assets/b343bc83-6423-4924-8695-a621cf98be11"
/>


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-19 08:03:15 -05:00
Miroslav Jonaš 2a4984cf7c fix(repo): fix nightly reporting (#30104)
This PR fixes broken reporting on nightly caused by breaking changes in
the `upload-artifact` and `download-artifact` GH actions

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-19 13:28:34 +01:00
Emily Xiong 42e860d3ea feat(js): upgrade verdaccio to 6 (#30015) 2025-02-19 13:44:31 +04:00
James Henry 443d4fd27a feat(core): support bun's new text-based lockfile and use bun publish within nx release (#30064) 2025-02-19 13:42:35 +04:00
Emily Xiong 1047991200 fix(js): identify correct circular dependecies (#29759) 2025-02-19 13:13:08 +04:00
Jack Hsu 51a0bae574 fix(nx-dev): remove OTel-based tracing for now to remove local dev erros (#30096)
Locally, when running `nx serve-docs nx-dev`, you'll see errors coming
from `/blog` URLs due to instrumentation problems. This is caused by the
`@grafana/faro-web-tracing` packages as soon as it is imported in an app
router environment.

We don't need it for now, so we can just remove it. It means that we
will be missing tracing on HTTP requests like XHRs, but we still get
performance metrics and error reporting.

## Current Behavior
See errors in logs during development

## Expected Behavior
No errors in logs

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-18 14:06:48 -05:00
Craigory Coppola 3f90f7eea9 fix(core): NX_PLUGIN_NO_TIMEOUTS should also remove timeout on plugin worker connection (#30095) 2025-02-18 18:12:10 +00:00
Jonathan Cammisuli 6e789f547f chore(repo): update powerpack version (#30032) 2025-02-18 20:45:05 +04:00
James Henry e82b811fe1 fix(core): make hash_array resilient to None values (#30090) 2025-02-18 15:54:45 +00:00
Emily Xiong 4f70cdb721 feat(angular): add release option to angular publishable libraries (#29869) 2025-02-18 19:54:35 +04:00
Louie Weng 377f5f6dfc docs(nx-cloud): ensure nx cloud statuses are not enforced on github (#30080)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Since statuses are generated dynamically based off of commands executed,
enforcing old statuses on Github will result in a "Waiting for status"
message which can block in progress PRs. The recommendation is then to
only enforce status checks on the default branch and not enforce any Nx
Cloud related status checks.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-18 07:32:26 -08:00
Leosvel Pérez Espinosa f6404f57be fix(devkit): handle missing include and exclude in tsconfig options when updating tsconfig to support js (#30073)
## Current Behavior

The `updateTsConfigsToJs` helper from `@nx/devkit` doesn't handle
tsconfig files without the `include` or `exclude` properties.

## Expected Behavior

The `updateTsConfigsToJs` helper from `@nx/devkit` should handle
tsconfig files without the `include` or `exclude` properties.

## Related Issue(s)

Fixes #30067
2025-02-18 12:42:30 +01:00
Leosvel Pérez Espinosa 96c775b4cf fix(js): invalidate tsconfig files cache in the @nx/js/typescript plugin when extended files change (#30071)
## Current Behavior

- The persistent tsconfig files cache used by the `@nx/js/typescript`
plugin does not get invalidated when the tsconfig files it extends from
are updated.
- Absolute paths are stored in the cache, which would be incorrect when
distributing the cache.
- The plugin throws a cryptic error when the lock file doesn't exist.

## Expected Behavior

- The persistent tsconfig files cache used by the `@nx/js/typescript`
plugin should get invalidated when the tsconfig files it extends from
are updated.
- Paths should be stored relative to the workspace root.
- The plugin should handle when the lock file is missing.

Additionally, a few other performance improvements were made to offset
the overhead introduced by creating a stricter cache key:

- cache and reuse file reads between tsconfig reads and file hashing
(now each file is only read once, if read at all)
- initialize a pre-populate tsconfig files cache in a first pass to skip
checking cache entries' key in subsequent reads
- reduce the tsconfig file cached content we store to disk
- cache the check for external project references

## Related Issue(s)

Fixes #29429
2025-02-18 12:34:59 +01:00
Leosvel Pérez Espinosa c78279990d fix(rspack): handle potentially missing lockfile in @nx/rspack/plugin plugin (#30086)
## Current Behavior

If the lock file is missing the `@nx/rspack/plugin` plugin throws a
cryptic error.

## Expected Behavior

The `@nx/rspack/plugin` should handle a missing lock file.

## Related Issue(s)

Fixes #
2025-02-18 12:30:43 +01:00
Ethan Koenig 9cdc1ccba4 fix(core): respect extends when reading tsconfig options (#30062)
Fix a bug introduced in https://github.com/nrwl/nx/pull/29774.

## Current Behavior

If a local plugin's `tsconfig.json` uses `extends`, the referenced base
config is not loaded.

## Expected Behavior

If a local plugin's `tsconfig.json` uses `extends`, the referenced base
config is loaded.

## Related Issue(s)

Fixes #30007

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-02-18 09:51:01 +00:00
Juri 3d63da2661 docs(nx-dev): link AI docs page from homepage 2025-02-17 19:49:37 +01:00
Juri 5887baf27f docs(core): adds feature for LLM enhancing 2025-02-17 17:41:21 +01:00
Juri 46cac5bd56 docs(nx-dev): article about monorepos being AI future-proof 2025-02-17 17:04:07 +01:00
Benjamin Cabanes 80e6ca1251 docs(nx-dev): update descriptions of nx (#30054)
Revised the description across documentation, metadata, and SEO content
to emphasize Nx's AI-powered architectural awareness alongside its
monorepo optimization and advanced CI capabilities.
2025-02-17 10:35:34 -05:00
Colum Ferry 090364ad39 feat(module-federation): add NxModuleFederationPlugin for inferred usage (#30003)
## Current Behaviour
Currently, Module Federation with Nx is forced to use executors to
provide the best DX.

## Expected Behaviour
As part of the transition to inferred targets, we will need Rspack
plugins that replicates the DX provided by our executors.
Add `NxModuleFederationPlugin` and `NxModuleFederationDevServerPlugin`
to handle this.
2025-02-17 15:21:36 +00:00
Jordan f659d2fd5e chore(misc): update .gitignore help link (#30051)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Currently when we generate a `.gitignore` file we include a help link to
http://help.github.com/ignore-files/ which is no longer a valid url.

## Expected Behavior
It should link to the new help link
https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29794
2025-02-17 09:52:57 -05:00
Denis Bendrikov af930c396d feat(testing): add type annotation for Jest configuration export (#30059) 2025-02-17 16:49:07 +04:00
Alejandro Forero d8345147ed fix(release): allow preid option in release command (#29264) 2025-02-17 15:17:15 +04:00
Juri Strumpflohner 804df721a7 docs(misc): update links on adopting Nx page from Turbo (#30060) 2025-02-15 21:18:12 +04:00
Emily Xiong fc39b3dc49 fix(react): add release option for @nx/react:lib --publishable (#29776) 2025-02-15 13:27:18 +04:00
Nicholas Cunningham 3152502629 feat(react): Update react-router-dom to latest (#29919)
Update `react-router-dom` and `remix` package versions to latest.
Currently, there should be no breaking changes from our generators.
2025-02-14 14:10:56 -07:00
James Henry 1257621031 docs(nx-dev): update migration guide (#30052) 2025-02-15 00:43:38 +04:00
Benjamin Cabanes 0006fbfc0b docs(nx-dev): update tag in hero subtitle (#30053)
Replaced an instance of `<strong>` with `<Strong>` to maintain
consistent tag usage across the component. It ensures readability and
uniformity in the codebase styling.
2025-02-14 14:35:24 -05:00
Austin Fahsl d36e4aa9ee docs(nx-dev): creating conformance rules docs adjustments (#30038) 2025-02-14 20:19:26 +04:00
James Henry 888957a010 fix(release): ensure tags for version match stable variant before prerelease (#30047) 2025-02-14 11:08:34 -05:00
Benjamin Cabanes 2413a4393c docs(nx-cloud): update home hero subtitle (#30049)
Revised the text to highlight the new AI-powered architectural awareness
and adjusted formatting for better readability on larger screens.
2025-02-14 10:49:17 -05:00
Colum Ferry 309a2a9228 fix(rspack): pin rspack 1.2.2 (#29997)
## Current Behavior
Rspack v1.2.3 was released with some issues around resolving and
transforming modules throwing errors at build time.

## Expected Behavior
Pin Rpsack to 1.2.2 until a solution for the above problem can be
resolved.
2025-02-14 08:04:11 -05:00
James Henry b10856bb32 feat(release): configure when all branches should be checked for a matching releaseTagPattern (#30044) 2025-02-14 17:02:02 +04:00
Hikari Hayashi b821d2954b fix(core): add the extends field to nx-schema.json (#30027) 2025-02-14 09:26:29 +00:00
Emily Xiong ef08108f7a fix(core): change to use init generator during import (#30029)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
- call init generator using implementationFactory, causing issue because
schema.json file isnt respected, and then NX_INTERACTIVE is never set to
true

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- change back to run init command

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-13 22:02:12 -05:00
Nicholas Cunningham 3c0820f707 fix(vite): prevent asset copying when NX_GRAPH_CREATION is enabled (#30037)
This PR includes updates to the `nxCopyAssetsPlugin` function in the
`packages/vite/plugins/nx-copy-assets.plugin.ts` file to improve asset
handling and daemon integration.

The most important changes include adding a check for
`NX_GRAPH_CREATION`.

Additionally, it also contains a check to ensure that before attempting
to watch for file changes the daemon should be available.
2025-02-13 22:01:57 -05:00
Leosvel Pérez Espinosa 13319a857d fix(js): improve the @nx/js/typescript plugin performance (#30024)
Improve the perf of the `@nx/js/typescript` plugin both in cold and warm
scenarios. The main changes done are:

- Batch some processing to do it once instead of doing it per config
file (avoids some duplicated processing)
- Use a custom TS host to read tsconfig files to reduce I/O operations
- Cache tsconfig files' reads

Benchmark results in a repo with 656 TS projects:

```
# Before the changes

Cold (NX_CACHE_PROJECT_GRAPH=false): ~2285 ms
Warm (NX_CACHE_PROJECT_GRAPH=true): ~2142 ms

# After the changes

Cold (NX_CACHE_PROJECT_GRAPH=false): ~597 ms
Warm (NX_CACHE_PROJECT_GRAPH=true): ~220 ms
```

Note: Once https://github.com/nrwl/nx/pull/29935 is merged. I'll send
another change to batch the file hashes.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-02-13 14:26:38 -05:00
Craigory Coppola c2e89f87b5 feat(core): add multi hash fn (#29935)
Adds function to compute multiple glob hashes in native code at the same time, greatly speeding up certain plugin performance.
2025-02-13 14:21:54 -05:00
Jack Hsu 2ebdd2e5a2 feat(nx-dev): add Faro for observability (#30021)
This PR adds frontend observability using Grafana Faro. It will provide
traffic data and performance data.
2025-02-13 14:12:21 -05:00
Mike Hartington 4cdbd2cb32 docs(misc): add canonical urls to website (#30025) 2025-02-13 12:01:12 -05:00
Leosvel Pérez Espinosa eb0505b1ad fix(vite): ignore vite temp files in eslint config (#29909)
## Current Behavior

Vite config temp files can sometimes cause errors to be thrown by
ESLint.

## Expected Behavior

Vite config temp files should be ignored by ESLint.

## Related Issue(s)

Fixes #
2025-02-13 17:04:26 +01:00
Leosvel Pérez Espinosa 9e204f973c feat(webpack): add option to opt out of watching buildable dependencies (#29984)
Add a `watchDependencies` options to the relevant webpack executors and
plugins to allow opting out of watching buildable dependencies.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #29961
2025-02-13 17:00:54 +01:00
Craigory Coppola 9234241570 fix(testing): remove dependency on @nx/vite and @nx/webpack from @nx/playwright (#30023) 2025-02-13 15:16:31 +00:00
Isaac Mann b5df8c25be chore(nx-dev): webinar page styling (#30010)
Updates the /webinar page styling
2025-02-13 09:52:37 -05:00
Chau Tran 1c2d0860b5 feat(graph): update graph lib to latest nx graph (#29768) 2025-02-13 06:58:03 -06:00
Emily Xiong b8ee838e23 fix(gradle): log gradlew output for verbose (#29966)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-12 20:33:40 -05:00
James Henry 8b1cd482e3 fix(core): tweaks to nx init (#30002)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-12 15:37:42 -05:00
Leosvel Pérez Espinosa 672318de7f fix(core): handle nullable lock when creating project graph (#30000)
## Current Behavior

The project graph construction can throw an error when the lock is not
created:
https://github.com/nrwl/nx/issues/29821#issuecomment-2653007563.

## Expected Behavior

The project graph construction should correctly handle the nullable
lock.

## Related Issue(s)

Fixes #
2025-02-12 12:21:23 -05:00
Philip Fulcher 0ff3d70108 docs(nx-dev): add vattenfall article (#29896)
- **doccs(nx-dev): add vattenfall article**
- **feat(nx-dev): add testimonial markdown component**
2025-02-12 09:43:39 -07:00
Benjamin Cabanes 9d95520fa3 docs(nx-dev): update NxPowerpack-Trial PDF & remove old duplicate file (#30004)
The duplicate PDF file in the `docs/shared/features` directory was
removed. The updated version of `NxPowerpack-Trial-v1.1.pdf` is now
properly placed in the `public/assets/powerpack` directory.
2025-02-12 10:29:26 -05:00
Nicholas Cunningham 4e04979a36 fix(rspack): should be inferred by default (#29736)
This PR updates the Rspack Plugin to be inferred by default.

### Currently
When you generate a project using rspack it would not be inferred and
would add the executor to `project.json`.

### After
Generating a project using rspack will add it to inferred plugins inside
`nx.json` and update the `rspack.config.js` to be a standard config and
use Nx plugins.
2025-02-12 07:24:39 -07:00
Emily Xiong 7c5fcf3566 fix(gradle): fix gradle undefined dependency target (#29943)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
got this error:
```
 NX   Cannot read properties of undefined (reading '1')

TypeError: Cannot read properties of undefined (reading '1')
    at fileDataDepTarget (/Users/emily/code/tmp/spring-boot/.nx/installation/node_modules/nx/src/config/project-graph.js:13:18)
    at ProjectGraphBuilder.calculateTargetDepsFromFiles (/Users/emily/code/tmp/spring-boot/.nx/installation/node_modules/nx/src/project-graph/project-graph-builder.js:271:74)
```

this happens because the project in the dependency file is in format
like `:spring-boot-project:spring-boot-autoconfigure (*)`. need to take
out the text after space.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-11 20:14:58 -05:00
Benjamin Cabanes e77280f7d4 docs(nx-dev): update webinar description to highlight React apps and DX (#29990)
Revised the text to emphasize building modern React applications with
platform-native tools.
2025-02-11 21:06:22 +00:00
Ryan Bas 2d9a673ec8 fix(linter): dependency-check-support-catalogs (#29923)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Currently there doesn't seem to be support for pnpm catalogs in the
dependency check which throws an error.



## Expected Behavior
Catalog should be supported and at least not throw an error since its a
default rule in some generators.
I noticed that also that only `workspace:*` was implemented so I added
the other possible options.

https://pnpm.io/workspaces#publishing-workspace-packages

I copy and pasted a test twice to add tests for this.

I mean ideally I guess we would check the `pnpm-workspace` file and say
is this catalog defined, I don't think that's up my ally for this
purpose and I'm not sure if how its implemented does that for the
workspace protocols as well.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
closed #29903, #29959


Gave it a shot, not sure if this is gonna be comprehensive enough. But
let me know! happy to try and get this right.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-02-11 15:20:51 -05:00
Benjamin Cabanes 3815df40e1 docs(nx-dev): add webinar details for February 26th (#29989)
Added the webinar notifier and related links to reflect the new date of
February 26th. Revised webinar description to emphasize new topics.
Reintroduced and adjusted UI references in enterprise hero section for
better event promotion.
2025-02-11 15:17:25 -05:00
Isaac Mann 61302f53c6 docs(core): update webinars (#29988)
Update the webinar content
2025-02-11 13:10:40 -05:00
Colum Ferry c1ebcb9129 feat(vite): add support for vite 6 (#29871)
## Current Behavior
Nx currently supports Vite at version 5. Nx does not generate vite
configurations using Vite 6 which has been released.
 

## Expected Behavior
Nx should use Vite 6 for vite projects.

## TODO
- [x] Add Package Update Migrations for Existing Projects
- [x] Add AST migrations to handle breaking change in resolve.extensions
- [x] Add migration to install `jsx` or `jiti` to handle processing TS
postcss config files
2025-02-11 11:28:23 -05:00
Leosvel Pérez Espinosa db4544844c fix(angular): do not generate @nx/dependency-checks block in flat root eslint config (#29980)
## Current Behavior

Generating a buildable Angular library results in a block for the
`@nx/dependency-checks` being added to the root ESLint Flat Config file
every time.

## Expected Behavior

Generating a buildable Angular library should not add a block for the
`@nx/dependency-checks` to the root ESLint Flat Config file. The
configuration is meant to be added to the project configuration, which
it already does.

## Related Issue(s)

Fixes #29970
2025-02-11 17:06:44 +01:00
Emily Xiong 22a519a612 chore(gradle): add max to code owners (#29967)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-11 09:47:58 -05:00
Leosvel Pérez Espinosa 713b9fbaaf feat(linter): add runtimeHelpers option to @nx/dependency-checks rule (#29954) 2025-02-11 15:30:07 +04:00
Victor Savkin 9672949f82 chore(repo): optimize assignment rules 2025-02-10 16:14:58 -05:00
Jason Jean 435e4056a9 fix(core): fix plugin error indexes (#29936)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The errors were misaligned to the plugin index they pertained to.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The errors are not misaligned to the plugin index they pertain to.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-10 14:03:09 -05:00
Emily Xiong 540aeff488 fix(js): allow publishable library to run release command (#29775)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
- there is no option `fallbackCurrentVersionResolver: 'disk',`
- can't run release for newly created publishable libraries

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- move code to add release for publishable libraries into its own file
to be reused by other stacks
- add `fallbackCurrentVersionResolver: 'disk',` to project's
release.version. generatorOptions

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/29723
2025-02-10 14:02:15 -05:00
Miroslav Jonaš 48421fdb9e docs(nx-dev): fix grammar on hero.tsx (#29955)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-10 17:09:56 +00:00
Juri c8072fa20e feat(nx-dev): add company video 2025-02-10 16:11:59 +01:00
Jack Hsu d5b8908449 fix(linter): install @eslint/eslintrc package as necessary (#29933)
When flat compat is necessary, we don't ensure that `@eslint/eslintrc`
is installed, even though we import it. Depending on the package manager
and hoisting, it may still work, but as we see with pnpm v10, it is not
working without an explicit dependency in `package.json`.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Some app generators are broken is we use eslint compat.

## Expected Behavior
App generators should work.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29845
2025-02-10 10:06:28 -05:00
Leosvel Pérez Espinosa 1841690c63 chore(repo): update nx packages to 20.5.0-beta.2 (#29873)
## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-02-10 10:50:06 +01:00
Benjamin Cabanes c0fd00df6e docs(nx-dev): add monorepo ai support section to homepage (#29934)
Introduced the Monorepo AI Support component and its corresponding
illustration to the homepage layout. Also updated the necessary exports
for proper integration.
2025-02-07 17:22:33 -05:00
Jason Jean 4c66403a00 Revert "fix(testing): move webpack and vite to optional peer dep (#29… (#29931)
…800)"

This reverts commit a5f13a28b1.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`@nx/playwright` is published with improper peer dependencies because
`nx release` does not support this apparently.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`@nx/playwright` is published with `dependencies` again for now.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/29921
2025-02-07 15:19:33 -05:00
Jonathan Cammisuli 64f165dc6f fix(core): create multi-glob function (#29880)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Whenever there are multiple plugins using in a workspace, all the
configuration paths are collected and used as 1 giant glob to test
against the workspace context files.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Each plugin configuration glob is now handled separately and are not
joined together into one giant one. This allows each glob pattern to
have separate files for each plugin.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29473

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2025-02-07 15:18:00 -05:00
Isaac Mann 33352bc970 feat(nx-dev): webinar page (#29913)
Adds a webinar page and a script to pull the webinar content from Notion
2025-02-07 14:22:52 -05:00
Juri a9178171b3 docs(nx-dev): adjust pinned posts 2025-02-07 19:55:12 +01:00
Juri 6120c8e36d docs(nx-dev): add Hetzner Cloud success story 2025-02-07 19:55:12 +01:00
Juri 541acf536b feat(nx-dev): add metrics and related blogs section 2025-02-07 19:55:12 +01:00
Juri 13b9c23e3b feat(nx-dev): add quote component for enterprise articles 2025-02-07 19:55:12 +01:00
Jack Hsu 9bc63177df feat(testing): disable jest runtime by default when inferring targets (#29917)
This PR updates `@nx/jest/plugin` such that `disableJestRuntime` option
is true by default. Users will need to set it to false to bring in
`jest-config` and `jest-runtime` to compute atomized targets. We're
leaving it as an option if anyone runs into discrepancies between our
calculation and what jest-runtime calculates for test files within a
project.



## Current Behavior
Jest runtime is used by default and is potentially slow if you use many
transforms, presets, etc. in the jest config.

## Expected Behavior
Jest runtime is not used by default, and users have to option of
enabling it.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-07 13:32:24 -05:00
Colum Ferry a7c8c1021e feat(testing): support vitest 3 (#29908)
## Current Behavior
We currently still generate Vitest configuration using Vitest v1.

Vitest v3 has released so Nx is pretty far behind now.


## Expected Behavior
Update vitest version to v3 and use it to configure new projects.
Existing workspaces using v1 will continue to use v1.
2025-02-07 13:10:01 -05:00
Jack Hsu 6a65db8601 feat(core): update CNW defaults so they generate a useful workspace by default (#29915)
This PR fixes some inconsistencies when generating a TS solution
workspace (e.g. `npx create-nx-workspace --workspace`).

If the user chooses `None` stack (or `--preset=ts`), then we continue to
default to no Prettier (and ESLint, etc.). However, for React, Vue, and
Node, we want the defaults to be useful for users to run lint, test,
etc. Thus, they are now updated the default does not opt out of any
tooling, but users can still choose no to any of them.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
The defaults for React, Vue, Node are inconsistent (e2e runner is there
by default, but not unit test runner, etc.)

## Expected Behavior
Defaults are consistent and useful, especially for tutorials.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-07 11:12:22 -05:00
Juri ef4398eb60 fix(nx-dev): error on course detail page on mobile 2025-02-07 14:40:39 +01:00
Nicholas Cunningham 8fb959209e fix(nx-dev): Update customers carousel subtitle (#29920) 2025-02-06 16:48:04 -05:00
Benjamin Cabanes f8f1f070de docs(nx-dev): update Nx Powerpack messaging & links (#29918)
Revised FAQ and hero section to clarify that Nx Powerpack is included in
Nx Enterprise, replacing references to OSS licenses with trial-related
messaging.
2025-02-06 21:18:38 +00:00
Isaac Mann f7f1864d52 chore(nx-dev): old tutorial url redirect (#29916)
Add a redirect for /tutorial/*
2025-02-06 18:53:38 +00:00
Nicholas Cunningham 29e5ce2963 fix(nextjs): enhance support for custom server with SWC configuration (#29895)
This pull request contains a few changes to enhance our swc support for
Next.js with a custom server.

### Issues
Currently, we have a few issues with our configuration when using
executors for Next.js with a custom server:

1. The custom server does not have an independent build configuration.
2. The custom server does not have an independent output directory.
3. Serving via `@nx/next-server` or via `@nx/js:node` with
configurations `production` and `development` does not always work.
(These are contained inside `project.json`).

### Changes
All the above issues have been addressed

1. We now have an independent swc build configuration
called`.server.swrc` (_follows the same format as `.eslintrc`,
`.babelrc`_) etc...
2. Now each custom server output will be named `{app}-server` such that
if you have multiple custom servers for multiple apps the names will not
clash.
3. Serving now works out of the box but can be adjusted to suit your
needs via updating the custom server entry file `main.ts`
2025-02-06 11:34:32 -07:00
Jack Hsu 8bd0bcdd97 fix(js): generate pacakge.json for non-buildable nest and expo libs (#29891)
This PR fixes a couple of issues for TS solution setup:
1. Expo library should generate with correct `package.json` file (e.g.
`exports` maps either to source or dist). See [spec
file](https://github.com/nrwl/nx/pull/29891/files#diff-ae2eb3d10d58786c17aa21f5603043b68043faaebafaec77912f3d69ac0c5295).
2. Nest library should generate `package.json` when non-buildable. See
[spec
file](https://github.com/nrwl/nx/pull/29891/files#diff-368467bcd2215def98ef14aaff9dcb056a915b0a724d0eb857f3a0badef8b40a).

**Notes:**
- Also removed an unsupported `standaloneConfig` option from
`@nx/nest:lib` generator. This was removed a long time ago in other
generators.
- Expo lib generator isn't crystalized when using Rollup for build. This
is a separate issue and we'll handle it in another task.

## Current Behavior
- Non-buildable Expo libs generate without `exports`
- Buildable Expo libs fail to generate due to error
- Non-buildable Nest libs do not generate `package.json`

## Expected Behavior
Expo and Nest libs generate correct `package.json` files depending on
whether they are build or non-buildable.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-05 16:27:56 -05:00
Philip Fulcher d62b94f6a7 docs(core): remove references to dumb components (#29897)
## Current Behavior
Docs refer to smart and dumb components

## Expected Behavior
Docs refer to presentational and container components
2025-02-05 12:11:05 -07:00
Jason Jean 2129135714 chore(core): handle project graph errors which do not have a message (#29893)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When weird errors which do not have a message get thrown, a weird error
gets thrown by Nx saying cannot read `split` of `undefined`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When weird errors which do not have a message get thrown, the weird
error is `console.error`ed

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-05 18:03:55 +00:00
Jason Jean 09be513439 fix(core): do not use revokable proxy (#29878)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`preTaskExecution` hooks used a revocable proxy to monitor updates to
`process.env` then revoking them. Apparently, this also prevents them
from being accessed afterwards which is definitely not intentional.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`preTaskExecution` hooks use a normal (non-revocable) proxy and restores
`process.env.` to the un-proxied version.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-05 12:52:54 -05:00
Jason Jean 35486caa87 fix(core): do not write filemap cache when there are errors (#29892)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Errors when processing the project graph still result in the project
file map being cached causing invalid information to be used when
recalculating the project graph.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The project file map will not be cached if there are errors calculating
the project graph. The dependencies of the graph will be recalculated
from scratch the next time Nx runs.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-05 17:48:31 +00:00
Jack Hsu 0944e34be4 fix(js): set --ws=false when running npm config for jest e2e (#29887)
When we run inferred Jest tasks with workspaces enabled, it'll result in
an error like this:

```
npm ERR! A complete log of this run can be found in: /Users/jack/.npm/_logs/2025-02-05T13_41_51_079Z-debug-0.log
Error: Command failed: npm config set //localhost:4873/:_authToken "secretVerdaccioToken"
npm ERR! code ENOWORKSPACES
npm ERR! This command does not support workspaces.
```

This is because the cwd is the project root (e.g. `packages/mypkg-e2e`),
and `npm config set` cannot be run on packages inside the workspaces. By
passing `--ws=false`, it'll only be run in the workspace root and won't
error.

## Current Behavior
Jest e2e tests inferred from `@nx/jest/plugin` fail when starting a
local registry.

## Expected Behavior
Jest e2e tests should work even if they are inferred (or have cwd other
than workspace root).

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-05 11:46:50 -05:00
Juri 041cecd6ff docs(release): link epic web nx release course 2025-02-05 16:22:51 +01:00
Juri 2f1b6f9f72 feat(nx-dev): allow link-card components to take an image URL 2025-02-05 16:22:51 +01:00
MaxKless 781b300a51 feat(core): show link to migrate detail page in --interactive mode (#29874) 2025-02-05 15:49:38 +01:00
Benjamin Cabanes a6e383369f docs(nx-dev): ipdate Hetzner Cloud testimonial content
Revised the heading to highlight trust by OSS and Fortune 500 companies and added a new description paragraph. Simplified the button text and removed the video-related click handler for streamlined functionality.
2025-02-05 09:00:09 +01:00
Jason Jean 45d5140948 chore(misc): fix failing snapshot (#29879)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Test Snapshot is failing

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Test Snapshot is updated

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-04 21:47:46 +00:00
Colum Ferry 18c555a50e feat(rspack): improve plugin createNodes performance (#29876)
## Current Behavior
Currently, calculating nodes via the `@nx/rspack/plugin` takes a long
time because the hash generation attempts to hash every source file.
This is problematic because the targets that are inferred do not rely on
the source files themselves and rather just the config file.

It also means the time taken to infer the targets grows as the project
grows.

## Expected Behavior
Calculate the hash based off the config file and the installed
dependencies, allowing it to scale as the project grows and allowing it
to be invalidated if dependencies change.

## Tested Results
Application with 90k files
Previous:  2mins
New: 1.18s
2025-02-04 21:30:34 +00:00
Benjamin Cabanes 61f9929f4a docs(nx-dev): update nx powerpack links with UTM parameters (#29877)
Updated all Nx Powerpack-related links across documentation and UI components to include UTM parameters. This enhances referral tracking and improves analytics for link performance across different sources.
2025-02-04 15:45:55 -05:00
Emily Xiong 98e79ee1a7 fix(gradle): fix max buffer for gradle stdout (#29864)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-04 15:12:45 -05:00
Juri 247dc296a5 fix(nx-dev): update blog metadata to include the post descriptions 2025-02-04 20:26:08 +01:00
Juri 5525c78789 docs(nx-dev): add missing blog description fields 2025-02-04 20:26:08 +01:00
Juri 3d0b15ef10 feat(nx-dev): conformance rule for blog post description 2025-02-04 20:26:08 +01:00
Juri 1059be666c docs(core): link TS related videos 2025-02-04 19:12:39 +01:00
Rares Matei 1ed347eda9 docs(nx-cloud): add release notes (#29872)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-04 09:23:53 -05:00
Leosvel Pérez Espinosa 8d056c9cdb fix(misc): generate config with output contained within project root (#29850)
Updates some generators to ensure the build tool produces the output
contained within the project root for the TS solution setup.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-02-04 09:16:02 -05:00
Leosvel Pérez Espinosa 1fbcd73cde fix(linter): produce type information for the eslint-plugin main entry point (#29855)
## Current Behavior

The `@nx/eslint-plugin` main entry point is untyped.

## Expected Behavior

The `@nx/eslint-plugin` main entry point should provide types.

## Related Issue(s)

Fixes #28448 
Fixes #29816
2025-02-04 09:15:23 -05:00
Philip Fulcher bc4ded002e docs(nx-dev): fix typos in workspace structure article (#29859) 2025-02-03 20:28:59 +00:00
Benjamin Cabanes a279bf6df3 docs(nx-dev): add Hetzner cloud testimonial section to homepage (#29858)
Introduced a new "Hetzner Cloud Testimonial" component showcasing a featured client story with video support. The `video-modal.tsx` component was moved to `ui-common` for reuse, and the homepage was updated to display it while commenting out the previous "Trusted By" section.
2025-02-03 15:16:02 -05:00
Philip Fulcher feecd195c9 docs(nx-dev): add workspace structure article (#29847) 2025-02-03 11:12:36 -07:00
Amr Salama bc06d63bee feat(core): add sync generators option to target defaults in nx-schema (#29441) 2025-02-03 16:42:32 +01:00
Jack Hsu 77ad299589 fix(misc): set hidden: true for all init generators (#29833)
This PR ensures that our init generators are hidden, such that they
don't appear in Nx Console when running generators, for example.

The init generator is meant to be used when running other generators,
like app or lib, and should not be run directly.

## Current Behavior
Init is not hidden

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Init is hidden
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-02-03 10:40:10 -05:00
Isaac Mann ff57bd9444 chore(nx-dev): move version picker to header (#29823)
Move the version picker to the header next to the docs logo
2025-02-03 10:39:43 -05:00
Craigory Coppola a5f13a28b1 fix(testing): move webpack and vite to optional peer dep (#29800)
@nx/webpack and @nx/vite are used for a single migration but pollute the
overall dep size of someone using @nx/playwright without both vite and
webpack. This change allows users to only install the one stack they are
using.
2025-02-03 09:03:17 -05:00
Leosvel Pérez Espinosa 4235cf35e3 fix(core): improve resolution of packages in package manager workspaces when constructing the project graph (#29795)
Main fixes:

- Identify dependencies from packages that only expose named exports (no
`.` export)
- Identify dependencies from exports containing wildcards (e.g.
`"./utils/*": "./src/utils/*.js`)
- Disallow identifying dependencies from restricted exports (e.g.
`"./foo": null`)
- Handle conditional exports (e.g. `"exports": { "import":
"./dist/index.js", "default": "./dist/index.js" }`
- Handle invalid `"exports": {}` (by not falling back to `main`)
- Handle projects included or not in package manager workspaces

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #29486
2025-02-03 08:03:49 -05:00
robertIsaac d655e667a1 fix(angular): fix path issues on windows for storybook generators and unit tests (#27489)
## Current Behavior
`nx test angular` fail on windows

## Expected Behavior
`nx test angular` to pass on windows

## notes
in
`packages/angular/src/generators/utils/storybook-ast/component-info.ts`
file I used `join(moduleFolderPath)` to convert it from always being `/`
to be OS separator
there are two other options I can do, but I don't have enough knowledge
to take the decision
1. to generate `moduleFolderPath` with OS separator instead of always
`/`
2. to make `candidateFile` to always be `/`

## Related Issue(s)
it might Fixes #22248
because now I see that when a new file is added, it's added to the end
of the tree, but when you reset it's then added to its place
also it explain why same code sometimes hit cache in windows, but miss
cache on linux, as the returned result different between the OSs
this should make sure that the returned result is always the same

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-02-03 10:25:43 +01:00
Philip Fulcher 05e0679714 docs(nx-dev): migrating more blog posts (#29807) 2025-01-31 17:13:38 -08:00
Colum Ferry 55e83e8c77 docs(nx-dev): add blog post on OTA updates with super apps and zephyr cloud (#29803)
Co-authored-by: Mike Hartington <mhartington@users.noreply.github.com>
2025-01-31 17:03:43 -05:00
Stefan Haas cdd4958a99 fix(core): allow postTaskExecution hook without preTaskExecution hook (#29820)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`postTaskExecution` hook is only called if `preTaskExecution` hook is
exported in the plugin.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`postTaskExecution` hook should be independent from `preTaskExecution`
hook. I.e., if `preTaskExecution` hook is not exported,
`postTaskExecution` hook should still be called after a task execution.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

Fixed `postTaskExecution` hook

Co-authored-by: Jonathan Cammisuli <4332460+Cammisuli@users.noreply.github.com>
2025-01-31 16:42:35 -05:00
Isaac Mann ed1dd5fd44 docs(core): update ts migration recipe (#29815)
Updates migration to TS project references recipe
2025-01-31 15:18:22 -05:00
Craigory Coppola 5917f09c5f chore(repo): fix macos push event (#29832)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-31 11:06:50 -05:00
Craigory Coppola cdbddd976e fix(repo): don't try to fetch master if already on master (#29831)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-31 11:00:02 -05:00
Craigory Coppola f50555b1fb chore(repo): migrate ci from circle to gha (#29801) 2025-01-31 10:53:05 -05:00
Juri a92e8f2d45 docs(nx-dev): update TS bencharks 2025-01-31 16:24:13 +01:00
Mike Pham 0d9d3fef9d fix(core): exponential retry on cache put fail (#29017)
Co-authored-by: Mike <mike.pham@autogeneral.com.au>
2025-01-31 10:02:45 -05:00
Juri 82bfb99366 fix(nx-dev): revert show alt text as label below markdown images
This reverts commit a4f07dbb64.
2025-01-31 16:01:20 +01:00
Colum Ferry 00b9525bef fix(rspack): handle configs with default exports (#29825)
## Current Behavior
When we resolve the config file for rspack, it can be provided in a few
different formats:

```
config

config.default

config.default.default
```

We do not handle if the config is provided in any of the named default
methods.

## Expected Behavior

Handle named defaults for the resolved user config for Rspack.
2025-01-31 09:47:12 -05:00
Isaac Mann 6b9496d8ef chore(nx-dev): fix tablet width (#29826)
Make the mobile and tablet width breakpoints work correctly again
2025-01-31 09:31:48 -05:00
Juri a4f07dbb64 feat(nx-dev): show alt text as label below markdown images 2025-01-31 15:09:12 +01:00
Juri Strumpflohner 999dcfbb0f feat(nx-dev): add epic nx release course (#29777) 2025-01-31 06:03:08 -08:00
Miroslav Jonaš 7d864c8db8 fix(bundling): rspack should allow ES config module imports (#29095)
Reproduction repo: https://github.com/olaf-cichocki/sample

## Current Behavior
When using mjs config file we end up with following error:
```
⚠️ Unable to construct project graph.
Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
      An error occurred while processing files for the @nx/rspack/plugin plugin.
    - apps/appA/rspack.config.mjs: require() of ES Module /Users/miro/Dev/Testbox/sample/apps/appA/rspack.config.mjs not supported.
  Instead change the require of /Users/miro/Dev/Testbox/sample/apps/appA/rspack.config.mjs to a dynamic import() which is available in all CommonJS modules.
      Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/miro/Dev/Testbox/sample/apps/appA/rspack.config.mjs not supported.
      Instead change the require of /Users/miro/Dev/Testbox/sample/apps/appA/rspack.config.mjs to a dynamic import() which is available in all CommonJS modules.
          at resolveUserDefinedRspackConfig (/Users/miro/Dev/Testbox/sample/node_modules/.pnpm/@nx+rspack@20.2.0-beta.3_@babel+traverse@7.25.9_@module-federation+enhanced@0.7.6_react-dom@1_7iwdcl66l7me4m7pewq22wegge/node_modules/@nx/rspack/src/utils/resolve-user-defined-rspack-config.js:19:16)
          at createRspackTargets (/Users/miro/Dev/Testbox/sample/node_modules/.pnpm/@nx+rspack@20.2.0-beta.3_@babel+traverse@7.25.9_@module-federation+enhanced@0.7.6_react-dom@1_7iwdcl66l7me4m7pewq22wegge/node_modules/@nx/rspack/src/plugins/plugin.js:65:98)
          at createNodesInternal (/Users/miro/Dev/Testbox/sample/node_modules/.pnpm/@nx+rspack@20.2.0-beta.3_@babel+traverse@7.25.9_@module-federation+enhanced@0.7.6_react-dom@1_7iwdcl66l7me4m7pewq22wegge/node_modules/@nx/rspack/src/plugins/plugin.js:51:34)
          at async /Users/miro/Dev/Testbox/sample/node_modules/.pnpm/nx@20.2.0-beta.3/node_modules/nx/src/project-graph/plugins/utils.js:10:27
          at async Promise.all (index 0)
```

## Expected Behavior
Using EU module config files is supported

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

Thank you @olaf-cichocki for reporting the issue.
2025-01-30 13:43:15 +00:00
Leosvel Pérez Espinosa c7ff6d358d fix(js): do not infer tsc tasks with verbose output by default (#29804)
## Current Behavior

The `@nx/js/typescript` plugin infers tasks with `--verbose`. This can
prevent users from running the same task with `--clean.` It can also
produce a lot of logs that might not be too relevant.

## Expected Behavior

The `@nx/js/typescript` plugin should not infer tasks with `--verbose`.
This is more aligned with other tools.

A new plugin option `verboseOutput` is added to allow inferring all
tasks with `--verbose` if desired.

Note: This revealed that some things were working (e.g., `dependsOn`)
because all the `typecheck` commands inferred by the different plugins
matched. As soon as the command is different, the different inferred
tasks are not merged, which is expected. We shouldn't rely on that, and
each plugin inferring the task should set the right options/metadata.
The different plugins were updated in this PR accordingly (they don't
have the verbose option).

We'll follow up on this later, so only the `@nx/js/typescript` plugin
infers the `typecheck` task. This is a breaking change so it will be for
Nx v21.

## Related Issue(s)

Fixes #28677
2025-01-30 14:19:06 +01:00
Colum Ferry 07f1215411 fix(module-federation): tuple remotes should have global identifier added if missing (#29811)
## Current Behavior
Our Module Federation Config allows passing tuple remotes:

```js
remotes: [
  ["remote1", "http://localhost:4201/remoteEntry.js"]
]
```

However, if the Module Federation system is expecting the remotes to be
loaded as Global variables in the browser, then we erroneously pass just
the url to webpack/rspack's `extractUrlAndGlobal` method.

This expects a string of format `name@url`. For non-tuple remote
configurations, we create this correctly.
However, when a tuple is passed, we simply return the url.


## Expected Behavior
We should ensure that the string is massaged to `name@url` even when a
tuple is provided.
2025-01-30 12:52:46 +00:00
Juri Strumpflohner 12dd8daea3 docs(nx-dev): just keep 2 pinned posts (#29809)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-30 07:52:04 -05:00
Juri Strumpflohner 10c14b6f17 feat(nx-dev): allow callout component to be expanded by default (#29806) 2025-01-29 10:54:51 -08:00
Juri 3dd3ab7421 docs(nx-dev): fix typos and UTM links in ts experience blog post 2025-01-29 19:10:47 +01:00
Philip Fulcher 8b8065934c docs(nx-dev): removed un-used pages (#29789)
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2025-01-29 08:51:41 -07:00
Emily Xiong 8754e3871d fix(gradle): fix dependencies.txt not found (#29787)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
- currently, when cache project report, it caches buildFileToDepsMap,
which is a map of build file to path of dependencies.txt
- however, when we try to read dependencies.txt in create dependencies,
it might not exist

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- read the dependencies.txt file when process project report to cache
- cache dependencies as processed project report result
- no need to read dependencies.txt in create dependencies

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-29 10:50:28 -05:00
Juri Strumpflohner 21aba7a179 docs(nx-dev): adjust typescript series links (#29799) 2025-01-29 16:45:31 +01:00
Mararok 8266785486 fix(testing): fix passing extra args to Jest cli (#27704)
Small fix for using
jest-runner-groups(https://www.npmjs.com/package/jest-runner-groups)
with Nx.

## Current Behavior
When running jest executor with extra group argument like:
```
nx run app-nebula-explorer-api:test --group=unit
```
`jest-runner-groups` runs all tests, not only from selected group.

From my investigation, `jest-runner-groups` using process.argv to
extract `--group` args

https://github.com/eugene-manuilov/jest-runner-groups/blob/3c9d3cf4cb3e595bdea733100f2bdc8d64f871d7/index.js#L57
and  `process.argv` passed to runner contains:

```javascript
[
 'M:\\programs\\nodejs\\22\\node.exe',
 'M:\\projects\\someproject\\node_modules\\.pnpm\\nx@19.3.2_@swc+core@1.6.6_@swc+helpers@0.5.11_\\node_modules\\nx\\bin\\run-executor.js'   
]
```

## Expected Behavior
Running jest executor with jest-runner-groups runner and `--group` args
should run only tests from group.

## PR changes summary
I implemented fix as generic and any extra arg will be added to
`process.argv` .

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-01-29 16:16:50 +01:00
Ethan Koenig 9b70596272 fix(core): reduce number of processed files when creating in-memory transpiler (#29774)
## Current Behavior

All of the TS source trees are unnecessarily traversed when a local
plugin is being registered.

## Expected Behavior

TS source trees are not unnecessarily traversed.

## Related Issue(s)

Fixes #29102 (see issue for more context)
2025-01-29 15:53:41 +01:00
Anthony Shew 13cbc17318 fix(nx-dev): typo in ts pkg management article (#29791)
Just a typo! Good article!
2025-01-29 05:12:01 -08:00
Juri 3e3c466d47 feat(nx-dev): add ability to add labels to video-player 2025-01-29 13:39:02 +01:00
Juri 6dca7e5217 docs(nx-dev): add blog article about new Nx TS experience 2025-01-29 13:39:02 +01:00
Rares Matei 6336573154 docs(nx-cloud): update release notes (#29788)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-29 12:37:37 +00:00
Colum Ferry 708499a28b fix(module-federation): depend on a range of versions of webpack to prevent peer dep issues (#29797)
## Current Behavior
`@nx/module-federation` is currently pinned to depend on
`webpack@5.88.0`. However, other Nx packages such as `@nx/webpack`
depend on a range of versions `^5.80.0`.

This leads to peerDep issues when package managers attempt to resolve
the packages.

## Expected Behavior
Change `@nx/module-federation` to depend on a range of versions.
`wepback@^5.88.0`.

## Related Issue(s)

Fixes #29682
2025-01-29 11:38:33 +00:00
Nicolas Beaussart dfbfe3b786 fix(linter): add cjs, cts, mjs, and mts to the default extensions for the inference plugin (#29534)
## Current Behavior

On the default generated eslint on a ts reference workspace, the config
allows for linting of cjs and mjs files

```js
const nx = require('@nx/eslint-plugin');

module.exports = [
  ...nx.configs['flat/base'],
  ...nx.configs['flat/typescript'],
  ...nx.configs['flat/javascript'],
  {
    ignores: ['**/dist'],
  },
  {
    files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
    rules: {
      '@nx/enforce-module-boundaries': [
        'error',
        {
          enforceBuildableLibDependency: true,
          allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?js$'],
          depConstraints: [
            {
              sourceTag: '*',
              onlyDependOnLibsWithTags: ['*'],
            },
          ],
        },
      ],
    },
  },
  {
    files: [
      '**/*.ts',
      '**/*.tsx',
      '**/*.js',
      '**/*.jsx',
      '**/*.cjs',
      '**/*.mjs',
    ],
    // Override or add rules here
    rules: {},
  },
];

```


However, the default glob is not matching them

## Expected Behavior
All cjs and mjs files are included in the lint target detection

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-01-29 12:24:35 +01:00
Esteban e2e9e6cb36 fix(vite): fall back to file matching when resolved file does not exist in nx-vite-ts-paths plugin (#29472)
The fallback path resolution was only happening if the resolvedFile was
a falsy value, so it was returning inexistent filepaths.

This pull request includes a small but important change to the
`packages/vite/plugins/nx-tsconfig-paths.plugin.ts` file. The change
improves the reliability of resolving file paths by checking if the
resolved path exists before proceeding with fallback file matching.

*
[`packages/vite/plugins/nx-tsconfig-paths.plugin.ts`](diffhunk://#diff-ad026b24ed45d9df484cabc7e277fc9b4d7759560af36bf357cbc4186725ae0bL174-R176):
Added a check to verify if the resolved file path exists before using
fallback file matching.
* 
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The resolver doesn't resolve the full file path, it ignores the file
extension. For example, for a path like this:
`import mergeClassNames from '@projects/global/utils/mergeClassNames'`

It resolves to 
`absolutePath.../projects/libs/global/src/utils/mergeClassNames`

When vite is building a project, it doesn't find the file and it errors.

This happens because the resolved file path is not a falsy value, thus,
it doesn't run the fallback file path matching.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
What is expected is that it resolves to (notice the file extension)
`absolutePath.../projects/libs/global/src/utils/mergeClassNames.ts`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-01-29 12:01:50 +01:00
Leosvel Pérez Espinosa ff31487cf6 chore(repo): format readme (#29796) 2025-01-29 14:24:05 +04:00
Jason Jean 7d52fefcba chore(repo): update circle docker image (#29790)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The current docker image being used cannot fetch chrome.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The new docker image can fetch chrome and pipelines can run.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-29 02:08:13 -05:00
Benjamin Cabanes 3f5e8636a0 docs(nx-dev): update Powerpack button link and add title (#29792)
Updated the Powerpack button link to use a relative path and added a descriptive `title` attribute for improved accessibility and clarity.
2025-01-28 19:00:21 -05:00
Benjamin Cabanes 89bbe22502 docs(core): update readme (#29793)
Updated team section in readme.
2025-01-28 18:54:49 -05:00
Philip Fulcher 8ca84f762e docs(nx-dev): point blog links to internal blog (#29786) 2025-01-28 13:46:28 -07:00
Isaac Mann 67f12a2d7a fix(nx-dev): make toc sticky (#29784)
Makes sidebar table of contents not overlap the footer

Fixes #29719
2025-01-28 13:43:19 -05:00
Neil 5aec542774 feat(core): add prefixColor property to @nx:run-commands (#29348)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Running tasks in parallel, we can set prefixes. However, there is no way
to label our prefixes with colors. Currently the only way is to set the
entire line to the color we want. This is not ideal as users may want to
keep the default colors for the logs and only want to use the prefix
colors as identifiers.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
PR to add this option

## Screenshots (Examples)

Tested with example screenshots below

### Before (v20.2.2 latest release)
<img
src="https://github.com/user-attachments/assets/dcc9b3fa-1977-4096-9dd2-3b111570c8cd"
alt="description" width="300" />


![image](https://github.com/user-attachments/assets/f25569a9-98e2-48f7-b61f-9f2a867b9882)

### This PR (local release)
<img
src="https://github.com/user-attachments/assets/6dc9eb3a-bc83-49cd-aad1-778b4f2eb354"
alt="description" width="300" />


![image](https://github.com/user-attachments/assets/f9594dec-4836-4cfd-9184-08edc0eae6a2)




## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2025-01-28 13:28:00 -05:00
Isaac Mann 87f1dda046 docs(core): fixes for custom tasks runner docs (#29785)
Tweaks to the new custom tasks runner docs
2025-01-28 12:31:15 -05:00
Victor Savkin ca89f14eb3 docs(misc): add custom runners migration doc 2025-01-28 12:06:47 -05:00
Ashley Hunter 567a3f7ce7 fix(js): ensure js library creation respects skipFormat (#28831)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
If I set `skipFormat` to `true` when creating a JS library with the
rollup bundler, formatting is still run during the rollup configuration
creation step.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`skipFormat` flag should be respected.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-28 11:56:36 -05:00
Kerick Howlett 9a9e6eb96b fix(core): allow for non-js libs to be moved without errors or the creation of any unneeded tsconfig files (#28350)
## Current Behavior

I have a project that is utilizing the `@nx-go/nx-go` extension that's
used for supporting Go applications.

When I attempt to use the `@nx/workspace:move` generator to move a Go
library, it'll produce an error. (Please refer to the _Failure Logs_
section for said error.)

Sadly, there isn't a consistent means to get the bun to start showing
up, but once it does, the issue will persist throughout the workspace's
life cycle.

I was able to trace this to the compiled Javascript files within Nx's
installed project files under the `node_modules` directory, which is
where I found a workaround. That being to have the
`secondaryEntryPointImportPaths` variable (located within the
`updateImports` function) set with an empty array on the same line it's
declared.

However, this will produce a `tsconfig.base.json` file at the root of
the workspace with the text `undefined` contained within it and with no
actual JSON to speak of.

## Expected Behavior

I have a project that is utilizing the `@nx-go/nx-go` extension that's
used for supporting Go applications.

The `@nx/workspace:move` schematic generator should be able to move
libraries based in Go and other programming languages without any errors
popping up.

It should also do it without generating an empty `tsconfig.base.json`
file if one didn't exist previously. This tends to be the case when
there is no Typescript to speak of within the Nx workspace. For example,
an Nx workspace initiated with the `@nx-go/nx-go` preset.

## Related Issue(s)

- [#28349](https://github.com/nrwl/nx/issues/28349)

Co-authored-by: Kerick Howlett <88661181+KerickHowlett@users.noreply.github.com>
2025-01-28 09:59:53 -05:00
Craigory Coppola 5721ea3c21 feat(core): lock graph creation when running in another process (#29408)
## Current Behavior
Running Nx in multiple processes at the same time with the daemon
disabled can cripple a system due to excess memory usage when creating
the graph. This is due to plugin workers being started per-parent
process when there is no daemon. This change enables a file lock to
prevent the simultaneous processing, and read from the cache when the
first run completes.

Currently, running `nx show projects` 30 times in parallel looks
something like this:

30 processes exited within 37535ms

## Expected Behavior
30 processes exited within 6435ms

## Test Script
```js
//@ts-check

const { spawn } = require('child_process');

let alive = new Set();

let start = Date.now();
let iterations = 30;

for (let i = 0; i < iterations; i++) {
  const cp = spawn('npx nx show projects', [], {
    shell: true,
    env: {
      ...process.env,
      NX_DAEMON: 'false',
      NX_VERBOSE_LOGGING: 'true',
    },
  });
  alive.add(i);
  //   cp.stdout.on('data', (data) => {
  //     console.log(`stdout [${i}]: ${data}`);
  //   });
  cp.stderr.on('data', (data) => {
    console.error(`stderr [${i}]: ${data}`);
  });
  cp.on('exit', (code) => {
    console.log(`child process ${i} exited with code ${code}`);
    alive.delete(i);
  });
}

const i = setInterval(() => {
  if (alive.size > 0) {
  } else {
    clearInterval(i);
    console.log(
      `${iterations} processes exited within ${Date.now() - start}ms`
    );
  }
}, 1);

```
2025-01-28 09:46:52 -05:00
Anthony Boyd cbbe14b8e5 fix(linter): add files entry to react flat configs to avoid applying TS rules to JSON files (#29457)
This PR fixes an issue with React libs, where TS rules are being applied
to JSON files.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28245

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-01-28 14:07:18 +00:00
Juri 4406a7e681 docs(nx-dev): article about TypeScript monorepo package linking strategies 2025-01-28 12:50:35 +01:00
Phillip Barta f015dd7527 cleanup(react-native): use native fetch for isPackagerRunning check and remove node-fetch dependency (#29568)
Removes the `node-fetch` dependency and uses the native fetch global for
the `isPackagerRunning()` check

## Current Behavior
- Dependency `node-fetch` is used.

## Expected Behavior
- Removed the `node-fetch` dependency.
- Used the native `fetch` global.


---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-01-28 11:03:05 +00:00
Leosvel Pérez Espinosa 626c514a99 feat(misc): replace ts-jest transformer with @swc/jest for ts solution setup (#29763)
## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-01-28 11:51:25 +01:00
Juri Strumpflohner 5127c15871 feat(nx-dev): refactor and improve style of video-player (#29749) 2025-01-28 00:14:56 -08:00
Jack Hsu e0c49d3627 fix(testing): infer correct file output paths for atomized targets (#29766)
There is a bug when `outputFile` is specified in `playright.config.ts`,
and atomizer is enabled via `ciTargetName`, then the path of the output
file is wrong.

For example, if you have this reporters entry:

```
reporter: [
  [
    'junit',
    {
      outputFile: 'dist/report.xml',
    },
  ],
],

```

Then the atomized output file would be something like
`dist/report.xml/example-spec-ts`, where `report.xml` is a directory.
The correct output file should be `dist/example-spec-ts/report.xml` to
avoid conflict with the non-atomized output of `dist/report.xml`.

## Current Behavior
If you run `nx e2e proj` then `nx e2e-ci proj` then you can run into an
issue where `report.xml` (or whatever the file name is) is a directory
in the cache, but it is a file currently -- or vice versa. This happens
due to the bug described above.

## Expected Behavior

The `outputFile` should never cause a conflict where a path should be a
directory but is currently a file, or vice versa.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-27 20:32:41 -05:00
Jason Jean 82c4e17b05 chore(repo): remove leftover debugging logs and update migrations docs (#29765)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Left a log by accident.
`master` is broken because of migrations misalignment..

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Log is removed
migrations docs are aligned.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-27 14:23:35 -05:00
Isaac Mann 84387f3611 feat(nx-dev): generate migration detail pages (#29580)
Generates list of migrations on the plugin overview page and a
standalone `/migrations` page.

To add sample code changes for a migration that has an implementation
file, create a `.md` file with the same name as the implementation file
in the same folder as the implementation file. i.e.
`move-cache-directory.md` for `move-cache-directory.ts`.

Migrations that have `packages` defined will have a table generated with
the package updates listed.

Separate PRs will be created to add sample code changes for each
migration with an implementation.

The migration list on the plugin overview page: [Angular
migrations](https://nx-dev-git-docs-migration-details-nrwl.vercel.app/nx-api/angular#migrations)
Standalone migration list page: [Angular
migrations](https://nx-dev-git-docs-migration-details-nrwl.vercel.app/nx-api/angular/migrations)
Sample migration with added markdown file details:
[17.0.0-move-cache-directory](https://nx-dev-git-docs-migration-details-nrwl.vercel.app/nx-api/nx#1700movecachedirectory)
Sample migration with only package updates: [Angular
20.4.0](https://nx-dev-git-docs-migration-details-nrwl.vercel.app/nx-api/angular#2040packageupdates)
Sample migration without any markdown file details:
[update-angular-cli-version-19-1-0](https://nx-dev-git-docs-migration-details-nrwl.vercel.app/nx-api/angular#updateangularcliversion1910)
- This last sample is very bare-bones and the reason why we need these
pages in the first place. People don't know what migrations are actually
doing. Follow up PRs will address pages like this.
2025-01-27 13:17:36 -05:00
Jason Jean 4a9508b368 feat(core): add pre and post run apis (#29636)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

There is no specific API for running things before and after tasks run.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This PR adds an API akin to npm's `preinstall` and `postinstall`.

Plugins can now specify `preTasksExecution` and `postTasksExecution`
functions which run before and after Nx runs tasks respectively.

```ts
import type { PreTasksExecutionContext, PostTasksExecutionContext } from '@nx/devkit';

interface PluginOptions {
  field: any;
}

export function preTasksExecution(options: PluginOptions, context: PreTasksExecutionContext) {
  console.log('prerun')
}

export function postTasksExecution(options: PluginOptions, context: PostTasksExecutionContext) {
  console.log('postrun', context.taskResults)
}
```

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-27 12:09:43 -05:00
Jack Hsu f02a88a72c Revert "fix(core): support subpath exports when constructing the project graph" (#29762)
Reverts nrwl/nx#29577

There is an issue with workspaces using tsconfig path alias, and when an
invalid import is found, it'll match on the wrong package due to the
name matching the prefix.
2025-01-27 11:52:28 -05:00
Phillip Barta 7df5737e12 feat(node): upgrade express to v4.21.2 to address security vulnerabilities (#29419)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Nx should install and depend on a version of express without security
vulnerabilities.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-01-27 11:49:20 -05:00
Leosvel Pérez Espinosa 1a13a67982 fix(misc): generate remix libs correctly and install correct @types/react version for react libs (#29760)
- Fix server file location for the `@nx/remix:library` generator
- Do not error when generating a buildable Remix library in the TS
solution setup
- Install the correct versions of react-related packages when generating
a React library

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-01-27 10:28:48 -05:00
Zachary DeRose 9f7120a228 Typescript project references article (#29698)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2025-01-27 08:53:00 -05:00
Maksym Polupan 655342ba11 fix(nuxt): correct webServerAddress and webServerCommand options in add-e2e.ts generator. (#29713)
## Current Behavior
Currently, the add-e2e.ts generator has redundant lines for the
webServerAddress and webServerCommand configuration when generating
Playwright configuration.
Produces `TypeError: Invalid URL` when running playwright tests on a
clean create-nx-workspace project.

## Expected Behavior
The generator should configure webServerAddress and webServerCommand
correctly. The changes fix the configuration generation for Playwright
tests.
2025-01-27 13:08:26 +00:00
Igor Loskutov 1f69dce067 feat(node): update app generator for fastify to the next major v5 (#29589)
## Current Behavior
`npx create-nx-workspace`, when fastify is chosen, generates fastify 4
boilerplate

## Expected Behavior
fastify bumped their major version, and many latest plugins require v5
(e.g. [cors](https://github.com/fastify/fastify-cors))

## Related Issue(s)
no

- the combination of versions works on my setup
- the combinations of versions is the latest at the moment

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-01-27 12:29:12 +00:00
AdrianDuan 2c607951f7 fix(rspack): fix error with 'TypeError: userDefinedConfig is not a function' (#29514) (#29515)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29514

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-01-27 12:29:02 +00:00
Hassan Khan ed186fd2c3 fix(detox): use a version of Detox that works with React Native 0.76/Expo v52 (#29679)
## Current Behavior

After adding `@nx/detox` to a newly-generated project, Detox E2E apps
will either fail to build or run with intermittent crashes on Android.

## Expected Behavior

Detox E2E apps should run as they normally did with React Native
0.74/Expo v51.
2025-01-27 10:38:00 +00:00
ilovemoon 4100515e78 chore(js): update dep babel-plugin-macros to ^3.1.0 (#28649)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

```bash
@coreproject-moe/monorepo@ /home/moonlitgrace/Projects/coreproject-monorepo
├─┬ @coreproject-moe/icons@0.0.65 -> ./packages/icons
│ └─┬ jest-config@29.7.0
│   └─┬ jest-circus@29.7.0
│     └─┬ dedent@1.5.3
│       └── babel-plugin-macros@2.8.0 deduped invalid: "^3.1.0" from node_modules/dedent
└─┬ @nx/js@20.0.5
  └── babel-plugin-macros@2.8.0
```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

No conflicts, without overriding `package.json`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28620
2025-01-27 10:20:29 +00:00
Jason Jean a8aba61e0b chore(repo): update nx to 20.4.0-beta.2 (#29752)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx 20.3.0-rc.0

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx 20.4.0-beta.2

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-25 23:55:07 -05:00
saintfirewater 15fc599a10 docs(core): run run to run (#29516) 2025-01-24 23:22:38 +04:00
Juri Strumpflohner 1c8b3b3fb9 docs(nx-dev): fix broken links to Nx Cloud runs (#29747) 2025-01-24 16:08:34 +01:00
Leosvel Pérez Espinosa 8d9234b385 feat(misc): prompt for unit test runner when creating a workspace using --workspaces flag (#29743)
## Current Behavior

Creating a new workspace does not prompt for the unit test runner.

## Expected Behavior

Creating a new workspace should prompt for the unit test runner.

For now, this new behavior will be behind the `--workspaces` flag.

## Related Issue(s)

Fixes #
2025-01-24 10:03:57 -05:00
Leosvel Pérez Espinosa 86798a286e fix(testing): finish dev server async generator in cypress executor (#29689)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Running an e2e task using the `@nx/cypress:cypress` executor that starts
a dev server by running another task that uses the `@nx/js:node`
executor result in the process to hang after the e2e tests have finished
running.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The async generator returned by starting the dev server and consumed by
the `@nx/cypress:cypress` executor should be finished, and the
`@nx/js:node` executor should properly clean up its child process once
the generator is finished.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29571
2025-01-24 10:03:10 -05:00
Leosvel Pérez Espinosa b0d4ac64d7 Revert "fix(core): collect all logs from forked processes (#27778)" (#29740)
This reverts commit c3709b2b84.

The change can result in tasks hanging when underlying processes are not
properly managed (can be processes created from third-party plugins or
user's code). A hanging task is a more serious issue than what this was
originally solving. We'll revisit this soon.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-24 10:00:25 -05:00
James Henry 9b7a797e8e chore(repo): update to powerpack 1.2.3 (#29744) 2025-01-24 18:31:34 +04:00
Ihor 128f21b0bb fix(devkit): add .riv to binary extension (#29309) 2025-01-24 16:56:18 +04:00
Oliver Yasuna f3b85bef22 fix(linter): export Options types for enforce-module-boundaries and nx-plugin-checks (#29072) 2025-01-24 16:54:18 +04:00
Phillip Barta 0ce694c9ca cleanup(rspack): migrate rspack to picocolors (#29562) 2025-01-24 16:48:27 +04:00
Phillip Barta c8865badac cleanup(react-native): migrate react-native to picocolors (#29566) 2025-01-24 16:47:49 +04:00
Mads Mætzke Tandrup 3e4f16f8b0 feat(release): allow invalid conventional commits to be considered via custom config (#29658) 2025-01-24 14:29:35 +04:00
Jack Hsu 45847a6754 feat(js): remove nx property from generated package.json files (#29705)
This PR updates our generators to no longer generate with `nx` in
`package.json` by default. The only times it is needed is if you pass
add `tags` or `implicitDependencies` to the project config.

This PR replaces our `projectType` checks to use the `getProjectType`
util from `@nx/js` to prefer the project config, but otherwise will
check for our conventions (e.g. using `exports` for libs,
`tsconfig.lib.json` vs `tsconfig.app.json`).

## Impact
- There shouldn't be any behavioral changes to existing projects that
have explicit `projectType`, `name`, etc. in with `project.json` or
`package.json` (via `nx` property).
- For new projects created under the new TS setup, the `nx` property
will no longer be there. Generators with logic that depend on
`projectType` will now check for `tsconfig.lib.json` and
`tsconfig.app.json` (so all of our generators are covered). If none of
those tsconfig files are found, then we check `package.json`, since
libraries are required to have `exports` to be consumed.
2025-01-23 20:03:28 -05:00
Benjamin Cabanes ae9aa5ac76 docs(nx-dev): remove webinar notifier & event link (#29737)
Commented out the `WebinarNotifier` in `_app.tsx` and the live event link section in `hero.tsx`.
2025-01-23 15:21:29 -05:00
Nicholas Cunningham 21a1f4e385 feat(rspack): non-inferred targets should work OOTB (#29733) 2025-01-23 10:06:44 -07:00
Leosvel Pérez Espinosa d6015613f5 feat(misc): use @swc/jest instead of ts-jest for the ts solution setup (#29718)
## Current Behavior

When using the TS solution setup and `jest` is used, `ts-jest` is used
as the transformer in most cases (except when the build compiler is
`swc`). The `ts-jest` transformer doesn't support modern module
resolutions like `nodenext` and it doesn't support TS project references
either.

## Expected Behavior

When using the TS solution setup and `jest` is used, `@swc/jest` should
be used as the transformer in cases where previously `ts-jest` was being
used and regardless of using `swc` as the build compiler.

## Related Issue(s)

Fixes #
2025-01-23 11:59:16 -05:00
Leosvel Pérez Espinosa 4bbbea2def fix(react): ensure project name is escaped in spec matcher when generating an application (#29732)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-23 17:55:48 +01:00
Leosvel Pérez Espinosa 9d1c55b80e fix(nx-plugin): fix plugin generation in ts solution setup (#29730)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-23 11:43:29 -05:00
Jiří Prokop bd35ab2892 fix(vite): do not stop the test process of failure in watch mode (#29260)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior

When you run `nx run <lib>:test --watch` it only works correctly if
there are no failing tests. In case you have some failing test, the
process finishes immediately after all tests are finished.

## Expected Behavior

Watch mode should work the same as with Jest or when you use `vitest` on
its own.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

The logic seems to be broken with introduction of
https://github.com/nrwl/nx/pull/27722

Fixes #28050
2025-01-23 08:18:36 -07:00
Jack Hsu a0cfe88f5f fix(node): set correct compilerOptions for Nest applications (#29725)
This PR fixes and issue where generating Nest app in the new TS setup
results in a build error due to missing `experimentalDecorators` option
in tsconfig. Decorators are required for Nest to work, but we do not set
it anymore in `tsconfig.base.json` by default.


## Current Behavior
Nest apps are broken

## Expected Behavior
Nest apps work

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-22 23:20:25 -05:00
Isaac Mann 8357a2270a docs(core): project linking concept and recipe (#29652)
Adds two pages:
- Concept page describing two options for [TypeScript project
linking](https://nx-dev-git-docs-workspaces-project-linking-nrwl.vercel.app/concepts/typescript-project-linking)
(workspaces and path aliases).
- Also describes performance benefits of TS Project References that are
possible with workspaces
- Recipe describing how to manually [switch from path aliases to
workspaces project
linking](https://nx-dev-git-docs-workspaces-project-linking-nrwl.vercel.app/recipes/tips-n-tricks/switch-to-workspaces-project-references)
2025-01-22 22:11:06 -05:00
Nicholas Cunningham 7524356180 feat(webpack, rspack): support multiple configurations (#29691)
This pull request includes changes to support multi-configuration mode
for both Rspack and Webpack.

## Currently
Currently our plugin only supports single configurations
```js
module.exports =  { 
  ...config
}
```
Which works in most cases but some applications can have mutliple
configs that serve different platforms.

## Changes
With these changes, the Webpack and Rspack plugins will also support
multi-configuration.
```js
module.exports = [ 
   { ...clientConfig },
   { ...serverConfig }
 ]
2025-01-22 18:50:03 -07:00
James Henry 123602c0d6 chore(repo): latest powerpack 1.2.0 (#29724) 2025-01-23 01:44:32 +04:00
Jonathan Cammisuli cad265dad6 docs(core): add local cache information for powerpack (#29630)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Also includes update ENV variables

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-22 15:21:28 -05:00
Isaac Mann c32d2c77f4 docs(core): typescript packages tutorial (#29721)
Renames the NPM workspaces tutorial to TypeScript Packages tutorial and
updates the intro text a bit. The content is all still valid for ts
project references
2025-01-22 14:30:55 -05:00
Jonathan Cammisuli a9f6ba553a fix(core): ensure that nx is backwards compatible with older versions of Nx Cloud (#29703) 2025-01-22 09:30:25 -05:00
Juri Strumpflohner a055f1be36 fix(nx-dev): update request a trial link on pricing page (#29711) 2025-01-22 05:38:07 -08:00
Zach Tindall 3c98a1ca56 fix(core): update yarn-parser to handle yarn v4 syntax for root workspace package (#29452)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
The root workspace package is not generated correctly when using Yarn v4

## Expected Behavior
yarn.lock should be created correctly

## Related Issue(s)

Fixes #29451
2025-01-21 17:12:18 -05:00
Jack Hsu cf206c3928 feat(core): support reading projects under new pnpm workspaces entry + skip writing empty nx property to pacakge.json for non-root projects (#29707)
This PR is a prerequisite to removing `nx` property from `package.json`
files in the new TS setup. It fixes two issues:

1. We always write `nx` property in `package.json` even if it is empty.
This should be done for root projects.
2. Adding an entry to `pnpm-workspace.yaml` is not picked up because
`readProjectConfiguration` only reads the file from disk, not from
virtual `Tree`

This is the next PR to remove the property:
https://github.com/nrwl/nx/pull/29705
2025-01-21 17:11:29 -05:00
Nicholas Cunningham 7f3ca1f094 docs(nx-dev): remove unnecessary directory flag from host & remote generation commands (#29704)
### Changes
Remove `--directory` flag if the arg is provided as a positional. If
provided it will throw errors.
2025-01-21 20:09:22 +00:00
Craigory Coppola 104f06ccb7 fix(core): do not warn about custom tasks runners when explicitly usi… (#29669)
…ng default<!-- Please make sure you have read the submission guidelines
before posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-21 14:00:28 -05:00
Emily Xiong ee135b20a9 feat(core): handle existing plugins failed with imported project (#28893)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
<img width="1025" alt="Screenshot 2024-12-21 at 9 51 18 PM"
src="https://github.com/user-attachments/assets/32815566-c532-4186-bc94-4b017b0a84c2"
/>


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-17 15:06:49 -05:00
Nicholas Cunningham dec21662b6 feat(core): Add ESM support for Eslint config file (#29613)
This pull request includes changes to migrate ESLint configuration files
from CommonJS (`.cjs`) to ECMAScript modules (`.mjs`) as the default.

### ESLint Configuration Generation Changes

The changes also ensure consistent generated eslint configs based on the
base eslint config.
- If the workspace root has an `eslint.config.cjs` or `eslint.config.js`
with `module.exports`. When you create a library or application it will
generate an accompanying config at path
`{projectRoot}/eslint.config.cjs` of the same format.
- If the workspace root has an `eslint.config.mjs` or
`eslint.config.mjs` with `export default`. When you create a library or
application it will generate an accompanying config at path
`{projectRoot}/eslint.config.mjs`.
- If no eslint config is found at the workspace root one will be created
`eslint.config.mjs`
2025-01-17 13:39:45 -05:00
Colum Ferry a468d72c7f feat(react): add support for React 19 for new Workspaces (#29286)
## Current Behavior
We currently have no support for React 19, generating only React 18
applications.

## Expected Behavior
Add utils to determine what version of React is installed in the
workspace.
If React 18 is the main version of react installed, continue to generate
React 18 projects.
If React 19 is the main version of react installed, generate React 19
projects.
If no React version is installed or can be determined, generate React 19
projects.
2025-01-17 15:14:48 +00:00
Colum Ferry bc0566f4c3 fix(testing): e2e config generators should prompt for missing serve data (#29660)
## Current Behavior
When running the `configuration` generator from `@nx/playwright` and
`@nx/cypress` for existing appliactions - they currently generate a
config that is likely to be invalid becaue there is not enough
information to correctly assume the port, target and baseUrl for the
application.
This data is provided by the application generators that call the
`configuration` generator - but that means that users running it
manually must remember to pass the information via flags.


## Expected Behavior
If the serve data is missing, prompt the user to input the correct
information to ensure the config generation is as accurate as possible.
2025-01-17 15:09:40 +00:00
MaxKless 37f994ad75 fix(graph): copy command text directly from PDV (#29645) 2025-01-17 15:46:07 +01:00
Louie Weng bb03ed7d82 docs(nx-cloud): use assignment rules with self provisioned agents (#29490)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The initial version of the docs only allow the use of assignment rules
with Nx Agents.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The updated docs include an overview and example of how to configure
assignment rules to work with self provisioned agents (and DTE in
'manual' mode).

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2025-01-17 00:17:45 -07:00
Isaac Mann cba25da87e docs(core): update turborepo docs (#29656)
Update the turborepo concept page and migration guide
2025-01-16 17:15:22 -05:00
Isaac Mann 520706b10b feat(nx-dev): show arg aliases (#29653)
List aliases of command arguments
2025-01-16 17:13:02 -05:00
Leosvel Pérez Espinosa 6d8fe5c5fe feat(angular): support angular v19.1 (#29523)
Add support for Angular v19.1.x.
2025-01-16 16:23:12 -05:00
Benjamin Cabanes 4d0ebe04c9 docs(nx-dev): update "ebook" references to "guide" in button texts (#29655)
Revised all button texts and titles to consistently use "guide" instead of "ebook" across multiple components.
2025-01-16 15:03:14 -05:00
Thimo Sietsma dd9db3603c docs(migration): update turborepo migration guide (#29522)
I came across the TurboRepo migration guide and noticed some outdated
TurboRepo configurations.

I’ve updated the migration guide for TurboRepo. However, the
documentation still lacks some global configurations:

- [ui](https://turbo.build/repo/docs/reference/configuration#ui)
- cacheDir
- [deamon](https://turbo.build/repo/docs/reference/configuration#daemon)
-
[envMode](https://turbo.build/repo/docs/reference/configuration#envmode)
-
[remoteCaching](https://turbo.build/repo/docs/core-concepts/remote-caching)

I'm not entirely sure if these should be included in the migration guide
or what their equivalent would be in nx, as I'm not yet very familiar
with nx.
2025-01-16 13:18:02 -05:00
Jack Hsu 1e032fb9e5 fix(misc): update e2e config generators to align with new TS solution setup (#29638)
This PR updates the `@nx/detox:app` generator to match the new TS
solution setup. The `@nx/cypress:configuration` and
`@nx/cypress:configuration` generators are also updated so that they can
be run on existing projects and generator the correct tsconfig files.

The Playwright/Cypress example can be seen as follows:

```shell
# Skip e2e
nx g @nx/react:app apps/demo --bundler vite --e2eTestRunner none

# now configure e2e
nx g @nx/playwright --project demo
```

Now if you add this line to `apps/demo/e2e/example.spec.ts`:
```
const x: number = 'a';
```

And run `nx typecheck demo`, it will pass. This happens because the
`e2e/**/*.ts` pattern is missing. Thus, we need to ensure that a
`tsconfig.e2e.json` project is added for the Playwright spec files. Same
thing with Cypress.

The Detox generator does not support adding configuration to existing
project, so we don't quite get the same problem. The fix for Detox is
just to make sure the tsconfig content is not following the old
(integrated) version, but the updated TS solution version.

## Current Behavior
Detox TS setup is incorrect. Running Cypress and Playwright
configuration generator on existing projects generate invalid setup,
such that spec files are not typechecked.

## Expected Behavior
E2E generators should all generate correct TS setup.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-16 13:10:34 -05:00
Leosvel Pérez Espinosa 8a6e44b788 fix(js): ignore bundler config files correctly in eslint config when using vitest in js library generator (#29649)
## Current Behavior

Generating a js library with esbuild or rollup as bundlers and vitest as
the unit test runner, results in an eslint configuration where the
bundler config file is not ignored from the `@nx/dependency-checks`
rule.

## Expected Behavior

Generating a js library with esbuild or rollup as bundlers and vitest as
the unit test runner, should result in an eslint configuration where the
bundler config file is ignored from the `@nx/dependency-checks` rule.

## Related Issue(s)

Fixes #
2025-01-16 15:51:32 +01:00
Leosvel Pérez Espinosa ad96cc17c9 fix(js): do not generate package.json file for non-buildable js libraries in non-ts solution setup (#29646)
## Current Behavior

When generating a non-buildable js library in a workspace using the
integrated setup, a `package.json` file is generated.

## Expected Behavior

When generating a non-buildable js library in a workspace using the
integrated setup, a `package.json` file should not be generated.

## Related Issue(s)

Fixes #
2025-01-16 15:32:08 +01:00
Leosvel Pérez Espinosa ca1c3ea6a8 docs(expo): fix typo in plugin overview (#29634)
## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-01-16 08:45:07 -05:00
Leosvel Pérez Espinosa ed6b220214 fix(js): fix typo so exports field in package.json is properly sorted (#29643)
## Current Behavior

It tries to sort `exported` which is an invalid field.

## Expected Behavior

It should sort `exports`.

## Related Issue(s)

Fixes #
2025-01-16 08:44:31 -05:00
Laney d0078d050e docs(release): fix typo in version.generatorOptions.updateDependen… (#29640)
…ts option

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior

The version generator option `updateDependents` is misspelled as
`updatedDependents` in one of the Nx release docs pages.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
n/a

Fixes #
2025-01-16 10:21:44 +01:00
Leosvel Pérez Espinosa a1271776d5 fix(misc): generate module and moduleResolution in base tsconfig based on cnw preset (#29633)
## Current Behavior
<!-- This is the behavior we have today -->

Creating a new workspace using the TS solution setup always generates a
`tsconfig.base.json` with `module: nodenext` and `moduleResolution:
nodenext`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Creating a new workspace using the TS solution setup should generate a
`tsconfig.base.json` with `module: nodenext`/`moduleResolution:
nodenext` for Node stacks and `module: esnext`/`moduleResolution:
bundler` for Web stacks (React, Vue).

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-15 16:21:35 -05:00
Jack Hsu cc441a6dc7 fix(js): sort package.json fields by idiomatic order (#29635)
This PR updates our app/lib generators such that `package.json` files
generated have fields in idiomatic order.

e.g.

```json
{
  "name": "...",
  "version": "...",
  "private": true,
  "type": "module",
  "main": "...",
  ...
  "dependencies": { ... }
}
```

The import fields such as name, version, private, and type are at the
top. Dep fields that could be noisy are at the bottom.

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-15 15:52:23 -05:00
Emily Xiong f9c306af28 fix(gradle): check if java is installed (#29572)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
throw an error when `./gradlew wrapper` or `java -version` failed to
run:
<img width="949" alt="Screenshot 2025-01-09 at 5 33 38 PM"
src="https://github.com/user-attachments/assets/f0b99adc-ff80-4962-8dfe-c1ad11944cac"
/>
<img width="933" alt="Screenshot 2025-01-09 at 5 32 20 PM"
src="https://github.com/user-attachments/assets/11d2286a-cc04-48a0-9839-b67cc93d5cfc"
/>



## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-15 14:47:08 -05:00
Colum Ferry 7ef4fa795f fix(vite): plugin should infer 'vite' for dev/serve command (#29585)
## Current Behavior
We currently have a `serveTargetName` that defaults to `serve` in the
`@nx/vite/plugin`.
This infers a `vite serve` command for the `serve` task to vite
projects.

While not incorrect, it could be abrasive for users coming from the
`vite` ecosystem to Nx.
The command to start the Vite Dev Server is `vite`, so we should infer
this.

`create-vite` also creates a package.json script with `"dev": "vite"`
meaning users are likely running `npm run dev`.

This creates two points of differences for vite ecosystem users.

## Expected Behavior
Deprecate `serveTargetName` in favour of `devTargetName` to more closely
align with lanugage from the Vite ecosystem.

Infer the command `vite` instead of `vite serve` for the `serve` and
`dev` tasks.
2025-01-15 17:32:10 +00:00
Jason Jean 32a2ca8eaa fix(core): check only for watcher connections during inactivity shutdown (#29621)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

We currently second guess our inactivity timer by checking if there are
any open connections. However, there's also a strong chance that plugin
workers will remain open as long as the daemon is open. This means the
daemon stays alive forever and the daemon never shuts down even though
it is inactive.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Instead of checking for open connections in general, the daemon server
will only check for open file watchers. Most Daemon client requests will
restart the server when sending messages so we can safely shut the
server down in most cases. The only case where shutting down the daemon
would cause a disruption is if a file watcher is registered. In those
cases, the daemon will not shutdown due to inactivity.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-15 10:43:28 -05:00
Jonathan Cammisuli d46761d764 feat(core): add support for skipping remote cache (#29574)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-15 10:33:47 -05:00
Colum Ferry 0d5e53d60e fix(rspack): make subresourceIntegrity usage configurable (#29629)
## Current Behavior
We currently set Subresource Integrity (SRI) on all scripts injected via
`HtmlRspackPlugin`.
This should be configurable.

## Expected Behavior
Expose an option to set SRI - mark false by default to match Rspack's
`HtmlRspackPlugin` behaviour
2025-01-15 14:43:02 +00:00
Leosvel Pérez Espinosa f24a869b67 fix(angular): restore esm2022 bundle and drop fesm2022 in ng-packagr-lite executor (#29615)
## Current Behavior

In Nx 20.2.0, the `ng-packagr-lite` executor stopped producing the
ESM2022 outputs and started producing the FESM2022 outputs. This was due
to the Angular Package Format (APF) dropping the ESM2022 outputs, which
was reflected in the upstream `ng-packagr` implementation. Due to this
change, the libraries' build time and memory increased compared to the
previous versions.

## Expected Behavior

The `ng-packagr-lite` executor should only produce ESM2022 outputs and
avoid running an extra step to bundle the outputs to produce the
FESM2022.

Given the `ng-packagr-lite` executor is not meant to produce publishable
artifacts, its output doesn't need to strictly comply with the APF and
can focus more on build performance.

## Related Issue(s)

Fixes #29519
2025-01-15 10:04:43 +01:00
Jack Hsu 0ae8665a88 feat(js): infer build-deps and watch-deps targets for incremental builds (#29609)
This PR adds `build-deps` and `watch-deps` targets to buildable JS
projects to help with incremental builds.

A use-case for this is if an app (e.g. Vite React app) has buildable
dependencies that need to be rebuilt when they change.

Say, you create a React app and lib as follows:

```
nx g @nx/react:app apps/react-app --bundler vite 
nx g @nx/react:lib packages/react-lib --bundler vite
```

And import `react-lib` inside the app.

```jsx
import { ReactLib } from '@acme/react-lib';
//...
return <ReactLib />
```

The user can then run:

```
nx watch-deps react-app
```

And then serve the app in another terminal:
```
nx serve react-app
```

Then whenever code is updated for a buildable dependency, it'll be
rebuilt and then reloaded in the app.
2025-01-14 16:13:43 -05:00
Jack Hsu 65e9a6b203 fix(js): non-buildable js libs specify type=module (#29620)
In the new TS solution setup, non-buildable libraries should still`type:
module`. This can lead to problem since ESM is used but the type will
default to CJS.

This PR also updates `nx sync` for TS references such that transitive
deps are not sycned by default, unless
`NX_ENABLE_TS_SYNC_TRANSITIVE_DEPENDENCIES=true` env var is setup.
Previously, the transitive deps are synced unless the env var disables
it. There isn't a good reason to enable it by default, and it is much
cleaner to not sync by default. This means that if we have libs `a`,
`b`, and `c`, where `a -> b` and `b -> c` dependency edges are formed,
then running:

```
nx sync
```

Will update `a/tsconfig.json` to contain refs to `b` but not `c`.
Whereas:

```
NX_ENABLE_TS_SYNC_TRANSITIVE_DEPENDENCIES=true nx sync
```

Will update `a/tsconfig.json` to contain refs to both `b` and `c`.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
`type` is missing

## Expected Behavior
`type: module` is set in `package.json`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-14 16:13:32 -05:00
Craigory Coppola c060b3ae7f fix(core): show better project graph errors (#29525)
## Current Behavior
Sub-errors are hidden when any project graph error is encountered. This
is detrimental, as things like "missing comma in JSON" get hidden and
make people think that Nx is broken, when in fact their config files are
invalid.

## Expected Behavior
Sub errors are shown regardless of verbose logging (but including their
stack trace if verbose logging is enabled)

### Without Verbose

![image](https://github.com/user-attachments/assets/3a96d07e-3f0a-4eb7-8629-0c02c6912746)

### With Verbose

![image](https://github.com/user-attachments/assets/41b83e19-e6b1-471c-80ca-004b8f56d8f2)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-14 15:28:58 -05:00
Colum Ferry c2fa9a03fd fix(core): update package script logic to handle cli tool name as command (#29617)
## Current Behavior
When we have an inferred target command that matches the entry point of
the cli tool, there is a chance we do not replace package scripts
correctly

e.g.

```
{
  "dev": "vite",
  "build": "tsc -b && vite build",
  "preview": "vite preview"
}
```

this could result in package scripts being updated to

```
{
  "dev": "nx dev",
  "build": "tsc -b && nx vite:build",
  "preview": "nx dev preview"
}
```

## Expected Behavior
We should update the package scripts correctly to match the desired
inferred target

```
{
  "preview": "nx preview"
}
```
2025-01-14 16:49:20 +00:00
James Garbutt c6e9565973 cleanup(core): move esbuild to use tinyglobby (#29453) 2025-01-14 19:06:11 +04:00
Alex H 1a85efca48 chore(core): nx plugin submission @klerick/nx-angular-mf (#29548)
<!-- 
_[Please make sure you have read the submission guidelines before
posting an
PR](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#submit-pr)_

# Community Plugin Submission

Thanks for submitting your Nx Plugin to our community plugins list. Make
sure to follow these steps to ensure that your PR is approved in a
timely manner.

## Plugin Requirements

Before you submit your plugin to be listed in our registry, it needs to
meet the following requirements:
- Run some kind of automated e2e tests in your repository
- Include `@nx/devkit` as a `dependency` in the plugin's `package.json`
- List a `repository.url` in the plugin's `package.json`

i.e.

```
{
  "repository": {
    "type": "git",
    "url": "https://github.com/nrwl/nx.git",
    "directory": "packages/web"
  }
}
```

Note: We reserve the right to remove unmaintained plugins from the
registry. If the plugins become maintained again, they can be
resubmitted to the registry.

## Steps to Submit Your Plugin
- Use the following commit message template: `chore(core): nx plugin
submission [PLUGIN_NAME]`
- Update the `community/approved-plugins.json` file with a new entry for
your plugin that includes `name`, `url`, `description`:

Example:

```json
// community/approved-plugins.json

[{
    "name": "@community/plugin",
    "url": "https://github.com/community/plugin",
    "description": "This plugin provides the following capabilities."
}]
```

Once merged, your plugin will be available when running the `nx list`
command, and will also be available in the Plugin Registry on
[nx.dev](https://nx.dev/plugin-registry)
-->

# Community Plugin Submission

## @klerick/nx-angular-mf

Custom builder for Angular projects designed to simplify the development
and production of microfrontend applications using native esm module.
The builder integrates with NX to provide seamless support for
development, testing, and deployment of Angular microfrontends.

## Features

- **Microfrontend Support**: Built-in support of native esm module with
dynamic imports them.
- **Server-Side Rendering (SSR)**: Improved SSR compatibility, including
custom module loaders and import maps.
- **Customizable Build Process**: Flexible options for managing
dependencies and extending build configurations.
- **Dev Server Enhancements**:
  - Incremental hydration support.
  - Dynamic `importmap` generation.
  - Automatic dependency resolution and rebuilds.
- **Seamless NX Integration**: Fully compatible with NX workspace for
streamlined project management.
2025-01-14 09:25:58 -05:00
Craigory Coppola facb6dbb95 chore(core): bump fs4 (#29611)
The version we relied on was yanked from cargo for some reason 🤷
2025-01-14 08:36:29 -05:00
Thomas Dekiere bde8a217f7 fix(release): ensure git push option is always applied (#29596) 2025-01-14 16:41:20 +04:00
Nicholas Cunningham 61815929d7 fix(js): improve error handling during SWC compilation (#29605)
Improves our error handling for swc when using `@nx/js:swc` executor

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The executor fails to build if the workspace has a newer versions of
`@swc/cli` e.g.(`0.6.0`) is installed since it now uses stderr instead
of message to log errors.
RE: https://github.com/swc-project/pkgs/pull/53

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The executor should pass in this scenario.


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29599
2025-01-13 10:20:50 -07:00
Chau Tran 669af5559f feat(graph): update headlessui v2 (#29586)
This PR updates `headlessui/react` to v2 so that it is compatible with
the new graph library. This also bumps `preact` to `10.25` for `useId`
compat.
2025-01-13 11:52:23 -05:00
Leosvel Pérez Espinosa a352c81876 fix(js): do not generate explicit vitest task config for a js library unless adding plugin is disabled (#29606)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Generating a js library with any bundler other than `vite` and with the
`vitest` test runner results in an explicit `test` task in the project
configuration.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Generating a js library with any bundler other than `vite` and with the
`vitest` test runner should not generate an explicit `test` task in the
project configuration. The `test` task should be inferred.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-13 17:37:20 +01:00
Benjamin Cabanes dc2c9dae24 docs(nx-dev): fix inconsistent styling in SectionHeading components (#29597)
Removed the redundant "text-white" class from SectionHeading components to standardize styles.
2025-01-11 21:07:01 -05:00
Benjamin Cabanes f57d88a624 docs(nx-dev): Add analytics events & improve CTAs across components (#29592)
Introduced custom event tracking for ebook downloads and sales contact buttons using `sendCustomEvent`. Enhanced call-to-action designs by replacing links with `ButtonLink` components and adjusted styling and text for clarity. Updated webinar links and refined headings for consistency.
2025-01-10 22:10:01 -05:00
Benjamin Cabanes bbbfd9f43b docs(nx-dev): enable WebinarNotifier and update webinar details (#29591)
Re-enabled the `WebinarNotifier` component in the app layout and updated the webinar date and localStorage key to reflect the new event on January 22, 2025.
2025-01-10 20:49:18 -05:00
Leosvel Pérez Espinosa 9dbebbee20 fix(misc): ensure exports are generated for several lib generators in ts solution setup (#29588)
- Update React Native, React, Remix and Vue library generators to
produce `exports` in the `package.json` for the TS solution setup
- Fix an issue in `@nx/rollup/with-nx` where an unhandled `undefined`
plugin was causing an error to be thrown
- Fix output path of the build task for React Native libraries in the TS
solution setup

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-10 15:49:49 -05:00
Nicholas Cunningham cbea0623df fix(nx-dev): Update Webinar link (#29590) 2025-01-10 12:52:03 -07:00
Jack Hsu 42d9e8bcb3 feat(web): add support for TS solution setup for @nx/web (#29583)
This PR adds the new TS setup support to `@nx/web:app` generator.
Previously it errored out since it was not handled.

## Current Behavior
Cannot generate webapp in new setup/

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Can generate webapp in new setup

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-10 13:52:36 -05:00
Robb Traister d08ad7504f fix(core): support subpath exports when constructing the project graph (#29577)
Sibling dependencies that rely exclusively on subpath exports are
excluded from the dependency graph because there is no exact match.

This adds a fallback to look for subpath exports if the exact match is
not found.

This also adds logic to respect conditional exports independent from
subpath exports.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior

Importing a workspace dependency via subpath export fails to match the
package name, and so is not included in the dependency graph.

### Example

```apps/api/package.json```
```json
  "name": "@my-org/api",
  "dependencies": {
    "@my-org/services": "workspace:*"
  }
```

```libs/services/package.json```
```json
  "name": "@my-org/services",
  "exports": {
    "./email": "./dist/email.js"
  }
```

The `@my-org/api` app should be able to import the email service with
`import { EmailService } from "@my-org/services/email"`.

However, the `getPackageEntryPointsToProjectMap` implementation results
in an object with a key of `@my-org/services/email`, but not
`@my-org/services`. This is not specifically a problem, except that
`findDependencyInWorkspaceProjects` only considers exact matches within
those object keys.

## Expected Behavior

Importing a workspace dependency via subpath export should be included
in the dependency graph.

I also addressed a related issue where the following resulted in keys of
`@my-org/services/default` and `@my-org/services/types`, which is
incorrect according to the subpath/conditional export rules.
```json
  "exports": {
    "default": "./dist/index.js",
    "types": "./dist/index.d.ts"
  }
```

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29486

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-01-10 13:32:33 -05:00
Leosvel Pérez Espinosa 0d5bfe3700 fix(misc): ensure all project generators add project to workspaces config (#29582)
- Update project generators to add the project to the workspaces setup
in the new TS solution setup
- Update some library generators that were not running package
installation

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-10 13:32:16 -05:00
Nicholas Cunningham d30a84f49c feat(nx-dev): add trial pages for Powerpack and Enterprise, update contact sales team page (#29554) 2025-01-10 10:15:36 -07:00
Colum Ferry dbdb72aee2 fix(react): setup mf env var as input for rspack (#29584)
## Current Behavior
The Module Federation `NxRuntimeLibraryControlPlugin` relies on an
environment variable that is set during the build/serve process.
This could potentially lead to issues with cache restoration.

The impact should be minimal as the runtime control plugin should only
be added to the module federation config when the env var is set.
It should only be set by the `module-federation-dev-server` executor
which is invoked during serve - a non-cacheable task already.

## Expected Behavior
Ensure the env var is set as an input to ensure maximum accuracy with
module federation builds via rspack executor
2025-01-10 17:15:08 +00:00
Rares Matei e89053c3b6 chore(repo): use new recommended agents cache folders (#29435)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-10 17:13:27 +00:00
Leosvel Pérez Espinosa dd9b09f917 fix(js): generate js libs with exports in package.json and ensure esm output when using rollup bundler (#29565)
- Ensure libs are generated with `exports` in `package.json`
- Generate `types` instead of `typings` in package.json
- Update js lib with rollup to only output esm
- Update `tsconfig.spec.json` for js libraries with rollup to set
`module: esnext` and `moduleResolution: bundler` (they use `@swc/jest`)
- Fix `@nx/js/typescript` issue with absolute paths when normalizing
inputs/outputs
- Fix `@nx/js/typescript` issue identifying buildable libs
- Fix express app generator not installing `@types/express`

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-01-10 08:29:09 -05:00
Jack Hsu cbfc6fe97f fix(js): update detection of ts solution setup (#29576)
Since we simplified `tsconfig.base.json`'s `compilerOptions` to not
include values that match defaults (as per Jake's feedback), the logic
to detect TS solution setup should check that `declaration` is
explicitly set to `false`, rather than that it is falsy.


Clean up PR: https://github.com/nrwl/nx/pull/29550

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
We're not detecting TS solution setup correctly

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Detection works

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-09 15:50:45 -05:00
Juri Strumpflohner 9c176d8a44 feat(nx-dev): customer videos on customer page (#29380)
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2025-01-09 12:30:16 -08:00
Zachary DeRose c09e3690b1 docs(misc): bundler blogpost (#29569)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-09 14:42:48 -05:00
Rares Matei 62057e99e0 docs(nx-cloud): use new cache recommendations on custom launch template docs (#29434)
Now that we home folder level caching has been unblocked, we can update
the package manager cache recommendations.
2025-01-09 19:01:03 +00:00
Jack Hsu c6cb024a06 feat(core): allow tasks to run with a substring of project name (#29552)
When projects use only `package.json` and not `project.json`, we need to
set the simple name in the `nx` property of `package.json`. This isn't
ideal because it's yet another Nx-specific thing that needs to be
configured when our goal is to reduce boilerplate.

This PR allows users to pass a substring that matches exactly one
project when running a task.

For example, if `@acme/foo` is the name in `package.json`, then running
`nx build foo` will match it.

If more than one projects match, then an error is thrown showing all the
matched projects, and the user has to be more specific or type in the
fully qualified name.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Users need to pass exact matches for project names when running tasks.

## Expected Behavior
User can pass a substring matching the project name.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-09 13:39:24 -05:00
Nicholas Cunningham a77e3ef083 fix(js): Update typescript plugin check for buildable projects (#29431)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, we use `rootDir` to check if the project is buildable. This
might not be correct in the case where the transpiled files are inside
source.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
It should work the for projects as long as the main / exports files are
not source files.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-09 11:03:33 -05:00
Rares Matei 325b9f6471 docs(nx-cloud): update release notes (#29351)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-09 10:14:43 -05:00
Phillip Barta b491489cb2 cleanup(testing): migrate jest to picocolors (#29561)
migrates `@nx/jest` from `chalk` to `picocolors`

Part of https://github.com/es-tooling/ecosystem-cleanup/issues/117

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-09 15:58:44 +01:00
Aidan Temple f98ae78734 feat(web): support custom cors headers (#29382)
## Current Behavior

It is not possible to pass custom cors headers to the
`@nx/web:file-server` executor despite `http-server` supporting it.

## Expected Behavior

`@nx/web:file-server` should pass-through a string of custom cors
headers to `http-server`.

## Related Issue(s)
2025-01-09 11:59:46 +01:00
Phillip Barta bc7c80908b cleanup(angular): migrate angular to picocolors (#29444)
migrates `@nx/angular` from `chalk` to `picocolors`

Part of https://github.com/es-tooling/ecosystem-cleanup/issues/117

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-09 11:56:55 +01:00
Tine Kondo addf107471 feat(testing): add option ciGroupName to @nx/jest/plugin (#29365)
Add option `ciGroupName` to the `@nx/jest/plugin` to allow customizing
the `Jest` atomized taks group on CI.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When using Atomizer on Jest for **unit tests** (via the `"ciTargetName":
"test-ci"`), the atomized tasks will be grouped under the misleading
name **"E2E (CI)"**.

Worst, if Atomizer is enabled for both **unit** and **e2e** tests, it
will result on E2E atomized tasks being overwritten by the one from unit
tests... when run on Nx Cloud.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Allow customizing the name of the atomized tasks group. The group name
can be derived from the `ciTargetName` , when not explicitly provided.


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28066

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-01-09 09:34:25 +01:00
Craigory Coppola 0edd1102f7 fix(core): avoid launching default plugins twice (#29539)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Default plugins are launched twice when loading plugins in a workspace
that has local plugins:
- Once to resolve the local plugin
- Once to be used as an actual plugin

## Expected Behavior
Default plugins are launched once and reused

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2025-01-08 18:10:57 -05:00
Jack Hsu fb318005f2 fix(js): avoid nested paths in workspaces because they can lead to future issues (#29553)
For the new TS setup, we currently use nested glob patterns: `apps/**`,
`libs/**`, and `packages/**`.

Nested paths can result into too many projects being matched. For
example, if `libs/mylib/src/__fixtures__/package.json` is there for
testing, it will be matched as a project and likely result in an error.

Other tools like turborepo also caution against this:
https://turbo.build/repo/docs/crafting-your-repository/structuring-a-repository#declaring-directories-for-packages

If users want to, they could change to nested `**` paths, but we should
not use it by default.

Note: For CNW, we only use `apps/*` by default since that is where the
project lives. When users do `nx g lib packages/foo` then `packages/*`
will be added automatically.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Use nested `**` paths.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Don't use nested `**` paths.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-08 18:08:39 -05:00
Jonathan Cammisuli e99cf07ffd fix(core): update nx cloud bundle install directory logic (#29555) 2025-01-08 16:04:25 -05:00
Leosvel Pérez Espinosa 71653dcbfe feat(js): simplify generated tsconfig.base.json compiler options in ts solution setup (#29550)
Simplify generated `tsconfig.base.json` file in the TS solution setup by
removing compiler options set to their default values.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-08 18:21:50 +01:00
Leosvel Pérez Espinosa 0334dad23f fix(js): ensure js libraries' build produce esm output in ts solution setup (#29546)
- Update js libraries for bundlers `esbuild`, `swc`, and `tsc` to
produce ESM output when using the TS solution setup.
- Fix `esbuild` and `swc` executors so they generate declaration files
even when skipping type-checking.
- Add `cjs` and `cts` to the `ignoredFiles` pattern for the rollup
config file in the eslint config.
- Ensure running an install after a js library is generated when using
the TS solution setup.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-08 18:21:39 +01:00
Leosvel Pérez Espinosa 6b8ba9778e fix(testing): infer correct outputs when absolute paths are provided in playwright config (#29549)
Update `@nx/playwright/plugin` to properly handle absolute paths set in
the playwright config to infer outputs correctly.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-08 12:12:44 -05:00
Leosvel Pérez Espinosa 160800e66f fix(js): do not set project references to non-existing tsconfig files in sync generator (#29536)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-08 16:45:15 +01:00
Mike Hartington 97e1e3bc50 fix(nx-dev): fix heroicons for safari (#29544) 2025-01-08 08:03:31 -05:00
Colum Ferry 5157a0daf9 feat(module-federation): upgrade to latest version of @module-federation/enhanced (#29535)
## Current Behavior
We currently use version `0.7.6` of `@module-federation/enhanced`.
This version does not contain the `externalRuntime` experiment to reduce
the remoteEntry bundle size.

## Expected Behavior
Upgrade Nx dependency of `@module-federation/enhanced` to version
`0.8.8`.
2025-01-08 10:32:38 +00:00
Benjamin Cabanes 7f2693a048 docs(nx-dev): set year to 2025 in LICENSE and footer (#29524)
The copyright year was updated from 2024 to 2025 in both the LICENSE file and the footer component.
2025-01-07 20:40:33 -05:00
Jack Hsu 90c0c8ebf6 fix(react): transpile SVGR into React 19 compatible component (#29543)
This PR fixes an issue with React 19 and our `@nx/react/plugins/jest`
transform. The current transform uses an unsupported `$$typeof` symbol,
and also uses the deprecated `forwardRef` API.

The updated transform will use new API for React 19 and older, while
maintaining the previous API for React 18 and earlier. The backwards
compatibility may be needed if the test is using `ref`, which requires
`forwardRef` older versions.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
SVGR fails in Jest tests with React 19

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
SVGR works

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-07 18:26:02 -05:00
Mike Hartington 8dc100a1af docs(misc): update nx 20.3 blog (#29542) 2025-01-07 18:17:16 -05:00
Zachary DeRose 3f3c8747c6 docs(misc): nx 20.3 blogpost (#29512)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-07 11:09:42 -07:00
Jack Hsu df27a97c7e fix(js): infer outputs correctly when both rootDir and outDir are set for tsconfig (#29531)
When the tsconfig has `rootDir` and `outDir` both defined, then the
`*.tsbuildinfo` file is not cached. This makes incremental tsc not work
through distribution (e.g. agents).

For example, given this `tsconfig.lib.json` file:

```json
{
  "compilerOptions": {
    "outDir": "out-tsc/lib-1",
    "rootDir": "src"
  }
}
```

The outputs (e.g. `*.d.ts` files) are under
`{projectRoot}/out-tsc/lib-1`, but the tsbuild info file is under
`{projectRoot}/out-tsc/tsconfig.lib.tsbuildinfo`.

## Current Behavior
tsbuildinfo file is not cached

## Expected Behavior
tsbuildinfo file is cached

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-01-07 11:17:23 -05:00
Isaac Mann 82751a1446 docs(core): create conformance rule recipe (#29406)
- [Create a Conformance
Rule](https://nx-dev-git-docs-conformance-rule-recipe-nrwl.vercel.app/nx-api/powerpack-conformance/documents/create-conformance-rule)
recipe

Blocked until the `create-rule` generator is merged and released
2025-01-07 07:05:56 -05:00
Matt Lewis 6948249ac7 fix(vite): tsconfig paths plugin should not partially match paths (#29501)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When there is a path mapping like:
```
"match-lib-deep/": ["libs/lib1/src/*"],
"match-lib-top-level": ["libs/lib2/src/*"],
"match-lib/*": ["libs/lib3/src/*"],
```

Imports to `match-lib-deep` or `match-lib-top-level` will try and use
the last `match-lib` path mapping as the trailing `/` is not accounted
for in the `startsWith` check.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The correct path mapping is matched.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

N/A
2025-01-07 12:48:57 +01:00
Daniel Karski f7712f6321 docs(storybook): update path in library generator command (#29483)
library path corrected for storybook-host generator

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-07 12:46:43 +01:00
Jack Stevenson 9e78142185 fix(js): only add typescript project references for explicit dependencies in sync generator (#28998)
This change omits references to implicit dependency tsconfigs for
typescript projects in the sync generator, since given that they are not
referenced directly in code there is no need for project references.

## Current Behavior
TypeScript sync generator adds references to any dependency project
which has a tsconfig (where composite is true), including implicit
dependencies where these references are unnecessary and can potentially
cause build failures.

See [example
repo](https://github.com/cogwirrel/nx-sync-generator-implicit-deps-example).

## Expected Behavior
Only explicit dependencies should be referenced in tsconfigs.

## Related Issue(s)
Fixes #28997

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-01-07 10:35:08 +01:00
Juri 68b293f6be docs(nx-dev): update weird dashes in article 2025-01-07 09:23:17 +01:00
Philip Fulcher aceebca1aa fix(nx-dev): add playsInline to video loop component 2025-01-07 09:12:07 +01:00
Nicholas Cunningham cb4a93e872 fix(nx-dev): Quote typo (#29513) 2025-01-06 09:05:51 -05:00
Slava 21d5bd8d66 docs(react): add spaces in 2023-08-10-create-your-own-create-react-app-cli.md (#29510)
Spaces in some places between word and backquote has been missed.

## Current Behavior
No spaces between formatted strings in some places.

## Expected Behavior
Spaces should appear between formatted string.

## Related Issue(s)
Not found any related issues. I have decided just create PR.
2025-01-03 12:24:42 -07:00
Benjamin Cabanes 8a841cd754 docs(nx-dev): update Nx Cloud CTA links to include UTM parameters (#29489)
Replaced internal Nx Cloud links with full URLs containing UTM parameters for better tracking of user interactions across various components. Additionally, minor improvements were made to React type definitions for clarity and consistency.
2024-12-30 10:51:08 -05:00
Juri fbd3db84f8 docs(nx-dev): update Nx Console blog post to include animations 2024-12-23 22:34:27 +01:00
Juri 2b479da159 docs(nx-dev): remove duplicated paragraph in blog post 2024-12-23 22:34:27 +01:00
Benjamin Cabanes 69a13dacd5 docs(nx-dev): replace graph image with light/dark neuron variants (#29461)
Replaced the old `graphs.jpg` image with two new `.avif` images to support light and dark mode. Updated the component to switch between the light and dark neuron visuals based on theme.
2024-12-23 12:41:19 -08:00
Juri a607df6168 docs(nx-dev): updates to EOY blog post 2024-12-23 21:32:31 +01:00
Juri 89cb91cd76 docs(nx-dev): year 2025 review post 2024-12-23 18:03:38 +01:00
Juri 3e564864fd feat(nx-dev): add TOC markdoc component for blog posts 2024-12-23 18:03:38 +01:00
Bartosz Adamczyk 90e12a77af fix(release): invalid config path in hint for using skipLockFileUpdate (#29425) 2024-12-23 19:17:11 +04:00
Isaac Mann c7e2782e78 docs(nx-dev): render keywords meta tag (#29450)
Renders `keywords` property from frontmatter as a `<meta>` tag.
2024-12-20 18:43:06 -05:00
Craigory Coppola d7ffba8f76 fix(core): daemon spinner should show text (#29448)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Daemon spinner doesn't show up

## Expected Behavior
Daemon spinner shows properly

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-20 14:10:15 -05:00
Emily Xiong 81c66eca73 fix(js): not generate tsconfig if already exists (#29317)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
- in serve target, it uses executor `@nx/webpack:dev-server`
- in `packages/webpack/src/executors/dev-server/dev-server.impl.ts`,
when buildLibsFromSource is false, it calls createTmpTsConfig to create
a temp config
- in webpack.config.js, it has `module.exports =
composePlugins(withNx()`. in withNx, it calls
NxTsconfigPathsWebpackPlugin.
- when buildLibsFromSource is false, it called createTmpTsConfig again
based on the temp config. it created an infinite loop because it creates
a tsconfig that extends itself.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- do not create a temp config if it is a generated ts config

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/28006
2024-12-20 13:10:06 -05:00
Juri 7498e470fa feat(nx-dev): link more customer videos on enterprise page 2024-12-20 17:27:56 +01:00
James Webster 6e41b30f8b docs(nx): Version error in documentation page (#29440)
Original text was:

e.g. `nx@19.2.0` and `@nx/js@20.2.0` should be used together.

Surely it should be...

e.g. `nx@19.2.0` and `@nx/js@19.2.0` should be used together.
2024-12-20 11:04:40 -05:00
Yohann Valentin 8516634300 fix(nuxt): change tsconfig path on server part (#28864)
## Current Behavior
On a new workspace with nuxt preset (`npx create-nx-workspace@latest
--preset=nuxt`), a `tsconfig.json` file is create on the nuxt server
side directory (path: `apps/nuxt-test/src/server/tsconfig.json`). The
file extends the building nuxt server tsconfig file (path:
`apps/nuxt-test/.nuxt/tsconfig.server.json`) with the following value :
```json
{
  "extends": "../.nuxt/tsconfig.server.json"
}
```

## Expected Behavior
This `tconfig.json` file generate need to extends the
`tsconfig.server.json` with the good path

Fixes #

The correct value is 
```json
{
  "extends": "../../.nuxt/tsconfig.server.json"
}
```
2024-12-20 14:28:39 +00:00
Craigory Coppola ba37a2f9e0 chore(repo): bump nx to 20.3.0-rc.0 (#29437)
Bumps Nx
2024-12-20 09:01:52 -05:00
Gustavo Perdomo 3a164a22de feat(nx-plugin): added support for vitest test runner (#29140)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Nx Plugin do not have the option to use Vitest as test runner

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This PR allow us to use Vitest as test runner in plugins projects.

Vitest for e2e targets is still missing and a new PR will be raised
after https://github.com/nrwl/nx/issues/29139 is fixed

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #22882
2024-12-20 08:53:29 -05:00
Colum Ferry 2143ea5e30 fix(angular): set up host and remote ssr apps correctly #29442 (#29447)
## Current Behavior
During the update to support Angular 19, the host and remote generators'
`updateSsrSetup` function was missed.

This led to the creation of a second `server.ts` file, which would
result in the node server trying to instantiate twice.

## Expected Behavior
Fix the path normalization dependent on angular major version to ensure
only one server will be instantiated.

## Related Issue(s)

Fixes #29442
2024-12-20 13:40:40 +00:00
Zach Tindall efa5ba2bb6 fix(core): update yarn-parser to handle yarn v4 syntax (#29067)
Update the yarn-parser so that yarn.lock file generation works with yarn
v4

## Current Behavior
yarn.lock is not correctly created when using yarn v4

```
"":
  version: 1.22.8
  resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin<compat/resolve>::version=1.22.8&hash=c3c19d"
  dependencies:
    is-core-module: "npm:^2.13.0"
    path-parse: "npm:^1.0.7"
    supports-preserve-symlinks-flag: "npm:^1.0.0"
  bin:
    resolve: bin/resolve
  checksum: 0446f024439cd2e50c6c8fa8ba77eaa8370b4180f401a96abf3d1ebc770ac51c1955e12764cde449fde3fff480a61f84388e3505ecdbab778f4bef5f8212c729
  languageName: node
  linkType: hard
```


## Expected Behavior
yarn.lock should be created correctly with no missing keys


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #19881
2024-12-19 23:07:06 -05:00
Craigory Coppola 09800062e7 fix(core): graph spinners should update properly (#29433)
## Current Behavior
Spinners are not updated properly

## Expected Behavior
Spinners are updated properly

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-19 22:09:28 +00:00
Colum Ferry 16c8ba164c fix(module-federation): dynamic federation helpers should normalize remote names (#29427)
## Current Behavior
After migration of existing remotes beyond Nx 19.8, dynamic manifest
federation files may be updated to match the normalized names of JS
variables (`_` instead of `-`).
Project names will not have been migrated, and therefore the logic to
find the projects based on the remote names is broken.

## Expected Behavior
Check the project graph for remote names as-is and by transforming `_`
to `-` to see if the project exists
2024-12-19 17:17:27 +00:00
Craigory Coppola 3c3d2e5f82 feat(core): show progress on ci if graph construction takes longer than expected (#29392)
Progress spinners currently only show up when the terminal is a tty.
This updates it to show static text on CI, but at a longer duration
2024-12-19 11:34:51 -05:00
Colum Ferry ba1641d7fd fix(bundling): ensure vitest timestamp files are ignored (#29418)
## Current Behavior
Vitest TS config files produce timestamp temp files during project graph
creation which are cleaned up.
However, the creation and deletion of these files triggers the daemon to
recalculate graph.
It ends up in a loop.
The vite timestamp files were already added to the gitignore to prevent
this.

## Expected Behavior
Add vitest timestamp files to gitignore
2024-12-19 16:04:04 +00:00
Leosvel Pérez Espinosa bb806b3ef3 fix(testing): force node10 module resolution for jest atomized tasks (#29421)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-19 10:55:18 -05:00
Colum Ferry 77ba049e11 fix(angular): normalize name when forced to build selector (#29417)
## Current Behavior
When passing a project name with a `/` in it to the library generator,
this name passes through to the `component` generator.
The `component` generator may then attempt to build a selector from this
name, however, it does not normalize the `/`.

## Expected Behavior
Ensure the `/` is normalized from the name when building the selector

## Related Issue(s)

Fixes #29229
2024-12-19 15:00:53 +00:00
Phillip Barta 7a583dacc6 cleanup(repo): remove unused dependencies (#27676) 2024-12-19 18:45:57 +04:00
Nicolas Beaussart 0ebe59cda9 fix(js): handle resolution from within node_module in the sync generator (#29412)
closed #29411

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The resolve function from ts.System returning the full path, and so
including the workspaceRoot that is also append by the FsTree

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Resolution within node_modules are correctly followed

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29411
2024-12-19 15:23:24 +01:00
Colum Ferry 2db82dd36d feat(rsbuild): move plugin export to root of package (#29415)
## Current Behavior
The Rsbuild plugin is exported at `@nx/rsbuild/plugin`


## Expected Behavior
Export the plugin from `@nx/rsbuild` i.e. the root of the package.
2024-12-19 14:09:57 +00:00
Colum Ferry 656d69b466 fix(module-federation): ensure @nx/module-federation package is installed for users (#29416)
## Current Behavior
The `@nx/module-federation` package is a direct dependency of some of
the other packages in the Nx Plugin ecosystem.
It should be resolved correctly by package managers such that it can be
used when setting up MF projects.

However, some users are facing issues with module resolutions where the
package is not found as expected.

## Expected Behavior
Install the package directly for the user to ensure module resolution
works as expected.

## Related Issue(s)

Fixes #29269
2024-12-19 14:09:48 +00:00
James Henry dfd5014792 chore(repo): add conformance rule for our package.json files (#29078) 2024-12-19 16:17:00 +04:00
Chau Tran 2eb524307b fix(core): make packageExports metadata optional field (#29407) 2024-12-18 20:28:52 -06:00
Philip Fulcher bdc7634eb8 chore(nx-dev): add bluesky to footer and community page (#29379)
## Current Behavior
Bluesky is not linked in the footer or community page.

## Expected Behavior
Bluesky is linked on the footer and community page.
2024-12-18 14:51:30 -07:00
Jack Hsu b9c0e3db5f feat(eslint): rename eslint.config.js to eslint.config.cjs to resolve them as CommonJS (#29334)
This PR updates our generators to use `eslint.config.cjs` instead of
`eslint.config.js` so that Node resolution will treat it as CommonJS.
This solves an issue where having `"type": "module"` in `package.json`
will result in an error when Node tries to resolve the config file as
ESM.

Also allows us to clean up out Remix generators to not have to rename to
`eslint.config.cjs` to solve the same issue.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-18 16:34:10 -05:00
Nicholas Cunningham a675bd2a06 fix(js): Configure typescript plugin to handle non-buildable libs (#29393)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, we are excluding non-buildable libs from the
`@nx/js/typescript` plugin. Although that allows non-buildable projects
from have the build target being inferred it also as a side-effect
removes the `typecheck` target which is unintended. Additionally, to
breaks the pattern of being self containment that TS project solutions
brings as we were modifying the root `nx.json`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
1. Non-buildable libs should not have a build target.
2. Non-buildable libs should have the typecheck target.
3. Buildable libs remain unchanged and should have both a build and
typecheck target.
4. Remove the `exclude` from `nx.json` for non-buildable libs.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-18 15:20:29 -05:00
Juri Strumpflohner 1a013464ff fix(nx-dev): update hero image on blog post (#29405)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-18 14:53:39 -05:00
Jason Jean ac22add400 chore(repo): use default cache directory (#29390)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Multiple workspaces using the cache directory is causing mismatches with
the db in the workspace data directory.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

We don't need the separate cache directory so we'll go back to using the
default in the workspace.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-18 14:29:07 -05:00
Nicholas Cunningham d05f30fb01 fix(core): Adding react apps/libs to workspaces so they can be referenced. (#29202)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
This PR address a few things:

1. When we generate an app or a library using the new TS Solution they
are not added to the workspaces/packages option.
2. Currently, when we use `pnpm` to generate a workspace the
`pnpm-workspace.yaml` looks like below which is not correct
```
packages: 
  - packages/**
```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

1. Libraries and apps should be referenced correctly out of the box so
that they can be symlinked after installation.
2. The intended `pnpm-workspace.yaml` should look similar to:
```
packages: 
  - 'packages/**'
  - 'demo'
```

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-12-18 12:39:47 -05:00
Colum Ferry 4b586a1acc feat(rsbuild): add react and vue support for app generation (#29349)
## Current Behavior
We do not have a generator that can scaffold a react or vue app using
rsbuild.


## Expected Behavior
Update the react application generator to support a bundler option of
rsbuild
Update the vue application generator to support a bundler option of
rsbuild
2024-12-18 11:44:21 -05:00
Jack Hsu b03c9c1e38 feat(core): add lib/** glob to workspaces so we support it out of the box (#29403)
We use `libs` a lot in our content, and use it ourselves in our own
monorepo. Some teams prefer it to `packages` so we should include it by
default.
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-18 11:32:48 -05:00
Juri Strumpflohner 7ab59458e3 docs(nx-dev): article on task inference (#29330) 2024-12-18 17:05:43 +01:00
Jack Hsu 0720f3f9b4 feat(core): nx-plugin-checks accounts for outDir and rootDir of projects when checking file existence (#29391)
For Nx plugins that use the the new TS solution setup, we need to
account for `generators.json`, `executors.json`, and `migrations.json`
pointing to `dist` rather than source.

This PR adds two options, `rootDir` and `outDir`, that allows the lint
rule to check the source files rather than depend on build artifacts.
The defaults are what we generate our plugins with.


<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-18 10:05:55 -05:00
Leosvel Pérez Espinosa 6bb0c2e5f0 feat(angular): support ngrx v19 (#29398)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-18 10:05:32 -05:00
MaxKless b1303d1121 docs(misc): add docs for Nx Console & Nx Cloud integration (#29401)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-12-18 09:27:01 -05:00
Isaac Mann 6051e6e208 docs(core): fix references to createNodes v1 (#29400) 2024-12-18 08:15:04 -05:00
James Henry 5f77d65554 chore(release): fix e2e (#29399) 2024-12-18 16:28:39 +04:00
James Henry 73735ca247 feat(release): allow automated git push from version or changelog step (#29280) 2024-12-18 13:29:47 +04:00
Mike Haas fb40366180 chore(core): nx plugin modification @nx-tools/nx-container (#29394)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

This is just a simple url update, you can observe the old url is no
longer valid because the structure of the git repo has changed

Co-authored-by: Michael Haas <michael.haas@futurewiseinsurance.com>
2024-12-17 19:12:16 -05:00
Nicholas Cunningham 0329cad1d1 fix(core): Update move/remove workspace generators to work with ts project references (#29331)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When a workspace is setup to use ts project references the move/remove
generators from `@nx/workspace` do not work correctly or result in an
incorrect state for the workspace.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This should work OOTB.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-17 13:37:28 -05:00
Emily Xiong 0888977c13 fix(gradle): cache gradle report (#29381)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`./gradlew projectReport` is run everytime Nx calculates the graph.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Results of `./gradlew projectReport` are cached until gradle files have
been changed. This improves the performance of the gradle graph plugin.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-12-17 12:45:19 -05:00
Isaac Mann 1963a0cf27 docs(core): common tasks page (#29376)
Create a common task names concept page.

The main purpose of this page is to have a good search result for people
searching for "build", "test" or "lint" in our docs search. These terms
are regularly in the top 10 most searched terms.
2024-12-17 11:06:05 -05:00
4133 changed files with 495213 additions and 50657 deletions
+3 -153
View File
@@ -1,13 +1,5 @@
version: 2.1
# -------------------------
# ORBS
# -------------------------
orbs:
nx: nrwl/nx@1.6.2
rust: circleci/rust@1.6.0
browser-tools: circleci/browser-tools@1.4.8
# -------------------------
# EXECUTORS
# -------------------------
@@ -19,56 +11,9 @@ executors:
linux:
<<: *defaults
docker:
- image: cimg/rust:1.73.0-browsers
resource_class: medium+
- image: cimg/rust:1.84.0-browsers
resource_class: small
macos:
<<: *defaults
resource_class: macos.m1.medium.gen1
macos:
xcode: '14.2.0'
# -------------------------
# COMMANDS
# -------------------------
commands:
run-pnpm-install:
parameters:
os:
type: string
steps:
- restore_cache:
name: Restore pnpm Package Cache
keys:
- node-deps-{{ arch }}-v3-{{ checksum "pnpm-lock.yaml" }}
- when:
condition:
equal: [<< parameters.os >>, linux]
steps:
- run:
name: Install pnpm package manager (linux)
command: |
npm install --prefix=$HOME/.local -g @pnpm/exe@9.8.0
- when:
condition:
equal: [<< parameters.os >>, macos]
steps:
- run:
name: Install pnpm package manager (macos)
command: |
npm install -g @pnpm/exe@9.8.0
- run:
name: Install Dependencies
command: |
pnpm install --frozen-lockfile
pnpm playwright install --with-deps
- save_cache:
name: Save pnpm Package Cache
key: node-deps-{{ arch }}-v3-{{ checksum "pnpm-lock.yaml" }}
paths:
- ~/.pnpm-store
- ~/.cache/Cypress
- node_modules
# -------------------------
# JOBS
# -------------------------
@@ -78,101 +23,8 @@ jobs:
# -------------------------
main-linux:
executor: linux
environment:
NX_E2E_CI_CACHE_KEY: e2e-circleci-linux
NX_DAEMON: 'true'
NX_PERF_LOGGING: 'false'
NX_VERBOSE_LOGGING: 'false'
NX_NATIVE_LOGGING: 'false'
NX_E2E_RUN_E2E: 'true'
NX_CI_EXECUTION_ENV: 'linux'
NX_CLOUD_DTE_V2: 'true'
NX_CLOUD_DTE_SUMMARY: 'true'
NX_CLOUD_NO_TIMEOUTS: 'true'
steps:
- checkout
- nx/set-shas:
main-branch-name: 'master'
- run: npx nx-cloud@next start-ci-run --distribute-on="./.nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
- run:
command: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- browser-tools/install-chrome
- run-pnpm-install:
os: linux
- run:
name: Check Documentation
command: pnpm nx documentation --no-dte
no_output_timeout: 20m
- run:
name: Run Checks/Lint/Test/Build
no_output_timeout: 60m
command: |
pids=()
pnpm nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD &
pids+=($!)
pnpm nx-cloud record -- nx sync:check
pids+=($!)
pnpm nx-cloud record -- nx-cloud conformance:check
pids+=($!)
pnpm nx run-many -t check-imports check-commit check-lock-files check-codeowners documentation --parallel=1 --no-dte &
pids+=($!)
pnpm nx affected --targets=lint,test,build,e2e,e2e-ci --base=$NX_BASE --head=$NX_HEAD --parallel=3 &
pids+=($!)
for pid in "${pids[@]}"; do
wait "$pid"
done
# -------------------------
# JOBS: Main-MacOS
# -------------------------
mainmacos:
executor: macos
environment:
NX_E2E_CI_CACHE_KEY: e2e-circleci-macos
NX_PERF_LOGGING: 'false'
NX_CI_EXECUTION_ENV: 'macos'
SELECTED_PM: 'npm' # explicitly define npm for macOS tests
steps:
- checkout
- restore_cache:
name: Restore Homebrew packages
keys:
- nrwl-nx-homebrew-packages
- run:
name: Configure Detox Environment, Install applesimutils
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
xcrun simctl shutdown all && xcrun simctl erase all
no_output_timeout: 20m
- save_cache:
name: Save Homebrew Cache
key: nrwl-nx-homebrew-packages
paths:
- /usr/local/Homebrew
- ~/Library/Caches/Homebrew
- run-pnpm-install:
os: macos
- rust/install
- nx/set-shas:
main-branch-name: 'master'
- run:
name: Run E2E Tests for macOS
command: |
HAS_CHANGED=$(node ./scripts/check-react-native-changes.js $NX_BASE $NX_HEAD);
if $HAS_CHANGED; then
pnpm nx affected -t e2e-macos-local --parallel=1 --base=$NX_BASE --head=$NX_HEAD
else
echo "Skip E2E tests for macOS as there are no changes in React Native projects."
fi
no_output_timeout: 45m
- run: echo "We are in the process of transitioning from Circle CI to GitHub Actions. For details about your build results, consult github actions build logs."
# -------------------------
# WORKFLOWS(JOBS)
@@ -183,5 +35,3 @@ workflows:
build:
jobs:
- main-linux
- mainmacos:
name: main-macos-e2e
+15 -1
View File
@@ -9,7 +9,21 @@
"extends": ["plugin:storybook/recommended"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-restricted-imports": ["error", "create-nx-workspace"],
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "create-nx-workspace",
"message": "Please import utils from nx or @nx/devkit instead."
},
{
"name": "node-fetch",
"message": "Please default to native fetch instead of 'node-fetch'."
}
]
}
],
"@typescript-eslint/no-restricted-imports": [
"error",
{
+1 -1
View File
@@ -60,7 +60,7 @@ body:
label: Package Manager Version
description: |
If `nx report` doesn't work, please provide the name and the version of your package manager.
You can get version information by running `yarn --version`, `pnpm --version` or `npm --version`, depending on the package manager used.
You can get version information by running `PACKAGE_MANAGER --version`, where PACKAGE_MANAGER is any of `yarn`, `pnpm`, `bun` or `npm`, depending on the package manager used.
- type: checkboxes
id: os
attributes:
+185
View File
@@ -0,0 +1,185 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- "**"
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
jobs:
main-linux:
runs-on: ubuntu-latest
env:
NX_E2E_CI_CACHE_KEY: e2e-github-linux
NX_DAEMON: 'true'
NX_PERF_LOGGING: 'false'
NX_VERBOSE_LOGGING: 'false'
NX_NATIVE_LOGGING: 'false'
NX_E2E_RUN_E2E: 'true'
NX_CI_EXECUTION_ENV: 'linux'
NX_CLOUD_NO_TIMEOUTS: 'true'
NX_ALLOW_NON_CACHEABLE_DTE: 'true'
NX_CLOUD_USE_NEW_TASK_APIS: 'true'
NX_CLOUD_USE_NEW_STREAM_OUTPUT: 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Fetch Master
run: git fetch origin master:master
if: ${{ github.event_name == 'pull_request' }}
- name: Set SHAs
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'master'
- name: Start CI Run
run: npx nx-cloud@next start-ci-run --distribute-on="./.nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
run_install: false
- name: Install project dependencies
run: |
pnpm install --frozen-lockfile
pnpm playwright install --with-deps
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Check Documentation
run: pnpm nx documentation
timeout-minutes: 20
- name: Run Checks/Lint/Test/Build
run: |
pids=()
pnpm nx-cloud record -- nx format:check &
pids+=($!)
pnpm nx-cloud record -- nx sync:check
pids+=($!)
pnpm nx-cloud record -- nx-cloud conformance:check
pids+=($!)
pnpm nx run-many -t check-imports check-commit check-lock-files check-codeowners --parallel=1 --no-dte &
pids+=($!)
pnpm nx affected --targets=lint,test,build,e2e,e2e-ci,format-native,lint-native &
pids+=($!)
for pid in "${pids[@]}"; do
wait "$pid"
done
timeout-minutes: 100
main-macos:
runs-on: macos-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}${{ contains(github.event_name, 'push') && format('-{0}', github.sha) || '' }}
cancel-in-progress: true
env:
NX_E2E_CI_CACHE_KEY: e2e-github-macos
NX_PERF_LOGGING: 'false'
NX_CI_EXECUTION_ENV: 'macos'
SELECTED_PM: 'npm'
steps:
- name: Log concurrency info
run: |
echo "Concurrency group: ${{ github.workflow }}-${{ github.ref }}${{ contains(github.event_name, 'push') && format('-{0}', github.sha) || '' }}"
echo "Concurrency cancel-in-progress: ${{ !contains(github.event_name, 'push') }}"
echo "Concurrency cancel-event-name: ${{ github.event_name }}"
if: always()
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Fetch Master
run: git fetch origin master:master
if: ${{ github.event_name == 'pull_request' }}
- name: Restore Homebrew packages
uses: actions/cache@v4
with:
path: |
/opt/homebrew
~/Library/Caches/Homebrew
key: nrwl-nx-homebrew-packages
- name: Configure Detox Environment, Install applesimutils
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
xcrun simctl shutdown all && xcrun simctl erase all
timeout-minutes: 20
- name: Save Homebrew Cache
uses: actions/cache@v4
with:
path: |
/opt/homebrew
~/Library/Caches/Homebrew
key: nrwl-nx-homebrew-packages
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
run_install: false
- name: Install project dependencies
run: |
pnpm install --frozen-lockfile
pnpm playwright install --with-deps
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set SHAs
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'master'
- name: Run E2E Tests for macOS
run: |
HAS_CHANGED=$(node ./scripts/check-react-native-changes.js $NX_BASE $NX_HEAD);
if $HAS_CHANGED; then
pnpm nx affected -t e2e-macos-local --parallel=1 --base=$NX_BASE --head=$NX_HEAD
else
echo "Skip E2E tests for macOS as there are no changes in React Native projects."
fi
+127 -317
View File
@@ -19,29 +19,35 @@ jobs:
preinstall:
if: ${{ github.repository_owner == 'nrwl' }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node_version:
- 18
- 20
- 22
# - 23
exclude:
# run just node v20 on macos
- os: macos-latest
node_version: 18
# run just node v20 on macos and windows
- os: macos-latest
node_version: 22
# - os: macos-latest
# node_version: 23
- os: windows-latest
node_version: 22
# - os: windows-latest
# node_version: 23
name: Cache install (${{ matrix.os }}, node v${{ matrix.node_version }})
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- uses: pnpm/action-setup@v4
name: Install pnpm
@@ -99,300 +105,45 @@ jobs:
if: steps.cache-cypress.outputs.cache-hit != 'true'
run: npx cypress install
prepare-matrix:
name: Prepare matrix combinations
if: ${{ github.repository_owner == 'nrwl' }}
timeout-minutes: 5
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.process-json.outputs.MATRIX }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Process matrix data
id: process-json
run:
echo "MATRIX=$(npx tsx .github/workflows/nightly/process-matrix.ts | jq -c .)" >> $GITHUB_OUTPUT
e2e:
if: ${{ github.repository_owner == 'nrwl' }}
needs: preinstall
needs:
- preinstall
- prepare-matrix
permissions:
contents: read
runs-on: ${{ matrix.os }}
timeout-minutes: 90
timeout-minutes: 70 # <- cap each job to 70 minutes
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
node_version:
- 18
- 20
- 22
# - 23
package_manager:
- npm
- yarn
- pnpm
project:
- e2e-angular
- e2e-cypress
- e2e-detox
- e2e-esbuild
- e2e-eslint
- e2e-expo
- e2e-gradle
- e2e-jest
- e2e-js
- e2e-lerna-smoke-tests
- e2e-next
- e2e-node
- e2e-nuxt
- e2e-nx-init
- e2e-nx
- e2e-playwright
- e2e-plugin
- e2e-react
- e2e-react-native
- e2e-release
- e2e-remix
- e2e-rollup
- e2e-storybook
- e2e-vite
- e2e-vue
- e2e-web
- e2e-webpack
- e2e-workspace-create
include:
# os short names
- os: ubuntu-latest
os_name: 'Linux'
- os: macos-latest
os_name: 'MacOS'
# test timeouts
- os: ubuntu-latest
os_timeout: 60
- os: macos-latest
os_timeout: 90
# codeowner groups
- project: e2e-angular
codeowners: 'S04SS457V38'
- project: e2e-cypress
codeowners: 'S04T16BTJJY'
- project: e2e-detox
codeowners: 'S04TNCNJG5N'
- project: e2e-esbuild
codeowners: 'S04SJ6HHP0X'
- project: e2e-expo
codeowners: 'S04TNCNJG5N'
- project: e2e-gradle
codeowners: 'S04TNCNJG5N'
- project: e2e-jest
codeowners: 'S04T16BTJJY'
- project: e2e-js
codeowners: 'S04SJ6HHP0X'
- project: e2e-lerna-smoke-tests
codeowners: 'S04TNCVEETS'
- project: e2e-eslint
codeowners: 'S04SYJGKSCT'
- project: e2e-next
codeowners: 'S04TNCNJG5N'
- project: e2e-node
codeowners: 'S04SJ6HHP0X'
- project: e2e-nx-init
codeowners: 'S04SYHYKGNP'
- project: e2e-nx
codeowners: 'S04SYHYKGNP'
- project: e2e-plugin
codeowners: 'S04SYHYKGNP'
- project: e2e-release
codeowners: 'S04SYHYKGNP'
- project: e2e-react
codeowners: 'S04TNCNJG5N'
- project: e2e-react-native
codeowners: 'S04TNCNJG5N'
- project: e2e-web
codeowners: 'S04SJ6PL98X'
- project: e2e-rollup
codeowners: 'S04SJ6PL98X'
- project: e2e-storybook
codeowners: 'S04SVQ8H0G5'
- project: e2e-playwright
codeowners: 'S04SVQ8H0G5'
- project: e2e-remix
codeowners: 'S04SVQ8H0G5'
- project: e2e-vite
codeowners: 'S04SJ6PL98X'
- project: e2e-vue
codeowners: 'S04SJ6PL98X'
- project: e2e-nuxt
codeowners: 'S04SJ6PL98X'
- project: e2e-webpack
codeowners: 'S04SJ6PL98X'
- project: e2e-workspace-create
codeowners: 'S04SYHYKGNP'
exclude:
# exclude react-native tests from ubuntu
- os: ubuntu-latest
project: e2e-react-native
- os: ubuntu-latest
project: e2e-detox
- os: ubuntu-latest
project: e2e-expo
# exclude non-CNW/Lerna tests from non-LTS node versions
- node_version: 18
project: e2e-angular
- node_version: 18
project: e2e-cypress
- node_version: 18
project: e2e-detox
- node_version: 18
project: e2e-esbuild
- node_version: 18
project: e2e-expo
- node_version: 18
project: e2e-gradle
- node_version: 18
project: e2e-jest
- node_version: 18
project: e2e-js
- node_version: 18
project: e2e-eslint
- node_version: 18
project: e2e-next
- node_version: 18
project: e2e-node
- node_version: 18
project: e2e-nuxt
- node_version: 18
project: e2e-nx-init
- node_version: 18
project: e2e-nx
- node_version: 18
project: e2e-plugin
- node_version: 18
project: e2e-playwright
- node_version: 18
project: e2e-react
- node_version: 18
project: e2e-react-native
- node_version: 18
project: e2e-web
- node_version: 18
project: e2e-remix
- node_version: 18
project: e2e-rollup
- node_version: 18
project: e2e-storybook
- node_version: 18
project: e2e-vite
- node_version: 18
project: e2e-vue
- node_version: 18
project: e2e-webpack
- node_version: 22
project: e2e-angular
- node_version: 22
project: e2e-cypress
- node_version: 22
project: e2e-detox
- node_version: 22
project: e2e-esbuild
- node_version: 22
project: e2e-expo
- node_version: 22
project: e2e-gradle
- node_version: 22
project: e2e-jest
- node_version: 22
project: e2e-js
- node_version: 22
project: e2e-eslint
- node_version: 22
project: e2e-next
- node_version: 22
project: e2e-node
- node_version: 22
project: e2e-nuxt
- node_version: 22
project: e2e-nx-init
- node_version: 22
project: e2e-nx
- node_version: 22
project: e2e-plugin
- node_version: 22
project: e2e-playwright
- node_version: 22
project: e2e-react
- node_version: 22
project: e2e-react-native
- node_version: 22
project: e2e-web
- node_version: 22
project: e2e-remix
- node_version: 22
project: e2e-rollup
- node_version: 22
project: e2e-storybook
- node_version: 22
project: e2e-vite
- node_version: 22
project: e2e-vue
- node_version: 22
project: e2e-webpack
# - node_version: 23
# project: e2e-angular
# - node_version: 23
# project: e2e-cypress
# - node_version: 23
# project: e2e-detox
# - node_version: 23
# project: e2e-esbuild
# - node_version: 23
# project: e2e-expo
# - node_version: 23
# project: e2e-gradle
# - node_version: 23
# project: e2e-jest
# - node_version: 23
# project: e2e-js
# - node_version: 23
# project: e2e-eslint
# - node_version: 23
# project: e2e-next
# - node_version: 23
# project: e2e-node
# - node_version: 23
# project: e2e-nuxt
# - node_version: 23
# project: e2e-nx-init
# - node_version: 23
# project: e2e-nx
# - node_version: 23
# project: e2e-plugin
# - node_version: 23
# project: e2e-playwright
# - node_version: 23
# project: e2e-react
# - node_version: 23
# project: e2e-react-native
# - node_version: 23
# project: e2e-web
# - node_version: 23
# project: e2e-remix
# - node_version: 23
# project: e2e-rollup
# - node_version: 23
# project: e2e-storybook
# - node_version: 23
# project: e2e-vite
# - node_version: 23
# project: e2e-vue
# - node_version: 23
# project: e2e-webpack
# run just npm v20 on macos
- os: macos-latest
package_manager: yarn
- os: macos-latest
package_manager: pnpm
- os: macos-latest
node_version: 18
- os: macos-latest
node_version: 22
# - os: macos-latest
# node_version: 23
matrix: ${{fromJson(needs.prepare-matrix.outputs.matrix)}} # Load matrix from previous job
fail-fast: false
name: ${{ matrix.os_name }}/${{ matrix.package_manager }}/${{ matrix.node_version }} ${{ join(matrix.project) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Prepare dir for output
run: mkdir -p outputs
@@ -409,12 +160,22 @@ jobs:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v4
- name: Install Rust
if: ${{ matrix.os != 'windows-latest' }}
run: |
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup toolchain install 1.70.0
- name: Load Cargo Env
if: ${{ matrix.os != 'windows-latest' }}
run: echo "PATH=$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
- name: Install bun
if: ${{ matrix.os != 'windows-latest' }}
uses: oven-sh/setup-bun@v1
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ hashFiles('pnpm-lock.yaml') }}
bun-version: latest
- name: Install packages
run: pnpm install --frozen-lockfile
@@ -456,12 +217,23 @@ jobs:
if: steps.cache-cypress.outputs.cache-hit != 'true'
run: npx cypress install
- name: Install applesimutils, reset ios simulators
- name: Configure Detox Environment, Install applesimutils
if: ${{ matrix.os == 'macos-latest' }}
run: |
# Check if applesimutils is already installed
if ! brew list applesimutils &>/dev/null; then
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
else
echo "applesimutils is already installed, skipping installation"
fi
timeout-minutes: 10
- name: Reset iOS Simulators
if: ${{ matrix.os == 'macos-latest' }}
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
xcrun simctl shutdown all && xcrun simctl erase all
timeout-minutes: 5
- name: Configure git metadata (needed for lerna smoke tests)
run: |
@@ -470,30 +242,57 @@ jobs:
- name: Set starting timestamp
id: before-e2e
shell: bash
run: |
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
- name: Run e2e tests
id: e2e-run
run: pnpm nx run-many -t e2e-local -p ${{ matrix.project }}
- name: Run e2e tests with pnpm (Linux/Windows)
id: e2e-run-pnpm
if: ${{ matrix.os != 'macos-latest' }}
run: pnpm nx run ${{ matrix.project }}:e2e-local
shell: bash
timeout-minutes: ${{ matrix.os_timeout }}
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
NX_E2E_CI_CACHE_KEY: e2e-gha-${{ matrix.os }}-${{ matrix.node_version }}-${{ matrix.package_manager }}
NX_DAEMON: 'true'
NX_PERF_LOGGING: 'false'
NX_E2E_VERBOSE_LOGGING: 'true'
NX_NATIVE_LOGGING: 'false'
NX_E2E_RUN_E2E: 'true'
NX_CLOUD_NO_TIMEOUTS: 'true'
NX_E2E_SKIP_CLEANUP: 'true'
NODE_OPTIONS: --max_old_space_size=8192
SELECTED_PM: ${{ matrix.package_manager }}
npm_config_registry: http://localhost:4872
YARN_REGISTRY: http://localhost:4872
NX_CACHE_DIRECTORY: 'tmp'
NX_E2E_SKIP_CLEANUP: 'true'
NX_E2E_RUN_E2E: 'true'
NX_E2E_VERBOSE_LOGGING: 'true'
CI: true
- name: Run e2e tests with npm (macOS)
id: e2e-run-npm
if: ${{ matrix.os == 'macos-latest' }}
run: |
# Run the tests
if [[ "${{ matrix.project }}" == "e2e-detox" ]] || [[ "${{ matrix.project }}" == "e2e-react-native" ]] || [[ "${{ matrix.project }}" == "e2e-expo" ]]; then
NX_E2E_VERBOSE_DEBUG=1 pnpm nx run ${{ matrix.project }}:e2e-macos-local
else
NX_E2E_VERBOSE_DEBUG=1 pnpm nx run ${{ matrix.project }}:e2e-local
fi
env:
NX_E2E_CI_CACHE_KEY: e2e-gha-${{ matrix.os }}-${{ matrix.node_version }}-${{ matrix.package_manager }}
NX_PERF_LOGGING: 'false'
NX_DAEMON: 'true'
NX_SKIP_LOG_GROUPING: 'true'
NX_CI_EXECUTION_ENV: 'macos'
NX_E2E_VERBOSE_LOGGING: 'true'
NX_NATIVE_LOGGING: 'false'
NX_E2E_RUN_E2E: 'true'
NX_E2E_SKIP_CLEANUP: 'true'
NODE_OPTIONS: --max_old_space_size=8192
SELECTED_PM: 'npm'
npm_config_registry: http://localhost:4872
YARN_REGISTRY: http://localhost:4872
DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer'
CI: true
- name: Save matrix config in file
if: ${{ always() }}
@@ -503,48 +302,54 @@ jobs:
before=${{ steps.before-e2e.outputs.timestamp }}
now=$(date +%s)
delta=$(($now - $before))
# Determine the outcome based on which step ran
outcome="${{ matrix.os == 'macos-latest' && steps.e2e-run-npm.outcome || steps.e2e-run-pnpm.outcome }}"
matrix=$((
echo '${{ toJSON(matrix) }}'
) | jq --argjson delta $delta -c '. + { "status": "${{ steps.e2e-run.outcome}}", "duration": $delta }')
echo "$matrix" > matrix
path=outputs/${{ matrix.os_name}}-${{ matrix.node_version}}-${{ matrix.package_manager}}-${{ matrix.project }}
echo "path=$path" >> $GITHUB_OUTPUT
echo "$matrix" > $path
) | jq --argjson delta $delta -c '. + { "status": "'"$outcome"'", "duration": $delta }')
echo "$matrix" > 'outputs/matrix.json'
- name: Upload matrix config
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: outputs
name: ${{ matrix.os_name}}-${{ matrix.node_version}}-${{ matrix.package_manager}}-${{ matrix.project }}
overwrite: true
if-no-files-found: 'ignore'
path: ${{ steps.save-matrix.outputs.path }}
path: 'outputs/matrix.json'
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && failure() }}
uses: mxschmitt/action-tmate@v3.8
timeout-minutes: 15
with:
sudo: ${{ matrix.os != 'windows-latest' }} # disable sudo for windows debugging
process-result:
if: ${{ always() && github.repository_owner == 'nrwl' }}
runs-on: ubuntu-latest
needs: e2e
timeout-minutes: 10
outputs:
message: ${{ steps.process-json.outputs.SLACK_MESSAGE }}
proj-duration: ${{ steps.process-json.outputs.SLACK_PROJ_DURATION }}
pm-duration: ${{ steps.process-json.outputs.SLACK_PM_DURATION }}
codeowners: ${{ steps.process-json.outputs.CODEOWNERS }}
steps:
- name: Prepare dir for output
run: mkdir -p outputs
- name: Load outputs
uses: actions/download-artifact@v4
with:
name: outputs
path: outputs
- name: Join and stringify matrix configs
id: combine-json
run: |
combined=$((jq -s . outputs/*) | jq tostring)
combined=$((jq -s . outputs/*/matrix.json) | jq tostring)
echo "combined=$combined" >> $GITHUB_OUTPUT
- name: Make slack outputs
@@ -581,6 +386,7 @@ jobs:
});
result += `\`\`\``;
core.setOutput('SLACK_MESSAGE', trimSpace(result));
console.log(trimSpace(result));
function humanizeDuration(num) {
let res = '';
@@ -608,7 +414,7 @@ jobs:
};
const macosProjects = ['e2e-detox', 'e2e-expo', 'e2e-react-native'];
combined.forEach((matrix) => {
if (matrix.os_name === 'Linux' && matrix.node_version === 18) {
if (matrix.os_name === 'Linux' && matrix.node_version === 20) {
pmReport[matrix.package_manager] += matrix.duration;
}
if (matrix.os_name === 'Linux' || macosProjects.includes(matrix.project)) {
@@ -685,6 +491,7 @@ jobs:
needs: process-result
runs-on: ubuntu-latest
name: Report failure
timeout-minutes: 10
steps:
- name: Send notification
uses: ravsamhq/notify-slack-action@v2
@@ -702,6 +509,7 @@ jobs:
needs: e2e
runs-on: ubuntu-latest
name: Report status
timeout-minutes: 10
steps:
- name: Send notification
uses: ravsamhq/notify-slack-action@v2
@@ -717,6 +525,7 @@ jobs:
if: ${{ always() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: process-result
runs-on: ubuntu-latest
timeout-minutes: 10
name: Report duration per package manager
steps:
- name: Send notification
@@ -732,6 +541,7 @@ jobs:
if: ${{ always() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: process-result
runs-on: ubuntu-latest
timeout-minutes: 10
name: Report duration per package manager
steps:
- name: Send notification
-471
View File
@@ -1,471 +0,0 @@
name: E2E matrix (Windows)
on:
schedule:
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
env:
CYPRESS_CACHE_FOLDER: ${{ github.workspace }}/.cypress
permissions: { }
jobs:
preinstall:
if: ${{ github.repository_owner == 'nrwl' }}
runs-on: windows-latest
strategy:
matrix:
node_version:
- 18
- 20
- 22
# - 23
name: Cache install (node v${{ matrix.node_version }})
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
run_install: false
- name: Set node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v4
with:
lookup-only: true
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install packages
if: steps.cache-modules.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v4
with:
lookup-only: true
path: '${{ github.workspace }}/.cypress'
key: windows-cypress
- name: Install Cypress
if: steps.cache-cypress.outputs.cache-hit != 'true'
run: pnpm cypress install
e2e:
if: ${{ github.repository_owner == 'nrwl' }}
needs: preinstall
permissions:
contents: read
runs-on: windows-latest
strategy:
matrix:
node_version:
- 18
- 20
- 22
# - 23
package_manager:
- npm
project:
- e2e-angular
- e2e-cypress
- e2e-esbuild
- e2e-eslint
- e2e-jest
- e2e-js
- e2e-lerna-smoke-tests
- e2e-next
- e2e-node
- e2e-nuxt
- e2e-nx-init
- e2e-nx
- e2e-playwright
- e2e-plugin
- e2e-react
- e2e-release
- e2e-remix
- e2e-rollup
- e2e-storybook
- e2e-vite
- e2e-vue
- e2e-web
- e2e-webpack
- e2e-workspace-create
include:
# codeowner groups
- project: e2e-angular
codeowners: 'S04SS457V38'
- project: e2e-cypress
codeowners: 'S04T16BTJJY'
- project: e2e-esbuild
codeowners: 'S04SJ6HHP0X'
- project: e2e-jest
codeowners: 'S04T16BTJJY'
- project: e2e-js
codeowners: 'S04SJ6HHP0X'
- project: e2e-lerna-smoke-tests
codeowners: 'S04TNCVEETS'
- project: e2e-eslint
codeowners: 'S04SYJGKSCT'
- project: e2e-next
codeowners: 'S04TNCNJG5N'
- project: e2e-node
codeowners: 'S04SJ6HHP0X'
- project: e2e-nx-init
codeowners: 'S04SYHYKGNP'
- project: e2e-nx
codeowners: 'S04SYHYKGNP'
- project: e2e-plugin
codeowners: 'S04SYHYKGNP'
- project: e2e-release
codeowners: 'S04SYHYKGNP'
- project: e2e-react
codeowners: 'S04TNCNJG5N'
- project: e2e-web
codeowners: 'S04SJ6PL98X'
- project: e2e-rollup
codeowners: 'S04SJ6PL98X'
- project: e2e-storybook
codeowners: 'S04SVQ8H0G5'
- project: e2e-playwright
codeowners: 'S04SVQ8H0G5'
- project: e2e-remix
codeowners: 'S04SVQ8H0G5'
- project: e2e-vite
codeowners: 'S04SJ6PL98X'
- project: e2e-vue
codeowners: 'S04SJ6PL98X'
- project: e2e-nuxt
codeowners: 'S04SJ6PL98X'
- project: e2e-webpack
codeowners: 'S04SJ6PL98X'
- project: e2e-workspace-create
codeowners: 'S04SYHYKGNP'
exclude:
# exclude non-CNW/Lerna tests from non-LTS node versions
- node_version: 18
project: e2e-angular
- node_version: 18
project: e2e-cypress
- node_version: 18
project: e2e-esbuild
- node_version: 18
project: e2e-jest
- node_version: 18
project: e2e-js
- node_version: 18
project: e2e-eslint
- node_version: 18
project: e2e-next
- node_version: 18
project: e2e-node
- node_version: 18
project: e2e-nuxt
- node_version: 18
project: e2e-nx-init
- node_version: 18
project: e2e-nx
- node_version: 18
project: e2e-plugin
- node_version: 18
project: e2e-playwright
- node_version: 18
project: e2e-react
- node_version: 18
project: e2e-web
- node_version: 18
project: e2e-remix
- node_version: 18
project: e2e-rollup
- node_version: 18
project: e2e-storybook
- node_version: 18
project: e2e-vite
- node_version: 18
project: e2e-vue
- node_version: 18
project: e2e-webpack
- node_version: 22
project: e2e-angular
- node_version: 22
project: e2e-cypress
- node_version: 22
project: e2e-esbuild
- node_version: 22
project: e2e-jest
- node_version: 22
project: e2e-js
- node_version: 22
project: e2e-eslint
- node_version: 22
project: e2e-next
- node_version: 22
project: e2e-node
- node_version: 22
project: e2e-nuxt
- node_version: 22
project: e2e-nx-init
- node_version: 22
project: e2e-nx
- node_version: 22
project: e2e-plugin
- node_version: 22
project: e2e-playwright
- node_version: 22
project: e2e-react
- node_version: 22
project: e2e-web
- node_version: 22
project: e2e-remix
- node_version: 22
project: e2e-rollup
- node_version: 22
project: e2e-storybook
- node_version: 22
project: e2e-vite
- node_version: 22
project: e2e-vue
- node_version: 22
project: e2e-webpack
# - node_version: 23
# project: e2e-angular
# - node_version: 23
# project: e2e-cypress
# - node_version: 23
# project: e2e-esbuild
# - node_version: 23
# project: e2e-jest
# - node_version: 23
# project: e2e-js
# - node_version: 23
# project: e2e-eslint
# - node_version: 23
# project: e2e-next
# - node_version: 23
# project: e2e-node
# - node_version: 23
# project: e2e-nuxt
# - node_version: 23
# project: e2e-nx-init
# - node_version: 23
# project: e2e-nx
# - node_version: 23
# project: e2e-plugin
# - node_version: 23
# project: e2e-playwright
# - node_version: 23
# project: e2e-react
# - node_version: 23
# project: e2e-web
# - node_version: 23
# project: e2e-remix
# - node_version: 23
# project: e2e-rollup
# - node_version: 23
# project: e2e-storybook
# - node_version: 23
# project: e2e-vite
# - node_version: 23
# project: e2e-vue
# - node_version: 23
# project: e2e-webpack
fail-fast: false
name: ${{ matrix.project }} (v${{ matrix.node_version }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare dir for output
run: mkdir -p outputs
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
run_install: false
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ github.run_id }}
- name: Install packages
run: pnpm install --frozen-lockfile
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v4
with:
path: '${{ github.workspace }}/.cypress'
key: ${{ runner.os }}-cypress
- name: Install Cypress
if: steps.cache-cypress.outputs.cache-hit != 'true'
run: npx cypress install
- name: Configure git metadata (needed for lerna smoke tests)
run: |
git config --global user.email test@test.com
git config --global user.name "Test Test"
- name: Run e2e tests
id: e2e-run
run: pnpm nx run ${{ matrix.project }}:e2e-local
shell: bash
timeout-minutes: 180
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
NX_E2E_CI_CACHE_KEY: e2e-gha-windows-${{ matrix.node_version }}-${{ matrix.package_manager }}
NODE_OPTIONS: --max_old_space_size=8192
SELECTED_PM: ${{ matrix.package_manager }}
npm_config_registry: http://localhost:4872
NX_CACHE_DIRECTORY: 'tmp'
NX_E2E_SKIP_CLEANUP: 'true'
NX_E2E_RUN_E2E: 'true'
NX_E2E_VERBOSE_LOGGING: 'true'
NX_PERF_LOGGING: 'false'
NX_DAEMON: 'true'
NX_SKIP_LOG_GROUPING: 'true'
- name: Save matrix config in file
if: ${{ always() }}
id: save-matrix
shell: bash
run: |
matrix=$((
echo '${{ toJSON(matrix) }}'
) | jq -c '. + { "status": "${{ steps.e2e-run.outcome}}" }')
echo "$matrix" > matrix
path=outputs/windows-${{ matrix.node_version}}-${{ matrix.package_manager}}-${{ matrix.project }}
echo "path=$path" >> $GITHUB_OUTPUT
echo "$matrix" > $path
- name: Upload matrix config
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: outputs
overwrite: true
if-no-files-found: 'ignore'
path: ${{ steps.save-matrix.outputs.path }}
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && failure() }}
uses: mxschmitt/action-tmate@v3.8
timeout-minutes: 15
with:
sudo: false # disable sudo for windows debugging
process-result:
if: ${{ always() && github.repository_owner == 'nrwl' }}
runs-on: ubuntu-latest
needs: e2e
outputs:
message: ${{ steps.process-json.outputs.SLACK_MESSAGE }}
codeowners: ${{ steps.process-json.outputs.CODEOWNERS }}
steps:
- name: Load outputs
uses: actions/download-artifact@v4
with:
name: outputs
path: outputs
- name: Join and stringify matrix configs
id: combine-json
shell: bash
run: |
combined=$((jq -s . outputs/*) | jq tostring)
echo "combined=$combined" >> $GITHUB_OUTPUT
- name: Make slack outputs
id: process-json
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ github.token }}
with:
script: |
const combined = JSON.parse(${{ steps.combine-json.outputs.combined }});
const failedProjects = combined.filter(c => c.status === 'failure').sort((a, b) => a.project.localeCompare(b.project));
// codeowners
const codeowners = new Set();
failedProjects.forEach(c => {
codeowners.add(c.codeowners);
});
core.setOutput('CODEOWNERS', Array.from(codeowners).join(','));
// message
let result = `
*OS* Windows
*Package manager* npm
\`\`\`
| Failed project | Node |
|--------------------------------|------|`;
failedProjects.forEach(matrix => {
result += `\n| ${matrix.project.padEnd(30)} | v${matrix.node_version} |`
});
result += `\`\`\``;
const message = result.split('\n').map(l => l.trim()).join('\n');
core.setOutput('SLACK_MESSAGE', message);
report-failure:
if: ${{ failure() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: process-result
runs-on: ubuntu-latest
name: Report failure
steps:
- name: Send notification
uses: ravsamhq/notify-slack-action@v2
with:
status: 'failure'
message_format: '{emoji} Workflow has {status_message} ${{ needs.process-result.outputs.message }}'
notification_title: '{workflow}'
footer: '<{run_url}|View Run> / Last commit <{commit_url}|{commit_sha}>'
mention_groups: ${{ needs.process-result.outputs.codeowners }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
report-success:
if: ${{ success() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: e2e
runs-on: ubuntu-latest
name: Report success
steps:
- name: Send notification
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ needs.e2e.result }}
message_format: '{emoji} Workflow has {status_message}'
notification_title: '{workflow}'
footer: '<{run_url}|View Run> / Last commit <{commit_url}|{commit_sha}>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
+2 -2
View File
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
node-version: ['20.19.0']
steps:
- name: Checkout
@@ -19,7 +19,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: '20.19.0'
- name: Install pnpm
uses: pnpm/action-setup@v4
+2 -2
View File
@@ -25,7 +25,7 @@ jobs:
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20.19.0'
cache: 'pnpm'
- name: Cache node_modules
@@ -50,7 +50,7 @@ jobs:
- name: Collect Issue Data
id: collect
run: npx ts-node ./scripts/issues-scraper/index.ts
run: npx tsx ./scripts/issues-scraper/index.ts
env:
GITHUB_TOKEN: ${{ github.token }}
+117
View File
@@ -0,0 +1,117 @@
type MatrixDataProject = {
name: string,
codeowners: string,
};
type MatrixDataOS = {
os: string, // GH runner machine name: e.g. ubuntu-latest
os_name: string, // short name that will be printed in the report and on the action
os_timeout: number, // 60
package_managers: string[], // package managers to run on this OS
node_versions: Array<number | string>, // node versions to run on this OS
excluded?: string[], // projects to exclude from running on this OS
};
type MatrixData = {
coreProjects: MatrixDataProject[],
projects: MatrixDataProject[],
nodeTLS: number,
setup: MatrixDataOS[],
}
// TODO: Extract Slack groups into named groups for easier maintenance
const matrixData: MatrixData = {
coreProjects: [
{ name: 'e2e-lerna-smoke-tests', codeowners: 'S04TNCVEETS' },
{ name: 'e2e-js', codeowners: 'S04SJ6HHP0X' },
{ name: 'e2e-nx-init', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-nx', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-release', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-workspace-create', codeowners: 'S04SYHYKGNP' }
],
projects: [
{ name: 'e2e-angular', codeowners: 'S04SS457V38' },
{ name: 'e2e-cypress', codeowners: 'S04T16BTJJY' },
{ name: 'e2e-detox', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-esbuild', codeowners: 'S04SJ6HHP0X' },
{ name: 'e2e-expo', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-gradle', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-jest', codeowners: 'S04T16BTJJY' },
{ name: 'e2e-eslint', codeowners: 'S04SYJGKSCT' },
{ name: 'e2e-next', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-node', codeowners: 'S04SJ6HHP0X' },
{ name: 'e2e-plugin', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-react', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-react-native', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-web', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-rollup', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-storybook', codeowners: 'S04SVQ8H0G5' },
{ name: 'e2e-playwright', codeowners: 'S04SVQ8H0G5' },
{ name: 'e2e-remix', codeowners: 'S04SVQ8H0G5' },
{ name: 'e2e-rspack', codeowners: 'S04SJ6HHP0X' },
{ name: 'e2e-vite', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-vue', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-nuxt', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-webpack', codeowners: 'S04SJ6PL98X' }
],
nodeTLS: 20,
setup: [
{ os: 'ubuntu-latest', os_name: 'Linux', os_timeout: 60, package_managers: ['npm', 'pnpm', 'yarn'], node_versions: ['20.19.0', "22.12.0"], excluded: ['e2e-detox', 'e2e-react-native', 'e2e-expo'] },
{ os: 'macos-latest', os_name: 'MacOS', os_timeout: 90, package_managers: ['npm'], node_versions: ['20.19.0'] },
{ os: 'windows-latest', os_name: 'WinOS', os_timeout: 180, package_managers: ['npm'], node_versions: ['20.19.0'], excluded: ['e2e-detox', 'e2e-react-native', 'e2e-expo'] }
]
};
const matrix: Array<{
project: string,
codeowners: string,
node_version: number | string,
package_manager: string,
os: string,
os_name: string,
os_timeout: number
}> = [];
function addMatrixCombo(project: MatrixDataProject, nodeVersion: number | string, pm: number, os: number) {
matrix.push({
project: project.name,
codeowners: project.codeowners,
node_version: nodeVersion,
package_manager: matrixData.setup[os].package_managers[pm],
os: matrixData.setup[os].os,
os_name: matrixData.setup[os].os_name,
os_timeout: matrixData.setup[os].os_timeout,
});
}
function processProject(project: MatrixDataProject, nodeVersion?: number) {
for (let os = 0; os < matrixData.setup.length; os++) {
for (let pm = 0; pm < matrixData.setup[os].package_managers.length; pm++) {
if (!matrixData.setup[os].excluded || !matrixData.setup[os].excluded?.includes(project.name)) {
if (nodeVersion) {
addMatrixCombo(project, nodeVersion, pm, os);
} else {
for (let n = 0; n < matrixData.setup[os].node_versions.length; n++) {
addMatrixCombo(project, matrixData.setup[os].node_versions[n], pm, os);
}
}
}
}
}
}
// process core projects
for (let p = 0; p < matrixData.coreProjects.length; p++) {
processProject(matrixData.coreProjects[p]);
}
// process other projects
for (let p = 0; p < matrixData.projects.length; p++) {
processProject(matrixData.projects[p], matrixData.nodeTLS);
}
if (matrix.length > 256) {
throw new Error('You have exceeded the size of the matrix. GitHub allows only 256 jobs in a matrix. Found ${matrix.length} jobs.');
}
// print result to stdout for pipeline to consume
process.stdout.write(JSON.stringify({ include: matrix }, null, 0));
+14 -4
View File
@@ -21,7 +21,7 @@ env:
DEBUG: napi:*
NX_RUN_GROUP: ${{ github.run_id }}-${{ github.run_attempt }}
CYPRESS_INSTALL_BINARY: 0
NODE_VERSION: 18
NODE_VERSION: 20.19.0
PNPM_VERSION: 9.8.0 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync)
jobs:
@@ -123,9 +123,13 @@ jobs:
settings:
- host: macos-13
target: x86_64-apple-darwin
setup: |-
rustup target add aarch64-apple-darwin
build: |
pnpm nx run-many --target=build-native -- --target=x86_64-apple-darwin
- host: windows-latest
setup: |-
rustup target add aarch64-pc-windows-msvc
build: pnpm nx run-many --target=build-native -- --target=x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
# Windows 32bit (not needed)
@@ -141,6 +145,7 @@ jobs:
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
rustup target add aarch64-unknown-linux-gnu &&
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
@@ -150,9 +155,12 @@ jobs:
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
rustup target add x86_64-unknown-linux-musl &&
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl
- host: macos-13
target: aarch64-apple-darwin
setup: |-
rustup target add aarch64-apple-darwin
build: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
@@ -168,12 +176,14 @@ jobs:
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
rustup target add aarch64-unknown-linux-gnu &&
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
setup: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf -y
rustup target add armv7-unknown-linux-gnueabihf
build: |
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=/usr/bin/arm-linux-gnueabihf-gcc pnpm nx run-many --target=build-native -- --target=armv7-unknown-linux-gnueabihf
# Android (not needed)
@@ -197,6 +207,8 @@ jobs:
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-musl
- host: windows-latest
target: aarch64-pc-windows-msvc
setup: |-
rustup target add aarch64-pc-windows-msvc
build: pnpm nx run-many --target=build-native -- --target=aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}
@@ -294,14 +306,12 @@ jobs:
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'schedule' && !github.event.inputs.pr }}
with:
repository: ${{ needs.resolve-required-data.outputs.repo }}
ref: ${{ needs.resolve-required-data.outputs.ref }}
- name: Build
id: build
if: ${{ github.event_name != 'schedule' && !github.event.inputs.pr }}
uses: cross-platform-actions/action@v0.25.0
env:
DEBUG: napi:*
@@ -343,7 +353,6 @@ jobs:
echo "COMPLETE"
- name: Upload artifact
if: ${{ github.event_name != 'schedule' && !github.event.inputs.pr }}
uses: actions/upload-artifact@v4
with:
name: bindings-freebsd
@@ -406,6 +415,7 @@ jobs:
VERSION: ${{ needs.resolve-required-data.outputs.version }}
DRY_RUN: ${{ needs.resolve-required-data.outputs.dry_run_flag }}
PUBLISH_BRANCH: ${{ needs.resolve-required-data.outputs.publish_branch }}
NX_VERBOSE_LOGGING: true
run: |
echo ""
# Create and check out the publish branch
+14
View File
@@ -2,6 +2,7 @@ node_modules
/.idea
/.fleet
/.vscode
/.cursor
dist
/build
/coverage
@@ -21,6 +22,7 @@ jest.debug.config.js
/graph/client/src/assets/generated-task-inputs
/graph/client/src/assets/generated-source-maps
/nx-dev/nx-dev/public/documentation
/nx-dev/nx-dev/public/tutorials
/nx-dev/nx-dev/public/images/open-graph
**/tests/temp-db
@@ -37,6 +39,9 @@ out
# Angular Cache
.angular
# Astro Cache
.astro
# Local dev files
.env.local
.bashrc
@@ -61,3 +66,12 @@ target
/wasi-sdk*
vite.config.*.timestamp*
storybook-static
# Ignore Gradle project-specific cache directory
.gradle
.kotlin
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
+1 -4
View File
@@ -1,4 +1 @@
pnpm check-lock-files
pnpm check-commit
pnpm documentation
pnpm pretty-quick --check
pnpm nx prepush --parallel 8 --tuiAutoExit 0
+67 -32
View File
@@ -1,37 +1,48 @@
launch-templates:
linux-medium:
resource-class: 'docker_linux_amd64/medium+'
image: 'ubuntu22.04-node20.11-v10'
image: 'us-east1-docker.pkg.dev/nxcloudoperations/nx-cloud/nx-agents-base-images:ubuntu22.04-node20.19-v1'
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
SELECTED_PM: 'pnpm'
NPM_CONFIG_PREFIX: '/home/workflows/.npm-global'
NX_NATIVE_LOGGING: 'nx::native::db'
init-steps:
- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml'
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/checkout/main.yaml'
- name: Check Node Version
script: node --version
- name: Cache restore
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/cache/main.yaml'
inputs:
key: 'pnpm-lock.yaml'
paths: |
node_modules
~/.cache/Cypress
~/.cache/ms-playwright
~/.pnpm-store
base_branch: 'master'
paths: .pnpm-store
base-branch: 'master'
- name: Install zip and unzip
script: sudo apt-get -yqq install zip unzip
- name: Install bun
script: |
curl -fsSL https://bun.sh/install | bash
echo "BUN_INSTALL=$HOME/.bun" >> $NX_CLOUD_ENV
echo "PATH=$HOME/.bun/bin:$PATH" >> $NX_CLOUD_ENV
- name: Check bun
script: |
bun --version
- name: Install e2e deps
script: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Install Pnpm
script: |
npm install -g pnpm@9.8.0
- name: Pnpm Install
- name: Pnpm Install from lockfile
script: |
pnpm install --frozen-lockfile
@@ -54,41 +65,61 @@ launch-templates:
- name: Load Cargo Env
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
- name: Install zip and unzip
script: sudo apt-get -yqq install zip unzip
- name: Setup Java 17
script: |
sudo apt update
sudo apt install -y openjdk-17-jdk
sudo update-alternatives --set java /usr/lib/jvm/java-17-openjdk-amd64/bin/java
java -version
- name: Setup Gradle
script: |
./gradlew wrapper
./gradlew --version
linux-extra-large:
resource-class: 'docker_linux_amd64/extra_large'
image: 'ubuntu22.04-node20.11-v10'
image: 'us-east1-docker.pkg.dev/nxcloudoperations/nx-cloud/nx-agents-base-images:ubuntu22.04-node20.19-v1'
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
SELECTED_PM: 'pnpm'
NPM_CONFIG_PREFIX: '/home/workflows/.npm-global'
NX_NATIVE_LOGGING: 'nx::native::db'
init-steps:
- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml'
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/checkout/main.yaml'
- name: Check Node Version
script: node --version
- name: Cache restore
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/cache/main.yaml'
inputs:
key: 'pnpm-lock.yaml'
paths: |
node_modules
~/.cache/Cypress
~/.cache/ms-playwright
~/.pnpm-store
base_branch: 'master'
paths: .pnpm-store
base-branch: 'master'
- name: Install zip and unzip
script: sudo apt-get -yqq install zip unzip
- name: Install bun
script: |
curl -fsSL https://bun.sh/install | bash
echo "BUN_INSTALL=$HOME/.bun" >> $NX_CLOUD_ENV
echo "PATH=$HOME/.bun/bin:$PATH" >> $NX_CLOUD_ENV
- name: Check bun
script: |
bun --version
- name: Install e2e deps
script: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Install Pnpm
script: |
npm install -g pnpm@9.8.0
- name: Pnpm Install
- name: Pnpm Install from lockfile
script: |
pnpm install --frozen-lockfile
@@ -111,5 +142,9 @@ launch-templates:
- name: Load Cargo Env
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
- name: Install zip and unzip
script: sudo apt-get -yqq install zip unzip
- name: Setup Java 21
script: |
sudo apt update
sudo apt install -y openjdk-21-jdk
sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java
java -version
+29 -7
View File
@@ -1,10 +1,32 @@
distribute-on:
default: auto linux-medium, 1 linux-extra-large
assignment-rules:
- project: nx-dev
target: build-base
runs-on:
- linux-extra-large
- target: test
runs-on:
- linux-medium
- targets:
- e2e-ci**
run-on:
- agent: linux-medium
parallelism: 1
- agent: linux-extra-large
parallelism: 1
- projects:
- nx-dev
targets:
- build*
run-on:
- agent: linux-extra-large
parallelism: 1
- targets:
- lint
run-on:
- agent: linux-medium
parallelism: 6
- targets:
- '*'
run-on:
- agent: linux-medium
parallelism: 3
- agent: linux-extra-large
parallelism: 3
+4 -1
View File
@@ -1,2 +1,5 @@
nx-dev/**/jest.config.js
.next
.next
_files
_solution
nx-dev/tutorial/**/templates
+5 -1
View File
@@ -13,6 +13,7 @@ packages/express/src/schematics/**/files/**/*.json
packages/nest/src/schematics/**/files/**/*.json
packages/react/src/schematics/**/files/**/*.json
packages/jest/src/schematics/**/files/**/*.json
packages/gradle/project-graph/build/**/*.*
packages/nx/src/plugins/js/lock-file/__fixtures__/**/*.*
packages/**/schematics/**/files/**/*.html
packages/**/generators/**/files/**/*.html
@@ -46,4 +47,7 @@ CODEOWNERS
.pnpm-store
/.nx/workspace-data
/.nx/workspace-data
/.nx/workflows/dynamic-changesets.yaml
_files
_solution
+2
View File
@@ -5,6 +5,8 @@ auth:
htpasswd:
file: ./htpasswd
max_body_size: 15mb
# a list of other known repositories we can talk to
uplinks:
npmjs:
+3 -4
View File
@@ -6,7 +6,7 @@
/tools/**/* @FrozenPandaz @vsavkin @AgentEnder @jaysoo @JamesHenry
package.json @nrwl/nx-core-reviewers
pnpm-lock.yaml @nrwl/nx-core-reviewers
rust-toolchain @nrwl/nx-native-reviewers
rust-toolchain.toml @nrwl/nx-native-reviewers
# Docs Site + Graph
/docs @nrwl/nx-docs-reviewers
@@ -145,8 +145,8 @@ rust-toolchain @nrwl/nx-native-reviewers
/packages/devkit/public-api.ts @FrozenPandaz @vsavkin
# Gradle
/packages/gradle/** @FrozenPandaz @xiongemi
/e2e/gradle/** @FrozenPandaz @xiongemi
/packages/gradle/** @FrozenPandaz @MaxKless @xiongemi
/e2e/gradle/** @FrozenPandaz @MaxKless @xiongemi
# Nx-Plugin
/docs/generated/packages/plugin/** @nrwl/nx-devkit-reviewers @nrwl/nx-docs-reviewers
@@ -186,7 +186,6 @@ rust-toolchain @nrwl/nx-native-reviewers
/scripts/angular-support-upgrades @nrwl/nx-angular-reviewers
# CI
/.circleci/** @nrwl/nx-pipelines-reviewers
/.nx/workflows/** @nrwl/nx-pipelines-reviewers
/.github/** @nrwl/nx-pipelines-reviewers
/.husky/** @nrwl/nx-pipelines-reviewers
Generated
+2302 -159
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
(The MIT License)
Copyright (c) 2017-2024 Narwhal Technologies Inc.
Copyright (c) 2017-2025 Narwhal Technologies Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
+5 -5
View File
@@ -21,7 +21,7 @@
# Smart Monorepos · Fast CI
Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
Build system, optimized for monorepos, with AI-powered architectural awareness and advanced CI capabilities.
Create a new Nx workspace with
@@ -77,10 +77,10 @@ help you get started.
| ![Victor Savkin](https://avatars1.githubusercontent.com/u/35996?s=160) | ![Jason Jean](https://avatars2.githubusercontent.com/u/8104246?s=160) | ![Benjamin Cabanes](https://avatars2.githubusercontent.com/u/3447705?s=160) | ![Jack Hsu](https://avatars0.githubusercontent.com/u/53559?s=160) |
| [vsavkin](https://github.com/vsavkin) | [FrozenPandaz](https://github.com/FrozenPandaz) | [bcabanes](https://github.com/bcabanes) | [jaysoo](https://github.com/jaysoo) |
| Jo Hanna Pearce | Jon Cammisuli | Isaac Mann | Juri Strumpflohner |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| ![Jo Hanna Pearce](https://avatars1.githubusercontent.com/u/439121?s=160) | ![Jon Cammisuli](https://avatars2.githubusercontent.com/u/4332460?s=160) | ![Isaac Mann](https://avatars1.githubusercontent.com/u/861504?s=160) | ![Juri Strumpflohner](https://avatars1.githubusercontent.com/u/542458?s=160) |
| [jdpearce](https://github.com/jdpearce) | [cammisuli](https://github.com/cammisuli) | [isaacplmann](https://github.com/isaacplmann) | [juristr](https://github.com/juristr) |
| James Henry | Jon Cammisuli | Isaac Mann | Juri Strumpflohner |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| ![James Henry](https://avatars.githubusercontent.com/u/900523?s=160&v=4) | ![Jon Cammisuli](https://avatars2.githubusercontent.com/u/4332460?s=160) | ![Isaac Mann](https://avatars1.githubusercontent.com/u/861504?s=160) | ![Juri Strumpflohner](https://avatars1.githubusercontent.com/u/542458?s=160) |
| [JamesHenry](https://github.com/JamesHenry) | [cammisuli](https://github.com/cammisuli) | [isaacplmann](https://github.com/isaacplmann) | [juristr](https://github.com/juristr) |
| Philip Fulcher | Caleb Ukle | Katerina Skroumpelou | Colum Ferry |
| ------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
+6
View File
@@ -0,0 +1,6 @@
plugins {
id("dev.nx.gradle.project-graph") version("0.1.0")
id("com.ncorti.ktfmt.gradle") version("+")
}
group = "dev.nx"
+4
View File
@@ -0,0 +1,4 @@
disallowed-types = [
# We need to ensure adjustments for light and dark themes are applied appropriately
{ path = "ratatui::style::Color", reason = "Use our utils from crate::native::tui::colors instead to ensure appropriate light/dark theme support" },
]
+26 -1
View File
@@ -4,6 +4,11 @@
"description": "Nx plugin add vitepress project to your workspace",
"url": "https://github.com/Ahryman40k/nx-vitepress/tree/main/packages/nx-vitepress"
},
{
"name": "@klerick/nx-angular-mf",
"description": "Custom Angular Builder for Microfrontend Architecture",
"url": "https://github.com/klerick/nx-angular-mf"
},
{
"name": "@nightwatch/nx",
"description": "The NightwatchJS plugin allows your workspace to use the power of NightwatchJS for E2E and Component Testing on Desktop and Mobile",
@@ -387,7 +392,7 @@
{
"name": "@nx-tools/nx-container",
"description": "Nx plugin to build OCI containers with Docker, Podman or Kaniko.",
"url": "https://github.com/gperdomor/nx-tools/tree/main/packages/nx-container"
"url": "https://github.com/gperdomor/nx-tools/tree/main/plugins/nx-container"
},
{
"name": "@nxrocks/nx-melos",
@@ -459,6 +464,11 @@
"description": "Nx plugin for Cloudflare, in particular Cloudflare workers. It allows to generate build and run Cloudflare workers in your Nx workspace.",
"url": "https://github.com/naxodev/oss/tree/main/packages/nx-cloudflare"
},
{
"name": "@naxodev/gonx",
"description": "Modern Nx plugin to use Go in a Nx workspace. Forked from @nx-go/nx-go",
"url": "https://github.com/naxodev/oss/tree/main/packages/gonx"
},
{
"name": "@ziacik/azure-func",
"description": "Generating, serving and publishing Azure Functions 4 apps.",
@@ -489,6 +499,11 @@
"description": "Plugin to deploy and promote Nx apps on Heroku",
"url": "https://github.com/getlarge/nx-heroku"
},
{
"name": "@getlarge/nx-node-sea",
"description": "Plugin that provides integration with Node.js Single Executable Applications (SEA).",
"url": "https://github.com/getlarge/nx-node-sea"
},
{
"name": "@huge-nx/conventions",
"description": "Plugin to generate and manage Nx workspaces by adhering to established workspace conventions.",
@@ -508,5 +523,15 @@
"name": "nx-foundry",
"description": "Foundry generators and inferred tasks for Nx",
"url": "https://github.com/juliangsibecas/nx-foundry"
},
{
"name": "@robby-rabbitman/nx-plus-web-test-runner",
"description": "Web Test Runner plugin for Nx workspaces.",
"url": "https://github.com/RobbyRabbitman/nx-plus/tree/main/libs/web-test-runner"
},
{
"name": "@aws/nx-plugin",
"description": "Nx Plugin for AWS: Accelerate building cloud-native applications with AWS",
"url": "https://github.com/awslabs/nx-plugin-for-aws"
}
]
+12 -4
View File
@@ -208,12 +208,12 @@ You can optionally also pass a `path` like
```
````
#### Terminal Video Output
#### Table of Contents
You can have a more dynamic visualization of a terminal output by using the following component:
You can add a table of contents to your document by using the following component. This is mostly useful for blog posts.
```
{% terminal-video src="/documentation/shared/images/caching/cache-terminal-animation.mp4" /%}
```markdown
{% toc /%}
```
#### Custom iframes
@@ -299,6 +299,14 @@ Have a more decent button-like widget that you can place below sections of a tut
{% video-link link="https://youtu.be/OQ-Zc5tcxJE?t=64" /%}
```
#### Course video embed
This is for embedding a video just like with the Youtube component, but in addition to have a link to a Nx Course (nx.dev/courses) video to improve the discoverability of these courses.
```markdown
{% course-video src="https://youtu.be/3hW53b1IJ84" courseTitle="From PNPM Workspaces to Distributed CI" courseUrl="/courses/pnpm-nx-next/lessons-01-nx-init" title="Initialize Nx in Your Project with nx init" /%}
```
#### Project Details View
Embed a Project Details View that is identical what is shown in Nx Console or `nx show project myproject --web`
@@ -0,0 +1,174 @@
---
title: 'Distributing CI: Binning and Distributed Task Execution'
slug: 'distributing-ci-binning-and-distributed-task-execution'
authors: ['Victor Savkin']
cover_image: '/blog/images/2021-06-15/jFVfKEglfQIM9QsP.avif'
tags: [nx]
description: "Learn how to scale your CI pipeline using two distribution strategies: binning for workload distribution and Nx Cloud's distributed task execution for optimal performance."
---
As your Nx workspaces grow, running CI on a single agent becomes unworkable. Nx's code change analysis and computation caching allows you to do the minimum amount of computation needed to verify that the PR is good to merge, but it only helps with the average case CI time. No matter how smart Nx is, in the worst case you need to rebuild/retest everything. **That's why any sizable workspace has to distribute CI across multiple agents.**
In this post we look at two ways to do that.
## Approach 1: Binning
Binning is an approach to distribution where the planning job divides the work into equally-weighted bins, one for each worker job. Then every worker executes the work prepared for it.
![](/blog/images/2021-06-15/92NTlO7eM7-mc9WD.avif)
Nx has always provided affordances to do that, and many workspaces took advantage of it. Most of the setups look similar. This is an [example of implementing binning using Azure Pipelines](/ci/recipes/set-up/monorepo-ci-azure).
The planning job invokes _print-affected_. This command executes the same logic as _"affected:\*"_ but instead of running the tasks, it returns the tasks' descriptions. The job invokes this command for each target such as build/test/lint/e2e. After that, each worker agent runs the tasks assigned to it.
Binning is very common. For instance, [the CircleCI support for running tests in parallel](https://circleci.com/docs/2.0/parallelism-faster-jobs/) uses binning.
We at Nrwl helped many large companies distribute CI using different variations of binning. It works reasonably well for simple cases, but not without issues.
## Issues with Binning
### Binning doesn't partition the work in the optimal way.
First, you cannot partition tasks into bins without knowing how long every task takes. Most binning solutions collect timings (including the one in the Azure example above) which works imperfectly.
Second, when using binning you split tasks of the same type: some agents run tests, some agents run lints. If you have a fixed set of agents, you often have a situation where one group of agents (say executing lints) finishes before the other group (say executing tests). **You cannot balance them well.**
Additionally, you have to clone the repo and restore installed dependencies three times, consequently: once for planning, once for testing, and once for deployment. If this step takes 3 minutes, you have a 9-minute setup cost.
### Binning splits semantic commands into many chunks.
If you partition your tests into five bins, you have five agents with separate log files. When some of them fail, you have to go through all the logs to see what has happened. Even though this is not a deal-breaker, in a large workspace with dozens of agents executing every CI run, this becomes a real issue.
More importantly, you often need all the file outputs for a given target on the same machine to do post-processing. For instance, **you can run the tests on 5 agents, but you need all the coverage reports in the same place to combine them and send them to SonarQube.** Doing this is challenging.
### Binning doesn't work for builds.
Any time you run a command in a monorepo, Nx creates a task graph, which it then executes.
**The biggest limitation of binning is that it only works when the task graph is a list.** The moment you have dependencies between tasks, you have to distribute tasks dynamically using some sort of coordinator, move the needed files between agents and so forth.
This is common when you have libraries that depend on other libraries.
![](/blog/images/2021-06-15/lS7eewNQuZzQ72kU.avif)
In this example, the Child 1 and Child 2 libraries have to be built first. Parent 1 can start only when Child 1 has been built because it needs the Child 1's dist folder. Parent 2 has to wait for both Child 1 and Child 2. And they can all be built on different agents, so their dist folders will have to be moved from agent to agent. You cannot implement it using binning. This problem also occurs for tests that require the libraries or applications to be built first.
That's why you often see tool authors talking about distributing tests and not builds. **Distributing tests is relatively straightforward. Distributing builds is hard.**
### Binning complicates CI/CD Setup.
Maintaining a CI setup that uses binning is often an ongoing effort. Because you don't have a proper coordinator, your CI has to be the coordinator, which complicates things.
## Approach 2: Nx Cloud 2.0 Distributed Task Execution (DTE)
We at Nrwl are in the business of helping companies use monorepos, so we have been dealing with these issues for many years. Nx Cloud 2.0's support for Distributed Task Execution is our solution for this problem. It solves all the problems listed above and more.
## How Does Distributed Task Execution Work?
This is an example CircleCI configuration that runs all commands on a single agent.
```yaml
jobs:
main:
environment:
steps:
- setup # clones the repo and runs npm install
- run: npx nx affected --target=test --parallel --maxParallel=3
- run: npx nx affected --target=lint --parallel --maxParallel=3
- run: npx nx affected --target=e2e
- run: npx nx affected --target=build
workflows:
PR:
jobs:
- main
```
Now use DTE to run the commands using 3 separate agents.
```yaml
jobs:
main:
environment:
NX_CLOUD_DISTRIBUTED_EXECUTION: "true"
steps:
- setup
- run: npx nx affected --target=test --parallel --maxParallel=3
- run: npx nx affected --target=lint --parallel --maxParallel=3
- run: npx nx affected --target=e2e
- run: npx nx affected --target=build
- run: npx nx-cloud stop-all-agents
agent:
steps:
- setup
- run:
name: Agent
command: npx nx-cloud start-agent
workflows:
PR:
jobs:
- agent
name: agent1
- agent
name: agent2
- agent
name: agent3
- main
```
As you can see there is not much that changed. We added the agent job, registered it 3 times, added the `NX_CLOUD_DISTRIBUTED_EXECUTION` env variable, and added an extra step to stop all the agents. That is it.
**What happens when it runs `nx affected --build`?**
![](/blog/images/2021-06-15/XISTgZIBj5ZZ3Sp7.avif)
It won't run the build locally. Instead, it sends the Task Graph to Nx Cloud. Nx Cloud Agents pick up the tasks they can run and execute them.
> The Nx Cloud agents here are CI jobs that run `npx nx-cloud start-agent` so they can can be defined in any CI env.
This happens transparently. If an agent builds `app1`, it fetches the outputs for lib if it doesn't have it already.
As agents complete tasks, the main job where you invoked `nx affected --build` l starts receiving created files and terminal outputs.
After `nx affected --build` completes, the main job has the built artifacts and all the terminal outputs as if it ran it locally.
Let's reexamine the issues above to see how we addressed them.
### Nx Cloud partitions the work in the optimal way.
In theory every agent could pull one task at a time to partition things evenly, but it doesn't work well in practice. The network overhead can add up for very small tasks, and it's often faster to run several tasks in parallel because of the batching capabilities Nx has.
As you run commands in your repo, Nx Cloud collects the timings and uses those to partition the work into well-sized batches, such that if one agent is slow, the CI isn't blocked. Agents also run tasks of different types (tests/lints), so the pool of agents is shared evenly.
### Nx Cloud does not split commands.
To stress one more time the main job contains all the terminal outputs and all the files from all the tasks that ran on the agents, as if it ran locally. There is one place to look for errors. The created Nx Cloud run will contain all the information from all the agents.
![](/blog/images/2021-06-15/PmhVG4DF-OKtbl.avif)
**Finally, because all the files are copied into the main job, you can combine any outputs in post-processing steps, in exactly the same way you did it before enabling distribution.**
### Nx Cloud distributes builds.
**Nx Cloud is a proper coordinator and it can process any task graph**. An Nx Cloud agent asks for tasks to execute. The Nx Cloud service looks at the commands currently running and will see if there are any tasks that have no unfulfilled dependencies. If there are some, the Nx Cloud service will use the collected timings to create a well-size batch of tasks that it will send to the agent.
The agent sees if it has all the files required to run those tasks (`dist` folders from previous tasks). And if it doesn't, it downloads them. When it's done running the task, it lets the Nx Cloud service know to "unblock" other tasks in the graph. At the same time, the Nx Cloud service sends the created files and terminal outputs to the main job.
### Nx Cloud does not require you to rewrite the CI setup.
As you saw above, the CI setup, by and large, remained the same. And nothing had to change in the workspace itself. For instance, the `npx nx affected --target=test --parallel --maxParallel=3` command looks exactly the same. The meaning of `--max-parallel` changes its meaning from run up to 3 test tasks on the main job to run up to 3 test tasks on each agent.
If you want to change this command without distribution, add `NX_CLOUD_DISTRIBUTED_EXECUTION` as follows: `NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx affected --target=test --parallel --maxParallel=3`.
### Works With any CI System
When using distributed task execution all the communication is done from your agents to Nx Cloud. This means that it works with any CI system, including your private Jenkins installations. See some examples [here](/ci/recipes/set-up). And even works locally if you create a docker image from the state of repo and push it to say ECS. It also works with Nx Private Cloud.
## Summary
In this post we looked at two ways to distribute your CI: binning and using Nx Cloud's distributed task execution.
Binning has been supported from Day 1 and works well for a variety of workspaces. It has drawbacks: the resource allocation, the developer ergonomics, the inability to distribute builds, and a much more complex Ci setup.
Nx Cloud distributed task execution addresses the drawbacks.
[Learn more about Nx Cloud 2.0 and its support for distributed task execution](/nx-cloud).
@@ -2,8 +2,9 @@
title: 'Step by Step Guide on Creating a Monorepo for React Native Apps using Nx'
slug: 'step-by-step-guide-on-creating-a-monorepo-for-react-native-apps-using-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2021-10-14/92uzyqB8oJ8tZJB9wAdoWQ.png'
cover_image: '/blog/images/2021-10-14/92uzyqB8oJ8tZJB9wAdoWQ.avif'
tags: [nx, tutorial]
description: Learn how to set up a monorepo with Nx to manage React Native mobile and React web apps with shared libraries, demonstrated through a daily horoscope app example.
---
Do you want to have both mobile and web apps in the same repo? Do you wish that you could share code between mobile and web apps? This blog post shows you how to create a React Native mobile app and a React web app in the same repo with shared libraries using Nx.
@@ -66,7 +67,7 @@ npm install --save @rneui/base @rneui/themed react-native-vector-icons react-nat
_**yarn add @rneui/base @rneui/themed react-native-vector-icons react-native-safe-area-context
```
In the apps package.json at `apps/daily-horoscope-app/package.json`, under dependencies, add the above packages:
In the app's package.json at `apps/daily-horoscope-app/package.json`, under dependencies, add the above packages:
```json5
{
@@ -166,7 +167,7 @@ export enum AdhZodiacSign {
}
```
**Note**: the enum has a prefix Adh to indicate it is a model under domain aztro-daily-horoscope. Add this prefix to distinguish model names from component names.
**Note**: the enum has a prefix "Adh" to indicate it is a model under domain "aztro-daily-horoscope". Add this prefix to distinguish model names from component names.
This example uses icons from [Material Community Icons](https://materialdesignicons.com/). You need to create a list that contains the zodiac sign name and its matching icon.
@@ -542,7 +543,7 @@ npm install --save-dev redux-logger @types/redux-logger
yarn add redux-logger @types/redux-logger --dev
```
Then you need to add the redux-logger to the root stores middleware, so the rootStore becomes:
Then you need to add the redux-logger to the root store's middleware, so the rootStore becomes:
```typescript
import logger from 'redux-logger';
@@ -559,7 +560,7 @@ const rootStore = configureStore({
Since the code is running in simulators, how to use the Redux Devtools extension and view the Redux Logger?
Open the debug menu in the simulator by entering `d` in the terminal that runs the start command. Then in the debug menu, choose Debug with Chrome for iOS and Debug for Android.
Open the debug menu in the simulator by entering `d` in the terminal that runs the start command. Then in the debug menu, choose "Debug with Chrome" for iOS and "Debug" for Android.
![](/blog/images/2021-10-14/4QVoNHRjzW0agHGnxyWvpw.avif)
_Debug Menu in iOS and Android_
@@ -587,7 +588,7 @@ npm install --save @react-navigation/native @react-navigation/stack react-native
yarn add @react-navigation/native @react-navigation/stack react-native-reanimated react-native-gesture-handler react-native-screens @react-native-community/masked-view
```
In the apps package.json at `apps/daily-horoscope-app/package.json`, under dependencies, add the above packages:
In the app's package.json at `apps/daily-horoscope-app/package.json`, under dependencies, add the above packages:
```json5
{
@@ -694,45 +695,7 @@ export default HoroscopeCard;
Now you need to add this screen to your app. In file `apps/daily-horoscope-app/src/app/App.tsx`, you need to update it to add a stack screen for the `horoscope-card` component:
```tsx
import { store } from '@aztro-daily-horoscope/store';
import {
ZodiacSignListContainer,
HoroscopeCard,
} from '@aztro-daily-horoscope/ui';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import * as React from 'react';
import { Provider } from 'react-redux';
const Stack = createStackNavigator();
const App = () => {
return (
<Provider store={store}>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Zodiac Sign List"
component={ZodiacSignListContainer}
/>
<Stack.Screen name="Horoscope Card" component={HoroscopeCard} />
</Stack.Navigator>
</NavigationContainer>
</Provider>
);
};
export default App;
```
In the `libs/ui/src/lib/zodiac-sign-list/zodiac-sign-list.tsx`, you need to trigger navigation when the list item got pressed.
Below code uses [`useNavigation`](https://reactnavigation.org/docs/use-navigation/) hook from [React Navigation](https://reactnavigation.org/) library. When the list item got pressed, it is going to call `navigation.navigate(Horoscope Card)` to navigate the `horoscope-card` component you created above.
[https://gist.github.com/xiongemi/c78c719e70aa4948b98e68033d7fe4a3](https://gist.github.com/xiongemi/c78c719e70aa4948b98e68033d7fe4a3)
```tsx {% fileName="App.tsx" %}
```tsx {% fileName="zodiac-sign-list.tsx" %}
import {
AdhZodiacSignItem,
AdhZodiacSignList,
@@ -800,7 +763,7 @@ nx generate lib services
In the services folder, add the below files:
- `aztro-horoscope-response.interface.ts` defines what the response object looks like. It has a transform function to transform response data to the app domain model.
- `aztro.service.ts` calls the API to get the users horoscope based on the zodiac sign and day.
- `aztro.service.ts` calls the API to get the user's horoscope based on the zodiac sign and day.
```typescript {% fileName="aztro-horoscope-response.interface.ts" %}
import { AdhHoroscope, AdhZodiacSign } from '@aztro-daily-horoscope/models';
@@ -899,7 +862,7 @@ export interface HoroscopeState {
- `loadingStatus` is the API request status from `aztro.service`.
- `error` is the API request error from `aztro.service`.
- `zodiacSignItem` is the users selected zodiac sign.
- `zodiacSignItem` is the user's selected zodiac sign.
- `day` is the parameter passed to `aztro.service`.
- `horoscope` is the transformed response from `aztro.service.`
@@ -1255,7 +1218,7 @@ AppRegistry.runApplication('main', {
});
```
Copy your code from `daily-horoscope-app`s app file to `daily-horoscope-web`s app file and add styles for the icon font files:
Copy your code from `daily-horoscope-app`'s app file to `daily-horoscope-web`'s app file and add styles for the icon font files:
```tsx {% fileName="app.tsx" %}
import { rootStore } from '@aztro-daily-horoscope/store';
@@ -2,13 +2,14 @@
title: 'Taming Code Organization with Module Boundaries in Nx'
slug: 'mastering-the-project-boundaries-in-nx'
authors: ['Miroslav Jonaš']
cover_image: '/blog/images/2021-12-17/PIUl1QGk7mOpSFdEwFQ8OA.png'
cover_image: '/blog/images/2021-12-17/PIUl1QGk7mOpSFdEwFQ8OA.avif'
tags: [nx]
description: Learn how to organize growing Nx repositories using module boundaries and ESLint rules to enforce clean architecture and prevent unwanted dependencies between domains.
---
As your repository grows, it becomes more challenging to organize and name the applications and libraries. This organization, when done right, feels intuitive and allows team members to easily find projects and understand how they work together. When done poorly, it results in a mess we eventually end up calling the legacy software. This article will show you different ways how you can prevent your repo from descending into chaos.
As your repository grows, it becomes more challenging to organize and name the applications and libraries. This organization, when done right, feels intuitive and allows team members to easily find projects and understand how they work together. When done poorly, it results in a mess we eventually end up calling "the legacy software". This article will show you different ways how you can prevent your repo from descending into chaos.
Our book [Enterprise Angular Monorepo Patterns](https://go.nx.dev/angular-enterprise-monorepo-patterns-new-book) presents an in-depth guide to assist you with naming and organization. If you still havent read this book, we warmly recommend you do. Dont let the name fool you, though — the architecture guidelines explained in this book apply to any framework.
Our book [Enterprise Angular Monorepo Patterns](https://go.nx.dev/angular-enterprise-monorepo-patterns-new-book) presents an in-depth guide to assist you with naming and organization. If you still haven't read this book, we warmly recommend you do. Don't let the name fool you, though — the architecture guidelines explained in this book apply to any framework.
On large projects, you will most likely find multiple teams working on different parts of the solution. Those projects are usually split into logical domains, where each team focuses on a single domain. Each domain block can have a clear public API which other domains can use to consume the information.
@@ -47,13 +48,13 @@ When you generate the first project in your workspace using one of our generator
}
```
Lets dissect what each of these properties does.
Let's dissect what each of these properties does.
The `allow` array acts as a whitelist listing the import definitions that should be omitted from further checks. You can read more about it in the **Overriding the overrides** section below.
The `depConstraints` section is the one you will be spending most time fine-tuning. It represents an array of constraints, each consisting of `sourceTag` and `onlyDependOnLibsWithTags` properties. The default configuration has a wildcard `*` set as a value for both of them, meaning that any project can import (depend on) any other project.
> Note, the wildcard only applies to libraries. Applications and E2E applications cannot be imported. It wouldnt make any sense. If you want to combine applications, you should use the [micro-frontends](/recipes/angular/dynamic-module-federation-with-angular) approach with the module federation.
> Note, the wildcard only applies to libraries. Applications and E2E applications cannot be imported. It wouldn't make any sense. If you want to combine applications, you should use the [micro-frontends](/recipes/angular/dynamic-module-federation-with-angular) approach with the module federation.
The circular dependency chains such as `lib A -> lib B -> lib C -> lib A` are also not allowed. The self circular dependency (when lib imports from a named alias of itself), while not recommended, can be overridden by setting the flag `allowCircularSelfDependency` to true.
@@ -91,7 +92,7 @@ First, we will use the project configuration to annotate our projects with `tags
- Tags used to live in `nx.json` but were in the recent version moved closer to the project, so you can locate them now in your `project.json` or `workspace.json`
Lets define the types of projects. We will use the following tags:
Let's define the types of projects. We will use the following tags:
- `type:app` for application
- `type:feature` for feature library
@@ -147,12 +148,12 @@ Now, that we have marked all of our projects, we can continue to define the rule
## Adding a second dimension
We said that a feature library can depend on any other feature library, but there is a small catch. Our two apps could be built with a different framework so mixing feature libraries would not be possible. To avoid any future impediments, we dont want to allow a feature library used in `Store` to depend on the feature library from `Admin` and vice versa. Additionally, only our apps should be able to load the `Core` library.
We said that a feature library can depend on any other feature library, but there is a small catch. Our two apps could be built with a different framework so mixing feature libraries would not be possible. To avoid any future impediments, we don't want to allow a feature library used in `Store` to depend on the feature library from `Admin` and vice versa. Additionally, only our apps should be able to load the `Core` library.
![](/blog/images/2021-12-17/mr_MbGgWVbBcfBhss0hNqA.avif)
_Project graph with type tags and technology badges_
Lets add another dimension to allow such restrictions. We will define the necessary scope tags:
Let's add another dimension to allow such restrictions. We will define the necessary scope tags:
- `scope:store` for store app-related projects
- `scope:admin` for admin app related projects
@@ -266,9 +267,9 @@ Using the wildcard `*` to match multiple projects e.g. `react*` we can save ours
## Restricting transitive dependencies
Our solution doesnt contain only internal projects but also depends on various external NPM packages. These external dependencies are explicitly declared in our `package.json`. Unfortunately, a package is rarely an island. They often consist of a tree of transitive dependencies branching out leading to thousands of packages being installed in your `node_modules` folder. Although we have control over what version or which direct dependency we install, we have no control over what versions of what packages this dependency depends on. The transitive dependencies are often the source of our app's vulnerabilities. We can also never guarantee those dependencies will be there. Just by simply running `npm install` parent may get updated to a patch or minor version that would wipe out one of the transitive dependencies or replace it with one with breaking changes.
Our solution doesn't contain only internal projects but also depends on various external NPM packages. These external dependencies are explicitly declared in our `package.json`. Unfortunately, a package is rarely an island. They often consist of a tree of transitive dependencies branching out leading to thousands of packages being installed in your `node_modules` folder. Although we have control over what version or which direct dependency we install, we have no control over what versions of what packages this dependency depends on. The transitive dependencies are often the source of our app's vulnerabilities. We can also never guarantee those dependencies will be there. Just by simply running `npm install` parent may get updated to a patch or minor version that would wipe out one of the transitive dependencies or replace it with one with breaking changes.
Therefore its wise not to allow developers to import transitive dependencies in their projects. Our ESLint plugin provides a simple flag to turn this restriction on.
Therefore it's wise not to allow developers to import transitive dependencies in their projects. Our ESLint plugin provides a simple flag to turn this restriction on.
```json5 {% fileName=".eslintrc.json" %}
{
@@ -2,8 +2,9 @@
title: 'Single File Monorepo Config, Custom Workspace Presets, Improved Tailwind Support, and more in Nx 13.4!'
slug: 'single-file-monorepo-config-custom-workspace-presets-improved-tailwind-support-and-more-in-nx-13'
authors: ['Brandon Roberts']
cover_image: '/blog/images/2021-12-23/4u3Fw49H5U-sqgyBoGsqw.png'
cover_image: '/blog/images/2021-12-23/4u3Fw49H5U-sqgyBoGsqw.avif'
tags: [nx, release]
description: Nx 13.4 brings single file monorepo configuration, custom workspace presets, enhanced Tailwind support for Angular, and dedicated TypeScript/JavaScript support with @nrwl/js.
---
Nx is a smart, extensible build framework to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, computation caching, dependency management, and more.
@@ -25,13 +26,13 @@ With the latest release of Nx and add-nx-to-monorepo 2.0, there is only the **nx
npx add-nx-to-monorepo
```
> Victor Savkin demoed the flexibility of Nx by migrating Metas (Facebook) React repository: [video link](https://youtu.be/XLP2RAOwfLQ)
> Victor Savkin demoed the flexibility of Nx by migrating Meta's (Facebook) React repository: [video link](https://youtu.be/XLP2RAOwfLQ)
Learn more in our guide of [adding Nx to an existing workspace](/recipes/adopting-nx/adding-to-monorepo) and the config inside the [**nx.json**](/reference/project-configuration)**.**
## Custom Workspace Presets 🎨
Nx provides many presets by default to support many different ecosystems. Nx for monorepos is like VSCode, where plugins allow you to extend the functionality of your monorepo to fit your ecosystem or platform of choice. To make it easier for scaffolding a pre-defined setup, weve introduced the ability to use custom presets when creating Nx workspaces with a provided npm package.
Nx provides many presets by default to support many different ecosystems. Nx for monorepos is like VSCode, where plugins allow you to extend the functionality of your monorepo to fit your ecosystem or platform of choice. To make it easier for scaffolding a pre-defined setup, we've introduced the ability to use custom presets when creating Nx workspaces with a provided npm package.
```shell
npx create-nx-workspace --preset=your-npm-package-name
@@ -47,7 +48,7 @@ This allows you to enhance the initial experience for new workspaces directly fo
Nx has always shipped with great TypeScript support. In version 13.4 we improve it even further by releasing a brand new package: `@nrwl/js` .
This is particularly useful if you have framework-agnostic TS/JS packages within an existing Nx workspace but also for those scenarios where you want to build and publish a TS/JS-based library to some package registry. The setup is very lightweight, but still provides all benefits youd expect from an Nx-based setup such as Jest, ESLint, Prettier etc.
This is particularly useful if you have framework-agnostic TS/JS packages within an existing Nx workspace but also for those scenarios where you want to build and publish a TS/JS-based library to some package registry. The setup is very lightweight, but still provides all benefits you'd expect from an Nx-based setup such as Jest, ESLint, Prettier etc.
Read all the details on [our new TypeScript guide](/getting-started/intro) or check out the video walkthrough below.
@@ -58,7 +59,7 @@ Read all the details on [our new TypeScript guide](/getting-started/intro) or ch
![](/blog/images/2021-12-23/1yacozydc1muZ74G.avif)
_Tailwind Logo_
Tailwind is a utility-first CSS framework packed with classes that can be composed to build any design, directly in your markup. If youve used Tailwind with Angular applications previously, it's supported out of the box with Nx. Were continually looking to improve the developer experience of using Tailwind in Angular applications and libraries. We already added support to the Angular plugin for Nx, and have added a new generator to configure Tailwind in **existing** apps and buildable/publishable libs, allowing you to set up and configure Tailwind without manual steps. The ability to configure new apps and libs is also supported, with support for Tailwind V2 and the latest V3 release.
Tailwind is a utility-first CSS framework packed with classes that can be composed to build any design, directly in your markup. If you've used Tailwind with Angular applications previously, it's supported out of the box with Nx. We're continually looking to improve the developer experience of using Tailwind in Angular applications and libraries. We already added support to the Angular plugin for Nx, and have added a new generator to configure Tailwind in **existing** apps and buildable/publishable libs, allowing you to set up and configure Tailwind without manual steps. The ability to configure new apps and libs is also supported, with support for Tailwind V2 and the latest V3 release.
```shell
nx g @nrwl/angular:app my-app --addTailwind
@@ -2,15 +2,16 @@
title: 'New Terminal Output & Performance Improvements in Nx 13.5'
slug: 'new-terminal-output-performance-improvements-in-nx-13-5'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-01-25/PIUl1QGk7mOpSFdEwFQ8OA.png'
cover_image: '/blog/images/2022-01-25/PIUl1QGk7mOpSFdEwFQ8OA.avif'
tags: [nx]
description: Nx 13.5 brings a new dynamic terminal output, 2.3x faster operations, Chrome DevTools profiling support, and improved project graph visualization.
---
Nx is a smart, extensible build framework to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, computation caching, dependency management, and more.
### New Terminal Output 💅
Folks that have been following along in our journey for quite some time know already that at Nx we strive for the best possible DX. The current terminal output was always something we havent been super happy with, especially if you run some of the commands that trigger the execution of multiple tasks (e.g. affected commands, run-many etc). This is why were even more excited about this feature: the new dynamic Nx terminal output is now the default for everyone.
Folks that have been following along in our journey for quite some time know already that at Nx we strive for the best possible DX. The current terminal output was always something we haven't been super happy with, especially if you run some of the commands that trigger the execution of multiple tasks (e.g. affected commands, run-many etc). This is why we're even more excited about this feature: the new dynamic Nx terminal output is now the default for everyone.
![](/blog/images/2022-01-25/81krRElSXV5w2T54DiCBAA.avif)
_New dynamic terminal output in Nx 13.5_
@@ -19,14 +20,14 @@ It clearly separates the terminal output into an upper part where all the comple
There are a few things to note here (and which kinda emphasize our love with details & dev ergonomics 😉)
- **Off in CI —** On CI youll still see the full output.
- **Off in CI —** On CI you'll still see the full output.
- **The full terminal output is still cached —** this is purely UI cosmetic. We still cache the entire terminal output. Hence, if you run the build of a single project that has previously been cached as part of a run-many command, you will see still the full output.
Thanks to [James Henry](https://twitter.com/mrjameshenry) for working on this feature!
### Nx keeps getting faster and faster 🚀
Performance is a feature, and we take it seriously with Nx. We landed a number of different performance improvements over the last couple of minor versions, ranging from optimizing how we store & restore our cache to improving the Nx workspace analysis and boot time. With v13.5 weve seen some Nx operations being
Performance is a feature, and we take it seriously with Nx. We landed a number of different performance improvements over the last couple of minor versions, ranging from optimizing how we store & restore our cache to improving the Nx workspace analysis and boot time. With v13.5 we've seen some Nx operations being
- 1.8x — 2.3x faster in the [Interstellar repo](https://github.com/vsavkin/interstellar)
- about 2x faster on some large client repositories
@@ -37,7 +38,7 @@ And we will not rest 😉.
When running an Nx command there might potentially be many tasks running at different times, in parallel, and using different processes. Optimizing those runs or better understanding where things go wrong might be a hard and cumbersome process. Being able to visualize things usually helps.
Thats why we introduced the ability to profile and visualize Nx commands in the Chrome Devtools.
That's why we introduced the ability to profile and visualize Nx commands in the Chrome Devtools.
![](/blog/images/2022-01-25/7vk8AUWRGkDI0vcVX4Ql-g.avif)
@@ -47,7 +48,7 @@ Use the `NX_PROFILE=<filename>` environment variable attached to your Nx CLI com
NX_PROFILE=profile.json nx build cart
```
Itll produce a JSON file which you can then open with Chromes devtools. [Read more about it on the Nx Docs](/troubleshooting/performance-profiling).
It'll produce a JSON file which you can then open with Chrome's devtools. [Read more about it on the Nx Docs](/troubleshooting/performance-profiling).
Thanks [Jason](https://twitter.com/FrozenPandaz) for working on this feature!
@@ -67,11 +68,11 @@ In v13.5 we now also store the current filter status in the URL. That makes it e
![](/blog/images/2022-01-25/RM9hDFIsgLn1X4EX5qsgGg.avif)
_Nx dep graph now stores filters in the URL_
Heres our deployed live example of the above screenshot: [https://nrwl-nx-examples-dep-graph.netlify.app/?focus=products-home-page](https://nrwl-nx-examples-dep-graph.netlify.app/?focus=products-home-page)
Here's our deployed live example of the above screenshot: [https://nrwl-nx-examples-dep-graph.netlify.app/?focus=products-home-page](https://nrwl-nx-examples-dep-graph.netlify.app/?focus=products-home-page)
Thanks [Philip Fulcher](https://twitter.com/PhilipJFulcher) for adding this feature!
Theres one more thing: As developers, we like to be as efficient as possible. We wanted to help by saving you some keystrokes. The project graph visualization can now be launched with
There's one more thing: As developers, we like to be as efficient as possible. We wanted to help by saving you some keystrokes. The project graph visualization can now be launched with
```shell
nx graph
@@ -85,7 +86,7 @@ There have been a number of improvements to our Angular plugin ( `@nrwl/angular`
- Option to skip the Angular Module creation when generating new libraries by passing `--skipModule`
- Support for multiple state slices when using the Nx Angular Data Persistence utilities. Thanks [David](https://medium.com/u/6e7f9350fcdf?source=post_page-----c407bb1c963a--------------------------------) for this community contribution !([#8216](https://github.com/nrwl/nx/pull/8216))
- New Angular Nx workspaces now use v2 of the workspace configuration (Nxs format of the `angular.json` )
- New Angular Nx workspaces now use v2 of the workspace configuration (Nx's format of the `angular.json` )
- Lots of improvements to the Angular SCAM generator
## How to Update Nx
@@ -2,15 +2,16 @@
title: 'Set up Tailwind CSS with Angular in an Nx workspace'
slug: 'set-up-tailwind-css-with-angular-in-an-nx-workspace'
authors: ['Leosvel Pérez Espinosa']
cover_image: '/blog/images/2022-01-28/igoocYqr8gj8n9t8qr5cuA.png'
cover_image: '/blog/images/2022-01-28/igoocYqr8gj8n9t8qr5cuA.avif'
tags: [nx]
description: Learn how to integrate Tailwind CSS with Angular in an Nx monorepo, including setup, configuration, and best practices for applications and libraries.
---
[**Tailwind CSS**](https://tailwindcss.com/) is a utility-first CSS framework packed with a lot of good functionality out of the box while providing a high level of customization. It has gained a lot of attention since it came out and its a good option when it comes to styling our applications.
[**Tailwind CSS**](https://tailwindcss.com/) is a utility-first CSS framework packed with a lot of good functionality out of the box while providing a high level of customization. It has gained a lot of attention since it came out and it's a good option when it comes to styling our applications.
In this blog post, we are going to see how we can use **Tailwind CSS** with [**Angular**](https://angular.io/) in an **Nx** monorepo. We are going to be looking at different scenarios and how to approach them.
Lets get started!
Let's get started!
> Please note that this blog post is not meant to be a **Tailwind CSS** or **Angular** tutorial. The purpose is to show how to use them together and how **Nx** can help to improve the developer experience and expand the native **Angular** capabilities when working with **Tailwind CSS**.
@@ -23,16 +24,16 @@ We are going to create 2 simple applications with the following layout:
![](/blog/images/2022-01-28/OXo64rzyF-5nKO2fbpG4xg.avif)
_Applications mockup_
Well start by creating one application with the required markup and **Tailwind CSS** utility classes to achieve the above layout. Then, were going to leverage **Nx**s library support and extract some common UI components into 2 different shared libraries:
We'll start by creating one application with the required markup and **Tailwind CSS** utility classes to achieve the above layout. Then, we're going to leverage **Nx**'s library support and extract some common UI components into 2 different shared libraries:
- a regular non-buildable library containing the header,
- a buildable library containing the card elements.
At that point, well create the second application using the components exposed by those shared libraries. Finally, well extract the button elements to a publishable library and adjust both applications to use them.
At that point, we'll create the second application using the components exposed by those shared libraries. Finally, we'll extract the button elements to a publishable library and adjust both applications to use them.
The idea is to show how different applications can still use the same components and have them styled differently using **Tailwind CSS**. Both applications in this blog post will share the same layout, but the approach explained here would apply to applications with different layouts sharing the same UI components.
> Discussing the different types of libraries and the motivation to use them goes beyond the scope of this blog post. Well use the three different types just to showcase how to use **Tailwind CSS** with each of them. To know more about them, please check [/concepts/decisions/project-size](/concepts/decisions/project-size) and [/concepts/buildable-and-publishable-libraries](/concepts/buildable-and-publishable-libraries).
> Discussing the different types of libraries and the motivation to use them goes beyond the scope of this blog post. We'll use the three different types just to showcase how to use **Tailwind CSS** with each of them. To know more about them, please check [/concepts/decisions/project-size](/concepts/decisions/project-size) and [/concepts/buildable-and-publishable-libraries](/concepts/buildable-and-publishable-libraries).
## Setting up the Nx workspace
@@ -50,9 +51,9 @@ npx create-nx-workspace@latest angular-tailwind-nx --pm=yarn
The above command creates a workspace called `angular-tailwind-nx` and asks us a few questions to help us set up the workspace. We chose the `angular` preset, provided `app1` for the initial **Angular** application name, chose `css` as the stylesheet to use, and this time chose not to use [**Nx Cloud**](/nx-cloud) but feel free to opt-in to use the **Nx Cloud** free tier to benefit from distributing the computation caching of your projects.
> Any of the stylesheet options can be used. Also, using **Nx Cloud** or not doesnt affect setting up **Tailwind CSS**.
> Any of the stylesheet options can be used. Also, using **Nx Cloud** or not doesn't affect setting up **Tailwind CSS**.
Now that we have a workspace with an **Angular** application ready to be used, lets start adding some **Tailwind CSS** magic!
Now that we have a workspace with an **Angular** application ready to be used, let's start adding some **Tailwind CSS** magic!
## Adding Tailwind CSS
@@ -70,7 +71,7 @@ The above command will do a few things for us:
> The above generator supports **Tailwind CSS** v2 and v3.
Lets take a look at the generated `apps/app1/tailwind.config.js` file:
Let's take a look at the generated `apps/app1/tailwind.config.js` file:
```javascript {% fileName="tailwind.config.js" %}
const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind');
@@ -88,7 +89,7 @@ module.exports = {
};
```
We can see the `content` property is configured to scan for all the HTML and TypeScript files within our application and besides that, theres also a call to a function called `createGlobPatternsForDependencies`. This is a pretty handy function that will identify the dependencies of the application and return the glob patterns for them. This ensures that **Tailwind CSS** utility classes that are used in the applications dependencies are also taken into account and included in the final CSS of the application.
We can see the `content` property is configured to scan for all the HTML and TypeScript files within our application and besides that, there's also a call to a function called `createGlobPatternsForDependencies`. This is a pretty handy function that will identify the dependencies of the application and return the glob patterns for them. This ensures that **Tailwind CSS** utility classes that are used in the application's dependencies are also taken into account and included in the final CSS of the application.
> Instead of using the `createGlobPatternsForDependencies`, we could just add the `_libs/**/*_` glob pattern that captures all libraries, but that could lead to bundling more CSS than needed in monorepos with multiple applications. This would happen because all applications would be scanning all libraries, regardless of whether they are dependencies or not. Such a glob pattern could also lead to scaling issues in large monorepos due to the amount of libraries to scan.
@@ -100,17 +101,14 @@ We can also see that the generator updated the `apps/app1/src/styles.css` file w
@tailwind utilities;
```
And thats all we need. We can now go ahead and add our custom theme and layout to achieve the desired design.
And that's all we need. We can now go ahead and add our custom theme and layout to achieve the desired design.
## Adding a custom theme and the application markup
First, we are going to update the `theme` section of the generated `apps/app1/tailwind.config.js`. We are going to overwrite the **Tailwind CSS** default theme and provide the custom palette of colors and spacing of our theme to be used throughout the application:
```javascript {% fileName="tailwind.config.js" %}
...
module.exports = {
...
theme: {
colors: {
primary: {
@@ -133,7 +131,7 @@ module.exports = {
xl: '2rem',
},
},
...
plugins: [],
};
```
@@ -192,7 +190,7 @@ Next, we update the `apps/app1/src/app/app.component.html` file with the require
</div>
```
With all set, lets see it in action by running:
With all set, let's see it in action by running:
```shell
npx nx run app1:serve
@@ -203,7 +201,7 @@ Visiting [https://localhost:4200](https://localhost:4200) in your browser should
![](/blog/images/2022-01-28/TkIVfzbeier6j0nlAeX7ig.avif)
_Application 1 screenshot_
Thats it! We have successfully created our application to fulfill the requirements we had. Next, we are going to start extracting pieces of the UI into shared libraries to reuse them with the second application.
That's it! We have successfully created our application to fulfill the requirements we had. Next, we are going to start extracting pieces of the UI into shared libraries to reuse them with the second application.
## Tailwind CSS and Angular libraries in an Nx workspace
@@ -215,13 +213,13 @@ From [**Tailwind CSS** docs](https://tailwindcss.com/docs/installation):
Any project can use the [**Tailwind CSS** CLI](https://tailwindcss.com/blog/standalone-cli) or [**PostCSS**](https://postcss.org/) with the `tailwindcss` plugin to scan the relevant files in the project and collect the usage of the **Tailwind CSS** utility classes, functions, and custom CSS directives (custom CSS [at-rules](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule)). With that information, the final CSS styles are generated.
**Angular** uses **PostCSS** to support **Tailwind CSS**. As we saw in a previous section, with the help of an **Nx** generator, its pretty straightforward to configure a **Tailwind CSS** for applications. Libraries can also be easily configured, but there are some nuances regarding how they are processed and whether they need to be configured or not.
**Angular** uses **PostCSS** to support **Tailwind CSS**. As we saw in a previous section, with the help of an **Nx** generator, it's pretty straightforward to configure a **Tailwind CSS** for applications. Libraries can also be easily configured, but there are some nuances regarding how they are processed and whether they need to be configured or not.
In an **Nx** workspace, a regular library (non-buildable and non-publishable) is just a slice of an application that is only built as part of the build process of an application that consumes it. Because of that, as long as the application that consumes it has **Tailwind CSS** configured, the library code will be processed as expected even though the library itself doesnt have a **Tailwind CSS** configuration. In fact, adding a `tailwind.config.js` file to the library wont have any effect whatsoever (itll be ignored) because the library is never built on its own.
In an **Nx** workspace, a regular library (non-buildable and non-publishable) is just a slice of an application that is only built as part of the build process of an application that consumes it. Because of that, as long as the application that consumes it has **Tailwind CSS** configured, the library code will be processed as expected even though the library itself doesn't have a **Tailwind CSS** configuration. In fact, adding a `tailwind.config.js` file to the library won't have any effect whatsoever (it'll be ignored) because the library is never built on its own.
On the other hand, buildable and publishable libraries are meant to be built on their own and their compiled output to be shared with the consumers. Therefore, they need to be able to process any **Tailwind CSS** directive or function (e.g. `@apply`, `theme()`) when they are built. If no **Tailwind CSS** directive or function is used, then the configuration is not needed.
> Providing the configuration to a buildable or publishable library that doesnt need it adds some unnecessary overhead to the build process. The executor will still load the configuration and the **PostCSS** plugin will process the stylesheets unnecessarily.
> Providing the configuration to a buildable or publishable library that doesn't need it adds some unnecessary overhead to the build process. The executor will still load the configuration and the **PostCSS** plugin will process the stylesheets unnecessarily.
How does this work?
@@ -238,7 +236,7 @@ When the **PostCSS** plugin processes a file containing these, it processes them
But we do use **Tailwind CSS** utility classes in the libraries and CSS needs to be generated for them. So, how is the CSS generated for those classes if the libraries are not configured?
If we recall from a previous section, in our applications `tailwind.config.js` file, we have the following:
If we recall from a previous section, in our application's `tailwind.config.js` file, we have the following:
```javascript {% fileName="tailwind.config.js" %}
...
@@ -252,11 +250,11 @@ module.exports = {
};
```
The `content` property of the configuration tells **Tailwind CSS** where to look for usages of utility classes. When the **PostCSS** plugin finds a file using the `@tailwind` directive, it will collect all the utility classes for the layer specified by the directive in the files matching the glob patterns set in the `content` property of the configuration, and it will produce the CSS replacing the directive. Its worth noting that the **PostCSS** plugin only scans the files collecting the utility classes that are used, it doesnt process them. Only the file containing the `@tailwind` directive is updated with the resulting CSS.
The `content` property of the configuration tells **Tailwind CSS** where to look for usages of utility classes. When the **PostCSS** plugin finds a file using the `@tailwind` directive, it will collect all the utility classes for the layer specified by the directive in the files matching the glob patterns set in the `content` property of the configuration, and it will produce the CSS replacing the directive. It's worth noting that the **PostCSS** plugin only scans the files collecting the utility classes that are used, it doesn't process them. Only the file containing the `@tailwind` directive is updated with the resulting CSS.
Since we have our application configured to scan the relevant files within itself and also within its dependencies, the utility classes used in the libraries that are dependencies of the application will be picked up correctly and the CSS will be generated for them.
> Its important to note that the support for **Tailwind CSS** for **Angular** libraries is only available using the `@nrwl/angular:ng-packagr-lite` executor for buildable libraries and the `@nrwl/angular:package` executor for publishable libraries.
> It's important to note that the support for **Tailwind CSS** for **Angular** libraries is only available using the `@nrwl/angular:ng-packagr-lite` executor for buildable libraries and the `@nrwl/angular:package` executor for publishable libraries.
Below is a small decision tree to check whether a **Tailwind CSS** configuration is needed for your library in an **Nx** workspace:
@@ -265,11 +263,11 @@ _Decision tree for the need of Tailwind CSS configuration in Angular libraries_
## Extracting the header into a library
Our application is looking good. At the same time, theres a great opportunity to reuse some of its components in another application. Therefore, we are going to extract the shared components into several shared libraries.
Our application is looking good. At the same time, there's a great opportunity to reuse some of its components in another application. Therefore, we are going to extract the shared components into several shared libraries.
> The applications of this blog post are very simple and its probably not worthy to extract the components into multiple libraries. We are doing it for illustrative purposes to cover the different scenarios we might find in real-life applications.
> The applications of this blog post are very simple and it's probably not worthy to extract the components into multiple libraries. We are doing it for illustrative purposes to cover the different scenarios we might find in real-life applications.
Well start by extracting the header of the application into a reusable component and placing it into a library. To do so, we start by creating a new **Angular** library in our workspace by running:
We'll start by extracting the header of the application into a reusable component and placing it into a library. To do so, we start by creating a new **Angular** library in our workspace by running:
```shell
npx nx generate @nrwl/angular:lib lib1
@@ -289,7 +287,7 @@ Add the markup for the header to the `libs/lib1/src/lib/header/header.component.
</header>
```
Import `Lib1Module` into our applications `AppModule`:
Import `Lib1Module` into our application's `AppModule`:
```typescript {% fileName="app.module.ts" %}
...
@@ -335,7 +333,7 @@ npx nx generate @nrwl/angular:setup-tailwind lib2
As explained in a previous section when we did the same for the application, the above command will install any required dependencies if needed, create the `tailwind.config.js` file and in the specific case of libraries, it will also add the `tailwindConfig` property to the `build` target of the project configuration.
> **Angular** applications, buildable and publishable libraries can be created with **Tailwind CSS** support with a single command. Well see that in the upcoming section. The `_@nrwl/angular:setup-tailwind_` generator is used to add **Tailwind CSS** support to existing projects.
> **Angular** applications, buildable and publishable libraries can be created with **Tailwind CSS** support with a single command. We'll see that in the upcoming section. The `_@nrwl/angular:setup-tailwind_` generator is used to add **Tailwind CSS** support to existing projects.
Then, we create the card component:
@@ -383,7 +381,7 @@ export class CardComponent {
</div>
```
Import `Lib2Module` into our applications `AppModule`:
Import `Lib2Module` into our application's `AppModule`:
```typescript {% fileName="app.module.ts" %}
...
@@ -420,7 +418,7 @@ And finally, replace the existing markup for the cards in the `apps/app1/src/app
</div>
```
With that in place, we can serve the application and it should be working exactly as before, but our application is still not fully set up to consume the library build output. As it stands right now, when the application thats consuming it is built, the library will be built together with it and its files will be processed as part of the application build pipeline.
With that in place, we can serve the application and it should be working exactly as before, but our application is still not fully set up to consume the library build output. As it stands right now, when the application that's consuming it is built, the library will be built together with it and its files will be processed as part of the application build pipeline.
To finish the buildable library setup, we can follow the instructions in [/recipes/angular/setup-incremental-builds-angular](/recipes/angular/setup-incremental-builds-angular). We need to install the `@nrwl/web` package, change the application `build` target executor to `@nrwl/angular:webpack-browser`, and change the application `serve` target executor to `@nrwl/web:file-server`:
@@ -456,13 +454,13 @@ yarn add -D @nrwl/web@latest
You can now go ahead and serve the application to check everything is working as expected. You should see the buildable library being built on its own before the application is built and served.
> The `@nrwl/web:file-server` executor uses the [http-server](https://www.npmjs.com/package/http-server) package to serve the built artifacts of our application. This is a lightweight HTTP server and it doesnt do things like live-reload or HMR. Be sure to refresh your browser while making changes to see them reflected.
> The `@nrwl/web:file-server` executor uses the [http-server](https://www.npmjs.com/package/http-server) package to serve the built artifacts of our application. This is a lightweight HTTP server and it doesn't do things like live-reload or HMR. Be sure to refresh your browser while making changes to see them reflected.
## Using Tailwind CSS directives and functions in buildable libraries
Our application is consuming a buildable library and still working as intended, but if we think about it, we didnt configure our theme in the librarys `tailwind.config.js` file. So, how is it still working?
Our application is consuming a buildable library and still working as intended, but if we think about it, we didn't configure our theme in the library's `tailwind.config.js` file. So, how is it still working?
If we go back to the decision tree shared in a previous section, well see that a buildable library only needs a **Tailwind CSS** configuration if we use a **Tailwind CSS** directive or function. As of right now, our library is not using any. We are just using some utility classes and those are processed correctly as part of the application build. You could go ahead and delete the `tailwind.config.js` file from the library and check that everything still works the same (if you do, please make sure to restore it before we continue).
If we go back to the decision tree shared in a previous section, we'll see that a buildable library only needs a **Tailwind CSS** configuration if we use a **Tailwind CSS** directive or function. As of right now, our library is not using any. We are just using some utility classes and those are processed correctly as part of the application build. You could go ahead and delete the `tailwind.config.js` file from the library and check that everything still works the same (if you do, please make sure to restore it before we continue).
Next, we are going to refactor our newly created card component to make use of some of these directives and functions and see the implications.
@@ -498,9 +496,9 @@ Update the card component files content as shown below:
We created some CSS classes where we are applying the same styles we had in the component template. We are applying those styles by using a combination of the `@apply` directive and the `theme` function.
> Please note we are not recommending creating CSS classes for scenarios like the above. The card component is already a reusable component and theres no need to extract CSS classes to style it. We are only extracting these classes to showcase how **Tailwind CSS** directives and functions can be correctly processed in buildable libraries. Make sure to check out the [**Tailwind CSS** recommendations for reusing styles](https://tailwindcss.com/docs/reusing-styles).
> Please note we are not recommending creating CSS classes for scenarios like the above. The card component is already a reusable component and there's no need to extract CSS classes to style it. We are only extracting these classes to showcase how **Tailwind CSS** directives and functions can be correctly processed in buildable libraries. Make sure to check out the [**Tailwind CSS** recommendations for reusing styles](https://tailwindcss.com/docs/reusing-styles).
If we now serve our application (or build the library), well find ourselves with the following error:
If we now serve our application (or build the library), we'll find ourselves with the following error:
```
------------------------------------------------------------------------------
@@ -509,9 +507,9 @@ Building entry point '@angular-tailwind-nx/lib2'
/angular-tailwind-nx/libs/lib2/src/lib/card/card.component.css:2:3: The `p-lg` class does not exist. If `p-lg` is a custom class, make sure it is defined within a `@layer` directive.
```
This is to be expected. The library build is failing because now we are using some **Tailwind CSS** directives and functions, and therefore, those directives and functions are being processed within the library context. Since we havent touched the `tailwind.config.js` file, **Tailwind CSS** doesnt know about our custom theme.
This is to be expected. The library build is failing because now we are using some **Tailwind CSS** directives and functions, and therefore, those directives and functions are being processed within the library context. Since we haven't touched the `tailwind.config.js` file, **Tailwind CSS** doesn't know about our custom theme.
To solve the issue, we need to configure the library to be aware of our custom theme so it can process the librarys files correctly. Lets update the `theme` property of the `libs/lib2/tailwind.config.js` file to match our application theme:
To solve the issue, we need to configure the library to be aware of our custom theme so it can process the library's files correctly. Let's update the `theme` property of the `libs/lib2/tailwind.config.js` file to match our application theme:
```javascript {% fileName="tailwind.config.js" %}
...
@@ -550,12 +548,12 @@ Well, no need to fret!
If we think about it, the same reasoning behind creating shared libraries applies to this. We just need to share the **Tailwind CSS** configuration. To do so, we have a couple of options:
- Create a shared file containing and exporting the theme so it can be imported by every projects `tailwind.config.js` file.
- Create a shared file containing and exporting the theme so it can be imported by every project's `tailwind.config.js` file.
- Create a [**Tailwind CSS** preset](https://tailwindcss.com/docs/presets) to expose a base configuration for your projects.
The last option is the better one. We can take advantage of the **Tailwind CSS** built-in support for defining a base configuration to be reused across different projects. The first option is almost the same, with the difference that we have to manually handle merging the configurations.
Well go ahead and create a **Tailwind CSS** preset and well then use it in our projects. Start by creating a `tailwind.config.js` file in the root of the workspace with the following content:
We'll go ahead and create a **Tailwind CSS** preset and we'll then use it in our projects. Start by creating a `tailwind.config.js` file in the root of the workspace with the following content:
```javascript {% fileName="tailwind.config.js" %}
module.exports = {
@@ -603,19 +601,19 @@ module.exports = {
};
```
Notice how we added the preset and removed almost all the configuration because its already defined in the preset.
Notice how we added the preset and removed almost all the configuration because it's already defined in the preset.
Thats all it takes. You can go ahead and serve the application (or refresh the browser if you are already serving it) to check everything is running correctly.
That's all it takes. You can go ahead and serve the application (or refresh the browser if you are already serving it) to check everything is running correctly.
## Sharing the Tailwind CSS preset in a library
We now only have to maintain our theme in a single place as opposed to keeping in sync the configuration of all the different projects. But we can still improve the experience. As it stands, if you now make a change on the `tailwind.config.js` file located at the root of the workspace (our preset), the file server doesnt pick up the change and therefore, it doesnt rebuild the affected projects.
We now only have to maintain our theme in a single place as opposed to keeping in sync the configuration of all the different projects. But we can still improve the experience. As it stands, if you now make a change on the `tailwind.config.js` file located at the root of the workspace (our preset), the file server doesn't pick up the change and therefore, it doesn't rebuild the affected projects.
This happens because the file server is watching for changes under the `apps` and `libs` folders. The preset configuration is not under those directories, its in the root of the workspace.
This happens because the file server is watching for changes under the `apps` and `libs` folders. The preset configuration is not under those directories, it's in the root of the workspace.
It would be better if we place the preset configuration in a small shared library. By doing that, we not only solve the issue regarding detecting changes on it, but we also make its library appear on the [**Nx** project graph](/concepts/mental-model), and with that, we benefit from all the goodies associated with the project graph (affected commands, enforcing module boundaries constraints, etc.).
This library is only going to contain the `tailwind.config.js` file and no targets in the project configuration. Theres no generator among the **Nx** core plugins that generate such an empty library. We could use one of the library generators and remove some content, but lets create it manually.
This library is only going to contain the `tailwind.config.js` file and no targets in the project configuration. There's no generator among the **Nx** core plugins that generate such an empty library. We could use one of the library generators and remove some content, but let's create it manually.
Start by creating a new folder `libs/tailwind-preset` and moving the `tailwind.config.js` file we created in the previous section at the root of the workspace to that folder.
@@ -653,16 +651,16 @@ const sharedTailwindConfig = require('../../libs/tailwind-preset/tailwind.config
Once again, if we serve our application everything should still be working as expected, but now our file server will pick up the changes made to the **Tailwind CSS** preset configuration.
Also, if we visualize the workspace projects well see how `app1` and `lib2` now have a dependency on `tailwind-preset`:
Also, if we visualize the workspace projects we'll see how `app1` and `lib2` now have a dependency on `tailwind-preset`:
![](/blog/images/2022-01-28/F1p0OfL4WrmubTQ2QPX04Q.avif)
_Project graph showing dependencies between the projects in the workspace_
## Creating the second application
We are now at a stage where we can develop our second application without having to duplicate the common functionality. So, before going ahead and distributing our buttons in a publishable library, lets first create the second application to see how we can reuse what we have been putting into libraries.
We are now at a stage where we can develop our second application without having to duplicate the common functionality. So, before going ahead and distributing our buttons in a publishable library, let's first create the second application to see how we can reuse what we have been putting into libraries.
Theres one important thing to note though, this new application will have a different theme.
There's one important thing to note though, this new application will have a different theme.
Generate the application by running the following command:
@@ -674,7 +672,7 @@ The above command will generate the new application and it will configure **Tail
> The `--addTailwind` flag is available in both `@nrwl/angular:app` and `@nrwl/angular:lib` generators.
Lets now update the application to use the shared components and achieve the layout we are after. Start by updating the `apps/app2/src/app/app.module.ts` to import `Lib1Module` and `Lib2Module`:
Let's now update the application to use the shared components and achieve the layout we are after. Start by updating the `apps/app2/src/app/app.module.ts` to import `Lib1Module` and `Lib2Module`:
```typescript {% fileName="app.module.ts" %}
...
@@ -689,7 +687,7 @@ import { Lib2Module } from '@angular-tailwind-nx/lib2';
export class AppModule {}
```
Next, update the `apps/app2/src/app/app.component.html` file with the required markup and **Tailwind CSS** utility classes to achieve our applications layout and using the component exported by the shared libraries we previously created:
Next, update the `apps/app2/src/app/app.component.html` file with the required markup and **Tailwind CSS** utility classes to achieve our application's layout and using the component exported by the shared libraries we previously created:
```angular2html {% fileName="app.component.html" %}
<div class="font-mono">
@@ -740,7 +738,7 @@ Like we did with `app1`, we also need to update the `build` and `serve` targets
}
```
Last but not least, we need to configure **Tailwind CSS** with our custom theme for `app2`. Well do that by updating the `apps/app2/tailwind.config.js` file with the following:
Last but not least, we need to configure **Tailwind CSS** with our custom theme for `app2`. We'll do that by updating the `apps/app2/tailwind.config.js` file with the following:
```javascript {% fileName="tailwind.config.js" %}
...
@@ -772,31 +770,31 @@ module.exports = {
};
```
Now that we have the second application configured, lets run it:
Now that we have the second application configured, let's run it:
```shell
npx nx run app2:serve
```
> You can pass a `--port=4201` to the above command to run it in a different port if its in use or if you want to have both applications running side-by-side.
> You can pass a `--port=4201` to the above command to run it in a different port if it's in use or if you want to have both applications running side-by-side.
Now, open your browser and navigate to it where you should see the application looking like the following screenshot:
![](/blog/images/2022-01-28/LoOmmjSzfB33ho9NhcqQKQ.avif)
_Application 2 screenshot_
That does indeed look different, but something is off. The card background color is not right, its still the same used for `app1` even though we provided a different theme. Also, some of the spacing for the elements within the card doesnt seem to have changed according to our configuration.
That does indeed look different, but something is off. The card background color is not right, it's still the same used for `app1` even though we provided a different theme. Also, some of the spacing for the elements within the card doesn't seem to have changed according to our configuration.
What is going on here?
You might have realized a couple of things by now:
- The card component comes from `lib2` which is a buildable library and as such, its built on its own using its own **Tailwind CSS** configuration
- The card component comes from `lib2` which is a buildable library and as such, it's built on its own using its own **Tailwind CSS** configuration
- `app1` and `lib2` use a **Tailwind CSS** preset to share the common configuration, while `app2` is adding its own
So, the first bullet point above would explain why the card component looks like the one rendered using the theme for `app1`. But thats not exactly what we are seeing, the buttons inside the card look different than what we have in `app1`. This is explained by the fact that the buttons are styled without using any **Tailwind CSS** directive or function, they just use utility classes, so the CSS for them is generated in the `app2` build using the application configuration. The rest of the card does use directives and functions, so the CSS for that is generated in the `lib2` build using the library configuration.
So, the first bullet point above would explain why the card component looks like the one rendered using the theme for `app1`. But that's not exactly what we are seeing, the buttons inside the card look different than what we have in `app1`. This is explained by the fact that the buttons are styled without using any **Tailwind CSS** directive or function, they just use utility classes, so the CSS for them is generated in the `app2` build using the application configuration. The rest of the card does use directives and functions, so the CSS for that is generated in the `lib2` build using the library configuration.
Also, we previously created a **Tailwind CSS** preset so we could share the base configuration among different projects. The problem is that all those projects shared a common theme, but `app2` requires a different one, so we cant just use the preset as it is right now.
Also, we previously created a **Tailwind CSS** preset so we could share the base configuration among different projects. The problem is that all those projects shared a common theme, but `app2` requires a different one, so we can't just use the preset as it is right now.
So, how do we solve this?
@@ -804,7 +802,7 @@ Enter CSS variables!
We can configure the **Tailwind CSS** preset to use CSS variables. This will allow each application to provide its own values for the variables and therefore, it enables us to have multiple themes using the same **Tailwind CSS** configuration.
Lets update our preset in the `libs/tailwind-preset/tailwind.config.js` file to use CSS variables instead of literal values:
Let's update our preset in the `libs/tailwind-preset/tailwind.config.js` file to use CSS variables instead of literal values:
```javascript {% fileName="tailwind.config.js" %}
module.exports = {
@@ -894,7 +892,7 @@ We need to do the same for `app1`. Edit the `apps/app1/src/styles.css` file with
}
```
Lets serve again `app2` and navigate to it to check the results of our changes:
Let's serve again `app2` and navigate to it to check the results of our changes:
![](/blog/images/2022-01-28/TwcAfPTrKRm1D9ydEFwWWA.avif)
_Application 2 screenshot_
@@ -1000,11 +998,11 @@ Once more, we can check both applications and make sure everything is still work
## Distributing the publishable library styles
The recently created publishable library is already being used successfully by both applications, but its still not ready for distribution. If we were to share it now, external consumers will need to provide their own CSS for it because the library itself is not bundling any CSS with the styling for the button. We only used some **Tailwind CSS** utility classes and as we have seen throughout this blog post, the CSS for them is generated in files containing `@tailwind` directives (normally in application style entry points).
The recently created publishable library is already being used successfully by both applications, but it's still not ready for distribution. If we were to share it now, external consumers would need to provide their own CSS for it because the library itself is not bundling any CSS with the styling for the button. We only used some **Tailwind CSS** utility classes and as we have seen throughout this blog post, the CSS for them is generated in files containing `@tailwind` directives (normally in application style entry points).
> Within the workspace, it works as expected because the applications consuming it use the same shared **Tailwind CSS** preset and their dependencies are included in the `content` of their configuration.
The library needs to contain everything thats needed for it to work and to achieve this, we are going to do something we already did with our buildable library: create our own classes using the `@apply` directive.
The library needs to contain everything that's needed for it to work and to achieve this, we are going to do something we already did with our buildable library: create our own classes using the `@apply` directive.
As we learned in a previous section, the `@apply` directive will be transformed into the CSS corresponding to the **Tailwind CSS** classes being applied. Thanks to this, our button component will contain the CSS needed to style it.
@@ -1024,7 +1022,7 @@ Go ahead and update the button component files with a new CSS class for the butt
I used the prefix `atn` (initials of **A**ngular, **T**ailwind CSS, and **N**x) for the CSS class name to prevent potential name collisions with the consumers' applications CSS.
Also, lets update the `libs/lib3/src/lib/button/button.component.ts` file to set the components `encapsulation` to `ViewEncapsulation.None` to allow consumers to overwrite its styles more easily:
Also, let's update the `libs/lib3/src/lib/button/button.component.ts` file to set the component's `encapsulation` to `ViewEncapsulation.None` to allow consumers to overwrite its styles more easily:
```typescript {% fileName="button.component.ts" %}
@@ -1043,7 +1041,7 @@ If we build our library now, the styles for the button component will be correct
We need to provide an initial theme that sets those CSS variables so the library components can be consumed without any additional setup. Actually, we are going to generate a couple of theme options so we can see how multiple themes can be provided.
Lets start by creating a `libs/lib3/src/styles/teal.css` theme file where we are going to import the **Tailwind CSS** `components` and `utilities` layers and define the values for the CSS variables of our theme:
Let's start by creating a `libs/lib3/src/styles/teal.css` theme file where we are going to import the **Tailwind CSS** `components` and `utilities` layers and define the values for the CSS variables of our theme:
```css {% fileName="teal.css" %}
@tailwind components;
@@ -1068,7 +1066,7 @@ Lets start by creating a `libs/lib3/src/styles/teal.css` theme file where we
}
```
Notice that we didnt include the `base` layer like we have done so far in the applications style entry points. This is because this is a component library and the `base` layer generates a set of application-wide base styles and thats not what we want to generate here.
Notice that we didn't include the `base` layer like we have done so far in the applications style entry points. This is because this is a component library and the `base` layer generates a set of application-wide base styles and that's not what we want to generate here.
Next, we generate our second theme by creating the `libs/lib3/src/styles/indigo.css` theme file with different values for the CSS variables:
@@ -1095,11 +1093,11 @@ Next, we generate our second theme by creating the `libs/lib3/src/styles/indigo.
}
```
With that in place, we now need to make sure those theme files are processed when we build the library. The `@nrwl/angular:package` executor is powered by the [**ng-packagr**](https://github.com/ng-packagr/ng-packagr) package to build the library. This is a tool recommended by **Angular** to ensure libraries are distributed using the [Angular Package Format](https://angular.io/guide/angular-package-format). Unfortunately, it doesnt have native support for building standalone stylesheets that are not referenced by a component, so we need to configure it ourselves.
With that in place, we now need to make sure those theme files are processed when we build the library. The `@nrwl/angular:package` executor is powered by the [**ng-packagr**](https://github.com/ng-packagr/ng-packagr) package to build the library. This is a tool recommended by **Angular** to ensure libraries are distributed using the [Angular Package Format](https://angular.io/guide/angular-package-format). Unfortunately, it doesn't have native support for building standalone stylesheets that are not referenced by a component, so we need to configure it ourselves.
To do so, we are going to use the **Tailwind CSS** CLI to process our stylesheets when the library is built and well do it in parallel since they dont depend on each other. One aspect to consider is that the `@nrwl/angular:package` executor will delete the destination folder before building. When running both processes in parallel, the styles might be generated first and then the directory containing them is deleted by the `@nrwl/angular:package` executor. Therefore, we are going to disable that behavior and we are going to control when to delete the destination folder to avoid any issues.
To do so, we are going to use the **Tailwind CSS** CLI to process our stylesheets when the library is built and we'll do it in parallel since they don't depend on each other. One aspect to consider is that the `@nrwl/angular:package` executor will delete the destination folder before building. When running both processes in parallel, the styles might be generated first and then the directory containing them is deleted by the `@nrwl/angular:package` executor. Therefore, we are going to disable that behavior and we are going to control when to delete the destination folder to avoid any issues.
Another thing to consider is that the **Tailwind CSS** CLI only supports processing one file at a time, it doesnt accept glob patterns or directories. Well need to run a command per theme in our library.
Another thing to consider is that the **Tailwind CSS** CLI only supports processing one file at a time, it doesn't accept glob patterns or directories. We'll need to run a command per theme in our library.
To orchestrate this, we are going to make the following changes to the `lib3` project configuration:
@@ -1198,7 +1196,7 @@ We can now build the library by running:
npx nx run lib3:build
```
If we check the output folder `dist/libs/lib3`, well see theres a `themes` folder in it with a couple of files `indigo.css` and `teal.css`:
If we check the output folder `dist/libs/lib3`, we'll see there's a `themes` folder in it with a couple of files `indigo.css` and `teal.css`:
![](/blog/images/2022-01-28/vcHqTWEppPbVtGRlVIqEPg.avif)
_Publishable library with the produced theme files highlighted_
@@ -2,13 +2,14 @@
title: 'Share code between React Web & React Native Mobile with Nx'
slug: 'share-code-between-react-web-react-native-mobile-with-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2022-02-01/lL-fGNaIGYBC_eOBwSvdBw.png'
cover_image: '/blog/images/2022-02-01/lL-fGNaIGYBC_eOBwSvdBw.avif'
tags: [nx, tutorial]
description: Learn how to create and manage React web and React Native mobile apps in an Nx monorepo, with guidance on sharing code and handling platform differences.
---
**A problem I try to solve:** I got this awesome idea, not only do I want to create a web app, but I also want to create a mobile app for it. Usually creating web and mobile apps require totally different tech stacks, and it is pretty hard to share code. This article shows how I added a React web app and a React Native mobile app in the same monorepo using Nx, and how I optimized codeshare between the two.
I am mostly a web developer, so lets start with the web app first: [https://xiongemi.github.io/studio-ghibli-search-engine](https://xiongemi.github.io/studio-ghibli-search-engine). It is a search engine for movies and characters under Studio Ghibli:
I am mostly a web developer, so let's start with the web app first: [https://xiongemi.github.io/studio-ghibli-search-engine](https://xiongemi.github.io/studio-ghibli-search-engine). It is a search engine for movies and characters under Studio Ghibli:
![](/blog/images/2022-02-01/TILaEjwvKtDTODE8Zo7wFA.avif)
_Screenshot of web app_
@@ -17,7 +18,7 @@ Example Repo: [xiongemi/studio-ghibli-search-engine](https://github.com/xiongemi
Github page: [https://xiongemi.github.io/studio-ghibli-search-engine](https://github.com/xiongemi/studio-ghibli-search-engine)
Now lets create the corresponding mobile version of this app.
Now let's create the corresponding mobile version of this app.
## Tech Stack
@@ -25,7 +26,7 @@ Now lets create the corresponding mobile version of this app.
- Web Frontend: [React](https://reactjs.org/)
- API: [https://ghibliapi.herokuapp.com/](https://ghibliapi.herokuapp.com/)
Currently, theres only a React web app within our Nx workspace. If I run `nx graph`, the dependency graph looks like the below:
Currently, there's only a React web app within our Nx workspace. If I run `nx graph`, the dependency graph looks like the below:
![](/blog/images/2022-02-01/AkrRrJ1pbALScj64T8rc_g.avif)
_Dependency graph_
@@ -46,7 +47,7 @@ Next, we can generate a new React Native app by running:
npx nx generate @nrwl/react-native:app studio-ghibli-search-engine-mobile
```
> Note, if youre using VSCode you might want to try [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console) for a more visual experience of running such commands.
> Note, if you're using VSCode you might want to try [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console) for a more visual experience of running such commands.
As a result of running the above command, you should now have two new folders under the `apps` directory: `studio-ghibli-search-engine-mobile` and `studio-ghibli-search-engine-mobile-e2e`
@@ -68,7 +69,7 @@ Even though our goal is to share as much as possible between our React web app a
We have to rewrite all the UI components for the mobile app. Unlike [Cordova](https://cordova.apache.org/) or [Ionic](https://ionicframework.com/), React Native is NOT a webview. The JavaScript we wrote got interpreted and converted to mobile native elements. Hence we cannot simply reuse UI HTML elements written for the React web app.
Heres a quick list of libraries weve used for the React web app and a corresponding React Native counterpart library we can use.
Here's a quick list of libraries we've used for the React web app and a corresponding React Native counterpart library we can use.
**Routing**
@@ -246,7 +247,7 @@ Nx comes with a set of different options for [handling environment variables](/r
NX_REQUEST_BASE_URL=://ghibliapi.herokuapp.com
```
This works nicely for our React web build, but it doesnt for our React Native application. This is because React Native and React apps use different Javascript bundlers. React Native uses [Metro](https://facebook.github.io/metro/) and React uses [Webpack](https://webpack.js.org/). Therefore, when we try to access `process.env.NX_REQUEST_BASE_URL`, we get `undefined`.
This works nicely for our React web build, but it doesn't for our React Native application. This is because React Native and React apps use different Javascript bundlers. React Native uses [Metro](https://facebook.github.io/metro/) and React uses [Webpack](https://webpack.js.org/). Therefore, when we try to access `process.env.NX_REQUEST_BASE_URL`, we get `undefined`.
To solve this, we can use the [react-native-config](https://github.com/luggit/react-native-config) library
@@ -256,7 +257,7 @@ npm install react-native-config --save-dev# yarn
yarn add react-native-config --dev
```
Heres an example of how to set up [react-native-config](https://github.com/luggit/react-native-config): [https://github.com/luggit/react-native-config#setup](https://github.com/luggit/react-native-config#setup).
Here's an example of how to set up [react-native-config](https://github.com/luggit/react-native-config): [https://github.com/luggit/react-native-config#setup](https://github.com/luggit/react-native-config#setup).
After that, we can have a simple utility function to retrieve the environment variables in our app.
@@ -267,11 +268,11 @@ export function getEnv(envName: string) {
}
```
To access the environment variable `NX_REQUEST_BASE_URL`, we can then simply use the above function:`getEnv(NX_REQUEST_BASE_URL)`.
To access the environment variable `NX_REQUEST_BASE_URL`, we can then simply use the above function:`getEnv('NX_REQUEST_BASE_URL')`.
### Fetch With HTTP
On the web, you most probably lean on the [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make network requests. On iOS, however, youll get an error saying: `TypeError: Network request failed`.
On the web, you most probably lean on the [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make network requests. On iOS, however, you'll get an error saying: `TypeError: Network request failed`.
It turns out that React Native does not allow HTTP requests by default: [https://stackoverflow.com/questions/38418998/react-native-fetch-network-request-failed](https://stackoverflow.com/questions/38418998/react-native-fetch-network-request-failed).
@@ -466,7 +467,7 @@ _Screenshots of Mobile App (left: iOS, right: Android)_
In this article, we ended up building both, a React-based web application and a corresponding React Native app in the same repository using Nx.
Nxs architecture promotes the separation of concerns, splitting things into `apps` (which are technology-specific) and `libs` which can be technology-specific or technology-independent. That allows us to easily have our common business logic in a technology-independent library which in turn (thanks to Nxs setup) be easily linked to both, our React web and React Native mobile app.
Nx's architecture promotes the separation of concerns, splitting things into `apps` (which are technology-specific) and `libs` which can be technology-specific or technology-independent. That allows us to easily have our common business logic in a technology-independent library which in turn (thanks to Nx's setup) be easily linked to both, our React web and React Native mobile app.
Although there are UI-specific differences we need to account for, that simply comes with one being a web tech stack and the other being a native app, we were still able to share big chunks of the technology-independent business logic of our application. That ultimately helps with maintenance and having feature parity across different platforms.
@@ -2,8 +2,9 @@
title: 'Introducing Expo Support for Nx'
slug: 'introducing-expo-support-for-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2022-03-23/yYc8g4ifk9RApSjAhQysag.png'
cover_image: '/blog/images/2022-03-23/yYc8g4ifk9RApSjAhQysag.avif'
tags: [nx, release]
description: Introducing @nrwl/expo for seamless Expo integration in Nx monorepos, with a tutorial on building a poetry app using Expo's development tools.
---
We are very excited to announce our support for Expo with our new package `@nrwl/expo`. In addition to the React Native support, with this release of `@nrwl/expo`, you will be able to easily develop mobile apps in the monorepo. If you use Expo in a monorepo then Nx is the tool for you.
@@ -17,7 +18,7 @@ Github Repo: [xiongemi/nx-expo-poetry](https://github.com/xiongemi/nx-expo-poetr
## Before We Start
When I just started to try out Expo, the first questions came to my mind were what is the difference between Expo and React Native and when to choose Expo and when to choose React Native? In short, Expo is a set of tools built on top of React Native. You can read it more at [https://stackoverflow.com/questions/39170622/what-is-the-difference-between-expo-and-react-native](https://stackoverflow.com/questions/39170622/what-is-the-difference-between-expo-and-react-native).
When I just started to try out Expo, the first questions came to my mind were "what is the difference between Expo and React Native" and "when to choose Expo and when to choose React Native"? In short, Expo is a set of tools built on top of React Native. You can read it more at [https://stackoverflow.com/questions/39170622/what-is-the-difference-between-expo-and-react-native](https://stackoverflow.com/questions/39170622/what-is-the-difference-between-expo-and-react-native).
Now I have created an app with Expo, to me, the most significant differences are developer experience and the build process.
@@ -32,7 +33,7 @@ Moreover, Expo provides [Expo Application Services(EAS)](https://docs.expo.dev/e
## Setup
First, lets create an Nx workspace:
First, let's create an Nx workspace:
```shell
npx create-nx-workspace nx-expo-poetry --preset=empty
@@ -73,7 +74,7 @@ _Expo Development Server_
## Create First Page
Now we got the app running, lets create our first page. In this example, we are going to use the [React Native Paper](https://callstack.github.io/react-native-paper/) as the material design library. To install:
Now we got the app running, let's create our first page. In this example, we are going to use the [React Native Paper](https://callstack.github.io/react-native-paper/) as the material design library. To install:
```shell
# npm
@@ -83,7 +84,7 @@ npm install react-native-paper --save
yarn add react-native-paper
```
Then, lets create our first component. This component simply displays a poem on the page.
Then, let's create our first component. This component simply displays a poem on the page.
First, to add a component file under the app, run the below command:
@@ -291,11 +292,11 @@ With Nx, we can create as many libraries as we want to handle different concerns
I hope you found this useful, and we look forward to hearing your [feedback](https://github.com/nrwl/nx-labs/issues).
If youre new to Nx and want to learn more, visit [our docs](/getting-started/intro)**.**
If you're new to Nx and want to learn more, visit [our docs](/getting-started/intro)**.**
_(Note, the repository with the code for this article is linked at the very top.)_
This app is also available in the app store, just search Poem of the Day:
This app is also available in the app store, just search "Poem of the Day":
Android:
@@ -1,16 +1,17 @@
---
title: 'The React CLI you always wanted but didnt know about'
title: "The React CLI you always wanted but didn't know about"
slug: 'the-react-cli-you-always-wanted-but-didnt-know-about'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-03-29/YR6QUEZel3nlNcTo6Pdlwg.png'
cover_image: '/blog/images/2022-03-29/YR6QUEZel3nlNcTo6Pdlwg.avif'
tags: [nx]
description: Discover Nx as a powerful CLI for React development with built-in project generation, build tools, and pre-configured integrations for modern tooling.
---
_In this article, Id like to specifically talk about developer tooling, why it is so massively important and how you might have missed out on Nx as your main React CLI for kickstarting new awesome projects._
_In this article, I'd like to specifically talk about developer tooling, why it is so massively important and how you might have missed out on Nx as your main React CLI for kickstarting new awesome projects._
It is awesome to be a JavaScript developer nowadays. The JavaScript ecosystem has evolved a lot in recent years. For the better! Speed has become a major focus, both from the framework perspective of running the app in production, as well as the speed of developing, testing, and building JavaScript/TypeScript from a developer tooling point of view. Frameworks and libraries such as Next.js, Astro, Qwik and Remix (just to name a few) have brought some great innovations to push the web even further.
While speed is of major importance, developer ergonomics shouldnt be left behind. Both of them greatly contribute to the overall productivity and also developer happiness 🙂. Lets see how Nx can help with that.
While speed is of major importance, developer ergonomics shouldn't be left behind. Both of them greatly contribute to the overall productivity and also developer happiness 🙂. Let's see how Nx can help with that.
**Prefer the video version?**
@@ -18,32 +19,30 @@ While speed is of major importance, developer ergonomics shouldnt be left beh
## Update (Aug 2023): Want a non-monorepo setup?
This article walks you through how to setup a new Nx monorepo workspace with React. If you rather prefer starting with a single-project setup (also named standalone) then you might want to have a look at this tutorial (including video):
[/getting-started/tutorials/react-standalone-tutorial](/getting-started/tutorials/react-standalone-tutorial)
This article walks you through how to setup a new Nx monorepo workspace with React. If you rather prefer starting with a single-project setup (also named "standalone") then you might want to have a look at the standalone tutorial (including video).
## Why use a devtool CLI?
Regardless of whether youre a seasoned developer or someone new just getting started with React: the last thing you want to have to deal with is to manually set up all the tooling to actually get started and be productive. You want to be able to focus on the actual task, like learning React or kicking off that new shiny project.
Regardless of whether you're a seasoned developer or someone new just getting started with React: the last thing you want to have to deal with is to manually set up all the tooling to actually get started and be productive. You want to be able to focus on the actual task, like learning React or kicking off that new shiny project.
Still, we definitely want to **have good defaults set up for us**. Things like the latest build tooling, tooling for writing unit tests as well as e2e tests, code quality tools like linters, and we definitely also dont want to argue about tabs vs spaces or spend time formatting our code: Prettier can help with that.
Still, we definitely want to **have good defaults set up for us**. Things like the latest build tooling, tooling for writing unit tests as well as e2e tests, code quality tools like linters, and we definitely also don't want to argue about tabs vs spaces or spend time formatting our code: Prettier can help with that.
Taking the time to set up a starter kit or template would work. But it is time-consuming, requires a lot of knowledge, and especially needs maintenance to update the tools over time. That rarely works out well in the long run, unless this is your job.
## Nx — from a birds eye view
## Nx — from a bird's eye view
What you usually want is a CLI, a command-line interface that helps you develop and deal with the underlying build infrastructure, something that sets you up with modern up-to-date tooling and also keeps those updated!
Nx comes with such a CLI, it is widely adopted by the Angular, React and Node community currently being downloaded more than 1.3 million times a week. Nx is [fully open source](https://github.com/nrwl/nx) (MIT licensed), baked by [Nrwl](/company) and the [community](https://go.nx.dev/community).
From a birds eye view, Nx comes with
From a bird's eye view, Nx comes with
- Code generators to generate new projects, configuration but also components, Redux setup, routes
- Code generators to generate new projects, configuration but also components, Redux setup, routes...
- Out of the box support for modern tools such as TypeScript, Webpack, Babel, SWC, Jest, Cypress, ESLint, Prettier, Storybook and more
- It keeps tooling up to date via dedicated migration commands
- Speed! Nx uses local computation caching that can be extended with Nx Cloud (which is basically free) to remote caching and DTE (Distributed Task Execution).
But lets have a deeper look at how Nx works exactly.
But let's have a deeper look at how Nx works exactly.
## Using Nx
@@ -57,20 +56,20 @@ Open your favorite terminal window and type:
npx create-nx-workspace@latest myorg
```
> _Note, Im using_ `_npx_` _to not have to install the Nx CLI globally. If you want to, you totally can:_ `_npm i nx -g_`
> _Note, I'm using_ `_npx_` _to not have to install the Nx CLI globally. If you want to, you totally can:_ `_npm i nx -g_`
`myorg` is the scope of your Nx workspace. Think of it as your NPM scope in case youd publish an npm package. In the case you create libraries in this new Nx workspace (more about that later), it would be used to import those, like
`myorg` is the scope of your Nx workspace. Think of it as your NPM scope in case you'd publish an npm package. In the case you create libraries in this new Nx workspace (more about that later), it would be used to import those, like
```typescript
import { someFunc } from '@myorg/somelib';
```
What youll get is a setup wizard that guides you through creating your application. We would most likely choose React in this case.
What you'll get is a setup wizard that guides you through creating your application. We would most likely choose "React" in this case.
![](/blog/images/2022-03-29/zLwqiNgVNDrLJMir1BV5TA.avif)
_Nx CLI guides through the setup process_
As part of this process, youll be asked to pick an Application name. This is simply the application Nx is going to generate for us to get started: `happynrwl` would be a nice name 🙂.
As part of this process, you'll be asked to pick an "Application name". This is simply the application Nx is going to generate for us to get started: `happynrwl` would be a nice name 🙂.
You should end up with a new Nx workspace and our `happynrwl` React app in the `apps/` folder.
@@ -85,7 +84,7 @@ To serve our React app, run
npx nx serve happynrwl
```
> _Note I prefix the commands with_ `_npx_`_, which is just a way to use the local_ `_nx_` _binary from the_ `_node_modules_` _folder of our workspace. Also, this way we dont have to install Nx globally. If you prefer doing that, run_ `_npm install -g nx_`_._
> _Note I prefix the commands with_ `_npx_`_, which is just a way to use the local_ `_nx_` _binary from the_ `_node_modules_` _folder of our workspace. Also, this way we don't have to install Nx globally. If you prefer doing that, run_ `_npm install -g nx_`_._
Going to [http://localhost:4200](http://localhost:4200/) should show the running React app located in `apps/happynrwl`.
@@ -107,13 +106,13 @@ _Output folder assets when building the React app_
Nx has another nice feature that basically comes for free: [computation caching](/concepts/how-caching-works). For every command Nx runs, it computes a unique hash that contains information about the involved source code, environment variables and the command itself. Next time the same conditions are met, the command is not executed again, but rather pulled out of a cache. As you can imagine, this drammatically speeds up things.
If youre curious and want to learn more, check out the docs page on [computation caching](/concepts/how-caching-works) and how to leverage [Nx Cloud](/nx-cloud) to store the cache remotely for sharing it with your team members. Also, Nx Cloud pricing recently changed, which makes it basically free for everyone.
If you're curious and want to learn more, check out the docs page on [computation caching](/concepts/how-caching-works) and how to leverage [Nx Cloud](/nx-cloud) to store the cache remotely for sharing it with your team members. Also, Nx Cloud pricing recently changed, which makes it basically free for everyone.
## Code Generators!
One of the core parts of Nx is code generators. As the name already suggests, code generators generate source code and configuration. That can range from a single React component file to an entire project with all that is needed. You basically already saw them in action when you created the initial project setup. But theres more to explore! Every Nx plugin (e.g. `@nrwl/react`, `@nrwl/next`,...) come with their own set of generators. All of them are invoked with the `npx nx generate` or short `npx nx g` command.
One of the core parts of Nx is code generators. As the name already suggests, code generators generate source code and configuration. That can range from a single React component file to an entire project with all that is needed. You basically already saw them in action when you created the initial project setup. But there's more to explore! Every Nx plugin (e.g. `@nrwl/react`, `@nrwl/next`,...) come with their own set of generators. All of them are invoked with the `npx nx generate` or short `npx nx g` command.
Lets for instance generate a new component for our React application:
Let's for instance generate a new component for our React application:
```shell
npx nx generate @nrwl/react:component HelloWorld
@@ -133,11 +132,11 @@ Many of these generators come with a rich set of flags. For example, passing `--
- **Nx documentation** — use the search function there or just navigate the docs. All the reference pages are structured like `nx.dev/packages/<packagename>`. As an example for React that would look like: [/nx-api/react](/nx-api/react).
- `npx nx list` - lists a set of installed plugins as well as other available plugins that can be installed. To get a list of generators for a specific plugin - say for the `@nrwl/react` plugin - run `npx nx list @nrwl/react`. Similarly, you can then run `npx nx g @nrwl/react:lib --help` to get help for a particular generator
However, the absolute easiest way to explore the potential and even use Nx if you are not the terminal type of person is [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)! Ill go a bit deeper into that in a later section.
However, the absolute easiest way to explore the potential and even use Nx if you are not the "terminal type of person" is [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)! I'll go a bit deeper into that in a later section.
## State of the Art Tooling Preconfigured
When setting up a new React project (that also holds for Angular, Node, Next.js,), you do not only get the React project, but also a set of tools preconfigured that help you stay productive and produce higher quality code. These are
When setting up a new React project (that also holds for Angular, Node, Next.js,...), you do not only get the React project, but also a set of tools preconfigured that help you stay productive and produce higher quality code. These are
- TypeScript
- ESLint
@@ -147,7 +146,7 @@ When setting up a new React project (that also holds for Angular, Node, Next.js,
The Nx core team closely collaborates with these open source projects to not only make sure they integrate seamlessly with the React setup but also to keep them updated over time as those tools evolve. In fact, by using [automated code migrations](https://egghead.io/lessons/javascript-update-your-nx-workspace-with-nx-migrations) updating your Nx workspace will automatically also update those tools and the corresponding config files for you.
Lets have a closer look.
Let's have a closer look.
## TypeScript as a first-class citizen!
@@ -174,7 +173,7 @@ npx nx lint happynrwl
Similar to the linting setup, every project in an Nx workspace has a test runner preconfigured already. By default, Nx comes with [Jest](https://jestjs.io/).
At the root of every project, theres a `jest.config.js` which already comes with proper transformers to support TypeScript and TSX/JSX. If you need to further customize how Jest should behave for this project, this is the place to do that.
At the root of every project, there's a `jest.config.js` which already comes with proper transformers to support TypeScript and TSX/JSX. If you need to further customize how Jest should behave for this project, this is the place to do that.
![](/blog/images/2022-03-29/JyIIbncCwSqDMg3gWzUPBw.avif)
_Jest configuration in an Nx workspace_
@@ -189,8 +188,8 @@ Obviously, you can pass parameters to customize the Jest run, like
- `--watch` for interactive mode
- `--t` to execute tests that match a given pattern
- `--testFile="apps/happynrwl/src/app/hello-world/hello-world.spec.tsx”` to run a specific file
-
- `--testFile="apps/happynrwl/src/app/hello-world/hello-world.spec.tsx" to run a specific file
- ...
If you happen to use [VSCode](https://code.visualstudio.com/), the easiest way however is to install [Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) and leverage its code lens feature to run and debug Jest tests:
@@ -206,7 +205,7 @@ Whenever you generate a new project in an Nx workspace, you have the option to a
![](/blog/images/2022-03-29/OA1d-lV54ylpNFd9ayJ07Q.avif)
_Cypress e2e app generated by Nx along-side the main React app_
The awesome part of this is that you dont have to configure anything at all. No need to
The awesome part of this is that you don't have to configure anything at all. No need to
- make sure TypeScript runs smoothly with Cypress
- set up linting for our e2e project (yes writing good quality test code is just as important)
@@ -220,7 +219,7 @@ npx e2e happynrwl-e2e
You can also pass `--watch` to run it interactively with the Cypress test runner such that the tests get re-executed whenever we change our source.
## Dont argue over code formatting — use Prettier!
## Don't argue over code formatting — use Prettier!
Are you a `tabs` or `spaces` person? Use semicolons or not? What about trailing commas? We all know that we devs can have some strong opinions on this 😅. But honestly, there are probably more important things to focus on. Luckily [Prettier](https://prettier.io/) can help a ton with these issues. It is opinionated with just very few configuration options and just takes away the burden of formatting the code.
@@ -234,7 +233,7 @@ npx nx format
![](/blog/images/2022-03-29/1gRcDUmEkjOn6DR8vO9MHA.avif)
Nx really is an advanced CLI based development tool. But regardless of whether you are a command line person or not, if you happen to use [VSCode](https://code.visualstudio.com/) make sure you install the [Nx Console extension](/getting-started/editor-setup) from the [marketplace](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console).
Nx really is an advanced CLI based development tool. But regardless of whether you are a command line person or not, if you happen to use [VSCode](https://code.visualstudio.com/), make sure you install the [Nx Console extension](/getting-started/editor-setup) from the [marketplace](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console).
> _For_ [_Webstorm_](https://www.jetbrains.com/webstorm/) _there are two community extensions that can be used:_ [_nx-webstorm_](https://plugins.jetbrains.com/plugin/15000-nx-webstorm) _and_ [_Nx Console Idea_](https://plugins.jetbrains.com/plugin/15101-nx-console-idea)_._
@@ -245,11 +244,11 @@ _Nx Console VSCode extension_
A couple of things:
- (2) is the panel where you see a fixed command Generate to invoke the Nx generator for creating new projects, libraries etc as we mentioned before. In addition you see a list of available commands to run.
- (2) is the panel where you see a fixed command "Generate" to invoke the Nx generator for creating new projects, libraries etc as we mentioned before. In addition you see a list of available commands to run.
- (3) shows additional commands that are commonly used in an Nx workspace. Feel free to click and explore them.
- (4) shows a list of projects in your workspace. We really just have our React app and Cypress e2e application, but potentially you could add more. See [Nx applications and libraries](/concepts/decisions/project-size) for more.
Lets take the example of generating a new React component, just as we did before, but this time using Nx Console. This is how youd do that:
Let's take the example of generating a new React component, just as we did before, but this time using Nx Console. This is how you'd do that:
![](/blog/images/2022-03-29/wJ4ZldDh_Glvxwl_0SDxHA.avif)
_Actions to generate a new React component with Nx Console_
@@ -259,7 +258,7 @@ Once you click the entry in the dropdown list, the Nx Console generate form open
![](/blog/images/2022-03-29/0F8baQFGgATjnQn30CqVeg.avif)
_Detail form shown by Nx Console to generate a new React component_
Whenever you change something in the form (1), youll automatically see a dry-run in the console that opens below (2). That shows what would happen if you run the command and is equivalent of adding the `--dry-run` flag whenever youd run the command on the terminal. Once youre ready, hit the Run button (3), or click the copy symbol (4) to copy the full command into your clipboard s.t. you can then paste it into your terminal.
Whenever you change something in the form (1), you'll automatically see a dry-run in the console that opens below (2). That shows what would happen if you run the command and is equivalent of adding the `--dry-run` flag whenever you'd run the command on the terminal. Once you're ready, hit the "Run" button (3), or click the copy symbol (4) to copy the full command into your clipboard s.t. you can then paste it into your terminal.
As you can see this approach is also really powerful for exploring different commands and their corresponding options.
@@ -274,7 +273,7 @@ One of the advantages of using Nx over — say CRA or a custom starter template
Just to mention an example: when upgrading Nx to v13, all Nx users automatically got migrated to Webpack 5.
This is possible with Nxs [migrate command](/nx-api/nx/documents/migrate) that allows you to keep up to date with your framework in a mostly automated fashion. Whenever you upgrade Nx, you run
This is possible with Nx's [migrate command](/nx-api/nx/documents/migrate) that allows you to keep up to date with your framework in a mostly automated fashion. Whenever you upgrade Nx, you run
```shell
npx nx migrate latest
@@ -307,7 +306,7 @@ Here are some common questions developers have. Have some more? Feel free to pin
Every Nx project comes with a `project.json` which contains the basic setup of targets (example: `build`, `serve`, `test`, `lint`,..) that can be run against the project.
Heres the `project.json` for our `happynrwl` React application. I clipped out the non-relevant parts here:
Here's the `project.json` for our `happynrwl` React application. I clipped out the non-relevant parts here:
```json5
{
@@ -347,13 +346,13 @@ Heres the `project.json` for our `happynrwl` React application. I clipped out
}
```
As you can see, all these targets (`build`, `serve`,...) have a so-called `options` property that allows you to configure how the target behaves. The actual configuration is abstracted behind the [Nx Executor](/concepts/executors-and-configurations), in our case `@nrwl/web:webpack`. You can find the details of how to configure that on the Nx docs in the CLI reference for the `@nrwl/web` package: [/nx-api/webpack/executors/webpack](/nx-api/webpack/executors/webpack).
As you can see, all these "targets" (`build`, `serve`,...) have a so-called `options` property that allows you to configure how the target behaves. The actual configuration is abstracted behind the "[Nx Executor](/concepts/executors-and-configurations)", in our case `@nrwl/web:webpack`. You can find the details of how to configure that on the Nx docs in the CLI reference for the `@nrwl/web` package: [/nx-api/webpack/executors/webpack](/nx-api/webpack/executors/webpack).
To read more about how the `project.json`, its executors, and configuration options are structured, check out the official docs: [/reference/project-configuration](/reference/project-configuration).
> _Note, Nx is also able to just pick up NPM scripts registered in the_ `_package.json_` _of your project root. This scenario is most useful if youre adding Nx to an existing monorepo (see_ [_add-nx-to-monorepo_](https://www.npmjs.com/package/add-nx-to-monorepo)_). Read more here:_ [_/reference/project-configuration_](/reference/project-configuration)
> _Note, Nx is also able to just pick up NPM scripts registered in the_ `_package.json_` _of your project root. This scenario is most useful if you're adding Nx to an existing monorepo (see_ [_add-nx-to-monorepo_](https://www.npmjs.com/package/add-nx-to-monorepo)_). Read more here:_ [_/reference/project-configuration_](/reference/project-configuration)
Nxs extensibility and customizability have really no limits, allowing it to really adapt to your needs. Here are some resources to learn more if you need some advanced features.
Nx's extensibility and customizability have really no limits, allowing it to really adapt to your needs. Here are some resources to learn more if you need some advanced features.
- [Custom workspace executors](/extending-nx/recipes/local-executors)
- [Custom workspace generators](/extending-nx/recipes/local-generators)
@@ -362,7 +361,7 @@ Nxs extensibility and customizability have really no limits, allowing it to r
## Q: Can I customize my Webpack config used to build my React app?
As mentioned previously, the underlying build machinery is usually hidden by a so-called [Nx Executor](/concepts/executors-and-configurations). As we have seen you can customize its behavior via the corresponding `options` property. By abstracting the underlying build tool, Nx is able to fulfill its evergreen promise as mentioned previously and allows to seamlessly upgrade workspaces to the latest versions of the build tooling that is being used.
As mentioned previously, the underlying build machinery is usually hidden by a so-called "[Nx Executor](/concepts/executors-and-configurations)". As we have seen you can customize its behavior via the corresponding `options` property. By abstracting the underlying build tool, Nx is able to fulfill its evergreen promise as mentioned previously and allows to seamlessly upgrade workspaces to the latest versions of the build tooling that is being used.
If the available `options` are not enough, you can further customize the Webpack configuration using the `webpackConfig` property:
@@ -399,11 +398,11 @@ module.exports = getWebpackConfig;
Notice how the default Nrwl provided Webpack configuration is invoked first to not lose the default behavior, followed by your own customizations.
## Q: Why is there an apps folder? Can I change it?
## Q: Why is there an "apps" folder? Can I change it?
Sure! Nx allows to host multiple applications and libraries in a single workspace: a monorepo scenario basically. In fact, even in our simple setup we have two applications: `happynrwl` and the corresponding e2e application, `happynrwl-e2e`.
In a default setup Nx generates an `apps` folder for hosting applications, and `libs` folder for hosting libraries. Read more about [“Apps and Libs on the Nx docs](/concepts/decisions/project-size).
In a default setup Nx generates an `apps` folder for hosting applications, and `libs` folder for hosting libraries. Read more about "Apps and Libs" on the Nx docs: [/concepts/decisions/project-size](/concepts/decisions/project-size).
You can change this setup in `nx.json` by adjustijng the `workspaceLayout` property which has an `appsDir` and `libsDir` configuration.
@@ -428,15 +427,15 @@ Agreed. Luckily Nx is plugin based, so you can start with the bare minimum (see
From my own experience, what usually happens is that teams start light and then over time end up with a similar stack, but hand-woven and therefore loosing out on a lot of the benefits Nx comes with.
## Q: Isnt Nx just for monorepos?
## Q: Isn't Nx just for monorepos?
Nx has been designed to support monorepo scenarios, and it really shines at scale. However, a lot of the features Ive been mentioning in this article, such as generators, out of the box setup of best practices development tools, automated migrations and more make it an excellent choice, even if your intention is not to create a monorepo.
Nx has been designed to support monorepo scenarios, and it really shines at scale. However, a lot of the features I've been mentioning in this article, such as generators, out of the box setup of best practices development tools, automated migrations and more make it an excellent choice, even if your intention is not to create a monorepo.
From my experience, Ive often seen teams start with a single application, which then over time gets company by other apps, in the form of React applications, also Node based backends or even a React Native application. Mainly because adding new applications is easy and the possibility to [share functionality (even across platforms)](/blog/share-code-between-react-web-react-native-mobile-with-nx) is appealing.
From my experience, I've often seen teams start with a single application, which then over time gets company by other apps, in the form of React applications, also Node based backends or even a React Native application. Mainly because adding new applications is easy and the possibility to [share functionality (even across platforms)](/blog/share-code-between-react-web-react-native-mobile-with-nx) is appealing.
> _If youre interested in monorepos or want to learn more about it, check out_ [_https://monorepo.tools_](https://monorepo.tools/)_._
> _If you're interested in monorepos or want to learn more about it, check out_ [_https://monorepo.tools_](https://monorepo.tools/)_._
## Q: Isnt Nx just for Angular projects?
## Q: Isn't Nx just for Angular projects?
This is a common but understandable misconception. Although Nx was heavily inspired by the Angular CLI initially, it is now a completely independent build system and CLI with first-class support for Angular, React, Node, Next.js, TypeScript and more. And with tons of [community plugins](/community) that extend Nx beyond that.
+22 -21
View File
@@ -2,27 +2,28 @@
title: 'What is new in Nx 13.10?'
slug: 'what-is-new-in-nx-13-10'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-04-08/PJ3SRAadq0DxGiC9mCIWsA.png'
cover_image: '/blog/images/2022-04-08/PJ3SRAadq0DxGiC9mCIWsA.avif'
tags: [nx, release]
description: Nx 13.10 brings core package consolidation, Nx Daemon by default, local plugin development, enhanced visualization, new lint rules, and React 18 support.
---
It has been a while since our last release blog post [which was on Nx 13.5](/blog/new-terminal-output-performance-improvements-in-nx-13-5). A lot has happened since then. So here we go!
## Housekeeping and core cleanup
## Housekeeping and "core" cleanup
We keep optimizing the Nx core. This round we started doing some housekeeping and cleanup that will allow us to move more quickly in the future and add new features more easily. In particular we now have a single package `nx` that contains all the core and CLI related functionality that have previously been in `@nrwl/cli` and `@nrwl/tao`. This also results in a reduce number of packages you need to install in any Nx workspace. In fact, if you run `add-nx-to-monorepo` - our easy migration command for [adding Nx to Yarn/NPM workspaces](/recipes/adopting-nx/adding-to-monorepo) - you should now see a single `nx` package and not have any `@nrwl/*` packages at all.
## Nx Daemon on by default
One of the core features of Nx is the calculation of the project graph. It is the basis for most other features in Nx like the [affected commands](/ci/features/affected), computation caching and calculation and topological sorting of parallelizing tasks [during DTE](/ci/features/distribute-task-execution). This is a I/O heavy operation. Whenever you change a file, the project graph needs to be re-calculated which involves reading the source files, analyze imports from other packages source files and external libraries.
One of the core features of Nx is the calculation of the project graph. It is the basis for most other features in Nx like the [affected commands](/ci/features/affected), computation caching and calculation and topological sorting of parallelizing tasks [during DTE](/ci/features/distribute-task-execution). This is a I/O heavy operation. Whenever you change a file, the project graph needs to be re-calculated which involves reading the source files, analyze imports from other packages' source files and external libraries.
Such a crucial and central feature like the project graph need to be as fast as possible. Thats the reason why we introduced the Nx Daemon, which is started automatically and runs in the background, watching for file changes and asynchronously recomputes and caches the project graph. As a result, whenever Nx runs an operation that requires the project graph, it is already there and ready to be used, without adding any additional delay to the operation that needs to be executed.
Such a crucial and central feature like the project graph need to be as fast as possible. That's the reason why we introduced the Nx Daemon, which is started automatically and runs in the background, watching for file changes and asynchronously recomputes and caches the project graph. As a result, whenever Nx runs an operation that requires the project graph, it is already there and ready to be used, without adding any additional delay to the operation that needs to be executed.
Read more on the docs: [/guides/nx-daemon](/concepts/nx-daemon)
## Nx Cloud opt-in now points to Yes by default
## Nx Cloud opt-in now points to "Yes" by default
When you set up a new Nx workspace with `create-nx-workspace` the question about opting into Nx Cloud will be pointed on Yes by default now.
When you set up a new Nx workspace with `create-nx-workspace` the question about opting into Nx Cloud will be pointed on "Yes" by default now.
![](/blog/images/2022-04-08/2N8T5oP1MUgmBTF_Q0bF-A.avif)
_Nx Cloud opt-in when setting up a new Nx workspace_
@@ -41,7 +42,7 @@ This illustration should give you a rough idea. obviously some of the plugins ma
You can just use the [Nx core without any plugins](/getting-started/intro) to get started and later decide to add more plugins such as `@nrwl/react` or `@nrwl/js` etc depending on your specific use case.
As you can see, plugins are at the very core and for quite some time now weve had a [fully featured Devkit and Nx Plugin package](/extending-nx/intro/getting-started) to create your own. And the community followed: have a look at [all the community Nx plugins that are available out there](/community).
As you can see, plugins are at the very core and for quite some time now we've had a [fully featured Devkit and Nx Plugin package](/extending-nx/intro/getting-started) to create your own. And the community followed: have a look at [all the community Nx plugins that are available out there](/community).
And we keep improving. Starting with Nx 13.10 you can now use Nx plugins to automate your local workspace. Install `@nrwl/nx-plugin` into your Nx workspace and generate a new plugin:
@@ -70,13 +71,13 @@ This creates a new library with a pre-configured setup to develop a Nx plugin. S
Note the `executor` definition of the `mybuild` target. It was never easier to create custom workspace executors.
And it doesnt stop at the executors level. The local plugin setup comes with a generator setup too, which can be invoked just like
And it doesn't stop at the executors level. The local plugin setup comes with a generator setup too, which can be invoked just like
```shell
npx nx g @myorg/workspace-extensions:<generator-name>
```
where `@myorg` is your Nx workspace name you defined and `workspace-extensions` the plugin library name weve chosen. You are free to choose whatever suits you best. This new setup opens up a wide range of new possibilities including defining default workspace generators.
where `@myorg` is your Nx workspace name you defined and `workspace-extensions` the plugin library name we've chosen. You are free to choose whatever suits you best. This new setup opens up a wide range of new possibilities including defining default workspace generators.
[Subscribe to our Youtube Channel](https://youtube.com/nrwl_io) for some upcoming tutorials and walkthroughs around this topic.
@@ -87,9 +88,9 @@ We keep improving our project graph and make it more and more useful for visuall
![](/blog/images/2022-04-08/a2bXoE4fGcDmqPTrxDyEFg.avif)
_Improved Project Graph visualization showing information about the edges that connect nodes_
And this is just a sneak peak of whats coming in Nx v14, so stay tuned!
And this is just a sneak peak of what's coming in Nx v14, so stay tuned!
## New notDependOnLibsWithTags Linter option
## New "notDependOnLibsWithTags" Linter option
Having a decent monorepo setup is not always just about speed but also to have features in place that help you keep your code-base healthy and maintainable in the long run. The Nx module boundary lint rules are an example for that.
@@ -144,13 +145,13 @@ So far you have only been able to specify which tags a library is allowed to dep
}
```
More on Miroslavs tweet:
More on Miroslav's tweet:
{% tweet url="https://x.com/meeroslav/status/1505844090713292808" /%}
## Automatic Lint rule fixes for self circular dependencies and wrong imports across library boundaries
Whether by accident or by letting your IDE auto-add the import. It often happens that the path that is being used is via the librarys TS path mapping through the `index.ts` entry point. This leads to a circular dependency when also `tslib-c-another.ts` is exported via the `index.ts`. Nxs module boundary lint rule correctly highlights this as can be seen in this screenshot.
Whether by accident or by letting your IDE auto-add the import. It often happens that the path that is being used is via the library's TS path mapping through the `index.ts` entry point. This leads to a circular dependency when also `tslib-c-another.ts` is exported via the `index.ts`. Nx's module boundary lint rule correctly highlights this as can be seen in this screenshot.
![](/blog/images/2022-04-08/Nh5uHJxDvqxppHF5kJJjZw.avif)
_Self circular dependency issue within a Nx based library_
@@ -166,7 +167,7 @@ This will analyze your imports, find the correct file and adjust them accordingl
![](/blog/images/2022-04-08/y81cryDv1j2uug38EgQsNg.avif)
_Automatic adjustment of circular self references when running the lint rule fix_
Similarly if you have relative or absolute imports across library boundaries rather than using the NPM scope, youll get a linting error.
Similarly if you have relative or absolute imports across library boundaries rather than using the NPM scope, you'll get a linting error.
![](/blog/images/2022-04-08/S69zum8bULwD_EXOT3xT6g.avif)
_Lint error about relative import across library boundaries_
@@ -178,11 +179,11 @@ _Automatic fixes for cross-library imports_
## React 18 support
Nx 13.10 introduces support for the latest React v18 release such that users can benefit from the latest features React has to offer. Check out our latest blog post on [The React CLI you always wanted but didnt know about](/blog/the-react-cli-you-always-wanted-but-didnt-know-about) to learn more how to use Nx for React development.
Nx 13.10 introduces support for the latest React v18 release such that users can benefit from the latest features React has to offer. Check out our latest blog post on ["The React CLI you always wanted but didn't know about"](/blog/the-react-cli-you-always-wanted-but-didnt-know-about) to learn more how to use Nx for React development.
## React Native gets Storybook support
Weve drastically improved our support for React Native within Nx workspaces. Check out our latest blog posts on
We've drastically improved our support for React Native within Nx workspaces. Check out our latest blog posts on
- [Share code between React Web & React Native Mobile with Nx](/blog/share-code-between-react-web-react-native-mobile-with-nx)
- [Introducing Expo Support for Nx](/blog/introducing-expo-support-for-nx)
@@ -199,7 +200,7 @@ or use Nx Console to get some more help in generating the Storybook setup.
By default when you create a new Nx workspace with `create-nx-workspace` you will see a couple of questions that help you find the correct setup for your needs. However, we just show a couple of the possible options, to not overwhelm you.
If however youre curious, you can now append `--allPrompts` to get all possible questions asked 🙂
If however you're curious, you can now append `--allPrompts` to get all possible questions asked 🙂
```shell
npx create-nx-workspace@next myorg --allPrompts
@@ -219,14 +220,14 @@ Here are some of the highlights in the latest Nx Console release.
## Nx Targets of VSCode Command Menu
You can now open the VSCode Command menu (Cmd + Shift + P or Win + Shift + P) and enter Nx: Run Target to invoke the Run Target menu which allows to choose the target to run as well as the project to execute the target on.
You can now open the VSCode Command menu (Cmd + Shift + P or Win + Shift + P) and enter "Nx: Run Target" to invoke the Run Target menu which allows to choose the target to run as well as the project to execute the target on.
![](/blog/images/2022-04-08/PuzwriM96qHohP28-_q3jA.avif)
_Commands can be invoked from the VSCode Command menu_
## Run Target View now in sync with workspace commands
While initially the Generate and Run Target panel was a static list of the usual Nx targets, it is now a dynamically generated list based on your actual workspace commands. Hence, also your custom defined targets will automatically show up.
While initially the "Generate and Run Target" panel was a static list of the usual Nx targets, it is now a dynamically generated list based on your actual workspace commands. Hence, also your custom defined targets will automatically show up.
![](/blog/images/2022-04-08/qILNK9-yQOtbgwE9uFMMiw.avif)
_Nx Console dynamically reads Nx targets from your Nx workspace now_
@@ -241,9 +242,9 @@ Learn more in this short video walkthrough:
## Our docs keep getting more and more awesome
Besides delivering awesome features, we keep improving our docs. They are essential to help discover new features and better understand existing ones. In the last weeks weve improved the navigation support, allowing you to navigate to a specific package with `/packages/<package-name>` such as [/nx-api/react](/nx-api/react) listing executors and generators that come with that Nx package, also improving the API docs of the individual executor options including a live embedded editor playground to experiment with different configuration setup.
Besides delivering awesome features, we keep improving our docs. They are essential to help discover new features and better understand existing ones. In the last weeks we've improved the navigation support, allowing you to navigate to a specific package with `/packages/<package-name>` such as [/nx-api/react](/nx-api/react) listing executors and generators that come with that Nx package, also improving the API docs of the individual executor options including a live embedded editor playground to experiment with different configuration setup.
Check out Benjamin Cabanes tweet with some short videos:
Check out Benjamin Cabanes' tweet with some short videos:
{% tweet url="https://x.com/bencabanes/status/1509641445086535687" /%}
@@ -2,13 +2,14 @@
title: 'Use Storybook with Nx React Native'
slug: 'use-storybook-with-nx-react-native'
authors: ['Emily Xiong']
cover_image: '/blog/images/2022-04-25/64nWVfUBihlYTLGWOvnc1g.png'
cover_image: '/blog/images/2022-04-25/64nWVfUBihlYTLGWOvnc1g.avif'
tags: [nx, release]
description: Learn how to integrate and configure Storybook with Nx React Native apps, including solutions for common navigation and Redux store integration issues.
---
In my previous [blogs](/blog/share-code-between-react-web-react-native-mobile-with-nx) _(see links at the end)_, I wrote about how to develop Nx React Native applications. However, as developers, we are constantly searching for ways to make the developer experience better.
This blog will show how to add Storybook to Nx React Native applications. With Nx, you dont need to go through [this long guideline](https://storybook.js.org/tutorials/intro-to-storybook/react-native/en/get-started/) to set up the Storybook, you can quickly get it running.
This blog will show how to add Storybook to Nx React Native applications. With Nx, you don't need to go through [this long guideline](https://storybook.js.org/tutorials/intro-to-storybook/react-native/en/get-started/) to set up the Storybook, you can quickly get it running.
Example Repo: [xiongemi/studio-ghibli-search-engine](https://github.com/xiongemi/studio-ghibli-search-engine)
@@ -104,7 +105,7 @@ module.exports = {
};
```
Also, notice that in your apps main file, the import of the App changed to `storybook/toggle-storybook`:
Also, notice that in your app's main file, the import of the App changed to `storybook/toggle-storybook`:
```typescript
import App from './storybook/toggle-storybook';
@@ -148,12 +149,12 @@ Then just run the command to start your app, you should see the storybook for yo
## Troubleshooting
### Error: Couldnt find a navigation object
### Error: Couldn't find a navigation object
If you are using the library `@react-navigation/native` and you are using hooks like `useNavigtion` and `useRoute` inside your component, you are likely to get the below error:
![](/blog/images/2022-04-25/oKNqqay19gpvIRgW1QGbkA.avif)
_Render Error for Couldnt find a navigation object_
_Render Error for Couldn't find a navigation object_
The easiest way is just to mock this library and create a [decorator](https://storybook.js.org/docs/react/writing-stories/decorators) for it:
@@ -220,12 +221,12 @@ const NavigationDecorator = (story) => {
};
```
### Error: Could not find store
### Error: Could not find "store"
If you are using Redux store and your component is stateful and connected to the store, you are likely to get the below error:
![](/blog/images/2022-04-25/T-Lj4PjuAlb_TbpSU5_1PQ.avif)
_Render Error for Could not find store_
_Render Error for Could not find "store"_
The simple solution is to mock the store. First, you need to install the library [redux-mock-store](https://github.com/reduxjs/redux-mock-store) and its typing:
@@ -2,11 +2,12 @@
title: 'Nx v14 is out — Here is all you need to know!'
slug: 'nx-v14-is-out-here-is-all-you-need-to-know'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-05-02/UAN1p_RMt38_IvB3CRpYTA.png'
cover_image: '/blog/images/2022-05-02/UAN1p_RMt38_IvB3CRpYTA.avif'
tags: [nx, release]
description: Nx v14 delivers enhanced performance, simplified core structure, improved terminal output, local plugins, automated CI, module federation, and React 18 support.
---
A lot happened since we released Nx version 13 back in October 2021. Nx has roughly a 6-month major release cycle and so that time has come again: Im happy to announce the **release of Nx v14**.
A lot happened since we released Nx version 13 back in October 2021. Nx has roughly a 6-month major release cycle and so that time has come again: I'm happy to announce the **release of Nx v14**.
Those last 6 months have been incredible and Nx probably got the biggest boost ever in terms of simplicity, features, and speed. We even made Nx more beautiful. Join me to explore some of the biggest highlights and what makes v14 so incredible.
@@ -16,7 +17,7 @@ Those last 6 months have been incredible and Nx probably got the biggest boost e
## Over 1.6 Million Downloads per week 🎉
We hit a major milestone with Nx v13 when we reached 1 million weekly downloads back in December 2021. Only 3 months later, were already over 1.6 million per week and growing fast!
We hit a major milestone with Nx v13 when we reached 1 million weekly downloads back in December 2021. Only 3 months later, we're already over 1.6 million per week and growing fast!
{% tweet url="https://x.com/victorsavkin/status/1504465520640278533" /%}
@@ -30,7 +31,7 @@ We saw that coming and made it easy for people to migrate to Nx.
npx add-nx-to-monorepo
```
Theres a detailed guide helping with some of the doubts and misconceptions which commonly come up with Lerna users: [https://lerna.js.org/](https://lerna.js.org/)
There's a detailed guide helping with some of the doubts and misconceptions which commonly come up with Lerna users: [https://lerna.js.org/](https://lerna.js.org/)
The future for monorepo tools looks bright as the awareness of monorepos, especially in the JS ecosystem, has grown a lot in recent months. Nx is doing great compared to those tools. But this movement excites us and we are more than ever committed to keep pushing forward and making Nx even better.
@@ -38,13 +39,13 @@ The future for monorepo tools looks bright as the awareness of monorepos, especi
## Nx Console reaches 1 million installs
While were talking numbers. We just hit another milestone 🎉
While we're talking numbers. We just hit another milestone 🎉
{% tweet url="https://x.com/NxDevTools/status/1518620884570820608" /%}
## Nx Core
We made a lot of improvements in Nx core since v13 that can roughly be categorized into: making Nx faster, simpler and improved dev ergonomics. Lets explore some of the highlights there
We made a lot of improvements in Nx core since v13 that can roughly be categorized into: making Nx faster, simpler and improved dev ergonomics. Let's explore some of the highlights there
## Making Nx even faster!
@@ -61,11 +62,11 @@ How can Nx be so fast? One thing we did introduce after v13 and [recently enable
> **_Running into a performance issue?_** _Try to debug it by using_ `_NX_PERF_LOGGING=true_` _in combination with your Nx command:_ `_NX_PERF_LOGGING=true nx build crew_`_. Alternatively, you can also have Nx generate a_ `_profile.json_` _and import it into Chrome Devtools._ [_Read more about that here_](/troubleshooting/performance-profiling)_._
While a lot of the above improvements help with local development, one of the biggest pain points of having a large monorepo can be CI times. This is where **distributed task execution (DTE)** makes all the difference\*_._\* Nx Clouds DTE understands which commands your CI is running, how many agents are typically being used, and how long a given task typically takes. It leverages that information along with task dependencies to create an execution plan that prioritizes builds of shared libraries first to unblock upstream builds. This results in a more even utilization of CI agents, optimizing the overall running time of your CI.
While a lot of the above improvements help with local development, one of the biggest pain points of having a large monorepo can be CI times. This is where **distributed task execution (DTE)** makes all the difference\*_._\* Nx Cloud's DTE understands which commands your CI is running, how many agents are typically being used, and how long a given task typically takes. It leverages that information along with task dependencies to create an execution plan that prioritizes builds of shared libraries first to unblock upstream builds. This results in a more even utilization of CI agents, optimizing the overall running time of your CI.
![](/blog/images/2022-05-02/k4ayjIt_OMEedxn-.avif)
Over time, Nx Clouds DTE learns about your workspace, keeping metrics about running times to allow the best possible distribution of a given task with the given amount of agents. This comes with Nx Cloud.
Over time, Nx Cloud's DTE learns about your workspace, keeping metrics about running times to allow the best possible distribution of a given task with the given amount of agents. This comes with Nx Cloud.
> _Note, if you are a large enterprise, you might want to look into the_ [_Nx Private Cloud_](/enterprise) _offering which allows to self-host Nx Cloud within your own infrastructure._
@@ -83,7 +84,7 @@ Nx is also able now to directly pick up your `package.json` scripts which are co
## Terminal Output
Developer experience is highly important to us. And that doesnt stop at the terminal output which is something we developers constantly interact with throughout our entire workday. We, therefore, put a lot of love for the details into how we present our terminal output, improving it in a way to show all completed tasks towards the top, while information about the current progress is shown below
Developer experience is highly important to us. And that doesn't stop at the terminal output which is something we developers constantly interact with throughout our entire workday. We, therefore, put a lot of love for the details into how we present our terminal output, improving it in a way to show all completed tasks towards the top, while information about the current progress is shown below
_(here executed by skipping the cache to show some progress running_ 🙂*)*
@@ -95,7 +96,7 @@ We now even filter out the build of dependent projects. Say you build the `react
Obviously, all errors would be reported properly, and on CI this behavior is disabled by default. If you want to disable it, you can always set `NX_TASKS_RUNNER_DYNAMIC_OUTPUT` to false.
## Local Plugins for your Nx Workspace
## "Local Plugins" for your Nx Workspace
[Check out our previous release post](/blog/what-is-new-in-nx-13-10) where we went into some of the details on how local plugins work. But in a nutshell, you can now generate a plugin into an existing Nx workspace:
@@ -136,13 +137,13 @@ Or just use [Nx Console](/getting-started/editor-setup), as always.
![](/blog/images/2022-05-02/XFXDdGUWc3dF9ZMC.avif)
This sets you up with an automated CI workflow that properly uses the Nx affected command together with the power of [Nx Clouds distributed task execution](/ci/features/distribute-task-execution).
This sets you up with an automated CI workflow that properly uses the Nx affected command together with the power of [Nx Cloud's distributed task execution](/ci/features/distribute-task-execution).
You can also use the `--all` flag when generating a new workspace, for seeing all the available options, including to setup CI.
## nx-cloud record
The [Nx Cloud GitHub app](https://github.com/apps/nx-cloud) is so useful for not having to go to your CircleCI logs and try to find the entry youre searching for. Instead all the executed targets nicely show up as a comment in your PR.
The [Nx Cloud GitHub app](https://github.com/apps/nx-cloud) is so useful for not having to go to your CircleCI logs and try to find the entry you're searching for. Instead all the executed targets nicely show up as a comment in your PR.
![](/blog/images/2022-05-02/4zTea6s4BTMyDToD.avif)
@@ -156,13 +157,13 @@ Until now, you had to have a task that is being executed through Nx Cloud. But w
npx nx-cloud record -- npx nx format:check
```
and they will automatically show up in the Nx Cloud viewer. 🤫 you dont even have to have Nx Cloud installed in the workspace.
and they will automatically show up in the Nx Cloud viewer. 🤫 you don't even have to have Nx Cloud installed in the workspace.
## Module Federation for Faster Builds
For many workspaces it is enough to leverage [Nx affected commands](/ci/features/affected), [computation caching](/concepts/how-caching-works) and [distributed task execution](/ci/features/distribute-task-execution).
However, if you have a huge monorepo, this might not be enough. You can add incremental builds and benefit from caching, but still, you might run into the issue of the final linking process taking a long time, which can hardly be optimized further. Unless you can split up your app into smaller pieces. No, were not talking about micro frontends necessarily (more on that in the next section). Rather we can leverage Webpacks Module Federation support.
However, if you have a huge monorepo, this might not be enough. You can add incremental builds and benefit from caching, but still, you might run into the issue of the final linking process taking a long time, which can hardly be optimized further. Unless you can split up your app into smaller pieces. No, we're not talking about micro frontends necessarily (more on that in the next section). Rather we can leverage Webpack's Module Federation support.
We added dedicated generators to create a new module federation setup for Angular and React:
@@ -186,24 +187,24 @@ npx nx serve shell
and all the other remotes are statically served from the cache. Your entire infrastructure is working, without you having to worry about building and serving all of the separate remotes. As you can imagine this speeds up local serve times by an order of magnitude.
If you want to work on one of the remotes, simply explicitly pass their name using `--devRemotes` flag and it will be served just normally with the Webpack dev server, with all the features youre used to.
If you want to work on one of the remotes, simply explicitly pass their name using `--devRemotes` flag and it will be served just normally with the Webpack dev server, with all the features you're used to.
```shell
npx nx serve shell --devRemotes=cart,shop
```
This can be a game-changer when building huge apps. Stay tuned for more content around this as were really just getting started.
This can be a game-changer when building huge apps. Stay tuned for more content around this as we're really just getting started.
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
@@ -211,15 +212,15 @@ You asked for it, the community responded. [Luís Carvalho](https://github.com/L
![](/blog/images/2022-05-02/TzVbTnDmzgInCw6H.avif)
Also, have you ever wondered whether in your gigantic graph theres a connection between two nodes?
Also, have you ever wondered whether in your gigantic graph there's a connection between two nodes?
![](/blog/images/2022-05-02/eMk2cAwrdHmaK07h.avif)
Now you can easily find out! Just click on a node and hit the Start button.
Now you can easily find out! Just click on a node and hit the "Start" button.
![](/blog/images/2022-05-02/gDnkyfnnAHy2P0Z8.avif)
Then click the target node youre interested in and hit End.
Then click the target node you're interested in and hit "End".
![](/blog/images/2022-05-02/BMoc7FuUD94GzOXO.avif)
@@ -231,7 +232,7 @@ And by clicking on the edges you can even get a more detailed output of why the
![](/blog/images/2022-05-02/EnPbSRFUD3KeOH4w.avif)
Oh wait, you didnt want the shortest path? Theres a button for showing all possible paths too 😉
Oh wait, you didn't want the shortest path? There's a button for showing all possible paths too 😉
![](/blog/images/2022-05-02/OlhUXFMhEwshLoTV.avif)
@@ -239,9 +240,9 @@ Oh wait, you didnt want the shortest path? Theres a button for showing all
In version 13.4 we released a brand new dedicated package for developing pure JavaScript/TypeScript packages: `@nrwl/js`
We kept improving it, adding SWC support (including an easy migration between TSC → SWC using an Nx generator) and were currently looking into automated publishing support.
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
@@ -249,7 +250,7 @@ Nx v14 ships with React 18 support for React DOM and React Native. The latter ha
In addition to that, Expo and Expo Application Service support has been added which has lead already to some drastic speed improvements with some of our clients.
Finally, it is the first version which ships the built-in module federation support for React as weve mentioned a couple of sections above. Check out the React package docs page and search for the `host` and `remote` generator: [/nx-api/react](/nx-api/react)
Finally, it is the first version which ships the built-in module federation support for React as we've mentioned a couple of sections above. Check out the React package docs page and search for the `host` and `remote` generator: [/nx-api/react](/nx-api/react)
## Angular
@@ -268,13 +269,13 @@ Docs are hard! But we keep investing and a lot of work has gone into making docs
{% tweet url="https://twitter.com/bencabanes/status/1509641445086535687" /%}
## Theres more
## There's more
Check out our previous release blog posts for all the details:
- [Single File Monorepo Config, Custom Workspace Presets, Improved Tailwind Support, and more in Nx 13.4!](/blog/single-file-monorepo-config-custom-workspace-presets-improved-tailwind-support-and-more-in-nx-13)
- [New Terminal Output & Performance Improvements in v13.5](/blog/new-terminal-output-performance-improvements-in-nx-13-5)
- [Whats new in Nx v13.10?](/blog/what-is-new-in-nx-13-10)
- [What's new in Nx v13.10?](/blog/what-is-new-in-nx-13-10)
## How to Update Nx
@@ -294,13 +295,13 @@ npx nx migrate --run-migrations
We already started working on v15. You can [find the roadmap on our GitHub repository](https://github.com/nrwl/nx/discussions/9716). There are some exciting things coming up, like
- Negative Configuration
- "Negative" Configuration
- React Server Side Rendering and Server Components support
- React Native + Detox
- Cypress v10 migration and Cypess Component Testing
- ...
Make sure you dont miss anything by
Make sure you don't miss anything by
- Following us [on Twitter](https://twitter.com/NxDevTools), and
- Subscribe to the [YouTube Channel](https://youtube.com/nrwl_io?sub_confirmation=1) for more information on [Angular](https://angular.io/), [React](https://reactjs.org/), Nx, and more!
@@ -2,13 +2,14 @@
title: 'Lerna is dead — Long Live Lerna'
slug: 'lerna-is-dead-long-live-lerna'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-05-11/gtsrJ-tMDZf9bvDLVSjQ.png'
cover_image: '/blog/images/2022-05-11/gtsrJ-tMDZf9bvDLVSjQ.avif'
tags: [nx]
description: Nrwl takes over Lerna.js stewardship, promising continued maintenance, critical updates, and future Nx integration while supporting the existing community.
---
If youre in a hurry, heres the **TL;DR:**
If you're in a hurry, here's the **TL;DR:**
> _We,_ [_Nrwl_](/company)_, the company behind Nx, are taking over the stewardship of Lerna.js, the popular JS monorepo tool._ [_Heres the official announcement on the Lerna repo_](https://github.com/lerna/lerna/issues/3121)_. We are thrilled and committed to helping the Lerna community move forward!_
> _We,_ [_Nrwl_](/company)_, the company behind Nx, are taking over the stewardship of Lerna.js, the popular JS monorepo tool._ [_Here's the official announcement on the Lerna repo_](https://github.com/lerna/lerna/issues/3121)_. We are thrilled and committed to helping the Lerna community move forward!_
## Who is Nrwl?
@@ -19,35 +20,35 @@ We (Nrwl) are the company behind Nx ([GitHub](https://github.com/nrwl/nx)) and w
This is when Nx started.
We think we are the best fit for helping the Lerna community continue and thrive because we have a good combination of real-world experience with open source community work. As part of Nrwl, we work with some of the worlds biggest companies, helping them improve productivity and ship great quality software through monorepos. In addition, Jeff and Victor have a lot of knowledge of managing a big open source project such as Angular when they were at Google and obviously at Nrwl from managing Nx as an open-source project with its quickly growing community.
We think we are the best fit for helping the Lerna community continue and thrive because we have a good combination of real-world experience with open source community work. As part of Nrwl, we work with some of the world's biggest companies, helping them improve productivity and ship great quality software through monorepos. In addition, Jeff and Victor have a lot of knowledge of managing a big open source project such as Angular when they were at Google and obviously at Nrwl from managing Nx as an open-source project with its quickly growing community.
Long story short, Nrwl ❤️ open source and community work, and we are thrilled to work with the Lerna community!
## Whats the story about Lerna being dead?
## What's the story about Lerna being dead?
_(Spoiler: It is not dead, we took over stewardship_ 😀*. But apart from that, heres the whole story)*
_(Spoiler: It is not dead, we took over stewardship_ 😀*. But apart from that, here's the whole story)*
- August 2020 — Issue is being opened [mentioning that Lerna is largely unmaintained](https://github.com/lerna/lerna/issues/2703)
- April 2022 — A [PR gets merged](https://github.com/lerna/lerna/pull/3092) that properly highlights the fact of Lerna being unmaintained at the very top of the repository README. This made the Lerna is dead discussions flare up again.
- April 2022 — A [PR gets merged](https://github.com/lerna/lerna/pull/3092) that properly highlights the fact of Lerna being unmaintained at the very top of the repository README. This made the "Lerna is dead" discussions flare up again.
- May 2022 — Lerna got resurrected: Nrwl takes over
While that last PR didnt really change the fact that Lerna has been in that state for the past years already, it just made it more apparent and also how many still rely on Lerna today.
While that last PR didn't really change the fact that Lerna has been in that state for the past years already, it just made it more apparent and also how many still rely on Lerna today.
And this is not to blame its contributors at all. They did an amazing job. However, Open Source can be a tough place, especially if it is not backed by a large community and/or company that helps make the work sustainable in the long run. Taking the weight of maintaining such a widely used tool, and then mostly for free, is a huge one. Burnout is real folks, so take care. And weve had lots of such open-source examples in the past years.
And this is not to blame its contributors at all. They did an amazing job. However, Open Source can be a tough place, especially if it is not backed by a large community and/or company that helps make the work sustainable in the long run. Taking the weight of maintaining such a widely used tool, and then mostly for free, is a huge one. Burnout is real folks, so take care. And we've had lots of such open-source examples in the past years.
## Nrwl is taking over: now what?
Lerna has definitely pioneered the JS monorepo space, however, the tooling space has progressed a lot in recent years. Some of its features are now baked into NPM, YARN, PNPM, and Lerna [lacks many other important monorepo features](https://monorepo.tools/#tools-review) such as computation caching to mention one example.
Nx can fill in many of these gaps. When the first discussions about Lerna being unmaintained came up in 2020, we implemented a set of features, allowing for easy migration from [Lerna/NPM/Yarn/PNPM workspaces to Nx](/recipes/adopting-nx/adding-to-monorepo). In addition, some recent [improvements in Nx](/blog/nx-v14-is-out-here-is-all-you-need-to-know) make this even easier, allowing it to basically co-exist in any of these workspaces. This can be done for instance by leveraging [Nxs powerful task scheduling capabilities](/getting-started/intro) while still continuing on relying on Lernas publishing process. Maintaining now both projects, Lerna & Nx, puts us in the unique position of allowing us to work on some seamless integration between the two.
Nx can fill in many of these gaps. When the first discussions about Lerna being unmaintained came up in 2020, we implemented a set of features, allowing for easy migration from [Lerna/NPM/Yarn/PNPM workspaces to Nx](/recipes/adopting-nx/adding-to-monorepo). In addition, some recent [improvements in Nx](/blog/nx-v14-is-out-here-is-all-you-need-to-know) make this even easier, allowing it to basically co-exist in any of these workspaces. This can be done for instance by leveraging [Nx's powerful task scheduling capabilities](/getting-started/intro) while still continuing on relying on Lerna's publishing process. Maintaining now both projects, Lerna & Nx, puts us in the unique position of allowing us to work on some seamless integration between the two.
With Nx, we are known to have a clear roadmap shared with the community of what our next 6 months focus will be (heres an [example of our roadmap for v15](https://github.com/nrwl/nx/discussions/9716)). As we get our hands dirty on Lernas codebase in the coming weeks, we are going to define a set of action items, prioritize them and elaborate a proper roadmap as well, which we will share with the community as soon as we have a more concrete plan. Since we know many organizations still depend on Lerna or may not be able to migrate away soon, some of our immediate to mid-term actions will be to **provide critical bug fixes and security updates to the project** and regularly release those to NPM.
With Nx, we are known to have a clear roadmap shared with the community of what our next 6 months' focus will be (here's an [example of our roadmap for v15](https://github.com/nrwl/nx/discussions/9716)). As we get our hands dirty on Lerna's codebase in the coming weeks, we are going to define a set of action items, prioritize them and elaborate a proper roadmap as well, which we will share with the community as soon as we have a more concrete plan. Since we know many organizations still depend on Lerna or may not be able to migrate away soon, some of our immediate to mid-term actions will be to **provide critical bug fixes and security updates to the project** and regularly release those to NPM.
## Stay tuned for more!
We think Lernas and Nxs future is bright and we are excited to help move the monorepo space forward, more than ever before!
We think Lerna's and Nx's future is bright and we are excited to help move the monorepo space forward, more than ever before!
Make sure you dont miss anything by
Make sure you don't miss anything by
- Following us [on Twitter](https://twitter.com/NxDevTools)
- Subscribing to our [YouTube Channel](https://youtube.com/nrwl_io?sub_confirmation=1)
@@ -2,8 +2,9 @@
title: 'How Lerna just got 10x faster!'
slug: 'lerna-used-to-walk-now-it-can-fly'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-05-25/WPGHapKqT3IguWjeN5UgWg.png'
cover_image: '/blog/images/2022-05-25/WPGHapKqT3IguWjeN5UgWg.avif'
tags: [nx]
description: Lerna v5.1 introduces the useNx flag for dramatic performance gains, making it 5.3x faster than Turborepo with added caching and task execution features.
---
**_TL;DR:_** _We released a new beta version of Lerna and it happens that it is now 5.3 times faster than Turbo 👀…by turning on a flag. Keep reading to learn more._
@@ -11,7 +12,7 @@ tags: [nx]
> _ICYMI: A couple of weeks ago we (Nrwl) announced that we take over stewardship of Lerna. Read all about it in our_ [_recent blog post_](/blog/lerna-is-dead-long-live-lerna)_.
> We also just released Lerna v5 as a first maintenance release:_ [_Read more here_](https://github.com/lerna/lerna/releases/tag/v5.0.0)_._
For folks that want to migrate to Nx, we always had a dedicated [Nx and Lerna](/recipes/adopting-nx) docs page that shows you how you can easily integrate the two. However, we felt we could do better and allow you to get all the speed benefits that come from Nxs task scheduling abilities, without needing to change nearly anything in your Lerna workspace.
For folks that want to migrate to Nx, we always had a dedicated [Nx and Lerna](/recipes/adopting-nx) docs page that shows you how you can easily integrate the two. However, we felt we could do better and allow you to get all the speed benefits that come from Nx's task scheduling abilities, without needing to change nearly anything in your Lerna workspace.
And it got fast, like really fast!!
@@ -25,11 +26,11 @@ Here you go
We just published Lerna v5.1 which introduces a `useNx` flag. Adding that makes Lerna to be on par with Nx in terms of speed, and is significantly faster than other tools.
Comparing Lerna with and without the flag isnt really an apples-to-apples comparison because one comes with caching abilities, while before, Lerna didnt have that at all. But just to give you an idea: enabling Nx on your existing Lerna workspace can **speed it up in the range of 210 times**, depending on the repo setup.
Comparing Lerna with and without the flag isn't really an apples-to-apples comparison because one comes with caching abilities, while before, Lerna didn't have that at all. But just to give you an idea: enabling Nx on your existing Lerna workspace can **speed it up in the range of 210 times**, depending on the repo setup.
But lets do some more real apples-to-apples comparison of Lernas speed with `useNx` enabled. For benchmarking Nx we have set up a repo in the past which we regularly use to measure the speed of new Nx releases with other similar tools on the market such as [Lage](https://microsoft.github.io/lage/) and [Turborepo](https://turborepo.org/): [https://github.com/vsavkin/large-monorepo](https://github.com/vsavkin/large-monorepo). We now added Lerna+Nx (Lerna with `useNx` enabled) to that repo to measure the impact.
But let's do some more real "apples-to-apples" comparison of Lerna's speed with `useNx` enabled. For benchmarking Nx we have set up a repo in the past which we regularly use to measure the speed of new Nx releases with other similar tools on the market such as [Lage](https://microsoft.github.io/lage/) and [Turborepo](https://turborepo.org/): [https://github.com/vsavkin/large-monorepo](https://github.com/vsavkin/large-monorepo). We now added Lerna+Nx (Lerna with `useNx` enabled) to that repo to measure the impact.
Heres a gif of running the benchmark of Lerna+Nx and Turborepo:
Here's a gif of running the benchmark of Lerna+Nx and Turborepo:
![](/blog/images/2022-05-25/MrhEU4wPZlwp4dbKsj876g.avif)
@@ -50,7 +51,7 @@ Finally, add the following to your `lerna.json`.
}
```
Thats mostly it. You can continue using the usual Lerna commands, but at this point Lerna would delegate its operations to Nx underneath.
That's mostly it. You can continue using the usual Lerna commands, but at this point Lerna would delegate its operations to Nx underneath.
To get more out of it, you might want to create a small `nx.json` file (or run `npx nx init` to generate one) for going into some more details on configuring the cacheable operations:
@@ -76,11 +77,11 @@ So how does this work on a technical level. So far Lerna (`lerna run` to be more
With the change we made in Lerna 5.1 we are adding Nx (MIT licensed) as a third option in addition to the already existing `p-map` and `p-queue`. By having `nx` installed and configured (as mentioned in the previous section), Lerna can now delegate its `lerna run` command to Nx directly. All of this is done in a backwards-compatible way: every `lerna run` command will work but will be significantly faster and can optionally even be distributed across multiple machines without any config (more about that in the next section).
## Whats more?
## What's more?
By having Nx integrated, you not just get faster builds but also some other Nxs features for free!
By having Nx integrated, you not just get faster builds but also some other Nx's features for free!
[**Nx Project graph**](/features/explore-graph) — By running `npx nx graph` you get the visualization of the graph. You can interactively explore what your workspace looks like and the relationships between the packages. We actually used this same graph on the Lerna repo itself, which helped us to get a better understanding of how the repo is structured when we took over the maintenance. Heres an example of filtering the lerna packages to understand what `@lerna/exec` is about and how it relates to other packages in the repo.
[**Nx Project graph**](/features/explore-graph) — By running `npx nx graph` you get the visualization of the graph. You can interactively explore what your workspace looks like and the relationships between the packages. We actually used this same graph on the Lerna repo itself, which helped us to get a better understanding of how the repo is structured when we took over the maintenance. Here's an example of filtering the lerna packages to understand what `@lerna/exec` is about and how it relates to other packages in the repo.
![](/blog/images/2022-05-25/uW4TaZQy7smwCDEj.avif)
@@ -96,6 +97,6 @@ npx nx connect-to-nx-cloud
## Conclusion
This is the first beta which we are trying out on some projects already. We arent worried about task orchestration, caching or distribution — all of those are done by Nx, which has been around for 5 years and is solid. We are trying to see if there is something in the integration that is confusing. We hope to release s stable version by mid-June.
This is the first beta which we are trying out on some projects already. We aren't worried about task orchestration, caching or distribution — all of those are done by Nx, which has been around for 5 years and is solid. We are trying to see if there is something in the integration that is confusing. We hope to release s stable version by mid-June.
Please have a look, upgrade your repo and [open an issue](https://github.com/lerna/lerna/issues) if you run into some weird behavior with the new `useNx` enabled. But not only that, feel free to ping us on the [@NxDevTools](https://twitter.com/nxdevtools) account with your success stories too. We'd love to hear 😃.
@@ -0,0 +1,163 @@
---
title: 'Nx 14.2 — Angular v14, Storybook update, lightweight Nx and more!'
slug: 'nx-14-2-angular-v14-storybook-update-lightweight-nx-and-more'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-06-09/uScdSDGP4NgCKFrPdznbhw.avif'
tags: [nx, release]
description: Nx 14.2 brings Angular v14 support, Storybook 6.5, improved Angular CLI migrations, optional nx.json configuration, and significant performance gains.
---
Another release packed with cool features and improvements just got released: [Nx 14.2](https://github.com/nrwl/nx/releases/tag/14.2.2). Read all about the Angular v14 upgrade that comes with it, TypeScript and other 3rd party package upgrades, improved Angular CLI to Nx migrations, optional `nx.json` and speed improvements.
## Angular v14
Angular v14 just got released last week. Read all about [the news here](https://blog.angular.io/angular-v14-is-now-available-391a6db736af). Huge kudos and congrats to the Angular team for again shipping on time based on their 6 months major release cycle. We've been collaborating with the team closely over the last couple of weeks to test early RCs, give feedback about upcoming features and foremost, make sure the new version not only works great in Nx, but also in the broader ecosystem that Nx supports such as Jest, ESLint, Storybook, Cypress and more.
We're excited about the new features that landed in Angular v14 which bring some fresh air and long-awaited innovations to the framework (\* cough \* Standalone Components, \* cough \* typed Angular forms).
As such, if you upgrade to Nx 14.2 (`npx nx migrate latest`), Nx will make sure to also trigger all the Angular v14 related migration scripts to update your workspace to the latest Angular version.
## TypeScript 4.7 and Prettier 2.6
With this release we also automatically update:
- TypeScript to version v4.7 ([announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/))
- Prettier to v2.6 ([announcement](https://prettier.io/blog/2022/03/16/2.6.0.html))
## Storybook 6.5
Nx 14.2 upgrades Storybook to the latest 6.5 version automatically for you.
Storybook support has been in Nx for a long time and we had our custom executor (builder) to preconfigure Storybook in a way that it works best within an Angular monorepo setup. We're glad that the Storybook support for Angular improved a lot over the last couple of releases s.t. we can **now directly use the Storybook native builders for Angular** (`@storybook/angular:start-storybook`, `@storybook/angular:build-storybook`). In your `project.json` (or `workspace.json` / `angular.json`) you should see the executor now being set to:
```json
"storybook": {
"executor": "@storybook/angular:start-storybook",
...
},
```
This avoids any potential downsides of options being different or not available and lowers the maintenance burden on our side going forward.
Storybook 6.5 also comes with support for using TS based Storybook configurations files, such as `main.ts` , `preview.ts` etc. We added support for that to our Storybook configuration generators.
For all the other cool Storybook features, please refer to their release [announcement](https://storybook.js.org/releases/6.5).
## Easy migration from Angular CLI to Nx
Nx is not only for large monorepos, but works really well for single-project Angular workspaces too! Why switch to Nx? We need an entire blog post for that (spoiler: coming soon 😉), but in a nutshell:
- everything from the Angular CLI still works
- you get faster builds, test runs, linting etc powered by Nx's task scheduling and caching
- more schematics (we call them generators in Nx) with specific support for SCAM, NgRX setup, module federation and micro frontend setup and much more to come (looking at you Standalone Components)
- better, out of the box integration with community tools such as Jest for unit testing, ESLint, Cypress, Storybook,…
- improved developer experience powered by the [Nx Console VSCode extension](/getting-started/editor-setup)
-
In the last couple of weeks we've been working hard on making an automated migration from the Angular CLI to Nx as seamless as it can possibly get. And this can be tricky, believe us. We always had automated migrations, but we improved our existing ones and in addition also added support for multi-project Angular CLI workspaces.
All you need to do is to run the following command on your existing Angular CLI setup.
```
ng add @nrwl/angular
```
We try to infer your current setup and configuration and automatically migrate it, in addition to providing useful warnings and logs for the things we couldn't migrate along the way, such that you have the possibility to manually adjust things.
## More lightweight Nx
When you setup a new Nx workspace you can choose from a variety of presets (templates) that preconfigure your workspace in the best possible way, already setting up tool like Prettier, Jest, ESLint and Cypress. For some folks however, this might seem too much.
For that, Nx always already had the — what we call — "Nx Core" setup. You can read more about [that on our guide](/getting-started/intro), but it basically allows Nx to be used without its plugins, just for the fast, powerful task scheduling and caching capabilities.
In v14 we already simplified Nx (we have a whole section in [our release blog post](/blog/nx-v14-is-out-here-is-all-you-need-to-know)) and in v14.2 we even go a step further: **we made `nx.json` optional**, providing some reasonable defaults. Now, if you want to add Nx's powerful task scheduler to an existing repository, all you need to do is to add the `nx` package as a dependency and you're all set up.
Whenever you need to fine-tune the default settings you can run the following command to get a `nx.json` generated or you can obviously create it by hand:
```shell
npx nx init
```
## Run Nx graph on any monorepo!
Speaking about lightweight Nx. With Nx v14.2.3 you can now just run
```shell
npx nx graph
```
to download the Nx package, have it analyze your monorepo's project graph and visualize it in its powerful project graph UI. Give it a try. Here's Victor demoing it on the Next.js and Babel.js repository!
{% tweet url="https://twitter.com/victorsavkin/status/1534909897976041474" /%}
## Nx just got faster, again!
Part of our team has been heads-down on Lerna in the past month since we [took over stewardship of Lerna](/blog/lerna-is-dead-long-live-lerna). And apart from releasing Lerna 5 with important package upgrades, we wanted to solve Lerna's biggest pain point: being slow. [We published an article](/blog/lerna-used-to-walk-now-it-can-fly) on how we envision that strategy 2 weeks ago and as part of that we've been digging deep into the Nx core and have been doing some proper profiling.
The result: Nx itself got faster as well 😃.
Here's the result of running our benchmark using the latest version of Nx 14.2:
```plaintext
* average lage time is: 10203.6
* average turbo time is: 1532.3
* average lerna (powered by nx) time is: 272.2
* average nx time is: 194.8
* nx is 52.379876796714576x faster than lage
* nx is 7.866016427104722x faster than turbo
* nx is 1.3973305954825461x faster than lerna (powered by nx)
```
(as always, feel free to [reproduce it here](https://github.com/vsavkin/large-monorepo))
## Dedicated Linting support for Nx Plugins
Only the possibility of being able to tailor and customize the processes and behavior of your monorepo tooling to your own needs, makes working with it pleasant and allows you to get most out of it. Whether it is to customize the code generation aspect to your company coding styleguide and best practices, to automate the setup of new projects or even add support for languages such as Go, .Net or Flutter. [Nx Plugins](/community) enable such support and really help you make Nx work in the best possible way for your current scenario.
Nx plugin support has been around for a while. Just have a look at our [Nx community plugins page](/community). And we keep improving it. We added support for [Nx Plugin presets](https://www.youtube.com/watch?v=yGUrF0-uqaU) and [lately also the ability for local plugins](/blog/nx-v14-is-out-here-is-all-you-need-to-know). In this release, we add proper **linting support for Nx Plugin development**.
Ever happened to you that you mistyped the implementation file in your `generators.json` configuration file of your plugin? Well guess what, now the linting process would warn you about:
![](/blog/images/2022-06-09/mbcZT24F7G8mbRGEnJ7iEg.avif)
When you generate a new Nx plugin, you should now have a `@nrwl/nx/nx-plugin-checks` configuration in your `.eslintrc.json` file.
```json
{
"files": ["./package.json", "./generators.json", "./executors.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nrwl/nx/nx-plugin-checks": "error"
}
}
```
If you have an existing plugin, you can run the following generator to add the new lint rules:
```shell
npx nx g @nrwl/nx-plugin:plugin-lint-checks --projectName=awesomeplugin
```
## How to Update Nx
Updating Nx is done with the following command, and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Exciting?
We're already deep into following our v15 [roadmap](https://github.com/nrwl/nx/discussions/9716) with a lot of cool stuff coming up on the horizon.
Makes sure you don't miss anything by
- Following us [on Twitter](https://twitter.com/NxDevTools), and
- Subscribe to the [YouTube Channel](https://youtube.com/nrwl_io?sub_confirmation=1) for more information on [Angular](https://angular.io/), [React](https://reactjs.org/), Nx, and more!
- Subscribing to [our newsletter](https://go.nx.dev/nx-newsletter)!
@@ -0,0 +1,200 @@
---
title: 'Nx 14.4 — Inputs, optional npm scope, project graph cache directory and more!'
slug: 'nx-14-4-inputs-optional-npm-scope-project-graph-cache-directory-and-more'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-07-05/lpmHhIiE9v5yJI6nLi2dlw.avif'
tags: [nx, release]
description: 'Nx 14.4 enhances build caching with configurable inputs, simplifies workspace setup with optional npm scope, and optimizes CI performance with project graph improvements.'
---
Our [last release blog post](/blog/nx-14-2-angular-v14-storybook-update-lightweight-nx-and-more) has been published not even a month ago and we already released 2 more minors. You missed the releases? No worries, we've got you covered. Here's all you need to know.
## targetDependencies -> targetDefaults
To get things started, `targetDependencies` got renamed to `targetDefaults`. We originally named them `targetDependencies` because you were able to define dependencies among project targets (e.g. to run the `build` target of dependent projects). See the next section for some more info about that.
You could always do more though. However, with our current mission to reduce configuration duplication, the now-called `targetDefaults` will get more powerful by allowing you to define sensible defaults for your project configs in a central place.
> _Don't worry, if you're using `nx migrate` it'll handle the rewriting for you._
## Syntactic sugar for "dependsOn"
One of the key features of the Nx task scheduling system is that it is able to automatically build/test/lint/{name your operation} dependencies of your project. If you have `proj-a` which has a dependency on `proj-b` and we run `nx build proj-a` then Nx automatically builds `proj-b` before building `proj-a`. Why? Because `proj-a` depends on the output of `proj-b`.
These target defaults can be defined
- globally at the `nx.json` level for all the projects in the workspace
- per project level in the `project.json`/`package.json` depending whether you use the [project.json config option](/reference/project-configuration) or [package.json](/reference/project-configuration)
You can still use the same notation as you did until now:
```json {% fileName="nx.json" %}
{
...
"targetDefaults": {
"build": {
"dependsOn": [
{
"target": "build",
"projects": "dependencies"
}
]
}
},
...
}
```
With this release we introduce another, much more concise and elegant way of expressing the same:
```json {% fileName="nx.json" %}
{
...
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
}
},
...
}
```
Similarly, if you don't specify the `^` it would be the same as writing the following:
```json {% fileName="nx.json" %}
{
...
"targetDefaults": {
"build": {
"dependsOn": [
{
"target": "prebuild",
"projects": "self"
}
]
}
},
...
}
```
In that case target `prebuild` on the project itself is invoked before running its `build` target.
## Inputs, Named Inputs, ENV and runtime variables
In order to improve cache hits we added the possibility to define `inputs`. For example on the `build` target, you could define the following input glob pattern to avoid cache invalidation when only spec files got changed.
```json {% fileName="nx.json" %}
{
...
"targetDefaults": {
"build": {
"inputs": ["!{projectRoot}/**/*.spec.ts"]
}
}
}
```
You can have as many inputs as you like. Also, in order to avoid ambiguity when specifying the path, you need to use either `{projectRoot}` or `{workspaceRoot}` in the glob pattern.
Since you might want to **reuse certain patterns across multiple targets**, we also introduced `namedInputs`, which allows you to define a set of patterns that can then be referenced in the various `targetDefaults`:
```json {% fileName="nx.json" %}
{
...
"namedInputs": {
"prodFiles": ["!{projectRoot}/**/*.spec.ts"]
},
"targetDefaults": {
"build": {
"inputs": ["prodFiles", "^prodFiles"]
},
"publish": {
"inputs": ["prodFiles", "^prodFiles"]
}
}
}
```
Note, by also adding `^` in front of the named input pattern, it also gets applied to all dependent projects, just like with the `dependsOn` definition.
**Inputs can not only just be file globs, but also runtime or environment variables**. This makes the `inputs` even more powerful and helps improve cache hits. In the following example, the environment variable "SELECTED_CLI", as well as the runtime output of running `node -v` would be included in the computation of the hash used for storing the cached result.
```json {% fileName="nx.json" %}
{
...
"targetDefaults": {
"e2e": {
"inputs": [
{
"env": "SELECTED_CLI"
},
{
"runtime": "node -v"
}
]
}
}
}
```
> _Note that `targetDefaults` is just a way to specify project-specific settings in a central place within the `nx.json`. All of these can directly also be added to the `package.json` or `project.json` (depending on which approach you use for configuring your projects)._
Check out the following video which goes into some of the details on the example of a [Lerna](https://lerna.js.org/) monorepo that uses the new Nx inputs configuration.
{% youtube src="https://youtu.be/u91YHPwddEM" /%}
## Optional npmScope
When you create a new Nx workspace it sets up a "npm scope" which you can find in the `nx.json`.
```json {% fileName="nx.json" %}
{
"npmScope": "myorg",
...
}
```
Although most of the time you might want to use one, it is not mandatory any more. This contributes to our mission of simplifying Nx and making it more flexible.
## Speeding up workspace config computation
Project configuration calculations can take up quite some time in large workspaces. Starting with v14.4 we offloaded that part to the [Nx Daemon](/concepts/nx-daemon), optimizing the overall command execution time in particular for large workspaces.
## New NX_PROJECT_GRAPH_CACHE_DIRECTORY
When using shared volumes on CI, different consumers of the cache can write a different project graph to the cache, thus overwriting one that may be in use by other consumers. Up until now, there was no way to specify a different cache directory just for the project graph.
With this release, we introduce a new `NX_PROJECT_GRAPH_CACHE_DIRECTORY` environment variable to dictate where Nx (and the Nx Daemon) should store the project graph cache.
## Angular updates
In Nx v14.2 we [also shipped the Angular v14 migrations](/blog/nx-14-2-angular-v14-storybook-update-lightweight-nx-and-more) which went smoothly. We keep improving our support. In this release in particular we
- added support to generate Storybook stories also for Angular standalone components
- upgraded `@angular-eslint/*` to version 14
- added support for `ngrx` version 14
## How to Update Nx
Updating Nx is done with the following command, and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Exciting?
We're already deep into following our v15 [roadmap](https://github.com/nrwl/nx/discussions/9716) with a lot of cool stuff coming up on the horizon.
Makes sure you don't miss anything by
- Following us [on Twitter](https://twitter.com/NxDevTools), and
- Subscribe to the [YouTube Channel](https://youtube.com/nrwl_io?sub_confirmation=1) for more information on [Angular](https://angular.io/), [React](https://reactjs.org/), Nx, and more!
- Subscribing to [our newsletter](https://go.nx.dev/nx-newsletter)!
@@ -2,11 +2,21 @@
title: 'Setup a Monorepo with PNPM workspaces and speed it up with Nx!'
slug: 'setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-07-14/ABrBjQPg4SrYzFQQXFxY-Q.png'
cover_image: '/blog/images/2022-07-14/ABrBjQPg4SrYzFQQXFxY-Q.avif'
tags: [nx, tutorial]
description: Learn to set up a monorepo with PNPM workspaces for Remix and React projects, then enhance it with Nx's task scheduling and caching features.
---
In this article were going to have a deep dive into setting up a new monorepo using [PNPM workspaces](https://pnpm.io/workspaces) that hosts a Remix application as well as a React-based library. We will learn how to run commands with PNPM, how to run them in parallel and finally were going to add Nx for a more sophisticated task scheduling, including command caching and more.
In this article we're going to have a deep dive into setting up a new monorepo using [PNPM workspaces](https://pnpm.io/workspaces) that hosts a Remix application as well as a React-based library. We will learn how to run commands with PNPM, how to run them in parallel and finally we're going to add Nx for a more sophisticated task scheduling, including command caching and more.
{% callout type="warning" title="Updated video!" %}
We made a lot of improvements since we last wrote this article. Here's our **updated content**:
- [the full all-in-one video on Youtube](https://youtu.be/zX-1tpqUG5c)
- [our free course: From PNPM Workspaces to Distributed CI](/courses/pnpm-nx-next)
{% /callout %}
**Important:** If you are already familiar with the setup and configuration of a new PNPM workspace, feel free to skip to the part where we add Nx later in the article.
@@ -37,9 +47,9 @@ In this article were going to have a deep dive into setting up a new monorepo
## Initialize a new PNPM workspace
To get started, lets make sure you have PNPM installed. The [official docs have an installation page](https://pnpm.io/installation) with detailed instructions. I also recommend using something like [Volta](https://volta.sh/) in particular if you have to deal with multiple different versions of NPM/PNPM and node versions.
To get started, let's make sure you have PNPM installed. The [official docs have an installation page](https://pnpm.io/installation) with detailed instructions. I also recommend using something like [Volta](https://volta.sh/) in particular if you have to deal with multiple different versions of NPM/PNPM and node versions.
Lets create a new folder named `pnpm-mono`, cd into it and then run `pnpm init` to generate a top-level `package.json`. This will be the root `package.json` for our PNPM monorepo.
Let's create a new folder named `pnpm-mono`, cd into it and then run `pnpm init` to generate a top-level `package.json`. This will be the root `package.json` for our PNPM monorepo.
```shell
mkdir pnpm-mono
@@ -53,7 +63,7 @@ It is probably also handy to initialize a new Git repository such that we can co
git init
```
At this point lets also create a `.gitignore` file to immediately exclude things like `node_modules` and common build output folders.
At this point let's also create a `.gitignore` file to immediately exclude things like `node_modules` and common build output folders.
```.gitignore {% fileName=".gitignore" %}
node_modules
@@ -68,7 +78,7 @@ The structure of a monorepo might vary depending on what you plan to use it for.
- **package centric** repositories which are used for developing and publishing a cohesive set of reusable packages. This is a common setup in the open source world and can be seen in repositories such as [Angular](https://github.com/angular/angular), [React](https://github.com/facebook/react), [Vue](https://github.com/vuejs/vue) and many others. Those repos are characterized by most commonly having a `packages` folder and which are then commonly published to some public registry such as [NPM](https://npmjs.com/).
- **app centric** repositories which are used mainly for developing applications and products. This is a common setup in companies. Such repos are characterized in having an `apps` and `packages` or `libs` folder, where the `apps` folder contains the buildable and deployable applications, while the `packages` or `libs` folder contains libraries that are specific to one or multiple applications that are being developed within the monorepo. You can still also publish some of these libs to a public registry.
In this article were going to use the app centric approach, to demonstrate how we can have an application that consumes packages from within the monorepo.
In this article we're going to use the "app centric" approach, to demonstrate how we can have an application that consumes packages from within the monorepo.
Create an `apps` and `packages` folder within `pnpm-mono`:
@@ -76,7 +86,7 @@ Create an `apps` and `packages` folder within `pnpm-mono`:
mkdir apps packages
```
Now lets configure PNPM to properly recognize the monorepo workspace. Basically we have to create a `pnpm-workspace.yaml` file at the root of the repository, defining our monorepo structure:
Now let's configure PNPM to properly recognize the monorepo workspace. Basically we have to create a `pnpm-workspace.yaml` file at the root of the repository, defining our monorepo structure:
```yaml {% fileName="pnpm-workspace.yaml" %}
packages:
@@ -88,7 +98,7 @@ packages:
## Adding a Remix application
We should now be ready to add our first application. For this example I picked [Remix](https://remix.run/) but you can really host any type of application in here, it wont really matter.
We should now be ready to add our first application. For this example I picked [Remix](https://remix.run/) but you can really host any type of application in here, it won't really matter.
> _Info: We use the normal_ [_Remix installation & setup procedure_](https://remix.run/docs/en/v1) _here which you can find on their docs page._
@@ -99,7 +109,7 @@ cd apps
npx create-remix@latest
```
You will be asked for an app name. Lets just go with my-remix-app which well be using for the rest of this article. Obviously feel free to use a different one. In addition, the Remix setup process is also going to ask you a couple of questions that customize the exact setup. The particular options are not really relevant for our article here, so feel free to choose whatever best suits your needs.
You will be asked for an app name. Let's just go with "my-remix-app" which we'll be using for the rest of this article. Obviously feel free to use a different one. In addition, the Remix setup process is also going to ask you a couple of questions that customize the exact setup. The particular options are not really relevant for our article here, so feel free to choose whatever best suits your needs.
You should have now a Remix app, within the `apps/my-remix-app` folder or whatever name you chose. Remix has already a `package.json` with corresponding scripts configured:
@@ -122,7 +132,7 @@ Usually, in a monorepo you want to run commands from the root of the repository
pnpm --filter <package-name> <command>
```
Now it happens (at the writing of this article) that Remixs default `package.json` doesn't have a `name` property defined which PNPM wants to run the package. So let's define one in the `apps/my-remix-app/package.json`:
Now it happens (at the writing of this article) that Remix's default `package.json` doesn't have a `name` property defined which PNPM wants to run the package. So let's define one in the `apps/my-remix-app/package.json`:
```json
{
@@ -143,7 +153,7 @@ pnpm --filter my-remix-app dev
## Create a Shared UI library
Now that we have our app set up, lets create a library package that can be consumed by our application.
Now that we have our app set up, let's create a library package that can be consumed by our application.
```shell
@@ -152,7 +162,7 @@ mkdir shared-ui
```
Next, lets create a `package.json` with the following content (you can also use `pnpm init` and adjust it):
Next, let's create a `package.json` with the following content (you can also use `pnpm init` and adjust it):
```json
{
@@ -170,7 +180,7 @@ Next, lets create a `package.json` with the following content (you can also u
Note, we declare it as `private` because we don't want to publish it to NPM or somewhere else, but rather just reference and use it locally within our workspace. I also removed the `version` property since it is not used.
As the technology stack Ive chosen to go with [React](https://reactjs.org/) (so we can import it in Remix) and [TypeScript](https://www.typescriptlang.org/) (because it can almost be considered a standard nowadays). Lets install these dependencies from the root of the workspace:
As the technology stack I've chosen to go with [React](https://reactjs.org/) (so we can import it in Remix) and [TypeScript](https://www.typescriptlang.org/) (because it can almost be considered a standard nowadays). Let's install these dependencies from the root of the workspace:
```shell
pnpm add --filter shared-ui react
@@ -196,7 +206,7 @@ We also want to have a public API where we export components to be used outside
export * from './Button';
```
For sake of simplicity we just use the TypeScript compiler to compile our package. We could have some more sophisticated setup for bundling multiple files together etc with something like [Rollup](https://rollupjs.org/guide/en/) or whatever you prefer using, but thats outside the scope of this article.
For sake of simplicity we just use the TypeScript compiler to compile our package. We could have some more sophisticated setup for bundling multiple files together etc with something like [Rollup](https://rollupjs.org/guide/en/) or whatever you prefer using, but that's outside the scope of this article.
To create the desired compilation output create a `packages/shared-ui/tsconfig.json` file with the following configuration.
@@ -376,13 +386,13 @@ This is exactly where Nx can help. It is optimized for monorepo scenarios and co
## Installing Nx
Since Nx will be used for running operations across the entire monorepo workspace were going to install it at the root level `package.json`.
Since Nx will be used for running operations across the entire monorepo workspace we're going to install it at the root level `package.json`.
```shell
pnpm add nx -D -w
```
Thats it.
That's it.
## Running tasks with Nx
@@ -394,7 +404,7 @@ npx nx <target> <project>
`target` is the NPM script in this specific case you want to execute.
Lets try to run the build for our `shared-ui` package using the following command:
Let's try to run the build for our `shared-ui` package using the following command:
```shell
npx nx build shared-ui
@@ -431,15 +441,15 @@ npx nx run-many --target=build --projects=my-remix-app,shared-ui
NX Successfully ran target build for 2 projects (1s)
```
> _Note Im prefixing the commands with_ `_npx_` _which runs the Nx executable in the_ `_node_modules_` _folder. In this way I don't have to install_ `_nx_` _globally. If you prefer doing that, feel free to do so._
> _Note I'm prefixing the commands with_ `_npx_` _which runs the Nx executable in the_ `_node_modules_` _folder. In this way I don't have to install_ `_nx_` _globally. If you prefer doing that, feel free to do so._
## Configure Caching
One of the main benefits of adding Nx to our PNPM workspace is **speed via caching**. [Computation caching](/concepts/how-caching-works) is a feature where different inputs (source files, env variables, command flags, etc.) are collected and a hash computed & stored in a local folder. Next time you run the command again, Nx looks for a matching hash, and if it finds one it just restores it. This includes restoring the terminal output as well as build artifacts (e.g. JS files in `dist` folders).
Not all operations are cacheable, only side-effect free ones are. For example, if you run an operation with the same inputs, it reliably always has to produce the same output. If as part of that operation you call some API for instance, it wouldnt be cacheable because the result of that API might vary given the same input parameters.
Not all operations are cacheable, only side-effect free ones are. For example, if you run an operation with the same inputs, it reliably always has to produce the same output. If as part of that operation you call some API for instance, it wouldn't be cacheable because the result of that API might vary given the same input parameters.
In order to enable caching, lets configure our cacheable operations. To do that we create an `nx.json` at the root of our workspace with the following content
In order to enable caching, let's configure our cacheable operations. To do that we create an `nx.json` at the root of our workspace with the following content
```json {% fileName="nx.json" %}
{
@@ -456,7 +466,7 @@ In order to enable caching, lets configure our cacheable operations. To do th
Note the `cacheableOperations` array where we specify `build` and `test` . You can add more such as linting.
Having enabled this, if we now run our Remix app build the first time it is executed just as normal and well see it takes roughly 1s.
Having enabled this, if we now run our Remix app build the first time it is executed just as normal and we'll see it takes roughly 1s.
```shell
npx nx build my-remix-app
@@ -480,7 +490,7 @@ NX Successfully ran target build for project my-remix-app (9ms)
Nx read the output from the cache instead of running the command for 1 out of 1 tasks.
```
You can also see that from the terminal output mentioning existing outputs match the cache, left as is as well as at the end Nx read the output from the cache instead of running the command for 1 out of 1 tasks.
You can also see that from the terminal output mentioning "existing outputs match the cache, left as is" as well as at the end "Nx read the output from the cache instead of running the command for 1 out of 1 tasks."
Having caching in place can drastically improve command execution times. It also gets even more useful if the cache is remotely distributed so that it can be shared with CI as well as other developer machines. In the case of Nx this can be done by enabling [Nx Cloud](/ci/features/remote-cache), which comes with 500 hours saved/month for free (no credit card required) and unlimited hours for open source projects.
@@ -600,7 +610,7 @@ Next, we also want to define a targetDefault for our Remix `dev` command, such t
}
```
Heres the entire `nx.json` file again as a reference point:
Here's the entire `nx.json` file again as a reference point:
```json
{
@@ -635,7 +645,7 @@ _Nx highlights dependent projects being built, but it keeps the main attention t
## Running just what changed
In addition to providing caching, Nx also allows to just run what changed in a given branch with respect to a base branch by using the so-called [affected command](/ci/features/affected).
In addition to providing caching, Nx also allows to just run what changed in a given branch with respect to a base branch by using the so-called ["affected command"](/ci/features/affected).
```shell
npx nx affected:<target>
@@ -648,7 +658,7 @@ You can use any target you have defined in your workspace. For example
- `npx nx affected:lint`
- `npx nx affected:publish`
**How does this work?** Nx builds a project graph based on the structure and dependencies among packages in your monorepo workspace. Lets assume the following hypothetical graph:
**How does this work?** Nx builds a project graph based on the structure and dependencies among packages in your monorepo workspace. Let's assume the following hypothetical graph:
![](/blog/images/2022-07-14/wdMo0VwoyAdZbAmDbn6uMw.avif)
@@ -668,7 +678,7 @@ If `lib2` gets changed in our feature branch, running tests against the workspac
![](/blog/images/2022-07-14/FACbo_7-AlbPOna_6-hDaw.avif)
_Affected projects if lib2 gets changed_
_Affected projects if "lib2" gets changed_
Be aware however, if we run `affected:build` and we defined a dependency in our `nx.json` indicating that dependent projects need to be built first as well (see section "Defining task dependencies"), then `affected:build` would build
@@ -680,7 +690,7 @@ It would not build `lib1` or `appA` though.
## Additional features
Besides speed and task scheduling improvements, we also get some additional features by adding Nx to our PNPM workspace. Lets explore some:
Besides speed and task scheduling improvements, we also get some additional features by adding Nx to our PNPM workspace. Let's explore some:
## Want to automate the creation of packages?
@@ -718,12 +728,12 @@ _Terminal output of Nx dynamically showing the parallel tasks being computed as
npx nx graph
```
This launches an interactive visualization of the workspaces project graph with some advanced capabilities of filtering, debugging your workspace structure and more.
This launches an interactive visualization of the workspace's project graph with some advanced capabilities of filtering, debugging your workspace structure and more.
![](/blog/images/2022-07-14/KpUCyj6SvYR3t7tmADloog.avif)
_Nx project graph visualization of our PNPM workspace_
> _As a side-note: you can run the project graph on any PNPM workspace, even if you dont have Nx installed. Running_ `_npx nx graph_` _should work._
> _As a side-note: you can run the project graph on any PNPM workspace, even if you don't have Nx installed. Running_ `_npx nx graph_` _should work._
## Conclusion
@@ -743,5 +753,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)
@@ -0,0 +1,304 @@
---
title: 'Nx 14.5 — Cypress v10, output globs, linter perf, React Tailwind support'
slug: 'nx-14-5-cypress-v10-output-globs-linter-perf-react-tailwind-support'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-08-02/ZUzLD-4JgrEBIZb3dXOvag.avif'
tags: [nx, release]
description: 'Nx 14.5 adds Cypress v10 with component testing, glob-based outputs for better caching, and improved React Tailwind integration.'
---
Here we go! After not even a month of [releasing v14.4](/blog/nx-14-4-inputs-optional-npm-scope-project-graph-cache-directory-and-more), Nx v14.5 is out!! Here's all you need to know.
**TL;DR:** [https://github.com/nrwl/nx/releases/tag/14.5.0](https://github.com/nrwl/nx/releases/tag/14.5.0)
## Cypress v10 and Component Testing
Cypress v10 is probably the most significant update since Cypress was released. It comes with a new, exciting [Cypress App](https://docs.cypress.io/guides/core-concepts/cypress-app), component testing beta, a new JS/TS-based configuration file and much more. Read all the details in [their official announcement](https://www.cypress.io/blog/2022/06/01/cypress-10-release/).
One of the strengths of Nx is to integrate various tools into a cohesive, high-quality experience. Working together with other companies and open source projects is key to making sure we meet this goal. We have had an ongoing relationship with the folks over at Cypress for years already and have been working closely with them since earlier this year to integrate v10 into Nx in the best possible way.
This includes an upgrade script to automatically migrate Nx users using Cypress v9 seamlessly to v10. By running…
```shell
nx g @nrwl/cypress:migrate-to-cypress-10
```
…your workspace will be automatically upgraded to the latest Cypress version.
Cypress v10 also comes with a beta version of [Component Testing](https://docs.cypress.io/guides/component-testing/writing-your-first-component-test). Nx v14.5 comes with an integrated generator to add component testing support to React-based project:
```shell
nx g @nrwl/react:cypress-component-configuration --project=my-react-project --generate-tests
```
You can also append the `--generate-tests` to automatically generate Cypress component tests for the existing components in the target project (`my-react-project`).
```shell
nx g @nrwl/react:cypress-component-configuration --project=my-react-project --generate-tests
```
Check out our [generator docs](/nx-api/react/generators/cypress-component-configuration) for more info.
{% youtube src="https://youtu.be/QDWN4C7T-Ck" /%}
## Globs for Task Outputs
In v14.4 we [introduced inputs and namedInputs](/blog/nx-14-4-inputs-optional-npm-scope-project-graph-cache-directory-and-more). They allow you to fine-tune how caching works and when it should be invalidated.
```json {% fileName="nx.json" %}
{
...
"targetDefaults": {
"build": {
"inputs": ["!{projectRoot}/**/*.spec.ts"]
}
}
}
```
Specifying such inputs can drastically increase the number of cache hits!
{% tweet url="https://twitter.com/victorsavkin/status/1550187124678205440" /%}
In this release, we also allow specifying globs for `outputs`. Outputs are optional as Nx comes with reasonable defaults, but you can specify your own if your setup differs from the most commonly used ones:
```json {% fileName="nx.json" %}
{
...
"targetDefaults": {
"build": {
...
"outputs": ["dist/libs/mylib"]
}
}
}
```
Globs are particularly useful when multiple targets write to the same directory. Say you have a `build-js` and `build-css` command and both write into `dist/libs/mylib`. For reasons of clarity, if possible, our recommendation is to split them up. Like:
```json {% fileName="nx.json" %}
{
"build-js": {
"outputs": ["dist/libs/mylib/js"]
},
"build-css": {
"outputs": ["dist/libs/mylib/css"]
}
}
```
Sometimes that's not feasible though. In that case, globs come in handy:
```json {% fileName="nx.json" %}
{
"build-js": {
"outputs": ["dist/libs/mylib/**/*.js"]
},
"build-css": {
"outputs": ["dist/libs/mylib/**/*.css"]
}
}
```
[Read more in our docs](/reference/project-configuration)
## Parameter Forwarding when building dependent projects
Besides the speed aspect, one key feature of Nx is the ability to build dependent projects automatically. Let's say you have `project-a` which depends on `project-b`, then whenever you run the build for `project-a`, thanks to its project graph, Nx will automatically run the build for `project-b` first. You can define such dependencies either directly in your [project.json](/reference/project-configuration) or [package.json](/reference/project-configuration) file, or globally for an entire workspace in `nx.json`:
```json {% fileName="nx.json" %}
{
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
}
}
}
```
The `^` is a short-hand notation for
```json {% fileName="nx.json" %}
{
"targetDefaults": {
"build": {
"dependsOn": [{ "projects": "dependencies", "target": "build" }]
}
}
}
```
...and defines that the `build` task should be run for all its dependencies first.
> _You have a PNPM,NPM or Yarn workspace? Adding Nx doesn't only benefit you in terms of speed improvements, but also to define such build dependencies. Have a look at this video to learn more:_ [_Setup a monorepo with PNPM workspaces and add Nx for speed: Defining task dependencies aka build pipelines_](https://youtu.be/ngdoUQBvAjo?t=1485)
What happens to parameters when invoking the target on a project's dependencies? By default, they are not forwarded but starting with 14.5 you can. Here are some configuration options:
```json
"build": {
// forward params passed to this target to the dependency targets
"dependsOn": [
{ "projects": "dependencies", "target": "build", "params": "forward" }
]
},
"test": {
// ignore params passed to this target, won't be forwarded to the dependency targets
"dependsOn": [
{ "projects": "self", "target": "build", "params": "ignore" }
]
}
"lint": {
// ignore params passed to this target, won't be forwarded to the dependency targets
"dependsOn": [
{ "projects": "self", "target": "build" }
]
}
```
[Read more in our docs](/reference/project-configuration)
## Linting Performance
We are obsessed with performance, yes we are! And I have good news: the Nx module boundary lint rule just got an order of magnitude faster 🤯.
{% tweet url="https://twitter.com/meeroslav/status/1550058325236191232" /%}
Replacing `Sets`, `foreach`, `reduce` with plain `for` loops can often have quite a significant impact. You won't notice much on smaller projects, but on large Nx workspaces with 500+ projects you should see some huge improvements 🚀.
## Support for banned external imports lint checks on transitive dependencies
The [Nx Module Boundary lint rule](/features/enforce-module-boundaries) is a powerful concept especially when it comes to the maintainability aspect of projects and monorepos. Learn more in our blog article on [Taming Code Organization with Module Boundaries in Nx](/blog/mastering-the-project-boundaries-in-nx).
The Module Boundary rule allows for much more though. It also allows to ban external imports. Say you have a frontend project where you want to make sure none of the "backend-type" dependencies accidentally get imported. Or vice-versa, a backend project where you wouldn't necessarily want to depend on any "frontend-type" package references. You can use the `bannedExternalImports` for that. For example:
```json {% fileName=".eslintrc.json" %}
{
// ... more ESLint config here // nx-enforce-module-boundaries should already exist at the top-level of your config
"nx-enforce-module-boundaries": [
"error",
{
"allow": [],
// update depConstraints based on your tags
"depConstraints": [
// projects tagged with "frontend" can't import from "@nestjs/common"
{
"sourceTag": "frontend",
"bannedExternalImports": ["@nestjs/common"]
},
// projects tagged with "backend" can't import from "@angular/core"
{
"sourceTag": "backend",
"bannedExternalImports": ["@angular/core"]
}
]
}
] // ... more ESLint config here
}
```
Note, the `frontend` and `backend` `sourceTag` definition is something you define. You could have easily named it differently. It is a string that can be attached to a project by adding it to the `tag` property of its `project.json` configuration file. Read more about banned external imports [in our docs](/features/enforce-module-boundaries).
Starting with 14.5 we now support such checks also on transitive dependencies. Assume we have `project-a` and `project-b`, both of which are tagged as `framework-agnostic` and have `react` in their banned external imports. Also, assume there's a relationship like `project-a -> project-b`. If `project-b` imports `react` and we run linting, it fails correctly. However, if we run linting on `project-a`, it succeeds as `project-a` is not importing `react` at all, thus not breaking the lint rule. In most situations, this is fine because linting happens at a project level, but sometimes you might want to have a "transitive" behavior where linting would also fail for `project-a` because it imports `project-a` which imports `react`.
You can now enable such behavior by setting `checkNestedExternalImports` to `true`:
```json {% fileName=".eslintrc.json" %}
{
// ... more ESLint config here // nx-enforce-module-boundaries should already exist at the top-level of your config
"nx-enforce-module-boundaries": [
"error",
{
"allow": [],
"checkNestedExternalImports": true,
// update depConstraints based on your tags
"depConstraints": [
// projects tagged with "frontend" can't import from "@nestjs/common"
{
"sourceTag": "framework-agnostic",
"bannedExternalImports": ["react"]
}
]
}
]
// ... more ESLint config here
}
```
## Improved automated Module Boundary Lint Rule fixes
In v13.10 we introduced automated fixes for the Nx Module Boundary rules. Wrong relative imports such as the following can be easily adjusted automatically by providing the `--fix` when running linting on the project.
![](/blog/images/2022-08-02/dhbe8hFyjEm_K86A.avif)
This is a huge time saver, especially on large projects. With Nx v14.5 the automated fixes now also support automated resolution of absolute imports across library boundaries, such as
```typescript
// WRONG
import { libSayHi } from 'libs/tslib-a/src/index';
// automatically fixed to
import { libSayHi } from '@myorg/tslib-a';
```
## Nx Migrate improvements and Nx Repair
We improved our log output from the Nx automated code migration run to make it more clear what a code migration actually changes. Also, those migrations that don't do anything because they don't apply to your workspace are not shown in the output at all.
![](/blog/images/2022-08-02/IWGJcienK4L_oGxl.avif)
## Tailwind Setup Generator for React
It has never been easier to add [Tailwind](https://tailwindcss.com/) support to your React app or library. Just run the `setup-tailwind` generator:
```shell
npx nx g @nrwl/react:setup-tailwind --project=<project-name>
```
![](/blog/images/2022-08-02/H1XArfg-tCgD0ZUp.avif)
This automatically sets up your project with a PostCSS and Tailwind configuration.
## React Native: Add Detox config to Expo apps
We also improved our React Native support by adding the possibility to generate a [Detox](https://wix.github.io/Detox/) config for Expo applications.
## Deprecating Angular Protractor e2e tests
[Protractor](https://github.com/angular/protractor/issues/5502) has been deprecated for a while on the Angular CLI side and given Nx has had [Cypress](https://cypress.io/) support for a while it has never been a popular choice. Starting with this release we're deprecating the generator for setting up Protractor and we're planning on removing support entirely in Nx v15.
## Other Package updates
Here are some more package updates that come with this release and will automatically be bumped when you run the Nx migration:
- Angular v14.1.0
- Express 14.18.1
- Nest v9
- Next.js v12.2.2
- React Native 0.69.1
- React Native Metro v0.71.3
- React 18.0.15
- `eslint-plugin-jsx-a11y` v6.6.1
For an exhaustive list check our release changelog on GitHub: [https://github.com/nrwl/nx/releases/tag/14.5.0](https://github.com/nrwl/nx/releases/tag/14.5.0)
## How to Update Nx
Updating Nx is done with the following command, and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Learn more
- 🧠 [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/@nxdevtools)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
@@ -2,8 +2,9 @@
title: 'Helping the Environment by Saving Two Centuries of Compute time'
slug: 'helping-the-environment-by-saving-two-centuries-of-compute-time'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-08-18/FBQVoC9YXF7wlq3dhxfQMQ.png'
cover_image: '/blog/images/2022-08-18/FBQVoC9YXF7wlq3dhxfQMQ.avif'
tags: [nx]
description: "Discover how Nx's caching and computation-saving features have saved over 200 years of compute time, reducing CO2 emissions through efficient task execution."
---
Among the core features of Nx is the ability to save computation time by applying different strategies. Scroll to the end of the article for some more info, but first, **how much time is actually being saved?**
@@ -44,7 +45,7 @@ Calculating the CO2 emissions can be tricky. It really depends on what machines
## Help me out! A Primer on how Nx saves computation
Nx has various strategies to help you reduce computation time, locally and on CI. Heres a very short overview of the strategies Nx applies with some links for further reading.
Nx has various strategies to help you reduce computation time, locally and on CI. Here's a very short overview of the strategies Nx applies with some links for further reading.
### Affected Commands
@@ -93,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)
@@ -1,12 +1,13 @@
---
title: 'Lerna reborn — Whats new in v6?'
title: "Lerna reborn — What's new in v6?"
slug: 'lerna-reborn-whats-new-in-v6'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-10-12/RGQCNNO-SSQ8PHnIZ4BVTQ.png'
cover_image: '/blog/images/2022-10-12/RGQCNNO-SSQ8PHnIZ4BVTQ.avif'
tags: [nx, release]
description: Lerna v6 brings default Nx integration, remote caching, PNPM support, dynamic terminal output, and improved task management to speed up your monorepo builds.
---
Lerna v6 is out!! Heres everything you need to know about the **new Lerna experience!**
Lerna v6 is out!! Here's everything you need to know about the **new Lerna experience!**
**Table of Contents**
@@ -26,7 +27,7 @@ Lerna v6 is out!! Heres everything you need to know about the **new Lerna exp
## Lerna continues to evolve
If you already know this, feel free to skip ahead. But surprisingly many still havent heard that **Lerna is back**, far from obsolete or deprecated and is getting brand new features. We from [Nrwl](/company) are the creators of Nx and given our long history in the monorepo space, we offered to [take over stewardship of Lerna](/blog/lerna-is-dead-long-live-lerna) when it was declared dead in April 2022.
If you already know this, feel free to skip ahead. But surprisingly many still haven't heard that **Lerna is back**, far from obsolete or deprecated and is getting brand new features. We from [Nrwl](/company) are the creators of Nx and given our long history in the monorepo space, we offered to [take over stewardship of Lerna](/blog/lerna-is-dead-long-live-lerna) when it was declared "dead" in April 2022.
Since we took over, in May 2022, it has been an absolute rollercoaster. We launched [a brand new website](https://lerna.js.org/), updated the content of the docs, and [made Lerna 10x faster](/blog/lerna-used-to-walk-now-it-can-fly). And now, **Lerna v6 is out!**
@@ -34,7 +35,7 @@ Since we took over, in May 2022, it has been an absolute rollercoaster. We launc
Up until Lerna v4, either the `p-map` or `p-queue` npm packages have been used to delegate the task scheduling. With [v5.1](/blog/lerna-used-to-walk-now-it-can-fly) we introduced `nx` as an additional mechanism to schedule tasks. The advantage? Nx has caching built-in, which **also gives Lerna caching support**, making it lightning fast. A recent benchmark test resulted in **Lerna being 2.5x faster than Lage** and around **4x faster than Turbo** (as of Oct 2022; [test it out by yourself](https://github.com/vsavkin/large-monorepo)).
So far you had to enable Nx support by setting the `useNx` flag in `lerna.json`:
So far you had to enable "Nx support" by setting the `useNx` flag in `lerna.json`:
```
// lerna.json
@@ -44,7 +45,7 @@ So far you had to enable “Nx support” by setting the `useNx` flag in `lerna.
}
```
Weve been testing this opt-in for the last couple of months and got tons of amazing feedback from companies and open source projects. As a result, **with v6 all Lerna workspaces have the useNx set to** `**true**` **by default** even if you don't have it in your Lerna config file. If you don't want to use it, you can disable it by setting the flag to false.
We've been testing this opt-in for the last couple of months and got tons of amazing feedback from companies and open source projects. As a result, **with v6 all Lerna workspaces have the useNx set to** `**true**` **by default** even if you don't have it in your Lerna config file. If you don't want to use it, you can disable it by setting the flag to false.
To experience fast caching, ensure you have a `nx.json` file at the root of your Lerna workspace where you define the cacheable operations. Check out [the docs for more details](https://lerna.js.org/docs/features/cache-tasks). Here's an example configuration file:
@@ -63,144 +64,6 @@ To experience fast caching, ensure you have a `nx.json` file at the root of your
Note that you can also run..
```shell
npx lerna add-caching
```
..to automatically generate a `nx.json` configuration file based on your existing Lerna workspace.
## Remote caching with Lerna
By using Nx as the task scheduler for Lerna it inherits all the capabilities Nx comes with. That not only just includes local caching, but also the possibility of having **remote caching** and **distributed task execution**.
Remote caching allows you to distribute your local cache with your co-workers and your CI system. This is done via [Nx Cloud](/nx-cloud). But distributed caching is just one aspect. Nx Cloud also comes with a “run view” that visualizes your CI run with easy grouping and filtering capabilities, but in particular, it comes with the ability to distribute your tasks dynamically across multiple machines. All by optimizing for the best parallelization and machine utilization.
![](/blog/images/2022-10-12/CtvU5Me27YRidzG1.avif)
All you need to set this up is to run..
```shell
npx nx connect-to-nx-cloud
```
..in your Lerna workspace, which will guide you through a couple of questions and set you up with an [Nx Cloud](/nx-cloud).
Read more [on the docs](https://lerna.js.org/docs/features/cache-tasks#distributed-computation-caching).
## Defining a task pipeline
When running tasks in a monorepo environment, you want to maximize the parallelization, but **still account for potential dependencies among tasks**. For example, assume you have a Remix application that depends on some `shared-ui` library. You want to ensure that `shared-ui` is built before either building or serving the Remix application.
With Lerna v6 you can do so in the `nx.json` file by defining the `targetDefaults`:
```
// nx.json
{
...
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
},
"dev": {
"dependsOn": ["^build"]
}
}
}
```
In this case, whenever you run either `build` or `dev`, Lerna would first run the `build` task on all the dependent packages.
[Read more on our docs](https://lerna.js.org/docs/concepts/task-pipeline-configuration).
## Lerna add-caching command
If you dont have caching or your task pipeline set up just yet, no worries. We wanted to make it as easy as possible by providing a dedicated command:
```shell
npx lerna add-caching
```
This will scan your workspace, find all your `package.json` scripts and then guide you through the **configuration of both, your cacheable operations as well as your task pipeline**.
Heres a quick walkthrough video:
{% youtube src="https://www.youtube.com/watch?v=jaH2BqWo-Pc" /%}
You are obviously always free to create the `nx.json`by hand.
## PNPM support for Lerna
In the past, Lerna didnt properly support PNPM. We fixed this in v6. Now whenever you use Lerna in combination with PNPM, we make sure to detect packages based on the `pnpm-workspace.yaml`, to enforce `useWorkspaces: true` , we update the `pnpm-lock.yaml`
accordingly when using `lerna version` and we also added proper support for the `workspace:` protocol that PNPM uses.
You can now finally use one of the fastest package managers in combination with a new fast Lerna experience. Also, make sure to check [out our docs for all the details](https://lerna.js.org/docs/recipes/using-pnpm-with-lerna).
## Dynamic terminal output
When running tasks in parallel across a large number of projects, it can become quite difficult to follow along in the terminal with what got built and where tasks failed. Thats why the new Lerna version comes with a dynamic terminal output that only shows what is most relevant at a given moment.
![](/blog/images/2022-10-12/8hPYG2wuAMk5hri0.avif)
Note that you would still see all of the output as usual on CI.
## VSCode extension for Lerna workspaces
Lerna now has a [dedicated VSCode extension](https://lerna.js.org/docs/features/editor-integrations) to help you navigate your monorepo. This allows you to run commands directly from the context menu (by right-clicking on a project):
![](/blog/images/2022-10-12/TlHvP1Kd46Vzbfg.avif)
Or visualize a project and its relationships with other projects in the workspace.
![](/blog/images/2022-10-12/ZFhpQX9xS59eZD7Q.avif)
You will also get intelligent autocompletion in configuration files. Heres an example of Nx console providing context-based information when editing the `nx.json` task dependencies.
![](/blog/images/2022-10-12/pMotejmmm1TUsLR2.avif)
## Lerna Repair
Lerna v6 comes with a built-in `lerna repair` command. Running this command will automatically fix your Lerna configuration. For instance, in Lerna v6, there's no need to have `useNx: true` in your `lerna.json` since that will be the new default going forward. Running `lerna repair` fixes this.
![](/blog/images/2022-10-12/SNKZvHYE2CG7jX7A.avif)
This allows you always to have the most up-to-date Lerna setup and it will become even more powerful as we keep adding migrations in the future.
## Lerna and Prettier
Prettier is part of the standard toolchain of every developer nowadays. In Lerna v6 we added a feature to detect whether Prettier is set up in the workspace. If so, we automatically apply it to all files that get updated by running the `lerna version` command. No more follow-up commits just to fix the file formatting!
## Migrating to Lerna v6
Migrating from Lerna v5 to v6 is non-breaking. We increased the major because we changed some defaults and wanted to be cautious about that and communicate it properly.
{% youtube src="https://www.youtube.com/embed/kOD7880DNEE" /%}
Similarly, if youre still on v4 and want to migrate to v6 it should be pretty straightforward and not be breaking in most cases.
Just update the Lerna package version to the latest and then run..
```shell
npx lerna add-caching
```
..to enable and configure caching for your workspace.
## Lerna is using Nx now. Can I keep using my Lerna commands?
Absolutely! One of the key advantages of the new integration of Lerna with Nx is that you can keep using your existing Lerna commands without migrating them to a new syntax. They will now just be a lot faster.
You can read more about that [on our docs](https://lerna.js.org/docs/lerna-and-nx).
## Are you maintaining an OSS repository using Lerna?
If you are an OSS maintainer and you use a Lerna workspace, let us know!
Ping the Lerna team [on Twitter](https://twitter.com/lernajs) or ping [me directly](https://twitter.com/juristr). Wed love to have a look and help with the migration, look at the repository and make sure it is configured in the best optimal way in terms of monorepo setup and features like caching.
That said, as an open-source maintainer you also get unlimited free computation caching with Nx Cloud. So wed love to set you up with that.
## Learn more
- 🧠 [Lerna Docs](https://lerna.js.org/)
- 👩‍💻 [Lerna GitHub](https://github.com/lerna/lerna)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)(join the `#lerna` channel)
- 📹 [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io)
+260
View File
@@ -0,0 +1,260 @@
---
title: What's new in Nx 15?
slug: 'whats-new-in-nx-15'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-10-14/ReZPz_brTiYN84yvR7Hi2w.avif'
tags: [nx, release]
description: 'Explore the major features and improvements introduced in Nx version 15, including enhanced performance and developer experience.'
---
Nx v15 is finally here! Let's go through all the great features that went into this major release.
{% toc /%}
## Growing fast!
Nx is currently at **~2.7 million NPM downloads per week**, which is incredible given we just crossed the 1 million downloads/week at the beginning of this year.
![](/blog/images/2022-10-14/SfKdIa3JKTG7F-tg.avif)
Expect it to see growing much faster even in the coming months.
## Performance — Core, Nx Daemon
Performance optimizations are a recurring theme for us. We're continuously optimizing Nx to make it even faster than it is now.
For example, when a cache hit needs to restore artifacts to some "dist" folder, we don't touch the file system if it is not needed (because FS operations are costly). As a result, this would also not mess with any "watch" process on your dist folder, which you might use. And obviously, we detect whenever a file is missing. If you delete a single file from your "dist" folder, Nx will know and restore it properly.
This is possible because we offload some of the computation to a daemon process. This runs in the background to compute heavy operations like ensuring the project graph is always in sync, watching cache output locations and more.
You can read more about it here: [/concepts/nx-daemon](/concepts/nx-daemon)
## Package-based and Integrated Style Monorepos
In our 5 years of working with small and huge monorepos we've seen various setups. We've narrowed them down to two approaches:
- **package-based monorepos** — a collection of packages where each package within the monorepo is treated as a fully independent package. Meaning they have their own `package.json` with dependencies declared. To share and link packages locally within the monorepo, the "workspaces" feature from NPM/Yarn/PNPM can be used. Tools for this style are Nx, Lerna, Lage and Turbo.
- **integrated monorepos** — is usually a pre-configured and managed setup. You don't have to rely on NPM/Yarn/PNPM workspaces for local linking and tooling helps with the low-level tooling setup and integrating various tools. Tools for this style are Nx and Bazel.
We improved and optimized Nx to be the best solution for both approaches. As part of this optimization, starting with Nx v15, when you run
```shell
npx create-nx-workspace
```
...you will now get a new question about whether you want to create a package-based monorepo or integrated style monorepo.
![](/blog/images/2022-10-14/CImYERzLu-0nlydk.avif)
There will be more content around choosing which style and even how to mix the two. Go with what works best for you and your current situation, and Nx will be there to handle the rest.
We also updated our docs to have two super short tutorials that illustrate the two approaches:
- [/getting-started/tutorials/typescript-packages-tutorial](/getting-started/tutorials/typescript-packages-tutorial)
- [/getting-started/tutorials/react-monorepo-tutorial](/getting-started/tutorials/react-monorepo-tutorial)
You can also read more about the concept here: [/deprecated/integrated-vs-package-based](/deprecated/integrated-vs-package-based)
## New Compact Syntax for Task Pipelines
Monorepos typically do not just have dependencies among projects but also among tasks. Let's say you have a Remix app that depends on some `shared-ui` React-based library. Whenever you build or serve your app, `shared-ui` gets built before. This is required - especially in a package-based monorepo - because connected packages depend on the build artifacts, that is the compiled JS files.
You can define such a relationship easily in the `nx.json` by specifying the `targetDefaults` property. Nx had this for a while, but as part of some v14 minor version, we made it more concise.
Here's an example:
```json {% fileName="nx.json" %}
{
"targetDefaults": {
// run the build of all dependent packages first
"build": {
"dependsOn": ["^build"]
},
"dev": {
"dependsOn": ["^build"]
},
// run a package's build task before running publish
"publish": {
"dependsOn": ["build"]
}
}
}
```
You can read more here: [/concepts/task-pipeline-configuration](/concepts/task-pipeline-configuration)
## Fine-tune Caching with Inputs
Nx's caching is already powerful, but you can get even more out of it by fine-tuning it to your workspace's needs. This is done by defining `inputs` in `nx.json` for the various targets.
Here, for instance, we define that the `build` target should include all the files of a given project but not include test-related files. As a result, changing a Jest spec won't invalidate your `build` target cache.
```json {% fileName="nx.json" %}
{
...
"targetDefaults": {
"build": {
...
"inputs": [
"{projectRoot}/**/*",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)"
]
}
}
}
```
Since these inputs are often re-used across different targets, they can be defined in a dedicated `namedInputs` property (think like a variable declaration) and re-used in the `targetDefaults`.
Here's an example of the defaults that a new Nx workspace comes with:
```json {% fileName="nx.json" %}
{
...
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": [
"default",
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s"
],
"sharedGlobals": []
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
},
"test": {
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
]
}
}
}
```
You can read more here: [/recipes/running-tasks/configure-inputs](/recipes/running-tasks/configure-inputs)
## Nx Console
Nx Console has evolved to be a key part of Nx's mission to improve the life of developers when working with Nx (and now also Lerna) monorepos. There have been tremendous improvements over the last couple of months. Here are some highlights!
The famous, so much loved [Nx Graph](/features/explore-graph) can now also be visualized within VSCode directly:
![](/blog/images/2022-10-14/92hOex9StyREA608.avif)
Get a more in-depth walkthrough here:
{% youtube src="https://youtu.be/ZST_rmhzRXI" /%}
There's also a language server that comes with Nx Console now, which gives you intelligent autocompletion support in your configuration files:
{% tweet url="https://twitter.com/NxDevTools/status/1573323012476051456" /%}
## Website Redesign & Docs Updates
Every now and then, it's time to revamp our website. Because it doesn't feel as fresh as it did when you originally created it. So here we go! We created a new, condensed entry page with the most relevant information,
![](/blog/images/2022-10-14/P5_ddaNI5vSWA9Vz.avif)
...followed by "tab-like" navigation
![](/blog/images/2022-10-14/s2FGPP87Y9HbZlTP.avif)
We keep improving our docs, and we invest a lot of time to make things easier for you all.
{% tweet url="https://twitter.com/victorsavkin/status/1580283233916186624" /%}
It is an ongoing process, and we have a lot of content to cover! We follow the [Diataxis](https://diataxis.fr/) framework for structuring our technical content where we want to clearly assign responsibilities to each page content, so it's easy for you to get out of it what you most need. It is mostly structured around whether
- you want to get a deeper understanding of core concepts ("Concepts" section)
- you want to learn something new ("Tutorial" section) or
- you want a solution to a specific problem ("Recipes" section).
Besides the two new [package-based](/getting-started/tutorials/typescript-packages-tutorial) and [integrated style tutorials](/getting-started/tutorials/react-monorepo-tutorial) we also have two brand new reworked tutorials
- [/getting-started/tutorials](/getting-started/tutorials)
Stay tuned for more updates to come.
## Cleanup for pure JS/TS packages and ESBuild support!
We streamlined our JavaScript / TypeScript packages to have dedicated ones for our bundlers:
- `@nrwl/webpack`
- `@nrwl/rollup`
- `@nrwl/esbuild` (NEW!)
So you can now generate a new JavaScript / TypeScript based package using the `@nrwl/js:lib` generator, which now allows you to choose between various builders:
![](/blog/images/2022-10-14/ti_BMWvFm9t9RVqI.avif)
And for those wondering. Yeah, [Vite](https://vitejs.dev/) is coming.
## Cypress v10 and Component Testing
Cypress has been an integral part of an Nx workspace for a long time. A couple of months ago, they shipped one of their biggest updates: Cypress v10. We've been working closely with the team to coordinate the integration into Nx and ensure it is as smooth as possible.
You can run the following command to migrate your existing Cypress to the latest version.
```shell
npx nx g @nrwl/cypress:migrate-to-cypress-10
```
Cypress v10 also comes with [Component Testing](https://docs.cypress.io/guides/component-testing/writing-your-first-component-test) (for React and Angular), and we provide generators for that to help you get started. You can add component testing to an existing project with
```shell
npx nx g @nrwl/react:cypress-component-configuration --project=your-projectnpx nx g @nrwl/angular:cypress-component-configuration --project=your-project
```
Read more here: [/recipes/cypress/cypress-component-testing](/recipes/cypress/cypress-component-testing)
## Angular: Improved Angular CLI Migrations and Standalone Components
We landed generators to support Angular developers in leveraging the new standalone components API in their Nx-based projects. Here's a preview:
{% tweet url="https://twitter.com/NxDevTools/status/1567513106380894215" /%}
In addition, we improved the migration support for moving projects from the Angular CLI to an Nx workspace. Whether for a single Angular CLI project or to consolidate multiple Angular CLI projects into a single Nx workspace. Please read all about it here: [/recipes/angular/migration/angular](/recipes/angular/migration/angular)
## Easily add Nx to an existing repository
You can easily add Nx to an existing repository. This can be done manually by adding the `nx` NPM package or by running the following command:
```shell
npx nx@latest init
```
It is as easy as it looks. The command analyzes the current workspace and then asks you a couple of questions to set up your workspace (including cacheable operations and configuring a task pipeline).
![](/blog/images/2022-10-14/imK9iVBVxn1-Vppk.avif)
## How to Update Nx
Updating Nx is done with the following command and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Learn more
- 🧠 [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/@nxdevtools)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
@@ -2,42 +2,43 @@
title: 'From Bootstrapped to Venture-Backed: Nx Raises $8.6M'
slug: 'from-bootstrapped-to-venture-backed'
authors: ['Jeff Cross']
cover_image: '/blog/images/2022-11-17/a3eT-mjLsXTiHU5m.png'
cover_image: '/blog/images/2022-11-17/a3eT-mjLsXTiHU5m.avif'
tags: [nx]
description: Nx raises $8.6M seed round led by Nexus Venture Partners and A16z to scale open source Nx, Nx Cloud, and Nx Enterprise, powering 75% of JavaScript monorepo tooling.
---
Im excited to let the Nx Community know about our first round of outside financing, led by [Nexus Venture Partners](https://nexusvp.com/) and [A16z](https://a16z.com/), with several amazing angel investors. Weve raised a seed round of $8.6M to scale the growth of open source Nx, [Nx Cloud](/nx-cloud), and [Nx Enterprise](/enterprise). With this new capital, were able to allocate significantly more resources to rapidly evolving our open source and commercial products to help development teams **ship faster at any scale**.
I'm excited to let the Nx Community know about our first round of outside financing, led by [Nexus Venture Partners](https://nexusvp.com/) and [A16z](https://a16z.com/), with several amazing angel investors. We've raised a seed round of $8.6M to scale the growth of open source Nx, [Nx Cloud](/nx-cloud), and [Nx Enterprise](/enterprise). With this new capital, we're able to allocate significantly more resources to rapidly evolving our open source and commercial products to help development teams **ship faster at any scale**.
![](/blog/images/2022-11-17/RYpEUOFtvrtdGwKx3RgGLA.avif)
_Just a few of the companies powered by Nx_
When Victor Savkin and I left Google to start this company in December 2016, we saw a big gap between how enterprises were building software and how companies like Google were building software. So in 2017, we released the first version of our developer toolkit, Nx, which focused on enabling monorepo-style development for large software teams. Nx has continued to evolve and grow in adoption since then, at more than 5x year-over-year in npm downloads to now 12M+ monthly downloads! Were proud that the worlds top brands depend on Nx to help their development teams iterate faster on critical products.
When Victor Savkin and I left Google to start this company in December 2016, we saw a big gap between how enterprises were building software and how companies like Google were building software. So in 2017, we released the first version of our developer toolkit, Nx, which focused on enabling monorepo-style development for large software teams. Nx has continued to evolve and grow in adoption since then, at more than 5x year-over-year in npm downloads to now 12M+ monthly downloads! We're proud that the world's top brands depend on Nx to help their development teams iterate faster on critical products.
![](/blog/images/2022-11-17/WIkl00uLsSt6p6dmQbIA0g.avif)
[Nx Cloud](/nx-cloud) has also seen a significant uptake in adoption, thanks in large part due to the addition of [Distributed Task Execution](/ci/concepts/parallelization-distribution) last year. With the combination of Distributed Task Execution and Distributed Caching, Nx Cloud is having a massive impact on the time it takes to validate and merge pull requests, drastically reducing product time-to-market. There are now more than 100k connected Nx Workspaces on nx.app. With Nx Cloud, Nx and Lerna workspaces can drastically reduce build times by letting Nx Cloud manage task cache distribution, and optimal distribution of tasks across many machines using Nxs deep understanding of project relationships and task timings. Weve determined that Nx and Nx Cloud have [saved over 250 years of compute time](/blog/helping-the-environment-by-saving-two-centuries-of-compute-time) since we started measuring.
[Nx Cloud](/nx-cloud) has also seen a significant uptake in adoption, thanks in large part due to the addition of [Distributed Task Execution](/ci/concepts/parallelization-distribution) last year. With the combination of Distributed Task Execution and Distributed Caching, Nx Cloud is having a massive impact on the time it takes to validate and merge pull requests, drastically reducing product time-to-market. There are now more than 100k connected Nx Workspaces on nx.app. With Nx Cloud, Nx and Lerna workspaces can drastically reduce build times by letting Nx Cloud manage task cache distribution, and optimal distribution of tasks across many machines using Nx's deep understanding of project relationships and task timings. We've determined that Nx and Nx Cloud have [saved over 250 years of compute time](/blog/helping-the-environment-by-saving-two-centuries-of-compute-time) since we started measuring.
![](/blog/images/2022-11-17/ysWZ8fn2K3m3GjCNGRwshw.avif)
Our most significant commercial innovation in the past year has been [Nx Enterprise](/enterprise), which allows companies to deploy Nx Cloud on their own infrastructure. Some of the worlds leading brands are relying on Nx Enterprise to help their developers get products and features to market significantly faster. One repository powered by Nx Enterprise is saving over 40,000 hours per month of compute time thanks to Distributed Caching and Distributed Task Execution, drastically reducing the time it takes to validate and merge pull requests.
Our most significant commercial innovation in the past year has been [Nx Enterprise](/enterprise), which allows companies to deploy Nx Cloud on their own infrastructure. Some of the world's leading brands are relying on Nx Enterprise to help their developers get products and features to market significantly faster. One repository powered by Nx Enterprise is saving over 40,000 hours per month of compute time thanks to Distributed Caching and Distributed Task Execution, drastically reducing the time it takes to validate and merge pull requests.
![](/blog/images/2022-11-17/zkOkZXDTZiNB6TAk.avif)
_Monorepo.tools, by Nx in collaboration with other monorepo projects_
With Nx and Lerna under our stewardship, we now maintain [more than 75% of leading JavaScript monorepo tooling](https://npmtrends.com/@bazel/typescript-vs-@microsoft/rush-vs-@nrwl/tao-vs-lerna-vs-turbo). Were sharing this space with some other great teams, who are all pushing the state of the art forward. We developed the site [monorepo.tools](https://monorepo.tools/) in collaboration with these teams to spread the monorepo love and help developers decide which tool is right for them.
With Nx and Lerna under our stewardship, we now maintain [more than 75% of leading JavaScript monorepo tooling](https://npmtrends.com/@bazel/typescript-vs-@microsoft/rush-vs-@nrwl/tao-vs-lerna-vs-turbo). We're sharing this space with some other great teams, who are all pushing the state of the art forward. We developed the site [monorepo.tools](https://monorepo.tools/) in collaboration with these teams to spread the monorepo love and help developers decide which tool is right for them.
## Why Outside Funding?
Victor Savkin and I originally decided not to raise funding when starting the company, to give ourselves space to experiment with different business models and find product-market fit. Weve revisited the idea of funding from time to time, but our consulting business has provided more than enough income to sustain the companys growth. It wasnt until Nx Cloud and Nx Enterprise started growing at a much more rapid pace that we decided we could provide a lot more value, more quickly to our community and customers by taking on some partners and capital to help us with our next phase of growth.
Victor Savkin and I originally decided not to raise funding when starting the company, to give ourselves space to experiment with different business models and find product-market fit. We've revisited the idea of funding from time to time, but our consulting business has provided more than enough income to sustain the company's growth. It wasn't until Nx Cloud and Nx Enterprise started growing at a much more rapid pace that we decided we could provide a lot more value, more quickly to our community and customers by taking on some partners and capital to help us with our next phase of growth.
We couldnt be more excited to partner with our co-lead investors, [Nexus Venture Partners](https://nexusvp.com/) and [Andreesen Horowitz (a16z)](https://a16z.com/). Both firms have deep expertise in developer tooling and strongly believe in our vision of helping development teams scale. Were excited to have them bring their own unique talents, experience, and resources to help us execute on that vision. Abhishek Sharma from Nexus has tremendous commercial open source experience, and has been excited about Nx for years. A16z is a powerhouse with an extremely talented enterprise infrastructure team led by Martin Casado and Jennifer Li, alongside amazing partners including, Satish Talluri, and Yoko Li. Were also excited to be joined by many angels, including Tom Preston-Werner, Matt Biilmann, and several other notable CEOs, founders and technologists.
We couldn't be more excited to partner with our co-lead investors, [Nexus Venture Partners](https://nexusvp.com/) and [Andreesen Horowitz (a16z)](https://a16z.com/). Both firms have deep expertise in developer tooling and strongly believe in our vision of helping development teams scale. We're excited to have them bring their own unique talents, experience, and resources to help us execute on that vision. Abhishek Sharma from Nexus has tremendous commercial open source experience, and has been excited about Nx for years. A16z is a powerhouse with an extremely talented enterprise infrastructure team led by Martin Casado and Jennifer Li, alongside amazing partners including, Satish Talluri, and Yoko Li. We're also excited to be joined by many angels, including Tom Preston-Werner, Matt Biilmann, and several other notable CEOs, founders and technologists.
![](/blog/images/2022-11-17/37ySQYL9U1xF7ezq.avif)
_Most of the Nx team at Nx Conf in Tempe, AZ, October 2022_
We are only scratching the surface of how we can help teams scale their development, and were drastically increasing our R&D time to move even faster on new innovations in build performance and team scaling. Fortunately, we already have a world-class team of top engineers whove helped us build Nx and Nx Cloud, while also helping our customers succeed with Nx. With this new capital, our engineers are able spend significantly more R&D time building industry-changing products and features, while continuing to work with and learn from our Nx Cloud and Nx Enterprise customers.
We are only scratching the surface of how we can help teams scale their development, and we're drastically increasing our R&D time to move even faster on new innovations in build performance and team scaling. Fortunately, we already have a world-class team of top engineers who've helped us build Nx and Nx Cloud, while also helping our customers succeed with Nx. With this new capital, our engineers are able spend significantly more R&D time building industry-changing products and features, while continuing to work with and learn from our Nx Cloud and Nx Enterprise customers.
Well be sharing more exciting announcements soon, so make sure to follow our journey on [@NxDevTools](https://twitter.com/nxdevtools)!
We'll be sharing more exciting announcements soon, so make sure to follow our journey on [@NxDevTools](https://twitter.com/nxdevtools)!
Jeff Cross
CEO, Nx
@@ -2,8 +2,9 @@
title: 'Nx 15.3 — Standalone Projects, Vite, Task Graph and more!'
slug: 'nx-15-3-standalone-projects-vite-task-graph-and-more'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-12-06/VXYjjWhOUpNuHFGCoF63OQ.png'
cover_image: '/blog/images/2022-12-06/VXYjjWhOUpNuHFGCoF63OQ.avif'
tags: [nx, release]
description: Nx 15.3 introduces standalone projects, Vite and Vitest tooling, enhanced task graph visualization, and simplified project adoption, now reaching 3M weekly downloads.
---
What a massive release! Here are all the news 👇
@@ -28,14 +29,14 @@ Prefer **a video version?**
## Funding — Nx raises $8.6M
In case you missed it, we raised $8.6 million a couple of weeks ago. Heres the official blog post from our CEO Jeff: [/blog/from-bootstrapped-to-venture-backed](/blog/from-bootstrapped-to-venture-backed)
In case you missed it, we raised $8.6 million a couple of weeks ago. Here's the official blog post from our CEO Jeff: [/blog/from-bootstrapped-to-venture-backed](/blog/from-bootstrapped-to-venture-backed)
It is exciting for us as we can now have more employees focused on pushing Nx and Nx Cloud forward, which will significantly boost development speed!
For most of our workforce, working on Nx and Nx Cloud was only part of their 20% project. Yet we released terrific features over the last years and have seen tremendous growth with Nx (which brings us to the next section)
For most of our workforce, working on Nx and Nx Cloud was only part of their "20% project". Yet we released terrific features over the last years and have seen tremendous growth with Nx (which brings us to the next section)
## 3 million downloads per week
2022 has been a particularly crazy but successful year for us. And Nxs growth confirms that were on the right track:
2022 has been a particularly crazy but successful year for us. And Nx's growth confirms that we're on the right track:
- January: Nx crosses 1 million downloads per week
- June: Nx crosses 2 million downloads per week
@@ -51,7 +52,7 @@ On to 4 million!
One of our most loved features also just got more powerful: the Nx graph!
Nx already visualizes your project graph, mapping the dependencies different projects have on one another through imports and exports in your code. But your tasks also have a graph. Your task can either depend on another target on the same project, lets say you have a `prebuild`
Nx already visualizes your project graph, mapping the dependencies different projects have on one another through imports and exports in your code. But your tasks also have a graph. Your task can either depend on another target on the same project, let's say you have a `prebuild`
and a `build` target. Whenever you run `build`, you want to run `prebuild` first. Similarly, if your project depends on other projects, you might want to make sure to build them first as well. This is called a [task pipeline](/concepts/task-pipeline-configuration) and can be defined in `nx.json` as follows:
```json5 {% fileName="nx.json" %}
@@ -89,7 +90,7 @@ In 15.3 we are therefore making **standalone projects** a first-class feature. S
![](/blog/images/2022-12-06/z3UOtkyCIKcL2LNg.avif)
In a standalone project setup, you dont have the typical `apps` and `libs` structure you might be accustomed to if you have been using Nx in the past. Instead, the app lives directly at the root of your workspace. The structure looks similar to the following:
In a standalone project setup, you don't have the typical `apps` and `libs` structure you might be accustomed to if you have been using Nx in the past. Instead, the app lives directly at the root of your workspace. The structure looks similar to the following:
```text
e2e/
@@ -136,15 +137,15 @@ package.json
It is really up to you how you want to structure them.
Think of it as a supercharged development tool, providing powerful generators, features like [module boundary rules](/blog/mastering-the-project-boundaries-in-nx) and obviously the ability to run tests, linting, building on individual libraries. Not to forget about Nxs powerful caching ability. And if youre ready for a real monorepo because you want to add multiple applications, there will be paths for you to upgrade to that structure.
Think of it as a supercharged development tool, providing powerful generators, features like [module boundary rules](/blog/mastering-the-project-boundaries-in-nx) and obviously the ability to run tests, linting, building on individual libraries. Not to forget about Nx's powerful caching ability. And if you're ready for a "real" monorepo because you want to add multiple applications, there will be paths for you to "upgrade" to that structure.
## Integrated Vite and Vitest support is here!
Finally! We talked about it; now it is here! Official Vite and Vitest support for Nx-based integrated monorepos and standalone app projects! That adds the Vite community into the Nx family, and weve been chatting with core members there recently, and we love it!
Finally! We talked about it; now it is here! Official Vite and Vitest support for Nx-based integrated monorepos and standalone app projects! That adds the Vite community into the Nx family, and we've been chatting with core members there recently, and we love it!
So before we dive into this: if you are using a package-based monorepo with Nx, you could already use Vite or whatever other technology you want. Nx does just the task scheduling there, running your `package.json` scripts efficiently. Whatever those scripts do "internally" is up to you.
But if you power an integrated setup, youd want more support via a dedicated Nx plugin. And there has already been a [Nx community plugin](/community) created by the folks from [https://nxext.dev/](https://nxext.dev/). Given the high demand for Vite support, we (the Nx core team) started to look into creating and maintaining our own. We reached out to the out [Dominik Piper](https://mobile.twitter.com/dominik_pieper) and [Jordan Hall](https://mobile.twitter.com/JordanHall_dev) from the NxExt team and they were on board from the beginning! We got lots of helpful input, while designing the new Vite plugin. Huge shoutout to them!!
But if you power an integrated setup, you'd want more support via a dedicated Nx plugin. And there has already been a [Nx community plugin](/community) created by the folks from [https://nxext.dev/](https://nxext.dev/). Given the high demand for Vite support, we (the Nx core team) started to look into creating and maintaining our own. We reached out to the out [Dominik Piper](https://mobile.twitter.com/dominik_pieper) and [Jordan Hall](https://mobile.twitter.com/JordanHall_dev) from the NxExt team and they were on board from the beginning! We got lots of helpful input, while designing the new Vite plugin. Huge shoutout to them!!
`@nrwl/vite` (just like `@nrwl/webpack`) is a package that can be integrated as part of other packages. Right now, we're prioritizing our React setup. If you generate a new Nx workspace and choose the new "Standalone React app" version, you will get a React application powered by Vite and Vitest.
@@ -160,7 +161,7 @@ This new setup gives you an easy jumpstart as it does all the configuration for
- Tests with Vitest
- Making sure it nicely works with TypeScript (both in src and spec files)
Open the applications `project.json` to inspect the setup:
Open the application's `project.json` to inspect the setup:
```json
{
@@ -189,7 +190,7 @@ Open the applications `project.json` to inspect the setup:
}
```
Furthermore, theres a `vite.config.ts` at the project root level, which you can further customize to your needs. It is already pre-configured to seamlessly work in a monorepo scenario and has the Vitest setup. Just run `npx nx serve` or `npx nx build` or `npx nx test` to serve, build or test your standalone React app.
Furthermore, there's a `vite.config.ts` at the project root level, which you can further customize to your needs. It is already pre-configured to seamlessly work in a monorepo scenario and has the Vitest setup. Just run `npx nx serve` or `npx nx build` or `npx nx test` to serve, build or test your standalone React app.
If you are currently using the NxExt based Vite plugin, or even a Webpack based Nx React setup, you can easily transition to the new Vite plugin by just running the following generator:
@@ -199,11 +200,11 @@ 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
Many developers dont necessarily start with a greenfield project, but rather have an existing reality where they want to use Nx. Weve been improving this process of adopting Nx over this year to the point where it has never been easier than now!
Many developers don't necessarily start with a greenfield project, but rather have an existing reality where they want to use Nx. We've been improving this process of adopting Nx over this year to the point where it has never been easier than now!
Regardless of whether you have
@@ -228,7 +229,7 @@ Check out our docs for all the details on
- [migrating your CRA project to Nx](/recipes/adopting-nx/adding-to-existing-project)
- [migrating your Angular CLI app to Nx](/recipes/angular/migration/angular)
Oh..youre wondering why you would want to add Nx to an existing non-monorepo project? Then keep reading 👇
Oh..you're wondering why you would want to add Nx to an existing non-monorepo project? Then keep reading 👇
## Adding Nx to an Existing Standalone Project
@@ -243,7 +244,7 @@ npx nx lint
npx nx e2e
```
If your change just modified a couple of spec files, then theres no point on running `build` or `e2e` again, but just `test` and potentially `lint`. Nx can restore the results of the other operations from the cache.
If your change just modified a couple of "spec files", then there's no point on running `build` or `e2e` again, but just `test` and potentially `lint`. Nx can restore the results of the other operations from the cache.
To add Nx to an existing standalone project, all you need to run is
@@ -251,7 +252,7 @@ To add Nx to an existing standalone project, all you need to run is
npx nx@latest init
```
This process will ask you a few questions about which operations are cacheable. We optimized it so that you dont necessarily have to use `nx` to run your build, linting or serving your app. You can keep using `npm run build` or `npm start`. This is because Nx wraps your scripts in the `package.json`. Notice how `build` and `lint` are wrapped because they are cacheable operations.
This process will ask you a few questions about which operations are cacheable. We optimized it so that you don't necessarily have to use `nx` to run your build, linting or serving your app. You can keep using `npm run build` or `npm start`. This is because Nx wraps your scripts in the `package.json`. Notice how `build` and `lint` are wrapped because they are cacheable operations.
```json
{
@@ -270,13 +271,13 @@ 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
{% youtube src="https://www.youtube.com/watch?v=PRURABLaS8s" /%}
Most of the tasks in a workspace run against a specific project, like building or testing it. Thats why they live in the corresponding `package.json` or `project.json`. But sometimes you have workspace-wide commands which you want to run through the "Nx pipeline" to get the benefits of caching.
Most of the tasks in a workspace run against a specific project, like building or testing it. That's why they live in the corresponding `package.json` or `project.json`. But sometimes you have workspace-wide commands which you want to run through the "Nx pipeline" to get the benefits of caching.
Assume you already have a script called `docs` in your root-level `package.json`.
@@ -311,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
@@ -344,7 +345,7 @@ Nx can automatically detect your scripts in `package.json`. But if you have an i
The task itself is handled by an [Nx executor](/extending-nx/recipes/local-executors) that comes with the plugin, in this case `@nrwl/vite:build` to build a Vite project.
To add a custom command, like invoking a node script, Nx has the so-called [run-commands](/recipes/running-tasks/run-commands-executor). So far you had to wrap those commands as follows:
To add a custom command, like invoking a node script, Nx has the so-called ["run-commands"](/recipes/running-tasks/run-commands-executor). So far you had to wrap those commands as follows:
```json5 {% fileName="project.json" %}
{
@@ -383,13 +384,13 @@ For simple commands this was a huge overhead, so we simplified it to just this:
}
```
Simple, isnt 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.
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
Wow, what a launch! But more features are on the way in the coming weeks that didnt make it for this release. Super excited about these, which most prominently include
Wow, what a launch! But more features are on the way in the coming weeks that didn't make it for this release. Super excited about these, which most prominently include
- Workspace watching
- Lock-file pruning
@@ -2,13 +2,14 @@
title: 'Nx 15.4 — Vite 4 Support, a new Nx Watch Command, and more!'
slug: 'nx-15-4-vite-4-support-a-new-nx-watch-command-and-more'
authors: ['Zack DeRose']
cover_image: '/blog/images/2022-12-22/N4_XxtYFr-V2cF6fPoBO3g.png'
cover_image: '/blog/images/2022-12-22/N4_XxtYFr-V2cF6fPoBO3g.avif'
tags: [nx, release]
description: Nx 15.4 adds Vite 4.0 support, new Watch command for file watching, webpack-less Cypress support, SSR for Module Federation, and parallel target execution improvements.
---
Nx just had a massive release 2 weeks ago with Nx 15.3 — if you missed it be sure to check out [our article](/blog/nx-15-3-standalone-projects-vite-task-graph-and-more) featuring some huge improvements including Vite support, Standalone Angular and React presets, and a Task Graph visualization!
But over the past couple of weeks, weve been able to land quite a few awesome features, so were going back at it again releasing Nx 15.4 today, including:
But over the past couple of weeks, we've been able to land quite a few awesome features, so we're going back at it again releasing Nx 15.4 today, including:
- [Vite 4.0 Support](#vite-40-support)
- [Nx Watch](#nx-watch)
@@ -27,11 +28,11 @@ Nx 15.4 brings in the latest Vite major version following the Vite 4 release ear
![](/blog/images/2022-12-22/w-TkOJGLJpif48RN.avif)
As the [Vite launch article](https://vitejs.dev/blog/announcing-vite4.html) mentions, we are investing in the Vite ecosystem, and now officially support a first-party Vite plugin. Nx 15.4 continues this investment with timely support for Vite 4, and were excited to be a part of the Vite ecosystem and a part of bringing more value to our devs through Vite support!
As the [Vite launch article](https://vitejs.dev/blog/announcing-vite4.html) mentions, we are investing in the Vite ecosystem, and now officially support a first-party Vite plugin. Nx 15.4 continues this investment with timely support for Vite 4, and we're excited to be a part of the Vite ecosystem and a part of bringing more value to our devs through Vite support!
Projects already using our [@nrwl/vite plugin](/nx-api/vite) will be automatically upgraded to Vite 4 when they upgrade to the latest Nx version with the `nx migrate` command, and we've also simplified the configuration required to support Vite.
Weve also spent some effort into making the conversion of existing projects to use Vite simpler, including:
We've also spent some effort into making the conversion of existing projects to use Vite simpler, including:
- the ability to choose which targets you want to convert
- enhanced `vite.config.ts` file configuration
@@ -45,7 +46,7 @@ You can check out more details about our Vite plugin including how to add Vite a
{% youtube src="https://youtu.be/0eVplUl1zBE" /%}
Nx 15.4 includes a new feature to support file-watching with Nx! Heres how it works:
Nx 15.4 includes a new feature to support file-watching with Nx! Here's how it works:
Syntax:
@@ -64,9 +65,9 @@ For the projects modifier option:
- you can use `--all` for all projects in the workspace
- or you can filter down to specific projects with the `--projects=[comma separated list of project names]` option that can be used in conjunction with a `--includeDependentProjects` option as well
The `nx watch` command will support the variables `$NX_PROJECT_NAME` and `$NX_CHANGED_FILES`. This feature opens the door for nice developer workflows where we can provide an out-of-the-box mechanism for Nx to run relevant tasks on save, and were excited to see our users get their hands on this feature.
The `nx watch` command will support the variables `$NX_PROJECT_NAME` and `$NX_CHANGED_FILES`. This feature opens the door for nice developer workflows where we can provide an out-of-the-box mechanism for Nx to run relevant tasks on save, and we're excited to see our users get their hands on this feature.
Personally, Im excited to use the following command:
Personally, I'm excited to use the following command:
```shell
npx -c 'nx watch all npx nx affected --target=test --files=$NX_FILE_CHANGES'
@@ -81,7 +82,7 @@ Check out [our docs](/recipes/running-tasks/workspace-watching) for more details
![](/blog/images/2022-12-22/wF2QV3h_G5ZjBfLK.avif)
_Running e2e with React Standalone Projects_
We added a React Standalone preset in 15.3 to support single react application workspaces with Nx, and in 15.4, weve added back in Cypress for this preset.
We added a React Standalone preset in 15.3 to support single react application workspaces with Nx, and in 15.4, we've added back in Cypress for this preset.
With Nx 15.4, a standalone React application will be created with an e2e directory preconfigured and optimized for running Cypress with the command `npx nx e2e e2e` as soon as your initial workspace is generated.
@@ -93,7 +94,7 @@ Now you can get the benefits of both Server Side Rendering and Module Federation
Our existing `host` and `remote` Module Federation generators have an added `--ssr` flag that will enable Server-Side Rendering by generating the correct server files.
Weve also added a new executor to allow you to serve the host server locally, along with all remote servers from a single command.
We've also added a new executor to allow you to serve the host server locally, along with all remote servers from a single command.
Learn more about this new feature [in our docs](/recipes/react/module-federation-with-ssr)!
@@ -117,13 +118,13 @@ npx nx run-many --target test build lint --projects "domain-products-*"
## Interactive Prompts for Custom Preset
Last but not least, weve added support for interactive prompts for Custom Presets!
Last but not least, we've added support for interactive prompts for Custom Presets!
In Nx, [presets](/extending-nx/recipes/create-preset#create-a-custom-plugin-preset) are special code generation scripts that can be used to create a brand new Nx Workspace, using our `create-nx-workspace` command.
![](/blog/images/2022-12-22/d4gI6k61RAEU_XfF.avif)
For instance, I happen to know [Shai Reznik](https://twitter.com/shai_reznik) at [builder.io](https://builder.io/) has been working on a qwik plugin for Nx, and since the [qwik-nx](https://www.npmjs.com/package/qwik-nx) plugin that hes published includes an [Nx generator called preset](https://github.com/qwikifiers/qwik-nx/blob/main/packages/qwik-nx/generators.json#L33), I can run the command:
For instance, I happen to know [Shai Reznik](https://twitter.com/shai_reznik) at [builder.io](https://builder.io/) has been working on a qwik plugin for Nx, and since the [qwik-nx](https://www.npmjs.com/package/qwik-nx) plugin that he's published includes an [Nx generator called "preset"](https://github.com/qwikifiers/qwik-nx/blob/main/packages/qwik-nx/generators.json#L33), I can run the command:
```shell
npx nx create-nx-workspace preset=qwik-nx
@@ -131,11 +132,11 @@ npx nx create-nx-workspace preset=qwik-nx
As we can see, the preset option matches the name of the published npm package.
This custom preset feature has been around for a while, but as of 15.4 weve added support for these custom presets to interactively prompt the user following the initial installation step!
This custom preset feature has been around for a while, but as of 15.4 we've added support for these custom presets to interactively prompt the user following the initial installation step!
This should open up some powerful functionality for plugin and package authors to parameterize their code generation scripts with Nx, and were excited to see folks like [Shai](https://twitter.com/shai_reznik), [builder.io](https://builder.io/), and [qwik](https://qwik.builder.io/) leverage this new feature!
This should open up some powerful functionality for plugin and package authors to parameterize their code generation scripts with Nx, and we're excited to see folks like [Shai](https://twitter.com/shai_reznik), [builder.io](https://builder.io/), and [qwik](https://qwik.builder.io/) leverage this new feature!
## Thats it for this release.
## That's it for this release.
Follow us on our socials and on [Youtube](https://www.youtube.com/channel/UCF8luR7ORJTCwSNA9yZksCw) to make sure to see more news and releases as we announce them!
@@ -2,8 +2,9 @@
title: 'Setting up Module Federation with Server-Side Rendering for Angular'
slug: 'setting-up-module-federation-with-server-side-rendering-for-angular'
authors: ['Colum Ferry']
cover_image: '/blog/images/2023-01-10/kyMChnJ-X6jK9sbuaOdOiw.png'
cover_image: '/blog/images/2023-01-10/kyMChnJ-X6jK9sbuaOdOiw.avif'
tags: [nx, tutorial]
description: Learn how to implement Webpack Module Federation with Server-Side Rendering in Angular applications using Nx for improved performance and micro-frontend architecture.
---
[Module Federation](https://webpack.js.org/plugins/module-federation-plugin/) is a technology provided by [Webpack](https://webpack.js.org/) that enables modules to be federated across different origins at runtime. This means that Webpack will simply ignore these modules at build time, expecting them to be available to be fetched across the network at runtime.
@@ -29,7 +30,7 @@ A traditional SSR application is rendered on the server. It receives the request
![](/blog/images/2023-01-10/ZqG4jdD8DaqmG_It.avif)
With Module Federation and SSR, it takes that concept and the concept of MF to allow portions of the app to be run on their own server. The host server will receive the route and if its a route pointing to a remote, it will ask the remote to process the route, then send the rendered HTML to the browser.
With Module Federation and SSR, it takes that concept and the concept of MF to allow portions of the app to be run on their own server. The host server will receive the route and if it's a route pointing to a remote, it will ask the remote to process the route, then send the rendered HTML to the browser.
![](/blog/images/2023-01-10/eQis_bQnsj-MToCa.avif)
@@ -37,13 +38,13 @@ This gives us full power of SSR but also still allowing us to break our build in
## Example
Lets walk through how to set this up with Nx for Angular. We will generate a host application (dashboard) and a remote application (login).
Let's walk through how to set this up with Nx for Angular. We will generate a host application (dashboard) and a remote application (login).
```shell
npx create-nx-workspace@latest myorg
```
Youll be prompted for the type of workspace you want to create, and the preset to use.
You'll be prompted for the type of workspace you want to create, and the preset to use.
Answer with the following:
@@ -51,7 +52,7 @@ Answer with the following:
✔ What to create in the new workspace · apps
✔ Enable distributed caching to make your CI faster · No
> _You will also be prompted whether to add Nx Cloud to your workspace. We wont address this in this article, but it is highly recommended to use this along with Module Federation to allow for the cache of your remote applications to be shared amongst teammates and CI, further improving your build times. You can learn more about Nx Cloud here:_ [_https://nx.app_](https://nx.app/)_._
> _You will also be prompted whether to add Nx Cloud to your workspace. We won't address this in this article, but it is highly recommended to use this along with Module Federation to allow for the cache of your remote applications to be shared amongst teammates and CI, further improving your build times. You can learn more about Nx Cloud here:_ [_https://nx.app_](https://nx.app/)_._
When your workspace is created, run `cd myorg`.
@@ -91,11 +92,11 @@ Compiled successfully.
\*\* Angular Universal Live Development Server is listening on http://localhost:4200, open your browser on http://localhost:4200 \*\*
```
Lets open a new tab in our browser, and open Network tab in the DevTools. After this, navigate to [http://localhost:4200](http://localhost:4200/). You should see the following:
Let's open a new tab in our browser, and open Network tab in the DevTools. After this, navigate to [http://localhost:4200](http://localhost:4200/). You should see the following:
![](/blog/images/2023-01-10/3irxzNENB79JiQmR.avif)
The most interesting piece here is the first entry in the network log. Lets look at it more closely:
The most interesting piece here is the first entry in the network log. Let's look at it more closely:
![](/blog/images/2023-01-10/Ikvgk8dF8rKmutTY.avif)
@@ -103,15 +104,15 @@ We can see that the server returned the fully rendered HTML for the page!
Angular Universal will switch to CSR after the initial page load, which means if we were to click on the `login` link, it would use CSR to render that page. The Angular Module that is resolved and rendered still lives on the remote server, but Module Federation will still resolve this correctly! 🔥
But to see where the real magic happens, lets manually navigate the browser to [http://localhost:4200/login](http://localhost:4200/login). You should see that in the Network tab, the fully rendered HTML for the login page has been returned!
But to see where the real magic happens, let's manually navigate the browser to [http://localhost:4200/login](http://localhost:4200/login). You should see that in the Network tab, the fully rendered HTML for the login page has been returned!
Despite the code for that page living on a different, remote, server, the host server composed it correctly and was still able to return the correct HTML for that route, thanks to Module Federation!
And thats it! Its super simple to get Module Federation and SSR up and running with Nx!
And that's it! It's super simple to get Module Federation and SSR up and running with Nx!
## Serving the login application and watching for changes
If youre working on the login application, and are iteratively checking the results of your changes, youll want the server to rebuild when you make your change. You can easily enable that by using the `devRemotes` flag::
If you're working on the login application, and are iteratively checking the results of your changes, you'll want the server to rebuild when you make your change. You can easily enable that by using the `devRemotes` flag::
```shell
npx nx serve-ssr dashboard --devRemotes=login
@@ -2,11 +2,12 @@
title: 'React, Vite and TypeScript: Get started in under 2 minutes'
slug: 'react-vite-and-typescript-get-started-in-under-2-minutes'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-01-12/ucL7YQ2v8aaOy426soLPZA.png'
cover_image: '/blog/images/2023-01-12/ucL7YQ2v8aaOy426soLPZA.avif'
tags: [nx]
description: Learn how to quickly set up a modern React application with Vite and TypeScript using Nx, featuring built-in testing, linting, and development tools.
---
Lets be honest. Dealing with tooling is not something enjoyable if you have to deliver code. It should just work and not be in the way. So lets explore how to kickstart your next React project using Vite, in under 2 minutes, without worrying about the setup.
Let's be honest. Dealing with tooling is not something enjoyable if you have to deliver code. It should just work and not be in the way. So let's explore how to kickstart your next React project using Vite, in under 2 minutes, without worrying about the setup.
## Table of Contents
@@ -29,7 +30,7 @@ Lets be honest. Dealing with tooling is not something enjoyable if you have t
{% youtube src="https://youtu.be/fkTz6KJxhhE" /%}
Traditionally, you might lean towards [Create-React-App (CRA)](https://create-react-app.dev/) started to do precisely that. But what if I told you theres a better alternative, providing
Traditionally, you might lean towards [Create-React-App (CRA)](https://create-react-app.dev/) started to do precisely that. But what if I told you there's a better alternative, providing
- not just scaffolding for the initial setup but helping you along the way to generate components, routing, etc
- automatically sets you up with best practices tools for e2e testing, unit testing, code formatting, and linting
@@ -38,14 +39,14 @@ Traditionally, you might lean towards [Create-React-App (CRA)](https://create-re
- helps you modularize your application
- comes with automated upgrade features to keep your tooling evergreen
Im talking about Nx. Nx comes with a set of plugins that come with code generation abilities and help abstract some of the lower-level tooling setups. And this can be really interesting for the use case we wanna tackle today.
I'm talking about Nx. Nx comes with a set of plugins that come with code generation abilities and help abstract some of the lower-level tooling setups. And this can be really interesting for the use case we wanna tackle today.
> **_Reader:_** _Wait a minute, I heard about Nx. Isnt that for monorepos?_**_Me:_** _Yeah youre right. But in 15.3 they introduced something called standalone apps’”
> Reader: Standalone?
> _**_Me:_** _Yeah, a fancy term for a setting up a single app and allows for some cool modularization. Theres a video introducing that feature here:_ [_https://youtu.be/qEaVzh-oBBc_](https://youtu.be/qEaVzh-oBBc)_"
> _**_Reader:_** _ha, interesting 🤔_
> **_Reader:_** _"Wait a minute, I heard about Nx. Isn't that for monorepos?"_**_Me:_** _"Yeah you're right. But in 15.3 they introduced something called 'standalone apps'"
> Reader: "Standalone?"
> _**_Me:_** _"Yeah, a fancy term for a setting up a single app and allows for some cool modularization. There's a video introducing that feature here:_ [_https://youtu.be/qEaVzh-oBBc_](https://youtu.be/qEaVzh-oBBc)_"
> _**_Reader:_** _"ha, interesting 🤔"_
So lets go and set up our **React + Vite + TypeScript project**.
So let's go and set up our **React + Vite + TypeScript project**.
## How do I create a new project setup?
@@ -65,13 +66,13 @@ And then choose the option you prefer in the terminal prompt:
![](/blog/images/2023-01-12/WceoJTEWec2ZTp5X.avif)
In the end, what youll get is the following structure:
In the end, what you'll get is the following structure:
![](/blog/images/2023-01-12/mykjIRKX-a5VtyQl.avif)
## Running, building and testing the app
First off, lets run our new, shiny application. Just invoke
First off, let's run our new, shiny application. Just invoke
```
npm start
@@ -158,7 +159,7 @@ npx nx test
You might have noticed the `e2e` folder. That's a fully-functioning setup of [Cypress](https://cypress.io/) for doing integration-level or even full end-to-end tests.
This is excellent because you dont have to configure anything at all. No need to
This is excellent because you don't have to configure anything at all. No need to
- Cypress configured to use Vite (instead of Webpack)
- set up linting for the e2e project (yes writing good quality test code is just as important)
@@ -199,7 +200,7 @@ This might look weird initially, but basically, we run the `e2e` target (see `e2
By default, these tests run in headless mode, but you can pass `--watch` to run it interactively with the Cypress test runner such that the tests get re-executed whenever we change our source.
> _Want Cypress Component testing? Theres an Nx generator that can help set that up. Check out the docs:_ [_/nx-api/react/generators/cypress-component-configuration_](/nx-api/react/generators/cypress-component-configuration)
> _Want Cypress Component testing? There's an Nx generator that can help set that up. Check out the docs:_ [_/nx-api/react/generators/cypress-component-configuration_](/nx-api/react/generators/cypress-component-configuration)
## Linting
@@ -209,7 +210,7 @@ And similarly, linting can be triggered by running the following command:
npx nx lint
```
Theres a `.eslintrc.json` file already at the workspace's root that contains some best practices rules.
There's a `.eslintrc.json` file already at the workspace's root that contains some best practices rules.
## Customize Vite and Vitest
@@ -250,7 +251,7 @@ Nx is known for its caching that helps optimize the speed in monorepos. Caching
![](/blog/images/2023-01-12/Af7lMrhaO0gcIUeY.avif)
On every run, Nx compares that hash against a local cache folder. If the hash exists, Nx restores the command line output and potential artifacts (JS, CSS,… files) produced by a previous run. This helps speed up computation because you dont run it if you dont need to.
On every run, Nx compares that hash against a local cache folder. If the hash exists, Nx restores the command line output and potential artifacts (JS, CSS,… files) produced by a previous run. This helps speed up computation because you don't run it if you don't need to.
> _See Nx the docs for more info:_ [_/concepts/how-caching-works_](/concepts/how-caching-works)
@@ -269,7 +270,7 @@ Imagine a storefront application. You will probably have domain areas like
- User Profile — which manages everything user related. Think of it when you access Amazon and go to your account. Things like managing your addresses
- …
Were just scratching the surface here. This can become big quickly. The only way to manage such a structure with the current tooling (including CRA) is to organize these domains in folders. So youd have something like this in a CRA setup:
We're just scratching the surface here. This can become big quickly. The only way to manage such a structure with the current tooling (including CRA) is to organize these domains in folders. So you'd have something like this in a CRA setup:
```
cra-app
@@ -301,13 +302,13 @@ cra-app
Most devtools (including CRA) force you into a monolithic structure, where you divide your features into folders. Folders are limited in terms of isolation, though; as your application grows, this might quickly go out of hand.
We can impose a different, stronger structure with Nx by extracting these areas into dedicated libraries or modules. These live side-by-side with your application. Lets say we have a folder named domains which contains these domain areas. Then you can easily generate a new library with the following command:
We can impose a different, stronger structure with Nx by extracting these areas into dedicated libraries or modules. These live side-by-side with your application. Let's say we have a folder named "domains" which contains these domain areas. Then you can easily generate a new library with the following command:
```shell
npx nx g @nrwl/react:lib checkout --directory=domains/orders/checkout --bundler=none
```
The above command creates a new checkout library in the `domains/orders/` folder. Here's what it looks like:
The above command creates a new " checkout " library in the `domains/orders/` folder. Here's what it looks like:
```
awesomereactapp
@@ -360,7 +361,7 @@ When generating the library, a TypeScript path mapping is automatically created
}
```
In this way, anything thats being exported from the `checkout` library can be consumed like
In this way, anything that's being exported from the `checkout` library can be consumed like
```typescript
import { SomeComponent } from '@awesomereactapp/domains/orders/checkout';
@@ -386,7 +387,7 @@ npx nx graph
![](/blog/images/2023-01-12/lQqPKUstJg1JHD-f.avif)
It becomes even more interesting if you select the Group by folder checkbox as the domains become visible at that point:
It becomes even more interesting if you select the "Group by folder" checkbox as the domains become visible at that point:
![](/blog/images/2023-01-12/5s3J449vgsfYVLkL.avif)
@@ -394,9 +395,9 @@ It becomes even more interesting if you select the “Group by folder” checkbo
## Hidden gem: Guard your boundaries
Scaling a software product is more than just the initial structuring and modularization. It consists of a constant ongoing process of ensuring modules stay in shape and dont contain any undesired cross-references or circular dependencies. You could leverage the Nx graph to verify that visually, but that doesnt scale.
Scaling a software product is more than just the initial structuring and modularization. It consists of a constant ongoing process of ensuring modules stay in shape and don't contain any undesired cross-references or circular dependencies. You could leverage the Nx graph to verify that visually, but that doesn't scale.
To help with that, Nx has a built-in [module boundary lint rule](/features/enforce-module-boundaries). Projects can be assigned tags, like `type:domain`, `type:utils`, `type:shared` and `domain:products`, `domain:orders`, `domain:auth`. These tags can be assigned in the `project.json`, like
To help with that, Nx has a built-in [module boundary lint rule](/features/enforce-module-boundaries). Projects can be assigned "tags", like `type:domain`, `type:utils`, `type:shared` and `domain:products`, `domain:orders`, `domain:auth`. These tags can be assigned in the `project.json`, like
```json
{
@@ -441,13 +442,13 @@ In the `.eslintrc.base.json` you can then define the rules. Here for instance we
If some of these lint rules need to be followed, your editor will show it right in your code, and you can also run lint checks for each PR on CI.
If youre curious, you can read more [here](/blog/mastering-the-project-boundaries-in-nx).
If you're curious, you can read more [here](/blog/mastering-the-project-boundaries-in-nx).
## Hidden gem: Just run what changed
In such a modular structure (as shown above) where your code is organized in smaller modules/libraries, it is very common that a given team member just works within a single domain area. Hence, very often PRs just touch a subset of the entire set of libraries. Nx comes with a backed-in command that allows you to take advantage of that on CI, using the so-called [affected commands](/ci/features/affected).
In such a modular structure (as shown above) where your code is organized in smaller modules/libraries, it is very common that a given team member just works within a single domain area. Hence, very often PRs just touch a subset of the entire set of libraries. Nx comes with a backed-in command that allows you to take advantage of that on CI, using the so-called "[affected commands](/ci/features/affected)".
Lets say we make a change in the `product-detail` library of our application. This would affect all other libraries that depend on it. You can also visualize it by running
Let's say we make a change in the `product-detail` library of our application. This would affect all other libraries that depend on it. You can also visualize it by running
```shell
npx nx affected:graph
@@ -469,7 +470,7 @@ npx nx affected:test
## Hidden gem: A dedicated Editor extension
If you are not the command line interface type developer and youd rather prefer something integrated within your IDE, then theres good news. The Nx core team also ships a dedicated VSCode extension: [Nx Console](/getting-started/editor-setup).
If you are not the "command line interface type" developer and you'd rather prefer something integrated within your IDE, then there's good news. The Nx core team also ships a dedicated VSCode extension: [Nx Console](/getting-started/editor-setup).
It has a dedicated view within VSCode to trigger common commands, browse the workspace structure and even inline render the graph.
@@ -479,7 +480,7 @@ It also comes with contextual menus to quickly access most of the commonly used
![](/blog/images/2023-01-12/0wOJ7DPKcNV25D-V.avif)
Heres a walkthrough video showing some of the powerful capabilities of Nx Console:
Here's a walkthrough video showing some of the powerful capabilities of Nx Console:
{% youtube src="https://youtu.be/ZST_rmhzRXI" /%}
@@ -503,7 +504,7 @@ Read more about how [Nx migrations work](/features/automate-updating-dependencie
## Using CRA? Automatically migrate to Vite + Nx
If youre currently on a [CRA](https://create-react-app.dev/) setup, you can easily migrate to an Nx + React + Vite-based setup by running the following command in your CRA project:
If you're currently on a [CRA](https://create-react-app.dev/) setup, you can easily migrate to an Nx + React + Vite-based setup by running the following command in your CRA project:
{% youtube src="https://youtu.be/zvYb7XCLQzU" /%}
@@ -2,19 +2,20 @@
title: 'Nx Console meets Nx Cloud'
slug: 'nx-console-meets-nx-cloud'
authors: ['Max Kless']
cover_image: '/blog/images/2023-01-18/Mkqkadhkk7DydWvPg5L0bA.png'
cover_image: '/blog/images/2023-01-18/Mkqkadhkk7DydWvPg5L0bA.avif'
tags: [nx]
description: Nx Console 17.28.0 integrates Nx Cloud features directly into VSCode, bringing remote caching, distributed task execution, and VCS integration with streamlined setup.
---
We just released Nx Console 17.28.0 and it comes with a huge new feature: Nx Cloud Integration, right in VSCode! 🎉
In case youre not sure what it does, Nx Cloud takes your Nx workspace to the next level with awesome features like:
In case you're not sure what it does, Nx Cloud takes your Nx workspace to the next level with awesome features like:
- **Remote Caching** — share your Nx cache with your coworkers and CI agents. By using Nx Cloud, you can be sure that no computation is done twice — throughout your company.
- **Distributed Task Execution** — the most important feature for truly scaling up repositories. Nx already knows about your project graph and what tasks depend on each other. With Nx Cloud, you can leverage this knowledge to distribute tasks smartly across multiple agents while making sure that everything is run in the correct sequence. This can speed up your CI times by orders of magnitude!
- **VCS \[version control system\]** **Integration** — see the results of your CI runs right on your pull request! Nx Cloud can talk to GitHub and other version control systems in real-time, giving you an overview of successes and failures as they happen.
And the best part? Its free! You wont pay anything for the first 500 hours of computation time saved per month. If you exceed 500 hours of computation saved, you can buy more; in the worst case, caching stops until the next month. For open-source projects, its free even beyond that. 😍
And the best part? It's free! You won't pay anything for the first 500 hours of computation time saved per month. If you exceed 500 hours of computation saved, you can buy more; in the worst case, caching stops until the next month. For open-source projects, it's free even beyond that. 😍
Head over to [http://nx.dev/nx-cloud](/nx-cloud) to learn more.
@@ -24,7 +25,7 @@ Head over to [http://nx.dev/nx-cloud](/nx-cloud) to learn more.
## Show me the new features already!
Now that were caught up, lets look at how Nx Console will make connecting to and working with Nx Cloud even easier.
Now that we're caught up, let's look at how Nx Console will make connecting to and working with Nx Cloud even easier.
To follow along, ensure you have installed the latest Nx Console version:
[Nx Console — Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)
@@ -33,7 +34,7 @@ In the Nx sidebar, you will see a new Nx Cloud section.
![](/blog/images/2023-01-18/JHNQd88EKmPVfnWBRqSidQ.avif)
If your workspace is not using Nx Cloud, click the Set up Nx Cloud button to set up the cloud runner automatically.
If your workspace is not using Nx Cloud, click the "Set up Nx Cloud" button to set up the cloud runner automatically.
You will see that some changes happen in your `nx.json`:
@@ -53,15 +54,15 @@ You will see that some changes happen in your `nx.json`:
}
```
**Thats it. You can now use Remote Caching and Distributed Task Execution (DTE). 🎉**
**That's it. You can now use Remote Caching and Distributed Task Execution (DTE). 🎉**
## Running your first task
Lets try it out! Select a task to run and see the results in the run list. You can get an even more detailed breakdown in the Nx Cloud web app.
Let's try it out! Select a task to run and see the results in the run list. You can get an even more detailed breakdown in the Nx Cloud web app.
![](/blog/images/2023-01-18/hFG4lqGwEYV3imSFATeKog.avif)
If you rerun the same task, you can see that the time it took to complete is under a second. This is because of Nxs [advanced computation caching](/features/cache-task-results). Whenever a task is executed, Nx caches it. If the task has been run before, it just restores the result from the cache. By default, this cache is local to your own workstation. However, with Nx Cloud, you can distribute and share it between machines.
If you rerun the same task, you can see that the time it took to complete is under a second. This is because of Nx's [advanced computation caching](/features/cache-task-results). Whenever a task is executed, Nx caches it. If the task has been run before, it just restores the result from the cache. By default, this cache is local to your own workstation. However, with Nx Cloud, you can distribute and share it between machines.
![](/blog/images/2023-01-18/kMKh30ojVJC-hSkZA5c46A.avif)
@@ -73,31 +74,31 @@ To learn more about Nx Cloud access tokens, head over to the docs: [Access Token
## Claiming your workspace
If youve just started using Nx Cloud, you will probably see this message prompting you to claim your workspace:
If you've just started using Nx Cloud, you will probably see this message prompting you to claim your workspace:
![](/blog/images/2023-01-18/vNRM1u3J5dixcXjoJWkHLQ.avif)
Out of the box, Nx Cloud works without the need to register. It is, however, highly recommended to create an account and associate it with your workspace. This process is called _claiming your workspace_ and has become much easier with Nx Console! After claiming, you can take full control of your cloud workspace, manage access restrictions and other settings.
Just click on Login and claim your workspace to be redirected to the browser where you can sign in to Nx Cloud or create an account. After successful authentication, you will come back to VSCode, where you can select one of your organizations and connect your workspace to it.
Just click on 'Login and claim your workspace' to be redirected to the browser where you can sign in to Nx Cloud or create an account. After successful authentication, you will come back to VSCode, where you can select one of your organizations and connect your workspace to it.
From now on, Nx Console will be able to make authenticated requests to the cloud API, so even if you choose to make your workspace private, logged-in users that are authorized to access it can do so.
## Distributed Task Execution
Distributed Task Execution (DTE) becomes very important as your workspace grows. With Nx, powerful features like [computation caching](http://√) and [affected analysis](/ci/features/affected) help you drastically cut down your CI times. Most of the time, large parts of your codebase will not need to be rebuilt and retested. However, we also have to consider the worst-case-scenarios. Lets say you do change a core lib that everything in your monorepo depends on. This could mean hundreds or even thousands of projects needing to be rebuilt and retested, which would mean hours of CI time. This is obviously very impractical and you should consider solutions that allow you to parallelize all this work and keep worst-case CI times at a reasonable level. [There are different approaches to achieving this](/ci/concepts/parallelization-distribution) but its hard to get right and not something most teams want to spend engineering resources on.
Distributed Task Execution (DTE) becomes very important as your workspace grows. With Nx, powerful features like [computation caching](http://√) and [affected analysis](/ci/features/affected) help you drastically cut down your CI times. Most of the time, large parts of your codebase will not need to be rebuilt and retested. However, we also have to consider the worst-case-scenarios. Let's say you do change a core lib that everything in your monorepo depends on. This could mean hundreds or even thousands of projects needing to be rebuilt and retested, which would mean hours of CI time. This is obviously very impractical and you should consider solutions that allow you to parallelize all this work and keep worst-case CI times at a reasonable level. [There are different approaches to achieving this](/ci/concepts/parallelization-distribution) but it's hard to get right and not something most teams want to spend engineering resources on.
![](/blog/images/2023-01-18/EZhpRG2t-vp8Y7pGNnuRpA.avif)
Distributed Task Execution with Nx Cloud solves this issue — it allows you to optimally parallelize tasks without thinking about their interdependencies or agent management. You dont have to use it immediately, but its useful if you want to keep your CI times low even as your workspace grows. 🚀
Distributed Task Execution with Nx Cloud solves this issue — it allows you to optimally parallelize tasks without thinking about their interdependencies or agent management. You don't have to use it immediately, but it's useful if you want to keep your CI times low even as your workspace grows. 🚀
DTE is available for all Nx Cloud workspaces with minimal setup. If you see a yellow DTE status in Nx Console, that just means you havent used it yet. [Check out the docs](/ci/features/distribute-task-execution) to [learn more about the motivation for DTE](/ci/concepts/parallelization-distribution) and [how to test it out in your workspace](/ci/features/distribute-task-execution).
DTE is available for all Nx Cloud workspaces with minimal setup. If you see a yellow DTE status in Nx Console, that just means you haven't used it yet. [Check out the docs](/ci/features/distribute-task-execution) to [learn more about the motivation for DTE](/ci/concepts/parallelization-distribution) and [how to test it out in your workspace](/ci/features/distribute-task-execution).
![](/blog/images/2023-01-18/T-GAMsmUCVVeO2ZCGuO3WA.avif)
## VCS Integration
Nx Cloud isnt just great for its remote caching and DTE features, it also generates readable and searchable reports for any executed tasks — whether it be 10 or 10.000. In a monorepo, your CI pipelines will seldom run just a single task. Its more common to have commands like `nx affected — -target=build` which amounts to rebuild everything that changed. This could potentially be dozens, hundreds or thousands of tasks. If something goes wrong, combing through thousands upon thousands of lines of logs quickly becomes tedious. So having a nicely structured, per-target view that you can filter and sort while still preserving all terminal styling is incredibly useful!
Nx Cloud isn't just great for its remote caching and DTE features, it also generates readable and searchable reports for any executed tasks — whether it be 10 or 10.000. In a monorepo, your CI pipelines will seldom run just a single task. It's more common to have commands like `nx affected — -target=build` which amounts to "rebuild everything that changed". This could potentially be dozens, hundreds or thousands of tasks. If something goes wrong, combing through thousands upon thousands of lines of logs quickly becomes tedious. So having a nicely structured, per-target view that you can filter and sort while still preserving all terminal styling is incredibly useful!
![](/blog/images/2023-01-18/i-eyF1ED2_mBkB1A_4piqg.avif)
@@ -2,11 +2,12 @@
title: 'Configuration Files and Potholes in Your Codebase'
slug: 'configuration-files-and-potholes-in-your-codebase'
authors: ['Isaac Mann']
cover_image: '/blog/images/2023-01-31/T-xiDccBOxMQpDrG.png'
cover_image: '/blog/images/2023-01-31/T-xiDccBOxMQpDrG.avif'
tags: [nx]
description: A guide to managing configuration files effectively in modern development, exploring Nx's approach to infrastructure code maintenance through generators and migrations.
---
Lets talk about configuration. The detractors call it boilerplate while proponents call it scaffolding or infrastructure. No matter what your feelings are, configuration code is all the setup that needs to be done before you can work on the features that actually accomplish something for your business. Like road maintenance, infrastructure code is often unnoticed when it is done well, but as soon as problems crop up, everyone feels the pain. How can this crucial configuration code be effectively maintained without dragging down the productivity of your development team?
Let's talk about configuration. The detractors call it boilerplate while proponents call it scaffolding or infrastructure. No matter what your feelings are, configuration code is all the setup that needs to be done before you can work on the features that actually accomplish something for your business. Like road maintenance, infrastructure code is often unnoticed when it is done well, but as soon as problems crop up, everyone feels the pain. How can this crucial configuration code be effectively maintained without dragging down the productivity of your development team?
## Less Configuration
@@ -22,9 +23,9 @@ Parcel advertises itself as a zero configuration bundler. This is mostly a react
![](/blog/images/2023-01-31/sWVhhyftTBiuMef.avif)
Apple also leveraged this sentiment with marketing slogan It Just Works. Compared to Windows or Linux ecosystems that require modifying settings to get software from different companies to work together, Apple provides its own suite of tools and hardware that have a major selling point of being intentionally designed to all work together. Theoretically, any hardware or software produced by Apple should fit seamlessly into the rest of the system.
Apple also leveraged this sentiment with marketing slogan "It Just Works". Compared to Windows or Linux ecosystems that require modifying settings to get software from different companies to work together, Apple provides its own suite of tools and hardware that have a major selling point of being intentionally designed to all work together. Theoretically, any hardware or software produced by Apple should fit seamlessly into the rest of the system.
All of these efforts to skip the configuration step reach their limits at some point. The idea of hiding default configuration works well, until you need to modify that default and have no starting point. The Zen of Python philosophy of explicit is better than implicit is a direct contradiction to Convention over Configuration. If you like most of what the zero config tool gives you, but you want to tweak it a little bit, it can be hard to find where to do the tweaking. Apple is great when It Just Works. But sometimes, It Just Doesnt.
All of these efforts to skip the configuration step reach their limits at some point. The idea of hiding default configuration works well, until you need to modify that default and have no starting point. The Zen of Python philosophy of "explicit is better than implicit" is a direct contradiction to Convention over Configuration. If you like most of what the zero config tool gives you, but you want to tweak it a little bit, it can be hard to find where to do the tweaking. Apple is great when It Just Works. But sometimes, It Just Doesn't.
![](/blog/images/2023-01-31/8f5YjBkc6SqPBA5E.avif)
@@ -32,13 +33,13 @@ All of these efforts to skip the configuration step reach their limits at some p
When your application is just getting started or when the configuration defaults work just fine for you, any time spent writing those defaults is wasted time and mental space. This applies to default configuration for initializing a project as well as default configuration for adding a new route or component in your application. When a developer is starting a new project or feature, we want their initial burst of energy to go as much as possible toward code that is valuable for the business, rather than code that is just infrastructure.
On the other hand, when the infrastructure code needs to be modified to make your application faster or modify the way the app behaves in some way, that infrastructure code needs to be easily accessible and clearly organized so that developers dont need to understand everything about the system before they can change a single part.
On the other hand, when the infrastructure code needs to be modified to make your application faster or modify the way the app behaves in some way, that infrastructure code needs to be easily accessible and clearly organized so that developers don't need to understand everything about the system before they can change a single part.
## Skip the Scaffolding
A cursory glance at the repos on Github will reveal numerous starter repos that people use to bypass the initial time investment involved in setting up the initial configuration files. Yeoman was a tool used to help generate scaffolding code, both for starting a project and for creating new sections of an application.
The problem with both of these tools is that any code they generate for you is instantly technical debt. By definition, no one in your company wrote the code that was created by those tools. But developers in your company will now have to maintain this code that they didnt write. Even if the starter project or Yeoman generator was well maintained and always used the latest state of art practices, any application built using them will only be state of the art the instant its created. The infrastructure code grows stale without constant maintenance.
The problem with both of these tools is that any code they generate for you is instantly technical debt. By definition, no one in your company wrote the code that was created by those tools. But developers in your company will now have to maintain this code that they didn't write. Even if the starter project or Yeoman generator was well maintained and always used the latest state of art practices, any application built using them will only be state of the art the instant its created. The infrastructure code grows stale without constant maintenance.
## Nx Generators and Migration Generators
@@ -50,7 +51,7 @@ Nx has an elegant solution to this dilemma. There are three key parts.
2. Modify those configuration files whenever your application needs some custom setting
3. Run [migration generators](/features/automate-updating-dependencies) to maintain state of the art defaults
If you never think about a configuration file is it still technical debt? Some people are put off by the number of configuration files that Nx generates when creating a new application. Perhaps these developers have been burned by starter repos burdening them with instant technical debt that must be maintained. These config files are created only for the eventuality that some day youll need to modify them.
If you never think about a configuration file is it still technical debt? Some people are put off by the number of configuration files that Nx generates when creating a new application. Perhaps these developers have been burned by starter repos burdening them with instant technical debt that must be maintained. These config files are created only for the eventuality that some day you'll need to modify them.
When you do need to modify a setting for Webpack, Vite or Jest (or any of the other tools for which we maintain plugins) the configuration file provides you an easy access point to make your own modifications without needing to understand all the default settings.
@@ -58,13 +59,13 @@ Every Nx plugin provides migration generators that will automatically update the
## One Size Never Fits All
While the generators that Nx provides work for most people, there will always be infrastructure that is unique to your own organization. Nx makes it easy to extend generators so that your developers can use generators that create code that has been tailored to your own organizations set up. Instead of having a manual check list to run through every time a developer makes a new feature, you can automate that check list with a generator.
While the generators that Nx provides work for most people, there will always be infrastructure that is unique to your own organization. Nx makes it easy to extend generators so that your developers can use generators that create code that has been tailored to your own organization's set up. Instead of having a manual check list to run through every time a developer makes a new feature, you can automate that check list with a generator.
## Negative Configuration?
Nx provides the ability to define default configuration settings at the global level and have individual projects inherit those settings from the global defaults. If a lot of your projects have the same settings, adding Nx to your repo will actually reduce the lines of code in your codebase — thus negative configuration. This isnt convention over configuration or zero configuration, because the configuration settings are still explicitly defined. The configuration code is just better organized and defined in a predictable way.
Nx provides the ability to define default configuration settings at the global level and have individual projects inherit those settings from the global defaults. If a lot of your projects have the same settings, adding Nx to your repo will actually reduce the lines of code in your codebase — thus negative configuration. This isn't convention over configuration or zero configuration, because the configuration settings are still explicitly defined. The configuration code is just better organized and defined in a predictable way.
If youre ready to have Nx help you manage your infrastructure so that your developers can speed down the highway without needing to avoid configuration potholes, check out [nx.dev](/getting-started/intro) to get started.
If you're ready to have Nx help you manage your infrastructure so that your developers can speed down the highway without needing to avoid configuration potholes, check out [nx.dev](/getting-started/intro) to get started.
## Learn more
@@ -2,13 +2,14 @@
title: 'Setup React and Tailwind — The Easy Way'
slug: 'setup-react-and-tailwind-the-easy-way'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-02-09/TK4Kdj-cc890gQkgUtKNyA.png'
cover_image: '/blog/images/2023-02-09/TK4Kdj-cc890gQkgUtKNyA.avif'
tags: [nx, tutorial]
description: Learn how to quickly set up React with Tailwind CSS using Nx's code generators, including migration from Create React App and automated configuration tools.
---
Developers love to argue about whether Tailwind is good, almost like arguing about code formatting or tabs vs. spaces (I use spaces!!). But whether you love it or hate it, Tailwind has found massive adoption among the frontend developer community. In fact, Im right now in the process of refreshing and rebuilding my personal site (it will be at [https://juri.dev](https://juri.dev/) soon, so keep an eye on that).
Developers love to argue about whether Tailwind is good, almost like arguing about code formatting or tabs vs. spaces (I use spaces!!). But whether you love it or hate it, Tailwind has found massive adoption among the frontend developer community. In fact, I'm right now in the process of refreshing and rebuilding my personal site (it will be at [https://juri.dev](https://juri.dev/) soon, so keep an eye on that).
## Prefer a video? Ive got you covered!
## Prefer a video? I've got you covered!
{% youtube src="https://www.youtube.com/watch?v=hHh0xhzSnx8" /%}
@@ -28,17 +29,17 @@ These steps mostly involve
![](/blog/images/2023-02-09/tcPmgZM4SjA2QM80.avif)
This came up a couple of weeks ago due to a [PR opened on the CRA repo](https://github.com/reactjs/reactjs.org/pull/5487) asking to kinda deprecate it as the main choice for new React projects. I couldnt help but share my opinion on this as well:
This came up a couple of weeks ago due to a [PR opened on the CRA repo](https://github.com/reactjs/reactjs.org/pull/5487) asking to kinda deprecate it as the main choice for new React projects. I couldn't help but share my opinion on this as well:
{% youtube src="https://youtu.be/fkTz6KJxhhE" /%}
And so did also [Fireship](https://youtu.be/2OTq15A5s0Y) and ultimately [Dan Abramov](https://github.com/reactjs/reactjs.org/pull/5487#issuecomment-1409720741). Anyway, if youre in the **CRA situation, read on**. Theres a way to get unblocked there.
And so did also [Fireship](https://youtu.be/2OTq15A5s0Y) and ultimately [Dan Abramov](https://github.com/reactjs/reactjs.org/pull/5487#issuecomment-1409720741). Anyway, if you're in the **"CRA situation", read on**. There's a way to get unblocked there.
## There is an easier way — Code Generators
Code generators speed up such configuration tasks. They are valuable for scaffolding the initial project structure and adding new features to the app setup, such as Tailwind.
Nx has such generators. To use them, you need an Nx-based React setup. If youre starting new, you can create an [Nx Standalone React project](/getting-started/tutorials/react-standalone-tutorial) easily using the following command
Nx has such generators. To use them, you need an Nx-based React setup. If you're starting new, you can create an Nx Standalone React project easily using the following command
```shell
$ npx create-nx-workspace reactapp --preset=react-standalone
@@ -58,7 +59,7 @@ You can pass `--vite=false` if you still want to keep the Webpack configuration
## Generating a Tailwind Setup
Once you have a [Nx-based React](/getting-started/tutorials/react-standalone-tutorial) setup, adding Tailwind is as easy as running:
Once you have a [Nx-based React](/getting-started/tutorials/react-monorepo-tutorial) setup, adding Tailwind is as easy as running:
```shell
$ npx nx g @nrwl/react:setup-tailwind
@@ -66,7 +67,7 @@ $ npx nx g @nrwl/react:setup-tailwind
This launches a generator that will guide you through the setup. It works **not only for Nx React-based projects** but **also if you use Next.js** in an Nx workspace.
Youll get
You'll get
- Tailwind, PostCSS, and Autoprefixer installed
- Tailwind configured together with PostCSS
@@ -74,11 +75,10 @@ Youll get
![](/blog/images/2023-02-09/lOVFEvRc7Wrsm5V_.avif)
## Thats it!
## That's it!
You should be all setup and ready now! Here are some related resources to explore:
- [Nx docs: React Standalone tutorial](/getting-started/tutorials/react-standalone-tutorial)
- [Nx docs: React Monorepo tutorial](/getting-started/tutorials/react-monorepo-tutorial)
- [Youtube: Is CRA Dead](https://youtu.be/fkTz6KJxhhE)
- [Nx docs: Migrate CRA to React and Vite](/recipes/adopting-nx/adding-to-existing-project)
@@ -2,11 +2,12 @@
title: 'Nx 15.7 — Node Support, Angular LTS, Lockfile Pruning'
slug: 'nx-15-7-node-support-angular-lts-lockfile-pruning'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-02-16/2AAo-mng7QyJP9yC80zNFQ.png'
cover_image: '/blog/images/2023-02-16/2AAo-mng7QyJP9yC80zNFQ.avif'
tags: [nx, release]
description: Nx 15.7 introduces first-class Node.js support, detached Angular version support, enhanced lockfile parsing, and Storybook 7.0 beta integration.
---
Heres all you need to know about our latest Nx release.
Here's all you need to know about our latest Nx release.
### Table of Contents
@@ -21,23 +22,23 @@ Heres all you need to know about our latest Nx release.
· [How to Update Nx](#how-to-update-nx)
· [Coming up](#coming-up)
### Prefer a video? Weve got you covered!
### Prefer a video? We've got you covered!
{% youtube src="https://www.youtube.com/watch?v=IStJODzZSoc" /%}
## 10k Subscribers on Youtube
Its almost a tradition to have some stats at the beginning of our Nx release blog posts. This time, about our YT channel: incredibly, we crossed 10k subscribers [on our Youtube channel](https://www.youtube.com/@nxdevtools)!!
It's almost a tradition to have some stats at the beginning of our Nx release blog posts. This time, about our YT channel: incredibly, we crossed 10k subscribers [on our Youtube channel](https://www.youtube.com/@nxdevtools)!!
![](/blog/images/2023-02-16/s8uTPTC3X01sE3u2.avif)
Apart from delivering high-quality engineering work, were very invested in producing educational content around developer tooling and monorepos. Weve been almost consistently shipping new content every week, whether that is blog posts on the [Nx blog](/blog) or in the form of new videos and live streams on our channel. Seeing our audience grow on Youtube confirms were on the right track and gives us new fuel to keep pushing!!
Apart from delivering high-quality engineering work, we're very invested in producing educational content around developer tooling and monorepos. We've been almost consistently shipping new content every week, whether that is blog posts on the [Nx blog](/blog) or in the form of new videos and live streams on our channel. Seeing our audience grow on Youtube confirms we're on the right track and gives us new fuel to keep pushing!!
If you havent subscribed yet, please do 🙏: [https://www.youtube.com/@nxdevtools](https://www.youtube.com/@nxdevtools). We also announce most of our new videos and live streams [on Twitter](https://twitter.com/nxdevtools).
If you haven't subscribed yet, please do 🙏: [https://www.youtube.com/@nxdevtools](https://www.youtube.com/@nxdevtools). We also announce most of our new videos and live streams [on Twitter](https://twitter.com/nxdevtools).
## Updates to our Nx Plugin Guides
Nx has been designed to be extensible from the ground up. Which is precisely why Nx Plugins are so powerful. They dont just come as part of an Nx integrated monorepo or standalone setup. Still, you can leverage them in the same way to automate your local workspace or even share them as proper Nx plugins with the community.
Nx has been designed to be extensible from the ground up. Which is precisely why Nx Plugins are so powerful. They don't just come as part of an Nx integrated monorepo or standalone setup. Still, you can leverage them in the same way to automate your local workspace or even share them as proper Nx plugins with the community.
Please have a look at our updated guide: [/extending-nx/tutorials/organization-specific-plugin](/extending-nx/tutorials/organization-specific-plugin)
@@ -45,8 +46,8 @@ Please have a look at our updated guide: [/extending-nx/tutorials/organization-s
{% youtube src="https://youtu.be/K4f-fMuAoRY" /%}
Due to a lack of time we never invested much more into streamlining the Node experience within Nx, though. This [changed now](/blog/from-bootstrapped-to-venture-backed), which is why were committed to making Nx the best developer tool for node based apps. Starting with v15.7 we improved support for [ExpressJS](https://expressjs.com/), [Fastify](https://fastify.io/) and [Koa](https://koajs.com/).
When starting a new Nx workspace, you now have a new option: Standalone Node Server app.
Due to a lack of time we never invested much more into streamlining the Node experience within Nx, though. This [changed now](/blog/from-bootstrapped-to-venture-backed), which is why we're committed to making Nx the best developer tool for node based apps. Starting with v15.7 we improved support for [ExpressJS](https://expressjs.com/), [Fastify](https://fastify.io/) and [Koa](https://koajs.com/).
When starting a new Nx workspace, you now have a new option: "Standalone Node Server app".
![](/blog/images/2023-02-16/yTl82iMY0EsbjmBQ.avif)
@@ -61,7 +62,7 @@ All the features Nx is known for also apply to backend development. That include
- **Speed** via running building, linting, testing for only **(**[**affected**](/ci/features/affected)**) parts of your applications**, via [caching](/concepts/how-caching-works) and [optimized CI setups](/ci/features/distribute-task-execution)
- the ability to use and/or expand to a monorepo
This is the first iteration with first-class Node support. But were already working on a whole set of improvements for the Nx + Node story. So stay tuned!
This is the first iteration with first-class Node support. But we're already working on a whole set of improvements for the Nx + Node story. So stay tuned!
## Detaching Angular versions
@@ -77,7 +78,7 @@ New workspaces will always be created with the latest Angular version, but durin
$ nx migrate latest --interactive
```
When collecting migrations in interactive mode, youll be prompted to apply any optional migrations, and any updates you choose to skip wont be applied. The rest of the updates will be used as usual.
When collecting migrations in interactive mode, you'll be prompted to apply any optional migrations, and any updates you choose to skip won't be applied. The rest of the updates will be used as usual.
If you need to apply an Angular update that you previously skipped, you can collect migrations from an older version of Nx by running:
@@ -85,7 +86,7 @@ If you need to apply an Angular update that you previously skipped, you can coll
$ nx migrate latest --from=nx@<version>
```
In particular, were working on making that part more intuitive in upcoming versions.
In particular, we're working on making that part more intuitive in upcoming versions.
Also, have a look at our [updated docs](/recipes/tips-n-tricks/advanced-update) as well as our [Nx and Angular compatibility matrix](/nx-api/angular/documents/angular-nx-version-matrix) for more details.
@@ -93,7 +94,7 @@ Also, have a look at our [updated docs](/recipes/tips-n-tricks/advanced-update)
{% youtube src="https://youtu.be/Hi3aJ0Rlkls" /%}
Angulars new [standalone APIs](https://angular.io/guide/standalone-components) is exciting as it provides a new, more lightweight way of developing and composing Angular applications without the need for `NgModules`. Nx has had the ability to generate new Angular components using the Standalone API for a while. With v15.7, we now also allow you to quickly bootstrap a new single-project Nx workspace with a NgModule-less Angular application.
Angular's new [standalone APIs](https://angular.io/guide/standalone-components) is exciting as it provides a new, more lightweight way of developing and composing Angular applications without the need for `NgModules`. Nx has had the ability to generate new Angular components using the Standalone API for a while. With v15.7, we now also allow you to quickly bootstrap a new single-project Nx workspace with a NgModule-less Angular application.
```shell
npx create-nx-workspace@latest ngapp
@@ -103,7 +104,7 @@ npx create-nx-workspace@latest ngapp
## Lockfile parsing and pruning
Lockfiles can be highly complex, and different formats across the NPM, Yarn, and PNPM package managers dont make it easier. Nx used to consider the lock-file a black box. Starting with 15.7, this changes! Nx can now properly process the lock-file of all three major package managers (and their different versions!).
Lockfiles can be highly complex, and different formats across the NPM, Yarn, and PNPM package managers don't make it easier. Nx used to consider the lock-file a black box. Starting with 15.7, this changes! Nx can now properly process the lock-file of all three major package managers (and their different versions!).
Why is this useful? Glad you asked! Mostly for three reasons:
@@ -111,12 +112,12 @@ Why is this useful? Glad you asked! Mostly for three reasons:
- generate a `package.json` with **precise snapshot of the used versions** (especially useful in a monorepo with single-version policy)
- ability to **generate a pruned lock-file** that can be used along-side the `package.json` when packaging your app in a Docker container
Some of our plugins `build` executors include:
Some of our plugins' `build` executors include:
- `generatePackageJson` flag (`@nrwl/webpack:webpack` and `@nrwl/node:webpack`) that automatically generates `package.json` and lock file.
- `generateLockfile` flag (`@nrwl/js:swc`, `@nrwl/js:tsc` and `@nrwl/next:build`) that generates lock file
If youre an Nx plugin developer, you can generate `package.json` and lock file using the following functions from the `@nrwl/devkit` package:
If you're an Nx plugin developer, you can generate `package.json` and lock file using the following functions from the `@nrwl/devkit` package:
```
import { createPackageJson, createLockFile } from '@nrwl/devkit';
@@ -150,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
@@ -184,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)
@@ -2,17 +2,18 @@
title: 'Using NgRx Standalone APIs with Nx'
slug: 'using-ngrx-standalone-apis-with-nx'
authors: ['Colum Ferry']
cover_image: '/blog/images/2023-02-21/pJHhA04d6jIjOb5vpCDjyw.png'
cover_image: '/blog/images/2023-02-21/pJHhA04d6jIjOb5vpCDjyw.avif'
tags: [nx, tutorial]
description: A practical guide to integrating NgRx Standalone APIs in Angular applications using Nx, with automated setup for state management.
---
Version 15 of [NgRx](https://ngrx.io/) introduced Standalone APIs to the package, enabling usage of the NgRx with Standalone Component-based [Angular](https://angular.io/) applications. This allows for a simpler integration of NgRx to your application.
Nx has added support for using these Standalone APIs from NgRx when generating NgRx stores with our `@nrwl/angular:ngrx` generator when you give it a path to a `Routes` definition file. _(Usually denoted by_ `_*.routes.ts_`_)_
In this article, well walk through using Nx to create a new Standalone Component-based Angular application and add NgRx to it, using _ONLY_ Nx Generators!
In this article, we'll walk through using Nx to create a new Standalone Component-based Angular application and add NgRx to it, using _ONLY_ Nx Generators!
**Prefer a video version? Weve got you covered!**
**Prefer a video version? We've got you covered!**
{% youtube src="https://www.youtube.com/watch?v=fp9E5G9C61Q" /%}
@@ -60,7 +61,7 @@ Nx will aid this also!
`nx g @nrwl/angular:ngrx --root --parent=src/main.ts`
Youll be asked for a name for the feature state, but you can ignore this and simply press enter in your terminal, it is not necessary at this stage.
You'll be asked for a name for the feature state, but you can ignore this and simply press enter in your terminal, it is not necessary at this stage.
Say false to Facades also.
@@ -96,7 +97,7 @@ Notice the addition of `provideEffects()` and `provideStore()` to the `providers
NgRx works better when you split your store based on the features you have within your application. This is a pretty common use case. Nx allows you to do this very easily and in a very structured way.
First, lets generate a new feature library, called `feature-users`, in Nx that will house everything related to our feature including the NgRx State.
First, let's generate a new feature library, called `feature-users`, in Nx that will house everything related to our feature including the NgRx State.
`nx g @nrwl/angular:lib feature-users --standalone --routing --lazy --parent=src/app/app.routes.ts`
@@ -105,7 +106,7 @@ This command does a few things:
- It creates a new library in our Nx Workspace
- It uses an Angular Standalone Component as the entrypoint
- It adds a routing configuration to the library and adds the component as the default route.
- It will add a lazy-loaded route to the applications `app.routes.ts` file, wiring up the application to the library!
- It will add a lazy-loaded route to the application's `app.routes.ts` file, wiring up the application to the library!
Some files you may want to explore in your own time are:
@@ -114,11 +115,11 @@ Some files you may want to explore in your own time are:
## Add feature state to the feature library
Now that we have a feature library for our users feature, lets generate the feature state! Its as simple as one command.
Now that we have a feature library for our users feature, let's generate the feature state! It's as simple as one command.
`nx g @nrwl/angular:ngrx users --parent=feature-users/src/lib/lib.routes.ts --route=''`
Youll be asked if this is the root state of the application, enter `N`. Then say no to Facades (unless you really want them).
You'll be asked if this is the root state of the application, enter `N`. Then say no to Facades (unless you really want them).
The `--route` option here is used to dictate what `route` within our routes definition file (`lib.routes.ts`) should have the state attached to it. This is to allow the NgRx Standalone APIs to be attached to that route.
@@ -153,7 +154,7 @@ The command will also have generated our
And with that, we now have NgRx installed and integrated into our application!
If youd like to confirm the integration, you can run the following commands and see successful outputs!
If you'd like to confirm the integration, you can run the following commands and see successful outputs!
`nx build`
@@ -1,12 +1,13 @@
---
title: 'Whats New With Lerna 6.5?'
title: "What's New With Lerna 6.5?"
slug: 'whats-new-with-lerna-6-5'
authors: ['Zack DeRose']
cover_image: '/blog/images/2023-02-22/izlWzEYnkZ9myXi58Rmv8A.png'
cover_image: '/blog/images/2023-02-22/izlWzEYnkZ9myXi58Rmv8A.avif'
tags: [nx, release]
description: Lerna 6.5 introduces idempotent publishing, multi-script execution, private package handling, and codebase improvements, with updates on Nx team maintenance.
---
In case you missed it, Lerna version 6.5 recently launched. Well catch you up on the latest Lerna news and newest features.
In case you missed it, Lerna version 6.5 recently launched. We'll catch you up on the latest Lerna news and newest features.
## Table of Contents
@@ -23,37 +24,37 @@ In case you missed it, Lerna version 6.5 recently launched. Well catch you up
In case you missed it, Lerna, the OG JavaScript monorepo tool, went largely unmaintained for a while, starting around 2020. Then, it officially declared itself to be unmaintained in April of 2022, only for Nx to step in to take over maintenance of the project in May of 2022!
You can find a more detailed account of Lernas Maintainance Odyssey in [this article](/blog/lerna-is-dead-long-live-lerna).
You can find a more detailed account of Lerna's "Maintainance Odyssey" in [this article](/blog/lerna-is-dead-long-live-lerna).
Since Nx took over in Lerna 4, weve added a brand new site to refresh the Lerna Docs:
Since Nx took over in Lerna 4, we've added a brand new site to refresh the Lerna Docs:
![](/blog/images/2023-02-22/3GKvhzStrTwq7re5.avif)
The top of our priorities for Lerna 5 was to resolve all vulnerabilities and outdated dependencies facing Lerna. We went on to make Lerna faster by allowing users to [opt into Nxs task caching inside of Lerna with the new `lerna add-caching` command](https://github.com/lerna/lerna/tree/main/packages/lerna/src/commands/add-caching#readme), and [add support for distributed caching to share task results amongst your organization in Lerna with Nx Cloud](https://lerna.js.org/docs/features/share-your-cache).
The top of our priorities for Lerna 5 was to resolve all vulnerabilities and outdated dependencies facing Lerna. We went on to make Lerna faster by allowing users to [opt into Nx's task caching inside of Lerna with the new `lerna add-caching` command](https://github.com/lerna/lerna/tree/main/packages/lerna/src/commands/add-caching#readme), and [add support for distributed caching to share task results amongst your organization in Lerna with Nx Cloud](https://lerna.js.org/docs/features/share-your-cache).
We were proud to go on to launch [Lerna 6](/blog/lerna-reborn-whats-new-in-v6) last October, where we began focusing on further improving Lernas feature set — focusing specifically on its unique strengths: versioning and publishing.
We were proud to go on to launch [Lerna 6](/blog/lerna-reborn-whats-new-in-v6) last October, where we began focusing on further improving Lerna's feature set — focusing specifically on its unique strengths: versioning and publishing.
## Still on Lerna 4?
[Heres how to upgrade to the latest and greatest](https://lerna.js.org/upgrade).
[Here's how to upgrade to the latest and greatest](https://lerna.js.org/upgrade).
Weve also started an initiative to assist Open Source projects in getting the most out of Lerna. Projects that use Lerna can now request free consulting to learn how to take advantage of Lernas newest features.
We've also started an initiative to assist Open Source projects in getting the most out of Lerna. Projects that use Lerna can now request free consulting to learn how to take advantage of Lerna's newest features.
Weve just started this initiative and have already been able to help [Sentry](https://github.com/getsentry/sentry-javascript) get optimized with task caching and task pipeline optimizations for their workspace!
We've just started this initiative and have already been able to help [Sentry](https://github.com/getsentry/sentry-javascript) get optimized with task caching and task pipeline optimizations for their workspace!
![](/blog/images/2023-02-22/7Wu1y3L6BNPZmZwE.avif)
This initiative complements [our free tier of unlimited Nx Cloud](/pricing) for any Open Source project.
If youre interested in optimizing your Open Source project to take advantage of the latest Lerna features, [reach out to us on Twitter!](https://twitter.com/lernajs)
If you're interested in optimizing your Open Source project to take advantage of the latest Lerna features, [reach out to us on Twitter!](https://twitter.com/lernajs)
Now lets jump into the newest Lerna 6.5 features!
Now let's jump into the newest Lerna 6.5 features!
## Idempotency Added to the `lerna publish from-git` Command
{% youtube src="https://youtu.be/kh4TaiKbC8c" /%}
Idempotent is a word used to describe an operation you can perform any number of times, and the resulting state is the same as if you had only run the operation once.
"Idempotent" is a word used to describe an operation you can perform any number of times, and the resulting state is the same as if you had only run the operation once.
The [`lerna publish` command](https://github.com/lerna/lerna/tree/main/libs/commands/publish#readme) is a beneficial tool for quickly publishing multiple packages from your workspace:
@@ -63,13 +64,13 @@ The [`lerna publish` command](https://github.com/lerna/lerna/tree/main/libs/comm
As we can see, `lerna publish from-package` is already idempotent (since it only publishes packages whose version doesn't exist, any run past the first will not adjust the state of the registry).
With 6.5, weve added the same idempotency to `lerna publish from-git`. This update is handy for recovering from a situation where some of your packages failed to publish initially (maybe due to a networking issue).
With 6.5, we've added the same idempotency to `lerna publish from-git`. This update is handy for recovering from a situation where some of your packages failed to publish initially (maybe due to a networking issue).
[For more information, check out the PR](https://github.com/lerna/lerna/pull/3513)
## `lerna run` Can Run Multiple Scripts In a Single Command
For 6.5, weve added the ability to run multiple scripts in a single `lerna run` command! Checkout this quick video demonstrating this below:
For 6.5, we've added the ability to run multiple scripts in a single `lerna run` command! Checkout this quick video demonstrating this below:
{% youtube src="https://youtu.be/Ey73CEGcVKw" /%}
@@ -85,7 +86,7 @@ lerna publish from-git --include-private my-private-package
Running `lerna publish` with this new [`--include-private`](https://github.com/lerna/lerna/tree/main/libs/commands/publish#--include-private) option (as above) will strip this `"private": true` configuration from the `package.json` of the packages listed in the command.
This new option is beneficial for the use case where youd like to run e2e for a package that will eventually be public but is currently private to prevent getting published too soon.
This new option is beneficial for the use case where you'd like to run e2e for a package that will eventually be public but is currently private to prevent getting published too soon.
{% youtube src=" https://youtu.be/7TgjCk7Diks" /%}
@@ -93,12 +94,12 @@ You can find more information on this change [here](https://github.com/lerna/ler
## Massive Refactor
Unlike the other updates mentioned for 6.5, this update does not affect Lernas public API, but as you can see from the numbers, this was quite an undertaking:
Unlike the other updates mentioned for 6.5, this update does not affect Lerna's public API, but as you can see from the numbers, this was quite an undertaking:
![](/blog/images/2023-02-22/AKQyRtbrKzzOUdPZ.avif)
![](/blog/images/2023-02-22/GUSOJi5vj5fGYYj3.avif)
The result is a significant improvement to the Typescript support for Lernas internals and a substantial simplification of the codebase. This investment will make Lerna significantly more approachable to other would-be contributors!
The result is a significant improvement to the Typescript support for Lerna's internals and a substantial simplification of the codebase. This investment will make Lerna significantly more approachable to other would-be contributors!
Find more on this change [here](https://github.com/lerna/lerna/pull/3517).
@@ -123,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)
@@ -2,15 +2,16 @@
title: 'Bundling a Node API with Fastify, esbuild, and Nx'
slug: 'bundling-a-node-api-with-fastify-esbuild-and-nx'
authors: ['Jack Hsu']
cover_image: '/blog/images/2023-02-28/PADY_RKrkXj39p4nj79ESw.png'
cover_image: '/blog/images/2023-02-28/PADY_RKrkXj39p4nj79ESw.avif'
tags: [nx, tutorial]
description: Build and deploy a Node.js API with Fastify, Nx, esbuild, Docker, and Fly.io.
---
There are many decisions to make when it comes to building a Node API. There are a variety of frameworks to choose from (Express, Fastify, Koa, etc.), and a million different ways to build and deploy the application.
In this article, Ill show you the easiest way to go from zero to production by using Nx to create a Node API project.
In this article, I'll show you the easiest way to go from zero to production by using Nx to create a Node API project.
Well be using [Fastify](https://www.fastify.io/) as the framework of choice. Fastify is a fast (as the name implies) and low-overhead server in Node. It has grown in popularity, recently crossing the 1 million weekly download mark on npm. Im a fan of Fastifys plugin architecture, and the ecosystem is quite impressive, boasting over [250 core and community plugins](https://www.fastify.io/ecosystem/).
We'll be using [Fastify](https://www.fastify.io/) as the framework of choice. Fastify is a fast (as the name implies) and low-overhead server in Node. It has grown in popularity, recently crossing the 1 million weekly download mark on npm. I'm a fan of Fastify's plugin architecture, and the ecosystem is quite impressive, boasting over [250 core and community plugins](https://www.fastify.io/ecosystem/).
## **Table of Contents**
@@ -21,7 +22,7 @@ Well be using [Fastify](https://www.fastify.io/) as the framework of choice.
· [Deploying the server](#deploying-the-server)
· [Summary](#summary)
**Prefer a video version? Weve got you covered!**
**Prefer a video version? We've got you covered!**
{% youtube src="https://www.youtube.com/watch?v=K4f-fMuAoRY" /%}
@@ -57,7 +58,7 @@ In additional to generating the source code, Nx will also create two test suites
1. Unit tests via `npx nx test` (aliased to `npm run test`).
2. E2E tests via `npx nx e2e e2e` (aliased to `npm run e2e`).
Unit tests take advantage of Fastifys plugin architecture, and allows you to test each plugin in isolation. It runs using [Jest](https://jestjs.io/), which is the most popular test runner in Node.
Unit tests take advantage of Fastify's plugin architecture, and allows you to test each plugin in isolation. It runs using [Jest](https://jestjs.io/), which is the most popular test runner in Node.
```
// src/app/app.spec.ts
@@ -101,7 +102,7 @@ There are trade-offs between speed versus confidence when it comes to unit versu
## Building for production using esbuild
Now that we have our production-ready app, lets examine how Nx handles the build process using [`esbuild`](https://esbuild.github.io/).
Now that we have our production-ready app, let's examine how Nx handles the build process using [`esbuild`](https://esbuild.github.io/).
`esbuild` is a bundler written in Go that is extremely fast — it is much faster than other bundlers like webpack and parcel, but that may change in the future as other tools make their own speed improvements.
@@ -118,7 +119,7 @@ NX Successfully ran target build for project api (2s)
```
A cool feature of Nx, is that commands such as `build` and `test` are cached if the project (or its dependencies) have not changed. If we run the build a second time, youll see it completes in a few milliseconds.
A cool feature of Nx, is that commands such as `build` and `test` are cached if the project (or its dependencies) have not changed. If we run the build a second time, you'll see it completes in a few milliseconds.
```shell
$ npx nx build
@@ -131,7 +132,7 @@ NX Successfully ran target build for project api (16ms) Nx read the output from
```
Well touch more on the caching when we look at Docker support.
We'll touch more on the caching when we look at Docker support.
And now that the server bundle is ready, we can run it.
@@ -188,9 +189,9 @@ $ docker run -p 3000:3000 -t api
There are numerous platforms that we can deploy our app to. I like [Fly.io](https://fly.io) since it very easy to deploy all over the world using the CLI, and it comes with good [Docker support](https://fly.io/docs/languages-and-frameworks/dockerfile/).
If you havent used Fly before, please follow their [short getting started guide](https://fly.io/docs/speedrun/) (510 mins).
If you haven't used Fly before, please follow their [short getting started guide](https://fly.io/docs/speedrun/) (510 mins).
Once you are ready, lets configure our project.
Once you are ready, let's configure our project.
```
@@ -224,7 +225,7 @@ And you can open the deployed server using `fly open`.
![](/blog/images/2023-02-28/tV8aAtjRoRMwlj1Tv17IAw.avif)
Thats it! Our server is now deployed for the world to use.
That's it! Our server is now deployed for the world to use.
## Summary
@@ -2,8 +2,9 @@
title: 'Expanding Nx Console to JetBrains IDEs'
slug: 'expanding-nx-console-to-jetbrains-ides'
authors: ['Max Kless']
cover_image: '/blog/images/2023-03-02/lEAhfd3d17hGichyT-oGbw.png'
cover_image: '/blog/images/2023-03-02/lEAhfd3d17hGichyT-oGbw.avif'
tags: [nx]
description: Explore the technical journey of bringing Nx Console to JetBrains IDEs, featuring Language Server integration and Generate UI implementation for IntelliJ.
---
**_Co-authored by_** [**_Jon Cammisuli_**](https://twitter.com/jcammisuli)
@@ -19,13 +20,13 @@ Go grab it on the official store.
![](/blog/images/2023-03-02/gnMRzttFFaoTX0tVw-zZbQ.avif)
Before we go into details of Nx Console for IntelliJ, wed really want to go and **thank our community**. [\* \*_Issam Guissouma_\*\*](https://twitter.com/iguissouma) and [**_Edward Tkachev_**](https://twitter.com/etkachev) from the
Before we go into details of Nx Console for IntelliJ, we'd really want to go and **thank our community**. [\* \*_Issam Guissouma_\*\*](https://twitter.com/iguissouma) and [**_Edward Tkachev_**](https://twitter.com/etkachev) from the
Nx community had their own Nx Console plugins for IntelliJ out there already for a while. And they have been super
popular. As such wed like to take the occasion to give them a shout-out for the awesome work on the community plugins,
popular. As such we'd like to take the occasion to give them a shout-out for the awesome work on the community plugins,
but also for closely collaborating with us over the last weeks to build our official IntelliJ support for Nx Console.
Especially Issam has been actively helping us port over all the features he built to the official Nx Console plugin. So
be sure to look out for the upcoming release because its going to be another huge one!
be sure to look out for the upcoming release because it's going to be another huge one!
### Table of Contents
@@ -38,7 +39,7 @@ be sure to look out for the upcoming release because its going to be another
· [Glueing it together](#glueing-it-together)
· [Looking ahead](#looking-ahead)
**Prefer a video version? Weve got you covered!**
**Prefer a video version? We've got you covered!**
{% youtube src="https://www.youtube.com/watch?v=xUTm6GDqwJM" /%}
@@ -54,18 +55,18 @@ Language Server and the Generate UI.
the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/). It serves as a single
source of truth for all information about your workspace and its projects. With it, you get features such a code
completion for `project.json` and `nx.json` files, clickable links for all kinds of files and more. Being a standalone
process, its editor-agnostic per default, which is great! However, IntelliJ doesnt natively support the language
process, it's editor-agnostic per default, which is great! However, IntelliJ doesn't natively support the language
server protocol yet, so we had to write some code that bridges the gap between the two. More about that in the following
section!
The great thing about having a central brain for both extensions is that it saves a lot of time writing the same
The great thing about having a central "brain" for both extensions is that it saves a lot of time writing the same
functionality multiple times. We only have to deal with platform-specific code for rendering UI or defining actions
instead of parsing `nx.json` files and the like. This makes both VSCode and IntelliJ extensions thin, DRY wrappers
around the nxls.
Another major part of Nx Console is the **Generate UI**. Instead of combing through CLI commands to fit your specific
use-case, you can use the form-based view it provides. Its a separate web application (currently built with Angular)
that runs inside VSCode as a webview. Again, being a standalone application means that we didnt have to rewrite it
use-case, you can use the form-based view it provides. It's a separate web application (currently built with Angular)
that runs inside VSCode as a webview. Again, being a standalone application means that we didn't have to rewrite it
completely in order to integrate it into JetBrains-based editors!
## Nx Language Server
@@ -86,7 +87,7 @@ to get information about the workspace. Since this workspace information is alre
solution to just use that same workspace info in the IDEs without us having to rewrite this logic in multiple
languages (ie, TypeScript and Kotlin).
We found out quickly that we can implement custom requests within the `nxls` to respond to other queries that arent
We found out quickly that we can implement custom requests within the `nxls` to respond to other queries that aren't
actually part of the Language Server Protocol. These requests are what allows us to use the `nxls` in multiple IDEs and
allow us to quickly iterate.
@@ -112,7 +113,7 @@ that moved to the `nxls` .
**IntelliJ**
For JetBrains editors (IntelliJ/Webstorm), calling a language server wasnt so obvious.
For JetBrains editors (IntelliJ/Webstorm), calling a language server wasn't so obvious.
Thankfully, there were already plugins that integrated language servers using
the [lsp4j](https://github.com/eclipse/lsp4j) library. This was a great starting out point for us and we quickly got
@@ -165,7 +166,7 @@ step, which is easily done with [`kotlinx.serialization`](https://github.com/Kot
## Adapting Styling
One aspect that makes designing webviews for VSCode a breeze is the massive stylesheets they ship by default. Every UI
elements colors are available in primary, secondary and disabled variants as well as fonts, background colors and more.
element's colors are available in primary, secondary and disabled variants as well as fonts, background colors and more.
However, this ended up being a struggle as all styling was very tightly coupled to these VSCode stylesheets, which are
obviously not present within a different host IDE. We replaced all of the VSCode styles with custom css variables. In a
@@ -177,11 +178,11 @@ the same style variables using `UIUtil` and pass them to the app.
To integrate the web application into IntelliJ, Nx Console
uses [JCEF (Java Chromium Embedded Framework)](https://plugins.jetbrains.com/docs/intellij/jcef.html). JCEF enables Java
applications to render web pages using Chromium. It comes with great debugging support using Chrome Devtools and we
havent run into any issues with it yet. The docs are sadly a bit lacking, but with some trial and error we managed to
haven't run into any issues with it yet. The docs are sadly a bit lacking, but with some trial and error we managed to
wire everything up. I want to give a special shoutout to Rafal Mucha and his
article [Creating IntelliJ plugin with WebView](https://medium.com/virtuslab/creating-intellij-plugin-with-webview-3b27c3f87aea).
It explains how to enable JCEF to load files from the `/resources` folder bundled in the plugin JAR. Theres not much
info on this topic so this one blog post was a true lifesaver. Its written in Scala but I learned a lot rewriting it to
It explains how to enable JCEF to load files from the `/resources` folder bundled in the plugin JAR. There's not much
info on this topic so this one blog post was a true lifesaver. It's written in Scala but I learned a lot rewriting it to
Kotlin. Now we have
a [Kotlin version](https://github.com/nrwl/nx-console/blob/master/apps/intellij/src/main/kotlin/dev/nx/console/generate_ui/CustomResourceHandler.kt)
out there too!
@@ -194,9 +195,9 @@ callbacks on the host side.
## Glueing it together
One of the unique aspects of the Nx Console for IntelliJ is that it combines different technologies in a polyglot
monorepo. While Nx is often used for Typescript- or Javascript-based repos, its actually technology-agnostic and can
monorepo. While Nx is often used for Typescript- or Javascript-based repos, it's actually technology-agnostic and can
host apps and libraries in any language. With the newly released [**_Encapsulated Nx_
**](/recipes/installation/install-non-javascript) setting, this is even taken a step further! Now you dont need a
**](/recipes/installation/install-non-javascript) setting, this is even taken a step further! Now you don't need a
`package.json` or `node_modules` to run Nx.
The codebase contains both Typescript code for the VSCode extension and Kotlin code for the IntelliJ plugin. Currently,
@@ -209,7 +210,7 @@ from the other (and back again) could definitely be improved and we might look i
integration later.
For the generate UI, we were able to keep it as a single app. Using different configurations for the `build` target,
were including the different stylesheets needed for each configuration and copying the files to where they need to be.
we're including the different stylesheets needed for each configuration and copying the files to where they need to be.
## Looking ahead
@@ -2,11 +2,12 @@
title: 'Nx 15.8 — Rust Hasher, Nx Console for IntelliJ, Deno, Node and Storybook'
slug: 'nx-15-8-rust-hasher-nx-console-for-intellij-deno-node-and-storybook'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-03-08/2gKrC6_Yx3hVkQaHxnw5xw.png'
cover_image: '/blog/images/2023-03-08/2gKrC6_Yx3hVkQaHxnw5xw.avif'
tags: [nx, release]
description: Nx 15.8 brings Rust-based hasher, IntelliJ IDE support, Deno integration, enhanced Node.js features, and Storybook CSF3 support for improved performance.
---
Just weeks after the [release of Nx 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning) (release video [here](https://www.youtube.com/watch?v=IStJODzZSoc)), the Nx team has now launched Nx 15.8, with exciting new features and enhancements aimed at improving developer experience, productivity, and efficiency. Lets dive straight in.
Just weeks after the [release of Nx 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning) (release video [here](https://www.youtube.com/watch?v=IStJODzZSoc)), the Nx team has now launched Nx 15.8, with exciting new features and enhancements aimed at improving developer experience, productivity, and efficiency. Let's dive straight in.
**Table of Contents**
· [Rustifying the Nx Hasher](#rustifying-the-nx-hasher)
@@ -18,7 +19,7 @@ Just weeks after the [release of Nx 15.7](/blog/nx-15-7-node-support-angular-lts
· [How to Update Nx](#how-to-update-nx)
· [Learn more](#learn-more)
## Prefer a video? Weve got you covered!
## Prefer a video? We've got you covered!
{% youtube src="https://www.youtube.com/watch?v=4XdHT5Y7zj4" /%}
@@ -33,16 +34,16 @@ Enable notifications here:
Starting with Nx 15.8, we now have a Rust-based Hasher enabled by default!
Performance is at the core of what we do at Nx. Hence it isnt surprising that Nx is the fastest JS-based monorepo solution out there. Weve shown [that a couple of times](https://github.com/vsavkin/large-monorepo). But every millisecond counts! As such, we decided to experiment with Rust to see whether we could further optimize our project graph creation as well as the hasher function that is used for the [computation cache](/features/cache-task-results).
Performance is at the core of what we do at Nx. Hence it isn't surprising that Nx is the fastest JS-based monorepo solution out there. We've shown [that a couple of times](https://github.com/vsavkin/large-monorepo). But every millisecond counts! As such, we decided to experiment with Rust to see whether we could further optimize our project graph creation as well as the hasher function that is used for the [computation cache](/features/cache-task-results).
Our original implementation used Git to calculate the hash. But it had some downsides as
- it didnt work if you dont have or use Git (obviously)
- it didnt work if you used Git submodules
- it didn't work if you don't have or use Git (obviously)
- it didn't work if you used Git submodules
- it became super slow if you had a lot of file changes on your Git working tree, like when switching between branches
- it triggered a lot of `execSync` calls to get different git status which was a fragile implementation
In some situations where we couldnt rely on or use the Git hasher, we did a fallback to a node implementation which made things even slower.
In some situations where we couldn't rely on or use the Git hasher, we did a fallback to a node implementation which made things even slower.
**All nice and good, but show me the numbers!**
@@ -61,13 +62,13 @@ When running these tests on Windows (not WSL), the Nx repo hashing timings turne
- Rust hasher: 72ms
- Git hasher: 330ms
Right now, we only observed the Rust hasher to be slightly slower on large repositories when you dont have any changes. Once you start making changes the Git hasher becomes slower again and is overtaken by the Rust version which remains stable in performance.
Right now, we only observed the Rust hasher to be slightly slower on large repositories when you don't have any changes. Once you start making changes the Git hasher becomes slower again and is overtaken by the Rust version which remains stable in performance.
An interesting side-effect of using the Rust-based hasher is the size of the generated hashes, which are much smaller and thus allow for a quicker serialization between the [Nx Daemon](/concepts/nx-daemon) and Nx.
**Future work**
While we started with the hasher optimization, the next implementation were exploring is using a binary format to communicate between the Nx Daemon and the Nx client. Currently, we serialize the JSON to a string and pass that through an IPC socket. Using a binary format will significantly speed up the communication here.
While we started with the hasher optimization, the next implementation we're exploring is using a binary format to communicate between the Nx Daemon and the Nx client. Currently, we serialize the JSON to a string and pass that through an IPC socket. Using a binary format will significantly speed up the communication here.
**Opting out**
@@ -87,7 +88,7 @@ As such, it should work on most CI and local developer machines. If we missed so
{% youtube src="https://youtu.be/NpH8cFSp51E" /%}
Nx Deno support [already landed in 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning), but didnt make it into the blog post. So here we go: we have a brand new Nx Deno plugin published at `@nrwl/deno`. For now, it is experimental and lives in our [labs repository](https://github.com/nrwl/nx-labs).
Nx Deno support [already landed in 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning), but didn't make it into the blog post. So here we go: we have a brand new Nx Deno plugin published at `@nrwl/deno`. For now, it is experimental and lives in our [labs repository](https://github.com/nrwl/nx-labs).
This plugin features the ability to generate Deno applications and libraries inside of an Nx workspace. Obviously, all the other much-loved Nx features such as caching, affected commands and the project graph visualization work out of the box as well.
@@ -109,9 +110,9 @@ Or generate a new library with:
npx nx g @nrwl/deno:lib mydenolib
```
Were excited to see folks welcome in Deno APIs to their Nx workspaces and be able to easily share their Typescript packages across Deno, Node, and web applications, all inside the same monorepo.
We're excited to see folks welcome in Deno APIs to their Nx workspaces and be able to easily share their Typescript packages across Deno, Node, and web applications, all inside the same monorepo.
Given this is still experimental, were more than happy to receive feedback and hear about ways you are using Deno right now and/or plan to use it in an Nx workspace.
Given this is still experimental, we're more than happy to receive feedback and hear about ways you are using Deno right now and/or plan to use it in an Nx workspace.
To see some of this in action, be sure to check out our [recent livestream with Caleb and Chau](https://youtu.be/Um8xXR54upQ), two of our engineers that have been working on this plugin:
@@ -125,7 +126,7 @@ Developer tool CLIs are known for being, well, command-line interfaces. Nx comes
- [providing IntelliSense](https://twitter.com/NxDevTools/status/1573323012476051456) support for Nx configuration files
- [integrating Nx Cloud](https://youtu.be/WfWmK1x52HE)
With the growing popularity, the ask for an equivalent extension for JetBrains IntelliJ & WebStorm editors got louder and louder. At Nx, were lucky to have an awesome community. [Issam Guissouma](https://twitter.com/iguissouma) and [Edward Tkachev](https://twitter.com/etkachev) from the Nx community jumped in and provided their implementation of Nx Console for IntelliJ.
With the growing popularity, the ask for an equivalent extension for JetBrains' IntelliJ & WebStorm editors got louder and louder. At Nx, we're lucky to have an awesome community. [Issam Guissouma](https://twitter.com/iguissouma) and [Edward Tkachev](https://twitter.com/etkachev) from the Nx community jumped in and provided their implementation of Nx Console for IntelliJ.
Since our team [now works full-time on Nx](/blog/from-bootstrapped-to-venture-backed) and the surrounding tooling, we decided to have a dedicated Nx Console extensions for IntelliJ and WebStorm that is actively maintained and developed by the core team. We reached out to Issam and Edward and started collaborating on it. The result can now be installed from the JetBrains marketplace:
[https://plugins.jetbrains.com/plugin/21060-nx-console](https://plugins.jetbrains.com/plugin/21060-nx-console)
@@ -143,7 +144,7 @@ Nx Console has proven a highly valuable tool for exploring Nx generators. Especi
With a growing number of parameters that a generator can take, it started to get messy and overwhelming. Furthermore, in 80% of the cases, you would probably need the main parameters such as the name, bundler, and directory where to generate the output.
This is the main reason we introduced a `x-priority` flag to our generator metadata, to have a way to prioritize certain flags and show them more prominently to the end user. Available values are `important` and `internal`.
The property can be defined for the desired parameters in the generators `schema.json`:
The property can be defined for the desired parameters in the generator's `schema.json`:
```json
{
@@ -2,8 +2,9 @@
title: 'Rspack — Getting up to speed with Nx'
slug: 'rspack-getting-up-to-speed-with-nx'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-03-10/fWQ53mw2itEs3SGAOJVonQ.png'
cover_image: '/blog/images/2023-03-10/fWQ53mw2itEs3SGAOJVonQ.avif'
tags: [nx]
description: Explore Nx's integration with Rspack, the Rust-based Webpack alternative that offers 5-10x faster compilation for React apps in your monorepo.
---
At Nx, we are excited to see the JavaScript tooling ecosystem evolve, particularly when it comes to improving speed! Performance is at the core of Nx. Faster tools with which we can integrate make our lives easier and allow us to provide a better experience for developers.
@@ -14,7 +15,7 @@ Almost a year ago [ByteDance](https://www.bytedance.com/) started developing a n
Rspack is a rewrite of Webpack with the primary goal of improving performance. Rust is the main language, allowing for a highly parallelized architecture that takes full advantage of modern multi-core CPUs. In addition, it also comes with essential bundling features already built-in to avoid further bottlenecks from 3rd-party packages. It also highly optimizes HMR (Hot Module Replacement) using a specialized incremental compilation strategy.
ByteDance developed Rspack to solve performance issues they faced when developing and maintaining their internal monolithic applications, all of which rely heavily on complex Webpack configurations. Rspack being a rewrite allows to rely on Webpacks mature architecture and is, at the same time, an easy drop-in replacement.
ByteDance developed Rspack to solve performance issues they faced when developing and maintaining their internal monolithic applications, all of which rely heavily on complex Webpack configurations. Rspack being a rewrite allows to rely on Webpack's mature architecture and is, at the same time, an easy drop-in replacement.
ByteDance already applied Rspack on some of their internal business applications and has seen between 5 to 10x improvement in compilation performance.
@@ -46,7 +47,7 @@ All the usual Nx features, such as
..work out of the box.
But not just the speed features. All the code generators, automate code migrations, and [code editor extensions](/getting-started/editor-setup) work too.
But not just the "speed features". All the code generators, automate code migrations, and [code editor extensions](/getting-started/editor-setup) work too.
## Rspack in an Nx Monorepo
+8 -7
View File
@@ -2,13 +2,14 @@
title: Nx Cloud 3.0 — Faster Cache, More Powerful DTE, Better Ergonomics
slug: 'nx-cloud-3-0-faster-more-efficient-modernized'
authors: [Juri Strumpflohner]
cover_image: '/blog/images/2023-04-19/featured_img.webp'
cover_image: '/blog/images/2023-04-19/featured_img.avif'
tags: [nx, nx-cloud]
description: Nx Cloud 3.0 introduces a modern UI, faster cache management, enhanced DTE, VCS integrations, enterprise features, and a simplified pricing model.
---
It has been almost 2 years since we released [Nx Cloud 2.0](/nx-cloud). Since then, it has saved over 400 years of computation by leveraging its distributed caching and task execution. And we keep adding 8 years every single week. Not only does this tremendously [impact our environment](/blog/helping-the-environment-by-saving-two-centuries-of-compute-time), but it also helps developers be more productive and companies save money.
In the last couple of months we have quadrupled the team and have done some amazing things. And we have some big plans for what is coming next. Heres all you need to know!
In the last couple of months we have quadrupled the team and have done some amazing things. And we have some big plans for what is coming next. Here's all you need to know!
**Table of Contents**
@@ -21,7 +22,7 @@ In the last couple of months we have quadrupled the team and have done some amaz
- [Coming Next](#coming-next)
- [Learn more](#learn-more)
**Prefer a Video? Weve got you Covered!**
**Prefer a Video? We've got you Covered!**
{% youtube src="https://www.youtube.com/embed/cG2hEI5L3qI?si=9frDSD8_HK1iTNEi" /%}
@@ -78,7 +79,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](/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.
Weve recently made a couple of improvements to our enterprise offering.
We've recently made a couple of improvements to our enterprise offering.
- **Helm Charts** — We added a **Helm chart** to simplify the process of deploying Nx Cloud to on-premises infrastructure, allowing organizations to quickly set up and manage their own instance of Nx Cloud within their secure environment.
- **Stability improvements** — We significantly reworked our on-premises solution to be identical to our SaaS deployment. This revamp resulted in a more robust and reliable on-premises deployment of Nx Cloud, ensuring enterprise-grade performance and reliability.
@@ -90,7 +91,7 @@ Learn more at [enterprise](/enterprise).
Nx Cloud has evolved a lot since we first released it in 2020, and is changing even more in 2023. To better adapt to Nx Cloud being a critical CI tool, we changed our pricing model to be more consistent and predictable for CI workloads.
Nx Clouds previous pricing was based on time savings from Nx Cloud, which made sense when Nx Cloud was strictly a distributed caching service. The [new pricing model](/pricing) is based entirely on the number of CI pipeline executions per calendar month. We believe this is a simpler and more transparent model that should help you predict your costs far more easily.
Nx Cloud's previous pricing was based on time savings from Nx Cloud, which made sense when Nx Cloud was strictly a distributed caching service. The [new pricing model](/pricing) is based entirely on the number of CI pipeline executions per calendar month. We believe this is a simpler and more transparent model that should help you predict your costs far more easily.
![](/blog/images/2023-04-19/bodyimg8.webp)
@@ -104,9 +105,9 @@ Learn more at [/pricing](/pricing).
## Coming Next
Weve got some big plans for Nx Cloud. You really want to write your CI script by focusing on what you want to achieve rather than thinking about making it fast. Were going to make this happen!
We've got some big plans for Nx Cloud. You really want to write your CI script by focusing on what you want to achieve rather than thinking about making it fast. We're going to make this happen!
The current Distributed Task Execution (DTE) already goes a long way, but you still have to provision the agents by yourself. Providing the correct number of agents is crucial for maximizing efficiency and reducing idle time. And it is not even a static number but might depend on the actual run itself. Nx has extensive knowledge about the structure of the workspace and according tasks. We want to leverage that information. Imagine a setup where you have a roughly 20 line CI config for a repo with hundreds of developers and Nx Cloud automatically determines for each run the ideal number of agents required, provisions them, distributes all tasks efficiently and then disposes all agents again. All fully automatically. And it will be fast. To the point where you wouldnt even need your Jenkins, CircleCI etc at all.
The current Distributed Task Execution (DTE) already goes a long way, but you still have to provision the agents by yourself. Providing the correct number of agents is crucial for maximizing efficiency and reducing idle time. And it is not even a static number but might depend on the actual run itself. Nx has extensive knowledge about the structure of the workspace and according tasks. We want to leverage that information. Imagine a setup where you have a roughly 20 line CI config for a repo with hundreds of developers and Nx Cloud automatically determines for each run the ideal number of agents required, provisions them, distributes all tasks efficiently and then disposes all agents again. All fully automatically. And it will be fast. To the point where you wouldn't even need your Jenkins, CircleCI etc at all.
In addition, we are actively exploring ways to provide advanced analytics for your workspace, including insights into the frequency and duration of specific tasks. This valuable information can help identify large tasks that could benefit from being broken down into smaller ones, leveraging caching and other speed improvements to optimize performance. Stay tuned for more to come!
+7 -6
View File
@@ -2,14 +2,15 @@
title: 'Nx 16 is Here!'
slug: 'nx-16-is-here'
authors: ['Zack DeRose']
cover_image: '/blog/images/2023-05-02/n8JTIcKSYkebBOl8zZuF9w.png'
cover_image: '/blog/images/2023-05-02/n8JTIcKSYkebBOl8zZuF9w.avif'
youtubeUrl: 'https://youtu.be/JIhOyJtuxEA'
tags: [nx, release]
description: Nx 16 brings package rescoping, enhanced Deno support, Cypress testing improvements, task graph visualization, and PNPM migration for better performance.
---
Were proud to announce the release of Nx version 16! In this article, well go over the major updates from Nx 16 and the key pieces of information youll need to know for the changes that Nx 16 brings!
We're proud to announce the release of Nx version 16! In this article, we'll go over the major updates from Nx 16 and the key pieces of information you'll need to know for the changes that Nx 16 brings!
But before we jump into the new features of Nx 16, lets recap some of the recent features from our Nx 15 minor releases!
But before we jump into the new features of Nx 16, let's recap some of the recent features from our Nx 15 minor releases!
- We introduced simpler presets for React, Angular, and [Node starter applications](https://youtu.be/K4f-fMuAoRY)
- We added official support for [Vite](/nx-api/vite) and Vitest for integrated Nx monorepos
@@ -21,7 +22,7 @@ But before we jump into the new features of Nx 16, lets recap some of the rec
### Table of Contents
· [Heres how to Upgrade with Nx Migrate](#heres-how-to-upgrade-with-nx-migrate)
· [Here's how to Upgrade with Nx Migrate](#heres-how-to-upgrade-with-nx-migrate)
· [Rescoping From @nrwl/_ to @nx/_](#rescoping-from-nrwl-to-nx)
· [Deno Standalone Apps, Edge Deployment and More](#deno-standalone-apps-edge-deployment-and-more)
· [Cypress Feature Testing](#cypress-feature-testing)
@@ -29,7 +30,7 @@ But before we jump into the new features of Nx 16, lets recap some of the rec
· [The Nx Repo Switches to PNPM for its Package Manager](#the-nx-repo-switches-to-pnpm-for-its-package-manager)
· [Learn more](#learn-more)
## Heres how to Upgrade with Nx Migrate
## Here's how to Upgrade with Nx Migrate
As with all new Nx releases, `nx migrate` can be used to bump your Nx packages to the appropriate version, as well as run any necessary changes to your codebase.
@@ -41,7 +42,7 @@ nx migrate latest
This will update your dependencies to the latest version, as well as update those dependencies in your root `package.json` file.
If further migrations are available, youll see a `migrations.json` file in the root of your workspace. This file will describe any further code generation scripts that should be run. To run these, use the command..
If further migrations are available, you'll see a `migrations.json` file in the root of your workspace. This file will describe any further code generation scripts that should be run. To run these, use the command..
```
nx migrate --run-migrations
@@ -2,8 +2,9 @@
title: 'Introducing the Nx Champions Program'
slug: 'introducing-the-nx-champions-program'
authors: ['Isaac Mann']
cover_image: '/blog/images/2023-05-16/cVGLh0H-uOpy7-D6.png'
cover_image: '/blog/images/2023-05-16/cVGLh0H-uOpy7-D6.avif'
tags: [nx]
description: Introducing the Nx Champions program, recognizing and supporting community leaders in Nx expertise, content creation, and community bridging.
---
The Nx community is too large to be adequately supported by the Nx team alone. Luckily, there are many people who volunteer their time and expertise to help others and share how they use Nx to solve their problems. We are launching the Nx Champions program as a way of acknowledging the work of key members of the community and supporting them in their ongoing efforts.
@@ -19,7 +20,7 @@ A full list of Nx Champions is available at [/community](/community).
![](/blog/images/2023-05-16/j58ocCsWEnDe4-8ZMsQd5g.avif)
_List of Nx Champions_
We appreciate everyone who was part of the initial group of Nx Champions, but acknowledge that there are more people who could qualify. If you are interested in joining the program, fill out the [application form](https://forms.gle/wYd9mC3ka64ki96G7) and lets talk about it.
We appreciate everyone who was part of the initial group of Nx Champions, but acknowledge that there are more people who could qualify. If you are interested in joining the program, fill out the [application form](https://forms.gle/wYd9mC3ka64ki96G7) and let's talk about it.
## Learn more about Nx
@@ -2,19 +2,20 @@
title: 'Determine your User Location with Netlify Edge Functions'
slug: 'determine-your-user-location-with-netlify-edge-functions'
authors: ['Nicholas Cunningham']
cover_image: '/blog/images/2023-05-26/G2ynKDm6DIKLcZ2fJlV0dw.png'
cover_image: '/blog/images/2023-05-26/G2ynKDm6DIKLcZ2fJlV0dw.avif'
tags: [nx, tutorial]
description: A guide to user location detection using Nx and Netlify Edge Functions, with serverless function setup, IP geolocation integration, and deployment for region-aware web apps.
---
Today, we will explore how to use `@nx/netlify` serverless functions to determine a users location. This can be an incredibly useful feature in various applications, such as customizing user experiences based on their region, displaying localized content, or tracking user demographics for marketing purposes. In this post, well walk you through a step-by-step guide on implementing this functionality using `@nx/netlify` serverless functions.
Today, we will explore how to use `@nx/netlify` serverless functions to determine a user's location. This can be an incredibly useful feature in various applications, such as customizing user experiences based on their region, displaying localized content, or tracking user demographics for marketing purposes. In this post, we'll walk you through a step-by-step guide on implementing this functionality using `@nx/netlify` serverless functions.
Before we get started though, heres a video introduction to the new `@nx/netlify` package:
Before we get started though, here's a video introduction to the new `@nx/netlify` package:
{% youtube src="https://youtu.be/idH6GCkWq0w" /%}
### Step 1: Set up your Nx workspace with Netlify
To get started, you need to have an Nx workspace. If you havent already, create a new Nx workspace by running:
To get started, you need to have an Nx workspace. If you haven't already, create a new Nx workspace by running:
```shell
npx create-nx-workspace user-location --preset=@nx/netlify
@@ -29,9 +30,9 @@ mkdir src/functions/user-location
touch src/functions/user-location/user-location.ts
```
### Step 3: Determine the users location
### Step 3: Determine the user's location
To determine the users location, we will leverage the `request.headers` object, specifically the `x-forwarded-for` header containing the users IP address. We can then use an IP geolocation API like ipapi ([https://ipapi.co/](https://ipapi.co/)) to fetch location data based on this IP address.
To determine the user's location, we will leverage the `request.headers` object, specifically the `x-forwarded-for` header containing the user's IP address. We can then use an IP geolocation API like ipapi ([https://ipapi.co/](https://ipapi.co/)) to fetch location data based on this IP address.
_Note_ in **Node.js 18**, the experimental global fetch API is available by default. If you are using a node version **lower** than **18** you can install `node-fetch` to handle API requests:
@@ -72,7 +73,7 @@ export const handler: Handler = async (event, _) => {
When we created our workspace, the initial scaffolding generated a **deploy-target** inside our `project.json`.
> A **target** is a specific task you can run for a project.
> You can think of it as a script/command that does a specific job. The most common targets are build, serve, test, lint, deploy, etc. For more information regarding `project.json` you can read about it at [project-configuration](/reference/project-configuration)
> You can think of it as a script/command that does a specific job. The most common targets are "build", "serve", "test", "lint", "deploy", etc. For more information regarding `project.json` you can read about it at [project-configuration](/reference/project-configuration)
We can start off by creating our site on Netlify by running:
@@ -88,7 +89,7 @@ Now, to deploy your serverless function run:
nx run deploy
```
Finally, navigate to your Netlify sites Functions tab, and you should see your `user-location` function deployed and ready to use!
Finally, navigate to your Netlify site's Functions tab, and you should see your `user-location` function deployed and ready to use!
For example, ours can be found at: [https://644a9b17d0299b00b581b33f--find-user-location.netlify.app/.netlify/functions/user-location](https://644a9b17d0299b00b581b33f--find-user-location.netlify.app/.netlify/functions/user-location)
@@ -96,7 +97,7 @@ For example, ours can be found at: [https://644a9b17d0299b00b581b33f--find-user-
{ "location": { "city": "Miami", "region": "Florida", "country": "US" } }
```
By following these steps, youve successfully used `@nx/netlify` serverless function to determine a users location!
By following these steps, you've successfully used `@nx/netlify` serverless function to determine a user's location!
### Wrapping up
@@ -2,31 +2,32 @@
title: 'Introducing Nx Ecosystem CI'
slug: 'introducing-nx-ecosystem-ci'
authors: ['Katerina Skroumpelou']
cover_image: '/blog/images/2023-06-20/EffyLKcVe5gE_x3MT8PJUQ.png'
cover_image: '/blog/images/2023-06-20/EffyLKcVe5gE_x3MT8PJUQ.avif'
tags: [nx]
description: Introducing Nx Ecosystem CI, a Vite-inspired automated testing framework for Nx ecosystem compatibility, pre-release testing, migration checks, and test suite management.
---
The JavaScript ecosystem evolves at a rapid pace, frequently introducing new tools and packages. At Nx, we provide out-of-the-box integrations with the most popular among them so you dont have to worry when stitching them together. That, however…yes you guessed it… can be a challenging task. Theres just one way to keep up: automation.
The JavaScript ecosystem evolves at a rapid pace, frequently introducing new tools and packages. At Nx, we provide out-of-the-box integrations with the most popular among them so you don't have to worry when stitching them together. That, however…yes you guessed it… can be a challenging task. There's just one way to keep up: automation.
We already run a ton of automated testing on our repository to ensure we dont break anything. But given Nxs popularity and vast usage across open source and enterprise projects, we want to go a step further: introducing the [Nx Ecosystem CI](https://github.com/nrwl/nx-ecosystem-ci). Inspired by the work done by our friends on the [Vite](https://vitejs.dev/) team, the [Nx Ecosystem CI](https://github.com/nrwl/nx-ecosystem-ci) is designed to enhance the stability of Nx by testing pre-release versions with projects in the Nx ecosystem.
We already run a ton of automated testing on our repository to ensure we don't break anything. But given Nx's popularity and vast usage across open source and enterprise projects, we want to go a step further: introducing the [Nx Ecosystem CI](https://github.com/nrwl/nx-ecosystem-ci). Inspired by the work done by our friends on the [Vite](https://vitejs.dev/) team, the [Nx Ecosystem CI](https://github.com/nrwl/nx-ecosystem-ci) is designed to enhance the stability of Nx by testing pre-release versions with projects in the Nx ecosystem.
### Inspired by the Vite Ecosystem CI
The [Vite Ecosystem CI](https://github.com/vitejs/vite-ecosystem-ci) is an innovative tool that has significantly enhanced the use of [Vite](https://vitejs.dev/). It monitors the compatibility of Vite with various other packages and projects in the ecosystem by running tests against the latest changes in the Vite codebase and the projects it integrates with. This allows the Vite team to catch issues early and maintain a high level of stability, ensuring that developers using Vite can trust that new contributions to either Vite or their project will not result in breaking changes.
This robust testing system is essential because it gives users confidence in Vites reliability, encouraging more developers to adopt Vite. Its a great example of proactive testing in a fast-paced ecosystem and an inspiration for other projects, including Nx. The concept of the Ecosystem CI introduces a framework-agnostic way of testing integrations of one tool with other tools in the ecosystem. It puts together a syntax with which tools can easily find the way to test their latest versions with one another.
This robust testing system is essential because it gives users confidence in Vite's reliability, encouraging more developers to adopt Vite. It's a great example of proactive testing in a fast-paced ecosystem and an inspiration for other projects, including Nx. The concept of the Ecosystem CI introduces a framework-agnostic way of testing integrations of one tool with other tools in the ecosystem. It puts together a "syntax" with which tools can easily find the way to test their latest versions with one another.
### Nx Ecosystem CI
The [Nx Ecosystem CI](https://github.com/nrwl/nx-ecosystem-ci) is a fork of the [Vite Ecosystem CI](https://github.com/vitejs/vite-ecosystem-ci) but is tailored specifically for the Nx ecosystem. Its designed to ensure that Nx maintains its high standards of reliability and compatibility with all our users.
The [Nx Ecosystem CI](https://github.com/nrwl/nx-ecosystem-ci) is a fork of the [Vite Ecosystem CI](https://github.com/vitejs/vite-ecosystem-ci) but is tailored specifically for the Nx ecosystem. It's designed to ensure that Nx maintains its high standards of reliability and compatibility with all our users.
### How Nx Ecosystem CI Works
The Nx Ecosystem CI works in the following way:
1. It clones the provided repo which uses Nx
2. It installs the projects dependencies
3. It runs a number of scripts specified by the projects author (eg. `test`, `build`, `e2e`)
2. It installs the project's dependencies
3. It runs a number of scripts specified by the project's author (eg. `test`, `build`, `e2e`)
4. It migrates the repository to the `next` version of Nx (using `nx migrate next`)
5. It runs the scripts again
6. It reports the results of the runs to the [Nx Official Discord Server](https://go.nx.dev/community)
@@ -49,7 +50,7 @@ import { RunOptions } from '../types';
`RunOptions` is a type that represents the options for running a test suite. It includes properties such as the repository to test, the branch to use, and the commands to run for building, testing, and performing e2e tests (all optional).
Next, you need to define the `test` function that accepts the `RunOptions`. Within this function, youll call the `runInRepo` function, passing in the options as well as any specific properties required for your suite:
Next, you need to define the `test` function that accepts the `RunOptions`. Within this function, you'll call the `runInRepo` function, passing in the options as well as any specific properties required for your suite:
Again, using the example of `nx-rspack`:
@@ -66,11 +67,11 @@ export async function test(options: RunOptions) {
}
```
In this example, the suite is set up to run on the nrwl/nx-labs repository on the `main` branch. It will run `build rspack`, `test rspack`, and `e2e rspack-e2e` as its build, test, and e2e tests respectively. These commands will be invoked using the package manager used by your repository. So, in the `nx-labs` case, it will run `yarn build rspack` in the `nrwl/nx-labs` repo.
In this example, the suite is set up to run on the 'nrwl/nx-labs' repository on the `main` branch. It will run `build rspack`, `test rspack`, and `e2e rspack-e2e` as its build, test, and e2e tests respectively. These commands will be invoked using the package manager used by your repository. So, in the `nx-labs` case, it will run `yarn build rspack` in the `nrwl/nx-labs` repo.
For this reason, adding a new test suite to the Nx Ecosystem CI also requires setting up appropriate `scripts` in your repositorys `package.json` file. These scripts provide the commands that will be invoked by your package manager to carry out the `build`, `test`, and `e2e` steps.
For this reason, adding a new test suite to the Nx Ecosystem CI also requires setting up appropriate `scripts` in your repository's `package.json` file. These scripts provide the commands that will be invoked by your package manager to carry out the `build`, `test`, and `e2e` steps.
Heres an example of how scripts might be configured in a package.json file for a repository using Nx:
Here's an example of how scripts might be configured in a package.json file for a repository using Nx:
```
"scripts": {
@@ -84,7 +85,7 @@ Heres an example of how scripts might be configured in a package.json file fo
These scripts should be set up in such a way that they can be invoked directly by your package manager. For example, in a repository using `pnpm`, you could run the build script with the command `pnpm run build`.
When you create your test suite file, youll specify these script names in the `build`, `test`, and `e2e` properties of the `options` object passed to `runInRepo`.
When you create your test suite file, you'll specify these script names in the `build`, `test`, and `e2e` properties of the `options` object passed to `runInRepo`.
```
export async function test(options: RunOptions) {
@@ -103,14 +104,14 @@ With this setup, the Nx Ecosystem CI will run these scripts in your repository a
In addition to creating the test suite and setting up the package.json scripts, you will also need to add the name of the new suite to the workflow configuration files in the `.github/workflows` directory of the Nx Ecosystem CI repository. This suite name should match the filename of your test suite script.
There are two workflow files youll need to update:
There are two workflow files you'll need to update:
- `.github/workflows/ecosystem-ci-selected.yml`
- `.github/workflows/ecosystem-ci.yml`
In `.github/workflows/ecosystem-ci.yml` youll find a strategy section with a `matrix` property. This `matrix` property specifies an array of suite names for the workflow to run. Youll need to add your new suite name to this array.
In `.github/workflows/ecosystem-ci.yml` you'll find a strategy section with a `matrix` property. This `matrix` property specifies an array of suite names for the workflow to run. You'll need to add your new suite name to this array.
Heres what the strategy section might look like after adding a new suite named `my-new-suite`:
Here's what the strategy section might look like after adding a new suite named `my-new-suite`:
```
strategy:
@@ -123,11 +124,11 @@ strategy:
- my-new-suite # your new suite
```
By adding your suite name to this file, youre instructing the Nx Ecosystem CI to include your suite in its test runs.
By adding your suite name to this file, you're instructing the Nx Ecosystem CI to include your suite in its test runs.
In addition to the `.github/workflows/ecosystem-ci.yml` file, you also need to include your suite in the `.github/workflows/ecosystem-ci-selected.yml` file.
The `ecosystem-ci-selected.yml` workflow is designed to allow manual selection of a test suite to run. To add a suite to this workflow, you add it to the options array under `workflow_dispatch > inputs > suite`. Heres what it might look like with a new suite named `my-new-suite`:
The `ecosystem-ci-selected.yml` workflow is designed to allow manual selection of a test suite to run. To add a suite to this workflow, you add it to the options array under `workflow_dispatch > inputs > suite`. Here's what it might look like with a new suite named `my-new-suite`:
```
on:
@@ -172,7 +173,7 @@ We are not alone in recognizing the value of an Ecosystem CI approach. Other OSS
- Rspack: [https://github.com/web-infra-dev/rspack-ecosystem-ci](https://github.com/web-infra-dev/rspack-ecosystem-ci)
- Storybook: [https://storybook.js.org/blog/storybook-ecosystem-ci/](https://storybook.js.org/blog/storybook-ecosystem-ci/)
As we continue to improve and refine the Nx Ecosystem CI, we remain committed to the goal of making Nx a reliable and integral part of your development workflow. If youre an open-source maintainer, you can create your own Ecosystem CI either from scratch (like Storybook) or by cloning the Vite Ecosystem CI. If your project uses Nx, you can easily add a new test suite for it.
As we continue to improve and refine the Nx Ecosystem CI, we remain committed to the goal of making Nx a reliable and integral part of your development workflow. If you're an open-source maintainer, you can create your own Ecosystem CI either from scratch (like Storybook) or by cloning the Vite Ecosystem CI. If your project uses Nx, you can easily add a new test suite for it.
## Learn more
+337
View File
@@ -1,9 +1,346 @@
---
title: Nx Console gets Lit
slug: 'nx-console-gets-lit'
authors: [Max Kless]
cover_image: '/blog/images/2023-06-29/featured_img.avif'
tags: [nx, nx-console]
description: Nx Console's Generate UI rebuilt with Lit for a faster, more maintainable experience across VSCode and JetBrains IDEs.
---
Over the last few weeks, we rebuilt one of Nx Console's most liked features from the ground up: The Generate UI. It looks better, loads faster, and preliminary research shows using it makes you happier, too ;)
You can use it today by installing the latest version of Nx Console for VSCode and JetBrains IDEs! 🎉🎉🎉
- [Nx Console on the VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)
- [Nx Console on the JetBrains Marketplace](https://plugins.jetbrains.com/plugin/21060-nx-console)
If you're curious to learn more about the rewrite and the motivations behind it, this is the blog post for you! We'll touch on these topics and more:
- Why did we choose to rewrite?
- What's Lit and why did we use it over Angular?
- How did the rewrite go and what Lit features were important for us?
- What does the performance look like before and after?
{% youtube src="https://www.youtube.com/embed/p455D4W7330?si=FRbiKJhGxT8dYzf9" /%}
## Background: Why Migrate from Angular to Lit?
### A Short History of Nx Console
Let's go back in time: Nx Console has been around for a while. It first launched in 2018 — then called Angular Console — as a standalone Electron app which let you run Angular schematics and builders from a graphical interface. Of course, it was built with Angular and looked something like this:
![Screenshot of the original Angular Console electron app](/blog/images/2023-06-29/bodyimg1.webp)
In 2019, it was ported to a VSCode extension with the now familiar UI and support for the standalone app was dropped.
In 2020, support for the entire Nx ecosystem was added, it was renamed to Nx Console and an amazing transformation began: Today, Nx Console is much more than just a single form — it tightly integrates Nx into your IDE, gives you the overview of your projects that you need and puts your task-running just a click away.
### Rewriting in Lit
This evolution brought significant improvements to the usability of Nx Console and the value we could provide to developers, but not without presenting its own set of challenges. Inevitably, the codebase grew complex and convoluted over time — the context in which it ran changed, the scope of the product changed, yet the technology remained the same. Adding small features or fixing bugs became increasingly time consuming, and every PR compounded the problem.
The UI looked somewhat outdated and had been built with only VSCode in mind — which became painfully obvious when support for JetBrains IDEs was added. While the web-based nature of the Generate UI allowed us to reuse the code in the new environment, the design looked out of place.
In addition, we started questioning our usage of Angular. Angular is a great framework for building web apps, and in the original context of Angular Console, it made a lot of sense: A tool built by and for Angular engineers — of course it's written in Angular. But things changed, and Angular started to feel overkill for what we needed. Angular has a huge number of features right out of the box. But for our simple form, we didn't need routing, http requests or modules to organize our code. The amount of boilerplate and overhead Angular introduces is significant.
So, ultimately, **we decided to pull the plug and rewrite the entire thing in [Lit](https://lit.dev/).**
Lit is a lightweight framework built on top of web components and "adds just what you need to be happy and productive: reactivity, declarative templates and a handful of thoughtful features to reduce boilerplate and make your job easier" (taken from their docs). We had used it before to [build the Nx Cloud view](/blog/nx-console-meets-nx-cloud) and were happy with the simple setup and great DX. So the decision to reuse it here was an easy one, since it allowed us to reuse code, build tooling and expertise. The rewrite also gave us the opportunity to improve the design for both supported IDEs and give the entire UI a clean, new coat of paint.
![Screenshot of the reworked generate ui](/blog/images/2023-06-29/bodyimg2.webp)
Before I dive deeper into specifics, let's have a look at the general architecture of Nx Console first.
## Nx Console Architectural Overview
Nx Console is composed of 3 core parts:
- The **nxls** is a language server based on the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) and acts as the "brain" of Nx Console. It analyzes your Nx workspace and provides information on it, including code completion and more.
- The **Generate UI** is the form-based view for running Nx generators.
- The **platform-specific wrappers**. These are written in Typescript and Kotlin and connect the rest of Nx Console to IDE-specific APIs. Having the other parts separate greatly reduces the amount of duplicated code we have to write in order to support multiple IDEs
This architecture's modularity meant we could quickly switch out the Generate UI for a new version without significantly impacting the rest of the codebase — only the parts that actually render the UI and communicate with it had to be adjusted slightly. It also allowed us to ensure backward compatibility: the old generate UI is still available via a feature toggle in the settings.
If you want to dive deeper, there are many more resources on the architecture of Nx Console and how it's built:
- [In-depth blog post about expanding to JetBrains IDEs](/blog/expanding-nx-console-to-jetbrains-ides)
- [Accompanying Youtube video by Zack DeRose](https://www.youtube.com/watch?v=xUTm6GDqwJM)
- [The Power of Nx Console — talk by Jon Cammisuli](https://www.youtube.com/watch?v=3C_9g9kt2KM)
## Migrating to Lit: Step by Step
To rebuild our UI, we first needed a new Lit app to work on. While there's no native Nx plugin for Lit, generating the code we need was still very straightforward:
`nx generate @nx/web:app apps/generate-ui-v2`
This generates an entire project for us, with a `tsconfig.json`, `index.html`, `main.ts`, and a `project.json`, where our Nx-specific config lives.
I also installed a couple of dependencies:
- The `@nx/esbuild` plugin because I like fast build times 🏎️
- TailwindCSS because I don't like writing CSS 🤫
- `@vscode/webview-ui-toolkit` because it does all of the VSCode work for me 🤖
This is really where Nx shines, because it allows you to take these tools and quickly patch them together and build a pipeline that does exactly what you need. And it also allows you to think about your workspace visually. This is what this is what my task graph for building the Lit app ultimately looks like:
![Nx task graph for building the Lit webview](/blog/images/2023-06-29/bodyimg3.webp)
You can see three build steps:
- `generate-ui-v2:_build` uses esbuild to bundle my Lit components written in Typescript and spits out a `main.js` file
- `generate-ui-v2:extract-dependencies` copies the third party assets we need into the dist folder. Right now it's just codicons `.css` and `.ttf` files.
- `generate-ui-v2:build` finally runs tailwind over the bundled code. This could also be done with `postCss` or a custom `esbuild` plugin but running tailwind directly is the easier, so why complicate things?
> 💡 There are different ways to generate this visualisation for your own workspaces:
>
> - In VSCode, use the Nx Project View or the `Nx: Focus task in Graph` action
> - In JetBrains IDEs, use the Nx Toolwindow or context menus
> - In the command line, run `nx build {{your project}} --graph`
In the bigger context of Nx Console, here's what happens when you build the VSCode extension:
![Nx task graph for building the VSCode extension](/blog/images/2023-06-29/bodyimg4.webp)
You can see that we're still building both the new & old generate UI as well as the Nxls and the Nx Cloud webview before combining them all into one VSCode extension artifact.
### Building the Form
Lit is a very small library that provides useful abstractions over browser-native features like web components and messages. Here's what a simple Lit component, written with Typescript, looks like:
```ts {% fileName="main.ts" %}
@customElement('root-element')
export class Root extends LitElement {
render() {
return html`<p>Hello World</p>`;
}
}
```
```html {% fileName="index.html" %}
<!DOCTYPE html>
<html lang="en">
<body>
<script type="module" src="main.js"></script>
<root-element></root-element>
</body>
</html>
```
If you need to pass information up the DOM, you use normal events and you can set properties to send information to descendants. Check out the [Lit Docs](https://lit.dev/docs/components/rendering/) to learn more about how the render() method works, how to leverage reactivity, the shadow DOM and so much more.
> 💡 All code samples in this section have been adapted for brevity and clarity. So you won't find this exact code anywhere, but it demonstrates the concepts well.
### Communicating with the IDE — using Reactive Controllers
To communicate with the host IDE, we were able to reuse almost all the logic from the previous UI (for more details, see [Communicating with IntelliJ](/blog/expanding-nx-console-to-jetbrains-ides) from the last blog post). Instead of a service that exposes observables that our component can consume, we used a [Reactive Controller](https://lit.dev/docs/composition/controllers/). Controllers are a neat feature of Lit — they hook into a component and can request DOM updates on their behalf. This eliminates the need for observable streams and subscriptions while keeping the communication code self-contained. Look at this example:
```ts {% fileName="main.ts" %}
@customElement('root-element')
export class Root extends LitElement {
icc: IdeCommunicationController;
constructor() {
super();
this.icc = new IdeCommunicationController(this);
}
render() {
return html`${JSON.stringify(this.icc.generatorSchema)}`;
}
}
```
```ts {% fileName="ide-communication-controller.ts" %}
// ide-communication-controller.ts
export class IdeCommunicationController implements ReactiveController {
generatorSchema: GeneratorSchema | undefined;
constructor(private host: ReactiveControllerHost) {}
// ...
private handleMessageFromIde(message: InputMessage) {
// ...
this.generatorSchema = message.payload;
this.host.requestUpdate();
}
}
```
You can see that `root-element` can really just deal with rendering the form contents, delegating communicating with the IDE and when to update the DOM to the controller.
### Rendering the form fields — using Mixins
The core part of the UI is the form. We built all kinds of inputs: text fields, checkboxes, (multi-) select boxes and array fields. While those each have unique implementations, displaying them is also going to take a lot of repeated code. Every fields needs a label and description. Every field needs to know about its validation state, how dispatch change events and what aria attributes to set. In order to keep this code clean and DRY, we used [Class Mixins](https://lit.dev/docs/composition/mixins/). Mixins aren't really a Lit-specific feature, but I don't see them used much in other frameworks. A mixin is essentially a factory that takes a class and returns another, modified class. Check out this example:
```ts {% fileName="field-mixin.ts" %}
const Field = (superClass) =>
class extends superClass {
// we can define (reactive) properties that every field is going to need
@property()
option: Option;
protected get fieldId(): string {
return `${this.option.name}-field`;
}
// we can define methods that should be available to all fields
dispatchValue(value: string) {
// ...
}
};
```
```ts {% fileName="field-wrapper-mixin.ts" %}
const FieldWrapper = (superClass) =>
class extends superClass {
// we can define a render() method so that fields are all rendered the same
protected render() {
return html` <label for="${this.fieldId}">${this.option.name}</label>
<p>${this.option.description}</p>
${this.renderField()}`;
}
};
```
```ts {% fileName="input-field.ts" %}
@customElement('input-field')
export class InputField extends FieldWrapper(Field(LitElement)) {
renderField() {
return html` <input
id="${this.fieldId}"
@input="${(e) => this.dispatchValue(e.target.value)}"
/>`;
}
}
```
You can see that each component and mixin deals with a specific subset of the overall logic, keeping our code cleanly separated and reusable. A checkbox, for example, is a special case because it's layout on the page is slightly different — no problem, we simply wrote a CheckboxWrapper with some modifications without having to worry about changing the checkbox logic itself.
> 💡 Properly typing mixins is complicated so I left that part out. Refer to [Mixins in Typescript](https://lit.dev/docs/composition/mixins/#mixins-in-typescript) to learn more or [check out our source code on GitHub](https://github.com/nrwl/nx-console).
### Injecting Services & Data — Lit Context
If you're coming from the Angular world, you probably appreciate the great dependency injection (DI) mechanism they have. You can centrally define some services and reuse them across your app, without thinking about passing on props from component to component — the DI system takes care of it. Lit provides something similar via the []`@lit-labs/context`](https://lit.dev/docs/data/context/) package. It's based on the [Context Community Protocol](https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md) and similar to React's context API.
Under the hood, it still works with normal browser events, but it abstracts it away from you so you can easily share data and services across your app.
The Generate UI is rendered in both VSCode and JetBrains IDEs. In order to look appropriate, components need to know which environment they're in and adjust styling accordingly. Instead of passing this information from component to component, we can make it available contextually! And with a proper mixin, reading the editor context only has to be implemented once, too.
Have a look at the following example:
```ts {% fileName="editor-context.ts" %}
export const editorContext = createContext<'vscode' | 'intellij'>(
Symbol('editor')
);
const EditorContext = (superClass) =>
class extends superClass {
@consume({ context: editorContext })
@state()
editor: 'vscode' | 'intellij';
};
```
```ts {% fileName="ide-communication-controller.ts" %}
export class IdeCommunicationController implements ReactiveController {
// ...
constructor(private host: ReactiveElement) {
const editor = isVscode() ? 'vscode' : 'intellij';
// provide the context to all DOM children of the host element
new ContextProvider(host, {
context: editorContext,
initialValue: editor,
});
}
}
```
```ts {% fileName="some-component.ts" %}
@customElement('some-component')
export class SomeComponent extends EditorContext(LitElement) {
render() {
return html`<p>I am rendered in ${this.editor}</p>`;
}
}
```
### VSCode Webview UI Toolkit
As we mentioned above, a big part of why we rewrote the UI is that it looked quite out of place in JetBrains IDEs. It was still useful, of course, but it's important to make sure the form _feels_ right.
In VSCode, this is very easy to achieve, thanks to the [VSCode Webview UI Toolkit](https://github.com/microsoft/vscode-webview-ui-toolkit). It's a set of web components, provided by Microsoft, that are designed to look good and be used in VSCode webviews.
![Sample image of the VSCode Webview UI Toolkit showing the different components it provides](/blog/images/2023-06-29/bodyimg5.webp)
Using it, you get the native look, a11y, and theme-aware styling for free! Thanks to everyone who built it, it's a huge help!
### E2E Testing with Cypress
One big upside of using a webview is the huge Javascript ecosystem is available to you! To make sure that no regressions are introduced later on, we use [Cypress](https://www.cypress.io/). We can mock the editor communication and provide different schemas, make sure the form is rendered correctly and the right messages are sent back to the IDE.
While there's no particular Lit integration for Cypress, the tool itself is framework agnostic so it still works perfectly fine. Using the [`@nx/cypress`](/nx-api/cypress) executors did most of the work for us so setup was pretty quick too.
### Results: Comparing Performance
There's a number of different aspects to performance we can compare between the two implementations. The biggest one by far is not really quantifiable: The maintainability and looks of the new UI. In my opinion, it looks a lot fresher and more native in both environments. We got rid of a lot of legacy code and the new version is easier to reason about and work with.
But there are thing we _can_ measure, so let's talk numbers!
### Startup Time
It takes time to bootstrap a large framework like Angular, so skipping that, the UI should load quicker than before.
We measured the median time it took to render all options of the `@nx/angular:application` generator in both VSCode and IntelliJ. You can see that the results are pretty clear-cut, even though they are not hugely impactful.
Old UI (Angular)New UI (Lit)SpeedupVSCode65 ms39 ms~ 1.7xIntelliJ189 ms122 ms~ 1.5x
### Bundle Size
As mentioned earlier, Angular comes with a lot more features out-of-the-box than Lit, so it would make sense that the built bundle will be bigger.
We were able to reduce the bundle size (w/o compression) from about 733 kB to 282 kB, which comes out to about a 2,6x decrease. Unlike a website, where the bundle needs to be shipped to users when they load a page, Nx Console users only need to download it once when installing the plugin. This means we're not affected by network speeds after installation, which makes the bundle size less critical.
> 💡 Because of a misconfiguration from a few Angular versions ago, the bundle size that we reported in [this tweet](https://twitter.com/MaxKless/status/1671095858182381569) was overly bloated. We corrected it, but Lit still came out ahead in terms of size and rendering times.
### Build Time
While it might not be important to users of Nx Console, the time it takes to build the project makes a difference to us developers.
Since Lit is just javascript files that don't require a custom compiler or build tooling, we decided to use [`esbuild`](https://esbuild.github.io/) (via `@nx/esbuild`), which is written in Go and extremely fast. On the other hand, the old UI used the `@angular-builders/custom-webpack:browser` builder, which uses webpack under the hood.
We went from about 3.5 seconds to less than 2 seconds of build time, which is less of an improvement than we expected. Since we also have to run tailwind over our files, some of that additional `esbuild` speed seems to be relativized.
## Looking Ahead
Rebuilding the UI has paved the road to reduce a lot of the maintenance burden of Nx Console. It will allow us to move even quicker on building new features to provide the best developer experience possible for you.
Specifically, the updated architecture enabled us to build a (still secret and WIP) plugin feature for Nx Console. Just like Nx, there are always going to be things that are unique to your workspace. We want to make it easy for you to extend and modify Nx Console in ways that help you make the most of using it.
So keep your eyes peeled for announcements and let us know via GitHub or Twitter if you have any ideas! We'd love to chat.
## One more thing!
Nx Console is a tool by developers for developers and there's one thing we love — keyboard shortcuts. So of course we had to build some in. In addition to being keyboard-friendly and tabbable, you can do the following:
- `Cmd/Ctrl + Enter` to run the generator
- `Cmd/Ctrl + Shift + Enter` to start a dry run
- `Cmd/Ctrl + Shift + S` to focus the search bar and look for a specific option. Just `tab` to get back to the form
If the prettier UI and better performance haven't convinced you, this surely will! 😉
---
## Learn more
- [Nx Docs](/getting-started/intro)
- [X/Twitter](https://twitter.com/nxdevtools) -- [LinkedIn](https://www.linkedin.com/company/nrwl/)
- [Nx GitHub](https://github.com/nrwl/nx)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
---
title: Nx Console gets Lit
slug: 'nx-console-gets-lit'
authors: [Max Kless]
cover_image: '/blog/images/2023-06-29/featured_img.webp'
tags: [nx, nx-console]
---
Over the last few weeks, we rebuilt one of Nx Consoles most liked features from the ground up: The Generate UI. It looks better, loads faster, and preliminary research shows using it makes you happier, too ;)
+23 -22
View File
@@ -2,21 +2,22 @@
title: 'Nx 16.5 Release!!!'
slug: 'nx-16-5-release'
authors: ['Zack DeRose']
cover_image: '/blog/images/2023-07-06/Gm3s_wLWrAf_uH2AzfJvvQ.png'
cover_image: '/blog/images/2023-07-06/Gm3s_wLWrAf_uH2AzfJvvQ.avif'
tags: [nx, release]
description: Nx 16.5 released with tag-based task targeting, NextJS 13 support, new recipes, Angular 16 compatibility, Verdaccio integration, custom CLI, external dependencies input, ESLint rule, and Rust integration for performance.
---
We have launched SO MANY features since our last release blog on Nx 16.0, so were covering the major features in this blog!
We have launched SO MANY features since our last release blog on Nx 16.0, so we're covering the major features in this blog!
{% youtube src="https://youtu.be/7XLoLOc3afY" /%}
Be sure to mark your calendars for our Nx 16.5 livestream as well! Well highlight the features you see here AND field any questions live! Follow the link to schedule a notification for when we go live:
Be sure to mark your calendars for our Nx 16.5 livestream as well! We'll highlight the features you see here AND field any questions live! Follow the link to schedule a notification for when we go live:
{% youtube src="https://youtu.be/EYgkKmYbRNI" /%}
## Targetting Tasks By Tags
Our first major feature actually comes to us from the community. Nx has supported a tags property in your project.json file for awhile now — and its main purpose has been to be used in conjuncture with the [Nx Module Boundary lint rule](/features/enforce-module-boundaries) to define which projects in your Nx workspace can depend on what — for example, you dont want your frontend applications to depend on any backend-specific code.
Our first major feature actually comes to us from the community. Nx has supported a tags property in your project.json file for awhile now — and it's main purpose has been to be used in conjuncture with the [Nx Module Boundary lint rule](/features/enforce-module-boundaries) to define which projects in your Nx workspace can depend on what — for example, you don't want your frontend applications to depend on any backend-specific code.
With this new feature, you can add the `--tag` option to the [`nx affected`](/nx-api/nx/documents/affected) and [`nx run-many`](/nx-api/nx/documents/run-many) commands to specify to Nx to only run commands for projects that match the given tags.
@@ -24,15 +25,15 @@ With this new feature, you can add the `--tag` option to the [`nx affected`](/nx
## NextJS 13 Support
React Server Components and the new NextJS app router are here, and Nx is here to support them. Weve added support for the latest versions of Next — complete with generators and executors. Weve also made sure that our [`withNx` NextJS plugin](/recipes/next/next-config-setup), which allows you to import from your other projects in your workspace while still working with the NextJS build scripts, works both for workspaces using our executors in an Integrated Monorepo approach, as well as for those using a Package-Based approach that are simply using the `next dev` command directly to start their dev server.
React Server Components and the new NextJS app router are here, and Nx is here to support them. We've added support for the latest versions of Next — complete with generators and executors. We've also made sure that our [`withNx` NextJS plugin](/recipes/next/next-config-setup), which allows you to import from your other projects in your workspace while still working with the NextJS build scripts, works both for workspaces using our executors in an Integrated Monorepo approach, as well as for those using a Package-Based approach that are simply using the `next dev` command directly to start their dev server.
Theres also built-in support for the new turbopack builder option via the `--turbo` command, for example: `nx serve webapp --turbo`
There's also built-in support for the new turbopack builder option via the `--turbo` command, for example: `nx serve webapp --turbo`
Weve also launched a new preset for `npx create-nx-workpace` for a standalone NextJS app. Checkout it out using the command: `npx create-nx-workspace@latest --preset=nextjs-standalone` or use the interactive prompts to find it:
We've also launched a new preset for `npx create-nx-workpace` for a standalone NextJS app. Checkout it out using the command: `npx create-nx-workspace@latest --preset=nextjs-standalone` or use the interactive prompts to find it:
![](/blog/images/2023-07-06/EZrDq742M_PZZhgn.avif)
Weve added a couple videos specifically on Next development in an Nx workspace in the past month, so if youre looking for more on Next, be sure to check them out!
We've added a couple videos specifically on Next development in an Nx workspace in the past month, so if you're looking for more on Next, be sure to check them out!
{% youtube src="https://youtu.be/RupxGAQ3fBY" /%}
@@ -42,7 +43,7 @@ Weve added a couple videos specifically on Next development in an Nx workspac
Did you know that we maintain [a set of Nx workspaces](https://github.com/nrwl/nx-recipes) designed to serve as examples for different Nx Workspaces?
Weve recently added examples repos for:
We've recently added examples repos for:
- fastify + mongo
- fastify + postgres
@@ -51,7 +52,7 @@ Weve recently added examples repos for:
- remix
- serverless + fastify + planetscale
Go check it out at [https://github.com/nrwl/nx-recipes](https://github.com/nrwl/nx-recipes) and let us know in the comments if there are more recipes youd like to see or if you want to see videos made from any of the existing recipes!
Go check it out at [https://github.com/nrwl/nx-recipes](https://github.com/nrwl/nx-recipes) and let us know in the comments if there are more recipes you'd like to see or if you want to see videos made from any of the existing recipes!
## Angular 16 Support And Migrations
@@ -59,7 +60,7 @@ Angular is continuing their pattern of releasing new and exciting features — a
As usual, we provide migrations to the most recent Angular version to cover your codebase for any breaking changes going to Angular 16.
And in case you missed it, Nx is no longer tied to your Angular version — the most recent version of Nx will now always [support all currently LTS versions of Angular](/nx-api/angular/documents/angular-nx-version-matrix), meaning you DONT have to upgrade your Angular version in order to get all these latest Nx Features. Be sure to use the `--interactive` flag to take advantage of this feature: `nx migrate latest --interactive`. You can find more details in [our docs for choosing optional packages to apply](/recipes/tips-n-tricks/advanced-update).
And in case you missed it, Nx is no longer tied to your Angular version — the most recent version of Nx will now always [support all currently LTS versions of Angular](/nx-api/angular/documents/angular-nx-version-matrix), meaning you DON'T have to upgrade your Angular version in order to get all these latest Nx Features. Be sure to use the `--interactive` flag to take advantage of this feature: `nx migrate latest --interactive`. You can find more details in [our docs for choosing optional packages to apply](/recipes/tips-n-tricks/advanced-update).
{% youtube src="https://youtu.be/AQV4WFldwlY" /%}
@@ -81,9 +82,9 @@ These tools should help in particular with local testing of publishing packages
The use of command-line interfaces (CLIs) to create new workspaces is common in various technologies. React has one, so does Angular, Vue, Vite and many more. Maintaining a good CLI experience can be tedious though, especially because framework authors would rather want to focus on the library or framework itself.
For a while now, Nx plugin authors had the possibility to create a so-called preset to control the entire Nx workspace structure. Once published it can be invoked by using the `--preset` flag:`npx create-nx-workspace myapp --preset=@my/plugin`. [Qwik-Nx](https://github.com/qwikifiers/qwik-nx) is an example of that.
For a while now, Nx plugin authors had the possibility to create a so-called "preset" to control the entire Nx workspace structure. Once published it can be invoked by using the `--preset` flag:`npx create-nx-workspace myapp --preset=@my/plugin`. [Qwik-Nx](https://github.com/qwikifiers/qwik-nx) is an example of that.
However, many authors would rather want to have a more branded experience. Like being able to invoke the previous example as follows:
However, many authors would rather want to have a more "branded" experience. Like being able to invoke the previous example as follows:
```shell
npx create-qwik-nx myapp
@@ -107,7 +108,7 @@ nx g @nx/plugin:create-package <cli name> --project=<existing plugin name> --e2e
Nx now supports a new input type: `externalDependencies` to add to the existing input types: `filesets`, `runtime` inputs, and `env` variables.
By default, Nx will take the defensive stance of assuming that all packages will affect your commands, meaning all external dependencies are taken into account when hashing your tasks dependencies.
By default, Nx will take the defensive stance of assuming that all packages will affect your commands, meaning all external dependencies are taken into account when hashing your task's dependencies.
The new `externalDependencies` input type allows you to specify a specific set of external dependencies for a given command, so you can configure your tasks to more accurately reflect their inputs.
@@ -126,19 +127,19 @@ For example, if you have a `publish-package` target that is using a `command` of
}
```
This way you are free to change other dependencies that dont affect this task without invalidating your cached run of the task.
This way you are free to change other dependencies that don't affect this task without invalidating your cached run of the task.
{% youtube src="https://youtu.be/FRqgWBmHmAU" /%}
## New `@nx/dependency-checks` EsLint Rule
Weve added a new `@nx/dependency-checks` lint rule to help with detecting any issues when specifying dependencies for your packages.
We've added a new `@nx/dependency-checks` lint rule to help with detecting any issues when specifying dependencies for your packages.
This rule will analyze your source code to determine any dependencies you are using in this specific package, and will catch any missing dependencies, mismatched versions, and unused dependencies in your projects `package.json` file.
This rule will analyze your source code to determine any dependencies you are using in this specific package, and will catch any missing dependencies, mismatched versions, and unused dependencies in your project's `package.json` file.
Even better, this rule supports the `--fix` option to automatically fix any issues that are found - making it a great tool for automating your dependencies.
After migrating your Nx workspace, you should have access to this lint rule. To turn it on, youll need to adjust the `lint` targets in your `project.json` files to include your `package.json` files like so:
After migrating your Nx workspace, you should have access to this lint rule. To turn it on, you'll need to adjust the `lint` targets in your `project.json` files to include your `package.json` files like so:
```json
{
@@ -160,7 +161,7 @@ After migrating your Nx workspace, you should have access to this lint rule. To
}
```
Then in webapp projects `.eslintrc.json` file you'll want to turn the rule on for your json files:
Then in "webapp" project's `.eslintrc.json` file you'll want to turn the rule on for your json files:
```json
{
@@ -188,7 +189,7 @@ Our biggest speed increase has come from moving our task hashing into the Nx Dae
Because the daemon persists between command runs, we are able to have more of the work that goes into hashing a task cached, which we added in Nx 16.3!
In Nx 16.4 we also moved to a rust-based watcher to further improve performance. We had already began the migration of some of the more performance-intensive computation of Nx to Rust in prior version, but were excited to bring more of the core of Nx into Rust and see more of these performance gains!
In Nx 16.4 we also moved to a rust-based watcher to further improve performance. We had already began the migration of some of the more performance-intensive computation of Nx to Rust in prior version, but we're excited to bring more of the core of Nx into Rust and see more of these performance gains!
Since our last benchmarking of Nx in October of last year where we clocked Nx at 276.2ms per command, these speed boosts have now gotten us down to 149.3ms, nearly doubling our speed!!
@@ -209,7 +210,7 @@ As part of the redesign, we also moved our webviews to the Lit framework — che
## Nx Changelog Launched
Last but CERTAINLY not least, weve launched [a new changelog](/changelog) to our docs site!
Last but CERTAINLY not least, we've launched [a new changelog](/changelog) to our docs site!
![](/blog/images/2023-07-06/RewMSU5fPazv_fn.avif)
@@ -217,7 +218,7 @@ This changelog includes links to all the release notes for all major and minor v
## Wrap Up
Thats all for now folks! Were just starting up a new iteration of development on Nx, so be sure to subscribe to [our YouTube channel](https://youtube.com/@nxdevtools) to get updates when new features land! Until next time, KEEP WORKING HARD!
That's all for now folks! We're just starting up a new iteration of development on Nx, so be sure to subscribe to [our YouTube channel](https://youtube.com/@nxdevtools) to get updates when new features land! Until next time, KEEP WORKING HARD!
## Learn more
@@ -2,17 +2,18 @@
title: 'Evergreen Tooling — More than Just CodeMods'
slug: 'evergreen-tooling-more-than-just-codemods'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-07-26/CPiI60mSguYXJzPfAHMbEQ.png'
cover_image: '/blog/images/2023-07-26/CPiI60mSguYXJzPfAHMbEQ.avif'
tags: [nx]
description: Nx's evergreen tooling approach automates migrations, updates code like a database, and uses plugins for seamless JavaScript ecosystem upgrades with backward compatibility and reduced maintenance.
---
As developers we always want to use the latest shiny tools. Theres a new bundler? Lets try! A new code editor, Im in! For your side-project: for sure! At work: nah, not really. Keeping your tooling up to date with the rather fast moving JS ecosystem can be a major challenge. Nx provides a mechanism that can help mitigate that, by providing a command to upgrade your tooling automatically:
As developers we always want to use the latest shiny tools. There's a new bundler? Let's try! A new code editor, I'm in! For your side-project: for sure! At work: nah, not really. Keeping your tooling up to date with the rather fast moving JS ecosystem can be a major challenge. Nx provides a mechanism that can help mitigate that, by providing a command to upgrade your tooling automatically:
```shell
npx nx migrate latest
```
**Prefer a video? Ive got you covered!**
**Prefer a video? I've got you covered!**
{% youtube src="https://www.youtube.com/watch?v=Ss6MfcXi0jE" /%}
@@ -2,13 +2,14 @@
title: 'Storybook Interaction Tests in Nx'
slug: 'storybook-interaction-tests-in-nx'
authors: ['Katerina Skroumpelou']
cover_image: '/blog/images/2023-08-03/NfJA7VBZvDwyyZHmV8qsiw.png'
cover_image: '/blog/images/2023-08-03/NfJA7VBZvDwyyZHmV8qsiw.avif'
tags: [nx]
description: Nx 16.6 introduces Storybook interaction tests, offering automated UI testing, Jest and Playwright integration, and a streamlined workflow.
---
In Nx 16.6 we are introducing our new generators for [Storybook interaction tests](https://storybook.js.org/docs/react/writing-tests/interaction-testing)! These new generators replace the default Cypress tests we used to generate along with a projects Storybook configuration, particularly for those already using Storybook. The intention is that if a user chooses to use Storybook and generate Storybook configuration, to integrate in that experience Storybook Interaction testing, and skip generating Cypress tests, to keep everything in one place, in an integrated experience.
In Nx 16.6 we are introducing our new generators for [Storybook interaction tests](https://storybook.js.org/docs/react/writing-tests/interaction-testing)! These new generators replace the default Cypress tests we used to generate along with a project's Storybook configuration, particularly for those already using Storybook. The intention is that if a user chooses to use Storybook and generate Storybook configuration, to integrate in that experience Storybook Interaction testing, and skip generating Cypress tests, to keep everything in one place, in an integrated experience.
**Prefer a video walkthrough? Weve got you covered**
**Prefer a video walkthrough? We've got you covered**
{% youtube src="https://www.youtube.com/watch?v=SaHoUx-TUs8" /%}
@@ -16,11 +17,11 @@ In Nx 16.6 we are introducing our new generators for [Storybook interaction test
Interaction tests allow users to verify the functional aspects of UIs. This is done by supplying the initial state of a component, simulating user behavior such as clicks and form entries, and finally checking if the UI and component state update correctly. Very much like e2e tests are doing.
In Storybook, this workflow occurs in your browser, which makes it easier to debug failures since youre running tests in the same environment you develop components.
In Storybook, this workflow occurs in your browser, which makes it easier to debug failures since you're running tests in the same environment you develop components.
## How it works
You write a story to set up the components initial state, simulate user behavior using the [play function](https://storybook.js.org/docs/react/writing-stories/play-function), and then use the [test runner](https://storybook.js.org/docs/react/writing-tests/test-runner) to confirm that the component renders correctly and that your interaction tests with the play function pass. [Storybooks Test runner](https://storybook.js.org/docs/react/writing-tests/test-runner) is a standalone utility — powered by Jest and Playwright — that executes all of your interaction tests, and runs parallel to your Storybook.
You write a story to set up the component's initial state, simulate user behavior using the [play function](https://storybook.js.org/docs/react/writing-stories/play-function), and then use the [test runner](https://storybook.js.org/docs/react/writing-tests/test-runner) to confirm that the component renders correctly and that your interaction tests with the play function pass. [Storybook's Test runner](https://storybook.js.org/docs/react/writing-tests/test-runner) is a standalone utility — powered by Jest and Playwright — that executes all of your interaction tests, and runs parallel to your Storybook.
## Setting Up Storybook Interaction Tests on Nx
@@ -28,9 +29,9 @@ You can read our detailed guide on how to set up Storybook interaction tests on
## Writing Interaction Tests in Storybook
An interaction test is defined inside a play function connected to a story. The story simulates the users behavior once it loads in the UI and verifies the underlying logic.
An interaction test is defined inside a play function connected to a story. The story simulates the user's behavior once it loads in the UI and verifies the underlying logic.
Under the hood, Storybooks [@storybook/addon-interactions](https://storybook.js.org/addons/@storybook/addon-interactions) mirrors [Testing Library](https://testing-library.com/)s user-events API. So, you can use the same queries and assertions that you would use for Testing Library, like we already do with our unit tests.
Under the hood, Storybook's [@storybook/addon-interactions](https://storybook.js.org/addons/@storybook/addon-interactions) mirrors [Testing Library](https://testing-library.com/)'s user-events API. So, you can use the same queries and assertions that you would use for Testing Library, like we already do with our unit tests.
For complex flows, it can be worthwhile to group sets of related interactions using the step function. This allows you to provide a custom label that describes a set of interactions.
@@ -41,11 +42,11 @@ Storybook provides an interactive debugger that displays the step-by-step flow o
![](/blog/images/2023-08-03/ZhrFxCwtYkO3gLaU.avif)
_Interaction test for the click of a button._
If an error occurs during a storys play function, itll be shown in the interaction addon panel to help with debugging. And since Storybook is a web app, anyone with the URL can reproduce the error with the same detailed information without any additional environment configuration or tooling required.
If an error occurs during a story's play function, it'll be shown in the interaction addon panel to help with debugging. And since Storybook is a web app, anyone with the URL can reproduce the error with the same detailed information without any additional environment configuration or tooling required.
## Executing and Automating Tests
Storybook only runs the interaction test when youre viewing a story. Therefore, as a Storybook grows, it becomes unrealistic to review each change manually. The Storybook test-runner automates the process by running all tests for you. This can be executed via the command line or on CI environment.
Storybook only runs the interaction test when you're viewing a story. Therefore, as a Storybook grows, it becomes unrealistic to review each change manually. The Storybook test-runner automates the process by running all tests for you. This can be executed via the command line or on CI environment.
## What should I choose? Interaction tests or E2E tests?
@@ -53,7 +54,7 @@ Setting up interaction tests with Nx and Storybook provides an extra layer of co
Storybook interaction tests provide a unique advantage over traditional e2e tests, especially when considering the development setup. With Storybook already in place, you essentially have a controlled environment set up for each of your components. This allows you to write interaction tests almost immediately, without the overhead of setting up and navigating through a full application environment, as is the case with e2e tests.
Moreover, since Storybook isolates each component, you can ensure that the tests are solely focused on individual component behavior rather than application-level concerns. This results in faster test execution, easier debugging, and more granular feedback during the development process. In essence, with Storybooks interaction tests, you get many of the benefits of e2e tests but with a setup thats quicker, more focused, and integrated right into your component development workflow.
Moreover, since Storybook isolates each component, you can ensure that the tests are solely focused on individual component behavior rather than application-level concerns. This results in faster test execution, easier debugging, and more granular feedback during the development process. In essence, with Storybook's interaction tests, you get many of the benefits of e2e tests but with a setup that's quicker, more focused, and integrated right into your component development workflow.
## Screenshare
@@ -2,8 +2,9 @@
title: 'Create Your Own create-react-app CLI'
slug: 'create-your-own-create-react-app-cli'
authors: ['Emily Xiong']
cover_image: '/blog/images/2023-08-10/j2QU-hjxt-1krFST8CGFiA.png'
cover_image: '/blog/images/2023-08-10/j2QU-hjxt-1krFST8CGFiA.avif'
tags: [nx]
description: Build a custom create-react-app CLI with Nx plugins, including workspace setup, Verdaccio testing, and project template customization for a branded React app scaffolding experience.
---
Most technologies have a CLI to create a new workspace. In fact, it is so prevalent that NPM and other package managers support it natively. For example:
@@ -15,11 +16,11 @@ Most technologies have a CLI to create a new workspace. In fact, it is so preval
Having a CLI to quickly scaffold a starting project is great for onboarding new people, but it can also be a burden for framework authors as they want to rather focus on building the framework. Additionally, building **and supporting** a good CLI is another beast to tackle. And this is where Nx comes in.
Nx has had support for [creating custom presets](/extending-nx/recipes/create-preset) for a while, allowing plugin authors to fully customize the workspace structure from the ground up. To use them you had to go via the `create-nx-workspace` command though, passing the name of your plugin as the `--preset` . This works, but you might want to have a more branded command experience, like `npx create-my-own-app` .
Nx has had support for [creating custom "presets"](/extending-nx/recipes/create-preset) for a while, allowing plugin authors to fully customize the workspace structure from the ground up. To use them you had to go via the `create-nx-workspace` command though, passing the name of your plugin as the `--preset` . This works, but you might want to have a more "branded command" experience, like `npx create-my-own-app` .
And this is exactly what were going to explore in this article. We will write our own CLI. And out of nostalgia, lets build our own version of Create-React-App.
And this is exactly what we're going to explore in this article. We will write our own CLI. And out of nostalgia, let's build our own version of Create-React-App.
If you want to check out the final result, heres the corresponding Github repo: [https://github.com/nrwl/nx-recipes/tree/main/nx-devkit-create-own-cli](https://github.com/nrwl/nx-recipes/tree/main/nx-devkit-create-own-cli)
If you want to check out the final result, here's the corresponding Github repo: [https://github.com/nrwl/nx-recipes/tree/main/nx-devkit-create-own-cli](https://github.com/nrwl/nx-recipes/tree/main/nx-devkit-create-own-cli)
**Prefer a video? We got you covered!**
@@ -53,11 +54,11 @@ _Project graph of the workspace_
The resulting workspace contains 2 projects: a CLI and an Nx plugin.
- **create-my-own-react-app:** The CLI project. It contains the code to run when developers invoke `npx create-my-own-react-app`. This will set up a workspace for the developer.
- **my-own-react:** Nx plugin to integrate react with Nx. It will contain the code for creating and serving an app. It is under the src folder. This will be installed in the users workspace.
- **my-own-react:** Nx plugin to integrate react with Nx. It will contain the code for creating and serving an app. It is under the src folder. This will be installed in the user's workspace.
### CLI Package Structure
Lets focus on the `create-my-own-react-app` project which is our CLI.
Let's focus on the `create-my-own-react-app` project which is our CLI.
![](/blog/images/2023-08-10/00F7H_Z13uonZiflZSQd8Q.avif)
@@ -130,17 +131,17 @@ cd tmp
npx create-my-own-react-app@1.0.0 test
```
What youll get is an Nx workspace with the base setup and a `test` library project with a single TS file. Because thats exactly what our current `preset` generator does.
What you'll get is an Nx workspace with the base setup and a `test` library project with a single TS file. Because that's exactly what our current `preset` generator does.
![](/blog/images/2023-08-10/v70qP_BS6LJm3NMAYkv2KQ.avif)
Lets fix that in the next step.
Let's fix that in the next step.
### Step 3: Change the CLI to Setup a React App
In this step, we dive a bit more into the actual Nx plugin development to create our CRA replica.
Well go rather quickly but if you want a slower walkthrough you might be interested in this video that leverages a generator for automating the creation of projects. Exactly what were going to do in our preset now.
We'll go rather quickly but if you want a slower walkthrough you might be interested in this video that leverages a generator for automating the creation of projects. Exactly what we're going to do in our preset now.
{% youtube src="https://youtu.be/myqfGDWC2go" /%}
@@ -180,9 +181,9 @@ export default presetGenerator;
The preset generator does 2 things:
- Create an Nx project using the`addProjectConfiguration` function. This creates a `project.json` file which allows Nx to run commands on it.
- Generates files in the project using the`generateFiles` function. This uses the templates under `src/generators/preset/files` which are interpolated to become the files that are generated for the user.
- Format the generated files with `prettier` with the`formatFiles` function
- Create an Nx project using the `addProjectConfiguration` function. This creates a `project.json` file which allows Nx to run commands on it.
- Generates files in the project using the `generateFiles` function. This uses the templates under `src/generators/preset/files` which are interpolated to become the files that are generated for the user.
- Format the generated files with `prettier` with the `formatFiles` function
![](/blog/images/2023-08-10/38RvkLIwUAvVDDrEp5sFPQ.avif)
_preset generator_
@@ -200,8 +201,8 @@ addProjectConfiguration(tree, options.name, {
});
```
- The `projectRoot` will be ., the root of a workspace
- The `projectType` changes to `application`
- The `projectRoot` will be ''.', the root of a workspace
- The `projectType` changes to 'application'
2\. Next, change the files generated into the project under `src/generators/preset/files`. We will use the same template as `create-react-app` .
@@ -397,16 +398,16 @@ The CLI now creates a workspace with the dependencies we want and the code for t
## Step 5: Add a Serve Target
The workspace setup is done, what were missing though is a way to easily serve our app. To stick to what CRA does we simply need to run `react-scripts start` , but ideally, we want to make that more convenient for the developer by pre-generating that script into the workspace.
The workspace setup is done, what we're missing though is a way to easily serve our app. To stick to what CRA does we simply need to run `react-scripts start` , but ideally, we want to make that more convenient for the developer by pre-generating that script into the workspace.
We have two possibilities:
- add the script to the root-level`package.json` using the `updateJson` function exposed by `@nx/devkit`
- add a target to the `project.json` using the `addProjectConfiguration` function exposed by `@nx/devkit`
Nx can use both. The `project.json` is Nxs variant of a more evolved package.json scripts declaration, that allows to specify metadata in a structured way.
Nx can use both. The `project.json` is Nx's variant of a more evolved package.json scripts declaration, that allows to specify metadata in a structured way.
To keep things simple, lets just generate a new script for the root-level `package.json`. We need to modify our `src/generators/preset/generator.ts` as follows:
To keep things simple, let's just generate a new script for the root-level `package.json`. We need to modify our `src/generators/preset/generator.ts` as follows:
```shell
import {
@@ -431,7 +432,7 @@ export default async function (tree: Tree, options: PresetGeneratorSchema) {
}
```
Note, we want to keep our `project.json` file even though it doesnt have any targets defined. That way Nx recognizes it as a proper project and applies caching and other optimization strategies.
Note, we want to keep our `project.json` file even though it doesn't have any targets defined. That way Nx recognizes it as a proper project and applies caching and other optimization strategies.
### Adding the target to the `project.json` rather than `package.json`
@@ -464,7 +465,7 @@ export default async function (tree: Tree, options: PresetGeneratorSchema) {
## Step 6: Run it Again to Get a React App That Can Be Served
To test our changes, lets publish a new version and run it again.
To test our changes, let's publish a new version and run it again.
```shell
npx nx run-many --targets publish --ver 1.0.2 --tag latest
@@ -485,9 +486,9 @@ _serve output_
## Step 7: Add a Prompt to the CLI to Customize the Starter App
Now, you have a CLI that creates a workspace that users can use to get started with React. But thats not all. Lets take it a step further and make it interactive by adding a prompt that can let different users customize the kind of workspace that they want to create.
Now, you have a CLI that creates a workspace that users can use to get started with React. But that's not all. Let's take it a step further and make it interactive by adding a prompt that can let different users customize the kind of workspace that they want to create.
Take a look at the CLI code at `create-my-own-react-package/bin/index.ts`, you will notice it is pretty barebone. It reads the`name` from the commands arguments.
Take a look at the CLI code at `create-my-own-react-package/bin/index.ts`, you will notice it is pretty barebone. It reads the`name` from the command's arguments.
You can use libraries like [enquirer](https://github.com/enquirer/enquirer) (or even fancier ones like [Clack](https://www.npmjs.com/package/@clack/prompts)) to prompt developers for options. For this example, prompt developers to select a light or dark theme for the starter app.
@@ -546,7 +547,7 @@ async function main() {
main();
```
You can assemble options for `createWorkspace`; however, youd like and they will be passed to the `my-own-react` preset.
You can assemble options for `createWorkspace`; however, you'd like and they will be passed to the `my-own-react` preset.
3\. Change `src/generators/preset` to accept this option and apply it.
@@ -588,7 +589,7 @@ You can modify this e2e test to test your CLI. Then, run it using the command `n
The default test works like this:
1. Creates a test workspace at `tmp/`using the `create-my-own-react-app` CLI
1. Creates a test workspace at `tmp/` using the `create-my-own-react-app` CLI
2. Runs `npm ls my-own-react` to validate that the plugin is installed in the test workspace
3. Cleans up the test workspace
@@ -628,14 +629,14 @@ Recap:
- We adjusted the preset generator to setup a CRA-like React setup
- We wrote some e2e tests to ensure that things do not break
This should give you a good insight into how to get started. But theres more to explore:
This should give you a good insight into how to get started. But there's more to explore:
- We could provide more [generators](/plugins/recipes/local-generators\) to our users that help with setting up new components, adding unit tests, configuring the React Router etc.
- Add a generator to add other Nx plugins such as Jest, ESLint, or Cypress
- We could also include [executors](/extending-nx/recipes/local-executors), which are wrappers around tasks to abstract the lower-level details of it
- We could also include "[executors](/extending-nx/recipes/local-executors)", which are wrappers around tasks to abstract the lower-level details of it
- etc.
Now clearly this was a simple example of how you could build your own CRA using Nx. If you want to see a real-world React setup powered by Nx, check out our React Tutorial: [/getting-started/tutorials/react-standalone-tutorial](/getting-started/tutorials/react-standalone-tutorial)
Now clearly this was a simple example of how you could build your own CRA using Nx. If you want to see a real-world React setup powered by Nx, check out our React Tutorial: [/getting-started/tutorials/react-monorepo-tutorial](/getting-started/tutorials/react-monorepo-tutorial)
## Learn more
+29 -28
View File
@@ -2,8 +2,9 @@
title: Qwikify your Development with Nx
slug: 'qwikify-your-development-with-nx'
authors: ['Colum Ferry']
cover_image: '/blog/images/2023-08-15/featured_img.png'
cover_image: '/blog/images/2023-08-15/featured_img.avif'
tags: [nx, changelog, release]
description: Learn how to integrate Qwik with Nx for a todo app, covering setup, routes, libraries, Qwik Context, and modular development best practices.
---
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.
@@ -12,7 +13,7 @@ Qwik is a modern web framework that focuses on application performance by reduci
Nx is a powerful tool that helps you build extensible and maintainable codebases that scale as your application and team grows. Nx utilises computation cache and workspace analysis to ensure maximum efficiency and developer experience. You can [learn more about Nx here](/getting-started/why-nx).
In this blog post, well explore how to combine the strengths of Nx and Qwik to create a todo app. To do this, well take advantage of an Nx Plugin that was created by the Qwikifiers team to maximise the integration between Qwik and Nx, called [`qwik-nx`](https://github.com/qwikifiers/qwik-nx).
In this blog post, we'll explore how to combine the strengths of Nx and Qwik to create a todo app. To do this, we'll take advantage of an Nx Plugin that was created by the Qwikifiers team to maximise the integration between Qwik and Nx, called [`qwik-nx`](https://github.com/qwikifiers/qwik-nx).
> You do not necessarily need to use an Nx Plugin for Qwik. Instead, you could use the [Qwik CLI](https://qwik.dev/docs/getting-started/#create-an-app-using-the-cli) to create your application and [add Nx later](/recipes/adopting-nx/adding-to-existing-project#install-nx-on-a-nonmonorepo-project).
> In this blog post we use the `qwik-nx` plugin to leverage better DX provided by the generators offered by the Plugin.
@@ -39,7 +40,7 @@ You can learn more about this integration in the video below:
## Creating the Workspace
Lets start by setting up our development environment. Well create an Nx workspace and integrate Qwik into it. Begin by generating an empty integrated workspace:
Let's start by setting up our development environment. We'll create an Nx workspace and integrate Qwik into it. Begin by generating an empty integrated workspace:
```shell
npx create-nx-workspace@latest qwik-todo-app
@@ -63,7 +64,7 @@ npm install --save-dev qwik-nx
One of the benefits of using an Nx Plugin is that it comes with additional features such as automatic migrations, executors to act on your code and generators to scaffold code (_like CodeMods_).
Now, lets use the application generator provided by `qwik-nx` to scaffold the todo application:
Now, let's use the application generator provided by `qwik-nx` to scaffold the todo application:
```shell
nx g qwik-nx:app todo
@@ -77,13 +78,13 @@ At this point, you can already run the `nx serve todo` and `nx build todo` comma
Qwik has another package called Qwik City that uses directory-based routing to handle navigation within your application. [Learn more about directory-based routing with Qwik City](https://qwik.dev/docs/qwikcity/).
The `qwik-nx` plugin can help generate new routes within our application. Lets use it to generate a route where we can store our todo logic.
The `qwik-nx` plugin can help generate new routes within our application. Let's use it to generate a route where we can store our todo logic.
```shell
nx g qwik-nx:route --name=todo --project=todo
```
After running this command, youll see a new directory and file created in your workspace:
After running this command, you'll see a new directory and file created in your workspace:
![Create apps/todo/src/routes/todo/index.tsx](/blog/images/2023-08-15/bodyimg2.webp)
@@ -97,7 +98,7 @@ export default component$(() => {
});
```
As you can see, its very simple, just a standard Qwik Component.
As you can see, it's very simple, just a standard Qwik Component.
If you run `nx serve todo` and navigate to `http://localhost:4200/todo` you can see that the route works and the component renders the content correctly.
@@ -105,7 +106,7 @@ If you run `nx serve todo` and navigate to `http://localhost:4200/todo` you can
## Build a Basic UI
We want to build a todo application, so lets add some UI elements to make this look more like an actual todo application.
We want to build a todo application, so let's add some UI elements to make this look more like an actual todo application.
Update `apps/todo/src/routes/todo/index.tsx` to match the following:
@@ -132,19 +133,19 @@ export default component$(() => {
});
```
Youll see the page update and look like the following:
You'll see the page update and look like the following:
![Qwik now the heading, a labeled checkbox, and a formfield to add a todo](/blog/images/2023-08-15/bodyimg4.webp)
Awesome!
However, youll notice that when you click `Add`, nothing happens! Lets add some logic to store new todos.
However, you'll notice that when you click `Add`, nothing happens! Let's add some logic to store new todos.
## Generate a Library
Nx helps you organise your workspace in a modular fashion by creating workspace libraries that focus on specific functionality.
Instead of organising your features into subfolders of your application, with Nx, youll extract them into workspace libraries (libraries that are not intended to be published, but still used by other libraries and applications in your repository). This helps to create a much stronger boundary between modules and features in your application as libraries have a public API (the `index.ts` file), allowing you to control exactly what can be accessed by consumers.
Instead of organising your features into subfolders of your application, with Nx, you'll extract them into workspace libraries (libraries that are not intended to be published, but still used by other libraries and applications in your repository). This helps to create a much stronger boundary between modules and features in your application as libraries have a public API (the `index.ts` file), allowing you to control exactly what can be accessed by consumers.
> [Learn more about defining and ensuring project boundaries in the Nx docs.](/features/enforce-module-boundaries)
>
@@ -154,7 +155,7 @@ Instead of organising your features into subfolders of your application, with Nx
Using this feature of Nx, we can organise the state management of our todo application into its own library, separating the logic from the application itself.
Lets generate a new library with the help of `qwik-nx`.
Let's generate a new library with the help of `qwik-nx`.
```shell
nx g qwik-nx:lib data-access
@@ -174,7 +175,7 @@ libs/data-access/src/lib/data-access.spec.tsx
Qwik uses [Contexts](https://qwik.dev/docs/components/context/) to help store state across both the server-side and client-side and across routes within the application.
Well use a Context to store the todos in the application, but first, lets create a file to store the TS Interfaces well use in our application.
We'll use a Context to store the todos in the application, but first, let's create a file to store the TS Interfaces we'll use in our application.
Create `libs/data-access/src/lib/api.ts` and add the following:
@@ -185,7 +186,7 @@ export interface Todo {
}
```
Next, lets create a new file `libs/data-access/src/lib/todo.context.tsx` and add the following content:
Next, let's create a new file `libs/data-access/src/lib/todo.context.tsx` and add the following content:
```tsx {% fileName="libs/data-access/src/lib/todo.context.tsx" %}
import {
@@ -217,11 +218,11 @@ This will create our Context and set up a Store within our application to store
> [Learn more about how Qwik uses Signals.](https://qwik.dev/docs/components/state/)
Finally, lets update the public entry point to the library to expose our Context and Interface.
Finally, let's update the public entry point to the library to expose our Context and Interface.
## Using the Context
Lets update the root page to add our Context Provider. Open `apps/todo/src/root.tsx` and add `TodoContextProvider` after `QwikCityProvider` in the component tree. Your file should look like the following:
Let's update the root page to add our Context Provider. Open `apps/todo/src/root.tsx` and add `TodoContextProvider` after `QwikCityProvider` in the component tree. Your file should look like the following:
```tsx {% fileName="apps/todo/src/root.tsx" %}
import { component$, useStyles$ } from '@builder.io/qwik';
@@ -267,7 +268,7 @@ export * from './lib/todo.context';
export * from './lib/api';
```
Now that our Context is in place, lets use it in our todo route to manage our todos.
Now that our Context is in place, let's use it in our todo route to manage our todos.
Update `apps/todo/src/routes/todo/index.tsx` to match the following:
@@ -298,7 +299,7 @@ export default component$(() => {
});
```
Our store has no todos in it when the application starts up, so if you serve the application you will no longer see any todos listed. Lets fix that!
Our store has no todos in it when the application starts up, so if you serve the application you will no longer see any todos listed. Let's fix that!
## Adding a `routeLoader$` to load data on Navigation
@@ -306,11 +307,11 @@ Qwik allows you to fetch data when a route is navigated to, allowing you to fetc
> [Learn more about routeLoader$.](https://qwik.dev/docs/route-loader/)
It does this by providing a function called `routeLoader$`. Well use this function to preload our store with some todos that will theoretically exist in a database.
It does this by providing a function called `routeLoader$`. We'll use this function to preload our store with some todos that will theoretically exist in a database.
For this blog post, well create an in-memory db to store some initial todos.
For this blog post, we'll create an in-memory db to store some initial todos.
Well start by updating our `libs/data-access/src/lib/api.ts` to add our in-memory DB.
We'll start by updating our `libs/data-access/src/lib/api.ts` to add our in-memory DB.
```ts {% fileName="libs/data-access/src/lib/api.ts" %}
export interface Todo {
@@ -348,7 +349,7 @@ export const db: DB = {
};
```
Now that we have this, lets use it in our `/todo` route to load some data when the user navigates to `/todo`.
Now that we have this, let's use it in our `/todo` route to load some data when the user navigates to `/todo`.
Update `apps/todo/src/routes/todo/index.tsx` to match the following:
@@ -406,11 +407,11 @@ export default component$(() => {
});
```
When you serve the application, youll see the first todo is fetched and rendered correctly!
When you serve the application, you'll see the first todo is fetched and rendered correctly!
## Handle the Form Action to add todos
Qwik also allows you to handle form actions on the server using the `routeAction$` API. Lets create the logic to add new todos to the store.
Qwik also allows you to handle form actions on the server using the `routeAction$` API. Let's create the logic to add new todos to the store.
> [Learn more about `routeAction$`](https://qwik.dev/docs/action/)
@@ -485,7 +486,7 @@ export default component$(() => {
Awesome! We can now add todos to our application!
However, you might have noticed that our file is starting to get very long. Not only that theres a lot of logic in the route file itself. Lets use Nx to separate the logic into the library we created earlier to keep logic collocated.
However, you might have noticed that our file is starting to get very long. Not only that there's a lot of logic in the route file itself. Let's use Nx to separate the logic into the library we created earlier to keep logic collocated.
## Improve the Architecture
@@ -527,7 +528,7 @@ export * from './lib/api';
export * from './lib/todo';
```
Finally, lets update `apps/todo/src/routes/todo/index.tsx` to use our newly created functions:
Finally, let's update `apps/todo/src/routes/todo/index.tsx` to use our newly created functions:
```tsx {% fileName="apps/todo/src/routes/todo/index.tsx" %}
import { component$, useContext, useTask$ } from '@builder.io/qwik';
@@ -580,7 +581,7 @@ export default component$(() => {
});
```
If you run `nx serve todo` again, youll notice that our refactor will not have changed anything for the user, but it has made the codebase more manageable!
If you run `nx serve todo` again, you'll notice that our refactor will not have changed anything for the user, but it has made the codebase more manageable!
Now, if we need to update the logic for loading or adding todos, we only need to retest the library, and not the full application, improving our CI times!
@@ -588,7 +589,7 @@ Now, if we need to update the logic for loading or adding todos, we only need to
## Conclusion
The collaboration between Nx and Qwik has led us to create a todo app that showcases efficient development practices and modular design. By centralizing route logic in a library, weve not only demonstrated the capabilities of Nx and Qwik but also highlighted how this approach can significantly improve cache and CI times.
The collaboration between Nx and Qwik has led us to create a todo app that showcases efficient development practices and modular design. By centralizing route logic in a library, we've not only demonstrated the capabilities of Nx and Qwik but also highlighted how this approach can significantly improve cache and CI times.
This journey through Qwik and Nx demonstrates how thoughtful architecture and the right tools can significantly enhance your development experience. So go ahead, Qwikify your development and build amazing web applications with ease!
@@ -2,8 +2,9 @@
title: 'Step-by-Step Guide to Creating an Expo Monorepo with Nx'
slug: 'step-by-step-guide-to-creating-an-expo-monorepo-with-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2023-08-24/IpM0kZdUNXoDWV4r8J5xXQ.png'
cover_image: '/blog/images/2023-08-24/IpM0kZdUNXoDWV4r8J5xXQ.avif'
tags: [nx, tutorial]
description: A comprehensive tutorial on building a multi-app Expo monorepo using Nx, featuring shared UI components, navigation setup, and deployment configurations, demonstrated through the creation of two mobile apps.
---
This blog will show you how to create an Expo monorepo with Nx. In this example, you will be creating two Expo apps in a monorepo with `@nx/expo`: one shows random facts about cats, and the other shows random facts about dogs.
@@ -25,7 +26,7 @@ Github repo: [xiongemi/nx-expo-monorepo](https://github.com/xiongemi/nx-expo-mon
## Creating an Nx Workspace
To create a new Nx workspace, run the command `npx create-nx-workspace <workspace name>` in the terminal. In this example, lets name it `nx-expo-monorepo`:
To create a new Nx workspace, run the command `npx create-nx-workspace <workspace name>` in the terminal. In this example, let's name it `nx-expo-monorepo`:
```
✔ Where would you like to create your workspace? · create-nx-monorepo
@@ -344,7 +345,7 @@ It will then ask you to choose which binary to submit from one of the following
- Path to an .apk or .aab or .ipa archive on your local filesystem.
- URL to the app archive.
Alternatively, you can submit your app on the [expo.dev](https://expo.dev/) site. Go to your build, under options, choose Submit to an app store:
Alternatively, you can submit your app on the [expo.dev](https://expo.dev/) site. Go to your build, under options, choose "Submit to an app store":
![](/blog/images/2023-08-24/yQlEmKOy3TXdWPCk9ILiZA.avif)
+33 -32
View File
@@ -2,11 +2,12 @@
title: 'Nx 16.8 Release!!!'
slug: 'nx-16-8-release'
authors: ['Zack DeRose']
cover_image: '/blog/images/2023-09-06/16gTRcKon8B4IKYQAY9V8w.png'
cover_image: '/blog/images/2023-09-06/16gTRcKon8B4IKYQAY9V8w.avif'
tags: [nx, release]
description: Nx 16.8 released with new project generator behavior, enhanced TypeScript library packaging, high-performance TypeScript compilation, Playwright support, Netlify integration, and interactive Nx Console features.
---
As always, the Nx Team has been hard at work, and were here to launch our latest release: Nx 16.8! And its absolutely bursting with new features. Well go into all these in depth below, but be sure to check out our latest release video on YouTube!
As always, the Nx Team has been hard at work, and we're here to launch our latest release: Nx 16.8! And it's absolutely bursting with new features. We'll go into all these in depth below, but be sure to check out our latest release video on YouTube!
If you have more questions — be sure to stop by our latest Nx Live to ask them there! You can sign up for a notification from the link below!
@@ -29,7 +30,7 @@ Nx is also coming up on 20k Github stars [please help us get there!](https://git
· [Packaging TypeScript Libraries — Secondary Entrypoints, ESM, CJS](#packaging-typescript-libraries-secondary-entrypoints-esm-cjs)
· [High Performance TypeScript Compilation: Introducing Batch Mode & Rust-based Dependency Resolution](#high-performance-typescript-compilation-introducing-batch-mode-rustbased-dependency-resolution)
· [NEW Nx PLUGIN: Playwright](#new-nx-plugin-playwright)
· [NEW INTEGRATION: Netlifys Improved Monorepo Experience](#new-integration-netlifys-improved-monorepo-experience)
· [NEW INTEGRATION: Netlify's Improved Monorepo Experience](#new-integration-netlifys-improved-monorepo-experience)
· [NEW Nx CONSOLE FEATURE: Interactive Graph Functionality](#new-nx-console-feature-interactive-graph-functionality)
· [ENHANCEMENT: Storybook Support for Interaction Testing](#enhancement-storybook-support-for-interaction-testing)
· [NEW GENERATOR: convert-to-monorepo](#new-generator-converttomonorepo)
@@ -49,13 +50,13 @@ Over the years, we found this to be much too rigid, so we made these locations m
We also simplified the definition of Nx projects to be any directory that had a `project.json` file in it, allowing for the ability to nest projects in your filesytem and also forego app or lib directories altogether!
With Nx 16.8, were introducing an all-new option in this `workspaceLayout` category: `projectNameAndRootFormat` where you can chose either the option to apply project names `as-provided` or `derived`.
With Nx 16.8, we're introducing an all-new option in this `workspaceLayout` category: `projectNameAndRootFormat` where you can chose either the option to apply project names `as-provided` or `derived`.
![](/blog/images/2023-09-06/U5gxfZXk8pwgOXCE.avif)
If you dont set this option in your `nx.json` file, our generators will now prompt you as to how we should set:
If you don't set this option in your `nx.json` file, our generators will now prompt you as to how we should set:
- the name of your project (as in the projects `project.json` file)
- the name of your project (as in the project's `project.json` file)
- where to put the project in your filesystem
![](/blog/images/2023-09-06/eBwA23cwcMv8V5zF.avif)
@@ -78,7 +79,7 @@ To get the legacy behavior, be sure to change the `projectNameAndRootFormat` to
{% youtube src="https://youtu.be/Vy4d0-SF5cY" /%}
Nx has always had first-class TypeScript support from the very beginning. You never really had to worry about Type Definition files being properly included or setting up TS support in the first place. But there are some aspects that can be tricky, like defining and properly exporting secondary entry points or packaging in multiple formats (ESM and CJS). Thats why we did some research to help make it easier.
Nx has always had first-class TypeScript support from the very beginning. You never really had to worry about Type Definition files being properly included or setting up TS support in the first place. But there are some aspects that can be tricky, like defining and properly exporting secondary entry points or packaging in multiple formats (ESM and CJS). That's why we did some research to help make it easier.
The `package.json` format supports an [export field](https://nodejs.org/api/packages.html#package-entry-points) which is a modern alternative to the `main` property, allowing to have multiple such entry points.
@@ -93,7 +94,7 @@ The `package.json` format supports an [export field](https://nodejs.org/api/pack
}
```
To make it easier to maintain these, weve added two new options to the `@nx/js` package: `additionalEntryPoints` and `generateExportsField`. Here's an example:
To make it easier to maintain these, we've added two new options to the `@nx/js` package: `additionalEntryPoints` and `generateExportsField`. Here's an example:
```
// packages/my-awesome-lib/project.json
@@ -191,7 +192,7 @@ Speed is in our DNA! And TypeScript compilation can be slow which is mostly due
To help with this, the TypeScript team introduced [Project References](https://www.typescriptlang.org/getting-started/intro/handbook/project-references.html) which performs incremental compilation by caching intermediate results. However this comes with some [caveats you need to be aware of](https://www.typescriptlang.org/getting-started/intro/handbook/project-references.html#caveats-for-project-references) and it can be intense to maintain by hand on a large codebase.
We wanted to make it transparent though and not something the user needs to worry about. Thats why we introduced [Batch Mode](/showcase/benchmarks/tsc-batch-mode). Batch mode is still experimental, and you can enable it for any project using the `@nx/js:tsc` executor by adding the environment variable `NX_BATCH_MODE=true`:
We wanted to make it transparent though and not something the user needs to worry about. That's why we introduced ["Batch Mode"](/showcase/benchmarks/tsc-batch-mode). Batch mode is still experimental, and you can enable it for any project using the `@nx/js:tsc` executor by adding the environment variable `NX_BATCH_MODE=true`:
```
> NX_BATCH_MODE=true nx run-many --target=build
@@ -211,7 +212,7 @@ A new Nx plugin has appeared!!
Nx now supports Playwright as an e2e option alongside our long-standing support for Cypress!
First off, this means weve added Playwright as an option when generating new frontend applications:
First off, this means we've added Playwright as an option when generating new frontend applications:
![](/blog/images/2023-09-06/kvqmp9n2pkivb8ba.avif)
@@ -221,7 +222,7 @@ If you want to add playwright to an existing project in your workspace you can a
npm add -D @nx/playwright
```
Then running our new generator to add playwright to your project (here Im adding it to my application called `my-app`):
Then running our new generator to add playwright to your project (here I'm adding it to my application called `my-app`):
```
nx g @nx/playwright:configuration --project=my-app
@@ -229,19 +230,19 @@ nx g @nx/playwright:configuration --project=my-app
This will setup playwright for you, and add an `e2e` target to your project using playwright!
## NEW INTEGRATION: Netlifys Improved Monorepo Experience
## NEW INTEGRATION: Netlify's Improved Monorepo Experience
On Netlifys enterprise tier, approximately 46% of builds are monorepos, with the majority leveraging Nx and [Lerna](https://lerna.js.org/). Recognizing this trend, Netlify has focused on enhancing the setup and deployment experiences for monorepo projects. In particular they worked on an automatic monorepo detection feature. When you connect your project to GitHub, Netlify automatically detects if its part of a monorepo, reads the relevant settings, and pre-configures your project. This eliminates the need for manual setup. This feature also extends to local development via the Netlify CLI.
On Netlify's enterprise tier, approximately 46% of builds are monorepos, with the majority leveraging Nx and [Lerna](https://lerna.js.org/). Recognizing this trend, Netlify has focused on enhancing the setup and deployment experiences for monorepo projects. In particular they worked on an "automatic monorepo detection" feature. When you connect your project to GitHub, Netlify automatically detects if it's part of a monorepo, reads the relevant settings, and pre-configures your project. This eliminates the need for manual setup. This feature also extends to local development via the Netlify CLI.
[Juri Strumpflohner](https://twitter.com/juristr) from the Nx team sits down with [Lukas Holzer](https://twitter.com/luka5c0m) from Netlify to discuss what monorepos are, when you might need them, their challenges and benefits, and the tooling support Nx provides. But its not just talk; they also walk you through setting up a new Nx monorepo, adding Netlify Edge functions, and deploying it all to Netlify — both via the website and locally through the newly improved Netlify CLI.
[Juri Strumpflohner](https://twitter.com/juristr) from the Nx team sits down with [Lukas Holzer](https://twitter.com/luka5c0m) from Netlify to discuss what monorepos are, when you might need them, their challenges and benefits, and the tooling support Nx provides. But it's not just talk; they also walk you through setting up a new Nx monorepo, adding Netlify Edge functions, and deploying it all to Netlify — both via the website and locally through the newly improved Netlify CLI.
{% youtube src="https://youtu.be/KL7PCwf-mtM" /%}
If you prefer the blog post, check out [Elevating enterprise deployment: Introducing an enhanced monorepo experience on Netlify](https://www.netlify.com/blog/elevating-enterprise-deployment-introducing-an-enhanced-monorepo-experience-on-netlify/) on the Netlify blog.
If you prefer the blog post, check out ["Elevating enterprise deployment: Introducing an enhanced monorepo experience on Netlify"](https://www.netlify.com/blog/elevating-enterprise-deployment-introducing-an-enhanced-monorepo-experience-on-netlify/) on the Netlify blog.
## NEW Nx CONSOLE FEATURE: Interactive Graph Functionality
If youre not familiar — Nx Console is our IDE enhancement for [VsCode (1.4 million installations!!)](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console) and [JetBrains Products (Intellij/WebStorm/etc — 52 thousand downloads!)](https://plugins.jetbrains.com/plugin/21060-nx-console).
If you're not familiar — Nx Console is our IDE enhancement for [VsCode (1.4 million installations!!)](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console) and [JetBrains Products (Intellij/WebStorm/etc — 52 thousand downloads!)](https://plugins.jetbrains.com/plugin/21060-nx-console).
Nx Console provides a Graphical User Interface for running tasks and generating code for your Nx Monorepos, and it also provides the ability to view your project graph
@@ -257,7 +258,7 @@ As of our latest release, Nx Console has added the new feature of adding buttons
![](/blog/images/2023-09-06/NZdpBJ59gO-HdsV5.avif)
And gives you a play button to run any task within your task graph:
And gives you a "play button" to run any task within your task graph:
![](/blog/images/2023-09-06/AEht-0Pq7rdr-Uso.avif)
@@ -277,9 +278,9 @@ Nx has always provided similar functionality via our Storybook + Cypress integra
## NEW GENERATOR: convert-to-monorepo
Towards the start of the year, we added support for Nx standalone applications. These were designed as a way of using Nx features in a way where you didnt need to opt into a monorepo setup.
Towards the start of the year, we added support for Nx standalone applications. These were designed as a way of using Nx features in a way where you didn't need to opt into a monorepo setup.
Ever since we introduced these, weve had requests from the community to add a generator to convert your standalone workspace to a monorepo setup — to support repos that grew to emcompass more than just the 1 application.
Ever since we introduced these, we've had requests from the community to add a generator to convert your standalone workspace to a monorepo setup — to support repos that grew to emcompass more than just the 1 application.
This is where our new [`convert-to-monorepo` generator](/nx-api/workspace/generators/convert-to-monorepo) comes into play!
@@ -295,43 +296,43 @@ When all is said and done, you should be able to now add additional applications
One of the great things about Nx is the extensibility, and the wide range of plugins that are available for supporting languages, frameworks, and tools that the core Nx team does not directly support.
Our docs site has hosted [a registry of these plugins](/plugin-registry) for awhile now, but weve recently added npm downloads, github stars, release dates, and compatible Nx versions to this registry:
Our docs site has hosted [a registry of these plugins](/plugin-registry) for awhile now, but we've recently added npm downloads, github stars, release dates, and compatible Nx versions to this registry:
![](/blog/images/2023-09-06/f74VOjpr7u9RTmDE.avif)
We expect that these will be valuable signals to users as to the quality of the plugin.
Weve also added the ability to sort the registry by these metrics as a way of surfacing the higher quality plugins to the top!
We've also added the ability to sort the registry by these metrics as a way of surfacing the higher quality plugins to the top!
![](/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
Our mission to improve Nx docs continues: this edition with some major updates to our [Docs intro page](/getting-started/intro).
We improved the messaging around Nx and more prominently emphasizing the [core features](/features) that distinguish Nx from other tools out there. We also linked a new What is Nx video. You should check it out 🐐
We improved the messaging around Nx and more prominently emphasizing the [core features](/features) that distinguish Nx from other tools out there. We also linked a new "What is Nx" video. You should check it out 🐐
{% youtube src="https://youtu.be/-_4WMl-Fn0w" /%}
The core part of the intro page now has a dedicated section for Learning Nx, surfacing some of our Nx, Nx Cloud and Monorepo videos as well as our in-depth tutorial about monorepos and single-project Nx workspaces. And we already have more in the works, so stay tuned.
The core part of the intro page now has a dedicated section for "Learning Nx", surfacing some of our Nx, Nx Cloud and Monorepo videos as well as our in-depth tutorial about monorepos and single-project Nx workspaces. And we already have more in the works, so stay tuned.
![](/blog/images/2023-09-06/VwG57cMDy9fGGI8l.avif)
Were also proud of all the new examples weve added in the last months. We have a brand new [Nx Recipe](https://github.com/nrwl/nx-recipes) repo with a variety of example projects that showcase Nx in combination with different technologies, even outside the JS ecosystem (e.g. with Rust, Go and .Net).
We're also proud of all the new examples we've added in the last months. We have a brand new [Nx Recipe](https://github.com/nrwl/nx-recipes) repo with a variety of example projects that showcase Nx in combination with different technologies, even outside the JS ecosystem (e.g. with Rust, Go and .Net).
Go pick the ones youre most interested in!
Go pick the ones you're most interested in!
![](/blog/images/2023-09-06/pMTW9GzZjRNrlyRH.avif)
You can find all of the examples and more on our Showcase section: [/showcase](/showcase).
You can find all of the examples and more on our "Showcase" section: [/showcase](/showcase).
## NEW GENERATOR: ESLint Flat Config
ESLint has announced a new config system — nicknamed flat config — whose intent is to be be familiar and much simpler than the current config system. You can read more about this [in their blog post](https://eslint.org/blog/2022/08/new-config-system-part-2/).
ESLint has announced a new config system — nicknamed "flat config" — whose intent is to be be familiar and much simpler than the current config system. You can read more about this [in their blog post](https://eslint.org/blog/2022/08/new-config-system-part-2/).
As part of our continued support for ESLint, weve introduced [a new generator](/nx-api/eslint/generators/convert-to-flat-config) to convert your Nx monorepo to this new system:
As part of our continued support for ESLint, we've introduced [a new generator](/nx-api/eslint/generators/convert-to-flat-config) to convert your Nx monorepo to this new system:
```
> nx g convert-to-flat-config
@@ -341,7 +342,7 @@ Flat config is still experimental, so you can use this as a way of easily previe
## New Nx Cloud Overview Video
Weve been working hard on our premium product: Nx Cloud, and part of that has been this awesome video from our own Rares Matei on what exactly Nx Cloud is!
We've been working hard on our premium product: Nx Cloud, and part of that has been this awesome video from our own Rares Matei on what exactly Nx Cloud is!
{% youtube src="https://youtu.be/NZF0ZJpgaJM" /%}
@@ -349,13 +350,13 @@ Be sure to checkout the [Nx Cloud landing site](/nx-cloud) for more details on a
## Nx Conf Coming Up
Last but definitely not least, [Nx Conf 2023](/conf) is fast approaching! Well be coming to you live from New York City on September 26!
Last but definitely not least, [Nx Conf 2023](/conf) is fast approaching! We'll be coming to you live from New York City on September 26!
Be sure to [register to attend online FOR FREE](https://ti.to/nx-conf/nxconf2023online) and be sure to checkout our [lineup of talks](/conf#speakers) and [speakers](/conf#agenda)!
## Wrap Up
Thats all for now folks! Were just starting up a new iteration of development on Nx, so be sure to subscribe to our YouTube channel to get updates when new features land! Until next time, KEEP WORKING HARD!
That's all for now folks! We're just starting up a new iteration of development on Nx, so be sure to subscribe to our YouTube channel to get updates when new features land! Until next time, KEEP WORKING HARD!
## Learn more
@@ -2,8 +2,9 @@
title: 'Introducing Playwright Support for Nx'
slug: 'introducing-playwright-support-for-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2023-09-18/589bVpPTJ4D4IACBePXWQ.png'
cover_image: '/blog/images/2023-09-18/589bVpPTJ4D4IACBePXWQ.avif'
tags: [nx, release, tutorial]
description: 'Discover how to integrate Playwright, a powerful end-to-end testing tool, into your Nx workspaces with our new @nx/playwright plugin.'
---
We are very excited to announce our support for Playwright with our new plugin `@nx/playwright`.
@@ -18,9 +19,9 @@ This blog will show you:
## What is Playwright?
Before we start, lets answer this question: what is Playwright and why should we use it?
Before we start, let's answer this question: what is Playwright and why should we use it?
From [playwright.dev](https://playwright.dev/), it says: Playwright is end-to-end testing for modern web apps. It sounds good, what does it do for us developers? What developer experience does it provide?
From [playwright.dev](https://playwright.dev/), it says: "Playwright is end-to-end testing for modern web apps". It sounds good, what does it do for us developers? What developer experience does it provide?
### Multiple Browsers
@@ -52,12 +53,12 @@ export default defineConfig({
### Auto Waiting
Playwright automatically waits for the relevant checks to pass, then performs the request action. What does it mean? For example, lets say we have a sign-up form where:
Playwright automatically waits for the relevant checks to pass, then performs the request action. What does it mean? For example, let's say we have a sign-up form where:
- while the app checks that the user name is unique, the submit button is disabled.
- after checking with the server, the submit button becomes enabled.
How do we write tests in the Playwright? Playwright performs a range of actionability checks on the elements before making actions to ensure these actions behave as expected. So we dont need to wait for the button to be enabled. Playwright will check it. We can simply write:
How do we write tests in the Playwright? Playwright performs a range of actionability checks on the elements before making actions to ensure these actions behave as expected. So we don't need to wait for the button to be enabled. Playwright will check it. We can simply write:
```
await page.getByTestId('submit-button').click();
@@ -77,7 +78,7 @@ _Test error_
It also has other features like recording [screenshots](https://playwright.dev/docs/screenshots) and [videos](https://playwright.dev/docs/videos), [test generation](https://playwright.dev/docs/codegen), and [visual comparisons](https://playwright.dev/docs/test-snapshots). Read more about Playwright at [https://playwright.dev](https://playwright.dev/)
Next, lets write and run some Playwright tests.
Next, let's write and run some Playwright tests.
## Create a new Nx Workspace with Playwright
+2 -1
View File
@@ -3,9 +3,10 @@ title: Nx Raises $16M Series A
slug: 'nx-raises-16m-series-a'
authors: [Jeff Cross]
tags: [nx]
description: Nx raises $16M Series A led by Nexus Venture Partners and a16z, a milestone in revolutionizing monorepo tooling and workflows.
---
Victor and I are excited to announce that Nx has raised another $16M in a Series A funding round with Nexus Venture Partners and a16z! See our announcement video for more, and be sure to check out the [live stream of Nx Conf 2023](https://youtube.com/live/IQ5YyEYZw68?feature=share) tomorrow to see what were up to!
Victor and I are excited to announce that Nx has raised another $16M in a Series A funding round with Nexus Venture Partners and a16z! See our announcement video for more, and be sure to check out the [live stream of Nx Conf 2023](https://youtube.com/live/IQ5YyEYZw68?feature=share) tomorrow to see what we're up to!
{% youtube src="https://www.youtube.com/embed/KuyYhC4ClW8?si=qoZL6i6X1E7wjChD" /%}
+24 -23
View File
@@ -2,11 +2,12 @@
title: Nx Conf 2023 — Recap
slug: 'nx-conf-2023-recap'
authors: [Juri Strumpflohner]
cover_image: '/blog/images/2023-10-13/featured_img.webp'
cover_image: '/blog/images/2023-10-13/featured_img.avif'
tags: [nx, nx-conf]
description: 'Nx Conf 2023 recap - keynotes, tech talks, and community discussions on Nx ecosystem growth, tooling, and monorepo development.'
---
The 3rd edition of [Nx Conf](/conf), this year live from New York City. If you missed the talks, no worries, weve got you covered. This article does a brief recap of all the presentations and has links to the individual recordings and slides.
The 3rd edition of [Nx Conf](/conf), this year live from New York City. If you missed the talks, no worries, we've got you covered. This article does a brief recap of all the presentations and has links to the individual recordings and slides.
{% youtube src="https://www.youtube.com/embed/P_W8MwX25a0?si=gpjul3hdqmOiBdev" /%}
@@ -20,7 +21,7 @@ Juri Strumpflohner (me 😅) opens the keynote. He focuses on the Nx ecosystem,
![](/blog/images/2023-10-13/bodyimg1.webp)
Such integration capabilities really help push the developer productivity, whether thats in single-project workspaces or monorepos.
Such integration capabilities really help push the developer productivity, whether that's in single-project workspaces or monorepos.
Juri also dives deeper into efforts from the team to provide high quality educational content around Nx and its capabilities. The [Nx docs](/getting-started/intro) have been restructured to follow the [Diataxis](https://diataxis.fr/) framework, dividing content into into learning-, task-, understanding- and information-oriented sections.
![](/blog/images/2023-10-13/bodyimg2.webp)
@@ -29,11 +30,11 @@ This makes it easier to find keep the content organized and focused and makes it
The Nx team not only produces written content, but also video content mainly on the [Nx YouTube Channel](https://www.youtube.com/@nxdevtools). Juri shows some of the growth stats, with the channel now having more than 14k subscribers and around 3.7k hours of watch time per month. The channel serves mostly short-form videos about new releases, highlighting new features as well as longer-form tutorial videos.
The Nx Community also got a special place in the keynote. Juri highlighted in particular the transition from the Nrwl Community Slack to the new Nx Community on Discord.
The Nx Community also got a special place in the keynote. Juri highlighted in particular the transition from the "Nrwl Community Slack" to the new "Nx Community" on Discord.
![](/blog/images/2023-10-13/bodyimg3.webp)
Discord is built for managing communities and will open up a series of features to come. Things like a built-in forum to ask questions, the ability to highlight Nx events (e.g. the Nx live stream) and having powerful automation and moderation tools. Since the launch a couple of weeks ago, already 1500+ members have signed up. If you didnt sign up yet, go to [https://go.nx.dev/community](https://go.nx.dev/community).
Discord is built for managing communities and will open up a series of features to come. Things like a built-in forum to ask questions, the ability to highlight Nx events (e.g. the Nx live stream) and having powerful automation and moderation tools. Since the launch a couple of weeks ago, already 1500+ members have signed up. If you didn't sign up yet, go to [https://go.nx.dev/community](https://go.nx.dev/community).
Juri also highlighted the [Nx Champions](/community) program that got launched this year which helps with efforts to grow the Nx community. The program features members that stood out in the Nx community by helping support others, producing content or speaking at conferences about Nx and related tech.
Finally there were also two **announcements**:
@@ -41,15 +42,15 @@ Finally there were also two **announcements**:
- the Nx team decided to move off Medium for a better publishing experience but mainly also to avoid the paywall, something that the team has no control over. The new blog is currently being built and will be hosted at [blog](/blog). This also allows to better resurface information by being able to integrate blog articles into the Nx docs search and make them also accessible to the Nx AI Assistant which was the 2nd announcement.
- the **Nx AI Assistant** is an experiment the team is running to use AI to improve discoverability on the Nx docs. The ChatGPT powered assistant allows to ask natural language questions and responds based on the Nx docs training data, also including links to the sources. Try it out at [ai-chat](/ai-chat) and use the feedback thumbs-up/down buttons to help improve it over time 🙏.
Also, Nx is open source: [https://github.com/nrwl/nx](https://github.com/nrwl/nx). Contribute! And while youre there, dont forget to give us a star 😃.
Also, Nx is open source: [https://github.com/nrwl/nx](https://github.com/nrwl/nx). Contribute! And while you're there, don't forget to give us a star 😃.
**Victor Savkin** began the second segment of the keynote discussing the hidden expenses that often plague large teams.
![](/blog/images/2023-10-13/bodyimg4.webp)
He emphasized that as an organization grows, so does the supporting work. This isnt limited to just communication and management. Every artifact, be it code, process, or otherwise, needs to be assimilated into the broader context. This supporting work becomes intricate and demanding. He pointed out that the remote work trend, while it started with a lot of momentum, struggles in larger corporations because it demands even more coordination and effort. In contrast, smaller entities often outshine their larger counterparts due to the reduced overhead of supporting work.
He emphasized that as an organization grows, so does the supporting work. This isn't limited to just communication and management. Every artifact, be it code, process, or otherwise, needs to be assimilated into the broader context. This supporting work becomes intricate and demanding. He pointed out that the remote work trend, while it started with a lot of momentum, struggles in larger corporations because it demands even more coordination and effort. In contrast, smaller entities often outshine their larger counterparts due to the reduced overhead of supporting work.
One of Victors main points was the potential of software developers. Given the right tools and environment, they can achieve remarkable feats. CI is one such tool.
One of Victor's main points was the potential of software developers. Given the right tools and environment, they can achieve remarkable feats. CI is one such tool.
![](/blog/images/2023-10-13/bodyimg5.webp)
@@ -59,7 +60,7 @@ However, scaling CI is a challenge. In larger workspace, up to 50 agents is pret
![](/blog/images/2023-10-13/bodyimg6.webp)
This might be manageable in a static repository setup, but monorepos introduce an added layer of complexity. Here, static CI recipes just wont cut it. The result is either an overuse of computational resources, leading to waste of money, or a painfully slow CI.
This might be manageable in a static repository setup, but monorepos introduce an added layer of complexity. Here, static "CI recipes" just won't cut it. The result is either an overuse of computational resources, leading to waste of money, or a painfully slow CI.
Victor critiqued that most current CI setups are:
@@ -103,7 +104,7 @@ This elevated abstraction is possible because Nx Cloud & Nx are intimately famil
![](/blog/images/2023-10-13/bodyimg8.webp)
Beyond simplifying CI configurations, Nx Cloud Workflows helps optimize computational resource use. Agents are instantiated dynamically based on the projects requirements.
Beyond simplifying CI configurations, Nx Cloud Workflows helps optimize computational resource use. Agents are instantiated dynamically based on the project's requirements.
![](/blog/images/2023-10-13/bodyimg9.webp)
@@ -132,17 +133,17 @@ Simon Critchley (Senior Software Architect at Nx) dives into the more technical
![](/blog/images/2023-10-13/bodyimg11.webp)
Apart from the distributed caching, Nx Cloud already offers [DTE (Distributed Task Execution)](/ci/features/distribute-task-execution), which is a mechanism to seamlessly distribute tasks across various machines to achieve a high degree of parallelism. Up until now it was on you to configure your existing CI in a way to provision machines (agents) to Nx Cloud DTE. This required some fine-tuning to understand the best level of parallelism given the underlying monorepo and tasks that need to be run. If you have too many machines, itll be wasteful, if you have to few your CI will be slower.
Apart from the distributed caching, Nx Cloud already offers [DTE (Distributed Task Execution)](/ci/features/distribute-task-execution), which is a mechanism to seamlessly distribute tasks across various machines to achieve a high degree of parallelism. Up until now it was on you to configure your existing CI in a way to provision machines (agents) to Nx Cloud DTE. This required some fine-tuning to understand the best level of parallelism given the underlying monorepo and tasks that need to be run. If you have too many machines, it'll be wasteful, if you have to few your CI will be slower.
Nx Cloud Workflow is an advancement of the DTE mechanism, where machines can be automatically provisioned and scaled based on the tasks that need to be run. Essentially it is a replacement for your existing CI but way smarter because it is able to leverage the knowledge it has about the Nx workspace, historical data and can thus do a series of optimizations. Traditional CI systems are running low-level commands on machines. Nx Cloud Workflows is task oriented instead: you tell it to run builds, tests, e2e, linting on the affected projects of the Nx workspace and it figures out how to split them up into fine-grained tasks and then distributes them among dynamically provisioned agents.
From a developers perspective, Nx Cloud Workflows are written in Yaml (or alternatively in JSON which is handy if you need to generate them). The format is very similar to existing CI providers to make sure the knowledge you have easily transfers. If you want an example, were dog-fooding Nx Cloud Workflows on the Nx repo (note the config will change as the product progresses): [https://github.com/nrwl/nx/blob/master/.nx/workflows/agents.yaml](https://github.com/nrwl/nx/blob/master/.nx/workflows/agents.yaml)
From a developer's perspective, Nx Cloud Workflows are written in Yaml (or alternatively in JSON which is handy if you need to generate them). The format is very similar to existing CI providers to make sure the knowledge you have easily transfers. If you want an example, we're dog-fooding Nx Cloud Workflows on the Nx repo (note the config will change as the product progresses): [https://github.com/nrwl/nx/blob/master/.nx/workflows/agents.yaml](https://github.com/nrwl/nx/blob/master/.nx/workflows/agents.yaml)
Simon then dives way deeper into the underlying architecture. In particular, how scheduling in Kubernetes works, which is used at the infrastructure level for Nx Cloud Workflows.
![](/blog/images/2023-10-13/bodyimg12.webp)
Workflow scheduling is handled by Kubernetes, specifically through a Workflow Controller that interacts with the K8s API Server and triggers Kubernetes Pods. Each Pod contains a Workflow executor and sidecar containers. All containers in the Nx Cloud workflow share a workspace volume for collaborative access. This allows for interesting optimizations in terms of sharing `node_modules` and restoring cache results.
Workflow scheduling is handled by Kubernetes, specifically through a "Workflow Controller" that interacts with the K8s API Server and triggers Kubernetes Pods. Each Pod contains a Workflow executor and sidecar containers. All containers in the Nx Cloud workflow share a workspace volume for collaborative access. This allows for interesting optimizations in terms of sharing `node_modules` and restoring cache results.
![](/blog/images/2023-10-13/bodyimg13.webp)
@@ -168,7 +169,7 @@ Michael talks about how to leverage Nx to migrate multiple repositories into a m
- how to do the move in parallel
- how to measure the progress
The project usually starts with an architectural audit. That involves a detailed analysis of the underlying codebase, also including an executive summary for non technical folks. Once the audit is done, the actual move is planned and prepared. A part of that is to define Nx migration goals, like
The project usually starts with an architectural audit. That involves a detailed analysis of the underlying codebase, also including an executive summary for non technical folks. Once the audit is done, the actual move is planned and prepared. A part of that is to define "Nx migration goals", like
- Single Version Policy
- Improved Maintenance
@@ -183,7 +184,7 @@ To prioritize which ones to address first, Michael uses the following metaphor:
![](/blog/images/2023-10-13/bodyimg15.webp)
The important part here is to understand why apples get bad in the first place. Is it the harvesting process?
The important part here is to understand why "apples get bad" in the first place. Is it the harvesting process?
Once the priorities are defined and roadmap laid out, the goal is to **move in parallel.**
As part of that move the following gets produced:
@@ -199,7 +200,7 @@ The training program is there to tackle the bottleneck of missing knowledge, rig
Finally the impact measurement; Nx Cloud already has graphs to measure how much time got saved in CI due to the improvements made. Michael mentions they go further, also measuring communication and productivity.
An interesting part is also how they perform the repository synching (from polyrepo to monorepo). They leverage an Nx plugin that
An interesting part is also how they perform the repository syncing (from polyrepo to monorepo). They leverage an Nx plugin that
- contains shared build logic
- has rules to run that produce actionable feedback about what is needed to sync/align the polyrepo repository s.t. it can be merged into the monorepo
@@ -215,7 +216,7 @@ Demo Repo:
{% youtube src="https://www.youtube.com/watch?v=bnjOu7iOrMg" /%}
Craigory did a deep dive into the new Nx inference API. This is particularly interesting if youre developing [Nx plugins](/extending-nx/intro/getting-started) or if you have leverage/build some more advanced automation for your Nx workspace.
Craigory did a deep dive into the new Nx inference API. This is particularly interesting if you're developing [Nx plugins](/extending-nx/intro/getting-started) or if you have leverage/build some more advanced automation for your Nx workspace.
What is project inference:
@@ -239,7 +240,7 @@ Project graph API v2
- `createNodes` - finds graph nodes based on files on disk
- `createDependencies` - finds edges to be added to the graph
Still 2 parts, but theres no overlap between these two and they have very specific purposes.
Still 2 parts, but there's no overlap between these two and they have very specific purposes.
`createNodes` is a tuple composed of:
@@ -285,7 +286,7 @@ Currently, Nx offers support for two predominant monorepo styles: package-based
- These are structured to prioritize consistency and maintainability.
- Updates within this framework are automated, and the setup adheres to a single-version policy.
Isaac then drew parallels between the Apollo program and the package-based mindset. The Apollo missions were evolutionary in nature, constantly pushing the envelope and embracing innovation with each successive mission. However, this trailblazing approach wasnt without its perils, as evidenced by tragic accidents. This experimental approach was feasible because the core team, responsible for creating the setup, remained consistent throughout the projects duration.
Isaac then drew parallels between the Apollo program and the package-based mindset. The Apollo missions were evolutionary in nature, constantly pushing the envelope and embracing innovation with each successive mission. However, this trailblazing approach wasn't without its perils, as evidenced by tragic accidents. This experimental approach was feasible because the core team, responsible for creating the setup, remained consistent throughout the project's duration.
In contrast, Isaac likened the International Space Station (ISS) to the integrated mindset. The ISS epitomizes the challenges of coordination, given its international collaboration involving numerous countries. Emphasizing longevity, the ISS necessitates that every new crew member be proficient in operating its intricate machinery.
@@ -298,7 +299,7 @@ Shifting gears, Isaac delved into a hands-on demonstration. He outlined the proc
- Devising a novel Nx generator, streamlining the process of setting up new libraries within the workspace.
- Finally, he showcased the seamless upgrade mechanism, ensuring the workspace is always aligned with the latest version.
## Nxt Level Publishing
## Nx't Level Publishing
**Speaker:** [James Henry](https://twitter.com/MrJamesHenry)
[Slides](https://main--idyllic-dieffenbachia-3699ec.netlify.app/1)
@@ -322,7 +323,7 @@ Important to note that all the existing plugins are still valid and will still b
James goes forward demoing how `nx release` works in a simple NPM package: [jump directly into the video](https://www.youtube.com/watch?si=xoIW0Q-mQWTGgrek&t=411&v=p5qW5-2nKqI&feature=youtu.be).
Nx release can be added to any npm package. All thats needed is the `nx` and `@nx/js` package and a `nx: {}` node in the `package.json`.
Nx release can be added to any npm package. All that's needed is the `nx` and `@nx/js` package and a `nx: {}` node in the `package.json`.
Nx release has a dry-run mode; `nx release version --dry-run`. This will output a diff of what version would be created and on which `package.json` files (if there are multiple).
The same mechanism also works for the `changelog` command, e.g. `nx release changelog --dry-run`. In addition to just dry-run, the `changelog` command also has an `--interactive` mode that allows to get the generated changelog in an interactive editor where you can adjust and add extra stuff.
@@ -335,7 +336,7 @@ A nice feature is also that the changelog will...
- automatically group first by type (e.g. features grouped together, fixes etc)
- within each type grouping it will be grouped by scope such as pkg-a etc which will be alphabetized
- if theres a fix on the entire repo thatll come first before the per-package changes
- if there's a fix on the entire repo that'll come first before the per-package changes
`nx release changelog --create-release=github` allows to also automatically push the changelog to a Github release.
@@ -344,7 +345,7 @@ When running `nx release publish`, Nx also takes into account the right order of
Future roadmap:
- ability to customize how the release works by defining it in `nx.json`
- release groups will allow to group packages and define whether versions should be in sync or versioned independently; filter by projects, or even just publish a subset of projects of a workspace
- "release groups" will allow to group packages and define whether versions should be in sync or versioned independently; filter by projects, or even just publish a subset of projects of a workspace
- publishing also automatically takes into account the provenance data on NPM
## Lightning Talk: What if your stories were — already — your e2e tests?
+26 -27
View File
@@ -2,15 +2,16 @@
title: 'Nx 17 has Landed'
slug: 'nx-17-release'
authors: ['Juri Strumpflohner', 'Zack DeRose']
cover_image: '/blog/images/2023-10-20/featured_img.png'
cover_image: '/blog/images/2023-10-20/featured_img.avif'
tags: [nx, release]
description: Nx 17 released with Vue.js support, Module Federation enhancements, generator path improvements, AI chatbot integration, and more.
---
Were excited to announce the release of Nx version 17!
We're excited to announce the release of Nx version 17!
This article will cover the main things you need to know to get the most out of Nx 17!
Heres a Table of Contents so you can skip straight to the updates you care about the most:
Here's a Table of Contents so you can skip straight to the updates you care about the most:
- [It's a Vue-tiful Day for Nx](#its-a-vuetiful-day-for-nx)
- [Enhancements to Module Federation Support](#enhancements-to-module-federation-support)
@@ -33,7 +34,7 @@ Heres a Table of Contents so you can skip straight to the updates you care ab
---
## Its a Vue-tiful Day for Nx!
## It's a Vue-tiful Day for Nx!
Ever since we added Vite as a first-class citizen to Nx workspaces (see `@nx/vite`), we started falling in love with the Vue community. The only logical next step: Nx now provides a brand new Vue plugin that is being maintained by the Nx team! (And we're already working on a [Nuxt](https://nuxt.com/) plugin 🤫)
@@ -47,13 +48,11 @@ This option will create a new Nx workspace with a fresh Vue application, all set
npm add -D @nx/vue
```
And youll have access to Nx generators so that you can generate Vue applications, libraries, components, and more in your workspace:
And you'll have access to Nx generators so that you can generate Vue applications, libraries, components, and more in your workspace:
![](/blog/images/2023-10-20/bodyimg2.gif)
Were very excited for this support to land, and were eager to get it into our users 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 youre eager to learn more, make sure to check out our new [Vue standalone tutorial](/getting-started/tutorials/vue-standalone-tutorial).
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.
## Enhancements to Module Federation Support
@@ -61,7 +60,7 @@ Nx already had great support for Module Federation — Nx 17 improves on this su
### NEW: Typesafe Config
Projects created with Nxs generators for module federation will now be created with a `module-federation.config.ts` file (as opposed to a `.js` file). A new `ModuleFederationConfig` interface is also exported from the `@nx/webpack` plugin.
Projects created with Nx's generators for module federation will now be created with a `module-federation.config.ts` file (as opposed to a `.js` file). A new `ModuleFederationConfig` interface is also exported from the `@nx/webpack` plugin.
### Better Typesafety Across Modules
@@ -119,13 +118,13 @@ This config will ensure that version `0.0.1` of the `is-odd` is used.
Similar to the [adjustments we made in 16.8](https://www.youtube.com/watch?v=bw8pRh0iC4A&t=14s) for most of our project-creating generators, v17 brings updates to how component generators work. These updates aim to give you more control over the name and file location of your components.
Towards this end, weve added a new `--nameAndDirectoryFormat` option that you can set to either `as-provided` or `derived`.
Towards this end, we've added a new `--nameAndDirectoryFormat` option that you can set to either `as-provided` or `derived`.
When set to `as-provided`, the generator will use the `name` option for the name of your component and the `directory` option to determine where on your file system to add the component. `as-provided` will be used by default if none is specified.
When set to `derived`, the generator will try to determine where to create your component based on the `project` option - which will mainly operate how component generators do now.
In addition, component generators now follow any given casing for component files. For example, lets say we have an integrated monorepo with a react application called my-app and want to add a Home component. With Nx 17, you can run the command:
In addition, component generators now follow any given casing for component files. For example, let's say we have an integrated monorepo with a react application called "my-app" and want to add a "Home" component. With Nx 17, you can run the command:
```shell
> nx g component apps/my-app/src/app/Home
@@ -133,7 +132,7 @@ In addition, component generators now follow any given casing for component file
And a `Home.tsx` file will be added in the `apps/my-app/src/app` directory.
Finally, generators will now factory in your current working directory, so you can also create this Home component via:
Finally, generators will now factory in your current working directory, so you can also create this "Home" component via:
```shell
cd apps/my-app/src/app
@@ -142,7 +141,7 @@ nx g component Home
## The NEW Nx AI ChatBot
Weve added a new AI ChatBot to our docs site. You can access it now at [/ai-chat](/ai-chat).
We've added a new AI ChatBot to our docs site. You can access it now at [/ai-chat](/ai-chat).
![](/blog/images/2023-10-20/bodyimg4.gif)
@@ -156,9 +155,9 @@ After running the `nx migrate` command to upgrade to Nx 17 and using Nx Cloud, y
Our Nx Cloud updates come alongside configuration changes in your `nx.json` file and project configuration.
Specifically, weve added an optional `nxCloudAccessToken` to the `nx.json` file - as long as a token is provided here, we'll make sure that you take advantage of the currently deployed version of Nx Cloud when running commands with Nx.
Specifically, we've added an optional `nxCloudAccessToken` to the `nx.json` file - as long as a token is provided here, we'll make sure that you take advantage of the currently deployed version of Nx Cloud when running commands with Nx.
Weve also removed the need to specify `cacheableOperations` at the task-runner level. From now on, every `target` configured in your `project.json` can be defined as cacheable using the `cache` property.
We've also removed the need to specify `cacheableOperations` at the task-runner level. From now on, every `target` configured in your `project.json` can be defined as cacheable using the `cache` property.
```json {% fileName="nx.json" %}
{
@@ -173,7 +172,7 @@ Weve 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.](/features/cache-task-results)
Weve 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 weve 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
@@ -183,19 +182,19 @@ If you missed it, Simon Critchley walks you through in his [Nx Conf](/blog/nx-co
{% youtube src="https://www.youtube.com/embed/JG1FWfZFByM?si=7_NzxJP8nA7RbFhl" /%}
Put simply, Nx Workflows represents Nx entering the CI provider arena, where Nx can now provide you with Cloud Computation to run your CI tasks. This creates the foundation for a whole new class of Nx Cloud features that were excited to work on in the coming cycles.
Put simply, Nx Workflows represents Nx entering the CI provider arena, where Nx can now provide you with Cloud Computation to run your CI tasks. This creates the foundation for a whole new class of Nx Cloud features that we're excited to work on in the coming cycles.
The Nx repo itself is now dog-fooding this latest feature (dog-fooding refers to using our tool in our own projects, or eating our own dog food), and you can see how its going now on our [public Nx Cloud workspace](https://staging.nx.app/orgs/62d013d4d26f260059f7765e/workspaces/62d013ea0852fe0a2df74438/overview).
The Nx repo itself is now "dog-fooding" this latest feature (dog-fooding refers to using our tool in our own projects, or "eating our own dog food"), and you can see how it's going now on our [public Nx Cloud workspace](https://staging.nx.app/orgs/62d013d4d26f260059f7765e/workspaces/62d013ea0852fe0a2df74438/overview).
![](/blog/images/2023-10-20/bodyimg5.webp)
Nx Workflows are still in the experimental phase. Were running pilots with our enterprise clients and are excited to open this up for everyone soon!
Nx Workflows are still in the experimental phase. We're running pilots with our enterprise clients and are excited to open this up for everyone soon!
## Task Graphing Improvements
Task Caching in Nx is based on a set of input files calculated for a given task. You can specify specific files or patterns of files in your project.json for a particular task or in the `targetDefaults` of your `nx.json` to set the default file sets for your inputs.
Task Caching in Nx is based on a set of "input" files calculated for a given task. You can specify specific files or patterns of files in your project.json for a particular task or in the `targetDefaults` of your `nx.json` to set the default file sets for your inputs.
There have been some difficulties in determining precisely which files were included and which werent for a given task. This is where our latest update to the task graph comes in:
There have been some difficulties in determining precisely which files were included and which weren't for a given task. This is where our latest update to the task graph comes in:
![](/blog/images/2023-10-20/bodyimg6.webp)
@@ -205,7 +204,7 @@ You can open this graph using the command:
nx graph
```
And then selecting Task from the Project”/”Task graph dropdown in the top left. Clicking on a specific task now allows you to see a comprehensive list of all files that were factored in as inputs for this task:
And then selecting "Task" from the "Project"/"Task" graph dropdown in the top left. Clicking on a specific task now allows you to see a comprehensive list of all files that were factored in as inputs for this task:
![](/blog/images/2023-10-20/bodyimg7.webp)
@@ -227,19 +226,19 @@ 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](/nx-api/nx/documents/release), and be sure to catch James Henrys announcement of this new command at [Nx Conf](/blog/nx-conf-2023-recap):
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](/blog/nx-conf-2023-recap):
{% youtube src="https://www.youtube.com/embed/p5qW5-2nKqI?si=FzpGMJwPVINc1hgL" /%}
## Experimental: Nx Project Inference API v2
At Nx, were OBSESSED with building a better, more robust experience for our developers. Towards this end, were now in [v2 of our Project Inference API](/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](/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](/nx-api/vue).
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.
For most developers, the main thing you need to know is that plugins may now add additional targets that you wont see in your `project.json` file. To see your actual project configuration, you can now use the command:
For most developers, the main thing you need to know is that plugins may now add additional targets that you won't see in your `project.json` file. To see your actual project configuration, you can now use the command:
```shell
nx show project <project_name>
@@ -269,7 +268,7 @@ npx nx migrate --run-migrations
## Wrapping up
Thats all for now folks! Were just starting up a new iteration of development on Nx, so be sure to subscribe to our [YouTube channel](https://www.youtube.com/@nxdevtools) to get updates when new features land! Until next time, KEEP WORKING HARD!
That's all for now folks! We're just starting up a new iteration of development on Nx, so be sure to subscribe to our [YouTube channel](https://www.youtube.com/@nxdevtools) to get updates when new features land! Until next time, KEEP WORKING HARD!
---
+7 -6
View File
@@ -2,8 +2,9 @@
title: State Management Nx React Native/Expo Apps with TanStack Query and Redux
slug: 'state-management-nx-react-native-expo-apps-with-tanstack-query-and-redux'
authors: [Emily Xiong]
cover_image: '/blog/images/2023-11-08/featured_img.webp'
cover_image: '/blog/images/2023-11-08/featured_img.avif'
tags: [nx, React Native]
description: Implementing state management in Nx React Native/Expo apps with TanStack Query and Redux, covering setup, dev tools, and unit testing.
---
There are currently countless numbers of state management libraries out there. This blog will show you how to use state management for React Native in Nx monorepo with [TanStack Query](https://tanstack.com/query/latest) (which happens to use [Nx on their repo](https://cloud.nx.app/orgs/6412ca9d1c251d000efa21ba/workspaces/6412c827e6da5d7b4a0b1fe3/overview)) and Redux.
@@ -88,7 +89,7 @@ const App = () => {
export default App;
```
Note: the [React Query Devtools](https://tanstack.com/query/latest/docs/framework/react/devtools) currently do not support react native, and it only works on the web, so there is a condition: `{ Platform.OS === web && <ReactQueryDevtools />}.`
Note: the [React Query Devtools](https://tanstack.com/query/latest/docs/framework/react/devtools) currently do not support react native, and it only works on the web, so there is a condition: `{ Platform.OS === 'web' && <ReactQueryDevtools />}.`
For the react native apps, in order to use this tool, you need to use [react-native-web](https://necolas.github.io/react-native-web/) to interpolate your native app to the web app first.
@@ -102,9 +103,9 @@ Or you can run `npx nx serve cats` to launch the app in a web browser and debug
What is a query?
> A query is a declarative dependency on an asynchronous source of data that is tied to a unique key. A query can be used with any Promise-based method (including GET and POST methods) to fetch data from a server. [(https://tanstack.com/query/v4/docs/react/guides/queries)](https://tanstack.com/query/v4/docs/react/guides/queries)
> "A query is a declarative dependency on an asynchronous source of data that is tied to a unique key. A query can be used with any Promise-based method (including GET and POST methods) to fetch data from a server." [(https://tanstack.com/query/v4/docs/react/guides/queries)](https://tanstack.com/query/v4/docs/react/guides/queries)
Now lets add our first query. In this example, it will be added under `lib/queries` folder. To create a query to fetch a new fact about cats, run the command:
Now let's add our first query. In this example, it will be added under `lib/queries` folder. To create a query to fetch a new fact about cats, run the command:
```shell
# expo workspace
@@ -124,7 +125,7 @@ Now notice under libs folder, `use-cat-fact` folder got created under `libs/quer
If you use React Native CLI, just add a folder in your workspace root.
For this app, lets use this API: [https://catfact.ninja/](https://catfact.ninja/). At `libs/queries/use-cat-fact/src/lib/use-cat-fact.ts`, add code to fetch the data from this API:
For this app, let's use this API: [https://catfact.ninja/](https://catfact.ninja/). At `libs/queries/use-cat-fact/src/lib/use-cat-fact.ts`, add code to fetch the data from this API:
```ts
import { useQuery } from '@tanstack/react-query';
@@ -187,7 +188,7 @@ fetchMock.enableMocks();
**2\. Create Mock Query Provider**
In order to test out `useQuery` hook, you need to wrap it inside a mock `QueryClientProvider`. Since this mock query provider is going to be used more than once, lets create a library for this wrapper:
In order to test out `useQuery` hook, you need to wrap it inside a mock `QueryClientProvider`. Since this mock query provider is going to be used more than once, let's create a library for this wrapper:
```shell
# expo library
+3 -2
View File
@@ -2,8 +2,9 @@
title: Nx Docs AI Assistant
slug: 'nx-docs-ai-assistant'
authors: [Katerina Skroumpelou]
cover_image: '/blog/images/2023-11-21/featured_img.webp'
cover_image: '/blog/images/2023-11-21/featured_img.avif'
tags: [nx, docs, AI]
description: Explore the Nx Docs AI Assistant's architecture, user benefits, and how it enhances documentation accessibility through intelligent search and contextual responses.
---
## Introduction
@@ -34,7 +35,7 @@ In a nutshell, the Nx Docs AI Assistant works in the following way:
This is based on the Web Q&A Tutorial from OpenAI [(https://platform.openai.com/docs/tutorials/web-qa-embeddings)](https://platform.openai.com/docs/tutorials/web-qa-embeddings) and Supabases Vector Search example [(https://supabase.com/docs/guides/ai/examples/nextjs-vector-search)](https://supabase.com/docs/guides/ai/examples/nextjs-vector-search).
Its important to note here that we are not “training the model on our docs”. The model is pretrained. We are just giving the model parts of our docs which are relevant to the users question, and the model creates a coherent answer to the question. Its basically like pasting in ChatGPT a docs page and asking it “how do I do that?”. Except in this case, were first searching our documentation and giving GPT only the relevant parts (more about how we do that later in this article), which it can “read” and extract information from.
Its important to note here that we are not “training the model in our docs”. The model is pretrained. We are just giving the model parts of our docs which are relevant to the users question, and the model creates a coherent answer to the question. Its basically like pasting in ChatGPT a docs page and asking it “how do I do that?”. Except in this case, were first searching our documentation and giving GPT only the relevant parts (more about how we do that later in this article), which it can “read” and extract information from.
## Step 1: Preprocessing our docs
+16 -15
View File
@@ -2,8 +2,9 @@
title: Unit Testing Expo Apps With Jest
slug: 'unit-testing-expo-apps-with-jest'
authors: [Emily Xiong]
cover_image: '/blog/images/2023-11-22/featured_img.webp'
cover_image: '/blog/images/2023-11-22/featured_img.avif'
tags: [nx, tutorial]
description: Learn how to unit test Expo apps using Jest and React Native Testing Library, with solutions for mocking AsyncStorage, Redux, and React Navigation.
---
In my latest [blog](/blog/step-by-step-guide-to-creating-an-expo-monorepo-with-nx), I successfully navigated through the steps of setting up an Expo Monorepo with [Nx](). The next challenge? Testing! This blog dives into:
@@ -16,7 +17,7 @@ Repo:
## Stacks
Heres my setup
Here's my setup
- Testing framework: [jest](https://jestjs.io/)
- Testing library: [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/)
@@ -24,7 +25,7 @@ Heres my setup
## Writing and Running Unit Tests
When you use Nx, it not only configures and sets up Jest, but also creates a default unit test for every expo component that is being generated. Heres what that looks like:
When you use Nx, it not only configures and sets up Jest, but also creates a default unit test for every expo component that is being generated. Here's what that looks like:
```typescript
import { render } from '@testing-library/react-native';
@@ -46,7 +47,7 @@ To run all unit tests for a given project, use:
npx nx test <project-name>
```
Heres the output of running this for my example app:
Here's the output of running this for my example app:
![terminal output](/blog/images/2023-11-22/bodyimg1.webp)
@@ -95,7 +96,7 @@ I am using the library `@react-native-async-storage/async-storage`, and I got th
The issue is that `@react-native-async-storage/async-storage` library can only be used in `NativeModule`. Since unit testing with Jest only tests JS/TS file logic, I need to mock this library.
In the apps test-setup.ts file, add the below lines:
In the app's test-setup.ts file, add the below lines:
```typescript
jest.mock('@react-native-async-storage/async-storage', () =>
@@ -103,7 +104,7 @@ jest.mock('@react-native-async-storage/async-storage', () =>
);
```
## Error: Could not find store
## Error: Could not find "store"
I am using Redux for state management, and I got this error for my stateful components:
@@ -146,7 +147,7 @@ beforeEach(() => {
});
```
For example, one of my stateful components unit test will become:
For example, one of my stateful components' unit test will become:
```typescript
import React from 'react';
@@ -207,7 +208,7 @@ jest.spyOn(ReactQuery, 'useQuery').mockImplementation(
);
```
### Error: Couldnt find a navigation object
### Error: Couldn't find a navigation object
If you use `@react-navigation` library for navigation, and inside your component, there are hooks from this library like `useNavigation` and `useRoute`, you are likely to get this error:
@@ -215,7 +216,7 @@ If you use `@react-navigation` library for navigation, and inside your component
Couldn't find a navigation object. Is your component inside NavigationContainer?
```
The fix this, I need to mock the `@react-nativgation/native` library. In the apps test-setup.ts file, I need to add:
The fix this, I need to mock the `@react-nativgation/native` library. In the app's test-setup.ts file, I need to add:
```typescript
jest.mock('@react-navigation/native', () => {
@@ -234,7 +235,7 @@ jest.mock('@react-navigation/native', () => {
});
```
### SyntaxError: Unexpected token export
### SyntaxError: Unexpected token 'export'
I got this error when using a library with ECMAScript Module (ESM), such as [`udid`](https://github.com/uuidjs/uuid):
@@ -252,7 +253,7 @@ I got this error when using a library with ECMAScript Module (ESM), such as [`ud
Jest does not work with ESM out of the box. The simple solution is to map this library to the CommonJS version of this library.
In the apps `jest.config.ts`, there should be an option called `moduleNameMapper`. The library I used is called `uuid`, so I need to add the map `uuid: require.resolve(uuid)` under `moduleNameMapper`. So when the code encounters imports from `uuid` library, it will resolve the CommonJS version of it:
In the app's `jest.config.ts`, there should be an option called `moduleNameMapper`. The library I used is called `uuid`, so I need to add the map `uuid: require.resolve('uuid')` under `moduleNameMapper`. So when the code encounters imports from `uuid` library, it will resolve the CommonJS version of it:
```typescript
module.exports = {
@@ -292,8 +293,8 @@ I got this error when I was importing from a library such as [react-native-vecto
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
• If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
• If I need a custom transformation specify a "transform" option in my config.
• If I simply want to mock my non-JS modules (e.g. binary assets) I can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/configuration
@@ -305,7 +306,7 @@ To fix this, add this library name to `transformIgnorePatterns` in the app's jes
What is `transformIgnorePatterns`? The `transformIgnorePatterns` allows developers to specify which files shall be transformed by Babel. `transformIgnorePatterns` is an array of regexp pattern strings that should be matched against all source file paths before the transformation. If the file path matches any patterns, it will not be transformed by Babel.
By default, Jest will ignore all the files under node_modules and only transform the files under the projects src.
By default, Jest will ignore all the files under node_modules and only transform the files under the project's src.
However, some libraries such as `react-native-paper` or `react-native-svg`, the library files are in `.ts` or `.tsx`. These files are not compiled to `js`. So I need to add these libraries' names to `transformIgnorePatterns`, so these libraries will be transformed by Babel along with my project. source file. The default generated `jest.config.js` already has:
@@ -324,7 +325,7 @@ If I have an error related to a library with an unexpected token, I need to chec
Here are some common errors that I will probably run into while doing unit testing. The solution to most problems is to find a way to mock a library that is not relevant to my component logic.
With Nx, you do not need to explicitly install any testing library, so you can dive right in and focus on writing the tests rather than spending time on setup.
With Nx, I do not need to explicitly install any testing library, so I can dive right in and focus on writing the tests rather than spending time on setup.
## Learn more
+24 -23
View File
@@ -2,11 +2,12 @@
title: Nx 17.2 Update
slug: 'nx-17-2-release'
authors: [Zack DeRose]
cover_image: '/blog/images/2023-12-20/featured_img.png'
cover_image: '/blog/images/2023-12-20/featured_img.avif'
tags: [nx, changelog, release]
description: Nx 17.2 released with simplified project configuration, Rust-powered task hashing, enhanced Module Federation, expanded releases, Angular 17 support, and Nx Agents for faster CI.
---
Its been a bit since we launched [Nx 17](/blog/nx-17-release)! In this article, well go over some of the new developments and improvements that have landed in Nx 17.2:
It's been a bit since we launched [Nx 17](/blog/nx-17-release)! In this article, we'll go over some of the new developments and improvements that have landed in Nx 17.2:
- [Nx Closes In On 4 Million Weekly NPM Downloads!!](#nx-closes-in-on-4-million-weekly-npm-downloads)
- [New Simplified Project Configuration On the Way](#new-simplified-project-configuration-on-the-way)
@@ -27,40 +28,40 @@ And our downloads on NPM keep confirming this. We are about to cross 4 million d
![](/blog/images/2023-12-20/bodyimg1.webp)
If this made you curious, keep an eye on [our blog](/blog) or [X/Twitter](https://twitter.com/nxdevtools) as were going to release a 2023 year recap blog post next week.
If this made you curious, keep an eye on [our blog](/blog) or [X/Twitter](https://twitter.com/nxdevtools) as we're going to release a 2023 year recap blog post next week.
## New Simplified Project Configuration On the Way
Adoption is crucial, and simplicity is the driver for adoption. Last year we heavily optimized how you can use Nx in an existing project. Just drop the `nx` package (or run `nx init`) and that's it. Nx understands your workspace and efficiently runs your `package.json` scripts.
Using Nx at that level is definitely useful as you get intelligent parallelization, task pipelines and caching. But it is just the tip of the iceberg of what Nx is actually capable of. Nx plugins provide much more, especially in terms of DX and developer productivity by taking away some of the burden of configuring your monorepo tooling. But many devs new to Nx found it harder to get started with them initially and incrementally migrating to Nx plugins wasnt as straightforward as wed wanted it to be.
Using Nx at that level is definitely useful as you get intelligent parallelization, task pipelines and caching. But it is just the tip of the iceberg of what Nx is actually capable of. Nx plugins provide much more, especially in terms of DX and developer productivity by taking away some of the burden of configuring your monorepo tooling. But many devs new to Nx found it harder to get started with them initially and incrementally migrating to Nx plugins wasn't as straightforward as we'd wanted it to be.
This is something thats gonna change drastically in 2024. And weve layed the first cornerstone for that. But it is behind a feature flag still as were streamlining the last bits. The goal?
This is something that's gonna change drastically in 2024. And we've layed the first cornerstone for that. But it is behind a feature flag still as we're streamlining the last bits. The goal?
- Going almost configuration-less (good defaults, you customize when you need to)
- Allowing easy drop-in of Nx plugins into existing workspaces (provides immediate productivity gains, but stays out of your way)
This opens up a series of possibilities which were already super excited about. Youll hear more about this in the new year ;)
This opens up a series of possibilities which we're already super excited about. You'll hear more about this in the new year ;)
## Rust for Speed, Typescript for Extensibility
At Nx, weve heavily embraced Typescript from the beginning, and weve been very happy with that decision.
At Nx, we've heavily embraced Typescript from the beginning, and we've been very happy with that decision.
If youve been paying attention to previous release announcements though, youve probably noticed that weve been moving more and more of the computationally intensive and performance critical pieces of the core of Nx from Typescript to Rust.
If you've been paying attention to previous release announcements though, you've probably noticed that we've been moving more and more of the computationally intensive and performance critical pieces of the core of Nx from Typescript to Rust.
That trend continues in Nx 17.2 with Nx [using Rust for its task hashing by default](https://github.com/nrwl/nx/pull/19617). Theres no adjustments needed for this change, and Nx will continue to behave the same way, just faster!
That trend continues in Nx 17.2 with Nx [using Rust for its task hashing by default](https://github.com/nrwl/nx/pull/19617). There's no adjustments needed for this change, and Nx will continue to behave the same way, just faster!
{% tweet url="https://twitter.com/victorsavkin/status/1724464283227234420" /%}
## Module Federation Updates
Module Federation has been a particularly hot topic lately, and 17.2 is coming in with some great enhancements to Nxs already best-in-class support for Module Federation!
Module Federation has been a particularly hot topic lately, and 17.2 is coming in with some great enhancements to Nx's already best-in-class support for Module Federation!
To start, weve greatly reduced the CPU and memory used for standing up your Module Federation web locally. These enhancements should be great news to larger workspaces using a Module Federation approach, where there were heavy CPU and memory costs to serving your entire federation locally.
To start, we've greatly reduced the CPU and memory used for standing up your Module Federation "web" locally. These enhancements should be great news to larger workspaces using a Module Federation approach, where there were heavy CPU and memory costs to serving your entire federation locally.
We accomplished these improvements by batching any applications that are not being watched for changes (listed with the `--devRemotes` option) to a single server, rather than a unique server for each application. We also parallelized the builds of these static applications when you start up your serve! You can now use the `--parallel={number}` option to specify how many builds you want going at any given time.
In addition to performance improvements, weve brought the concept of dynamic federation to our React module federation support. Dynamic federation allows a host application to dynamically load remotes via the manifest file.
In addition to performance improvements, we've brought the concept of dynamic federation to our React module federation support. Dynamic federation allows a host application to dynamically load remotes via the manifest file.
You can generate your react module federation workspace now to use dyanmic federation via the `--dynamic` flag:
@@ -80,7 +81,7 @@ Lastly, we have an [example repo](https://github.com/jaysoo/nx-react-vite-module
Nx 17 launched with the new `nx release` capability in the Nx CLI. Since then we've been streamlining the experience, accounting for various edge cases and release scenarios. (extensive docs are being worked on rn ;)
To give you full flexibility, in 17.2, weve added a programmatic API, which will allow you to easily write custom release scripts:
To give you full flexibility, in 17.2, we've added a programmatic API, which will allow you to easily write custom release scripts:
```ts
import { releaseChangelog, releasePublish, releaseVersion } from 'nx/release';
@@ -98,9 +99,9 @@ import { releaseChangelog, releasePublish, releaseVersion } from 'nx/release';
})();
```
This script above demonstrates how you can use this API to create your own script for updating your workspaces version, then creating a changelog, and then publishing your package!
This script above demonstrates how you can use this API to create your own script for updating your workspace's version, then creating a changelog, and then publishing your package!
Weve also added first class support for independently released projects, meaning you can now target a specific project for release with the `--projects` command. For example, you can create a new version for just one project in your workspace with the command:
We've also added first class support for independently released projects, meaning you can now target a specific project for release with the `--projects` command. For example, you can create a new version for just one project in your workspace with the command:
```shell
nx release version patch --project=my-project
@@ -140,19 +141,19 @@ nx migrate latest --interactive
## Smart Monorepos — Fast CI
We just gave our Nx homepage a small facelift, including a new tagline, subtagline and illustration to better reflect Nxs mission statement.
We just gave our Nx homepage a small facelift, including a new tagline, subtagline and illustration to better reflect Nx's mission statement.
![](/blog/images/2023-12-20/bodyimg3.webp)
When you enter the monorepo space, having good local development experience and tooling to support you is one thing, scaling is the other. And scaling comes with multiple challenges, from scaling teams working on the monorepo to maintaining high throughput on CI.
The latter is a common headache and weve seen companies struggle. With Nx were moving into the direction of becoming your e2e solution for monorepos, where we dont just cover your local dev experience, but also provide robust and scalable solutions on CI.
The latter is a common headache and we've seen companies struggle. With Nx we're moving into the direction of becoming your e2e solution for monorepos, where we don't just cover your local dev experience, but also provide robust and scalable solutions on CI.
![](/blog/images/2023-12-20/bodyimg4.webp)
Were super excited to have launched Nx Agents to Early Access. If you havent seen Victors video yet about how he reduced e2e tests from 90 minutes to 10, then make sure to [check it out](/ci/features/distribute-task-execution).
We're super excited to have launched "Nx Agents" to Early Access. If you haven't seen Victor's video yet about how he reduced e2e tests from 90 minutes to 10, then make sure to [check it out](/ci/features/distribute-task-execution).
**Nx Agents** are the next iteration of DTE, providing a more flexible, cost effective and more performant approach to distribution on CI. This includes things like being able to dynamically allocate machines based on the size of the PR and flaky task detection and re-running. Also, it can be configured with a single line:
**"Nx Agents"** are the next iteration of DTE, providing a more flexible, cost effective and more performant approach to distribution on CI. This includes things like being able to dynamically allocate machines based on the size of the PR and flaky task detection and re-running. Also, it can be configured with a single line:
```yaml
- name: Start CI run
@@ -160,11 +161,11 @@ Were super excited to have launched “Nx Agents” to Early Access. If you h
...
```
You can run Nx Agents on any CI provider. If youre curious, [sign up for early access](https://go.nx.dev/nx-agents-ea)!
You can run Nx Agents on any CI provider. If you're curious, [sign up for early access](https://go.nx.dev/nx-agents-ea)!
## New Canary Releases
Weve added a new npm release tag: canary!
We've added a new npm release tag: canary!
![](/blog/images/2023-12-20/bodyimg5.webp)
@@ -182,7 +183,7 @@ This should be useful for previewing new not-yet released features!
{% youtube src="https://www.youtube.com/embed/OXXTUjSO1hs?si=iDFETYdpg-0BrAIP" title="Nx 17.2 Release Livestream" /%}
Were going live in January with the Nx team to go over these updates as well! Be sure to click the link to get notified when we go live! And feel free to come with your questions in the chat!
We're going live in January with the Nx team to go over these updates as well! Be sure to click the link to get notified when we go live! And feel free to come with your questions in the chat!
## Automatically Update Nx
@@ -201,7 +202,7 @@ npx nx migrate --run-migrations
## Wrapping up
Thats all for now folks! Were just starting up a new iteration of development on Nx, so be sure to subscribe to our [YouTube channel](https://www.youtube.com/@nxdevtools) to get updates when new features land! Until next time, KEEP WORKING HARD!
That's all for now folks! We're just starting up a new iteration of development on Nx, so be sure to subscribe to our [YouTube channel](https://www.youtube.com/@nxdevtools) to get updates when new features land! Until next time, KEEP WORKING HARD!
---
+46 -45
View File
@@ -2,8 +2,9 @@
title: Nx — Highlights of 2023
slug: 'nx-highlights-of-2023'
authors: [Juri Strumpflohner, Victor Savkin, Zack DeRose]
cover_image: /blog/images/2023-12-28/featured_img.png
cover_image: /blog/images/2023-12-28/featured_img.avif
tags: [nx, nx-cloud]
description: "Nx's 2023 highlights - Rust for performance, Vite support, publishing improvements, new backend tools, expanded IDE support, Playwright integration, TypeScript enhancements, Vue plugin, and community growth."
---
It is that time again: getting flooded by Year of Review blog posts. We did it last year, and we should do it again! So here we go, and be warned, 2023 was massive!!
@@ -13,7 +14,7 @@ It is that time again: getting flooded by Year of Review blog posts. We did it l
- [Top 10 Nx Highlights of 2023](#top-10-nx-highlights-of-2023)
- [TypeScript for Extensibility — Rust for Speed](#typescript-for-extensibility-rust-for-speed)
- [First Class Vite Support](#first-class-vite-support)
- [Nxt Level Publishing](#nxt-level-publishing)
- [Nx't Level Publishing](#nxt-level-publishing)
- [Improved Node Backend Development: Fastify and Docker](#improved-node-backend-development-fastify-and-docker)
- [Nx Console support for IntelliJ](#nx-console-support-for-intellij)
- [Playwright for e2e testing](#playwright-for-e2e-testing)
@@ -38,7 +39,7 @@ We've picked out 10 highlights for you.
### TypeScript for Extensibility — Rust for Speed
At Nx, weve heavily embraced Typescript from the beginning and weve been very happy with that decision. Nx also stands as the [fastest JS monorepo tool](https://github.com/vsavkin/large-monorepo) available, demonstrating that adopting TypeScript does not necessarily compromise speed. However, we dont stop here. To push the boundaries further, we started to rewrite the most performance critical and computationally intensive parts of the Nx core in Rust.
At Nx, we've heavily embraced Typescript from the beginning and we've been very happy with that decision. Nx also stands as the [fastest JS monorepo tool](https://github.com/vsavkin/large-monorepo) available, demonstrating that adopting TypeScript does not necessarily compromise speed. However, we don't stop here. To push the boundaries further, we started to rewrite the most performance critical and computationally intensive parts of the Nx core in Rust.
Our initial focus was on [rewriting the task hasher](/blog/nx-15-8-rust-hasher-nx-console-for-intellij-deno-node-and-storybook), previously reliant on Git with a Node fallback. This shift to Rust brings a noticeable performance boost, particularly in large repositories, while maintaining the same user experience.
@@ -50,9 +51,9 @@ Such enhancements are especially crucial for the efficient [project graph calcul
### First Class Vite Support
Vite is rapidly transforming the landscape of frontend development! Its refreshing simplicity and innovative approach have made a significant mark in the developer community. What truly stands out is not just Vites technological aspect but also how its team approaches and grows the community around the tool. Vite stands for speed and community, values that deeply resonate with us here at Nx.
Vite is rapidly transforming the landscape of frontend development! Its refreshing simplicity and innovative approach have made a significant mark in the developer community. What truly stands out is not just Vite's technological aspect but also how its team approaches and grows the community around the tool. Vite stands for speed and community, values that deeply resonate with us here at Nx.
Our collaboration with our friends in the Vite core team has been incredibly fruitful. Vite is not just compatible but a first-class option with many of Nxs frontend plugins. When you create a new Nx powered React workspace, Vite (and [Vitest](https://vitest.dev/)) are your default options.
Our collaboration with our friends in the Vite core team has been incredibly fruitful. Vite is not just compatible but a first-class option with many of Nx's frontend plugins. When you create a new Nx powered React workspace, Vite (and [Vitest](https://vitest.dev/)) are your default options.
![](/blog/images/2023-12-28/bodyimg1.webp)
@@ -60,21 +61,21 @@ We also built some powerful code generators that not only facilitate a seamless
[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.
We also spoke at both editions of [ViteConf](https://viteconf.org/23/). If youre curious check out [Juris talk about High Speed Monorepos](https://www.youtube.com/watch?si=A5Nkg3rxe3DlODc4&v=TiU-hdn7_To&feature=youtu.be) and this years talk by [Katerina on Streamlining your Vite dev flow with Nx](https://www.youtube.com/watch?si=A5Nkg3rxe3DlODc4&v=TiU-hdn7_To&feature=youtu.be).
We also spoke at both editions of [ViteConf](https://viteconf.org/23/). If you're curious check out [Juri's talk about High Speed Monorepos](https://www.youtube.com/watch?si=A5Nkg3rxe3DlODc4&v=TiU-hdn7_To&feature=youtu.be) and this year's talk by [Katerina on Streamlining your Vite dev flow with Nx](https://www.youtube.com/watch?si=A5Nkg3rxe3DlODc4&v=TiU-hdn7_To&feature=youtu.be).
### Nxt Level Publishing
### Nx't Level Publishing
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 well 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.
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, weve introduced [the nx release command](/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 years Nx Conf:
James Henry gave a deep dive talk of an early version of it at this year's Nx Conf:
{% youtube src="https://www.youtube.com/embed/p5qW5-2nKqI" /%}
Since its introduction, the nx release feature has significantly evolved, leveraging the power of the Nx project graph to effectively understand inter-package dependencies. This understanding is crucial as it allows for:
Since its introduction, the "nx release" feature has significantly evolved, leveraging the power of the Nx project graph to effectively understand inter-package dependencies. This understanding is crucial as it allows for:
- Versioning packages offering support for both independent and locked versioning strategies.
- 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](/features/manage-releases#using-the-programmatic-api-for-nx-release) offers maximum flexibility.
@@ -83,21 +84,21 @@ Beyond these core functionalities, the feature also includes a robust grouping m
Colocating frontend and backend code within the same monorepo has become a popular practice. It greatly facilitates cross-functional teams and helps ensure end-to-end type safety. Although you can use [other backend stacks](https://www.nx-dotnet.com/) with Nx, Node is a popular backend companion for JS based frontends. We had support for [Express](https://expressjs.com/) and [NestJS](https://nestjs.com/) backend for a while.
This year we added another popular option: [Fastify](https://fastify.dev/). Known for its high performance, excellent developer experience, and useful built-in features like logging, Fastify aligns well with Nxs modular software design principles. Its extensible and modular nature complements the Nx philosophy perfectly.
This year we added another popular option: [Fastify](https://fastify.dev/). Known for its high performance, excellent developer experience, and useful built-in features like logging, Fastify aligns well with Nx's modular software design principles. Its extensible and modular nature complements the Nx philosophy perfectly.
{% youtube src="https://www.youtube.com/embed/LHLW0b4fr2w?si=WeTqm5msQxssQ_d3" /%}
In tandem with Fastify, weve also introduced [Docker support](https://youtu.be/LHLW0b4fr2w?feature=shared) for Node deployments.
In tandem with Fastify, we've also introduced [Docker support](https://youtu.be/LHLW0b4fr2w?feature=shared) for Node deployments.
### Nx Console support for IntelliJ
Nx Console has evolved from an experimental side project of the Nx team to a core part for enhancing your productivity when working in a monorepo. Being integrated right into your editor it can provide useful information and functionality right where you need it, whether thats running commands, [providing contextual autocomplete support](https://twitter.com/juristr/status/1653032530474565638) or the ability to explore the project and task graph.
Nx Console has evolved from an experimental side project of the Nx team to a core part for enhancing your productivity when working in a monorepo. Being integrated right into your editor it can provide useful information and functionality right where you need it, whether that's running commands, [providing contextual autocomplete support](https://twitter.com/juristr/status/1653032530474565638) or the ability to explore the project and task graph.
![](/blog/images/2023-12-28/bodyimg2.webp)
This year we not only added a lot of new features to Nx Console, but also rewrote its [internals](/blog/nx-console-gets-lit) which paved the way to expand Nx Console to other code editors: **JetBrains IDEs.**
Yes, this means you can now use the latest Nx Console directly in your [Webstorm IDE](https://www.jetbrains.com/webstorm/). Read the [announcement blog post](/blog/expanding-nx-console-to-jetbrains-ides) for all the details or go ahead and install Nx Console if you didnt already:
Yes, this means you can now use the latest Nx Console directly in your [Webstorm IDE](https://www.jetbrains.com/webstorm/). Read the [announcement blog post](/blog/expanding-nx-console-to-jetbrains-ides) for all the details or go ahead and install Nx Console if you didn't already:
- [Nx Console for VSCode](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)
- [Nx Console for IntelliJ](https://plugins.jetbrains.com/plugin/21060-nx-console)
@@ -189,11 +190,11 @@ Similarly we improved the ability to package your TS libraries in multiple forma
}
```
Heres a video that walks you through:
Here's a video that walks you through:
{% youtube src="https://www.youtube.com/embed/Vy4d0-SF5cY?si=mHatqRPRqHAK0X9o" /%}
But we wouldnt be talking about Nx if we didnt 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.
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.
![](/blog/images/2023-12-28/bodyimg3.gif)
@@ -205,7 +206,7 @@ Vue is currently the second most popular frontend framework (according to npm do
![](/blog/images/2023-12-28/bodyimg4.webp)
The first place your might notice Nxs support for Vue is in the `create-nx-workspace` script:
The first place your might notice Nx's support for Vue is in the `create-nx-workspace` script:
![](/blog/images/2023-12-28/bodyimg5.webp)
@@ -215,17 +216,17 @@ The option above will create a new Nx workspace with a fresh new Vue application
% npm add -D @nx/vue
```
And youll then have access to Nx generators so you can create Vue applications, libraries, and more in your workspace!
And you'll then have access to Nx generators so you can create Vue applications, libraries, and more in your workspace!
![](/blog/images/2023-12-28/bodyimg6.gif)
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!
Checkout out 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](/plugin-registry). Furthermore, Nxs 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 Nxs 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.
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" /%}
@@ -241,7 +242,7 @@ We wanted to make building on top of Nx even more pleasant, allowing you to intr
npx create-qwik-nx
```
And finally, we extracted our own [Verdaccio](https://verdaccio.org/) setup that weve been using to run our e2e tests in the [Nx repo](https://github.com/nrwl/nx) s.t. you can use it for your own plugin development as well. Check out [this video](https://www.youtube.com/watch?v=t1c925TzrzE) for a walkthrough on how this works.
And finally, we extracted our own [Verdaccio](https://verdaccio.org/) setup that we've been using to run our e2e tests in the [Nx repo](https://github.com/nrwl/nx) s.t. you can use it for your own plugin development as well. Check out [this video](https://www.youtube.com/watch?v=t1c925TzrzE) for a walkthrough on how this works.
### Module Federation
@@ -251,17 +252,17 @@ 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](/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:
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
```
Where in the example above your host application is named host-application and a remote application that you want live updates on as youre developing is named 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, weve continued to increase Nxs 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!
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, were excited about the Module Federation support we offer for our users, and think that it has many interesting applications when paired with Nxs CI capabilities, in particular allowing for [much shorter build times](/concepts/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) especially for larger Angular applications.
## Many OSS repos adopt Nx
@@ -276,13 +277,13 @@ Numerous open-source packages are adopting Nx in this lightweight manner. It ena
I picked out some of the more well-known OSS repos that started using Nx this year:
[**Tanstack**](https://tanstack.com/) — Tanstack has evolved to an entire ecosystem consisting of the famous [Tanstack (or React) Query](https://github.com/tanstack/query), [Tanstack Table](https://github.com/tanstack/table), now also [Tanstack Router](https://github.com/tanstack/router) and [Tanstack Form](https://github.com/tanstack/form). It started with Tanstack Query, which adopted Nx and Nx Cloud. [Zack talked about this collab with Dominik](https://www.youtube.com/watch?v=NvPXK6DVZGE), and we also had [Dominik](https://twitter.com/TkDodo) on our [Nx live stream](https://www.youtube.com/live/IbU6b6s0H1Q?si=0QZexPwulLXB9FIN). Now, all the above-mentioned Tanstack libs have adopted Nx, and theres more coming.
[**Tanstack**](https://tanstack.com/) — Tanstack has evolved to an entire ecosystem consisting of the famous [Tanstack (or React) Query](https://github.com/tanstack/query), [Tanstack Table](https://github.com/tanstack/table), now also [Tanstack Router](https://github.com/tanstack/router) and [Tanstack Form](https://github.com/tanstack/form). It started with Tanstack Query, which adopted Nx and Nx Cloud. [Zack talked about this collab with Dominik](https://www.youtube.com/watch?v=NvPXK6DVZGE), and we also had [Dominik](https://twitter.com/TkDodo) on our [Nx live stream](https://www.youtube.com/live/IbU6b6s0H1Q?si=0QZexPwulLXB9FIN). Now, all the above-mentioned Tanstack libs have adopted Nx, and there's more coming.
[**Sentry JavaScript**](https://github.com/getsentry/sentry-javascript/) — Sentry, renowned for its comprehensive solutions in frontend monitoring and error logging, recently adopted Nx for their [official JavaScript SDK](https://github.com/getsentry/sentry-javascript/). This move integrates Nxs capabilities into their monorepo, containing packages for popular frontend and Node.js backend integrations. They also published a blog post on [the benefits theyve seen following the adoption of Nx in their monorepo](https://sentry.engineering/blog/reduce-ci-time-with-nx-caching) (hint: reducing CI times by 35%).
[**Sentry JavaScript**](https://github.com/getsentry/sentry-javascript/) — Sentry, renowned for its comprehensive solutions in frontend monitoring and error logging, recently adopted Nx for their [official JavaScript SDK](https://github.com/getsentry/sentry-javascript/). This move integrates Nx's capabilities into their monorepo, containing packages for popular frontend and Node.js backend integrations. They also published a blog post on [the benefits they've seen following the adoption of Nx in their monorepo](https://sentry.engineering/blog/reduce-ci-time-with-nx-caching) (hint: reducing CI times by 35%).
[**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 Nxs latest `nx release` feature to publish packages to NPM.
[**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 [Nxs DevKit](/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](/extending-nx/recipes/create-install-package).
@@ -290,11 +291,11 @@ I picked out some of the more well-known OSS repos that started using Nx this ye
[**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.
And these are just some of them that joined in 2023. If I missed some cool ones (which Im pretty sure), [ping me](https://twitter.com/juristr) and let me know!
And these are just some of them that joined in 2023. If I missed some cool ones (which I'm pretty sure), [ping me](https://twitter.com/juristr) and let me know!
## Nx Community
Nx has a huge community! Were 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 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](/community) program.
@@ -308,16 +309,16 @@ Make sure [you join](https://go.nx.dev/community)!
## New Content & Improved Docs
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 weve been working a lot behind the scenes. So stay tuned!
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](/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. Youll 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**](/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](/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](/getting-started/intro), including dedicated examples of using Nx with popular stacks:
@@ -327,17 +328,17 @@ 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
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 Nxs robust tooling, and later, when the need arises, seamlessly [migrate to a monorepo](/recipes/tips-n-tricks/standalone-to-monorepo).
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-monorepo).
However, Nxs 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**.
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**.
{% tweet url="https://twitter.com/juristr/status/1734558895547568634" /%}
Setting up an efficient and maintainable CI process for monorepos can be a complex task, so weve 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. Were publicly launching [Nx Agents](/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: [/ci](/ci/intro/ci-with-nx).
@@ -347,7 +348,7 @@ We did it again! The second in-person Nx Conf was a resounding success, this tim
![](/blog/images/2023-12-28/bodyimg9.webp)
Theres not much to say. Check out some of the amazing talks. I did a [Nx Conf 2023 recap blog post](/blog/nx-conf-2023-recap).
There's not much to say. Check out some of the amazing talks. I did a [Nx Conf 2023 recap blog post](/blog/nx-conf-2023-recap).
## Looking ahead — 2024
@@ -355,7 +356,7 @@ Although we shipped a lot in 2023, in many ways 2023 was about preparing for wha
### Solving CI
Legacy CI systems are a performance and productivity bottleneck if you use a powerful build system like Nx. Big tech companies know it and thats why their CI systems look nothing like Circle or Jenkins. Weve been narrowing this gap over the years, but only this year we finally built a turn-key CI solution that gives you great performance, scalability, dev ergonomics, and must better cost efficiency.
Legacy CI systems are a performance and productivity bottleneck if you use a powerful build system like Nx. Big tech companies know it and that's why their CI systems look nothing like Circle or Jenkins. We've been narrowing this gap over the years, but only this year we finally built a turn-key CI solution that gives you great performance, scalability, dev ergonomics, and must better cost efficiency.
It has three components:
@@ -369,13 +370,13 @@ Optimal parallelization and distribution, using the right numbers of agents for
Balancing simplicity and power is the trickiest part of the dev tools design. Simple onboarding for small projects or handling the biggest enterprise systems? Two years ago we solved this problem by giving you a choice between the package-based setup (a more powerful version of something like Turborepo) and the integrated setup (we manage your whole monorepo in the most optimal way). But now we believe we have a much better solution, where you have both, the simplicity of the former with the power of the latter. So you no longer have to choose.
We took inspiration from VSCode. Any project you open in VSCode will work right away: it is simple, and you dont need to configure anything. If you install say a Playwright plugin, VSCode becomes aware of Playwright. It can run and debug your tests right in the editor. Thats what the Nx experience is going to be like. Any project, any tool will work right away. But if you — for instance — install the Playwright plugin, Nx will become aware of Playwright and will be able to cache test runs in the most optimal way and distribute your e2e tests across machines for best efficiency. All the benefits with none of the costs.
We took inspiration from VSCode. Any project you open in VSCode will work right away: it is simple, and you don't need to configure anything. If you install say a Playwright plugin, VSCode becomes aware of Playwright. It can run and debug your tests right in the editor. That's what the Nx experience is going to be like. Any project, any tool will work right away. But if you — for instance — install the Playwright plugin, Nx will become aware of Playwright and will be able to cache test runs in the most optimal way and distribute your e2e tests across machines for best efficiency. All the benefits with none of the costs.
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](/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 havent already ;)
Exciting stuff! So keep an eye on our channels, and subscribe if you haven't already ;)
---
@@ -0,0 +1,17 @@
---
title: 'Monorepos: the Benefits, Challenges, and Importance of Tooling Support '
description: 'Learn how monorepos and better tooling can help you overcome challenges in software development like scalability, maintenance, communication, and cost.'
date: 2024-01-24
slug: 'monorepos-the-benefits-challenges-and-importance-of-tooling-support'
authors: ['Juri Strumpflohner']
tags: [webinar]
cover_image: /blog/images/2024-01-24/january-webinar-card.avif
status: Past - Gated
registrationUrl: https://go.nx.dev/january-webinar
---
Presented by Juri Strumpflohner
Learn how monorepos and better tooling can help you overcome challenges in software development like scalability, maintenance, communication, and cost.
{% call-to-action title="Download the recording" url="https://go.nx.dev/january-webinar" description="Sign up to gain access" /%}
+10 -9
View File
@@ -2,12 +2,13 @@
title: What if Nx Plugins Were More Like VSCode Extensions
slug: 'what-if-nx-plugins-were-more-like-vscode-extensions'
authors: [Juri Strumpflohner]
cover_image: '/blog/images/2024-02-05/featured_img.png'
cover_image: '/blog/images/2024-02-05/featured_img.avif'
tags: [nx, releases]
reposts: []
description: Introducing Project Crystal in Nx 18, a transformative approach to Nx plugins that makes them more transparent and lightweight, featuring inferred targets, reduced configuration overhead, and improved monorepo adoption.
---
Enhance, but dont interfere! Thats the ideal! And this is how extensions work in VSCode (or Webstorm). You can use VSCode without any extension and get some basic functionality, or you can add an extension on top to enhance your experience and, ideally, increase your productivity.
Enhance, but don't interfere! That's the ideal! And this is how extensions work in VSCode (or Webstorm). You can use VSCode without any extension and get some basic functionality, or you can add an extension on top to enhance your experience and, ideally, increase your productivity.
Table of Contents
@@ -23,14 +24,14 @@ Table of Contents
---
**Prefer a video? Weve got you covered!**
**Prefer a video? We've got you covered!**
{% youtube src="https://www.youtube.com/embed/wADNsVItnsM?si=sQ3-Dlx6KBRBUMkE" title="What if Nx Plugins Were More Like VSCode Extensions" /%}
Also, make sure to check out [Launch Nx Conf](/launch-nx) on Thursday, Feb 8th, where well have more in-depth talks about Project Crystal as well as other exciting features around Nx and Nx Cloud.
Also, make sure to check out [Launch Nx Conf](/launch-nx) on Thursday, Feb 8th, where we'll have more in-depth talks about Project Crystal as well as other exciting features around Nx and Nx Cloud.
---
Take, for instance, the Playwright plugin. You install it, and itll automatically detect the Playwright config file and enhance your workspace by providing quick run buttons alongside your tests or even a dedicated Test Explorer window.
Take, for instance, the Playwright plugin. You install it, and it'll automatically detect the Playwright config file and enhance your workspace by providing quick run buttons alongside your tests or even a dedicated Test Explorer window.
![](/blog/images/2024-02-05/bodyimg1.webp)
_The Playwright VSCode extension enhancing the developer experience_
@@ -43,13 +44,13 @@ You can add Nx to an existing npm/yarn/pnpm monorepo quite straightforwardly. Yo
npx nx@latest init
```
Youll get an `nx` package installed and an `nx.json` allowing you to define [task dependencies](/recipes/running-tasks/defining-task-pipeline) and caching. With that, you're now able to run commands like `nx build <your project>` or nx `run-many -t build test` to run all `build` and `test` targets in your workspace in parallel. Nx will read and use your existing `package.json` scripts. I've written an in-depth [blog post about adopting Nx in such a scenario](/blog/setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx).
You'll get an `nx` package installed and an `nx.json` allowing you to define [task dependencies](/recipes/running-tasks/defining-task-pipeline) and caching. With that, you're now able to run commands like `nx build <your project>` or nx `run-many -t build test` to run all `build` and `test` targets in your workspace in parallel. Nx will read and use your existing `package.json` scripts. I've written an in-depth [blog post about adopting Nx in such a scenario](/blog/setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx).
This is the most lightweight setup you can get while still getting some improvements via Nx regarding faster task running and more intelligent parallelization. But, you need to deal with the remaining of the monorepo setup.
## Project Crystal
Nx always had more to offer, though, which it mainly did through its plugins. Theyre optional but usually something youd get set up when creating a new workspace with `create-nx-workspace`. Nx Plugins are extremely powerful, helping you not only create and configure new monorepos, but also taking away the burden of integrating various tooling as well as providing features for enforcing consistency and helping with maintainability. These aspects are fundamental in enterprise settings, where Nx Plugins have proven to help teams successfully manage their monorepos.
Nx always had more to offer, though, which it mainly did through its plugins. They're optional but usually something you'd get set up when creating a new workspace with `create-nx-workspace`. Nx Plugins are extremely powerful, helping you not only create and configure new monorepos, but also taking away the burden of integrating various tooling as well as providing features for enforcing consistency and helping with maintainability. These aspects are fundamental in enterprise settings, where Nx Plugins have proven to help teams successfully manage their monorepos.
However, this is a balancing act. More abstraction and automation means more support but also potentially a learning curve and giving up some low-level control. It also requires a slightly more significant upfront investment when migrating to an Nx plugin-powered monorepo.
@@ -74,7 +75,7 @@ When you create a new Nx workspace using
npx create-nx-workspace myorg
```
... and you choose an integrated monorepo youll get the usual setup powered by Nx Plugins and all the features and benefits that come with them. Where youll see Project Crystal in action is when you open a `project.json` file, which will most likely look like the following:
... and you choose an "integrated monorepo" you'll get the usual setup powered by Nx Plugins and all the features and benefits that come with them. Where you'll see Project Crystal in action is when you open a `project.json` file, which will most likely look like the following:
```json {% fileName="project.json" }
{
@@ -89,7 +90,7 @@ npx create-nx-workspace myorg
### Inferred Targets
Starting with Nx 18 and Project Crystal, we dont generate any targets anymore, but the corresponding Nx plugin instead [infers them](/concepts/inferred-tasks). If we open the `nx.json`, you'll see a new property, `plugins`:
Starting with Nx 18 and Project Crystal, we don't generate any targets anymore, but the corresponding Nx plugin instead [infers them](/concepts/inferred-tasks). If we open the `nx.json`, you'll see a new property, `plugins`:
```json {% fileName="nx.json" %}
{
@@ -1,9 +1,10 @@
---
title: Introducing @nx/nuxt Enhanced Nuxt.js Support in Nx
slug: 'introducing-nx-nuxt-enhanced-nuxt-js-support-in-nx'
cover_image: '/blog/images/2024-02-06/featured_img.png'
cover_image: '/blog/images/2024-02-06/featured_img.avif'
authors: ['Katerina Skroumpelou']
tags: [devtools, javascript, monorepos, nuxt]
description: 'Explore how the new @nx/nuxt plugin enhances Nuxt.js development with automated task recognition and improved monorepo capabilities.'
---
We're excited to introduce a new way to enhance your [Nuxt](https://nuxt.com/) development workflow! After the Vue plugin, we're introducing our new Nx plugin for Nuxt, `@nx/nuxt`. Designed for Nuxt developers and existing Nx users alike, this integration brings the best of both worlds into your development ecosystem, enabling you to leverage Nx's powerful capabilities seamlessly within your Nuxt projects.
@@ -180,7 +181,7 @@ Whether you're starting a new Nuxt project or looking to enhance an existing one
## Nx Live With Nuxt Maintainer Daniel Roe
Dont miss Nx team members Zack and Katerina with Nuxts maintainer, Daniel Roe — live!
Don't miss Nx team members Zack and Katerina with Nuxt's maintainer, Daniel Roe — live!
{% youtube src="https://www.youtube.com/watch?v=uHwUxFYX2DY" %}
+6 -5
View File
@@ -2,9 +2,10 @@
title: Fast, Effortless CI
slug: 'fast-effortless-ci'
authors: [Isaac Mann]
cover_image: '/blog/images/2024-02-07/featured_img.png'
cover_image: '/blog/images/2024-02-07/featured_img.avif'
tags: [nx, nx-cloud, release]
reposts: []
description: 'Discover how Nx Agents speeds up CI pipelines from 90 to 10 minutes by intelligently distributing tasks and managing resources.'
---
## From 90-minute to 10-minute CI Pipelines
@@ -59,7 +60,7 @@ At any point in the future, if a task is added to the system or there is a chang
## A Build System That Runs Your CI
Part of the reason CI is so difficult to maintain is that it has no knowledge of your repository. Your CI provider cant optimize your pipeline because it doesnt even know the language youre using, let alone relationships between your projects. A build system, on the other hand, must know all that information in order to properly function.
Part of the reason CI is so difficult to maintain is that it has no knowledge of your repository. Your CI provider can't optimize your pipeline because it doesn't even know the language you're using, let alone relationships between your projects. A build system, on the other hand, must know all that information in order to properly function.
The key that unlocks all the power of Nx Agents is this architectural shift:
@@ -102,19 +103,19 @@ Nx understands that some CI pipelines need more resources than others. To accoun
## Automatically Split E2E Tasks by File
Typically, e2e tests are the tasks that take the longest in CI. In order to take advantage of parallelization and task distribution, these large tasks would need to be split into smaller tasks, but doing this manually would involve duplicating a lot of configuration code and making sure to keep that configuration synchronized. Nx 18s [Project Crystal](/blog/what-if-nx-plugins-were-more-like-vscode-extensions) allows you to [automatically create separate Cypress and Playwright tasks](/ci/features/split-e2e-tasks) for each spec file in the e2e project. These individual tasks can all be triggered by running the `e2e-ci` task. What was once a tedious manual process can now be done for you automatically.
Typically, e2e tests are the tasks that take the longest in CI. In order to take advantage of parallelization and task distribution, these large tasks would need to be split into smaller tasks, but doing this manually would involve duplicating a lot of configuration code and making sure to keep that configuration synchronized. Nx 18's [Project Crystal](/blog/what-if-nx-plugins-were-more-like-vscode-extensions) allows you to [automatically create separate Cypress and Playwright tasks](/ci/features/split-e2e-tasks) for each spec file in the e2e project. These individual tasks can all be triggered by running the `e2e-ci` task. What was once a tedious manual process can now be done for you automatically.
![](/blog/images/2024-02-07/bodyimg3.webp)
## Identify and Re-run Flaky Tasks
There are some tasks that will fail or succeed in CI without any changes to the tasks code. These are flaky tasks and in order to merge a change in unrelated code, developers need to manually re-run the entire pipeline until that flaky task succeeds. Because Nx is already tracking inputs and outputs of tasks, it knows when a task is flaky. Now, Nx Cloud will [automatically re-run a flaky task if it fails](/ci/features/flaky-tasks), without a developer needing to manually trigger it.
There are some tasks that will fail or succeed in CI without any changes to the task's code. These are flaky tasks and in order to merge a change in unrelated code, developers need to manually re-run the entire pipeline until that flaky task succeeds. Because Nx is already tracking inputs and outputs of tasks, it knows when a task is flaky. Now, Nx Cloud will [automatically re-run a flaky task if it fails](/ci/features/flaky-tasks), without a developer needing to manually trigger it.
![](/blog/images/2024-02-07/bodyimg4.webp)
## Run Some Tasks on Another CI Provider
If you have a task that cant be run on Nx Agents for some reason, you can easily [flag it to run directly on the main CI job](/ci/reference/nx-cloud-cli#enablingdisabling-distribution). Add a `--no-agents` flag to the command and Nx will not run it on an agent.
If you have a task that can't be run on Nx Agents for some reason, you can easily [flag it to run directly on the main CI job](/ci/reference/nx-cloud-cli#enablingdisabling-distribution). Add a `--no-agents` flag to the command and Nx will not run it on an agent.
---
@@ -2,7 +2,8 @@
title: Versioning and Releasing Packages in a Monorepo
slug: 'versioning-and-releasing-packages-in-a-monorepo'
authors: [Juri Strumpflohner]
cover_image: '/blog/images/2024-02-09/featured_img.png'
description: 'Learn how to use Nx Release to version and publish packages in your monorepo with conventional commits and automated changelog generation.'
cover_image: '/blog/images/2024-02-09/featured_img.avif'
tags: [nx, nx-cloud, releases, changelog]
---
@@ -10,7 +11,7 @@ When it comes to publishing NPM packages, there are a bunch of libraries and uti
Nx already has all that knowledge, and it can leverage the information it has about your project dependencies and relationships to optimize your task runs.
Heres the structure of our current example workspace were going to refer to in this article:
Here's the structure of our current example workspace we're going to refer to in this article:
![@tuskdesign/demo relies on @tuskdesign/forms and @tuskdesign/buttons, and @tuskdesign/forms also depends on @tuskdesign/buttons](/blog/images/2024-02-09/bodyimg1.webp)
@@ -20,9 +21,7 @@ As you can see `@tuskdesign/forms` relies on `@tuskdesign/buttons` and as such h
---
**Prefer a video?**
{% youtube src="https://www.youtube.com/embed/KjZKFGu3_9I?si=L-8oRzy-hV-WF_pS" title="Versioning and Releasing Packages in a Monorepo" /%}
{% link-card title="Free Course: Versioning and Releasing NPM packages with Nx" type="external" url="https://www.epicweb.dev/tutorials/versioning-and-releasing-npm-packages-with-nx" icon="/documentation/shared/images/nx-release-course-logo.webp" /%}
---
@@ -53,7 +52,7 @@ This brings up a couple of questions including whether to install [Project Cryst
![](/blog/images/2024-02-09/bodyimg2.webp)
It gives you some additional benefits ([you can read more here](/blog/what-if-nx-plugins-were-more-like-vscode-extensions)), but you dont have to as it is not required for Nx Release.
It gives you some additional benefits ([you can read more here](/blog/what-if-nx-plugins-were-more-like-vscode-extensions)), but you don't have to as it is not required for Nx Release.
## Installing the JavaScript/TypeScript versioning Package
@@ -67,7 +66,7 @@ _(We use the `-w` flag to install it at the monorepo root level)_
## Running Nx Release
Once youre set-up, you can already go ahead and run the following command:
Once you're set-up, you can already go ahead and run the following command:
```shell
pnpm nx release --dry-run
@@ -77,7 +76,7 @@ This command will do the versioning, changelog generation, and publishing steps
![](/blog/images/2024-02-09/bodyimg3.webp)
Youll get asked whether you want to release a major, pre-major, minor… release or choose an exact version.
You'll get asked whether you want to release a major, pre-major, minor… release or choose an exact version.
Once this runs through, you might hit the following error:
@@ -169,7 +168,7 @@ pnpm nx release --dry-run
![](/blog/images/2024-02-09/bodyimg7.webp)
Lets go ahead and change something in our `@tuskdesign/buttons` package and then commit it as follows:
Let's go ahead and change something in our `@tuskdesign/buttons` package and then commit it as follows:
```shell
git commit -am 'feat(buttons): add new background shadow'
@@ -229,13 +228,13 @@ Note, you can still use `--dry-run` and it'd show you the URL where the GitHub r
## Programmatic Mode
As youve seen, you can use `nx release` right away with minimal configuration. However, we are very well aware that many real-world scenarios are more complex, you want/need more control over when the version is happening, when the changelog generation kicks in and so on. This is why we also introduced a **programmatic API.**
As you've seen, you can use `nx release` right away with minimal configuration. However, we are very well aware that many real-world scenarios are more complex, you want/need more control over when the version is happening, when the changelog generation kicks in and so on. This is why we also introduced a **programmatic API.**
This approach gives you full control to embed Nx Release into your current release flow. Theres a nice [example script in our docs](/features/manage-releases#using-the-programmatic-api-for-nx-release) that can help you get started.
This approach gives you full control to embed Nx Release into your current release flow. There's a nice [example script in our docs](/features/manage-releases#using-the-programmatic-api-for-nx-release) that can help you get started.
Create a file — I call it `release.ts` - at the root of my workspace. Nx Release obviously doesn't care how the file is called or where you place it. You can also go with plain JS.
Heres the [example script from our docs](/features/manage-releases#using-the-programmatic-api-for-nx-release):
Here's the [example script from our docs](/features/manage-releases#using-the-programmatic-api-for-nx-release):
```ts
import { releaseChangelog, releasePublish, releaseVersion } from 'nx/release';
+11 -10
View File
@@ -2,13 +2,14 @@
title: Launch Nx Week Recap
slug: 'launch-nx-week-recap'
authors: [Zack DeRose]
cover_image: '/blog/images/2024-02-15/featured_img.png'
cover_image: '/blog/images/2024-02-15/featured_img.avif'
tags: [nx, nx-cloud, releases, changelog]
description: 'Explore the major announcements from Launch Nx Week, including Nx 18.0, Project Crystal, Nuxt plugin, Nx Agents, and Tusky AI integration.'
---
We just finished wrapping up [Launch Nx Week](/launch-nx), which ran from February 59, including a full conference on Thursday!
In this article, were going to recap all the things launched during Launch Nx Conf, as well as all the talks given during the conference! Heres a set of links so you can fast-forward to the stuff youre most interested in if you want!
In this article, we're going to recap all the things launched during Launch Nx Conf, as well as all the talks given during the conference! Here's a set of links so you can fast-forward to the stuff you're most interested in if you want!
**Prefer a video?**
@@ -29,7 +30,7 @@ In this article, were going to recap all the things launched during Launch Nx
## Nx 18.0 && Project Crystal
Exciting news!! Weve broken our standard release cadence of publishing a new major version every 6 months to release Nx 18, just 3 months after releasing Nx 17 in December 2024.
Exciting news!! We've broken our standard release cadence of publishing a new major version every 6 months to release Nx 18, just 3 months after releasing Nx 17 in December 2024.
Juri announced launched Project Crystal with this video:
@@ -39,7 +40,7 @@ The short version is: Nx project crystal means Nx plugins make your codebases wo
For the long version, checkout this blog post by Juri where he describes [how Nx plugins are now more like VsCode Extentions](/blog/what-if-nx-plugins-were-more-like-vscode-extensions)!
And dont miss our two conference talks on this subject:
And don't miss our two conference talks on this subject:
### Conference Talk: Project Crystal
@@ -55,7 +56,7 @@ And dont miss our two conference talks on this subject:
## New Plugin: @nx/nuxt
On Tuesday we launched our newest plugin, and our first plugin to be :gem:crystalized:gem: from its very beginning: @nx/nuxt!
On Tuesday we launched our newest plugin, and our first plugin to be :gem:crystalized:gem: from it's very beginning: @nx/nuxt!
Zack explains Nuxt and how to use the new plugin in this video:
@@ -77,7 +78,7 @@ Zack, Katerina, and Daniel got together to live code a working tic-tac-toe app u
Nx Agents are here!! We launched Nx Agents on Wednesday, and it climbed into the top 20 on [Product Hunt](https://www.producthunt.com/products/nx-cloud#nx-agents)!
Were very excited about Nx Agents because we think that in its current state, Continuous Integration/Deployment is broken, and we think that Nx paired with Nx Agents fixes Continuous Integration. Zack explains more in this video:
We're very excited about Nx Agents because we think that in its current state, Continuous Integration/Deployment is broken, and we think that Nx paired with Nx Agents fixes Continuous Integration. Zack explains more in this video:
{% youtube src="https://www.youtube.com/embed/_FSHQIwITic?si=jDpwTVXLYFXiHEm0" title="Nx Agents" /%}
@@ -111,15 +112,15 @@ In the teaser video, you can see some ways Tusky will be integrated into Nx Clou
The more exciting features of Tusky though includes the ability to perfectly optimize the number of agents used per PR — even spinning up and tearing down agents mid-pipeline! This is a huge optimization for task distribution, and will help optimize both walltime of your CI, as well as compute costs!
Tusky will also be able to provide organizational-level insights to your codebase, including automatically detecting development groups (like lines of business) inside your codebase based on commit history, and providing statistical insights on their commit patterns. Were also excited about Tusky being able to make suggestions on things you can do to further optimize your codebase — like generating a PR to introduce [Codeowners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) to the repo!
Tusky will also be able to provide organizational-level insights to your codebase, including automatically detecting development groups (like lines of business) inside your codebase based on commit history, and providing statistical insights on their commit patterns. We're also excited about Tusky being able to make suggestions on things you can do to further optimize your codebase — like generating a PR to introduce [Codeowners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) to the repo!
## Nx Release Is Stable
Versioning and publishing packages is always a bit tricky. Mix in the added complexity of having multiple packages — sometimes with different versioning or publishing strategies — inside the same codebase, and things can get weird quick!
For a long time, Nx has been purposefully versioning and publishing agnostic, but given our time spent as [stewards of Lerna](/blog/lerna-is-dead-long-live-lerna) (the OG Javascript monorepo tool), weve been able to take alot of that experience and finally feel confident creating our own versioning and publishing implementation.
For a long time, Nx has been purposefully versioning and publishing agnostic, but given our time spent as [stewards of Lerna](/blog/lerna-is-dead-long-live-lerna) (the OG Javascript monorepo tool), we've been able to take alot of that experience and finally feel confident creating our own versioning and publishing implementation.
Therefore, weve been working on a new command to the Nx CLI: [nx release](/recipes/nx-release/get-started-with-nx-release#get-started-with-nx-release). We launched this on Friday of our Launch Nx week!
Therefore, we've been working on a new command to the Nx CLI: [nx release](/recipes/nx-release/get-started-with-nx-release#get-started-with-nx-release). We launched this on Friday of our Launch Nx week!
Juri goes into [full details in this blog post](/blog/versioning-and-releasing-packages-in-a-monorepo), and James Henry — our Director of Engineering and the primary engineer responsible for both maintaining Lerna and creating Nx Release — expands further in his conference talk:
@@ -135,7 +136,7 @@ Juri, Zack, and Victor wrapped up the week with a livestream recapping the launc
{% youtube src="https://www.youtube.com/embed/xjLrFvEcxZw?si=O70JD4NgseP0lknA" title="Launch Nx Week Wrap Up" /%}
Thats all for now folks! Were just starting up a new iteration of development on Nx, so be sure to subscribe to [our YouTube channel](https://www.youtube.com/@nxdevtools) to get updates when new features land! Until next time, KEEP WORKING HARD!
That's all for now folks! We're just starting up a new iteration of development on Nx, so be sure to subscribe to [our YouTube channel](https://www.youtube.com/@nxdevtools) to get updates when new features land! Until next time, KEEP WORKING HARD!
---
@@ -0,0 +1,17 @@
---
title: 'Nx Agents Walkthrough: Effortlessly Fast CI Built for Monorepos'
description: 'Learn how you can streamline your existing CI config to its absolute simplest form, reducing CI times from 30 minutes to ~5 minutes with Nx Agents. '
date: 2024-03-11
slug: 'nx-agents-walkthrough-effortlessly-fast-ci-built-for-monorepos'
authors: ['Rareș Matei']
tags: [webinar]
cover_image: /blog/images/2024-03-11/march-webinar.avif
status: Past - Gated
registrationUrl: https://go.nx.dev/march-webinar
---
Presented by Rareș Matei
Learn how you can streamline your existing CI config to its absolute simplest form, reducing CI times from 30 minutes to ~5 minutes with Nx Agents.
{% call-to-action title="Download the recording" url="https://go.nx.dev/march-webinar" description="Sign up to gain access" /%}
+9 -8
View File
@@ -3,12 +3,13 @@ title: Monorepos - Why Speed Matters
slug: 'monorepos-why-speed-matters'
authors: ['Katerina Skroumpelou', 'Jeff Cross']
tags: [nx, nxdevtools, speed, ci]
cover_image: '/blog/images/2024-03-20/featured_img.png'
cover_image: '/blog/images/2024-03-20/featured_img.avif'
description: 'Discover how Nx enhances development speed through Rust integration, improved caching, Nx Agents, and test atomization features.'
---
In the ever-evolving landscape of software development, efficiency and speed are vital. As projects grow in complexity, developers and teams need tools that can keep up without sacrificing quality or performance.
Nx is a suite of powerful tools designed to optimize your development workflow, which sets the [building blocks for a fast CI](/ci/concepts/building-blocks-fast-ci). Nx is always innovating in many ways to make developers lives easier, but this post is exclusively focused on the things Nx has done in the past year to make development faster and faster.
Nx is a suite of powerful tools designed to optimize your development workflow, which sets the [building blocks for a fast CI](/ci/concepts/building-blocks-fast-ci). Nx is always innovating in many ways to make developers' lives easier, but this post is exclusively focused on the things Nx has done in the past year to make development faster and faster.
## Why speed matters
@@ -18,13 +19,13 @@ The ability to iterate quickly and efficiently is vital for any software project
- **Reduced time to market:** Accelerating the development process can significantly cut down the overall time to market, providing a competitive edge which reclaims revenue that would have otherwise been lost.
- **Decreased developer frustration:** [No more waiting for builds and tests to complete](/ci/concepts/reduce-waste). A streamlined workflow keeps morale high and productivity higher.
If youre using Nx already, youre already familiar with
If you're using Nx already, you're already familiar with
- [**Affected**](/ci/features/affected) - identifying and running tasks only on projects impacted by code changes,
- [**Nx Replay**](/ci/features/remote-cache) - our powerful cache and
- [**Nx Agents**](/ci/features/distribute-task-execution) - the concept of [Parallelization and Distribution](/ci/concepts/parallelization-distribution).
But lets see all the extra things we did this past year to make everything faster.
But let's see all the extra things we did this past year to make everything faster.
## Speed at the core
@@ -44,9 +45,9 @@ The archive file is a binary file that contains the workspace file hashes with t
![](/blog/images/2024-03-20/bodyimg1.webp)
Nx Replay enables caching and reusing of task results. Its our well known Nx remote cache! It allows developers to avoid re-running expensive tasks by retrieving the cached results from a remote cache. This significantly improves build and test performance, as well as developer productivity. Nx Replay is also critical to the functioning of Nx Agents, which rely on the remote cache to ensure that the results of a task will be shared with every agent that needs them. By using Nx Replay, developers can optimize their workflows and reduce the time spent waiting for tasks to complete.
Nx Replay enables caching and reusing of task results. It's our well known Nx remote cache! It allows developers to avoid re-running expensive tasks by retrieving the cached results from a remote cache. This significantly improves build and test performance, as well as developer productivity. Nx Replay is also critical to the functioning of Nx Agents, which rely on the remote cache to ensure that the results of a task will be shared with every agent that needs them. By using Nx Replay, developers can optimize their workflows and reduce the time spent waiting for tasks to complete.
With Nx Replay, you can see significant speed improvements in your CI pipelines for modified PRs. Whats also important is that if a task has been executed in CI, a developer running that same task locally can reuse the task result instead of actually running the task. So you will also see improvements locally.
With Nx Replay, you can see significant speed improvements in your CI pipelines for modified PRs. What's also important is that if a task has been executed in CI, a developer running that same task locally can reuse the task result instead of actually running the task. So you will also see improvements locally.
### Nx Agents
@@ -55,7 +56,7 @@ With Nx Replay, you can see significant speed improvements in your CI pipelines
[Nx Agents](/ci/features/distribute-task-execution) represent the pinnacle of task distribution optimization, ensuring that tasks are executed as efficiently as possible based on the specific requirements of each change. Some features that make up this effort are:
- [Easy integration with existing providers](/ci/recipes/set-up)
- Distribution is handled on the Nx Cloud infrastructure and all you need is a single line. Whats more, all results are played back to your original CI provider script which triggers the Nx Cloud distribution, so that you can make use of the resulting artifacts
- Distribution is handled on the Nx Cloud infrastructure and all you need is a single line. What's more, all results are played back to your original CI provider script which triggers the Nx Cloud distribution, so that you can make use of the resulting artifacts
- [Efficient task distribution](/ci/features/dynamic-agents)
- Save compute resources and reduce costs, minimizing idle time and compute waste
- Dynamic sizing based on PR size
@@ -82,7 +83,7 @@ Nx creates a hash of all the inputs for a task whenever it is run. If it encount
### Module Federation
With the help of Nx and the Module Federation setup that Nx offers, you can split up large Angular apps into smaller vertical slices. This can significantly speed up your builds and app startup time. Nx has revolutionized the use of Module Federation, especially in how static remotes are built and served. We make use of Nxs task orchestration, allowing users to fine tune the number of builds happening in parallel to improve local startup time, manage machine resources better, allow for scaling.
With the help of Nx and the Module Federation setup that Nx offers, you can split up large Angular apps into smaller "vertical slices". This can significantly speed up your builds and app startup time. Nx has revolutionized the use of Module Federation, especially in how static remotes are built and served. We make use of Nx's task orchestration, allowing users to fine tune the number of builds happening in parallel to improve local startup time, manage machine resources better, allow for scaling.
### First-Class Playwright support
+11 -11
View File
@@ -2,22 +2,22 @@
title: Reliable CI. A new execution model fixing both flakiness and slowness
slug: 'reliable-ci-a-new-execution-model-fixing-both-flakiness-and-slowness'
authors: [Victor Savkin]
cover_image: '/blog/images/2024-03-21/featured_img.png'
cover_image: '/blog/images/2024-03-21/featured_img.avif'
tags: [nx, nx-cloud, releases]
pinned: true
description: 'Learn how Nx Cloud revolutionizes CI with a task-based execution model that solves both flaky tests and slow pipelines.'
---
The proverbial slow and flaky CI isnt the failure of the developers or even the testing tools. Its the failure of the CI execution model we relied on for the last 20 years.
The proverbial slow and flaky CI isn't the failure of the developers or even the testing tools. It's the failure of the CI execution model we relied on for the last 20 years.
**By switching from the old CI model, implemented as a graph of VMs, to the new one, implemented as a graph of tasks, we can solve both the flakiness and slowness.**
In this blog post Ill explore why this is the case, and how you can do it by using Nx Cloud.
In this blog post I'll explore why this is the case, and how you can do it by using Nx Cloud.
---
## History of CI
Its easy to forget that Continuous Integration has been around for only 20 years. For reference, UI frameworks have been around since the 1970s.
It's easy to forget that Continuous Integration has been around for only 20 years. For reference, UI frameworks have been around since the 1970s.
![](/blog/images/2024-03-21/bodyimg1.webp)
@@ -37,9 +37,9 @@ A traditional CI execution is a directed acyclic graph (DAG) of virtual machines
**Every distributed system needs efficient communication between nodes and the ability to tolerate failure.**
The traditional CI execution model offers **very basic** means of communication: the status code propagation and ad-hoc ways of uploading/downloading files. Because the communication is effortful, in practice, **its either not done at all or very minimally.**
The traditional CI execution model offers **very basic** means of communication: the status code propagation and ad-hoc ways of uploading/downloading files. Because the communication is effortful, in practice, **it's either not done at all or very minimally.**
To understand why the traditional CI execution model fails to handle failures, lets review the types of failures we can have.
To understand why the traditional CI execution model fails to handle failures, let's review the types of failures we can have.
Failures can be:
@@ -54,11 +54,11 @@ Tasks can fail:
- for external reasons _(npm install fails cause npm is down)_
- for unknown reasons _(a flaky test)_
**The traditional CI execution model doesnt tolerate any of these failures.**
**The traditional CI execution model doesn't tolerate any of these failures.**
## Problem in numbers
Lets see how varying a few parameters affects the probability of the CI execution failing.
Let's see how varying a few parameters affects the probability of the CI execution failing.
| Number of VMS | Avg Tests per VM | Flaky Test Probability | Slow Test Probability | Broken CI Builds (Flaky) | Slow CI Builds |
| :-----------: | :--------------: | :--------------------: | :-------------------: | :----------------------: | :------------: |
@@ -69,9 +69,9 @@ Lets see how varying a few parameters affects the probability of the CI execu
| 10 | 10 | 0.5% | 1% | 40% | 65% |
| 50 | 10 | 0.5% | 1% | 92% | 99% |
**The result is much worse than most intuitively expect.** For instance, assuming that an **e2e test has 1 in 1000 chance (0.1%) of failing** for a flaky reason, when the number of e2e tests reaches 500, **the probability of the CI failing for a flaky reason reaches 39%**, and the vast majority of CI executions are slowed down. Note, this is an exceptionally stable test suite. The bottom part of the table is more representative of a typical e2e suite, and the CI becomes broken at a much smaller scale.
**The result is much worse than most intuitively expect.** For instance, assuming that an **e2e test has 1 in 1000 chance (0.1%) of failing** for a flaky reason, when the number of e2e tests reaches 500, **the probability of the CI failing for a flaky reason reaches 39%**, and the vast majority of CI executions are slowed down. Note, this is an exceptionally stable test suite. The bottom part of the table is more representative of a typical e2e suite, and the CI becomes "broken" at a much smaller scale.
One can try to fix it by increasing the robustness of the tests, but at some point, doing this is costly. If an e2e test has a 10% chance of a flaky failure, its relatively easy to bring this number to 1%. Going from 1% to 0.5% is harder. Going from 0.5% to 0.1% is exceptionally hard and may be practically impossible. Testing complex systems is simply a difficult task.
One can try to fix it by increasing the robustness of the tests, but at some point, doing this is costly. If an e2e test has a 10% chance of a flaky failure, it's relatively easy to bring this number to 1%. Going from 1% to 0.5% is harder. Going from 0.5% to 0.1% is exceptionally hard and may be practically impossible. Testing complex systems is simply a difficult task.
This is the formula for the failed CI run:
@@ -0,0 +1,17 @@
---
title: 'Making the Argument for Monorepos'
description: 'Trying to convince your colleagues to use a monorepo? Already using a monorepo and need to justify that decision? Check out this webinar to learn 7 essential reasons for using monorepos and bust a few myths and misconceptions along the way.'
date: 2024-04-17
slug: 'making-the-argument-for-monorepos'
authors: ['Miroslav Jonaš']
tags: [webinar]
cover_image: /blog/images/2024-04-17/april-webinar.avif
status: Past - Gated
registrationUrl: https://go.nx.dev/april-webinar
---
Presented by Miroslav Jonaš
Trying to convince your colleagues to use a monorepo? Already using a monorepo and need to justify that decision? Check out this webinar to learn 7 essential reasons for using monorepos and bust a few myths and misconceptions along the way.
{% call-to-action title="Download the recording" url="https://go.nx.dev/april-webinar" description="Sign up to gain access" /%}
+7 -6
View File
@@ -2,11 +2,12 @@
title: Manage Your Gradle Project using Nx
slug: 'manage-your-gradle-project-using-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2024-04-19/featured_img.png'
cover_image: '/blog/images/2024-04-19/featured_img.avif'
tags: [nx, gradle, how-to]
description: 'Learn how to manage Gradle projects in Nx workspaces using the new @nx/gradle plugin for better library visualization and multi-tech stack support.'
---
Heres my situation: I have a Gradle workspace with multiple Gradle libraries. How do I easily view the relationships between different libraries? I have a monorepo workspace with both Gradle and Javascript libraries, how do I manage these libraries of different tech stacks?
Here's my situation: I have a Gradle workspace with multiple Gradle libraries. How do I easily view the relationships between different libraries? I have a monorepo workspace with both Gradle and Javascript libraries, how do I manage these libraries of different tech stacks?
We are very excited to announce our support for Gradle with our new plugin: `@nx/gradle`.
@@ -24,9 +25,9 @@ This blog will show you:
## What is Nx?
Before we start, lets answer this question: what is Nx and why should we use it?
Before we start, let's answer this question: what is Nx and why should we use it?
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?
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:
@@ -41,7 +42,7 @@ Nx adds the following features to your workspace:
## How to add Nx to a Gradle Workspace?
Now we understand the benefits of Nx, now lets set it up. The setup is pretty easy, just need to run one command.
Now we understand the benefits of Nx, now let's set it up. The setup is pretty easy, just need to run one command.
In the workspace, run the below command:
@@ -77,7 +78,7 @@ found 0 vulnerabilities
✔ Initializing @nx/gradle...
```
Thats it! Now we have Nx in our Gradle project.
That's it! Now we have Nx in our Gradle project.
### Example: Gradle Init
+6 -5
View File
@@ -2,8 +2,9 @@
title: Nx 19.0 Release!!
slug: 'nx-19-release'
authors: ['Zack DeRose']
cover_image: '/blog/images/2024-05-08/nx-19-thumbnail.png'
cover_image: '/blog/images/2024-05-08/nx-19-thumbnail.avif'
tags: [nx, release]
description: 'Explore Nx 19.0, returning to our six-month release cycle with enhanced Project Crystal plugins that work seamlessly with minimal configuration.'
---
Hey folks!
@@ -80,9 +81,9 @@ You'll see the following in the project view:
Notice how all tasks are now appropriately grouped in the `E2E (CI)` group!
You can also find the same enhancements in Nx Cloud. Below is a view of all tasks in the [CI pipeline](https://staging.nx.app/runs/ctbAZfiLy3):
You can also find the same enhancements in Nx Cloud. Below is a view of all tasks in the CI pipeline:
{% video-player src="/documentation/blog/media/2024-05-08/nx-cloud-atomizer-groupings.mp4" alt="Showing the Atomizer in Nx Cloud" link="https://staging.nx.app/runs/ctbAZfiLy3" /%}
{% video-player src="/documentation/blog/media/2024-05-08/nx-cloud-atomizer-groupings.mp4" alt="Showing the Atomizer in Nx Cloud" autoPlay=true loop=true /%}
Notice how all e2e groups are collapsed by default to give a concise view, while allowing you to expand to see how each individual task is progressing!
@@ -160,7 +161,7 @@ Since Nx 18 release, we also started using Project Crystal inside of the Nx repo
You can find a full list of fixes and features applied in this major release [here](https://github.com/nrwl/nx/releases/tag/19.0.0).
{% video-player src="/documentation/blog/media/2024-05-08/fixes.mp4" alt="A display listing the Github changelog" /%}
{% video-player src="/documentation/blog/media/2024-05-08/fixes.mp4" alt="A display listing the Github changelog" autoPlay=true loop=true /%}
With Project Crystal landed now, we're also adjusting our priorities to place a higher importance on stability. You should see this reflected in Nx 19.
@@ -182,7 +183,7 @@ In February, we launched two big enhancements to Nx Cloud: the [Atomizer](/ci/fe
Since then, the Atomizer has received a nice UI update (as we had seen earlier):
{% video-player src="/documentation/blog/media/2024-05-08/nx-cloud-atomizer-groupings.mp4" alt="Showing the Atomizer in Nx Cloud" link="https://staging.nx.app/runs/ctbAZfiLy3" /%}
{% video-player src="/documentation/blog/media/2024-05-08/nx-cloud-atomizer-groupings.mp4" alt="Showing the Atomizer in Nx Cloud" autoPlay=true loop=true /%}
Since February, we also revamped our task distribution algorithms. This has resulted in a 5-20% (depending on the repo) increase in both speed and cost efficiency for our users.
@@ -3,12 +3,13 @@ title: 'Nx Enterprise Podcast Episode 1: Hicham El Hammouchi'
slug: 'hicham-el-hammouchi-podcast-1'
authors: ['Zack DeRose']
tags: [podcast]
cover_image: /blog/images/2024-06-18/ep-1-hicham.png
cover_image: /blog/images/2024-06-18/ep-1-hicham.avif
podcastYoutubeId: 8iiLB_2djZ8
podcastSpotifyId: 24yagCNpu9EGj0fCwSDQkj
podcastAmazonUrl: https://music.amazon.com/podcasts/a221fdad-36fd-4695-a5b4-038d7b99d284/episodes/899a2e4c-2e56-4dfa-a3e3-e69eb216f2b0/the-enterprise-software-podcast-by-nx-the-enterprise-software-podcast-by-nx-1-hicham-el-hamouchi
podcastAppleUrl: https://podcasters.spotify.com/pod/show/enterprise-software/episodes/The-Enterprise-Software-Podcast-By-Nx-1--Hicham-El-Hamouchi-e2l0302
podcastIHeartUrl: https://www.iheart.com/podcast/269-the-enterprise-software-po-186891508/episode/the-enterprise-software-podcast-by-nx-186891511/
description: 'Join Zack DeRose as he discusses enterprise software development with veteran Hicham El Hammouchi, exploring challenges and emerging trends.'
---
In this episode, Zack DeRose from Nx chats with Hicham El Hammouchi, a veteran in enterprise software. Hicham dives into his background, sharing his career journey and the wealth of experience he's gathered along the way.
@@ -0,0 +1,19 @@
---
title: "Monorepos and CI can be a Mess - Here's How Nx and Nx Cloud Fixed It"
description: "Continuous Integration (CI) in monorepos can be notoriously slow and unreliable, quickly become a bottleneck for scaling monorepos.
Learn how Nx and Nx Cloud's new task-based approach ensures fast, resilient, and efficient CI for your monorepo projects."
date: 2024-06-26
slug: 'monorepos-and-ci-can-be-a-mess-heres-how-nx-and-nx-cloud-fixed-it'
authors: ['Juri Strumpflohner']
tags: [webinar]
cover_image: /blog/images/2024-06-26/June-Webinar-card.avif
status: Past - Gated
registrationUrl: https://go.nx.dev/june-webinar
---
Presented by Juri Strumpflohner
Continuous Integration (CI) in monorepos can be notoriously slow and unreliable, quickly become a bottleneck for scaling monorepos.
Learn how Nx and Nx Cloud's new task-based approach ensures fast, resilient, and efficient CI for your monorepo projects.
{% call-to-action title="Download the recording" url="https://go.nx.dev/june-webinar" description="Sign up to gain access" /%}
@@ -3,12 +3,13 @@ title: 'Nx Enterprise Podcast Episode 2: Tine Kondo'
slug: 'tine-kondo-podcast-2'
authors: ['Zack DeRose']
tags: [podcast]
cover_image: /blog/images/2024-07-19/ep-2-tine.png
cover_image: /blog/images/2024-07-19/ep-2-tine.avif
podcastYoutubeId: Nzf3BmymfEo
podcastSpotifyId: 0CCQaWCln7rvwkkVvsyxsk
podcastAmazonUrl: https://music.amazon.com/podcasts/a221fdad-36fd-4695-a5b4-038d7b99d284/episodes/53934cd9-c521-441e-8523-8b947ed207ca/the-enterprise-software-podcast-by-nx-the-enterprise-software-podcast-by-nx-2-tine-kondo
podcastAppleUrl: https://podcasts.apple.com/us/podcast/the-enterprise-software-podcast-by-nx-2-tine-kondo/id1752704996?i=1000662764990
podcastIHeartUrl: https://www.iheart.com/podcast/269-the-enterprise-software-po-186891508/episode/the-enterprise-software-podcast-by-nx-197335640/
description: 'Explore insights from Nx Champion Tine Kondo on monorepo benefits and the potential of Nx Gradle plugin for Java development.'
---
In this episode, welcome Nx Champion and Nx Expert, Tine Kondo. Our discussion highlights how Nx is poised to make an impact in the Java space.
+1
View File
@@ -5,6 +5,7 @@ authors: ['Philip Fulcher']
cover_image: '/blog/images/2024-07-29/explain-with-ai-header.avif'
tags: [nx, nx-cloud, ai, release]
youtubeUrl: https://youtu.be/g2m9cHp-O-Q?si=ax-SKCO0Xvy9vFIz
description: Explain with AI in Nx Cloud Pro helps debug CI failures with AI explanations and suggested fixes.
---
It's Friday, and you absolutely, positively have to deploy to production. But you can't get CI to pass your PR. What do you do? It's an inevitable part of your life as a developer, and you've built a collection of tools to deal with it: Google, MDN, Discord, ChatGPT. We've got one more tool for your toolbox: **"Explain with AI" for [Nx Cloud](/nx-cloud)**.

Some files were not shown because too many files have changed in this diff Show More