14226 Commits

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

3c9d3cf4cb/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