Compare commits

..

118 Commits

Author SHA1 Message Date
“JamesHenry” fb42a0dfac chore: use @nx/graph for graph implementation details 2024-07-27 22:56:21 +04:00
Colum Ferry 7b9ee39c22 docs(webpack): update NxAppWebpackPlugin reference (#27156)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-26 17:02:35 +01:00
Colum Ferry 795f8479d8 fix(vite): ensure nxViteTsPaths resolve before vite internal resolver (#27155)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 Yarn and PNPM Workspaces, the `nxViteTsPaths`'s `resolveId` is not
called because Vite has already tried to resolve the module.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure the `nxViteTsPath`'s logic is run before vite's internal
resolver.

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

Fixes #20520
2024-07-26 16:59:20 +01:00
Colum Ferry 38a7f43925 fix(module-federation): handle tspath mappings with /* wildcard #26765 (#27149)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->
Module Federation setups using `/*` wildcards in ts path mappings error
out as they cannot resolve the module.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`/*` ts path mappings should still allow modules to be resolved

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

Fixes #26765
2024-07-26 11:54:09 -04:00
Isaac Mann b7f2514e47 docs(core): show projects example with tags (#27145)
Fixes #25062
2024-07-26 11:40:39 -04:00
zack-derose e78a6a2c48 docs(misc): isaac review items 2024-07-26 08:03:00 -07:00
zack-derose f0904b6eeb docs(misc): nx cloud updated 2024-07-26 08:03:00 -07:00
zack-derose d2a2315e0a docs(misc): typo fix 2024-07-26 08:03:00 -07:00
zack-derose 84ced3c7b1 docs(misc): adjustments from Jason conversation 2024-07-26 08:03:00 -07:00
zack-derose 7557046f4e docs(misc): small adjustments 2024-07-26 08:03:00 -07:00
zack-derose bb2d3bc710 docs(misc): update react section 2024-07-26 08:03:00 -07:00
zack-derose 000210d726 docs(misc): add changelog info 2024-07-26 08:03:00 -07:00
zack-derose 41ddab9d4c docs(misc): review updates for 19.5 blogpost 2024-07-26 08:03:00 -07:00
zack-derose 0b0f029a74 docs(misc): nx 19.5 update blogpost 2024-07-26 08:03:00 -07:00
Isaac Mann 719c6a5322 docs(core): explain root level tasks in project.json (#27151)
Fixes #20522
2024-07-26 10:45:58 -04:00
Leosvel Pérez Espinosa 5e4f05c52b fix(misc): generate the "types" field in package.json if no set (#27147)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #20003
2024-07-26 15:56:48 +02:00
Eason Lin fa976e04c8 docs(react): change word "Angular" to "React" (#27140)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

"Hence we can easily import them into other libraries and our Angular
application. As an example, let's use the pre-generated
ProductsComponent component from our libs/products library."

It's a tutorial providing a React project example, I think "Angular" is
typing wrong

## Current Behavior

Hence we can easily import them into other libraries and our **Angular**
application. As an example, let's use the pre-generated
ProductsComponent component from our libs/products library.

## Expected Behavior

Hence we can easily import them into other libraries and our **React**
application. As an example, let's use the pre-generated
ProductsComponent component from our libs/products library.
2024-07-26 07:32:02 -06:00
Jack Hsu b3d75091cc fix(node): ensure artifacts are built before serving app (#27146)
This PR ensures that all dependencies are built before serving the Node
app.
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
If users don't manually run `nx build <app>` first, then the
dependencies won't build because when `@nx/js:node` executor runs, it
uses `runExecutor` which skips dependencies.

## Expected Behavior
Set `dependsOn` on the `serve` target so run `<app>:build` first, which
would ensure dependencies are all built. Also add
`runBuildTargetDependencies: false` to the target options for
visibility, so users could toggle it on if they want to re-build deps
whenever there is a change (during watch). The option will slow things
down, so we still want it to be `false` by default.

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

Fixes #18964
2024-07-26 09:24:25 -04:00
Leosvel Pérez Espinosa 09b0b38333 cleanup(angular): replace old util with devkit util and remove "ignore" dependency (#27126)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-26 14:59:53 +02:00
Jack Hsu 45c458e677 fix(react): generate valid Vite + JSX setup for React (#27130)
The current `@nx/react:app` generator does not take the `--js` option
into account. There are two problems:

1. `index.html` includes `main.tsx` not `main.jsx`.
2. `.js` files with JSX are invalid in Vite, and must be named `.jsx`.

This PR adds a new option to the `toJS` devkit util to preserve `.jsx`
rather than renaming them to `.js`. The vast majority of non-Vite React
projects will use `.js` and not `.jsx` (e.g. Next.js, Expo, Remix, etc.)
so we just want to apply this change to Vite only for now.

In the future we could enhance React generators to support `--jsx`, for
example.

## 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 #20810
2024-07-26 08:30:16 -04:00
Benjamin Cabanes d2e3fc79db feat(nx-dev): add ai for ci (#27096)
Introduced a new AI section with dark/light image support. Refactored component exports from arrow functions to named functions for better readability and consistency. Included minor adjustments to class names and style properties.
2024-07-26 01:07:19 -07:00
Nicholas Cunningham b3c67defdb feat(nx-dev): Update footer links (#27075)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2024-07-25 22:18:35 -04:00
Jack Hsu 4ab9e6dc14 fix(nextjs): fix inlined workspace root in .nx-helpers (#27136)
This PR fixes an issue where our `withNx` function for Next.js is
compiled with inlined `workspaceRoot` (to support container
environments). On Windows, we write the `.nx-helpers/with-nx.js` with
the following:

```js
workspaceRoot: 'C:\Users\user\projects\app',
```

The `\u` character result in a Node error: `Invalid Unicode escape
sequence`.

The fix is to escape `\` as `\\`, so when the file is written, the path
is valid and does not cause unicode errors.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #18824
2024-07-25 18:01:27 -06:00
Craigory Coppola 8e596c3abf docs(core): document projectsAffectedByDependencyUpdates (#27134)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
No docs for new config flag

## Expected Behavior
Docs 🎉 

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

Fixes #22259
2024-07-25 19:18:27 -04:00
Craigory Coppola 97b00840cc docs(nx-plugin): fixup docs for project name and root changes (#27139)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 plugin docs don't make sense after project name and root changes

## Expected Behavior
They've been touched up

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

Fixes #25191
2024-07-25 19:17:59 -04:00
Nicholas Cunningham fcbc142c6c fix(nx-dev): improve bandwidth usage convert gif to mp4 (#27129)
This PR aims to improve the bandwidth usage of nx-dev which is hosted on
Vercel.
2024-07-25 15:12:23 -06:00
Nicholas Cunningham 09c0b3d31a feat(nx-dev): Migrate brands from nx.app (#27044) 2024-07-25 16:53:43 -04:00
Craigory Coppola 8f5d3dccc9 chore(repo): cache documentation script (#27100)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
`documentation` is not cacheable. It is reran everytime someone tries to
push, including the following flow:

- git push, fails as docs changes found
- git commit -am "chore(repo): add docs"
- git push, runs full docs cycle again in pre-push hook

## Expected Behavior
`documentation` is cacheable, and avoids rerunning when no fs changes
are made

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

Fixes #
2024-07-25 16:52:40 -04:00
Jason Jean 155e69b946 fix(devkit): detect package manager based on install location (#27127)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 package manager is detected based off of the relative `cwd` which in
most cases is `''`. This incorrectly goes off of the `cwd` of the
command rather than the location of the `package.json` file being
modified.

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

The package manager is detected based off the absolute path of the
directory containing the `package.json` file being modified. So if this
is the root, it will detect the package manager at the root rather than
the `cwd`

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

Fixes https://github.com/nrwl/nx/issues/19831
2024-07-25 14:40:57 -05:00
Wixewr 50e08aa356 feat(js): added a verdaccio listen address to configuration (#26976)
Co-authored-by: William van der Vegt <william.van.der.vegt@moba.net>
Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
2024-07-25 14:43:33 -04:00
Rajhans Jadhao a9c2f16bee fix(linter): checking command is specified (#26908) 2024-07-25 14:41:59 -04:00
Isaac Mann 3a5e0ddfef docs(core): remove reference to affected:graph (#27128)
Fixes #26582
2024-07-25 14:23:07 -04:00
Pascal zhang 3ba2763911 docs(core): adding npx where it missing (#27015)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->
having some command without npx before
````
nx .....
````
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Have npx on all command 
````
npx nx .....
````

Co-authored-by: pikooli <>
2024-07-25 13:59:44 -04:00
Isaac Mann 4a3a8a9c90 docs(core): npm workspaces tutorial video (#26821)
Add video for npm workspaces tutorial
2024-07-25 13:07:52 -04:00
Isaac Mann 529fa429f0 docs(core): react monorepo tutorial video (#26817)
Add video to React monorepo tutorial
2024-07-25 12:39:39 -04:00
MaxKless 73536da764 fix(core): always load task envs from workspace root instead of relative to cwd (#27120) 2024-07-25 12:29:07 -04:00
Jonathan Cammisuli dd84dab01c chore(repo): use inputs instead of env for the cache step in agents (#27123)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-25 12:18:59 -04:00
Nicholas Cunningham 8e55dbe537 Fix (nx-dev): idea feedback (#27121)
Taken from: https://github.com/nrwl/nx/pull/26560

## Currently

When you enter a space in the idea form it gets trimmed so users are
unable to add a proper sentence when submitting an idea.

## Expected

Users should be able to add spaces as they feel is necessary without
being restricted.

---------

Co-authored-by: Sarthak <130341942+Sarthak0085@users.noreply.github.com>
2024-07-25 10:14:58 -06:00
Craigory Coppola 40d39d40a8 feat(core): include target architecture in nx report (#27094) 2024-07-25 12:01:58 -04:00
Jonathan Cammisuli 173ea84d92 chore(repo): update nx agents to use v4 of cache and checkout (#27122)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->
agents.yaml are currently using a pinned version of v3.6

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
agents.yaml are using v4 of the workflow steps

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

Fixes #
2024-07-25 11:58:37 -04:00
Colum Ferry 58cd577f2c fix(vite): vitest executor should continue to load plugins #22001 (#27118)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->
Plugins were not being loaded by vitest executor when calling
`startVitest` when using a vite config file with a custom name.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Correctly load the plugins found in the resolved config file, regardless
of the config file name


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

Fixes #22001
2024-07-25 15:48:19 +00:00
Jason Jean 37cc8ab747 fix(core): bump the time crate so compilation succeeds (#27117)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->

`time` crate is locked to a version which fails to compile.

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

`time` crate is updated to a version which does not fail to compile.

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

Fixes #
2024-07-25 10:45:56 -04:00
Leosvel Pérez Espinosa 484e9b1de6 fix(js): generate additional entry point exports without the filename for barrel files (#27112)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #23519
2024-07-25 16:22:05 +02:00
Colum Ferry 2e8f162cf8 feat(react): add skipPackageJson flag to remote and host generators (#27116)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 `host` and `remote` generators do not have an option to skip package
install.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add the `skipPackageJson` flag to the remote and host generators

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

Fixes #
2024-07-25 15:19:02 +01:00
Nicholas Cunningham a0ca85841f feat(nx-dev): Migrate pricing page from nx.app (#27012)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2024-07-25 10:14:51 -04:00
Warren Dugan 6fd9cf4d45 docs(misc): update monorepo-ci-azure.md (#26299)
Add `--targets` to `nx affected` command.
2024-07-25 09:35:14 -04:00
Leosvel Pérez Espinosa e9d9c9fde9 fix(core): format global config files modified by nx migrate (#27066)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #8928
2024-07-25 09:22:18 -04:00
Jason Jean 9fe9c291c8 feat(core): update axios to ^1.7.2 (#27076)
## Current Behavior
<!-- This is the behavior we have today -->

`axios@^1.6.0` is used.

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

`axios@^1.7.2` is used

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

Fixes #26538
2024-07-25 09:19:02 -04:00
Leosvel Pérez Espinosa 1774edd1a6 fix(js): do not override package.json type when defined in tsc executor (#27106)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #23579
2024-07-25 12:23:28 +02:00
Leosvel Pérez Espinosa ebb42b73eb fix(angular): bump ngrx version and add @ngrx/operators to the package update list (#27107)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #26694
2024-07-25 10:35:43 +02:00
Denis Frenademetz 5d5b13e783 fix(linter): ensure too many warnings is only logged if enabled (#27083)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->

ESLint found too many warnings (maximum: -1).

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Nothing should be logged if maximum is set to -1
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-25 10:10:07 +02:00
Jack Hsu 3890edc560 docs(core): feature Nx Cloud sections more prominently in CLI tutorials (#27077)
Updated these tutorials:
-
https://nx-dev-git-docs-cli-tutorials-promote-cloud-nrwl.vercel.app/getting-started/tutorials/npm-workspaces-tutorial
-
https://nx-dev-git-docs-cli-tutorials-promote-cloud-nrwl.vercel.app/getting-started/tutorials/react-standalone-tutorial
-
https://nx-dev-git-docs-cli-tutorials-promote-cloud-nrwl.vercel.app/getting-started/tutorials/react-monorepo-tutorial
-
https://nx-dev-git-docs-cli-tutorials-promote-cloud-nrwl.vercel.app/getting-started/tutorials/angular-standalone-tutorial
-
https://nx-dev-git-docs-cli-tutorials-promote-cloud-nrwl.vercel.app/getting-started/tutorials/angular-monorepo-tutorial
-
https://nx-dev-git-docs-cli-tutorials-promote-cloud-nrwl.vercel.app/getting-started/tutorials/vue-standalone-tutorial
-
https://nx-dev-git-docs-cli-tutorials-promote-cloud-nrwl.vercel.app/getting-started/tutorials/gradle-tutorial
-
https://nx-dev-git-docs-cli-tutorials-promote-cloud-nrwl.vercel.app/recipes/adopting-nx/adding-to-monorepo
-
https://nx-dev-git-docs-cli-tutorials-promote-cloud-nrwl.vercel.app/recipes/adopting-nx/adding-to-existing-project
2024-07-24 21:32:01 -04:00
Nicholas Cunningham fc60f6b187 feat(nx-dev): Update nx-cloud page ai section (#27103)
To be inline with ocean: https://github.com/nrwl/ocean/pull/5379
2024-07-24 18:33:06 -06:00
Craigory Coppola 0104ea4fc3 fix(core): allow overriding NX_PARALLEL with --parallel (#27016) 2024-07-24 17:41:24 -04:00
Jason Jean fc1ad39fa2 fix(core): improve error for setting an internal node as an external … (#27102)
…dependency

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 unhelpful error is thrown when someone specifies a local project as an
external dependency input.

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

A helpful error is thrown when someone specifies a local projecft as an
external dependency input.

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

Fixes https://github.com/nrwl/nx/issues/27088
2024-07-24 15:31:19 -05:00
Emily Xiong 28cd0c4eef feat(js): add scopes option for verdaccio (#26918) 2024-07-24 16:18:13 -04:00
Leosvel Pérez Espinosa 8afd3ea15d fix(core): update migration generators missing calls to format files (#27082)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #25122
2024-07-24 16:03:49 -04:00
Leosvel Pérez Espinosa e474b597c5 fix(core): remove outdated workaround artificially keeping process alive (#27062)
Remove an old workaround added in https://github.com/nrwl/nx/pull/5807.
The issue it was addressing was fixed in the Angular CLI shortly after,
but the workaround was never 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 #
2024-07-24 16:02:36 -04:00
Leosvel Pérez Espinosa c7e1a1681e fix(testing): use taskkill to kill web server process when running cypress on windows (#27068)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #26599
2024-07-24 15:48:59 -04:00
Jason Jean bb92857b21 chore(repo): make publishing depend on build targets (#27080)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->

Populating the local registry for e2e tests is not dependent on the
builds but runs them. It sometimes gets cache misses for some builds
thus making that inconsistent.


https://staging.nx.app/runs/FxIwbj6UQo/task/%40nx%2Fnx-source%3Apopulate-local-registry-storage

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

Populating the local registry for e2e tests is dependent on the builds
and does not run them within itself. In the CI pipeline, this ensures
that the build tasks are run first.


https://staging.nx.app/runs/NUrFeUBbQk/task/%40nx%2Fnx-source%3Apopulate-local-registry-storage

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

Fixes #
2024-07-24 15:46:09 -04:00
Craigory Coppola def20f29ca fix(core): shorten socket length for plugin workers (#27073)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
Plugin worker's socket path includes a hash digest of the workspace
root. This is not needed, as the socket path already includes the
process pid in it which is unique. The hash digest adds an additional 20
characters to the path and as the path is too long on some unix systems
the uniqueness is dropped, causing the plugin transactions to get hit
inappropriately.

## Expected Behavior
The plugin socket path doesn't contain extra characters, so it should be
unique.

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

Possibly related #27040
2024-07-24 15:42:24 -04:00
Craigory Coppola b7472fdd41 fix(core): reset should cleanup temporary nx-cloud files (#23316)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

## Current Behavior
<!-- This is the behavior we have today -->
`nx reset` doesn't remove marker files used by nx cloud.
## Expected Behavior
`nx reset` removes marker files from nx cloud

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

Fixes #https://github.com/nrwl/nx/issues/23308
2024-07-24 15:39:14 -04:00
Katerina Skroumpelou 467f343e3d feat(misc): only create one commit with cloud onboard URL on cnw (#27093)
* Only create one commit during CNW
* Commit includes cloud onboarding URL
![Screenshot 2024-07-24 at 7 15
54 PM](https://github.com/user-attachments/assets/39b50443-4fbd-4423-b25c-68c45099af66)
2024-07-24 14:05:34 -05:00
Raz Luvaton 99a488ae75 fix(core): use argument length that match the actual size of the argument length (#21074) 2024-07-24 12:23:18 -04:00
Adrian Dimech 918b8fbc52 fix(core): ensure output paths returned are unique (#18207)
It is possible for users to define multiple duplicate outputs in their
project.json. This is leading to fs related issues like `ENOTEMPTY:
directory not empty, rmdir`. The reason this occurs is that the src will
tried to be copied to the cached directory in parallel for all output
paths (even duplicated ones) and is the reason why these errors are seen
sporadically. By ensuring output paths are unique, we only ever copy one
path which resolves this issue.

Note: There may still be an issue present if there is a glob that is
overlapping another directory i.e: `cdk.out/*` and `cdk.out`, however
have not been able to reproduce a fs error while testing.

fixes #17277, #16337

## Current Behavior
If you have a project.json which has duplicate output entires, it is
possible to receive fs related errors when the cache is being written to
disk.

## Expected Behavior
each output should only be copied once into the caches directory. 

## Related Issue(s)
#17277, #16337

Fixes #17277, #16337
2024-07-24 11:57:11 -04:00
Phillip Barta aeec5cc31a cleanup(core): refactor nx list command to remove unused code and code duplication (#21748)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

## Current Behavior
<!-- This is the behavior we have today -->
the code for the `nx list` command has unused and duplicated code.
 
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
no unused code and code duplication

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

Fixes #

---------

Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
2024-07-24 11:56:27 -04:00
Colum Ferry a8dc251cce fix(bundling): get workspace package prefix length correctly #20817 (#27092)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 are workspace libraries with the following import paths:

```
@org/core
@org/core/db
@org/core/acme
```

They need to be sorted for the manifest such that matching finds the
most specific first.
The logic for this is currently based off whether an `*` exists, which
doesn't work when the paths are specific.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Try to use `*` first and fallback to `/` to determine package prefix
length.


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

Fixes #20817
2024-07-24 10:26:39 -04:00
Jack Hsu 31f9d9ef11 docs(core): update CI tutorials with better distribution screenshots (#27049)
The current screenshot doesn't show any tasks. This PR replaces it with
one that actually shoes tasks in progress, as well what the GitHub PR
looks like. Also updates the workflow config file to align with what we
generate for 19.5.1.

Previews:
-
https://nx-dev-git-docs-ci-tutorials-update-part-2-nrwl.vercel.app/ci/intro/tutorials/circle
-
https://nx-dev-git-docs-ci-tutorials-update-part-2-nrwl.vercel.app/ci/intro/tutorials/github-actions
2024-07-24 10:18:57 -04:00
Katerina Skroumpelou 7a642ee4fb feat(misc): prioritize github onboarding flow (#27085)
* Prioritized remotes in the order: `origin`, `upstream`, `base`, and
then the first remote found, when trying to determine if repo uses
GitHub.
* Implemented fallback to a default GitHub onboarding URL
(`/setup/connect-workspace/github/select`) if no remotes are found.
* Added corresponding unit tests to verify the new remote priority order
and fallback behavior.
2024-07-24 16:22:49 +03:00
Colum Ferry 339d673b2b fix(bundling): prevent exports overwrite with esbuild (#27047)
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: katsanva <1161259+katsanva@users.noreply.github.com>

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #20324 #20325

Co-authored-by: katsanva <1161259+katsanva@users.noreply.github.com>
2024-07-24 08:30:24 -04:00
Colum Ferry db7cb5de48 fix(vite): respect existing package.json type #27057 (#27084)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 `@nx/vite:build` executor is always overwriting the
`packageJson.type` field when generating a packageJson.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `@nx/vite:build` executor should respect the existing type in
packageJson

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

Fixes #27057
2024-07-24 08:29:45 -04:00
Colum Ferry 996c97f13e fix(vite): remove cache.dir option from test utils (#27087)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->
`cache.dir` is still generating when it shouldn't be.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`cache.dir` option should not be generating

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

Fixes #27039
2024-07-24 08:29:23 -04:00
Jan-Niklas W. 9faeddc1d6 feat(core): update pnpm/action-setup to v4 in ci-workflow generator (#26838)
I just created a new nx monorepo with pnpm and in the github.ci file it
uses pnpm/action-setup@v2.
I ran into the following issue
https://github.com/pnpm/action-setup/issues/136 and updating to
pnpm/action-setup@v4 solved the issue for me

---------

Co-authored-by: Jan-Niklas Wortmann <jan-niklas.wortmann@jetbrains.com>
Co-authored-by: Miroslav Jonaš <missing.manual@gmail.com>
2024-07-24 13:54:37 +02:00
Guilherme Prezzi 15b71d0803 feat(module-federation): support setremotedefinition api (#27051)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 only method available to manage remotes is `setRemoteDefinitions`
method, that overwrite the previous state, as expected. The problem is
that in some cases, when it needed to add more remotes dynamically, this
API replace it current state, removing the previous remotes.

## Expected Behavior
Expose a new API called `setRemoteDefinition(remoteName: string,
remoteUrl: string)` that adds or replace a new remote definition in the
remotes map, without overwrite the remotes map.

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

Fixes #27050

---------

Co-authored-by: Guilherme Prezzi <guilherme.prezzi@totvs.com.br>
2024-07-24 09:38:20 +01:00
Matthew Hancock 92eb1fa701 feat(module-federation): improve console output for remote build errors (#26711)
## Current Behavior
When running `nx serve` for a module federation application, if one of
the static remotes fail you get output that looks as such
```
> nx run shell:serve:development


 NX  Starting module federation dev-server for shell with 13 remotes


 NX  Building 13 static remotes...

/<user-path>/node_modules/@nx/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js:140
                throw new Error(`Remote failed to start. A complete log can be found in: ${remoteBuildLogFile}`);
                ^

Error: Remote failed to start. A complete log can be found in: /<user-path>/.nx/workspace-data/2024-06-26T21_21_37_744Z-build.log
    at ChildProcess.<anonymous> (/<user-path>/node_modules/@nx/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js:140:23)
    at Object.onceWrapper (node:events:632:26)
    at ChildProcess.emit (node:events:517:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:292:12)

Node.js v18.20.3

——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Running target serve for project shell failed
```

The cause of the failure is not immediately obvious. The output is
cryptic and seems like a fatal error occurred, not one from the project
source code. The failure could happen for many reasons such as updating
a package that is not compatible with all remotes.

## Expected Behavior
With the changes proposed in this PR, we get a much more improved output
that's easier to read and much more obvious what happened in the project
source code.

1. Replace the `throw` statement with a promise rejection which outputs
a clean Nx Error
2. When an error is detected from webpack, output that snippet directly
into the console. No need to open and scroll through the entire log file
searching for the error.

```
 NX  Starting module federation dev-server for shell with 13 remotes


 NX  Building 13 static remotes...

m (id hint: vendors) 134 KiB [rendered] reused as split chunk (cache group: defaultVendors)
chunk (runtime: mover) 8762.js 13.4 KiB [rendered]
chunk (runtime: mover) 8798.js 14.9 KiB [rendered]
chunk (runtime: mover) 8802.js (id hint: vendors) 20.1 KiB [rendered] reused as split chunk (cache group: defaultVendors)
chunk (runtime: mover) 8930.js (id hint: vendors) 121 KiB [rendered] split chunk (cache group: defaultVendors)
chunk (runtime: mover) 8974.css, 8974.js 150 KiB (javascript) 252 bytes (consume-shared) 25.6 KiB (css/mini-extract) [rendered]
chunk (runtime: mover) 42 bytes reused as split chunk (cache group: default)
chunk (runtime: mover) 9199.js 17.4 KiB [rendered]
chunk (runtime: mover) 9227.js 7.02 KiB [rendered]
chunk (runtime: mover) 9241.js 10.7 KiB [rendered]
chunk (runtime: mover) 9279.js (id hint: vendors) 209 KiB [rendered] split chunk (cache group: defaultVendors)
chunk (runtime: mover) 9289.js (id hint: vendors) 228 KiB [rendered] reused as split chunk (cache group: defaultVendors)
chunk (runtime: mover) 9354.js 15 bytes [rendered]
chunk (runtime: mover) 9356.js 14.5 KiB [rendered]
chunk (runtime: mover) 9426.js (id hint: vendors) 26.8 KiB [rendered] reused as split chunk (cache group: defaultVendors)
chunk (runtime: mover) 9500.js 1.05 KiB [rendered]
chunk (runtime: mover) 9637.js 78.1 KiB (javascript) 84 bytes (consume-shared) [rendered] reused as split chunk (cache group: default)
chunk (runtime: mover) 9716.js (id hint: vendors) 59.5 KiB [rendered] split chunk (cache group: defaultVendors)
chunk (runtime: mover) 9807.js 16.2 KiB [rendered]
chunk (runtime: mover) 9888.js 7.42 KiB [rendered]

ERROR in ./apps/app1/src/../../../index.tsx:20:20
TS2322: Type '"foo"' is not assignable to type 'Tones'.
    18 |   return (
    19 |     <div data-component-id="Banner">
  > 20 |       <ComponentA tone={'foo'} >
       |                   ^^^^
    21 |         <div className="space-y-2">
    22 |           <div className="pr-2">

webpack compiled with 1 error (bd60f37cf54db8e4)


 NX   Remote failed to start. A complete log can be found in: /<user-path>/.nx/workspace-data/2024-06-26T21_27_40_438Z-build.log



——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Running target serve for project shell failed
```

## Related Issue(s)
N/A

Co-authored-by: Hancock, Matthew <Matthew_Hancock@comcast.com>
2024-07-24 09:37:18 +01:00
Nicholas Cunningham 232e12479e fix(nx-dev): Remove announcement banner 2024-07-24 01:28:24 -07:00
Jason Jean 684d2a9bbe fix(core): fix watch daemon error (#27067)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 watch` throws an error saying the daemon is not running when the
daemon is indeed running.

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

`nx watch` does not throw an error saying the daemon is not running when
the daemon is indeed running.

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

Fixes #
2024-07-23 15:40:47 -04:00
Miroslav Jonaš a7ff250f27 feat(nx-dev): reprioritize customer logos on landing page (#27061)
A follow up PR will replace Amplify logo with AWS

## Current Behavior
<img width="1257" alt="image"
src="https://github.com/user-attachments/assets/75063fc7-ea4f-4110-82d2-de0640ff9352">


## Expected Behavior
<img width="1220" alt="image"
src="https://github.com/user-attachments/assets/38fdb143-19ac-4a12-900d-67a8952f057f">


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

Fixes #
2024-07-23 21:37:44 +02:00
Louie Weng 981d8c1c1b chore(repo): enable dte summary table (#27055)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 summary of distributed task runs

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

There is a summary of distributed task runs on CI
https://app.circleci.com/pipelines/github/nrwl/nx/53764/workflows/208f1b92-909b-489d-9144-58444e1b3c43/jobs/429693

 

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

Fixes #
2024-07-23 14:46:16 -04:00
Miroslav Jonas f2df3b57fd docs(nx-dev): replace amplify logo with aws 2024-07-23 11:17:09 -07:00
Leosvel Pérez Espinosa 8ccfc925a1 fix(module-federation): pin versions mf packages versions (#27071)
Pin the MF package versions to a minor range that works. There was a
release today that is causing failures:
https://staging.nx.app/runs/h1eVO5d9D7/task/e2e-angular%3Ae2e-ci--src%2Fmodule-federation.test.ts.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-23 14:03:39 -04:00
MaxKless 184e83ad58 feat(core): error when running atomized tasks outside of DTE (#26898)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 allows running atomized tasks (like `e2e-ci`) anywhere.

## Expected Behavior
Nx allows running atomized tasks (like `e2e-ci`) only in distributed
environments like Nx Agents or DTE. We'll leave that actual check to nx
cloud but in the default runner, we'll throw an error.
It's possible to escape from this with an env var.
2024-07-23 10:52:14 -04:00
Nicholas Cunningham e9b02cb3f7 feat(nx-dev): Migrate careers from nx.app (#27020) 2024-07-23 08:39:34 -04:00
Lars Gyrup Brink Nielsen f953ab8d9c chore(core): update actions/setup-node to v4 in ci-workflow generator (#26642)
Currently, the following warning is output when using GitHub Actions.

> Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: actions/setup-node@v3. For more information see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 `actions/setup-node` GitHub Action is installed in version 3.x
which uses the deprecated Node.js 16 runtime for GitHub Actions

## Expected Behavior
- The `actions/setup-node` GitHub Action is installed in version 4.x
which uses the supported Node.js 20 runtime for GitHub Actions

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

Fixes #

---------

Co-authored-by: Miroslav Jonaš <missing.manual@gmail.com>
2024-07-23 12:09:22 +02:00
Rares Matei ff505a7983 docs(nx-cloud): remove managed saml docs (#26969)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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: Miroslav Jonaš <missing.manual@gmail.com>
2024-07-23 11:43:17 +02:00
Nicholas Cunningham 3b1deb1a22 Add filters to blog page (#26997)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2024-07-23 02:36:16 -07:00
Miroslav Jonaš 157aca4d40 docs(nx-dev): add distribute on manual to custom dte (#27059)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-23 11:29:35 +02:00
Rares Matei 21cb714377 docs(nx-cloud): fix saml callback url (#27009)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-23 11:05:28 +02:00
Leosvel Pérez Espinosa e7c07ed719 fix(angular): remove unnecessary esbuild peer dependency (#27046)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #26770
2024-07-23 09:31:25 +02:00
Craigory Coppola c4f9d898ba fix(repo): update tests to pass regardless of actually installed yarn version (#27054)
… version

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-22 18:32:43 -04:00
Emily Xiong bfb0106e13 feat(graph): add parallelism in target details (#27014)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->
![Screenshot 2024-07-19 at 4 00
37 PM](https://github.com/user-attachments/assets/10637098-2429-4672-bec9-6caacd8ca190)
![Screenshot 2024-07-19 at 3 27
54 PM](https://github.com/user-attachments/assets/11b2c280-2b26-4ba0-b83d-3b833fea2ae7)


## 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-07-22 17:30:23 -05:00
Emily Xiong 627504d8d3 docs(core): add docs for parallelism (#26950)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-22 17:42:03 -04:00
Colum Ferry 8cf69c4b9a fix(vite): typecheck vue projects with vue-tsc #20242 (#26450)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

## Current Behavior
<!-- This is the behavior we have today -->
Typechecking of  Vue Projects with Vite is not functioning correctly

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Typechecking of Vue projects should type check the .vue files and not
error in TS files importing .vue files

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

Fixes #20242
2024-07-22 17:52:59 +01:00
Tim van den Eijnden 764eceed67 feat(testing): support vite configOverrides for cypress (#26554)
We'd like to use shared cypress commands, but that's currently not
working because vite cannot resolve the import.
By allowing to pass options to the vite config we have the possibility
to add an alias or a plugin to fix this.

This adds support for an **optional** `viteConfigOverrides` object.

## Current Behavior
![Screenshot 2024-06-14 at 15 19
21](https://github.com/nrwl/nx/assets/951290/78f5037f-c839-4227-a3ea-4de4142006cf)

cypress.config.ts:
```ts
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';

export default defineConfig({
  e2e: {
    ...nxE2EPreset(__filename, { cypressDir: 'cypress', bundler: 'vite' }),
  },
});
```

## Expected Behavior
![Screenshot 2024-06-14 at 15 23
56](https://github.com/nrwl/nx/assets/951290/385cde67-91b9-462e-9bfa-0c784d3947b7)

cypress.config.ts:
```ts
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';

const viteConfigOverrides = {
  resolve: {
    alias: {
      '@cypress-shared-commands': '../../../shared-cypress-commands',
    },
  },
};

export default defineConfig({
  e2e: {
    ...nxE2EPreset(__filename, { cypressDir: 'cypress', bundler: 'vite', viteConfigOverrides }),
  },
});
```
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-22 12:51:17 -04:00
Rares Matei 224305cb0d docs(nx-cloud): add release notes (#26989)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-22 17:05:04 +01:00
Louie Weng fb55c905c2 feat(repo): run e2e in the same command as build,test,lint (#27019)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-22 09:46:28 -06:00
Isaac Mann 199ffd1d54 docs(core): angular monorepo tutorial video (#26819)
Add video to Angular monorepo tutorial
2024-07-22 17:17:21 +02:00
Leosvel Pérez Espinosa 5217c3385f fix(linter): convert root projects correctly to inferred and remove default option values (#27035)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->

Converting a root project to inferred results in the plugin registration
to have the `includes` option set to `./**/*`. This is invalid and
causes no project to be inferred.

Additionally, the eslint `convert-to-inferred` generator:

- keeps a redundant `config` option, which is not needed because
inferred tasks only work with default/known ESLint config files, so
there's no need to specify it in the options
- converts all `lintFilePatterns` to `args`, which is correct, but it
keeps the patterns that are already inferred by the plugin, which leads
to duplicated patterns when running the task

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

Converting a root project to inferred should work as expected and result
in the `lint` task being inferred for the project.
Also, default inferred options should be removed from the target
options.

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

Fixes #26775
2024-07-22 10:03:19 -04:00
Leosvel Pérez Espinosa 0bc889838f fix(core): copy package manager config files when installing latest nx version in nx migrate (#27032)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #26926
2024-07-22 15:59:12 +02:00
Leosvel Pérez Espinosa 5b414d1727 docs(testing): remove wrong cypress config filenames from plugin overview (#26981)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 cypress plugin overview lists `cypress.config.mts` and
`cypress.config.cts` filenames, which are not configuration filenames
supported by Cypress by default.

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

The cypress plugin overview only lists valid configuration filenames
supported by Cypress.

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

Fixes #
2024-07-22 15:58:32 +02:00
Leosvel Pérez Espinosa c724d10e2c cleanup(linter): remove leftover console.log from lint executor (#27002)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-22 15:58:18 +02:00
Leosvel Pérez Espinosa ae48a15629 fix(linter): log a message when the number of warnings exceeds the specified maxWarnings for the lint executor (#27003)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #26906
2024-07-22 15:58:01 +02:00
Jason Jean f08cd4cae3 docs(misc): lower concurrency to 3 in the docs (#27013)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 was changed in the generated ci workflow but not on the docs.

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

This is changed in the docs as well so it's not confusing.

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

Fixes #
2024-07-22 09:46:19 -04:00
Jason Jean e1cced3016 fix(core): record stats for more commands (#27017)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->

Stats are not recorded for `nx connect`, `nx view-logs`, and `nx init`.

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

Stats are recorded for those commands and they get sent to the right URL

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

Fixes #
2024-07-22 09:45:55 -04:00
James Henry 521c3f3891 fix(core): typo in nx update log (#27036) 2024-07-22 08:50:24 -04:00
Arthur f366d4e09c docs(core): added missing close bracket (#27023)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 a missing closing bracket in the
[cache-task-result](https://nx.dev/features/cache-task-results#finetune-caching-with-inputs-and-outputs)

<img width="696" alt="Screenshot 2024-07-21 at 2 22 01 PM"
src="https://github.com/user-attachments/assets/4a798a3a-3869-46e9-bd0b-cb762034a70f">


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

Add the missing closing bracket: change `{projectName` to
`{projectName}`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
N/A!
2024-07-22 08:54:58 +02:00
Leosvel Pérez Espinosa 4871642a74 fix(angular): generate correct server file when using webpack-based executors (#27007)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 #26722
2024-07-22 08:50:59 +02:00
Isaac Mann 9410164313 docs(core): github actions tutorial update (#26995)
Update the github actions tutorial:
- Removes content that focuses on GitHub Actions itself
- Updates for the new `nx connect` onboarding flow

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-07-19 15:29:39 -04:00
Emily Xiong e87bf395e1 fix(react-native): fix unable to resolve realm (#26983)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 https://github.com/nrwl/nx/issues/26853
2024-07-19 15:25:45 -04:00
Milan Kovacic b623104aac docs(nest): add deployment section (#26048)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

## Current Behavior
nx/nest documentation contains no deployment information.

## Expected Behavior
Deployment information is present, as it is a common question in
Discord.

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

---------

Co-authored-by: MilanKovacic <9189985+MilanKovacic@users.noreply.github.com>
2024-07-19 13:16:43 -06:00
Nicholas Cunningham 51d5d23eb8 feat(nx-dev): add Nx Cloud Page (#26865) 2024-07-19 14:53:25 -04:00
Benjamin Cabanes f1f8ab7fe7 feat(nx-dev): update typography and hero component styles (#27011)
Enhanced the typography styles to improve text scaling across various
screen sizes. Adjusted the hero component to include responsive line
breaks and optimized the SVG element for better alignment and sizing.
2024-07-19 14:12:21 -04:00
Jack Hsu ec5b04fb82 docs(core): move "nx connect" earlier in CI section for standalone/monorepo tutorials (#26845)
We're making an enhancement to `nx g ci-workflow` such that when the
workspace is already connected to Nx Cloud, we'll enable distribution in
the workflow file, rather than having them commented out. For the flow
of the tutorial, it makes more sense to do `nx connect` first so things
are set up correctly without user intervention.

Note: I left the "Make sure the following line is uncommented" for
distribution because older versions will still leave it uncommented.

Example:
https://nx-dev-git-docs-tutorials-update-nrwl.vercel.app/getting-started/tutorials/angular-monorepo-tutorial

---------

Co-authored-by: Isaac Mann <isaacplmann@gmail.com>
2024-07-19 13:43:05 -04:00
Emily Xiong 188f0d8526 fix(core): normalizeTargetDependencyWithStringProjects should not return undefined (#26994)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 https://github.com/nrwl/nx/issues/26975
2024-07-19 09:57:58 -07:00
Jack Hsu 8b1c78caa5 fix(module-federation): do not cache assets from static serve (#27005)
We're currently caching files for an hour when serving the host with
static remotes. This PR fixes the issue by setting `cacheSeconds: -1` on
the static server (disables cache).

This affects development only.
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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-07-19 10:39:32 -04:00
Benjamin Cabanes 83b88a10c7 feat(nx-dev): update descriptions and layout styles for better clarity (#26991)
Revised meta descriptions and adjusted layout styles to improve visual
consistency and accessibility. Enhanced card layout by refining padding
and icon handling for different screen sizes.
2024-07-18 14:09:20 -04:00
Colum Ferry a549b9b0c9 feat(module-federation): use proxy servers to proxy to single file server for static remotes (#26782)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->
Remotes that are served for a host are usually served from a single file
server running on a single port.
We perform some mapping logic during the build of the host application
to update the locations the remotes can be found at to point to the
single file server.

This works, but it's also wrong, as it breaks the flow that users
expect.
It also breaks dynamic remotes.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Continue to serve the remotes from a single file server, as this helps
reduce the amount of resources used on developers machines.
Use express to create proxy servers that will proxy requests from the
original remote location to the single file server.

This allows applications to continue to work without us having to
interfere and map any remote locations.
It also solves the issue with dynamic remotes.


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

Fixes #26318
2024-07-18 13:46:06 -04:00
Leosvel Pérez Espinosa 53d2e9cfc7 fix(core): resolve nested delegated executor package correctly (#26979)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 -->

Resolving the package for delegated executor definitions doesn't take
into account that the package could be nested inside the parent package.

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

Resolving the package for delegated executor definitions should work
correctly.

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

Fixes #26896
2024-07-18 16:41:26 +02:00
443 changed files with 974 additions and 16748 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ jobs:
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
pnpm nx affected -t e2e-macos-ci --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
+2 -2
View File
@@ -1,7 +1,7 @@
launch-templates:
linux-medium:
resource-class: 'docker_linux_amd64/medium+'
image: 'ubuntu22.04-node20.11-v10'
image: 'ubuntu22.04-node20.11-v3'
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
@@ -21,7 +21,7 @@ launch-templates:
~/.cache/Cypress
~/.cache/ms-playwright
~/.pnpm-store
base_branch: 'master'
base-branch: 'master'
- name: Install e2e deps
script: |
sudo apt-get update
-10
View File
@@ -379,11 +379,6 @@
"description": "Nx plugin that applies betterer standards on a per-project basis.",
"url": "https://github.com/spaceribs/spaceribs/tree/main/packages/nx-betterer"
},
{
"name": "@nx-extensions/helm",
"description": "Nx plugin providing comprehensive support for Helm charts, including generation, packaging, and publishing capabilities.",
"url": "https://github.com/marcolongol/nx-extensions/tree/main/packages/helm"
},
{
"name": "@nx-tools/nx-container",
"description": "Nx plugin to build OCI containers with Docker, Podman or Kaniko.",
@@ -493,10 +488,5 @@
"name": "@huge-nx/conventions",
"description": "Plugin to generate and manage Nx workspaces by adhering to established workspace conventions.",
"url": "https://github.com/jogelin/huge-nx"
},
{
"name": "nx-github-pages",
"description": "A small Nx plugin to make deploying static projects to GitHub Pages easy.",
"url": "https://github.com/agentender/nx-github-pages"
}
]
+2 -2
View File
@@ -90,7 +90,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 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](https://nx.app/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)
@@ -100,7 +100,7 @@ Finally, the **Enterprise plan** is for companies that want full control over wh
All these changes should allow developers to choose the plan that best suits their needs and budget more easily, ensuring a seamless and transparent experience regarding pricing and subscription management.
Learn more at [https://nx.dev/pricing](/pricing).
Learn more at [https://nx.app/pricing](https://nx.app/pricing).
## Coming Next
+176
View File
@@ -0,0 +1,176 @@
---
title: 'Nx 19.5: StackBlitz, New Features, And More!!'
slug: 'nx-19-5-adds-stackblitz-new-features-and-more'
authors: ['Zack DeRose']
cover_image: '/blog/images/2024-07-25/nx-19-5-thumbnail.png'
tags: [nx, release]
---
## Table of Contents
In this blog post:
- [StackBlitz Support](#stackblitz-support)
- [NEW: Pattern Support for `targetDefaults`](#new-pattern-support-for-targetdefaults)
- [NEW: Individual Targets Can Now Opt Out of Parallelism](#new-individual-targets-can-now-opt-out-of-parallelism)
- [Experimental: Gradle Test Atomization](#experimental-gradle-test-atomization)
- [Support for React 19 (rc) and Angular 18.1](#support-for-react-19-rc-and-angular-181)
- [NEW: Nx Cloud Hobby Tier](#new-nx-cloud-hobby-tier)
- [Automatically Update Nx](#automatically-update-nx)
- [Monorepo World Conference Speakers to Be Announced Soon!!](#monorepo-world-conference-speakers-to-be-announced-soon)
## StackBlitz Support!!
Nx now has support for Stackblitz. This means that you can create a StackBlitz with a whole Nx Workspace inside of it and run all Nx capabilities from their embedded terminal.
[![Nx Workspace in Stackblitz](/blog/images/2024-07-25/react-app-in-stackblitz.jpg)](https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-cwruaw?file=apps%2Freact-app%2Fsrc%2Fapp%2Fapp.tsx)
[Check out the example](https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-cwruaw?file=apps%2Freact-app%2Fsrc%2Fapp%2Fapp.tsx) above - you can use the standard command in the terminal:
```shell
> nx serve react-app
```
to develop your application inside of the stackblitz.
We're excited for this as it opens up many interesting use-cases, including easier ways of sharing examples, better opportunities for reproduction of issues or bugs, and potential for us to use embedded examples in our documentation in the future.
Web Assembly (or WASM) is the underlying technology being used here, so in addition to stackblitz any other tools built on a node context should now work as well.
## NEW: Pattern Support for `targetDefaults`
When using the Atomizer features of plugins like [`@nx/playwright`](/nx-api/playwright) and [`@nx/cypress`](/nx-api/cypress), you end up creating tasks with dynamic but predictable names.
![Tasks Created With Atomizer](/blog/images/2024-07-25/e2e-task-names.jpg)
Notice how the `e2e-ci--src/example.spec.ts` and `e2e-ci--src/test.spec.ts` tasks here are created by the `@nx/playwright` plugin based on the playwright spec files present in your workspace.
We've now added pattern matching to `targetDefaults` task names as a way to target these dynamic tasks.
The following will set all such tasks to depend on their `build` task:
```json
{
"targetDefaults": {
"e2e-ci--**/*": {
"dependsOn": ["build"]
}
}
}
```
Note that our plugins will set sensible configurations here out of the box when creating new workspaces using our generators.
Read more about [reducing configuration with `targetDefaults`](/recipes/running-tasks/reduce-repetitive-configuration#reduce-configuration-with-targetdefaults) and [how you can define task pipelines with `targetDefaults`](/features/run-tasks#defining-a-task-pipeline).
## NEW: Individual Targets Can Now Opt Out of Parallelism
One of our goals in changing the landscape of CI is to make CI more declarative - defining the what rather than the how.
Unfortunately, to accomodate for port collisions on end-to-end test, we've long adjusted our generated ci script to look like this:
```yml
- run: npx nx affected -t lint test build
- run: npx nx affected --parallel 1 -t e2e-ci
```
This is unfortunately more imperative, as we are starting to give instructions on how to run and order your CI, rather than defining what to run in our CI. In addition, these instructions will still run `lint`, `test`, and `build` targets first and wait until they all complete before then running `e2e-ci` - which leaves some inefficiencies on the table.
To address this, all tasks now support a `parallelism` property. By setting this property to `false`, you can now inform the Nx task runner to not attempt to run a certain task in parallel. This way we can define parallelism as a property of a task, and move our task running to be more declarative again.
Both our `@nx/playwright` and `@nx/cypress` plugins will now set `targetDefaults` for atomized tests to turn off `parallelism` from now on:
```json
{
// ...
"targetDefaults": {
"e2e-**/*": {
// ...
"parallelism": false
}
}
}
```
This way we can simply run the command:
```shell
> nx run-many --targets=lint,test,e2e-ci,build
```
And in CI, Nx Agents will allow all tasks to run in parallel on the same machine, except for the atomized end-to-end tasks, which will only run in isolation.
Learn more about how you can [Parallelize Tasks Across Multiple Machines Using Nx Agents](/ci/intro/tutorials/github-actions#parallelize-tasks-across-multiple-machines-using-nx-agents):
{% youtube
src="https://youtu.be/0YxcxIR7QU0"
title="Faster e2e Tests!"
width="100%" /%}
## Experimental: Gradle Test Atomization
Our new [`@nx/gradle` plugin](/nx-api/gradle) now supports Test Atomization out of the box.
![Gradle Atomized](/blog/images/2024-07-25/gradle-atomized.jpg)
This means that as you add tests in your gradle projects, we'll automatically create a new task for each test class, allowing you to distribute the execution of these tasks in your CI pipeline, just like with our `@nx/playwright` and `@nx/cypress` plugins.
## Support for React 19 (rc) and Angular 18.1
Nx 19.5 adds support for the React 19 release candidate and updated our Angular package to support the latest Angular minor version: 18.1.
When using our `@nx/angular` package, we'll automatically update you to the latest angular version when you run our migration. Using the `--interactive` flag you can choose to opt in or out of the latest Angular version:
```shell
> nx migrate latest --interactive
✔ Do you want to update to TypeScript v5.5? (Y/n) · true
✔ Do you want to update the Angular version to v18.1? (Y/n) · true
Fetching @angular/core@18.1.2
NX The migrate command has run successfully.
```
Our `@nx/react` package will now create new React applications using version 18.3, and we now support the new experimental `reactCompiler`. Users can install the [`babel-plugin-react-compiler` package](https://www.npmjs.com/package/babel-plugin-react-compiler) and you can follow [this guide for how to enable it with Nx](/recipes/react/react-compiler#react-compiler-with-nx).
Note that due to the extent of breaking changes coming with React 19, we will not be providing a automated migration to React 19 via [`nx migrate`](/nx-api/nx/documents/migrate).
## Automatically Update Nx
As always - updating Nx and its plugins is easy as we ship an [automated migration command](/features/automate-updating-dependencies).
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## NEW: Nx Cloud Hobby Tier
Our new expanded Hobby Tier now adds trial support for all features AND includes credits to run Nx Agents.
Sample the entire suite of features to see its impact on your organization. Start with everything, scale when you need more.
[![Nx Cloud Tiers](/blog/images/2024-07-25/start-with-everything-scale-when-you-need.jpg)](https://nx.app/pricing#plan-details)
Checkout the [plan details page](https://nx.app/pricing#plan-details) for more info, and see how Nx Cloud can help you!
## Monorepo World Conference Speakers to Be Announced Soon!!
[![Monorepo World](/blog/images/2024-07-25/monorepo-world.jpg)](https://monorepo.world)
The [Monorepo World conference](https://monorepo.world) is coming up soon on October 7, 2024 at the Computer History museum in Mountain View, California.
[Get your tickets now](https://ti.to/nx-conf/monorepoworld2024), consider [requesting access to the invite-only Enterprise Summit on October 8](https://ti.to/nx-conf/monorepoworld2024), and be sure to stay tuned as we'll be announcing speakers soon!
## 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)
- [Speed up your CI](https://nx.app/)
-55
View File
@@ -1,55 +0,0 @@
---
title: Introducing Explain with AI
slug: 'explain-with-ai'
authors: ['Philip Fulcher']
cover_image: '/blog/images/2024-07-29/explain-with-ai-header.avif'
tags: [nx, nx-cloud, ai, release]
---
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)**.
## Your ticket to fast error debugging
"Explain with AI" is a new feature for all Nx Cloud Pro users that is going to help you troubleshoot those pesky failing tasks. Whenever you get an error message on CI, look for the "Explain with AI" button on the upper right-hand corner:
![Nx Cloud error log window](/blog/images/2024-07-29/explain-with-ai-1.avif)
Once you hit that button, we collect the terminal output and other Nx task information and sprinkle some AI on top of it to give you a suggested fix. That should help you quickly get to the bottom of the issue and get back to work quickly.
![Explain with AI explaining how to resolve the CI error](/blog/images/2024-07-29/explain-with-ai-2.avif)
No more switching back and forth between a dozen tabs with different solutions. No more providing the right context for your masterfully written chat prompt. **Get your suggested fix and get back to work.**
## How can I start using this today?
![Nx Cloud organization settings section for enabling AI features](/blog/images/2024-07-29/ai-features.avif)
Here's how you get started:
- **Step 1:** Go to your [Nx Cloud](https://cloud.nx.app/) organization settings
- **Step 2:** Enable AI features
- **Step 3:** Accept the Nx Cloud AI terms and conditions.
- **Step 4:** You're all set ✨
Note that you'll need to be an organization admin for your Nx Cloud workspace to enable AI features.
{% call-to-action title="Log in to Nx Cloud" url="https://cloud.nx.app" icon="nxcloud" description="Enable AI features in your organization settings" %}
Log in to Nx Cloud
{% /call-to-action %}
### I want to try this, but I'm on the Hobby plan 🤔
If you're currently on the Hobby plan, you can start a free Pro plan trial for 14 days to try it out on your own workspace. No, we don't ask for credit cards to start a trial, so feel free to experiment!
## More to come!
This is just the first of a series of AI-powered features that we're going to be rolling out to your workspaces. We've got some cool features in the works already, which we're going to **announce publicly during the [Monorepo World](https://monorepo.world) conference in October**! So stay tuned!
## 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)
- [Speed up your CI](https://nx.app/)
-292
View File
@@ -1,292 +0,0 @@
---
title: 'Nx 19.5 is here! Stackblitz, Bun, Incremental Builds for Vite, Gradle Test Atomizer'
slug: 'nx-19-5-adds-stackblitz-new-features-and-more'
authors: ['Zack DeRose']
cover_image: '/blog/images/2024-08-01/nx-19-5-thumbnail.png'
tags: [nx, release]
---
## Table of Contents
In this blog post:
- [Announcing Nx Cloud Hobby Tier](#announcing-nx-cloud-hobby-tier)
- [StackBlitz Support](#stackblitz-support)
- [Bun and Pnpm v9 Support](#bun-and-pnpm-v9-support)
- [Local Flaky Task Detection](#local-flaky-task-detection)
- [Project Detail View Enhancements](#project-detail-view-enhancements)
- [Pattern Support for `targetDefaults`](#pattern-support-for-targetdefaults)
- [Individual Targets Can Now Opt Out of Parallelism](#individual-targets-can-now-opt-out-of-parallelism)
- [Support For Incremental Builds For Vite](#support-for-incremental-builds-for-vite)
- [Project Crystal Conversion Generators](#project-crystal-conversion-generators)
- [Gradle Composite Builds Support](#gradle-composite-builds-support)
- [Experimental: Gradle Test Atomization](#experimental-gradle-test-atomization)
- [Experimental: Nx Release Adds File Based Versioning Support](#experimental-nx-release-adds-file-based-versioning-support)
- [Support for React 19 (rc) and Angular 18.1](#support-for-react-19-rc-and-angular-181)
- [Automatically Update Nx](#automatically-update-nx)
- [Monorepo World Conference Speakers Announced!!](#monorepo-world-conference-speakers-announced)
## Video Summary
{% youtube
src="https://youtu.be/ER-6sKbb9ck"
title="Nx 19.5 is here! Stackblitz, Bun, AND MORE!"
width="100%" /%}
## Announcing Nx Cloud Hobby Tier
We just added a new [Hobby Tier](/pricing#plan-details) to Nx Cloud! Why is this exciting? It is completely free and contains all major features, which includes the ability to [distribute your tasks with Nx Agents](/ci/features/distribute-task-execution).
This gives you plenty of opportunities to experiment with Nx Cloud on your workspace and see its impact on your teams productivity.
[![Nx Cloud Tiers](/blog/images/2024-08-01/start-with-everything-scale-when-you-need.avif)](/pricing#plan-details)
Checkout the [plan details page](/pricing#plan-details) for more info, and see how Nx Cloud can help you! And in case you missed it, check out our latest blog on the latest Nx Cloud feature: [Explain with AI](/blog/explain-with-ai)!
## StackBlitz Support
Nx now has support for [Stackblitz](https://stackblitz.com/) (again). For a while it was not possible to use Nx on Stackblitz because we implemented some perf critical parts of Nx as native components with Rust. Huge shoutout to [LongYinan](https://github.com/Brooooooklyn) for [their amazing work of pushing napi-rs](https://napi.rs/) forward and helping us [add WebAssembly support to Nx](https://github.com/nrwl/nx/pull/22870) as well as the StackBlitz team who helped debug issues.
This means we are back and you can create a StackBlitz with a whole Nx Workspace inside it and run all Nx capabilities from their embedded terminal.
[![Nx Workspace in Stackblitz](/blog/images/2024-08-01/react-app-in-stackblitz.avif)](https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-cwruaw?file=apps%2Freact-app%2Fsrc%2Fapp%2Fapp.tsx)
[Check out the example](https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-cwruaw?file=apps%2Freact-app%2Fsrc%2Fapp%2Fapp.tsx) above. You can use the standard Nx commands in the Stackblitz terminal, like
```shell
nx serve react-app
```
We're excited about this as it opens up many interesting use cases, including easier ways of sharing examples, better opportunities for reproducing issues or bugs, and the potential for us to use embedded examples in our documentation in the future.
Again, special shout out to community contributor [LongYinan](https://github.com/Brooooooklyn) and [their napi-rs project](https://napi.rs/).
## Bun and Pnpm v9 Support
We've been monitoring [Bun](https://bun.sh/) for a while both as a runtime and as a package manager, and we've decided to take the first step in Bun support now by supporting [Bun as a package manager](https://bun.sh/docs/cli/install)! This means that you can now use Bun like you would use npm, pnpm, or yarn to install and manage your dependencies, and Nx will be able to correctly understand those dependencies as `externalNodes` in the Nx dependency graph.
Sending a big thank you to community contributor [Jordan Hall](https://github.com/Jordan-Hall) for completing [this work](https://github.com/nrwl/nx/pull/22602).
In addition to supporting Bun, Nx now supports the latest format of [`pnpm`](https://pnpm.io/) lockfiles which was introduced in version 9.
## Local Flaky Task Detection
Nx Cloud has long offered [flaky task detection](/ci/features/flaky-tasks) on CI, and now this capability is available **even when running them locally**.
![Local Flaky Task Warning](/blog/images/2024-08-01/flaky-task.avif)
If a task is detected as flaky during local execution, youll receive a warning. Nx identifies flaky tasks by tracking the outcomes of your tasks in relation to your source code and external dependencies. When the same code produces different results, Nx flags the task as flaky and triggers the warning.
Detecting flaky tasks in the local environment empowers developers to address issues early in the development cycle—before they affect your CI pipelines.
## Project Detail View Enhancements
As part of [project Crystal](/concepts/inferred-tasks) we've added the ability to our plugins to automatically infer tasks based on the tools and configuration files available in your workspace. As part of that we created the "project detail view", allowing you to visualize such dynamically created tasks. You can launch it by using the [Nx Console IDE plugin](/getting-started/editor-setup) or by running the command:
```shell
nx show project [projectName]
```
In this iteration we've added several enhancements to the project detail view. For one, we've added more instructions on how to discover options for the underlying tools, and included examples on how to adjust these options via your `project.json` file.
![Project Detail View Vite Serve](/blog/images/2024-08-01/project-detail-view-vite-serve.avif)
In addition, we've added a callout for tasks that [leverage the `Nx Atomizer`](/ci/features/split-e2e-tasks). Since atomizer tasks are designed to be used with [Nx Agents](/ci/features/distribute-task-execution#distribute-task-execution-nx-agents), this callout will appear in yellow to warn if your project is not yet configured to run them on CI, and you can click on this callout for an easy way to complete that setup:
![Atomizer Warning](/blog/images/2024-08-01/atomizer-warning.avif)
Clicking this button will launch the [Nx Cloud onboarding](https://cloud.nx.app) process, which will generate a PR in your repository to complete the setup.
![Connect Your Repo](/blog/images/2024-08-01/connect-a-repo.avif)
Note that the new, free [hobby tier for Nx Cloud](#new-nx-cloud-hobby-tier) includes the ability to run [Nx Agents](/ci/features/distribute-task-execution) without the need to immediately jump onto a paid plan.
## Pattern Support for `targetDefaults`
When using the [Atomizer features](/ci/features/split-e2e-tasks) of plugins like [`@nx/playwright`](/nx-api/playwright) and [`@nx/cypress`](/nx-api/cypress), you end up creating tasks with dynamic but predictable names.
![Tasks Created With Atomizer](/blog/images/2024-08-01/e2e-task-names.avif)
Notice how the `e2e-ci--src/example.spec.ts` and `e2e-ci--src/test.spec.ts` tasks here are created by the `@nx/playwright` plugin dynamically based on the playwright spec files present in your workspace.
We've now **added pattern matching** to `targetDefaults` task names as a way to target these dynamic tasks.
In the past it was difficult to customize this dynamic set of targets. But with the new support for specifying a pattern to a target name, you can now customize this set of dynamic targets all at once.
The following will set all such tasks to depend on their `build` task:
```json
{
"targetDefaults": {
"e2e-ci--**/*": {
"dependsOn": ["build"]
}
}
}
```
Note that our plugins will set sensible configurations here out of the box when creating new workspaces using our generators.
Read more about [reducing configuration with `targetDefaults`](/recipes/running-tasks/reduce-repetitive-configuration#reduce-configuration-with-targetdefaults) and [how you can define task pipelines with `targetDefaults`](/features/run-tasks#defining-a-task-pipeline).
## Individual Targets Can Now Opt Out of Parallelism
One of our goals in transforming the CI landscape is to **make CI more declarative** by focusing on defining the "what" rather than the "how."
To accommodate port collisions in end-to-end tests, we've long adjusted our generated CI script to look like this:
```yml
- run: npx nx affected -t lint test build
- run: npx nx affected --parallel 1 -t e2e-ci
```
Unfortunately, this approach is more imperative, as it instructs how to run and order your CI rather than defining what should be run. Additionally, these instructions cause `lint`, `test`, and `build` targets to run first and wait until they all complete before running `e2e-ci`, leading to inefficiencies.
To address this, all tasks now support a `parallelism` property. By setting this property to `false`, you can instruct the Nx task runner not to run a specific task in parallel. This allows us to define parallelism as a task property, making our CI configuration more declarative.
Both our `@nx/playwright` and `@nx/cypress` plugins will now automatically set `targetDefaults` for atomized tests to disable parallelism:
```json {% fileName="nx.json" %}
{
// ...
"targetDefaults": {
"e2e-**/*": {
// ...
"parallelism": false
}
}
}
```
This way we can simply run the command:
```shell
nx affected --targets=lint,test,build,e2e-ci
```
In CI, Nx Agents will allow all tasks to run in parallel on the same machine, except for the atomized end-to-end tasks, which will only run in isolation.
Learn more about how you can [Parallelize Tasks Across Multiple Machines Using Nx Agents](/ci/intro/tutorials/github-actions#parallelize-tasks-across-multiple-machines-using-nx-agents):
{% youtube
src="https://youtu.be/0YxcxIR7QU0"
title="Faster e2e Tests!"
width="100%" /%}
## Support For Incremental Builds For Vite
Nx now supports incremental builds with our [`vite` plugin](/nx-api/vite). Incremental builds in Nx workspaces allow you to build any package in your workspace individually, and will then automatically use that built artifact when then building any project or application that consumes the package. This way you can speed up your build and CI times through optimizations like [only building packages that were affected](/nx-api/nx/documents/affected), using [Nx Replay](/ci/features/remote-cache) to effortlessly cache and share your built artifacts, and allowing you to run builds of your various packages in parallel using [Nx Agents](/ci/features/distribute-task-execution).
Read more about [buildable libraries and incremental builds](/concepts/buildable-and-publishable-libraries).
## Project Crystal Conversion Generators
Since launching [Nx Project Crystal](/concepts/inferred-tasks) in Nx version 18, we've adjusted our generators to leverage these features when creating new workspaces and projects. We've now added the `convert-to-inferred` generator to give you an automated way to opt into project crystal.
To run the generator, you can run the command:
```shell
npx nx g convert-to-inferred
```
The important thing to note here is that while this generator will make adjustments to the `project.json` file of the projects you convert, the behavior of your tasks should remain the same. You can see project details via the [Nx Console](/getting-started/editor-setup) plugin of your IDE, or in a browser by running the command: `nx show project [projectName]`.
In Nx 19, we were focused on adding `convert-to-inferred` to our [Playwright](/nx-api/playwright), [Cypress](/nx-api/cypress), and [ESLint](/nx-api/eslint) plugins - where bringing the [Nx Atomizer](/ci/features/split-e2e-tasks) provided the greatest value. Since then, we've added this generator to most other plugins. Currently, our React native plugins (react native, expo, detox) are the only plugins that are outstanding, and we'll be providing `convert-to-inferred` generators here in the near future.
## Gradle Composite Builds Support
In [Nx 19.0](/blog/nx-19-release), we introduced support for Gradle through our [Gradle plugin](/nx-api/gradle). With the latest update, this plugin now also supports [Gradle Composite builds](https://docs.gradle.org/current/userguide/composite_builds.html), in addition to multi-project builds.
Gradle Composite builds are commonly used in larger workspaces to manage dependencies across multiple projects. With this new support, Nx can now leverage composite builds to enhance the Nx Task Graph. For example, consider the following `settings.gradle.kts` file:
```kotlin
rootProject.name = "app"
includeBuild("number-utils")
includeBuild("string-utils")
```
Nx will now be able to automatically determine the dependencies between the `app` project and the `number-utils` and `string-utils` workspaces:
![Gradle Composite Project Dep Graph](/blog/images/2024-08-01/gradle-composite-dep-graph.avif)
You can read more on composite builds in the [Gradle documentation](https://docs.gradle.org/current/userguide/composite_builds.html).
## Experimental: Gradle Test Atomization
The new [`@nx/gradle` plugin](/nx-api/gradle) now includes experimental support for [Test Atomization](/ci/features/split-e2e-tasks).
![Gradle Atomized](/blog/images/2024-08-01/gradle-atomized.avif)
With Test Atomization, as you add tests to your Gradle projects, Nx will automatically create a separate task for each test class. This allows you to distribute the execution of these tasks across multiple machines on CI, similar to the functionality provided by our `@nx/playwright` and `@nx/cypress` plugins.
## Experimental: Nx Release Adds File Based Versioning Support
Currently with [Nx release](/nx-api/nx/documents/release), you already have two different ways of figuring out the how to modify the current version of a package to get its updated version:
- Imperatively via the CLI/prompt by telling it your desired relative (semver keyword) or absolute (e.g. `1.2.3`) version.
- Declaratively by letting Nx inspect your git history and determine the semver bump to apply based on the conventional commits specification.
Nx release now supports an experimental third way of deriving the version bump that we call "version plans".
The idea behind version plans is that you want to track your intended version bumps alongside your changes, just like you would do with conventional commits, but you want to make this tracking independent from your actual commit data. This might be because you do not want to/cannot use the conventional commits standard in your workspace, or it could just be that you find it a cleaner approach to versioning.
Version plan files use frontmatter enhanced markdown for their contents, and can be created by hand or by leveraging the new `nx release plan` subcommand. This will guide you through creating a git-tracked file within `.nx/version-plans` that will be committed alongside your normal changes.
![Nx Release Plan Command](/blog/images/2024-08-01/nx-release-plan-command.avif)
When your team is ready to release, you can now simply run the CLI command `nx release` (or use the [powerful programmatic API](/features/manage-releases#using-the-programmatic-api-for-nx-release)) and nx will ingest all the outstanding version plan files and use the combined information to determine the resulting version for all referenced projects and/or release groups as part of the versioning, changelog generation, and publishing steps. (You can also run the command `nx release version` if all you want to do is update the version!)
![Nx Release With Plans](/blog/images/2024-08-01/nx-release-with-plans.avif)
Anyone who has used the tools "Changesets" or "Beachball" will be familiar with the concept of file based versioning, but with Nx release you get the power to combine one or more of the above mentioned versioning strategies all within the same workspace for different release groups, and we are really excited to keep building out this feature set and mark it as non-experimental (by fully documenting it) very soon. To learn more about the other features of [Nx Release in the meantime, check out our docs](/features/manage-releases).
## Support for React 19 (rc) and Angular 18.1
Nx 19.5 adds support for the React 19 release candidate and updated our Angular package to support the latest Angular minor version: 18.1.
When using our `@nx/angular` package, we'll automatically update you to the latest angular version when you run our migration. Using the `--interactive` flag you can choose to opt in or out of the latest Angular version:
```shell
nx migrate latest --interactive
✔ Do you want to update to TypeScript v5.5? (Y/n) · true
✔ Do you want to update the Angular version to v18.1? (Y/n) · true
Fetching @angular/core@18.1.2
NX The migrate command has run successfully.
```
Our `@nx/react` package will now create new React applications using version 18.3, and we now support the new experimental `reactCompiler`. Users can install the [`babel-plugin-react-compiler` package](https://www.npmjs.com/package/babel-plugin-react-compiler) and you can follow [this guide for how to enable it with Nx](/recipes/react/react-compiler#react-compiler-with-nx).
Note that due to the extent of breaking changes coming with React 19, we will not be providing a automated migration to React 19 via [`nx migrate`](/nx-api/nx/documents/migrate).
## Automatically Update Nx
As always - updating Nx and its plugins is easy as we ship an [automated migration command](/features/automate-updating-dependencies).
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Monorepo World Conference Speakers Announced!!
[![Monorepo World](/blog/images/2024-08-01/monorepo-world.avif)](https://monorepo.world)
The [Monorepo World conference](https://monorepo.world) is coming up soon on October 7, 2024 at the Computer History museum in Mountain View, California.
[Get your tickets now](https://ti.to/nx-conf/monorepoworld2024), consider [requesting access to the invite-only Enterprise Summit on October 8](https://ti.to/nx-conf/monorepoworld2024), and be sure to check out our [list of speakers](https://monorepo.world/#speakers-title) that was just published!
## 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)
- [Speed up your CI](https://nx.app/)
-6
View File
@@ -52,11 +52,5 @@
"image": "/blog/images/Jeff Cross.jpeg",
"twitter": "jeffbcross",
"github": "jeffbcross"
},
{
"name": "Philip Fulcher",
"image": "/blog/images/Philip Fulcher.jpeg",
"twitter": "philipjfulcher",
"github": "philipjfulcher"
}
]
Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

+6 -14
View File
@@ -1,26 +1,18 @@
# Nx 19.5 Adds StackBlitz, New Features, And More!!
[![Nx 19.5 Adds StackBlitz, New Features, And More!!](/blog/images/2024-08-01/nx-19-5-thumbnail.png)](/blog/nx-19-5-adds-stackblitz-new-features-and-more)
[![Nx 19.5 Adds StackBlitz, New Features, And More!!](/blog/images/2024-07-25/nx-19-5-thumbnail.png)](/blog/nx-19-5-adds-stackblitz-new-features-and-more)
Read the [blogpost](/blog/nx-19-5-adds-stackblitz-new-features-and-more) for full details.
## Features
{% cards cols="2" %}
{% card title="Announcing Nx Cloud Hobby Tier" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#announcing-nx-cloud-hobby-tier" /%}
{% card title="StackBlitz Support" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#stackblitz-support" /%}
{% card title="Bun and Pnpm v9 Support" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#bun-and-pnpm-v9-support" /%}
{% card title="Local Flaky Task Detection" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#local-flaky-task-detection" /%}
{% card title="Project Detail View Enhancements" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#project-detail-view-enhancements" /%}
{% card title="Pattern Support for `targetDefaults`" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#pattern-support-for-targetdefaults" /%}
{% card title="Individual Targets Can Now Opt Out of Parallelism" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#individual-targets-can-now-opt-out-of-parallelism" /%}
{% card title="Support For Incremental Builds For Vite" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#support-for-incremental-builds-for-vite" /%}
{% card title="Project Crystal Conversion Generators" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#project-crystal-conversion-generators" /%}
{% card title="Gradle Composite Builds Support" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#gradle-composite-builds-support" /%}
{% card title="Stackblitz Support" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#stackblitz-support" /%}
{% card title="NEW: Pattern Support for `targetDefaults`" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#new-pattern-support-for-targetdefaults" /%}
{% card title="NEW: Individual Targets Can Now Opt Out of Parallelism" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#new-individual-targets-can-now-opt-out-of-parallelism" /%}
{% card title="Experimental: Gradle Test Atomization" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#experimental-gradle-test-atomization" /%}
{% card title="Experimental: Nx Release Adds Version Plans Support" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#experimental-nx-release-adds-version-plans-support" /%}
{% card title="Support for React 19 (rc) and Angular 18.1" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#support-for-react-19-rc-and-angular-181" /%}
{% card title="Automatically Update Nx" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#automatically-update-nx" /%}
{% card title="Monorepo World Conference Speakers Announced!!" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#monorepo-world-conference-speakers-announced" /%}
{% card title="NEW: Nx Cloud Hobby Tier" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#new-nx-cloud-hobby-tier" /%}
{% card title="Monorepo World Conference Speakers to Be Announced Soon!!" type="document" url="/blog/nx-19-5-adds-stackblitz-new-features-and-more#monorepo-world-conference-speakers-to-be-announced-soon" /%}
{% /cards %}
@@ -28,7 +28,6 @@ Nx.json configuration
- [implicitDependencies](../../devkit/documents/NxJsonConfiguration#implicitdependencies): ImplicitDependencyEntry<T>
- [installation](../../devkit/documents/NxJsonConfiguration#installation): NxInstallationConfiguration
- [namedInputs](../../devkit/documents/NxJsonConfiguration#namedinputs): Object
- [neverConnectToCloud](../../devkit/documents/NxJsonConfiguration#neverconnecttocloud): boolean
- [nxCloudAccessToken](../../devkit/documents/NxJsonConfiguration#nxcloudaccesstoken): string
- [nxCloudEncryptionKey](../../devkit/documents/NxJsonConfiguration#nxcloudencryptionkey): string
- [nxCloudUrl](../../devkit/documents/NxJsonConfiguration#nxcloudurl): string
@@ -164,14 +163,6 @@ Named inputs targets can refer to reduce duplication
---
### neverConnectToCloud
`Optional` **neverConnectToCloud**: `boolean`
Set this to false to disable connection to Nx Cloud
---
### nxCloudAccessToken
`Optional` **nxCloudAccessToken**: `string`
-13
View File
@@ -26,7 +26,6 @@ use ProjectsConfigurations or NxJsonConfiguration
- [implicitDependencies](../../devkit/documents/Workspace#implicitdependencies): ImplicitDependencyEntry<string[] | "\*">
- [installation](../../devkit/documents/Workspace#installation): NxInstallationConfiguration
- [namedInputs](../../devkit/documents/Workspace#namedinputs): Object
- [neverConnectToCloud](../../devkit/documents/Workspace#neverconnecttocloud): boolean
- [nxCloudAccessToken](../../devkit/documents/Workspace#nxcloudaccesstoken): string
- [nxCloudEncryptionKey](../../devkit/documents/Workspace#nxcloudencryptionkey): string
- [nxCloudUrl](../../devkit/documents/Workspace#nxcloudurl): string
@@ -204,18 +203,6 @@ Named inputs targets can refer to reduce duplication
---
### neverConnectToCloud
`Optional` **neverConnectToCloud**: `boolean`
Set this to false to disable connection to Nx Cloud
#### Inherited from
[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[neverConnectToCloud](../../devkit/documents/NxJsonConfiguration#neverconnecttocloud)
---
### nxCloudAccessToken
`Optional` **nxCloudAccessToken**: `string`
+24 -24
View File
@@ -1922,14 +1922,6 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Customize Conventional Commit Types",
"path": "/recipes/nx-release/customize-conventional-commit-types",
"id": "customize-conventional-commit-types",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Configure Custom Registries",
"path": "/recipes/nx-release/configure-custom-registries",
@@ -1970,6 +1962,14 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Customize Conventional Commit Types",
"path": "/recipes/nx-release/customize-conventional-commit-types",
"id": "customize-conventional-commit-types",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Configure Changelog Format",
"path": "/recipes/nx-release/configure-changelog-format",
@@ -3625,14 +3625,6 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Customize Conventional Commit Types",
"path": "/recipes/nx-release/customize-conventional-commit-types",
"id": "customize-conventional-commit-types",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Configure Custom Registries",
"path": "/recipes/nx-release/configure-custom-registries",
@@ -3673,6 +3665,14 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Customize Conventional Commit Types",
"path": "/recipes/nx-release/customize-conventional-commit-types",
"id": "customize-conventional-commit-types",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Configure Changelog Format",
"path": "/recipes/nx-release/configure-changelog-format",
@@ -3716,14 +3716,6 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Customize Conventional Commit Types",
"path": "/recipes/nx-release/customize-conventional-commit-types",
"id": "customize-conventional-commit-types",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Configure Custom Registries",
"path": "/recipes/nx-release/configure-custom-registries",
@@ -3764,6 +3756,14 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Customize Conventional Commit Types",
"path": "/recipes/nx-release/customize-conventional-commit-types",
"id": "customize-conventional-commit-types",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Configure Changelog Format",
"path": "/recipes/nx-release/configure-changelog-format",
+33 -33
View File
@@ -2626,17 +2626,6 @@
"path": "/recipes/nx-release/automatically-version-with-conventional-commits",
"tags": ["nx-release"]
},
{
"id": "customize-conventional-commit-types",
"name": "Customize Conventional Commit Types",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/customize-conventional-commit-types",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/customize-conventional-commit-types",
"tags": ["nx-release"]
},
{
"id": "configure-custom-registries",
"name": "Configure Custom Registries",
@@ -2692,6 +2681,17 @@
"path": "/recipes/nx-release/update-local-registry-setup",
"tags": ["nx-release"]
},
{
"id": "customize-conventional-commit-types",
"name": "Customize Conventional Commit Types",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/customize-conventional-commit-types",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/customize-conventional-commit-types",
"tags": ["nx-release"]
},
{
"id": "configure-changelog-format",
"name": "Configure Changelog Format",
@@ -4961,17 +4961,6 @@
"path": "/recipes/nx-release/automatically-version-with-conventional-commits",
"tags": ["nx-release"]
},
{
"id": "customize-conventional-commit-types",
"name": "Customize Conventional Commit Types",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/customize-conventional-commit-types",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/customize-conventional-commit-types",
"tags": ["nx-release"]
},
{
"id": "configure-custom-registries",
"name": "Configure Custom Registries",
@@ -5027,6 +5016,17 @@
"path": "/recipes/nx-release/update-local-registry-setup",
"tags": ["nx-release"]
},
{
"id": "customize-conventional-commit-types",
"name": "Customize Conventional Commit Types",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/customize-conventional-commit-types",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/customize-conventional-commit-types",
"tags": ["nx-release"]
},
{
"id": "configure-changelog-format",
"name": "Configure Changelog Format",
@@ -5087,17 +5087,6 @@
"path": "/recipes/nx-release/automatically-version-with-conventional-commits",
"tags": ["nx-release"]
},
"/recipes/nx-release/customize-conventional-commit-types": {
"id": "customize-conventional-commit-types",
"name": "Customize Conventional Commit Types",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/customize-conventional-commit-types",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/customize-conventional-commit-types",
"tags": ["nx-release"]
},
"/recipes/nx-release/configure-custom-registries": {
"id": "configure-custom-registries",
"name": "Configure Custom Registries",
@@ -5153,6 +5142,17 @@
"path": "/recipes/nx-release/update-local-registry-setup",
"tags": ["nx-release"]
},
"/recipes/nx-release/customize-conventional-commit-types": {
"id": "customize-conventional-commit-types",
"name": "Customize Conventional Commit Types",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/customize-conventional-commit-types",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/customize-conventional-commit-types",
"tags": ["nx-release"]
},
"/recipes/nx-release/configure-changelog-format": {
"id": "configure-changelog-format",
"name": "Configure Changelog Format",
+21 -21
View File
@@ -123,21 +123,21 @@
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/run",
"file": "generated/packages/generated/packages/nx/documents/run",
"id": "run",
"name": "run",
"path": "/nx-api/nx/documents/run"
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/run-many",
"file": "generated/packages/generated/packages/nx/documents/run-many",
"id": "run-many",
"name": "run-many",
"path": "/nx-api/nx/documents/run-many"
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/affected",
"file": "generated/packages/generated/packages/nx/documents/affected",
"id": "affected",
"name": "affected",
"path": "/nx-api/nx/documents/affected"
@@ -230,14 +230,14 @@
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/connect-to-nx-cloud",
"file": "generated/packages/generated/packages/nx/documents/connect-to-nx-cloud",
"id": "connect-to-nx-cloud",
"name": "connect-to-nx-cloud",
"path": "/nx-api/nx/documents/connect-to-nx-cloud"
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/reset",
"file": "generated/packages/generated/packages/nx/documents/reset",
"id": "reset",
"name": "reset",
"path": "/nx-api/nx/documents/reset"
@@ -274,7 +274,7 @@
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/dep-graph",
"file": "generated/packages/generated/packages/nx/documents/dep-graph",
"id": "dep-graph",
"name": "graph",
"path": "/nx-api/nx/documents/dep-graph"
@@ -339,7 +339,7 @@
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/generate",
"file": "generated/packages/generated/packages/nx/documents/generate",
"id": "generate",
"name": "generate",
"path": "/nx-api/nx/documents/generate"
@@ -369,7 +369,7 @@
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/migrate",
"file": "generated/packages/generated/packages/nx/documents/migrate",
"id": "migrate",
"name": "migrate",
"path": "/nx-api/nx/documents/migrate"
@@ -441,14 +441,14 @@
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/format-check",
"file": "generated/packages/generated/packages/nx/documents/format-check",
"id": "format-check",
"name": "format:check",
"path": "/nx-api/nx/documents/format-check"
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/format-write",
"file": "generated/packages/generated/packages/nx/documents/format-write",
"id": "format-write",
"name": "format:write",
"path": "/nx-api/nx/documents/format-write"
@@ -483,13 +483,6 @@
"name": "Automatically Version with Conventional Commits",
"path": "/recipes/nx-release/automatically-version-with-conventional-commits"
},
{
"description": "",
"file": "shared/recipes/nx-release/customize-conventional-commit-types",
"id": "customize-conventional-commit-types",
"name": "Customize Conventional Commit Types",
"path": "/recipes/nx-release/customize-conventional-commit-types"
},
{
"description": "",
"file": "shared/recipes/nx-release/configure-custom-registries",
@@ -525,6 +518,13 @@
"name": "Update Your Local Registry Setup to use Nx Release",
"path": "/recipes/nx-release/update-local-registry-setup"
},
{
"description": "",
"file": "shared/recipes/nx-release/customize-conventional-commit-types",
"id": "customize-conventional-commit-types",
"name": "Customize Conventional Commit Types",
"path": "/recipes/nx-release/customize-conventional-commit-types"
},
{
"description": "",
"file": "shared/recipes/nx-release/configure-changelog-format",
@@ -541,7 +541,7 @@
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/release",
"file": "generated/packages/generated/packages/nx/documents/release",
"id": "release",
"name": "release",
"path": "/nx-api/nx/documents/release"
@@ -631,7 +631,7 @@
},
{
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
"file": "generated/packages/angular/documents/nx-devkit-angular-devkit",
"file": "generated/packages/generated/packages/angular/documents/nx-devkit-angular-devkit",
"id": "nx-devkit-angular-devkit",
"name": "Nx Devkit and Angular Devkit",
"path": "/nx-api/angular/documents/nx-devkit-angular-devkit"
@@ -783,7 +783,7 @@
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/watch",
"file": "generated/packages/generated/packages/nx/documents/watch",
"id": "watch",
"name": "watch",
"path": "/nx-api/nx/documents/watch"
@@ -1113,7 +1113,7 @@
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/connect-to-nx-cloud",
"file": "generated/packages/generated/packages/nx/documents/connect-to-nx-cloud",
"id": "connect-to-nx-cloud",
"name": "connect-to-nx-cloud",
"path": "/nx-api/nx/documents/connect-to-nx-cloud"
@@ -40,11 +40,6 @@
"x-completion-type": "directory",
"x-priority": "important"
},
"outputFileName": {
"type": "string",
"description": "The path to the main file relative to the outputPath",
"x-completion-type": "file"
},
"tsConfig": {
"type": "string",
"description": "The path to the Typescript configuration file.",
+6 -6
View File
@@ -998,12 +998,6 @@
"tags": ["nx-release"],
"file": "shared/recipes/nx-release/automatically-version-with-conventional-commits"
},
{
"name": "Customize Conventional Commit Types",
"id": "customize-conventional-commit-types",
"tags": ["nx-release"],
"file": "shared/recipes/nx-release/customize-conventional-commit-types"
},
{
"name": "Configure Custom Registries",
"id": "configure-custom-registries",
@@ -1034,6 +1028,12 @@
"tags": ["nx-release"],
"file": "shared/recipes/nx-release/update-local-registry-setup"
},
{
"name": "Customize Conventional Commit Types",
"id": "customize-conventional-commit-types",
"tags": ["nx-release"],
"file": "shared/recipes/nx-release/customize-conventional-commit-types"
},
{
"name": "Configure Changelog Format",
"id": "configure-changelog-format",
+5 -9
View File
@@ -32,10 +32,6 @@ jobs:
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
fetchDepth: 0
persistCredentials: true
- script: npm ci
- script: npx nx-cloud start-agent
@@ -45,7 +41,11 @@ jobs:
vmImage: 'ubuntu-latest'
steps:
# Get last successfull commit from Azure Devops CLI
- bash: |
- displayName: 'Get last successful commit SHA'
condition: ne(variables['Build.Reason'], 'PullRequest')
env:
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
bash: |
LAST_SHA=$(az pipelines build list --branch $(Build.SourceBranchName) --definition-ids $(System.DefinitionId) --result succeeded --top 1 --query "[0].triggerInfo.\"ci.sourceSha\"")
if [ -z "$LAST_SHA" ]
then
@@ -54,10 +54,6 @@ jobs:
echo "Last successful commit SHA: $LAST_SHA"
echo "##vso[task.setvariable variable=BASE_SHA]$LAST_SHA"
fi
displayName: 'Get last successful commit SHA'
condition: ne(variables['Build.Reason'], 'PullRequest')
env:
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
- script: git branch --track main origin/main
- script: npm ci
+9 -10
View File
@@ -4,26 +4,24 @@ Nx Cloud directly integrates with your existing CI setup.
![Nx Cloud Overview](/shared/images/nx-cloud/nx-cloud-overview.webp)
Here's how you get set up.
In a nutshell, here's how this works:
## Step 1: Connect your workspace to Nx Cloud
**Step 1: Connect your workspace to Nx Cloud**
To connect your workspace, **push it to GitHub** (or your respective source control provider) and then run:
This can be done by signing up on [nx.app](https://nx.app) and then connecting to your git repository.
```shell
npx nx connect
```
## Step 2: Configure your CI script
If you have CI set up already, configure [distribution with Nx Agents](/ci/features/distribute-task-execution) as follows:
**Step 2: Your CI script triggers Nx Cloud**
```yml
- name: Start CI run
run: 'npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js"'
```
Alternatively you can generate the CI configuration using:
Let us generate the workflow file for you, if you don't already have one.
```shell
npx nx g ci-workflow
@@ -31,15 +29,16 @@ npx nx g ci-workflow
Or, check out our [recipes for the various CI providers](/ci/recipes/set-up).
## Step 3: Run your Nx commands as usual
**Step 3: Run your Nx commands as usual**
```yml
- run: npx nx-cloud record -- node tools/custom-script.js
- run: npx nx affected -t lint test build e2e-ci
- run: npx nx affected -t lint test build
- run: npx nx affected -t e2e-ci --parallel 1
```
All these commands are automatically picked up by Nx Cloud, split up into smaller tasks and distributed across the specified number of machines. Nx Cloud works with Nx tasks automatically, or you can [record non-Nx commands with `nx-cloud record`](/ci/recipes/other/record-commands).
## Step 4: All results are played back automatically
**Step 4: All results are played back automatically**
Nx Cloud automatically plays back all results to your CI system, as if distribution never happened. You can continue doing post-processing on the results, like uploading test reports, deploying artifacts etc.
+7 -7
View File
@@ -59,7 +59,7 @@ The following resource classes are available:
- `docker_linux_arm64/extra_large`
- `windows/medium`
See their detailed description and pricing at [nx.dev/pricing](/pricing#plan-detail?sutm_source=nx.dev&utm_medium=launch-templates).
See their detailed description and pricing at [nx.app/pricing](https://nx.app/pricing#plan-detail?sutm_source=nx.dev&utm_medium=launch-templates).
### `launch-templates.<template-name>.image`
@@ -190,7 +190,7 @@ launch-templates:
inputs:
env: 'package-lock.json|yarn.lock|pnpm-lock.yaml'
paths: 'node_modules'
base_branch: 'main'
base-branch: 'main'
```
## Full Example
@@ -223,7 +223,7 @@ launch-templates:
inputs:
env: 'package-lock.json|yarn.lock|pnpm-lock.yaml'
paths: 'node_modules'
base_branch: 'main'
base-branch: 'main'
- name: Restore Browser Binary Cache
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
inputs:
@@ -231,7 +231,7 @@ launch-templates:
paths: |
'~/.cache/Cypress'
'~/.cache/ms-playwright'
base_branch: 'main'
base-branch: 'main'
- name: Install Node Modules
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml'
- name: Install Browsers (if needed)
@@ -274,7 +274,7 @@ launch-templates:
inputs:
env: 'package-lock.json|yarn.lock|pnpm-lock.yaml'
paths: 'node_modules'
base_branch: 'main'
base-branch: 'main'
- name: Restore Browser Binary Cache
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
inputs:
@@ -282,7 +282,7 @@ launch-templates:
paths: |
'~/.cache/Cypress'
'~/.cache/ms-playwright'
base_branch: 'main'
base-branch: 'main'
- name: Install Node Modules
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml'
- name: Install Browsers (if needed)
@@ -312,7 +312,7 @@ launch-templates:
inputs:
env: 'package-lock.json|yarn.lock|pnpm-lock.yaml'
paths: 'node_modules'
base_branch: 'main'
base-branch: 'main'
- name: Install Node Modules
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml'
- name: Install Rust
-4
View File
@@ -30,10 +30,6 @@ We now have full support for BitBucket Data Center (self-hosted):
- the CIPE visualisation has been updated (elapsed task time)
- general web app performance improvements
##### Breaking changes
If you are using DTE, you will now need to pass the `--distribute-on="manual"` flag to your `npx nx-cloud start-ci-run` commands.
### 2405.02.15
##### Easy membership management via GitHub
@@ -249,11 +249,10 @@ manually.
## What does `withModuleFederation` do?
In the previous section, we saw `withModuleFederation` used in the webpack config. This function is an abstraction on
top of `@module-federation/enhanced` with some Nx-specific behavior.
top of webpack's `ModuleFederationPlugin` with some Nx-specific behavior.
- All libraries (npm and workspace) are shared singletons by default, so you don't manually configure them.
- Remotes are referenced by name only, since Nx knows which ports each remote is running on (in development mode).
- Access to the latest features of Module Federation (such as RuntimePlugins). Learn more at [module-federation.io](https://module-federation.io).
With Nx, the developer experience (DX) when working with Module Federation matches more closely to development on a SPA.
You don't have to worry about managing a bunch of configuration, and most things just work out of the box.
@@ -2,15 +2,6 @@
Module Federation is a technique that allows developers to share code and resources across multiple applications. It has become more popular in recent years since the addition of the [ModuleFederationPlugin](https://webpack.js.org/plugins/module-federation-plugin/) in [Webpack](https://webpack.js.org).
{% callout type="note" title="Nx uses @module-federation/enhanced" %}
As of Nx 19.5, our Module Federation support is provided by the [@module-federation/enhanced](https://npmjs.com/@module-federation/enhanced) package.
This package is owned and maintained by [Zack Jackson](https://x.com/ScriptedAlchemy), the creator of Module Federation, and the [ByteDance](https://x.com/ByteDanceTalk) team.
Using this package for Nx's Module Federation support keeps our support aligned with the latest improvements, features and bug fixes for Module Federation.
You can learn more about Module Federation Enhanced on their [docs](https://module-federation.io/).
{% /callout %}
An increasing number of enterprise applications have started to adopt Module Federation to help them develop and scale their applications quickly, while reducing some overhead in sharing code between teams.
Nx added out-of-the-box support for Module Federation with Webpack to make it more approachable, less complex and leverage some unique benefits that can only be realised in a monorepo.
@@ -112,7 +112,6 @@ To achieve this, we can add an `inputs` and `outputs` definition globally for al
```
{% /tab %}
{% /tabs %}
Note, you only need to define output locations if they differ from the usual `dist` or `build` directory which Nx automatically recognizes.
@@ -5,7 +5,7 @@ Environment variables are useful to store system-wide values such as the directo
(PATH), OS version, Network Information, and custom variables. These env variables are passed at build time and used at
the runtime of an app.
## Set Environment Variables
## Setting environment variables
By default, Nx will load any environment variables you place in the following files:
@@ -53,30 +53,7 @@ We recommend nesting your **app** specific `env` files in `apps/your-app`, and c
for workspace-specific settings (like the [Nx Cloud token](/ci/recipes/security/access-tokens)).
{% /callout %}
### Environment Variables for Configurations
Nx will only load environment variable files for a particular configuration if that configuration is defined for a task, even if you specify that configuration name from the command line. So if there is no `development` configuration defined for the `app`'s `build` task, the following command will use `.env.build` instead of `.env.build.development`:
```shell
nx build app --development
```
In order to have Nx actually use the `.env.build.development` environment variables, the `development` configuration needs to be set for the task (even if it is empty).
```jsonc {% fileName="apps/app/project.json" highlightLines=["5-7"] %}
{
"targets": {
"build": {
// ...
"configurations": {
"development": {}
}
}
}
}
```
### Point to Custom Env Files
### Pointing to custom env files
If you want to load variables from `env` files other than the ones listed above:
@@ -84,7 +61,7 @@ If you want to load variables from `env` files other than the ones listed above:
2. Use [dotenvx](https://github.com/dotenvx/dotenvx): `dotenvx run --env-file=.qa.env -- nx serve`
3. Use the `envFile` option of the [run-commands](/nx-api/nx/executors/run-commands#envfile) builder and execute your command inside of the builder
### Ad-hoc Variables
### Ad-hoc variables
You can also define environment variables in an ad-hoc manner using support from your OS and shell.
-2
View File
@@ -28,8 +28,6 @@ jobs:
steps:
- checkout: self
fetchDepth: 0
persistCredentials: true
# Set Azure Devops CLI default settings
- bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject)
displayName: 'Set default Azure DevOps organization and project'
@@ -2,19 +2,6 @@
Nx Release can automate the creation of [GitHub releases](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) for you. GitHub releases are a great way to communicate the changes in your projects to your users.
<!-- Prettier will mess up the end tag of the callout causing it to capture all content that follows it -->
<!-- prettier-ignore-start -->
{% callout type="note" title="Authenticating with GitHub" %}
In order to be able to create the release on GitHub, you need to provide a valid token which can be used for authenticating with the GitHub API.
Nx release supports two main ways of doing this:
1. In all environments it will preferentially check for an environment variable (the environment variable can either be called `GITHUB_TOKEN` or `GH_TOKEN`). Please ensure that this environment variable is set in your CI environment (and that the token it has been set to has been configured with the appropriate permissions to create releases) before attempting to create a release in CI.
2. It can also detect if you have a valid, authenticated installation of the official `gh` CLI tool (https://cli.github.com/) and leverage that automatically as a fallback when no environment variable is set.
{% /callout %}
<!-- prettier-ignore-end -->
## GitHub Release Contents
When a GitHub release is created, it will include the changelog that Nx Release generates with entries based on the changes since the last release. Nx Release will parse the `feat` and `fix` type commits according to the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification and sort them into appropriate sections of the changelog. Take a look at the [Nx releases page](https://github.com/nrwl/nx/releases) to see examples of GitHub releases generated by Nx Release.
@@ -1,150 +1,112 @@
# Customize Conventional Commit Types
[Nx release](/features/manage-releases) allows you to leverage the [conventional commits](/recipes/nx-release/automatically-version-with-conventional-commits) standard to automatically determine the next version increment.
Nx Release can defer to the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard to automatically determine the next version to release. To enable this behavior for versioning, see [Automatically Version with Conventional Commits](/recipes/nx-release/automatically-version-with-conventional-commits).
By default, this results in:
This recipe will cover how to customize the types of commits that trigger version bumps, how to customize the version bump for each type, and how to customize the changelog entry for each commit type.
- `feat(...)` triggering a minor version bump (`1.?.0`)
- `fix(...)` triggering a patch version bump (`1.?.x`)
- `BREAKING CHANGE` in the footer of the commit message or with an exclamation mark after the commit type (`fix(...)!`) triggers a major version bump (`?.0.0`)
## Conventional Commits Usage within Nx Release
The conventional commits configuration is used in two different places within Nx Release - once in the version step for determining the version bump, and once when generating changelogs.
### Determine the Version Bump
When `release.version.conventionalCommits` is `true` in `nx.json`, Nx Release will use the commit messages since the last release to determine the version bump. It will look at the type of each commit and determine the highest version bump from the following list:
- 'feat' -> minor
- 'fix' -> patch
For example, if the git history looks like this:
```
- fix(pkg-1): fix something
- feat(pkg-2): add a new feature
- chore(pkg-3): update docs
- chore(release): 1.0.0
```
then Nx Release will select the `minor` version bump and elect to release version 1.1.0. This is because there is a `feat` commit since the last release of 1.0.0. To customize the version bump for different types of commits, or to trigger a version bump with custom commit types, see the [Configure Commit Types](#configure-commit-types) section below.
{% callout type="info" title="No changes detected" %}
If Nx Release does not find any relevant commits since the last release, it will skip releasing a new version. This works with [independent releases](/recipes/nx-release/release-projects-independently) as well, allowing for only some projects to be released while others are skipped.
If Nx Release does not find any relevant commits since the last release, it will skip releasing a new version. This works with [independent releases](/recipes/nx-release/release-projects-independently) as well, allowing for only some projects to be released and some to be skipped.
{% /callout %}
However, you can customize how Nx interprets these conventional commits, for both **versioning** and **changelog** generation.
#### Breaking Changes and Major Version Bumps
## Disable a Commit Type for Versioning and Changelog Generation
Major version bumps are triggered by the presence of a `BREAKING CHANGE` in the footer of the commit message or with '!' after the commit type and scope, as specified by the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard. This is regardless of the type or scope of the commit. For example:
To disable a commit type, set it to `false`.
```
fix: remove deprecated config properties
```json {% fileName="nx.json" %}
{
"release": {
"conventionalCommits": {
"types": {
// disable the docs type for versioning and in the changelog
"docs": false,
...
}
}
}
}
BREAKING CHANGE: `settings` and `overrides` keys in config are no longer supported
```
If you just want to disable a commit type for versioning, but still want it to appear in the changelog, set `semverBump` to `none`.
```json {% fileName="nx.json" %}
{
"release": {
"conventionalCommits": {
"types": {
// disable the docs type for versioning, but still include it in the changelog
"docs": {
"semverBump": "none",
...
},
...
}
}
}
}
```
fix!: do not trigger a workflow when user submits bad data
```
## Changing the Type of Semver Version Bump
```
feat(pkg-2)!: redirect users to the new workflow page
```
Assume you'd like `docs(...)` commit types to cause a `patch` version bump. You can define that as follows:
When Nx Release detects a breaking change, it will bump the major version, regardless of the other commits present in the history. Breaking changes will also appear in their own section of the changelog.
### Generate Changelog Sections
Nx Release will sort changes within changelogs into sections based on the type of commit. By default, `fix`, `feat`, and `perf` commits will be included in the changelog. To customize the headers of changelog sections, include other commit types, or exclude the default commit types, see the [Configure Commit Types](#configure-commit-types) section below.
See the [Nx repo](https://github.com/nrwl/nx/releases) for an example of a changelogs generated with Nx Release.
## Configure Commit Types
Commit types are configured in the `release.conventionalCommits.types` property in `nx.json`:
```json {% fileName="nx.json" %}
{
"release": {
"conventionalCommits": {
"types": {
// disable the fix type for versioning and in the changelog
"fix": false,
"docs": {
"semverBump": "patch",
...
},
}
}
}
}
```
## Renaming the Changelog Section for a Commit Type
To rename the changelog section for a commit type, set the `title` property.
```json {% fileName="nx.json" %}
{
"release": {
"conventionalCommits": {
"types": {
...
"docs": {
...
"changelog": {
"hidden": false,
"title": "Documentation Changes"
}
},
...
}
}
}
}
```
## Hiding a Commit Type from the Changelog
To hide a commit type from the changelog, set `changelog` to `false`.
```json {% fileName="nx.json" %}
{
"release": {
"conventionalCommits": {
"types": {
...
"chore": {
"changelog": false
},
...
}
}
}
}
```
Alternatively, you can set `hidden` to `true` to achieve the same result.
```json {% fileName="nx.json" %}
{
"release": {
"conventionalCommits": {
"types": {
...
"chore": {
"perf": {
"semverBump": "none",
// omitting "hidden" will default it to false
"changelog": {
"hidden": true
"title": "Performance Improvements"
}
},
...
"deps": {
"semverBump": "minor",
// omitting "hidden" will default it to false
"changelog": {
"title": "Dependency Updates"
}
},
// unspecified semverBump will default to "patch"
"chore": {
// "changelog.hidden" defaults to true, but setting changelog: false
// is a shortcut for setting "changelog.hidden" to false.
"changelog": false
},
// unspecified semverBump will default to "patch"
"styles": {}
}
}
}
}
```
## Defining non-standard Commit Types
In this example, the following types are configured:
If you want to use custom, non-standard conventional commit types, you can define them in the `types` object. If you don't specify a `semverBump`, Nx will default to `patch`.
```json {% fileName="nx.json" %}
{
"release": {
"conventionalCommits": {
"types": {
"awesome": {}
}
}
}
}
```
- The `fix` type has been fully disabled, so `fix` commits will not trigger a version bump and will not be included in the changelog.
- The `docs` type will trigger a `patch` version bump and will have the "Documentation Changes" title in the changelog.
- The `perf` type will NOT trigger a version bump and will have the "Performance Improvements" title in the changelog.
- The `deps` type will trigger a `minor` version bump and will have the "Dependency Updates" title in the changelog.
- The `chore` type will trigger a `patch` version bump, which is the default for if `versionBump` is not specified, and will not be included in the changelog.
- The `styles` type will trigger a `patch` version bump, which is the default for if `versionBump` is not specified, and will be included in the changelog with the corresponding default title.
@@ -270,8 +270,6 @@ For this same example, if you want the commit message to be 'chore(release): 1.2
}
```
When using release groups in which the member projects are versioned together, you can also leverage `{releaseGroupName}` and it will be interpolated appropriately in the commit/tag that gets created for that release group.
## Future Releases
After the first release, the `--first-release` option will no longer be required. Nx Release will expect to find git tags and changelog files for each package. It will also use `npm view` to look up the current version of packages before publishing, ensuring that the package has not already been published and therefore avoid any conflict errors, meaning you can run the same publish action multiple times without any negative side-effects.
@@ -209,8 +209,6 @@ For this same example, if you want the commit message to be 'chore(release): 1.2
}
```
When using release groups in which the member projects are versioned together, you can also leverage `{releaseGroupName}` and it will be interpolated appropriately in the commit/tag that gets created for that release group.
## Future Releases
After the first release, the `--first-release` option will no longer be required. Nx Release will expect to find git tags and changelog files for each package.
@@ -31,7 +31,6 @@ The following environment variables are ones that you can set to change the beha
| NX_MIGRATE_CLI_VERSION | string | The version of Nx to use for running the `nx migrate` command. If not set, it defaults to `latest`. |
| NX_LOAD_DOT_ENV_FILES | boolean | If set to 'false', Nx will not load any environment files (e.g. `.local.env`, `.env.local`) |
| NX_NATIVE_FILE_CACHE_DIRECTORY | string | The cache for native `.node` files is stored under a global temp directory by default. Set this variable to use a different directory. This is interpreted as an absolute path. |
| NX_PLUGIN_NO_TIMEOUTS | boolean | If set to `true`, plugin operations will not timeout |
Nx will set the following environment variables so they can be accessible within the process even outside of executors and generators.
+1 -23
View File
@@ -132,8 +132,6 @@ Target defaults provide ways to set common options for a particular target in yo
- `` `${executor}` ``
- `` `${targetName}` `` (if the configuration specifies the executor, this needs to match the target's executor as well)
Additionally, if there is not a match for either of the above, we look for other keys that may match the target name via a glob pattern. For example, a key in the target defaults that looks like `e2e-ci--**/*` would match all of the targets created by a task atomizer plugin.
Target defaults matching the executor takes precedence over those matching the target name. If we find a target default for a given target, we use it as the base for that target's configuration.
{% callout type="warning" title="Beware" %}
@@ -309,26 +307,6 @@ If multiple targets with the same name run different commands (or use different
For more details on how to pass args to the underlying command see the [Pass Args to Commands recipe](/recipes/running-tasks/pass-args-to-commands).
### Task Atomizer Configuration
Task Atomizer plugins create several targets with a similar pattern. For example, the `@nx/cypress` plugin creates a top level `e2e-ci` target and a target for each test file that looks like `e2e-ci--test/my/test.spec.ts`. To avoid having to write a target default for each of these targets, you can use a glob pattern in the target default key.
```json {% fileName="nx.json" %}
{
"targetDefaults": {
"e2e-ci--**/*": {
"options": {
"headless": true
}
}
}
}
```
{% callout type="info" title="Pattern Matching" %}
Nx uses glob patterns for matching against the target name. This means that the `**/*` pattern above is required because the target name contains a `/`. If your target name does not contain a `/`, you can use a simpler pattern like `e2e-ci-*`.
{% /callout %}
## Release
The `release` property in `nx.json` configures the `nx release` command. It is an optional property, as `nx release` is capable of working with zero config, but when present it is used to configure the versioning, changelog, and publishing phases of the release process.
@@ -369,7 +347,7 @@ The `projectsRelationship` property tells Nx whether to release projects indepen
Optionally override the git/release tag pattern to use. This field is the source of truth for changelog generation and release tagging, as well as for conventional commits parsing.
It supports interpolating the version as `{version}` and (if releasing independently or forcing project level version control system releases) the project name as `{projectName}` within the string. When using release groups in which the member projects are versioned together, you can also leverage `{releaseGroupName}` and it will be interpolated appropriately in the commit/tag that gets created for that release group.
It supports interpolating the version as `{version}` and (if releasing independently or forcing project level version control system releases) the project name as `{projectName}` within the string.
The default `"releaseTagPattern"` for fixed/unified releases is: `v{version}`
+1 -53
View File
@@ -440,27 +440,6 @@ You can also express task dependencies with an object syntax:
{% /tab %}
{% /tabs %}
Starting from v19.5.0, wildcards can be used to define dependencies in the `dependsOn` field.
```json
{
"targets": {
"test": {
"dependsOn": [
{
"target": "build", // target name
"params": "ignore" // "forward" or "ignore", defaults to "ignore"
},
"build-*", // support for using wildcards in dependsOn, matches: "build-css", "build-js" targets of current project
"^build-*", // matches tasks: "build-css", "build-js" targets of dependencies
"*build-*", // matches tasks: "build-css", "build-js" as well as "task-with-build-in-middle" targets of current project
"^*build-*" // matches tasks: "build-css", "build-js" as well as "task-with-build-in-middle" targets of dependencies
]
}
}
}
```
#### Examples
You can write the shorthand configuration above in the object syntax like this:
@@ -650,23 +629,6 @@ In the case of an explicit target using an executor, you can specify the executo
}
```
### Target Metadata
You can add additional metadata to be attached to a target. For example, you can provide a description stating what the
target does:
```jsonc {% fileName="project.json" %}
{
"targets": {
"build": {
"metadata": {
"description": "Build the application for production"
}
}
}
}
```
## Project Metadata
The following properties describe the project as a whole.
@@ -786,21 +748,7 @@ An implicit dependency could also be a glob pattern:
{% /tab %}
{% /tabs %}
### Metadata
You can add additional metadata to be attached to the project. For example, you can provide a description for your
project:
```jsonc {% fileName="project.json" %}
{
"name": "admin",
"metadata": {
"description": "This is the admin application"
}
}
```
## Including package.json files as projects in the graph
### Including package.json files as projects in the graph
Any `package.json` file that is referenced by the `workspaces` property in the root `package.json` file will be included as a project in the graph. If you are using Lerna, projects defined in `lerna.json` will be included. If you are using pnpm, projects defined in `pnpm-workspace.yml` will be included.
+1 -1
View File
@@ -157,12 +157,12 @@
- [Get Started with Nx Release](/recipes/nx-release/get-started-with-nx-release)
- [Release Projects Independently](/recipes/nx-release/release-projects-independently)
- [Automatically Version with Conventional Commits](/recipes/nx-release/automatically-version-with-conventional-commits)
- [Customize Conventional Commit Types](/recipes/nx-release/customize-conventional-commit-types)
- [Configure Custom Registries](/recipes/nx-release/configure-custom-registries)
- [Publish in CI/CD](/recipes/nx-release/publish-in-ci-cd)
- [Automate GitHub Releases](/recipes/nx-release/automate-github-releases)
- [Publish Rust Crates](/recipes/nx-release/publish-rust-crates)
- [Update Your Local Registry Setup to use Nx Release](/recipes/nx-release/update-local-registry-setup)
- [Customize Conventional Commit Types](/recipes/nx-release/customize-conventional-commit-types)
- [Configure Changelog Format](/recipes/nx-release/configure-changelog-format)
- [Publish a Custom Dist Directory](/recipes/nx-release/publish-custom-dist-directory)
- [Other](/recipes/other)
+2 -2
View File
@@ -363,12 +363,12 @@ After this first release, you can remove the `--first-release` flag and just run
## Fast CI ⚡ {% highlightColor="green" %}
{% video-link link="https://youtu.be/ZA9K4iT3ANc?t=821" /%}
{% callout type="check" title="Forked repository with Nx" %}
Make sure you have completed the previous sections of this tutorial before starting this one. If you want a clean starting point, you can fork the [sample repository with Nx already added](https://github.com/nrwl/nx-recipes/tree/main/npm-workspaces).
{% /callout %}
{% video-link link="https://youtu.be/ZA9K4iT3ANc?t=821" /%}
So far in this tutorial you've seen how Nx improves the local development experience, but the biggest difference Nx makes is in CI. As repositories get bigger, making sure that the CI is fast, reliable and maintainable can get very challenging. Nx provides a solution.
- Nx reduces wasted time in CI with the [`affected` command](/ci/features/affected).
@@ -39,15 +39,7 @@ describe('Lerna Smoke Tests', () => {
// If this snapshot fails it means that nx repair generators are making assumptions which don't hold true for lerna workspaces
it('should complete successfully on a new lerna workspace', async () => {
let result = runLernaCLI(`repair`);
result = result
.replace(/.*\/node_modules\/.*\n/, '') // yarn adds "$ /node_modules/.bin/lerna repair" to the output
.replace(
/Running the following migrations:\n(?:.*\n)*---------------------------------------------------------\n\n/,
''
) // sorted list of all migrations to be run
.replace(/Running migration.*\n/g, '') // start of individual migration run
.replace(/Ran .* from .*\n .*\n\n/g, '') // end of individual migration run
.replace(/No changes were made\n\n/g, ''); // no changes during individual migration run
result = result.replace(/.*\/node_modules\/.*\n/, ''); // yarn adds "$ /node_modules/.bin/lerna repair" to the output
expect(result).toMatchInlineSnapshot(`
Lerna No changes were necessary. This workspace is up to date!
@@ -1,29 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Node Applications should generate a nest application with docker 1`] = `
"# This file is generated by Nx.
#
# Build the docker image with \`npx nx docker-build node-nest-docker-test\`.
# Tip: Modify "docker-build" options in project.json to change docker build args.
#
# Run the container with \`docker run -p 3000:3000 -t node-nest-docker-test\`.
FROM docker.io/node:lts-alpine
ENV HOST=0.0.0.0
ENV PORT=3000
WORKDIR /app
RUN addgroup --system node-nest-docker-test && \\
adduser --system -G node-nest-docker-test node-nest-docker-test
COPY dist/node-nest-docker-test node-nest-docker-test/
RUN chown -R node-nest-docker-test:node-nest-docker-test .
# You can remove this install step if you build with \`--bundle\` option.
# The bundled output will include external dependencies.
RUN npm --prefix node-nest-docker-test --omit=dev -f install
CMD [ "node", "node-nest-docker-test" ]
"
`;
+2 -15
View File
@@ -23,7 +23,7 @@ import {
updateFile,
updateJson,
} from '@nx/e2e/utils';
import { execSync } from 'child_process';
import { exec, execSync } from 'child_process';
import * as http from 'http';
import { getLockFileName } from '@nx/js';
import { satisfies } from 'semver';
@@ -58,7 +58,7 @@ describe('Node Applications', () => {
beforeAll(() => {
originalEnvPort = process.env.PORT;
newProject({
packages: ['@nx/node', '@nx/express', '@nx/nest', '@nx/webpack'],
packages: ['@nx/node', '@nx/express', '@nx/nest'],
});
});
@@ -340,19 +340,6 @@ module.exports = {
await promisifiedTreeKill(p.pid, 'SIGKILL');
}, 120000);
it('should generate a nest application with docker', async () => {
const nestapp = 'node-nest-docker-test';
runCLI(
`generate @nx/node:app ${nestapp} --project-name-and-root-format=as-provided --bundler=webpack --framework=nest --docker`
);
checkFilesExist(`${nestapp}/Dockerfile`);
const dockerFile = readFile(`${nestapp}/Dockerfile`);
expect(dockerFile).toMatchSnapshot();
});
// TODO(crystal, @ndcunningham): how do we handle this now?
// Revisit when NxWebpackPlugin({}) outputFilename is working.
xit('should be able to run ESM applications', async () => {
@@ -191,8 +191,7 @@ describe('@nx/react-native (legacy)', () => {
);
});
// TODO(@xiongemi): Look into this test failing on macos
xit('should upgrade native for application', async () => {
it('should upgrade native for application', async () => {
expect(() => runCLI(`upgrade ${appName}`)).not.toThrow();
});
+10 -12
View File
@@ -68,8 +68,6 @@ describe('React Applications', () => {
const libName = uniq('lib');
const libWithNoComponents = uniq('lib');
const logoSvg = readFileSync(join(__dirname, 'logo.svg')).toString();
const blueSvg = `<?xml version="1.0"?><svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" viewBox="0 0 30 30"><rect x="10" y="10" width="10" height="10" fill="blue"/></svg>`;
const redSvg = `<?xml version="1.0"?><svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" viewBox="0 0 30 30"><rect x="10" y="10" width="10" height="10" fill="red"/></svg>`;
runCLI(
`generate @nx/react:app ${appName} --style=css --bundler=webpack --no-interactive --skipFormat`
@@ -94,15 +92,11 @@ describe('React Applications', () => {
`
);
updateFile(`apps/${appName}/src/app/blue/img.svg`, blueSvg); // ensure that same filenames do not conflict
updateFile(`apps/${appName}/src/app/red/img.svg`, redSvg); // ensure that same filenames do not conflict
updateFile(`apps/${appName}/src/app/logo.svg`, logoSvg);
updateFile(
`apps/${appName}/src/app/app.tsx`,
`
import { ReactComponent as Logo } from './logo.svg';
import blue from './blue/img.svg';
import red from './red/img.svg';
import logo from './logo.svg';
import NxWelcome from './nx-welcome';
@@ -111,8 +105,6 @@ describe('React Applications', () => {
<>
<Logo />
<img src={logo} alt="" />
<img src={blue} alt="" />
<img src={red} alt="" />
<NxWelcome title="${appName}" />
</>
);
@@ -142,7 +134,10 @@ describe('React Applications', () => {
checkSourceMap: true,
checkStyles: true,
checkLinter: true,
// TODO(jack): check why Playwright tests are timing out in CI
// TODO(caleb): Fix cypress tests
// /tmp/nx-e2e--1970-rQ4U0qBe6Nht/nx/proj1614306/dist/apps/app5172641/server/runtime.js:119
// if (typeof import.meta.url === "string") scriptUrl = import.meta.url
// SyntaxError: Cannot use 'import.meta' outside a module
checkE2E: false,
});
@@ -155,10 +150,13 @@ describe('React Applications', () => {
checkSourceMap: false,
checkStyles: false,
checkLinter: false,
// TODO(jack): check why Playwright tests are timing out in CI
// TODO(caleb): Fix cypress tests
// /tmp/nx-e2e--1970-rQ4U0qBe6Nht/nx/proj1614306/dist/apps/app5172641/server/runtime.js:119
// if (typeof import.meta.url === "string") scriptUrl = import.meta.url
// SyntaxError: Cannot use 'import.meta' outside a module
checkE2E: false,
});
}, 500_000);
}, 500000);
it('should generate app with routing', async () => {
const appName = uniq('app');
@@ -534,7 +532,7 @@ async function testGeneratedApp(
if (opts.checkE2E && runE2ETests()) {
const e2eResults = runCLI(`e2e ${appName}-e2e`);
expect(e2eResults).toContain('Successfully ran target e2e');
expect(e2eResults).toContain('All specs passed!');
expect(await killPorts()).toBeTruthy();
}
}
-4
View File
@@ -44,7 +44,6 @@ describe('Rollup Plugin', () => {
module: './index.esm.js',
import: './index.cjs.mjs',
default: './index.cjs.js',
types: './index.esm.d.ts',
},
'./package.json': './package.json',
});
@@ -112,19 +111,16 @@ describe('Rollup Plugin', () => {
module: './index.esm.js',
import: './index.cjs.mjs',
default: './index.cjs.js',
types: './index.esm.d.ts',
},
'./bar': {
module: './bar.esm.js',
import: './bar.cjs.mjs',
default: './bar.cjs.js',
types: './bar.esm.d.ts',
},
'./foo': {
module: './foo.esm.js',
import: './foo.cjs.mjs',
default: './foo.cjs.js',
types: './foo.esm.d.ts',
},
});
});
-4
View File
@@ -47,7 +47,6 @@ describe('Rollup Plugin', () => {
module: './index.esm.js',
import: './index.cjs.mjs',
default: './index.cjs.js',
types: './index.esm.d.ts',
},
'./package.json': './package.json',
});
@@ -143,19 +142,16 @@ describe('Rollup Plugin', () => {
module: './index.esm.js',
import: './index.cjs.mjs',
default: './index.cjs.js',
types: './index.esm.d.ts',
},
'./bar': {
module: './bar.esm.js',
import: './bar.cjs.mjs',
default: './bar.cjs.js',
types: './bar.esm.d.ts',
},
'./foo': {
module: './foo.esm.js',
import: './foo.cjs.mjs',
default: './foo.cjs.js',
types: './foo.esm.d.ts',
},
});
});
+2 -6
View File
@@ -650,12 +650,8 @@ export function createNonNxProjectDirectory(
);
}
export function uniq(prefix: string): string {
// We need to ensure that the length of the random section of the name is of consistent length to avoid flakiness in tests
const randomSevenDigitNumber = Math.floor(Math.random() * 10000000)
.toString()
.padStart(7, '0');
return `${prefix}${randomSevenDigitNumber}`;
export function uniq(prefix: string) {
return `${prefix}${Math.floor(Math.random() * 10000000)}`;
}
// Useful in order to cleanup space during CI to prevent `No space left on device` exceptions
+5 -11
View File
@@ -5,7 +5,6 @@ import {
createFile,
isNotWindows,
killPorts,
listFiles,
newProject,
readFile,
runCLI,
@@ -80,27 +79,22 @@ describe('Web Components Applications', () => {
'none'
);
runCLI(`build ${appName}`);
const images = listFiles(`dist/apps/${appName}`).filter((f) =>
f.endsWith('.png')
);
checkFilesExist(
`dist/apps/${appName}/index.html`,
`dist/apps/${appName}/runtime.js`,
`dist/apps/${appName}/emitted.png`,
`dist/apps/${appName}/main.js`,
`dist/apps/${appName}/styles.css`
);
expect(images.some((f) => f.startsWith('emitted.'))).toBe(true);
expect(images.some((f) => f.startsWith('inlined.'))).toBe(false);
checkFilesDoNotExist(`dist/apps/${appName}/inlined.png`);
expect(readFile(`dist/apps/${appName}/main.js`)).toContain(
'data:image/png;base64'
);
// Should not be a JS module but kept as a PNG
expect(
readFile(
`dist/apps/${appName}/${images.find((f) => f.startsWith('emitted.'))}`
)
).not.toContain('export default');
expect(readFile(`dist/apps/${appName}/emitted.png`)).not.toContain(
'export default'
);
expect(readFile(`dist/apps/${appName}/index.html`)).toContain(
'<link rel="stylesheet" href="styles.css">'
-36
View File
@@ -336,42 +336,6 @@ describe('Webpack Plugin', () => {
`Successfully ran target build for project ${appName} and 1 task it depends on`
);
});
it('should be able to support webpack config with nx enhanced and babel', () => {
const appName = uniq('app');
runCLI(
`generate @nx/web:app ${appName} --bundler=webpack --compiler=babel`
);
updateFile(
`apps/${appName}/webpack.config.js`,
`
const { composePlugins, withNx } = require('@nx/webpack');
const { withReact } = require('@nx/react');
const { join } = require('path');
const pluginOption = {
index: 'apps/${appName}/src/index.html',
main: 'apps/${appName}/src/main.ts',
tsConfig: 'apps/${appName}/tsconfig.app.json',
outputPath: 'dist/apps/${appName}',
}
// Nx composable plugins for webpack.
module.exports = composePlugins(
withNx(pluginOption),
withReact(pluginOption),
);`
);
const result = runCLI(`build ${appName}`);
expect(result).toContain(`nx run ${appName}:build`);
expect(result).toContain(
`Successfully ran target build for project ${appName}`
);
});
});
function readMainFile(dir: string): string {
@@ -106,6 +106,8 @@ const mockAppConfig: AppConfig = {
label: 'local',
projectGraphUrl: 'assets/project-graphs/e2e.json',
taskGraphUrl: 'assets/task-graphs/e2e.json',
taskInputsUrl: '',
sourceMapsUrl: '',
},
],
defaultWorkspaceId: 'local',
@@ -1,9 +1,8 @@
/* eslint-disable @nx/enforce-module-boundaries */
// nx-ignore-next-line
import { ProjectGraphClientResponse } from 'nx/src/command-line/graph/graph';
// nx-ignore-next-line
import { ProjectDetailsWrapper } from '@nx/graph/project-details';
/* eslint-enable @nx/enforce-module-boundaries */
import { ProjectDetailsWrapper } from '@nx/graph/project-details';
import { useFloating } from '@floating-ui/react';
import { XMarkIcon } from '@heroicons/react/24/outline';
import { useEffect, useState } from 'react';
+1 -1
View File
@@ -5,7 +5,7 @@ import type {
ProjectGraphClientResponse,
TaskGraphClientResponse,
} from 'nx/src/command-line/graph/graph';
import { AppConfig, ExternalApi } from '@nx/graph/shared';
import type { AppConfig, ExternalApi } from '@nx/graph/shared';
export declare global {
interface Window {
+12 -1
View File
@@ -1,5 +1,10 @@
const path = require('path');
// @ts-check
const path = require('node:path');
// Ignore these nx related dependencies since they are the installed versions not the ones in the workspace
// nx-ignore-next-line
const { workspaceRoot } = require('@nx/devkit');
// nx-ignore-next-line
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
@@ -7,6 +12,12 @@ module.exports = {
content: [
path.join(__dirname, 'src/**/*.{js,ts,jsx,tsx,html}'),
...createGlobPatternsForDependencies(__dirname),
// Resolve the classes used in @nx/graph components
// TODO: make a decision on whether this is really the best approach, or if precompiling and deduplicating the classes would be better
path.join(
workspaceRoot,
'node_modules/@nx/graph/**/*.{js,ts,jsx,tsx,html}'
),
],
darkMode: 'class', // or 'media' or 'class'
theme: {
-12
View File
@@ -1,12 +0,0 @@
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
],
"plugins": []
}
-18
View File
@@ -1,18 +0,0 @@
{
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
-7
View File
@@ -1,7 +0,0 @@
# project-details
This library was generated with [Nx](https://nx.dev).
## Running unit tests
Run `nx test project-details` to execute the unit tests via [Jest](https://jestjs.io).
-11
View File
@@ -1,11 +0,0 @@
/* eslint-disable */
export default {
testEnvironment: 'jsdom',
displayName: 'graph-project-details',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': 'babel-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/graph/project-details',
};
-8
View File
@@ -1,8 +0,0 @@
{
"name": "graph-project-details",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "graph/project-details/src",
"projectType": "library",
"tags": [],
"targets": {}
}
-3
View File
@@ -1,3 +0,0 @@
export * from './lib/project-details-wrapper';
export * from './lib/project-details-page';
export * from './lib/project-details-header';
@@ -1,25 +0,0 @@
import { Link } from 'react-router-dom';
import { useRouteConstructor } from '@nx/graph/shared';
import { ThemePanel } from '@nx/graph/ui-theme';
export function ProjectDetailsHeader() {
const routeConstructor = useRouteConstructor();
return (
<header className="mx-auto mb-8 flex w-full items-center justify-center border-b-2 border-slate-900/10 py-2 dark:border-slate-300/10">
<div className="flex max-w-6xl flex-grow items-center justify-between px-8 ">
<Link to={routeConstructor('/projects', false)}>
<svg
className="h-10 w-auto text-slate-900 dark:text-white"
viewBox="0 0 24 24"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
>
<title>Nx</title>
<path d="M11.987 14.138l-3.132 4.923-5.193-8.427-.012 8.822H0V4.544h3.691l5.247 8.833.005-3.998 3.044 4.759zm.601-5.761c.024-.048 0-3.784.008-3.833h-3.65c.002.059-.005 3.776-.003 3.833h3.645zm5.634 4.134a2.061 2.061 0 0 0-1.969 1.336 1.963 1.963 0 0 1 2.343-.739c.396.161.917.422 1.33.283a2.1 2.1 0 0 0-1.704-.88zm3.39 1.061c-.375-.13-.8-.277-1.109-.681-.06-.08-.116-.17-.176-.265a2.143 2.143 0 0 0-.533-.642c-.294-.216-.68-.322-1.18-.322a2.482 2.482 0 0 0-2.294 1.536 2.325 2.325 0 0 1 4.002.388.75.75 0 0 0 .836.334c.493-.105.46.36 1.203.518v-.133c-.003-.446-.246-.55-.75-.733zm2.024 1.266a.723.723 0 0 0 .347-.638c-.01-2.957-2.41-5.487-5.37-5.487a5.364 5.364 0 0 0-4.487 2.418c-.01-.026-1.522-2.39-1.538-2.418H8.943l3.463 5.423-3.379 5.32h3.54l1.54-2.366 1.568 2.366h3.541l-3.21-5.052a.7.7 0 0 1-.084-.32 2.69 2.69 0 0 1 2.69-2.691h.001c1.488 0 1.736.89 2.057 1.308.634.826 1.9.464 1.9 1.541a.707.707 0 0 0 1.066.596zm.35.133c-.173.372-.56.338-.755.639-.176.271.114.412.114.412s.337.156.538-.311c.104-.231.14-.488.103-.74z" />
</svg>
</Link>
<ThemePanel />
</div>
</header>
);
}
@@ -1,73 +0,0 @@
/* eslint-disable @nx/enforce-module-boundaries */
// nx-ignore-next-line
import { ProjectGraphProjectNode } from '@nx/devkit';
// nx-ignore-next-line
import { GraphError } from 'nx/src/command-line/graph/graph';
/* eslint-enable @nx/enforce-module-boundaries */
import {
ScrollRestoration,
useParams,
useRouteLoaderData,
} from 'react-router-dom';
import { ProjectDetailsWrapper } from './project-details-wrapper';
import {
ExpandedTargetsProvider,
fetchProjectGraph,
getProjectGraphDataService,
useEnvironmentConfig,
usePoll,
} from '@nx/graph/shared';
import { ProjectDetailsHeader } from './project-details-header';
export function ProjectDetailsPage() {
const { project, sourceMap, hash, errors, connectedToCloud } =
useRouteLoaderData('selectedProjectDetails') as {
hash: string;
project: ProjectGraphProjectNode;
sourceMap: Record<string, string[]>;
errors?: GraphError[];
connectedToCloud?: boolean;
};
const { environment, watch, appConfig } = useEnvironmentConfig();
const projectGraphDataService = getProjectGraphDataService();
const params = useParams();
usePoll(
async () => {
const data = await fetchProjectGraph(
projectGraphDataService,
params,
appConfig
);
if (data?.hash !== hash) {
window.location.reload();
}
},
1000,
watch
);
return (
<ExpandedTargetsProvider>
<div className="flex w-full flex-col justify-center text-slate-700 dark:text-slate-400">
<ScrollRestoration />
{environment !== 'nx-console' ? (
<ProjectDetailsHeader />
) : (
<div className="py-2"></div>
)}
<div className="mx-auto mb-8 w-full max-w-6xl flex-grow px-8">
<ProjectDetailsWrapper
project={project}
sourceMap={sourceMap}
errors={errors}
connectedToCloud={connectedToCloud}
></ProjectDetailsWrapper>
</div>
</div>
</ExpandedTargetsProvider>
);
}
@@ -1,181 +0,0 @@
/* eslint-disable @nx/enforce-module-boundaries */
// nx-ignore-next-line
import type { ProjectGraphProjectNode } from '@nx/devkit';
// nx-ignore-next-line
import { GraphError } from 'nx/src/command-line/graph/graph';
/* eslint-enable @nx/enforce-module-boundaries */
import { useNavigate, useNavigation, useSearchParams } from 'react-router-dom';
import {
ErrorToast,
ExpandedTargetsContext,
getExternalApiService,
useEnvironmentConfig,
useRouteConstructor,
} from '@nx/graph/shared';
import { Spinner } from '@nx/graph/ui-components';
import { ProjectDetails } from '@nx/graph/ui-project-details';
import { useCallback, useContext, useEffect } from 'react';
interface ProjectDetailsProps {
project: ProjectGraphProjectNode;
sourceMap: Record<string, string[]>;
errors?: GraphError[];
connectedToCloud?: boolean;
}
export function ProjectDetailsWrapper({
project,
sourceMap,
errors,
connectedToCloud,
}: ProjectDetailsProps) {
const environment = useEnvironmentConfig()?.environment;
const externalApiService = getExternalApiService();
const navigate = useNavigate();
const { state: navigationState, location } = useNavigation();
const routeConstructor = useRouteConstructor();
const [searchParams, setSearchParams] = useSearchParams();
const { expandedTargets, setExpandedTargets, collapseAllTargets } =
useContext(ExpandedTargetsContext);
const handleViewInProjectGraph = useCallback(
(data: { projectName: string }) => {
if (environment === 'nx-console') {
externalApiService.postEvent({
type: 'open-project-graph',
payload: {
projectName: data.projectName,
},
});
} else {
navigate(
routeConstructor(
`/projects/${encodeURIComponent(data.projectName)}`,
true,
['expanded'] // omit expanded targets from search params
)
);
}
},
[externalApiService, routeConstructor, navigate, environment]
);
const handleViewInTaskGraph = useCallback(
(data: { projectName: string; targetName: string }) => {
if (environment === 'nx-console') {
externalApiService.postEvent({
type: 'open-task-graph',
payload: {
projectName: data.projectName,
targetName: data.targetName,
},
});
} else {
navigate(
routeConstructor(
{
pathname: `/tasks/${encodeURIComponent(data.targetName)}`,
search: `?projects=${encodeURIComponent(data.projectName)}`,
},
true,
['expanded'] // omit expanded targets from search params
)
);
}
},
[externalApiService, routeConstructor, navigate, environment]
);
const handleRunTarget = useCallback(
(data: { projectName: string; targetName: string }) => {
externalApiService.postEvent({
type: 'run-task',
payload: { taskId: `${data.projectName}:${data.targetName}` },
});
},
[externalApiService]
);
const handleNxConnect = useCallback(
() =>
externalApiService.postEvent({
type: 'nx-connect',
}),
[externalApiService]
);
const updateSearchParams = (
params: URLSearchParams,
targetNames?: string[]
) => {
if (!targetNames || targetNames.length === 0) {
params.delete('expanded');
} else {
params.set('expanded', targetNames.join(','));
}
};
useEffect(() => {
const expandedTargetsParams = searchParams.get('expanded')?.split(',');
if (
expandedTargetsParams &&
expandedTargetsParams.length > 0 &&
setExpandedTargets
) {
setExpandedTargets(expandedTargetsParams);
}
return () => {
if (collapseAllTargets) {
collapseAllTargets();
}
};
}, []); // only run on mount
useEffect(() => {
const expandedTargetsParams =
searchParams.get('expanded')?.split(',') || [];
if (expandedTargetsParams.join(',') === expandedTargets?.join(',')) {
return;
}
setSearchParams(
(currentSearchParams) => {
updateSearchParams(currentSearchParams, expandedTargets);
return currentSearchParams;
},
{ replace: true, preventScrollReset: true }
);
}, [expandedTargets, searchParams, setSearchParams]);
if (
navigationState === 'loading' &&
!location.pathname.includes('project-details') // do not show spinner when updating search params
) {
return (
<div className="flex justify-center">
<Spinner />
</div>
);
}
return (
<>
<ProjectDetails
project={project}
sourceMap={sourceMap}
onViewInProjectGraph={handleViewInProjectGraph}
onViewInTaskGraph={handleViewInTaskGraph}
onRunTarget={environment === 'nx-console' ? handleRunTarget : undefined}
viewInProjectGraphPosition={
environment === 'nx-console' ? 'bottom' : 'top'
}
connectedToCloud={connectedToCloud}
onNxConnect={environment === 'nx-console' ? handleNxConnect : undefined}
/>
<ErrorToast errors={errors} />
</>
);
}
-20
View File
@@ -1,20 +0,0 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"allowJs": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"extends": "../../tsconfig.base.json"
}
-24
View File
@@ -1,24 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
],
"lib": ["DOM"]
},
"exclude": [
"jest.config.ts",
"src/**/*.spec.ts",
"src/**/*.test.ts",
"src/**/*.spec.tsx",
"src/**/*.test.tsx",
"src/**/*.spec.js",
"src/**/*.test.js",
"src/**/*.spec.jsx",
"src/**/*.test.jsx"
],
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
}
-20
View File
@@ -1,20 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"jest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
]
}
-12
View File
@@ -1,12 +0,0 @@
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
],
"plugins": []
}
-18
View File
@@ -1,18 +0,0 @@
{
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
-7
View File
@@ -1,7 +0,0 @@
# graph-shared
This library was generated with [Nx](https://nx.dev).
## Running unit tests
Run `nx test graph-shared` to execute the unit tests via [Jest](https://jestjs.io).
-9
View File
@@ -1,9 +0,0 @@
/* eslint-disable */
export default {
displayName: 'graph-shared',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': 'babel-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
};
-8
View File
@@ -1,8 +0,0 @@
{
"name": "graph-shared",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "graph/shared/src",
"projectType": "library",
"tags": [],
"targets": {}
}
-25
View File
@@ -1,25 +0,0 @@
/* eslint-disable @nx/enforce-module-boundaries */
// nx-ignore-next-line
import type {
ExpandedTaskInputsReponse,
ProjectGraphClientResponse,
TaskGraphClientResponse,
} from 'nx/src/command-line/graph/graph';
import { AppConfig } from './lib/app-config';
import { ExternalApi } from './lib/external-api';
export declare global {
interface Window {
exclude: string[];
watch: boolean;
localMode: 'serve' | 'build';
projectGraphResponse?: ProjectGraphClientResponse;
taskGraphResponse?: TaskGraphClientResponse;
expandedTaskInputsResponse?: ExpandedTaskInputsReponse;
sourceMapsResponse?: Record<string, Record<string, string[]>>;
environment: 'dev' | 'watch' | 'release' | 'nx-console';
appConfig: AppConfig;
useXstateInspect: boolean;
externalApi?: ExternalApi;
}
}
-10
View File
@@ -1,10 +0,0 @@
export * from './lib/external-api';
export * from './lib/external-api-service';
export * from './lib/use-environment-config';
export * from './lib/app-config';
export * from './lib/use-route-constructor';
export * from './lib/use-poll';
export * from './lib/project-graph-data-service/get-project-graph-data-service';
export * from './lib/fetch-project-graph';
export * from './lib/error-toast';
export * from './lib/expanded-targets-provider';
-15
View File
@@ -1,15 +0,0 @@
export interface AppConfig {
showDebugger: boolean;
showExperimentalFeatures: boolean;
workspaces: WorkspaceData[];
defaultWorkspaceId: string;
}
export interface WorkspaceData {
id: string;
label: string;
projectGraphUrl: string;
taskGraphUrl: string;
taskInputsUrl: string;
sourceMapsUrl: string;
}
-132
View File
@@ -1,132 +0,0 @@
/* eslint-disable @nx/enforce-module-boundaries */
// nx-ignore-next-line
import { GraphError } from 'nx/src/command-line/graph/graph';
/* eslint-enable @nx/enforce-module-boundaries */
import {
createRef,
ForwardedRef,
forwardRef,
useCallback,
useImperativeHandle,
useLayoutEffect,
} from 'react';
import { Transition } from '@headlessui/react';
import { ExclamationCircleIcon } from '@heroicons/react/24/outline';
import { SetURLSearchParams, useSearchParams } from 'react-router-dom';
import { ErrorRenderer, Modal, ModalHandle } from '@nx/graph/ui-components';
export interface ErrorToastImperativeHandle {
closeModal: () => void;
openModal: () => void;
}
interface ErrorToastProps {
errors?: GraphError[] | undefined;
}
export const ErrorToast = forwardRef(
(
{ errors }: ErrorToastProps,
ref: ForwardedRef<ErrorToastImperativeHandle>
) => {
const inputsModalRef = createRef<ModalHandle>();
const [searchParams, setSearchParams] = useSearchParams();
useImperativeHandle(ref, () => ({
openModal: () => {
inputsModalRef?.current?.openModal();
},
closeModal: () => {
inputsModalRef?.current?.closeModal();
},
}));
const handleModalOpen = useCallback(() => {
if (searchParams.get('show-error') === 'true') return;
setSearchParams(
(currentSearchParams) => {
currentSearchParams.set('show-error', 'true');
return currentSearchParams;
},
{ replace: true, preventScrollReset: true }
);
}, [setSearchParams, searchParams]);
const handleModalClose = useCallback(() => {
if (!searchParams.get('show-error')) return;
setSearchParams(
(currentSearchParams) => {
currentSearchParams.delete('show-error');
return currentSearchParams;
},
{ replace: true, preventScrollReset: true }
);
}, [setSearchParams, searchParams]);
useLayoutEffect(() => {
if (searchParams.get('show-error') === 'true') {
if (errors && errors.length > 0) {
inputsModalRef.current?.openModal();
} else {
setSearchParams(
(currentSearchParams) => {
currentSearchParams.delete('show-error');
return currentSearchParams;
},
{ replace: true, preventScrollReset: true }
);
}
}
}, [searchParams, inputsModalRef, errors, setSearchParams]);
return (
<Transition
show={!!errors && errors.length > 0}
enter="ease-out duration-300"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="ease-in duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<div className="fixed inset-x-0 bottom-0 px-4 py-2 text-center">
<div
onClick={() => inputsModalRef.current?.openModal()}
className="z-50 mx-auto flex w-fit max-w-[75%] cursor-pointer items-center rounded-md bg-red-600 p-4 text-slate-200 shadow-lg"
>
<ExclamationCircleIcon className="mr-2 inline-block h-6 w-6" />
Some project information might be missing. Click to see errors.
</div>
{errors?.length > 0 && (
<Modal
title={`Project Graph Errors`}
ref={inputsModalRef}
onOpen={handleModalOpen}
onClose={handleModalClose}
>
<ErrorRenderer errors={errors ?? []} />
</Modal>
)}
</div>
</Transition>
);
}
);
export const useRouterHandleModalOpen = (
searchParams: URLSearchParams,
setSearchParams: SetURLSearchParams
) =>
useCallback(() => {
if (searchParams.get('show-error') === 'true') return;
setSearchParams(
(currentSearchParams) => {
currentSearchParams.set('show-error', 'true');
return currentSearchParams;
},
{ replace: true, preventScrollReset: true }
);
}, [setSearchParams, searchParams]);
@@ -1,38 +0,0 @@
import { createContext, useState } from 'react';
export const ExpandedTargetsContext = createContext<{
expandedTargets?: string[];
setExpandedTargets?: (expandedTargets: string[]) => void;
toggleTarget?: (targetName: string) => void;
collapseAllTargets?: () => void;
}>({});
export const ExpandedTargetsProvider = ({ children }) => {
const [expandedTargets, setExpandedTargets] = useState<string[]>([]);
const toggleTarget = (targetName: string) => {
setExpandedTargets((prevExpandedTargets) => {
if (prevExpandedTargets.includes(targetName)) {
return prevExpandedTargets.filter((name) => name !== targetName);
}
return [...prevExpandedTargets, targetName];
});
};
const collapseAllTargets = () => {
setExpandedTargets([]);
};
return (
<ExpandedTargetsContext.Provider
value={{
expandedTargets,
setExpandedTargets,
toggleTarget,
collapseAllTargets,
}}
>
{children}
</ExpandedTargetsContext.Provider>
);
};
@@ -1,24 +0,0 @@
let externalApiService: ExternalApiService | null = null;
export function getExternalApiService() {
if (!externalApiService) {
externalApiService = new ExternalApiService();
}
return externalApiService;
}
export class ExternalApiService {
private subscribers: Set<(event: { type: string; payload?: any }) => void> =
new Set();
postEvent(event: { type: string; payload?: any }) {
this.subscribers.forEach((subscriber) => {
subscriber(event);
});
}
subscribe(callback: (event: { type: string; payload: any }) => void) {
this.subscribers.add(callback);
}
}
-42
View File
@@ -1,42 +0,0 @@
/* eslint-disable @nx/enforce-module-boundaries */
// nx-ignore-next-line
import type {
ProjectGraphClientResponse,
TaskGraphClientResponse,
} from 'nx/src/command-line/graph/graph';
export abstract class ExternalApi {
abstract openProjectDetails(projectName: string, targetName?: string): void;
abstract focusProject(projectName: string): void;
abstract toggleSelectProject(projectName: string): void;
abstract selectAllProjects(): void;
abstract showAffectedProjects(): void;
abstract focusTarget(projectName: string, targetName: string): void;
abstract selectAllTargetsByName(targetName: string): void;
abstract enableExperimentalFeatures(): void;
abstract disableExperimentalFeatures(): void;
loadProjectGraph:
| ((url: string) => Promise<ProjectGraphClientResponse>)
| null = null;
loadTaskGraph: ((url: string) => Promise<TaskGraphClientResponse>) | null =
null;
loadExpandedTaskInputs:
| ((taskId: string) => Promise<Record<string, Record<string, string[]>>>)
| null = null;
loadSourceMaps:
| ((url: string) => Promise<Record<string, Record<string, string[]>>>)
| null = null;
graphInteractionEventListener:
| ((event: { type: string; payload: any }) => void | undefined)
| null = null;
}
@@ -1,18 +0,0 @@
import { Params } from 'react-router-dom';
import { ProjectGraphService } from './project-graph-data-service/get-project-graph-data-service';
import { AppConfig } from './app-config';
export async function fetchProjectGraph(
projectGraphService: ProjectGraphService,
params: Readonly<Params<string>>,
appConfig: AppConfig
) {
const selectedWorkspaceId =
params.selectedWorkspaceId ?? appConfig.defaultWorkspaceId;
const projectInfo = appConfig.workspaces.find(
(graph) => graph.id === selectedWorkspaceId
);
return await projectGraphService.getProjectGraph(projectInfo.projectGraphUrl);
}

Some files were not shown because too many files have changed in this diff Show More