14571 Commits

Author SHA1 Message Date
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