Compare commits

...

1723 Commits

Author SHA1 Message Date
FrozenPandaz 23a145ee4f chore(repo): test 2024-12-05 15:42:33 -05:00
Jack Hsu 7c25cf150d fix(remix): update lib generator to generate valid names in package.json (#29219)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 g @nx/remix:lib packages/foo` generates invalid package names in new
TS setup. e.g. `@acme/packages/foo`.

## Expected Behavior
The name should be valid in `package.json`.

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

Fixes #
2024-12-05 11:04:47 -05:00
Jack Hsu f89fca98f3 fix(remix): update app generator with valid package.json without Prettier (#29218)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
If you don't have Prettier installed, then `nx g @nx/remix:app
apps/myapp` will generate a `package.json` with trailing comma, and `npm
install` fails.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`package.json` should be valid without Prettier.

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

Fixes #
2024-12-05 10:27:53 -05:00
Leosvel Pérez Espinosa 625d8f3095 feat(angular): add migration to remove the tailwindConfig option from ng-packager executors (#29220)
Add migration to remove the `tailwindConfig` option from the ng-packagr
executors, which have been unused since Angular v17. Tailwind CSS
configurations located at the project or workspace root will be picked
up automatically.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #29217
2024-12-05 16:18:50 +01:00
Thomas Dekiere b848bb3dba fix(release): skip changelog generation for projects without available version data (#29212) 2024-12-05 16:38:04 +04:00
Leosvel Pérez Espinosa 2fa3ce21d4 feat(angular): add migration to remove angular eslint rules removed in v19 (#29214)
Add migration to remove Angular ESLint rules that were removed in v19:

- `@angular-eslint/no-host-metadata-property`
- `@angular-eslint/sort-ngmodule-metadata-arrays`
- `@angular-eslint/prefer-standalone-component`

See Angular ESLint v19 changelog for reference:
https://github.com/angular-eslint/angular-eslint/blob/main/CHANGELOG.md#1900-2024-11-29

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

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

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

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

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

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

Fixes #
2024-12-05 11:12:52 +01:00
Jason Jean 15060e3a4f fix(core): recreate db when unable to connect (#29207)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 Nx is unable to connect to the DB, nothing works and the user needs
to run `nx reset` to remove the db file.

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

When Nx is unable to connect to the DB, the db is destroyed and
recreated automatically within the same command.

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

Fixes #
2024-12-04 17:27:35 -05:00
Jason Jean 4773e35d01 chore(repo): update nx to 20.2.0-beta.7 (#29198)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

This repo uses Nx `20.2.0-beta.3`

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

This repo uses Nx `20.2.0-beta.7`

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

Fixes #
2024-12-04 15:42:15 -05:00
Colum Ferry 7157e7a07c fix(rspack): align @rspack/core versions (#29199)
Align rspack versions amongst packages and update useLegacyNxPlugin
helper to match new API changes
2024-12-04 18:05:49 +00:00
Jack Hsu 6c5916a79f feat(rollup): use .cjs file extension for config files (#29196)
The `rollup.config.js` file will be resolved as ESM if the closest
`package.json` has `type: 'module`. This causes an error when computing
the project graph and when reading the file for builds.

```
  Original error: require is not defined in ES module scope, you can use import instead
```

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

This PR also updates the output directory to `{projectRoot}/dist` for
the new TS setup.

## Current Behavior
`nx g @nx/react:lib --bundler=rollup` has an error due to Node
resolution

## Expected Behavior
`nx g @nx/react:lib --bundler=rollup` works out of the box

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

Fixes #29193, #[29195](https://github.com/nrwl/nx/issues/29195)

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2024-12-04 12:53:42 -05:00
Jack Hsu 972c01bd25 feat(storybook): add support for TS solutions file (#29194)
This PR adds support for the [new TS
setup](https://github.com/nrwl/nx/discussions/29099) with Storybook.
2024-12-04 17:44:07 +00:00
Leosvel Pérez Espinosa 59e3704fb3 fix(testing): force compatible module resolution when running the jest executor (#29189)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #29139
2024-12-04 12:04:45 -05:00
Colum Ferry aefafc55ba feat(module-federation): alias host and remote generators to consumer and producer (#29190)
## Current Behavior
Our Module Federation support across Angular and React contains Host and
Remote generators.
The module-federation.io docs have started to shift towards Consumer and
Producer terminology for better translation of meanings across
languages.


## Expected Behavior
To stay consistent with official terminology, add aliases for the host
and remote generators to allow for the new terminology. i.e. host ->
consumer, remote -> producer.

Therefore the following are all valid

```shell
nx g host shell --remotes=remote1
nx g host shell --producers=producer1
nx g consumer shell --remotes=remote1
nx g consumer shell --producers=remote1

nx g remote remote1 --host=shell
nx g remote remote1 --consumer=shell
nx g producer producer1 --host=shell
nx g producer producer1 --consumer=shell
```
2024-12-04 16:45:27 +00:00
James Henry 67d03937b5 fix(release): set make_latest legacy during github release creation (#29197) 2024-12-04 11:32:52 -05:00
Leosvel Pérez Espinosa db5e2f63bf docs(core): update nx sync messaging in npm workspaces tutorial (#29188)
Update the npm workspaces tutorial to reflect the changes made in
https://github.com/nrwl/nx/pull/29149.

Updated doc:
https://nx-dev-git-docs-nx-sync-terminal-output-nrwl.vercel.app/getting-started/tutorials/npm-workspaces-tutorial

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

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

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

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

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

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

Fixes #
2024-12-04 17:28:49 +01:00
Jason Jean bba941ab4d fix(core): move resolving plugins back to main thread (#29176)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 custom plugins to their paths to be loaded involves loading
our default plugins. When plugin isolation, this loads the default
plugins for each and every plugin worker.

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

Resolution of the plugins is the same and easily serializable to send to
the worker. Resolving plugins on the main thread allows Nx to reuse the
default plugins and decrease the memory usage greatly.

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

Fixes #
2024-12-04 10:05:43 -05:00
Leosvel Pérez Espinosa 1dbddb11ba feat(angular): update analog packages (#29187)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

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

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

Fixes #
2024-12-04 11:46:52 +01:00
Jason Jean 75b2080521 chore(core): fix test mocking (#29183)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 mock for this test is not actually mocking the function being used.

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

The function being used is getting mocked.

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

Fixes #
2024-12-03 19:59:59 -05:00
Nicholas Cunningham dd14f3943c fix(react): None buildable libs should not have a build target (#29175) 2024-12-03 16:30:51 -07:00
Leosvel Pérez Espinosa 3cc321d4ce fix(js): generate multiline project references in the sync generator (#29148)
Update the `@nx/js:typescript-sync` sync generator to produce the
updated project references in multiple lines. This improves the
formatting of the generated project references when not using Prettier.

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

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

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

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

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

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

Fixes #
2024-12-03 15:58:10 -05:00
Nicholas Cunningham c1469b68ca fix(core): Update preset test snapshots and test names (#29172)
- Creates uniq names for each preset test case
- Updates the test names so you can run each `it` via IDE
2024-12-03 15:57:32 -05:00
Leosvel Pérez Espinosa 38e29b9e90 feat(angular): use new test environment function from jest-preset-angular (#29169)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #29165
2024-12-03 15:24:14 -05:00
Colum Ferry 54dbbfded5 fix(core): use fork to execute nx generate workspace:preset (#29122)
## Current Behavior
On Windows, when packageManager=pnpm, `create-nx-workspace` fails due to
an issue with `child_process.spawn`.
Using `spawn`, the `@nx/workspace:preset` generator is executed twice
when `packageManager=pnpm`, causing the overall create-nx-workspace flow
to fail, even though most things have been set up correctly to that
point.

Using `fork` has shown success.

## Expected Behavior
Running `create-nx-workspace --packageManager=pnpm` should work on
Windows

## Fixes
Fixes #20222 
Fixes #27270 
Fixes #22917 
Fixes #22312 
Fixes #28710 
Fixes #28289 
Fixes #28235 
Fixes #22383 
Fixes #21742 
Fixes #20270
2024-12-03 15:17:08 -05:00
Philip Fulcher 9bd08851f0 docs(nx-dev): add monorepo relationships blog post (#29152) 2024-12-03 12:27:13 -07:00
Craigory Coppola 6bd86158d1 fix(core): provide a way to reuse cached graph in CI (#29156)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

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

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

Fixes #
2024-12-03 13:23:06 -05:00
Jason Jean 9ad6b8c208 fix(core): fix misc issues (#29114)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

This PR fixes several issues:

1. Affected loaded plugins again.
2. `package-json` plugin takes a while and is loaded often.
3. Performance logging was not showing up properly.

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

1. Affected does not load plugins again.
2. `package-json` plugin utilizes a cache so that it is fast even when
it is loaded often.
3. Performance logging shows up properly

## 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-12-03 10:24:28 -05:00
Colum Ferry d32ca3788e docs(module-federation): add link to module-federation.io (#29166)
Add a link to https://module-federation.io from the `@nx/module-federation` README
2024-12-03 14:45:20 +00:00
Leosvel Pérez Espinosa 201cd89f5a fix(js): normalize paths correctly when creating temporary tsconfig file for incremental builds (#29121)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28316
2024-12-03 15:38:53 +01:00
Leosvel Pérez Espinosa c62d78dd7e feat(angular): add migration to disable @angular-eslint/prefer-standalone when not set (#29164)
- Add migration to disable the `@angular-eslint/prefer-standalone` rule
when it's not already set. This prevents a breaking change due to the
[rule being promoted to the recommended rules in
v19](https://github.com/angular-eslint/angular-eslint/commit/8dfdc4f4d4b2a0b23f91aeb7ef14fa384bec3cec).
- Update the `@nx/angular` package peer dependencies range to drop
Angular v16 and include Angular v20.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #29163
2024-12-03 15:30:09 +01:00
Leosvel Pérez Espinosa e9be7d92cf feat(core): improve sync messages (#29149)
## `nx sync:check` (out of sync)

**Before**:

![image](https://github.com/user-attachments/assets/3fd737be-9c08-4cb4-b4e2-956bfd325ec7)

**After**:

![image](https://github.com/user-attachments/assets/c96c8f6c-b5e9-4566-88e4-cbe66037e411)

> The `Custom out of sync message` in these examples is a message
returned from the sync generator, while the other one is the fallback
message displayed if the sync generator doesn't return one.

## `nx sync:check` (up to date)

**Before**:

![image](https://github.com/user-attachments/assets/88f46c72-7222-4407-8b4a-90b4b6a7c9de)

**After**:

![image](https://github.com/user-attachments/assets/f4b9e181-67cd-4042-b1ac-be61fb400711)

## Running tasks

**Before**:

![image](https://github.com/user-attachments/assets/0bdc160c-c893-421a-8407-4de05e4d31b4)

**After**:

![image](https://github.com/user-attachments/assets/a7f2d471-1ad8-450f-8438-d1c3d4f8a3f9)

## Sync generator failures

**Before**:

![image](https://github.com/user-attachments/assets/805941cb-cef8-4346-9572-4eea142e6b40)

**After**:

![image](https://github.com/user-attachments/assets/621a3217-efe1-4f92-932f-80509d205dbc)

## Sync generator failures (`--verbose`)

**Before**:

![image](https://github.com/user-attachments/assets/070c22a6-39d0-4c6d-9f9f-38d77903eb6b)

**After**:

![image](https://github.com/user-attachments/assets/b007ecf7-100e-4e04-a7b1-d8bb713dbb37)

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

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

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

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

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

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

Fixes #
2024-12-03 15:28:12 +01:00
Colum Ferry 5448046f06 feat(module-federation): move common executor logic to module-federation package (#29151)
## Current Behavior
The logic for the `module-federation-dev-server` and
`module-federation-ssr-dev-server` is duplicated across Angular, React
and Rspack.

The majority of this logic is the same, and the duplication causes an
increased maintenance tax.

## Expected Behavior
Move the logic into a utility that is exposed from
`@nx/module-federation`.
2024-12-03 08:15:20 -05:00
Benjamin Cabanes da901dec08 docs(nx-dev): update team (#29160) 2024-12-03 07:59:08 -05:00
Juri Strumpflohner 922c0469b1 docs(testing): fix playwright API docs about task splitting (#29162)
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-12-03 04:57:34 -08:00
Juri a54bbcc8ac docs(nx-cloud): remove note on --with-env-vars=auto as it is breaking users badly 90% of the time 2024-12-03 11:12:03 +01:00
Benjamin Cabanes 6b870050b6 docs(nx-dev): add Pro plan details to FAQ (#29155)
Included a new FAQ entry to clarify the existence and conditions of the
Pro plan for existing users, which is no longer available to new users.
Added a link to this FAQ section from the pricing display page to help
users easily find information about the Pro plan. Updated HTML in the
FAQ section with an additional class for better scrolling behavior.

---------

Co-authored-by: Juri Strumpflohner <juri.strumpflohner@gmail.com>
2024-12-02 16:31:42 -05:00
Benjamin Cabanes 8c25c02112 docs(nx-dev): add rb2b script to _app.tsx (#29154)
This commit integrates the rb2b tracking script into the application by injecting it into the page with the `afterInteractive` strategy.
2024-12-02 15:54:19 -05:00
Caleb Ukle 6a46030995 docs(core): update e2e-ci glob example (#29150)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 glob pattern in the e2e-ci example is incorrect for nested
directories example mentioned.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
when using nested directories the **/** pattern is needed, so the
example was incorrect
it's also confusing why something wouldn't work, so added more info as
to the different common glob patterns (`**/*`, `**/**`) to be more clear

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

Fixes #

---------

Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-12-02 14:56:12 -05:00
Leosvel Pérez Espinosa 3ec539065d feat(angular): add support for angular v19 (#28847)
## Third-party deps support for Angular v19

- [x] `jest-preset-angular`
  - [x] PRs:
    - [x] https://github.com/thymikee/jest-preset-angular/pull/2835
  - [x] Released:
- [x] RC:
https://github.com/thymikee/jest-preset-angular/releases/tag/v14.4.0-rc.0
- [x] Stable:
https://github.com/thymikee/jest-preset-angular/releases/tag/v14.4.0
- [x] Angular ESLint
  - [x] PRs:
    - [x] https://github.com/angular-eslint/angular-eslint/pull/2109
  - [x] Released:
- [x]
https://github.com/angular-eslint/angular-eslint/releases/tag/v19.0.0
- [x] Storybook
  - [x] PRs:
    - [x] https://github.com/storybookjs/storybook/pull/29659
    - [x] https://github.com/storybookjs/storybook/pull/29677
  - [x] Released:
    - [x] https://github.com/storybookjs/storybook/pull/29679
- [ ] NgRx
  - [x] PRs:
    - [x] https://github.com/ngrx/platform/pull/4602
  - [ ] Released:
- [x] Beta:
https://github.com/ngrx/platform/blob/main/CHANGELOG.md#1900-beta0-2024-11-20
    - [ ] Stable:
- [ ] Analog
  - [x] PRs:
    - [x] https://github.com/analogjs/analog/pull/1447
    - [x] https://github.com/analogjs/analog/pull/1451
  - [ ] Released:
- [x] Beta:
https://github.com/analogjs/analog/releases/tag/v1.10.0-beta.6
    - [ ] Stable:

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

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

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

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

Angular v19 is not supported.

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

Angular v19 should be supported.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
 
Fixes #29028
2024-12-02 11:43:24 -05:00
Zachary DeRose 06d549b043 docs(misc): advent of code 2024 starter repo blog (#29132)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-30 19:17:19 -05:00
Jack Hsu ec5a5e6360 feat(react): update app and lib generators to support new TS solution setup (#28808)
This PR updates app and lib generators in the following packages such
that they will generate files with the TS solution setup if it is
detected.

- `@nx/react`
- `@nx/next`
- `@nx/remix`
- `@nx/expo`
- `@nx/react-native`

React apps and libs will be linked using npm/pnpm/yarn/bun workspaces
feature rather than through tsconfig paths. This means that local
aliases like `@/` will work with Next.js and Remix apps.

Note: This will be behind `--workspaces` flag when using `npx
create-nx-workspace` and choosing React stack. If you use the None/TS
stack then adding plugins like `nx add @nx/react` then generating apps,
it will automatically pick up the new TS solution setup.


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

## Current Behavior
React generators are not compatible with TS solution setup (i.e.
workspaces + TS project references).

## Expected Behavior
React generators work with new TS solution setup (Plain, Next.js, Remix,
Expo, React Native).

## Related Issue(s)
#28322

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-11-28 22:18:45 -05:00
Nicholas Cunningham 2cb58b937d fix(webpack): Webpack and Rspack ignore warnings should concat all rules instead of overwrite them. (#29112)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #18243
2024-11-28 15:36:40 -07:00
Nicholas Cunningham 08a33075a7 fix(nest): update project config to enable artifacts to be built as dev (#29110)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Currently, when we generate a Nest application and run the serve target
with development configuration the `node-env` is set to `production`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Running the serve target in `development` should build the artifacts as
`development` so they can be served correctly.

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

Fixes #26761
2024-11-28 10:23:09 -07:00
Leosvel Pérez Espinosa dc67660fec fix(misc): update artifact generator option descriptions and cleanup leftovers (#29077)
- Update artifact generator schemas:
- Clarify `path` is the artifact file path relative to the current
working directory
  - Clarify `name` is the artifact symbol name
- Remove prompt for `name` and remove it from the important options
(won't be displayed by default in Nx Console generation UI, it will be
part of the collapsed options) given that most of the time, it's meant
to match the filename (last segment of the `path`)
- Remove some leftover options related to the name and path formats that
were previously missed
- Fix an issue with NestJS generators
- Fix an issue with Next `page` generator

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

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

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

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

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

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

Fixes #
2024-11-28 09:44:44 -05:00
Colum Ferry c66b99c499 docs(testing): add example of using Playwright's --project argument with Nx (#29107)
## Current Behavior
Missing documentation on how to use Playwright's `--project` argument
with Nx.
Because Nx also has a `--project` argument, passing it to the command
like `nx e2e app --project=firefox` will result in the `--project` being
stripped from the command that is sent to Playwright.


## Expected Behavior
The fix is simple enough, change the command to be `nx e2e app --
--project=firefox` to ensure the argument is forwarded correctly to
Playwright.
Add some information to the Playwright plugin's overview documentation
to explain this.


## Related Issue(s)

Fixes #26965
2024-11-28 05:37:08 -08:00
Colum Ferry 182b46ca66 fix(module-federation): use 'hoisted' runtime for node to prevent issues with eager sharing (#29104)
## Current Behavior
SSR with Module Federation frequently encounters issues related to the
eager resolution of shared packages.
This has resulted in numerous erroneous behaviours including but not
limited to:
- Failure to start server
- Failure to resolve remotes
- Failure to server render remotes

## Expected Behavior
Using the `'hoisted'` runtime provided by MF 2.0, we can ensure that SSR
for Module Federation runs in an async environment, removing the issues
surrounding eager consumption and resolution of shared modules.
In testing, this has fixed the issues outlined above

## Related Issue(s)

Fixes #27000
Fixes #27964
2024-11-28 11:38:17 +00:00
Nicholas Cunningham 8eb6159696 fix(nextjs): Add support for next.config.ts for executors (#29071)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28960
2024-11-27 13:50:48 -05:00
Nicholas Cunningham 25c5643283 fix(nest): Fix generators (guard, interceptor etc...) path to not duplicate when provided (#29084)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
When we run the nest generators (interceptor, resource, guard etc...) it
tends to duplicate the path and leads to unexpected folder creations.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
It should generate in the path provided.

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

Fixes #29076
2024-11-27 10:24:06 -07:00
Rares Matei 0bf7565664 docs(nx-cloud): add breaking change mention for terminal outputs (#29097)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-27 16:46:09 +00:00
Jason Jean b018b94096 fix(core): update to the async version of getting powerpack information (#29088)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 deprecated sync API for getting powerpack license information is
used.

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

The new async API for getting powerpack license information is used if
it is available. If not, it uses the sync API.

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

Fixes #
2024-11-26 20:10:00 -05:00
Benjamin Cabanes 1ea7bb43e1 docs(nx-dev): update webinar signup link (#29090)
Replaced the URL in the webinar signup link with a shortened version to simplify the href. Removed the onClick event handler for tracking the webinar sign-up click event.
2024-11-26 18:58:21 -05:00
Benjamin Cabanes 47663727c1 docs(nx-dev): add WebinarNotifier component (#29087)
Introduce the `WebinarNotifier` component and integrate it within the app. This helps in promoting the upcoming webinars to users by displaying a notification banner with details and a signup link.
2024-11-26 18:55:09 -05:00
Jason Jean 0d0d6c7c11 feat(misc): replace tutorials with social links in create-nx-workspace (#29085)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Currently, `create-nx-workspace` links to tutorials which in most cases,
users are in the middle of doing or have already done in the past.

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

Rather than tutorials, `create-nx-workspace` will welcome users to the
Nx community and give them ways to show their appreciation, stay up to
date, and chat about Nx.

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

Fixes #
2024-11-26 17:49:32 -05:00
Benjamin Cabanes 4030494cd5 docs(nx-dev): update case study link (#29086) 2024-11-26 16:26:02 -05:00
Juri 6089b28916 docs(release): update how the publish results are handled 2024-11-26 21:47:13 +01:00
James Henry 9ab1068d1d docs(repo): update some conformance docs (#29073) 2024-11-27 00:33:28 +04:00
Benjamin Cabanes a435e263cd docs(nx-dev): udpate links for Banking Case Study downloads (#29082)
Corrected URLs in both `enterprise-customers.tsx` and
`metrics-and-customers.tsx` to ensure users can access the Banking Case
Study.
2024-11-26 14:37:17 -05:00
Juri Strumpflohner bcaef27046 docs(core): adjust nx course video titles for better SEO (#29079)
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-11-26 08:32:05 -08:00
Benjamin Cabanes c75aa8f661 docs(nx-dev): update ebook download link (#29081)
Changed the href in `download-ebook.tsx` to point to the new CI ebook URL.
2024-11-26 11:07:47 -05:00
Andy 55143297be server-next-executor-examples: minor typo documentation (#28830)
## Current Behavior

Typo


![image](https://github.com/user-attachments/assets/39b5ebe8-5518-4afb-8c32-1c736489bf6c)
2024-11-26 08:06:55 -07:00
Colum Ferry a5c5cbf326 fix(module-federation): migration does not handle external nodes and errors (#29075)
## Current Behavior
The React + Angular migrations intended to update the path for the
`ModuleFederationConfig` imports in webpack and rspack config files will
fail on externalNodes in the project graph that have `@nx/webpack` or
`@nx/rspack` listed as a dependency.

## Expected Behavior
If the dependency is discovered in an `externalNode` we should skip that
node, instead of continuing with the migration.
2024-11-26 14:55:02 +00:00
Craigory Coppola 30d722bd98 chore(core): warn when db cache is disabled (#28929)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-26 09:52:37 -05:00
Nicholas Cunningham beded4ef6d fix(angular): ngrx-root-store generator check ngModule path (#29068)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
When we run the ngrx-root-store generator on a MFe host app it assumes
`app.module.ts` is created.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We should check if `app.module.ts` exists first, then fall back if not.

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

Fixes #28970
2024-11-25 16:52:28 -07:00
James Henry 8b3f9d883a chore(repo): use nx-cloud conformance (#29062) 2024-11-25 18:00:57 -05:00
Nicholas Cunningham cbc19c54ae fix(nextjs): ensure next apps config is correctly checked when using jest (#29066)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
When we create a new Next.js app it checks if `tsconfig.app.json` exists
else it throws an error.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
It should check for `tsconfig.json` instead of `tsconfig.app.json`

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

Fixes #29035
2024-11-25 13:36:19 -07:00
Juri 9921496d64 feat(nx-dev): update top-level navbar 2024-11-25 21:33:22 +01:00
MaxKless 6904789b10 fix(core): don't generate nxCloudId if running nx connect through nx console (#29060) 2024-11-25 09:02:12 -07:00
Colum Ferry 5f92f1729b fix(rspack): outputHashing should default to 'all' #29011 (#29058)
## Current Behavior
Current default for outputHashing is set to 'none'.
This means that both executor and plugin usage will output file names
that will not bust browser cache.

## Expected Behavior
Set default for `outputHashing` to 'all' to ensure all outputted files
are hashed allowing for cache busting.

## Related Issue(s)

Fixes #29011
2024-11-25 09:26:23 -05:00
Isaac Mann fc7ee36a96 chore(nx-dev): wrap breadcrumbs (#29059) 2024-11-25 16:37:19 +04:00
Jason Jean 128778e7d1 chore(repo): update nx to 20.2.0-beta.3 and other dependencies (#29049)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

This repo uses Nx `20.2.0-beta.2`.

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

This repo uses Nx `20.2.0-beta.3`.

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

Fixes #
2024-11-22 18:49:51 -05:00
Isaac Mann c7894d7579 docs(core): enterprise conformance rules docs (#29046)
Co-authored-by: JamesHenry <james@henry.sc>
2024-11-22 17:20:48 -05:00
FrozenPandaz 1bf0e67e1b fix(core): handle self shutdown for plugin workers is orphaned before connections and loading 2024-11-22 15:56:11 -05:00
FrozenPandaz 0ae87f191c Revert "fix(core): lower socket path by 10 chars to reduce chances of too-long paths (#28920)"
This reverts commit be8029d5dd.
2024-11-22 15:56:11 -05:00
Altan Stalker a4c79d0f92 docs(nx-cloud): improve --stop-agents-after docs and add advanced example (#29044)
## Current Behavior
Docs are not representative of current feature set

## Expected Behavior
Docs are representative of current feature set
2024-11-22 15:38:00 -05:00
Colum Ferry 007c0c85a9 fix(rspack): ensure generated app is picked up by crystal (#29048)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Current projects are added to excludes of rspack plugin.
Init is also not detecting rspack workspaces

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure excludes is not being set up when generating new apps as they are
resilient to project graph creation now.
Init should detect projects correctly


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

Fixes #
2024-11-22 14:08:28 -05:00
Colum Ferry 840d935d2e feat(module-federation): move withModuleFederation for rspack to new package (#29045)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `withModuleFederation` helper currently lives in the `@nx/rspack`
package.
With the goal of consolidating the module federation support into a
single package, this introduces a divergence in where module-federation
support lies


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Move `withModuleFederation` helper for angular into the
`@nx/module-federation` package, exposed via
`@nx/module-federation/rspack`.
Adds a migration to migrate existing projects to use the new package

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

Fixes #
2024-11-22 13:26:00 -05:00
Louie Weng 9526560fa0 docs(nx-cloud): add docs for assignment rules (#28855)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

Add documentation for how assignment rules feature works with Nx Cloud. 

## 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>
Co-authored-by: Isaac Mann <isaacplmann@gmail.com>
2024-11-22 18:20:58 +00:00
Colum Ferry 432d9d3b17 feat(module-federation): move withModuleFederation for webpack to new package (#29031)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `withModuleFederation` helper currently lives in the `@nx/react`
package.
With the goal of consolidating the module federation support into a
single package, this introduces a divergence in where module-federation
support lies


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Move `withModuleFederation` helper for angular into the
`@nx/module-federation` package, exposed via
`@nx/module-federation/webpack`.
Adds a migration to migrate existing projects to use the new package

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

Fixes #
2024-11-22 08:28:13 -05:00
Nicholas Cunningham a37a9c2f8b fix(rspack): Add webpack as a dependency for fork-ts-checker-plugin (#29033) 2024-11-22 08:18:02 +01:00
Nicholas Cunningham 5bd8f4f3a2 feat(rspack): Update configuration generator to support NxRspackAppPlugin (#29024)
WIP

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

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

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

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

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

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

Fixes #

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2024-11-21 23:18:40 -05:00
Isaac Mann a1efb63819 fix(nx-dev): breadcrumb casing (#29032)
Fixes the breadcrumb component to show actual page titles instead of
just capitalizing the url segments
2024-11-21 17:20:33 -05:00
Isaac Mann c3d53a4900 docs(core): fix star icon 2024-11-21 21:52:48 +01:00
Isaac Mann 58769f8634 docs(core): star on github cta 2024-11-21 21:52:48 +01:00
Jack Hsu b16122d5fa fix(core): gracefully handle non-existent files in find_imports (#29027)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-21 13:17:13 -05:00
Colum Ferry 9ca15f75b0 feat(module-federation): move withModuleFederation for angular to new package (#29021)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `withModuleFederation` helper currently lives in the `@nx/angular`
package.
With the goal of consolidating the module federation support into a
single package, this introduces a divergence in where module-federation
support lies


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Move `withModuleFederation` helper for angular into the
`@nx/module-federation` package, exposed via
`@nx/module-federation/angular`.
Adds a migration to migrate existing projects to use the new package

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

Fixes #
2024-11-21 11:07:51 -05:00
Juri 940ada38b4 docs(devkit): adjust icons on extending nx intro page 2024-11-21 15:53:02 +01:00
Colum Ferry 5cc88b87a2 feat(rspack): add convert-to-inferred generator (#29012)
- feat(module-federation): migrate to latest
- feat(rspack): add convert to legacy plugin
- feat(rspack): add convert-to-inferred generator

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

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Our current rspack configs rely on executor usage.
But there is no automated method to convert the config to use inferred
targets

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add convert-to-inferred generator

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

Fixes #
2024-11-21 09:19:08 -05:00
Pavlo Grosse 02b8bbeffe fix(angular): make scam-to-standalone replace correct module (#29014)
## Current Behavior
Without this fix, the regular expression would replace other modules
that have old module name in their name.
E.g. `MapIconModule` contains `IconModule` and when migrating
`IconModule`, the migration would wrongfully update `MapIconModule` to
`MapIconComponent`.

## Expected Behavior
Migration changes only the Module/Component that's being migrated.
2024-11-21 09:28:42 +01:00
Tine Kondo 60a9f81dac fix(core): add missing supported CI providers to NxCloud type (#29008) 2024-11-20 18:23:15 -05:00
Colum Ferry 79855a5471 feat(rspack): migrate to latest rspack versions (#29004)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
We're currently installing Rspack 1.0.5. The latest is 1.1.2.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure we install the latest for users, and migrate existing users to
latest

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

Fixes #
2024-11-20 16:33:04 -05:00
Dennis Harder c6784b21c5 docs(core): improvement for better understanding (#28699)
improvement the typo and the tutorial for beginners

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-20 15:23:13 -05:00
Benjamin Staneck 4187d56371 docs(core): update installation.md instructions for yarn (#28596)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
`yarn global` was removed in modern versions of yarn, this adds a hint
that it is only available in v1 of it.


<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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. -->
2024-11-20 15:21:57 -05:00
Colum Ferry 7ece24c067 feat(module-federation): migrate to latest (#29005)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 runtime resolve bug in older versions of Module Federation
2.0 Packages.
It is fixed in v0.7.6
We're currently installing 0.6.9


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Migrate to the latest version of MF2.0 packages

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

Fixes #
2024-11-20 14:03:52 -05:00
Jack Hsu 8f67441e63 fix(remix): remove tooling packages from generated package.json since they are installed in the root (#29009)
The `eslint` version is causing errors like:

```
Error while loading rule '@typescript-eslint/no-unused-expressions': Cannot read properties of undefined (reading 'allowShortCircuit')
```

This is because we are installing both eslint 8 and 9 to the workspace,
which are not compatible. We shouldn't need to add `eslint`,
`typescript`, `vite` and other tooling to the app's package.json since
they should following single version policy by default and be installed
at the root.

Note: This is only an issue when you enable workspaces.
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-20 13:31:18 -05:00
Emily Xiong b0a4f35afd fix(nextjs): fix next e2e test to ensure playwright installed (#29000)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-20 09:47:47 -08:00
groninge 548973cd6c docs: update preserving-git-histories.md (#27846)
While following the docs to preserve git histories I ran into some
issues.
This update hopefully makes sure any future readers can complete the
outlined procedure successfully
2024-11-20 12:15:12 -05:00
Julián Gómez Sibecas 1c2ae37b6e chore(core): nx plugin submission nx-foundry (#28025)
<!-- 
_[Please make sure you have read the submission guidelines before
posting an
PR](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#submit-pr)_

# Community Plugin Submission

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

## Plugin Requirements

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

i.e.

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

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

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

Example:

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

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

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

# Community Plugin Submission

## nx-foundry

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

---------

Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-11-20 10:08:32 -05:00
Jack Hsu ce6caba1f9 chore(repo): ensure playwright is installed before running e2e tests (#29006)
We're using Playwright by default, but the e2e test is ensuring Cypress
installation.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-20 09:48:01 -05:00
Thomas Dekiere a0d760f790 fix(release): remove duplicate space character in changelog thank you header (#28664) 2024-11-20 17:14:50 +04:00
Colum Ferry 09a01eb30c feat(rspack): add NxAppRspackPlugin and NxReactRspackPlugin (#28987)
- feat(rspack): add NxAppRspackPlugin
- feat(rspack): add NxReactRspackPlugin

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

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

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

## Current Behavior
<!-- This is the behavior we have today -->
We currently do not have rspack plugins to encapsulate our app, web and
react support for Rspack. This leads to issues with defining configs
that are supported by Crystal


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add and expose two plugins, `NxAppRspackPlugin` and
`NxReactRspackPlugin`, to support building configs that are supported by
crystal

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

Fixes #
2024-11-19 16:01:10 -05:00
Nicholas Cunningham 2c53e742db fix(rspack): buildLibsFromSource option (#28994)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Currently, the `buildLibsFromSource` option is not being used. So even
if the user sets it to `'buildLibsFromSource': false` it will not be
updated.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `buildLibsFromSource` should be supported.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
There is an issue with Rspack that requires the baseUrl to be set in the
generated tsconfig.

Fixes #
2024-11-19 15:55:55 -05:00
Benjamin Cabanes 8c66662e3e docs(nx-dev): update link href in trial-callout component (#28995)
Changed the href attribute for the sales contact link from "/contact-us/sales" to "/contact/sales" to correct the URL path.
2024-11-19 15:33:15 -05:00
demonicattack 25909b0d9e fix(linter): move eslint-config-prettier to the end for proper override (#28503)
There is a conflict between ESLint and Prettier rules, which causes
incorrect formatting behavior.

Reordering the config so that `eslint-config-prettier` is applied last
ensures proper rule overrides and resolves conflicts with Prettier.

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2024-11-19 19:01:43 +01:00
Philip Fulcher e4ce2b1140 docs(nx-dev): fixes for affected project graph post (#28992)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-19 09:24:28 -07:00
Philip Fulcher 429ea42c5f docs(nx-dev): add ci affected graph post (#28870) 2024-11-19 06:49:22 -05:00
Leosvel Pérez Espinosa 743cf47b1f chore(repo): remove unused generator default (#28957)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-19 09:04:31 +01:00
Jason Jean 636cd77002 fix(linter): remove legacy dependencies during convert to flat config (#28981)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

`@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` are
left at old versions after converting to flat config.

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

`@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` are
removed when converting to flat config.

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

Fixes #
2024-11-18 16:38:44 -05:00
Colum Ferry 76d61ea5e6 feat(module-federation): consolidate module federation utils into module-federation package (#28919)
- feat(module-federation): consolidate module federation utils into
module-federation package
- chore(module-federation): fix tests and linting

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

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Our current support for Module Federation relies on utilities that are
spread and duplicated across the `@nx/webpack` package and the
`@nx/rspack` package.



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Now that we have a `@nx/module-federation` package, dedupe the utils and
consolidate them into a single package

## Todo
- [x] Migrations for React + Angular to install `@nx/module-federation`
and point `ModuleFederationConfig` export to that package from
webpack.config and rspack.config files
2024-11-18 14:15:10 -05:00
Isaac Mann 0407b7a7b4 docs(core): database cache concept page (#28935)
Adds a concept page describing the database cache

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2024-11-18 10:02:54 -05:00
Chau Tran eaa458c5dd docs(nx-cloud): add cipe project graph recipe (#28961)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
N/A

## Expected Behavior
Add new recipe on the CI section about using CIPE Affected Project Graph

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

Fixes #

---------

Co-authored-by: Isaac Mann <isaacplmann@gmail.com>
2024-11-18 08:55:55 -06:00
Emily Xiong eb143d3ed6 feat(storybook): upgrade @storybook/test-runner to 0.19 (#28959)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
I got this error locally, I think it is because @storybook/test-runner
is incompatible with storybook version
https://github.com/storybookjs/test-runner/issues/505
<img width="1147" alt="Screenshot 2024-11-15 at 12 22 13 PM"
src="https://github.com/user-attachments/assets/e2a9f4c9-e784-4946-8677-b60b62ff36ef">

from https://github.com/storybookjs/test-runner#storybook-compatibility
storybook ^8.2.0 should use @storybook/test-runner ^0.19.0

## 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-11-18 11:07:44 +01:00
Jason Jean 8efad63f86 chore(repo): update nx to 20.2.0-beta.2 (#28958)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

This repo uses Nx `20.1.0-beta.3`

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

This repo uses Nx `20.2.0-beta.2`

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

Fixes #
2024-11-15 15:47:29 -05:00
Benjamin Cabanes bbdc330958 docs(nx-dev): update docs format (#28964) 2024-11-15 14:18:26 -05:00
Benjamin Cabanes cb5a8ff8af docs(nx-dev): update plan references from Pro to Team (#28963)
Replaced mentions of "Pro plan" with "Team plan" across several documentation files to reflect the updated plan structure.
2024-11-15 14:03:38 -05:00
Benjamin Cabanes 090cadf866 docs(nx-dev): add MinIO icon & adjust nx powerpack cache layout (#28962)
Integrate a new MinIO icon into the UI icons library and Nx Powerpack features. Adjust the layout and styling of the Nx Powerpack features to improve flexibility and responsiveness.
2024-11-15 14:01:34 -05:00
Juri fc2016cc8a fix(nx-dev): disable notifier for now 2024-11-15 19:55:13 +01:00
Craigory Coppola 5176a1ea4b fix(core): ensure process is kept alive when plugin communication in progress (#28948)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
When using NX_PLUGIN_NO_TIMEOUTS there is not a reference counted as the
setTimeout is not called. This could theoretically result in node
killing the process if the only thing that was keeping it alive was the
plugin call.

## Expected Behavior
A ref is tracked either way to prevent the process from getting dropped.

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

Fixes #
2024-11-15 12:40:27 -05:00
Aaron Casanova 3763baf77f docs(misc): update reference to sharedGlobals (#27625) 2024-11-15 12:38:10 -05:00
Ikko Eltociear Ashimine e6d8437fa2 docs(react-native): update run-android-examples.md (#27771)
avaiable -> available

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-15 12:36:45 -05:00
Jonathan Cammisuli 2c0592503a docs(core): add information for s3 compatible providers (#28925)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-15 11:28:38 -05:00
Nicholas Cunningham 1b7cd9b86f fix(webpack): sourceMap type should accept all types of sourceMaps (#28947) 2024-11-15 15:57:10 +00:00
Benjamin Cabanes 2d5acec2d1 docs(nx-dev): add credit pricing section (#28946)
It renames the ResourceClasses component to CreditPricing and updates its references throughout the application. It also includes additional non-compute pricing information and a more detailed breakdown of credit costs associated with various CI/CD operations for Nx Cloud.
2024-11-15 10:18:34 -05:00
Younes Jaaidi 88017bb96c chore(angular): recover mistakenly removed test (cf. #28694) (#28954) 2024-11-15 12:29:08 +01:00
Petr Plenkov 39f0b6f539 docs(linter): mention that eslint.config.cjs is supported (#28265)
## Current Behavior
Currently it is already possible to use `eslint.config.cjs` because of
this
[line](https://github.com/nrwl/nx/blob/c655b6cf4f8c65a03edde1ff3c79a7ba093b5c48/packages/eslint/src/utils/flat-config.ts#L7):

However docs section doesn't mention it

## Expected Behavior
This commit is supposed to mention this feature in the plugin
documentation

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2024-11-15 11:36:15 +01:00
Dmitry Zakharov 0d6ad2b1b0 feat(core): add eslint vscode extension on eslint init (#28573)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 create fresh angular or react integrated project no eslint
extension out of the box. Few years ago I fill the issue
https://github.com/nrwl/nx/issues/7047 about deprecated tslint extension
looks like that has been deleted but without change to eslint extension
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
when I create angular / react project eslint extension should be added
to recommended vscode extensions
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-11-15 11:04:52 +01:00
pawel-twardziak 3c6c38773b fix(nest): repair nestjs service generator schema (#28928)
# Related Issue(s)

Fixes #28910
2024-11-14 14:26:34 -07:00
Colum Ferry 0686892ac8 fix(rspack): do not global styles as entrypoints (#28941)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Setting global styles as entry points in rspack causes HMR to fail


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Rspack does not require styles to be set as entrypoints as it will be
handled by the CssExtractPlugin.
Remove the entries

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

Fixes #
2024-11-14 14:25:21 -07:00
Mike Hartington b627c1f8af docs(core): add cors blog post (#28938)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-14 15:52:38 -05:00
Colum Ferry ae7a84a47c fix(rspack): withModuleFederationForSSR should use commonjs-module as library (#28944)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 navigating directly to a route that renders a portion of a remote
app, SSR was not correctly server rendering the remote portion.
This was because of the output type provided to rspack and MFP

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure commonjs-module is set as output type for MF with SSR

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

Fixes #
2024-11-14 15:43:19 -05:00
Colum Ferry 36236776cc fix(core): typo in readme for CNW (#28942)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-14 19:51:07 +00:00
Isaac Mann 3cac60084f docs(core): fix npm workspace typos (#28943)
Fix some typos
2024-11-14 14:44:33 -05:00
Nicholas Cunningham da60c38a34 feat(rspack): update executor to be in line with webpack (#28913)
This PR brings the rspack executor `@nx/rspack:rspack` inline with
webpack.

It also prepares the executor to be used with the soon to be implemented
`NxRspackAppPlugin` so that we can support executor and inferred
targets.
2024-11-14 18:31:54 +00:00
Juri Strumpflohner d8f9161f85 docs(release): small update to make phases of version plan stand out more (#28875) 2024-11-14 19:54:10 +04:00
Isaac Mann 45401846b7 feat(nx-dev): version picker (#28828)
Adds a version picker to the footer of nx.dev
2024-11-14 10:27:26 -05:00
Younes Jaaidi 668913e1ce chore(angular): remove superfluous test (#28694)
We always use .mts extension. It is not conditional anymore.
2024-11-14 05:01:17 -05:00
Jack Stevenson e32079ce3b fix(js): skip tsc batch builds for implicit dependencies (#28840)
Implicit dependencies are not referenced in code and therefore TSC
incremental builds are not applicable.

## Current Behavior
A project using the `@nx/js:tsc` executor will fail to build if it has
implicit dependencies on projects which do not use the `@nx/js:tsc`
executor.

To reproduce:
* Clone https://github.com/cogwirrel/nx-tsc-batch-implicit-deps-example
* `pnpm i && pnpm nx run-many --target build --batch --all`

## Expected Behavior
- Implicit dependencies that do not use the `@nx/js:tsc` executor are
permitted. For example, a TypeScript project may implicitly depend on a
Python project, but the TypeScript project should still be buildable in
batch mode.
- Projects using the `@nx/js:tsc` executor will still fail to build if
they have explicit dependencies on projects which do not use the
`@nx/js:tsc` executor.

Tested by publishing to the local registry, upgrading the [example
repo](https://github.com/cogwirrel/nx-tsc-batch-implicit-deps-example)
to use my local version, and built successfully in batch mode.

## Related Issue(s)
Fixes #28839
2024-11-14 07:59:27 +00:00
Julia Passynkova 82bb0a6e5f docs(angular): fix type esbuildMidleware (#28777)
Fix type esbuildMidleware. Should be esbuildMiddleware

closed #28774

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-14 08:23:53 +01:00
Michal Jez 1163eb5c50 cleanup(linter): remove unused basePath parameter (#28549)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

I was looking at the source to understand how `sourceRoot` is used and
saw it was referenced in the eslint-plugin but it turns out it isn't
actually used

## Current Behavior

This parameter isn't used

## Expected Behavior

The parameter should be removed
2024-11-14 08:20:21 +01:00
Jason Jean 08953af5ec chore(module-federation): add public publish access (#28926)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/module-federation` cannot be published because it doesn't have
public publish access

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

`@nx/module-federation` can be published.

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

Fixes #
2024-11-13 13:32:51 -05:00
Isaac Mann 0983ba52bc docs(core): nx command related docs (#28891)
Adds related documents to Nx commands API reference pages
2024-11-13 12:07:00 -05:00
Jason Jean 7f4fc50dfb fix(core): create different dummy tasks for different parent tasks an… (#28923)
…d dependency targets

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

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

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

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

Dummy tasks are given an ID containing the parent task's target.
Multiple parent tasks can create the same dummy task which overrides
other dummy tasks.

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

Dummy tasks are given an ID containing the dependency and the parent
tasks's name. This means different parent tasks will create different
dummy tasks instead of overriding other ones.

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

Fixes #
2024-11-13 11:53:59 -05:00
Jason Jean 538a4f2722 chore(repo): disable parallelism for nx-dev:build-base and separate it from test tasks (#28887)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Running `nx-dev:build-base` takes a lot of memory and particularly if it
is run after `test` tasks, it will cause agents to run out of memory.

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

I don't have a fix for the task taking up a lot of memory... but I do
have a fix which will alleviate the issue. I've split up `test` tasks
and `nx-dev:build-base` to run on different agents.

We should still look into how to make this task not take up so much
memory. What I've learned is that prerendering pages for `nx-dev` has a
memory leak so we should investigate what during prerendering a page is
not cleaned up properly.

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

Fixes #
2024-11-13 11:33:16 -05:00
MaxKless be8029d5dd fix(core): lower socket path by 10 chars to reduce chances of too-long paths (#28920)
## Current Behavior
Socket paths have quite a short allowed length. It's easy to hit the
maximum.

## Expected Behavior
We should exceed the maximum as rarely as possible. By lowering the
workspacePath hash portion, we reduce the chances of exceeding the path.

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

Fixes https://github.com/nrwl/nx/issues/27725
2024-11-13 17:18:50 +01:00
Benjamin Cabanes 7c3d12f763 docs(nx-dev): update plan limits (#28921) 2024-11-13 10:42:27 -05:00
Leosvel Pérez Espinosa 907e58fda7 fix(js): handle outputFileName correctly when generating package json (#28915)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28894
2024-11-13 15:43:01 +01:00
Colum Ferry dbaeb86102 chore(rspack): move apply-react-config to plugins/utils directory for consistency (#28918)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-13 13:45:02 +00:00
Colum Ferry 0392a67a70 fix(rspack): ensure swc provides react runtime automatically (#28916)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Rspack w/ SWC requires setting `runtime: 'automatic'` to allow React
global to be set in browser


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Set `runtime: 'automatic'`

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

Fixes #
2024-11-13 12:21:31 +00:00
Leosvel Pérez Espinosa dc8f29cc36 feat(angular): add poll option to ng-packagr executors (#28909)
Add `poll` option to the ng-packagr executors. This change was made
upstream for Angular v18, but it was missed on the Nx executors.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-13 10:13:40 +01:00
Leosvel Pérez Espinosa 5c7d4d1fbf cleanup(angular): remove invalid metadata from schemas (#28908)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-13 10:13:20 +01:00
Nicholas Cunningham cda7f26c16 feat(rspack): update withReact plugin for parity with webpack plugin (#28812)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-12 20:00:26 +00:00
Leosvel Pérez Espinosa f7f26d847e feat(nx-plugin): add support for the ts solution config setup to the @nx/plugin plugin (#28724)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-12 14:25:31 -05:00
Emily Xiong 2d77495cc5 fix(core): set default branch to main if no git (#28854)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-12 13:13:17 -05:00
Colum Ferry 048f7c61af feat(rspack): move logic for withNx to applyBaseConfig and bring in line with webpack (#28825)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
`withNx` from `@nx/rspack` is not reflective of what `@nx/webpack` does.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Bring `withNx` in line with `@nx/webpack`

## Notes
2024-11-12 11:44:29 -05:00
Colum Ferry cd121bd5ee fix(angular): when unit test runner is set to none library component should not generate spec file (#28906)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 unitTestRunner is set to none, spec files are still generated


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
SkipTests when unit test runner set to none

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

Fixes #
2024-11-12 16:38:17 +00:00
Jason Jean a3dbc40b1a chore(repo): add back heartbeat (#28365)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 Cloud Heartbeat was disabled temporarily.

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

Nx Cloud Heartbeat is enabled again

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

Fixes #
2024-11-12 10:57:41 -05:00
Benjamin Cabanes f3d5787f97 docs(nx-dev): add click tracking on pricing plans (#28902) 2024-11-12 10:33:15 -05:00
Colum Ferry 06af0ee53b feat(module-federation): add initial module-federation package (#28783)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
We do not currently have an `@nx/module-federation` package to house the
shared executors and utils for Module Federation across `Webpack`,
`Rspack` and `Angular`.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Create a single package to store the Module Federation capabilities
within Nx

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

Fixes #
2024-11-12 14:04:44 +00:00
Nicholas Cunningham 1e1cd3a0c5 fix(nx-dev): update course API to ignore system OS Metadata file (#28886)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-12 02:29:40 -07:00
Jason Jean c21b039dd0 fix(core): reduce time it takes to require nx commands (#28884)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/src/command-line/nx-commands` takes ~88-91ms on my machine to
require which needs to happen for every single Nx command.

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

`nx/src/command-line/nx-commands` takes ~30-33ms on my machine to
require.

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

Fixes #
2024-11-11 17:18:24 -05:00
Rares Matei 19b0828d27 docs(nx-cloud): mention webhook events (#28815)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-11 15:43:51 -05:00
Benjamin Cabanes 0b6ca49bda docs(nx-dev): update plans (#28877)
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-11-11 15:10:00 -05:00
James Henry 5be5579a3c fix(release): ensure dependents that are both direct and transitive are not bumped twice (#28878) 2024-11-11 23:33:14 +04:00
Isaac Mann 37e31bea57 docs(core): fix search indexing errors (#28858)
Fix search indexing errors
2024-11-11 14:15:17 -05:00
Colum Ferry f3889e4873 feat(remix): ensure migrations point to latest remix verison (#28876)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Latest migrations for Remix will install verions `2.13.1`.
The latest version of remix packages is `2.14`

We also were not updating auxillary @remix-run/* packages, including
server adapters.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure version `2.14` is installed
Ensure auxillary packages are migrated


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

Fixes #
2024-11-11 19:11:39 +00:00
Emily Xiong 18bba6f4f7 fix(core): Remove warning when Nx is not installed globally (#28868)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-11 12:46:55 -05:00
Nicholas Cunningham d4b9e0dc30 fix(nextjs): update default next-env (#28861)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
The current next-env.d.ts is outdated so when you run `nx build` Next.js
would update the `next-env.d.ts` file which would trigger git changes
due to the outdated content.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When you run `nx build` the `next-env.d.ts` ideally should not update
from what is generated OOTB.

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

Fixes #
2024-11-11 11:57:25 -05:00
James Henry 0fd3442e47 fix(core): cross-workspace implicitDependencies should be safely ignored (#28845) 2024-11-11 20:32:11 +04:00
Benjamin Cabanes cc251e4378 docs(nx-dev): use localstorage for livestream banner (#28880) 2024-11-11 10:42:27 -05:00
Jason Jean 258a2566f1 fix(core): do not use unix dotfile locks (#28859)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 unix dotfiles are incompatible with posix dotfiles. Having the 2
modes being switched between yields weird errors.

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

Posix dotfiles seem fine for what we're doing so Nx will stick with that
mode for all cases.

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

Fixes #
2024-11-11 09:01:20 -05:00
Shantanu Jain d2c1067a08 fix(release): support workspace root as a subdirectory of git root (#28650) 2024-11-11 17:34:49 +04:00
Juri b0a4291f05 docs(core): move nx release, MF and Nx Console recipes further up 2024-11-11 14:07:23 +01:00
Juri 4bec699709 docs(misc): embed videos in various docs pages 2024-11-11 14:06:46 +01:00
Ahmed Hakeem 3643f66b61 fix(graph): enable action on the ViewOnGraph button regardless of the… (#28863)
## Current Behavior
ViewOnGraph button doesn't work until you open the accordion

## Expected Behavior
ViewOnGraph button should direct to graph without the need to open the
accordion first.

I believe it's better from the UX prespective that user shouldn't click
twice on the same button to fire its action.
2024-11-11 11:50:53 +01:00
Leosvel Pérez Espinosa f56e0a30bf fix(devkit): do not write back to package.json when adding plugin and there are no changes (#28846)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Generators adding plugins to `nx.json` can modify projects'
`package.json` files with some JSON serialization changes even though
there are no actual changes and prettier is not installed, so they
shouldn't be formatted.

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

Generators adding plugins to `nx.json` should not modify projects'
`package.json` files with JSON serialization changes when there are no
actual changes to make and prettier is not installed.

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

Fixes #
2024-11-11 10:50:21 +01:00
Jason Jean 77d6704ac4 chore(repo): update nx to 20.1.0-beta.3 (#28860)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

This repo uses Nx `20.1.0-beta.2`

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

This repo uses Nx `20.1.0-beta.3`

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

Fixes #
2024-11-08 18:03:13 -05:00
Craigory Coppola 0d7f226338 fix(core): shutdown plugin workers when disconnected (#28857)
Currently we send a message to the plugin to shutdown when the parent
process either dies or is ready for them to shutdown. This works, but
fails when the host process is killed with a sigterm as the cleanup
can't run. This PR shifts the strategy such that whenever the one and
only socket connection ends, the plugin automatically shuts down
2024-11-08 17:05:05 -05:00
Jason Jean 7f39dc1852 fix(core): do not depend on ci info crate (#28850)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 way VS Code / Nx Console starts the daemon makes the ci info rust
crate believe that the daemon process is running in CI. This starts the
database using the unix dotfile... which causes issues

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

The ci info rust crate is not used, we have our own logic which is
identical to the JS logic we have.

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

Fixes #
2024-11-08 15:28:13 -05:00
Craigory Coppola 158d343ec2 fix(misc): update generators to use autocomplete instead of select when possible (#28851) 2024-11-08 12:51:30 -05:00
Jason Jean c50269a61a fix(core): create different dummy tasks for different targets (#28837)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Task dependencies were getting conflated between different targets. If
nx runs lint tasks which depend on TaskA and test tasks which depend on
TaskB... the task graph was reporting that both lint and test tasks
depended on TaskA.. which is incorrect.

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

Task dependencies are not conflated between different targets. If lint
tasks depend on TaskA and test tasks depend on TaskB.. then... lint
tasks will truly depend on TaskA and test tasks will truly depend on
TaskB properly.

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

Fixes #
2024-11-08 08:02:19 -05:00
Jason Jean 6882ad14e4 chore(repo): update nx to 20.1.0-beta.2 (#28813)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

This repo uses Nx 20.0.7

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

This repo uses nx 20.1.0-beta.0

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

Fixes #
2024-11-07 16:49:40 -05:00
MaxKless 0d746ef587 fix(graph): add better pdv empty states when no targets exist (#28797) 2024-11-07 17:02:16 +01:00
Juri Strumpflohner a1fe42b158 feat(nx-dev): add video course page (#28736)
https://nx-dev-git-video-course-nrwl.vercel.app/courses
2024-11-07 10:03:04 -05:00
Juri Strumpflohner 6a3d864ba1 fix(nx-dev): SEO tags (#28823)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-07 09:15:50 +01:00
Colum Ferry fd2e8d0f55 feat(rspack): move logic for withWeb to applyWebConfig and bring in line with webpack (#28803)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
`withWeb` from `@nx/rspack` is not reflective of what `@nx/webpack`
does.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Bring `withWeb` in line with `@nx/webpack`

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

Fixes #
2024-11-06 21:13:56 -05:00
Isaac Mann 2c9fc572f0 docs(core): update on-premise redirects (#28822)
Redirects on-premise docs to https://github.com/nrwl/nx-cloud-helm
2024-11-06 14:56:42 -07:00
Jonathan Cammisuli bc1a6cf40b fix(core): ensure that the database connection is closed when nx exits (#28821)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

DB connections are sometimes left open.

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

DB connections are closed when the process exits

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

Fixes #
2024-11-06 16:52:17 -05:00
Nicholas Cunningham 6afc28650e fix(core): jest plugin should work with nodenext set in tsconfig (#28820)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 you create a new project using the new ts setup to support ts
project references jest does not work out of the box due to
incompatibility with the module being set inside tsconfig to `nodenext`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Jest should work out of the box with our current setup

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

Fixes #
2024-11-06 14:46:14 -07:00
Louie Weng a22a43141b feat(nx-cloud): configure import paths for light client when running … (#28735)
…login/logout

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 you call `nx login` and `nx logout`, we did not pass in import
paths to node modules so the displayed messages for each command were
just raw text.

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

When you call `login` or `logout`, you get formatting on the command
output.

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

Fixes #
2024-11-06 13:17:56 -08:00
Craigory Coppola a5920e3845 fix(core): empty external deps should work properly (#28727) 2024-11-06 14:55:16 -05:00
Miroslav Jonaš ee7b001ec9 fix(repo): update version of actions/github-script in nightly script (#28784)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-06 14:50:32 -05:00
Emily Xiong 9c245667c2 fix(core): task graph needs to handle multiple cycles (#28793)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
- getNonDummyDeps is a recursive function. we pass in cycle arg to this
function. currently we end the recursion when the task is in a cycle.
however, currently there is an error "Maximum call stack size". i
suspect this recursion is not being ended because the cycle is not
detected when there are multiple cycles.
- add a function to get all cycles of the graph
- also, change getNonDummyDeps to track a list of seen tasks, even with
no cycle detected, this function will not run into infinite recursion

## 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/28788
2024-11-06 14:49:59 -05:00
Emily Xiong 906cc1aceb fix(core): fix cannot read properties of undefined (reading 'split') (#28761)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/27736 and
https://github.com/nrwl/nx/issues/27736
2024-11-06 13:45:42 -05:00
Jonathan Cammisuli b14d5c5d5b fix(core): revert archive file creation changes (#28817)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-06 10:50:15 -05:00
Thu Vo bd40a56e19 docs(release): version prefix dependents (#28729) 2024-11-06 14:57:25 +04:00
Zachary DeRose 51f47f0329 docs(misc): nx 20 video added (#28600)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-06 02:02:39 +00:00
Colum Ferry b69ef46dcd fix(rspack): remove unnecessary required properties in schema validation (#28796)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/rspack:rspack` executor had listed other properties as required
in the schema that could have been set by the rspack config.



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Make those properties optional and add validation after config is
resolved

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

Fixes #
2024-11-05 17:47:49 +00:00
Colum Ferry be7bfa4820 fix(nuxt): use loadNuxtConfig to load nuxt config for plugin (#28795)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
We switched to using `loadConfigFile` from `@nx/devkit` to load Nuxt
Config files when plugins were not isolated.
However, they are now, so we can use `loadNuxtConfig` again.

The effect of using `loadConfigFile` paired with Nuxt's auto-imports
resulted in inconsistent failures.



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use `loadNuxtConfig` when `NX_ISOLATE_PLUGINS=true`


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

Fixes #28506
Fixes #28374
2024-11-05 12:27:09 -05:00
Colum Ferry 7e3f256756 fix(rspack): move main validation to implementation (#28794)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
We currently have validation for the `main` property in the `executor`
schema, however, this value could be defined in the `rspack.config`
file.
This can cause an inaccurate schema validation error

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
After loading the config file and applying the executor options, run
validation over the config.

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

Fixes #
2024-11-05 12:22:49 -05:00
Juri 75a73ed0e7 feat(nx-dev): add customer case studies 2024-11-05 13:52:16 +01:00
Isaac Mann 5ddcb565d9 docs(core): add azure and gcs powerpack plugins (#28668)
- Adds powerpack-gcs-cache plugin docs
- Adds powerpack-azure-cache-plugin docs
- Removes a duplicate rspack entry on the /nx-api page

---------

Co-authored-by: Jonathan Cammisuli <jon@cammisuli.ca>
2024-11-05 07:48:24 -05:00
James Garbutt e2f5eaabb5 cleanup(webpack): migrate to picocolors (#28315) 2024-11-05 13:13:54 +04:00
James Garbutt 5d21f215a4 cleanup(core): use built in function to strip control chars (#28778) 2024-11-05 13:13:01 +04:00
Jonathan Cammisuli b925f8ccfa fix(core): ensure that setWorkspaceContext is run only on main nx packages (#28706)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 running postinstall with Nx, we create a files archive file. When
there are multiple versions of nx installed, the post install would run
for all versions. This causes issues where one version might overwrite
the archive files while another version is writing to the same location.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `setupWorkspaceContext` is now only ran when we detect that it is
the main nx package. This also makes the creation of the archive file
more atomic so that we dont overwrite files while its being written by
other processes

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

Fixes #
2024-11-04 21:23:20 -05:00
Dmitry Zakharov bb878aa033 feat(linter): add support eslint 9 --quiet param (#28743)
closes #28291

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 9 support --quiet param for not run warn rules, but nx not pass
that param directly
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
nx executor should pass --quiet directly to eslint
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28291
2024-11-04 16:15:59 -05:00
Phillip Barta dbabfa7d2c cleanup(core): update @yarnpkg/parsers to a stable version (#27666) 2024-11-05 00:43:15 +04:00
Jack Hsu 8e4f9f55b7 chore(repo): enable DB and verbose logging for module federation tests (#28792)
This can help us debug issues that come up during these tests.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-04 15:08:15 -05:00
Mathieu Guilbault c08d995290 docs(core): fix grammar (#28697)
fix grammar

---------

Co-authored-by: Isaac Mann <isaacplmann@gmail.com>
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-11-04 19:55:47 +00:00
Isaac Mann 052a62685f chore(nx-dev): disable nx-dev-e2e (#28789)
Disable the e2e tests for nx-dev
2024-11-04 14:00:01 -05:00
Emily Xiong 277c58fbcc feat(expo): use createNodesV2 (#28005)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-04 13:56:42 -05:00
Colum Ferry 735300c63e feat(rspack): make target property optional (#28785)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `target` property is currently required by the `@nx/rspack:rspack`
executor, but is not by the `@nx/webpack:webpack` executor.
This can make migrating between the two a little more difficult.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Target should be handled by Nx's `withWeb` helper or set intentionally
by the user in their `rspack.config` file.

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

Fixes #
2024-11-04 17:28:00 +00:00
Emily Xiong 2b2866ac89 fix(core): fix create workspace for react native (#28763)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/26805
2024-11-04 11:47:36 -05:00
Phillip Barta 38448da34f feat(bundling): add createNodesV2 for rollup plugin (#28090)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
There should be an implementation for `createNodesV2`.

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

Fixes #
2024-11-04 10:07:49 -05:00
Egor Kuzin 7ba7f3e798 fix(vite): tsconfig paths plugin should resolve file with dot in the name (#28701)
closed #28615

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28615
2024-11-04 10:00:02 -05:00
Armin Gerina 39b0a6c959 chore(nextjs): bump Next.js version to 14.2.16 (#28782)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Currently, the Next.js version in @nx/next is set to 14.0.3, which lacks
the latest features and improvements available in the 14.2.16 release.
Additionally, the current version has known vulnerabilities:


[GHSA-gp8f-8m3g-qvj9](https://github.com/advisories/GHSA-gp8f-8m3g-qvj9):
Cache Poisoning vulnerability in Next.js (versions before 14.1.0)

[GHSA-g77x-44xx-532m](https://github.com/advisories/GHSA-g77x-44xx-532m):
Denial of Service (DoS) condition in Next.js image optimization
(versions before 14.2.0)

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
With this PR, the Next.js version in @nx/next is updated to 14.2.16,
addressing the listed vulnerabilities and bringing in the latest
features and bug fixes.

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

Fixes #
2024-11-04 09:50:18 -05:00
Colum Ferry 48db8ddc04 chore(react): separate module federation tests into separate test files for better distribution (#28765)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 tests take ~21-25mins

![image](https://github.com/user-attachments/assets/771f6314-2fba-4340-9617-d7fb0dd40c93)


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Module Federation tests take ~11-13mins

![image](https://github.com/user-attachments/assets/9a720178-5f0c-4b60-a3af-53b3f0db1111)


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

Fixes #
2024-11-04 08:23:13 -05:00
Juri eea38d760a docs(core): update pinned posts 2024-11-04 13:29:36 +01:00
Rares Matei ba762101ad docs(nx-cloud): fix formatting and wording (#28749)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-04 12:03:20 +00:00
Isaac Mann 796862d9f4 docs(core): add martin hochel as a champion (#28755)
Adds @Hotell as an Nx Champion
2024-11-04 06:13:58 -05:00
Benjamin Cabanes c290b37cbd docs(nx-dev): add nx powerpack enterprise trial (#28712) 2024-11-01 17:43:37 -04:00
Benjamin Cabanes 856c8bcb72 docs(nx-dev): update nx powerpack title meta (#28759) 2024-11-01 17:43:20 -04:00
Benjamin Cabanes af22a41d6a docs(nx-dev): update give a star button styles (#28760) 2024-11-01 17:43:03 -04:00
Benjamin Cabanes a89e34cfca docs(nx-dev): add star github button on intro (#28758) 2024-11-01 17:42:44 -04:00
Isaac Mann b9c1f0b58e fix(testing): install playwright with-deps (#28738)
Uses the `--with-deps` flag when running `playwright install` in the
`ci-workflow` generator
2024-11-01 15:52:24 -04:00
Colum Ferry 1777d29ccb chore(react): cleanup react e2e test name (#28754)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-01 19:20:27 +00:00
Nicholas Cunningham 0706c7f68c fix(nextjs): Formatting for pages (#28734)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28561
2024-11-01 13:04:15 -06:00
Emily Xiong 9a88ea8906 fix(expo): allow yarn 4 to install for build local (#28603)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/28121
2024-11-01 14:50:47 -04:00
Emily Xiong c43c179432 feat(core): upgrade semver to 7.6.3 (#28716)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/28451
2024-11-01 14:50:33 -04:00
Jack Hsu 0c852e60de chore(repo): update to nx 20.0.7 (#28746)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-01 14:12:51 -04:00
Jack Hsu 8e460f16d1 fix(webpack): update stylus version to fix security issue (#28646)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28541
2024-11-01 13:00:26 -04:00
Colum Ferry 4f4b54609b fix(react): ensure module federation template files are indented correctly (#28753)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-01 16:49:37 +00:00
Jack Hsu 80ef3ee544 chore(repo): allow NX_NATIVE_LOGGING to be passed to commands within e2e tests (#28752)
…e2e tests

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-11-01 12:28:16 -04:00
Philip Fulcher a51f02f517 docs(nx-dev): fixes for sports retailer post (#28739) 2024-11-01 10:27:46 -06:00
Colum Ferry 0f25b3c42e feat(module-federation): use module-federation runtime for dynamic federation (#28704)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
We currently have hombrewed support for Dynamic Module Federation.
However, Module Federation 2.0 comes with more powerful helpers to
handle dynamic federation.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
For new host projects using dynamic federation, use the Module
Federation Runtime.
For existing hosts using Nx's dynamic federation, continue to use it
when adding new remotes to it.
Deprecate Nx's dynamic federation helpers with intended removal in Nx 22

### Example Screenshot of Deprecation Message
<img width="810" alt="image"
src="https://github.com/user-attachments/assets/6c6a9504-6d89-497b-9259-9272b3f47276">


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

Fixes #
2024-11-01 16:01:33 +00:00
Colum Ferry ab8d77e719 fix(rspack): ensure NX_PUBLIC env vars are available to applications #28720 (#28751)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
With Webpack, we setup DefinePlugin to define `NX_PUBLIC` env vars.
This was not replicated in Rspack


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure `NX_PUBLIC` env vars are included in the DefinePlugin

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

Fixes #28720
2024-11-01 11:59:56 -04:00
Jonathan Cammisuli 276e799d40 chore(core): enable db logging on ci and agents (#28744) 2024-11-01 10:08:54 -04:00
Emily Xiong 9adb9e00be fix(core): fix dependency with multiple dependent packages (#28669)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
- we introduce a feature to allow circular project dependencies to
execute tasks in pr https://github.com/nrwl/nx/pull/28227/files
- for this feature, we introduce the concept of dummy task as a
temporary placeholder so we can still generate a task graph even if
dependencies contain circular dependencies
- however, it does not handle a task graph of multiple dummy task deps.
for example:
lib1 -> lib2 -> lib3 -> lib4
if we got task graph like:
lib1:build -> lib2:dummy
lib2:dummy -> lib3:dummy
lib3:dummy -> lib4:rebuild
currently, it does not create a dependency between
lib1:build->lib4:prebuild

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
it should link the dependency when it contains multiple level of
depending on dummy tasks

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

Fixes https://github.com/nrwl/nx/issues/28599 and
https://github.com/nrwl/nx/issues/28380
2024-10-31 23:33:04 -04:00
Isaac Mann d4f4dac2eb docs(core): remove on-premise docs (#28730)
Removes the on-premise docs in favor single tenant and the
nrwl/nx-cloud-helm repo
2024-10-31 16:42:56 -04:00
Isaac Mann d960ddd40f fix(nx-dev): breadcrumbs extra text with query param (#28732)
Breadcrumb component was incorrectly showing extra text when the url has
a query parameter.
2024-10-31 14:55:43 -04:00
Jack Hsu 0ad7c6b5b4 fix(nextjs): do not generate spec files if unitTestRunner is not set programmatically (#28733)
This PR fixes an issue where `create-nx-workspace` with Next.js preset
generates with Jest spec files, but does not install
`@testing-library/react` correctly due to not checking the normalized
schema file.

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

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

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

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

## 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-10-31 14:51:21 -04:00
Nicholas Cunningham b89a62e89a fix(nextjs): Fix json spread typo (#28728)
closes: #28703

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-31 12:34:06 -06:00
Leosvel Pérez Espinosa 6af298d0a9 feat(testing): add support for the ts solution config setup to the cypress plugin (#28637)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-31 18:29:53 +01:00
Nicholas Cunningham c2e31127d9 feat(core): Update plugin generators so that they are formatted by default (#28593) 2024-10-31 12:14:21 -04:00
Jack Hsu 178d93d9c0 feat(testing): add disableJestRuntime option to @nx/jest/plugin to speed up target inference (#28522)
This PR adds a new `disableJestRuntime` option to `@nx/jest/plugin`. By
setting this to `true`, the inference plugin will not use `jest-config`
and `jest-runtime` to retrieve `outputs`, nor matching spec files when
`ciTargetName` is used. Instead, we'll use our own config loader and
glob/matcher to get both values for the inferred targets.

This speeds up computation quite a bit. With a large monorepo (800
projects, 75K files), the computation goes from 2m 41s to 35s, or ~78%
time reduction.

NOTE: This has no effect on existing projects and needs to be opted
into.


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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-31 11:48:43 -04:00
Jonathan Cammisuli 4014662986 fix(core): fix powerpack license information grammar (#28725) 2024-10-31 10:26:18 -04:00
MaxKless 93b9b71e31 docs(core): remove mention of node_modules/.cache/nx from yarn pnp docs (#28722)
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-10-31 14:42:24 +01:00
Jack Hsu e22d65eeea feat(testing): split atomized outputs for Playwright and Cypress CI targets (#28682)
This PR updates `@nx/playwright/plugin` to create non-conflicting
outputs for atomized tasks.



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

## Current Behavior
Outputs from `outputDir` and reporters are the same for each atomized
task, which results in missing outputs.

## Expected Behavior
All outputs should be captured and cached correctly.

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

Fixes #
2024-10-31 09:40:29 -04:00
Rares Matei af33660be2 docs(nx-cloud): add release notes for enterprise version (#28698)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-31 09:23:51 +00:00
Rares Matei e3773a5a63 docs(nx-cloud): update custom github app instructions (#28708)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-31 09:15:45 +00:00
Nicholas Cunningham ce05a98476 fix(nextjs): Add deprecation message for svgr (#28705)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Currently, if you are using Next.js 15 have SVGR enabled via `WithNx`
and are using turbopack. You could potentially have issues loading your
svg. This happens because of how webpack imports svg and not having an
additional configuration for turbopack (currently it is under the
experimental option).

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Moving forward, we can call this out and deprecate the option to be
removed in Nx 21. As such should you need to use SVGs it is recommended
to do so manually. Something similar to [this
comment](https://github.com/vercel/turborepo/issues/4832#issuecomment-1751407444).

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

Fixes #
2024-10-30 18:52:18 -06:00
Nicholas Cunningham faf448379d fix(nextjs): Remove deprecated export executor (#28702)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-30 18:10:47 -06:00
Nicholas Cunningham 51bed0e456 feat(nextjs): add support for typescript Next.js config file (#28709)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28572
2024-10-30 16:15:48 -04:00
Jonathan Cammisuli 63b745e8c3 fix(core): retry more db operations (#28667) 2024-10-30 11:45:34 -04:00
Zachary DeRose 125675079c docs(misc): adding nx import blog post (#28686)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-30 11:16:36 -04:00
Colum Ferry c65f344bed fix(angular): use vitest generator instead of vite config generator (#28696)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Using the viteConfigGenerator leads to build and serve targets being
overriden


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use the `vitestGenerator` to only add the test target

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

Fixes #
2024-10-30 15:23:54 +01:00
Colum Ferry 9e598a6c1a fix(vite): add correct gitignore pattern for vite timestamp files #28685 (#28693)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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


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

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

Fixes #28685
2024-10-30 13:38:06 +00:00
Leosvel Pérez Espinosa 1e0423bcda fix(js): provide absolute paths to hashFile function in @nx/js/typescript plugin (#28690)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-30 08:29:41 -04:00
Younes Jaaidi dbbc3fcae6 fix(vite): include vite mts config files (#28691)
Add `vite.config.mts` and `vitest.config.mts` to `vitest.workspace.ts`
and `tsconfig` files.

- Angular generator creates vite.config.mts files.
- Users might also use mts files.

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

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

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

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

`vite.config.mts` and `vitest.config.mts` were ignored in
`vitest.workspace.ts`.
They were not included in the tsconfig files neither.

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

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2024-10-30 11:40:16 +00:00
Colum Ferry d8d6d13c9e fix(linter): ensure .cjs config file is handled correctly for generators #28214 (#28672)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
When the workspace has `eslint.config.cjs` at the root, generation of
new lint projects currently does not check for it correctly


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure utils continue to work as expected when `eslint.config.cjs` is
detected at the workspaceRoot

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

Fixes #28214
2024-10-30 11:39:58 +01:00
Juri 62f58ebfee docs(core): update import page with new vid link 2024-10-29 23:18:13 +01:00
Juri 46769b3c18 feat(nx-dev): linkable resources page 2024-10-29 22:05:04 +01:00
Jonathan Cammisuli 0aa79c82ec fix(core): fix checks for wasm in db operations (#28676) 2024-10-29 16:10:14 -04:00
Younes Jaaidi 9fe8274367 feat(angular): add vitest option to angular (#27311)
- This adds `vitest` option to `unitTestRunner` for Angular generators.
- This **does not** add vitest option to `create-nx-workspace` but I
think we should provide this as an option in the future. Please let me
know if you wantme to add this here or as a future feature.

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2024-10-29 14:31:48 -04:00
Emily Xiong c0c7ad7efc fix(core): not install cypress when e2e is playwright for react monorepo preset (#28642)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior

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

Fixes #

Co-authored-by: Benjamin Cabanes <3447705+bcabanes@users.noreply.github.com>
2024-10-29 13:46:19 -04:00
Colum Ferry 5a3fd0e1cf fix(module-federation): add comment clarifying default export in config file (#28675)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-29 17:14:20 +00:00
Jack Hsu aec53a0406 feat(misc): remove handling of @nrwl scope (#28589)
This PR removes logic where we handle both `@nx/` and `@nrwl/` scope.
The latter scope has stopped being published in v20, and are no longer
relevant.

- Cleans up e2e
- Removes references to `@nrwl/` scope in our generators and executors
- Removes `@nrwl/` from `nx/package.json` `packageGroup`
- Cleans up documentation quality script
2024-10-29 11:04:44 -04:00
Tobias Engelhardt fb9c5ede84 fix(core): update http-proxy-middleware (#28607)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28577
2024-10-29 08:40:12 -04:00
Colum Ferry af9d980f34 feat(remix): generate remix vite application (#28555)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
We currently still generate Remix Classic applications


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We should generate Remix Vite applications

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

Fixes #
2024-10-29 08:38:13 -04:00
Lorenzo a9dbc71e9d fix: add required minimizer setting to the generated Nest rspack conf… (#28629)
## Current Behavior
When using Nest.js in combination with [decorator
metadata](https://docs.nestjs.com/fundamentals/execution-context#reflection-and-metadata),
the class names and handlers become mangled/compressed causing them to
lose the reference to the correct class/handler name.

## Expected Behavior
The decorator metadata works as intended.

## Approach
This PR implements a custom instance of the
`SwcJsMinimizerRspackPlugin`, where the setting is modified to keep
original class and function names from the `compress` and `mangle`
options.

## Related
I've opened a related PR on the rspack-examples repository:
https://github.com/rspack-contrib/rspack-examples/pull/158
2024-10-29 12:25:19 +00:00
Leosvel Pérez Espinosa 4b70d1b206 feat(testing): add support for the ts solution config setup to the playwright plugin (#28636)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-28 14:49:04 -04:00
Leosvel Pérez Espinosa f357b4ed53 feat(js): update the setup-build generator to support the new ts setup (#28446)
Update the `@nx/js:setup-build` and the generators it depends on to
support the new TS setup with project references.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-28 14:34:57 -04:00
Isaac Mann 1fec637514 docs(core): update docs/shared/getting-started/intro.md 2024-10-28 16:21:42 +01:00
Juri 8b1a041f92 docs(core): link nx import on entry page 2024-10-28 16:21:42 +01:00
Colum Ferry ce6f943371 fix(rspack): set NODE_ENV to production correctly #28584 (#28662)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 switch from `DefinPlugin` to `EnvironmentPlugin` did not account for
`production`.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure `production` is accounted for and set as expected

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

Fixes #28584
2024-10-28 13:44:13 +00:00
Colum Ferry 0857492c93 fix(vite): set NODE_ENV to production correctly #28584 (#28663)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
After the switch to use `resolveConfig` we failed to set the value for
`NODE_ENV` which is an argument to the function.
This means it always defaulted to development.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure `NODE_ENV` is set as expected.

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

Fixes #28584
2024-10-28 13:43:53 +00:00
Colum Ferry 2936bdcb3d fix(rspack): ensure baseHref is set when provided #28455 (#28660)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/rspack:rspack` executor supports `baseHref` as an option, but
we do not set it in the `rspack.HtmlRspackPlugin`.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure if `baseHref` is set, we pass it to `rspack.HtmlRspackPlugin`

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

Fixes #28455
2024-10-28 13:43:43 +00:00
Miroslav Jonaš 0d2a696443 chore(repo): update node version on nightly (#28622)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-28 13:32:28 +01:00
Philip Fulcher f84b6e5c97 docs(nx-dev): add sports retailer blog post (#28619) 2024-10-25 15:54:37 -06:00
Benjamin Cabanes b0aebc5f9a docs(nx-dev): fix powerpack typos (#28647) 2024-10-25 17:35:10 -04:00
Isaac Mann 3da438d270 chore(core): add instructions to use e2e-ci with dte (#28621)
Use e2e in ci-workflow generator with instructions to use e2e-ci if Nx
Agents are turned on
2024-10-25 15:08:01 -04:00
Emily Xiong 013aaee85f fix(storybook): fix externalDependencies undefined (#28641)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-25 14:24:47 -04:00
Benjamin Cabanes 96f36d3139 docs(nx-dev): add star github button & cleanup (#28623) 2024-10-25 11:51:46 -04:00
Jonathan Cammisuli ffb1b29208 chore(core): add cache implementations (#28595)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-25 11:25:20 -04:00
Colum Ferry 37ab3cdf65 fix(react): selecting tailwind should import correct style file extension (#28630)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Currently we use `<%= style %>` to set the style file extension in the
`main.tsx` template file.
This is incorrect when `style=tailwind`


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
If `options.style=tailwind` update the `templateVariables` that are used
to set `style=css`


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

Fixes #
2024-10-25 15:12:15 +01:00
Colum Ferry edc207d1c8 docs(module-federation): remote schema should show updated regex for names #28558 (#28610)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Docs show incorrect regex pattern for valid MF remote names

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Docs show correct regex pattern for valid MF remote names

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

Fixes #28558
2024-10-25 15:12:07 +01:00
Jack Hsu 4e81fa2d70 fix(core): skip eslint custom hasher when hashing tasks during running commands (#28616)
This change speeds up Nx Cloud runs by not orchestrating cache hits for
lint tasks.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-25 08:30:22 -04:00
Leosvel Pérez Espinosa fe7d7ac48e fix(js): include referenced internal config files in plugin cache hash (#28536) 2024-10-25 15:09:51 +04:00
Leosvel Pérez Espinosa 890ef830b3 fix(js): set the tsBuildInfoFile as output when it's not contained in the outDir (#28538) 2024-10-25 14:01:03 +04:00
Leosvel Pérez Espinosa fae8474939 fix(js): fix resolution of extended tsconfig files in plugin (#28535) 2024-10-25 13:59:11 +04:00
Benjamin Cabanes ff630a3e09 docs(nx-dev): update free powerpack link (#28523)
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-10-25 09:52:08 +02:00
Emily Xiong 1218502c84 fix(js): allow custom listenAddress for verdaccio (#28498)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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
-->
replace localhost with options. listenAddress

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

Fixes https://github.com/nrwl/nx/issues/28314
2024-10-24 12:51:10 -04:00
Juri 84aba19bec feat(nx-dev): add videos to CI docs 2024-10-24 17:29:06 +02:00
Emily Xiong 7839c804a0 fix(storybook): fix yarn storybook upgrade 8 (#28605)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/28301
2024-10-24 08:27:29 +01:00
Emily Xiong 0bea5b28e6 fix(core): createTaskGraph should accept extraTargetDependencies (#28542)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

this pr is a follow up to https://github.com/nrwl/nx/pull/26033.
for function `createTaskGraph`, it should not accept
`defaultDependencyConfigs`, it should be `extraTargetDependencies`.

## Current Behavior
<!-- This is the behavior we have today -->
this caused an issue where the task graph shows that 2 tasks depend on
each other; however, when actually running, it does not.

## 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/26929
2024-10-23 21:25:02 -04:00
Jonathan Cammisuli 7f92efad79 fix(core): only check if files are in sync if there are no records in the db (#28597)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-23 17:14:27 -04:00
Philip Fulcher b6a3414f95 chore(nx-dev): remove duplicate blog post (#28570)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Personal access token blog post appears twice

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Personal access token blog post appears once

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

Fixes #
2024-10-23 14:48:44 -06:00
Jonathan Cammisuli d3df76f2f4 fix(core): handle concurrent db connections better (#28544) 2024-10-23 23:33:33 +04:00
Jack Hsu 018543c785 cleanup(misc): remove unused migrations (#28591)
This PR removes migrations that are unused in our packages.

Other changes:

- Update the `remove-migrations` generator to remove all files inside
the migration directory, rather than just the implementation, spec file,
and `__snapshots__` directory. There were some helpers that were not
removed due to this problem.
- Add a check to the `assertValidMigrationPaths` test util (used in
`migrations.spec.ts` test files) to ensure that all paths inside
`./src/migrations` are included in `migrations.json` file. There were a
few migrations missing in the `@nx/expo` package, and we never run them
nor cleaned them up.


**Note:** This has no effect on users and is purely a clean-up.

## 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-10-23 14:29:56 -04:00
Isaac Mann daa4e19a07 chore(core): task distribution defaults to off (#28587)
- Updates workspace:ci-workflow generator to disable task distribution
by default
- Updates gradle:ci-workflow generator to disable task distribution by
default
- Updates all tutorials to reflect the new generator and adds a line
explaining how to enable task distribution
2024-10-23 13:15:00 -04:00
James Henry 29a556dc78 chore(repo): bump nx to latest v20 and graph 0.1.0 (#28581) 2024-10-23 19:48:11 +04:00
Juri ea01d39291 fix(nx-dev): powerpack content update 2024-10-23 16:21:48 +02:00
Isaac Mann 2d3eea3dcd docs(core): single tenant section (#28548)
- Remove on-premise Nx Cloud docs from navigation
- Expand single tenant Nx Cloud documentation
2024-10-23 10:20:11 -04:00
MaxKless d27f8bc076 fix(core): make sure yarn berry correctly resolves latest version during nx add (#28580) 2024-10-23 18:07:54 +04:00
Colum Ferry 36556f6f23 feat(rspack): add convert-webpack generator (#28167)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
We do not have an automated method for people to switch to rspack from
webpack applications


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We should have a generator that will convert webpack application
projects to use rspack

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

Fixes #
2024-10-23 09:54:49 +01:00
Benjamin Cabanes 12cbfc35da docs(nx-dev): update powerpack features description (#28566) 2024-10-22 20:15:24 -04:00
Jack Hsu a354857d47 feat(react): update eslint plugins to be compat with eslint v9 (#28559)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28191
2024-10-22 19:59:14 -04:00
Isaac Mann e345bc7b11 docs(core): ts project references in npm tutorial (#28504)
Update the npm workspaces tutorial to use typescript project references
2024-10-22 15:52:13 -04:00
Isaac Mann ce7f1b5e4a docs(core): move powerpack features to enterprise section (#28528)
- Makes a new Enterprise section under the Nx section of the docs
- Moves Powerpack docs into the Enterprise section
2024-10-22 14:53:08 -04:00
Isaac Mann e1c49d9178 docs(core): remove reference to remote cache API (#28505)
Remove outdated reference to remote cache API
2024-10-22 14:46:10 -04:00
James Henry c396c1c5ca chore(repo): bump dependencies (#28562) 2024-10-22 20:14:07 +04:00
Emily Xiong 53b33b1f0e fix(core): not to cache entire workspace root (#28552)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
- if directory is workspace root, when walking through the directory, it
will include the directory root path, then will strip prefix, it will be
empty string. it will return "*" as a found path.
- When copying "*", it will run into a recursive loop because it will
try to copy the walkspace root with node_modules into
node_modules/.cache/nx

## 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/28393
2024-10-22 10:15:16 -04:00
Juri e57b85152c fix(nx-dev): cleanup 2024-10-21 17:30:52 +02:00
Mike Hartington b7578f1bdc docs(core): update release blog post (#28526)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-21 10:39:50 -04:00
Isaac Mann 1876b83c3f chore(nx-dev): ignore anchors on changelog page (#28540)
Do not check anchor links pointing to the changelog page
2024-10-21 10:05:31 -04:00
Phillip Barta 25e3bdde9c fix(rspack): removed webpack-sources import (#28447)
removed the webpack-sources import and replaced it with the sources
export from rspack

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/rspack` uses `webpack-sources` which is not listed as dependency.
The issue originated in PR #27676 but i decided to split it out. I also
opened #28225 to add the dependency-check rule for rspack.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`@nx/rspack` uses the reexport from `@rspack/core` 

https://rspack.dev/api/javascript-api/#sources-object

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

#28225 #27676
2024-10-21 12:33:33 +01:00
Nicholas Cunningham 19e765f89a feat(nextjs): update createNodes to createNodesV2 and add deprecation message (#28527)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Currently, we are using `createNodes` API which should be deprecated in
favour of `createNodesV2`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We should be using `createNodesV2` instead of `createNodes`.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-10-18 13:20:21 -06:00
Nicholas Cunningham 8b5ee3624b docs(nx-dev): Remove unused environment variables (#28521) 2024-10-18 11:09:25 -06:00
James Henry 59bb1c6b89 feat(core): allow disabling of tsconfig path sorting in format:write and formatFiles() (#28517) 2024-10-18 20:12:44 +04:00
Colum Ferry 768e59e144 fix(module-federation): normalize hypen names for runtime library control plugin #28497 (#28512)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
As part of the work to normalize `-` in MF project names for Federation,
setting the NX_MF_DEV_REMOTES env var was missed.
This causes issues with the RuntimeLibraryControlPlugin


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Remote names should be normalized correctly

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

Fixes #28497
2024-10-18 08:18:47 -04:00
Colum Ferry 112c9f63ce fix(react): ensure rspack react app is added to exclude on rspack plugin #28464 (#28515)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 you create a react rspack app when there is a `@nx/rspack/plugin`
definition in the nx.json, it causes the project graph to fail to create
nodes.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure the projects created via @nx/react:app --bundler=rspack are added
to exclude array if the plugin exists

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

Fixes #28464
2024-10-18 08:18:25 -04:00
Benjamin Cabanes f971c1b63a docs(nx-dev): update blog post (#28500) 2024-10-17 21:21:15 -04:00
Alexander Janssen 9b528cc893 fix(expo): check if option is not undefined closes #28488 (#28489)
## Current Behavior
NX Cannot read properties of undefined (reading 'trim')

TypeError: Cannot read properties of undefined (reading 'trim')
at
/path/node_modules/@expo/package-manager/build/node/NpmPackageManager.js:80:22
at Array.map ()
at NpmPackageManager.parsePackageSpecs
(/path/node_modules/@expo/package-manager/build/node/NpmPackageManager.js:79:14)
at NpmPackageManager.addAsync
(/path/node_modules/@expo/package-manager/build/node/NpmPackageManager.js:34:56)
at installPackagesAsync
(/path/node_modules/@expo/cli/build/src/install/installAsync.js:178:30)
at process.processTicksAndRejections
(node:internal/process/task_queues:105:5)
at async installAndUpdatePackageJson
(/path/node_modules/@nx/expo/src/executors/install/install.impl.js:33:5)
at async buildExecutor
(/path/node_modules/@nx/expo/src/executors/update/update.impl.js:13:9)
at async getLastValueFromAsyncIterableIterator
(/path/node_modules/nx/src/utils/async-iterator.js:15:19)
at async iteratorToProcessStatusCode
(/path/node_modules/nx/src/command-line/run/run.js:39:25)

## Expected Behavior
› Installing 1 SDK 51.0.0 compatible native module using npm
npm install

## Related Issue(s)
Fixes #28488
2024-10-17 16:00:49 -06:00
Nicholas Cunningham 1806624891 fix(core): neverConnectToCloud should disable connecting to nxCloud (#28501)
closed #28482, #28486

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

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

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

## Current Behavior
<!-- This is the behavior we have today -->
If, `neverConnectToCloud` is set to `true`, there are still attempts
made to connect to NxCloud.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
if, `neverConnectToCloud` is set to `true`, we should not attempt to
connect to NxCloud.

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

Fixes #
2024-10-17 16:53:01 -04:00
MaxKless 499300fd76 fix(core): repair SIGINT signals on windows (#28496)
using `windowsHide: true` is causing an issue on windows: Ctrl + C
handling isn't enabled and no `SIGINT` is sent to the child process when
users exit the process. See https://github.com/nodejs/node/issues/29837
and https://github.com/nodejs/node-v0.x-archive/issues/5054 for
reference. This will cause leftover processes throughout nx.

This PR sets `windowsHide: false` everywhere except for the plugin
workers and some short-lived utils. They `spawn` child processes but
have explicit handling to make sure they kill themselves when the parent
process dies, so the missing Ctrl + C handling doesn't cause issues.

We will follow up to make sure any other culprits that still cause
windows popups (especially when used through Nx Console) are handled.
Leaving no leftover processes running is more important for now, though.

Keep in mind the underlying tooling (like vite) might have some windows
popups themselves that Nx will inherit.
2024-10-17 15:03:37 -04:00
Igor Loskutov 42da5421af fix(expo): pnpm+workspace build (#28209)
## Current Behavior

build executors for expo crash when package manager pnpm and workspaces
are used

## Expected Behavior

no crashies

## Related Issue(s)

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

Fixes #28208

## FAQ

- why not handle the `undefined` by the calling code instead

The less the calling code knows about inner workings, the better: in
this case, doing this would add the implicit dependency on "pnpm and
workspaces" to the calling code

- but it's an empty function, my performance

We call it once per user interaction.

- but still, it's an empty function

We return an `empty array` when there are no elements; we don't return
`undefined` when the array is empty and `array` when array is non-empty.
Hopefully so.

- but,

The doc also says that this function returns a function.
2024-10-17 13:39:29 -04:00
Colum Ferry f9f3de06d0 fix(vite): use resolveConfig instead of loadConfigFromFile to ensure node env set #27627 (#28444)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 the Vite Build Executor, we're using `loadConfigFromFile` from Vite
to get the config options.
The issue with this is that vite will not attempt to set `NODE_ENV`
which may be required by both the config file that is being loaded, and
other plugins.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use resolveConfig which does set NODE_ENV correctly


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

Fixes #27627
2024-10-17 12:26:34 -04:00
Nicholas Cunningham 1dd401cdc3 fix(react): update rspack to include styles in the main bundle (#28478)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Currently, styles are not included in the main bundle by default.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Similar to webpack, styles should be included by default.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28465
2024-10-17 07:48:09 +01:00
Alan Pazetto aa2e86088c fix(js): change verdaccio childProcess kill order (#28364)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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/js:verdaccio` current call `npm config` to setup npm scopes in
global `.npmrc` file, which it's supposed to do.

However, when process is killed (using terminal exit command or any
other way), the process is killed and doesn't restore changed config.

In my case I'm changing scope to my private scope (using `scopes`
option), but after kill I need to restore manually.

## Expected Behavior
When process be killed, restore all configs that was set.

## Related Issue(s)
#28353

Fixes #28353
2024-10-17 00:20:17 -04:00
MaxKless c902036e16 fix(graph): make sure disabledTaskSyncGenerators can be set correctly from nx console (#28466)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-16 13:30:38 -04:00
Isaac Mann 7efa5fc720 docs(core): powerpack pricing clarification (#28473)
Clarify the powerpack pricing for small teams and OSS repos
2024-10-16 12:04:03 -04:00
Isaac Mann 494715929d fix(nx-dev): fix tabs logic (#28470)
Fix tabs being hidden when selecting a tab in a different tab group
2024-10-16 08:42:43 -06:00
Colum Ferry 5dbea2e16f fix(vite): add vite temp files to gitignore #28371 (#28443)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 Vite's tries to handle a `.ts` config file it builds it to JS with
a `.timestamp-` suffix. These files are still picked up by Nx when they
shouldn't as it's a temp file
(https://github.com/vitejs/vite/issues/13267).



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add these temp files to gitignore to prevent processing.


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

Fixes #28371
2024-10-16 15:32:42 +03:00
Phillip Barta 4b6c831a48 fix(rspack): add dependency-checks lint rule (#28225)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 rspack plugin has no dependency-checks in place. I discovered it
while working on #27676.

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

The `@nx/dependency-checks` eslint rule should be used.

There are a few dependencies that I don't know how to proceed with:

```
The "rspack" project uses the following packages, but they are missing from "dependencies":
    - @nx/workspace
    - webpack-sources
    - @module-federation/sdk  @nx/dependency-checks

The "@rspack/plugin-minify" package is not used by "rspack" project
```

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

#27676

---------

Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
2024-10-16 13:29:27 +01:00
Isaac Mann bb14914275 docs(core): center specific markdown tables (#28459)
- Removes the hard-coded centering of markdown table cells.
- Centers specific tables that make sense to be centered
2024-10-16 07:28:25 -04:00
Sam Tsai 330772053b fix(rspack): make rspack dev server respect port (#28251)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Port is not respected from `rspack.config.[jt]s` and needs to be
explicitly set in `project.json` options.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Port should be configurable via config, options, etc.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #28040 (port portion)
2024-10-16 10:33:52 +01:00
Sam Tsai 200b62ad4b fix(rspack): replace DefinePlugin with EnvironmentPlugin (#28252)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
```
[webpack-dev-server] WARNING
  ⚠ DefinePlugin:
  │ Conflicting values for 'process.env.NODE_ENV' ("'development'" !== "\"development\"")
```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`process.env.NODE_ENV` should resolve to `'development'` and not a
quoted value: `"'development'"`

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

Fixes #28040 (NODE_ENV part)
2024-10-16 10:33:40 +01:00
James Henry 3634781d66 fix(release): ensure plan subcommand works with object config (#28460) 2024-10-15 17:11:43 -04:00
Jonathan Cammisuli 72292c7542 fix(core): add migration to set useLegacyCache by default (#28454) 2024-10-15 20:05:22 +00:00
Juri Strumpflohner 5cb2552daf feat(nx-dev): add contact link on powerpack page (#28458)
Co-authored-by: Benjamin Cabanes <3447705+bcabanes@users.noreply.github.com>
2024-10-15 22:00:33 +02:00
James Henry 3cab51389f chore(repo): fix npm-audit workflow, only run on origin (#28457) 2024-10-15 15:38:21 -04:00
Jonathan Cammisuli 45b0b7d902 fix(core): handle neverConnectToCloud property (#28452)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
`neverConnectToCloud` was not respected in the `isNxCloudUsed` function

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

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

Fixes #28287
2024-10-15 14:53:50 -04:00
Mike Hartington e0f9a5c530 docs(core): update release blog post (#28384)
Provide a recap of features from the previous release

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-15 11:53:22 -04:00
Leosvel Pérez Espinosa 76580dbd93 fix(js): improve @nx/js/typescript plugin and typescript-sync generator performance (#28379) 2024-10-15 19:49:40 +04:00
Jonathan Cammisuli e6f6dd814a fix(core): add busy handler for sqlite (#28390)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
When the sql database throws a busy signal, there is no handler in nx to
try the operation again.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
There is a handler to tell sqlite to handle the operation again, and try
up to N times.

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

Fixes #
2024-10-15 11:20:22 -04:00
Colum Ferry 216bd633e4 docs(rspack): remove incorrect information (#28383)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 docs specify that the react library generator supports using rspack
as a bundler option.
The react library generator does not have rspack as an option.


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


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

Fixes #
2024-10-15 10:36:04 -04:00
Isaac Mann 3d44a1d5b4 docs(core): schema update to disable nx cloud (#28432)
Add `neverConnectToCloud` to the `nx-schema.json`

Fixes #28188
2024-10-15 09:31:04 -04:00
Jonathan Cammisuli d1ff5fd784 fix(core): support NX_NO_CLOUD (#28366)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Using `NX_NO_CLOUD` does not disable the remoteCache implementation for
Nx Cloud

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Using `NX_NO_CLOUD` will disable nx cloud remote cache

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

Fixes #
2024-10-15 09:29:22 -04:00
Colum Ferry c8c95c28c9 fix(rspack): do not select char from string when mapping remotes (#28441)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 global prefix is used, there is an issue with the mapping of string
remote usage.
It selects a single character from the string rather than using the full
string


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use the full string as remote name when mapping remotes

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

Fixes #
2024-10-15 09:00:04 -04:00
Colum Ferry 1badac82c9 fix(module-federation): remote names should follow JS variable naming schema (#28401)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
We previously had a schema restriction on the characters allowed for
remote names. It was to prevent names that violated the JS spec for a
variable declaration.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure invalid project names fail error allowing the user to fix it at
generation


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

Fixes #28354, #28408

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-10-14 19:42:42 -04:00
Colum Ferry 1c466d03e1 fix(rspack): log compilation errors #28179 (#28429)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 running serve with Rspack, `stats: false` is being added to
`devMiddleware` preventing logs from being output to the terminal.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure logs are logged to the devServer

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

Fixes #28179
2024-10-14 17:14:49 -04:00
Colum Ferry c7d274549b feat(module-federation): use latest module-federation/enhanced (#28296)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-14 17:12:57 -04:00
Colum Ferry bb9f209155 fix(module-federation): ensure mf-manifest supported and tspaths are added with snake_case (#28244)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-14 17:12:27 -04:00
Isaac Mann 39b8a4d990 docs(core): update data cache env var (#28431)
Fix data cache env var

Fixes #28389
2024-10-14 13:29:16 -04:00
Isaac Mann 24bae0ddb2 docs(core): add s3-cache github actions example (#28241)
Add a GitHub Actions example in the s3-cache plugin docs
2024-10-14 09:44:52 -04:00
Leosvel Pérez Espinosa b7f9c42193 fix(angular): add missing package version bump for zone.js (#28430)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #28046
2024-10-14 15:42:20 +02:00
Colum Ferry b96e6727a8 fix(angular): ensure provideStore is provided before storeDevTools #28107 (#28428)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 order of the `provide*` functions for NgRx matters and should
therefore be structured as such


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure `provideStore` is first provider added

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

Fixes #28107
2024-10-14 12:22:16 +01:00
Leosvel Pérez Espinosa db47dc30a5 feat(js): support esbuild and swc bundlers with the new ts solution config setup (#28409)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

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

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

Fixes #

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-10-14 09:30:43 +02:00
Benjamin Cabanes 74bdc583b9 feat(nx-dev): update home hero & livestream notifier (#28403) 2024-10-12 17:11:56 -04:00
Francesco Moro 37a7eb17fe feat(expo): build w/package.json overrides/resolutions (#28254)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
When running nx build expo-app, the build executor copies dependencies
and devDependencies of the workspace package.json (see
copyPackageJsonAndLock function).

The build executor does not copy the resolutions object (for yarn) nor
the overrides object (for npm).

## Expected Behavior
The build executor copies the overrides object or the resolutions
object, if present in the package.json. The original project
package.json is restored after the build is completed successfully or
after it errors.

## Related Issue(s)
#28249

Fixes #
2024-10-10 17:57:36 -07:00
Colum Ferry a18adb7a98 fix(react): depends on migration should ignore configs that point to @nx/react #28377 (#28382)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Some executors using `@nx/webpack:webpack` point to a webpack config
that is exported from the `@nx/react plugin.

We do not want to try modify this.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Skip the migration if the webpack config points to the exported plugin
from @nx/react.


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

Fixes #28377
2024-10-10 15:47:36 -07:00
Nicholas Cunningham 40d444eb25 docs(nx-dev): update monorepo world notification (#28398) 2024-10-10 15:48:53 -04:00
Leosvel Pérez Espinosa c3b77e7255 fix(linter): scope js and ts shared configs to js and ts files (#28381) 2024-10-10 07:29:35 -07:00
James Henry db10812da7 chore(repo): add new issue type to bug template (#28367) 2024-10-08 18:23:30 -04:00
Isaac Mann c3f57ba8e6 docs(core): update livestream links again 2024-10-07 18:17:27 +02:00
Isaac Mann 0fad4a0016 docs(core): update live stream links 2024-10-07 18:17:27 +02:00
Isaac Mann 27354ac8ad docs(core): redirect conf to monorepo.world (#28338)
Redirect `/conf` to `monorepo.world`
2024-10-07 11:10:03 -04:00
Benjamin Cabanes 523f137e76 feat(nx-dev): add live stream notifier (#28260)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2024-10-07 07:46:13 -07:00
Nicholas Cunningham 01305c2d0f chore(nx-dev): Update LTS version for Nx 20 (#28259)
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-10-07 00:26:28 -04:00
Juri cb41bcbc37 docs(core): add missing description field on custom conformance rule type 2024-10-07 02:01:31 +02:00
Colum Ferry fba6cc8f9b chore(core): update to 20.0.0-rc.0 (#28320)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-06 15:16:24 -04:00
Abdur Rehman c2af06e0a1 docs(angular) : add cd instruction to move inside workspace directory (#28135)
`npx nx serve angular-store` this would not work if the user does not
move to the directory first.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-05 06:16:00 -06:00
Jack Hsu 75c1da3245 chore(repo): update to 20.0.0-beta.8 (#28300)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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: Jonathan Cammisuli <jon@cammisuli.ca>
2024-10-04 18:24:47 -04:00
Jack Hsu cbda8cf275 fix(testing): getJestProjectsAsync no longer duplicates project paths (#28311)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
Using `getJestProjectsAsync` to include both `project.json` and inferred
targets can result in errors due to duplcicated paths.

You see an error like this:

```
Error: Whoops! Two projects resolved to the same config path: /Users/jack/projects/ocean/libs/nx-cloud/data-access-organization-dashboard/jest.config.ts:

  Project 1: /Users/jack/projects/ocean/libs/nx-cloud/data-access-organization-dashboard/jest.config.ts
  Project 2: /Users/jack/projects/ocean/libs/nx-cloud/data-access-organization-dashboard

This usually means that your "projects" config includes a directory that doesn't have any configuration recognizable by Jest. Please fix it.

    at ensureNoDuplicateConfigs (/Users/jack/projects/ocean/node_modules/jest-config/build/index.js:325:13)
    at readConfigs (/Users/jack/projects/ocean/node_modules/jest-config/build/index.js:474:5)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runCLI (/Users/jack/projects/ocean/node_modules/jest-cli/node_modules/@jest/core/build/cli/index.js:151:59)
    at async Object.run (/Users/jack/projects/ocean/node_modules/jest-cli/build/run.js:130:37)
```

## Expected Behavior
Using `getJestProjectsAsync` should work and include all inferred
projects.

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

Fixes #
2024-10-04 16:50:05 -04:00
Jonathan Cammisuli d714099501 fix(core): handle unique constraint errors when adding duplicate hashes to the cache db (#28310)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-04 15:16:03 -04:00
Louie Weng acb19a6439 fix(nx-cloud): use create-workspace-v1 endpoint if v2 returns with 404 (#28015)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

By default we connect all workspaces to Nx Cloud via the V2 connect
endpoint.

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

Certain users (on-prem or single tenant) may not have access to the V2
endpoint, and so we should fall back to V1 so as not to prevent new
workspaces from being created.

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

Fixes #
2024-10-04 14:16:45 -04:00
Jack Hsu f743808bd5 fix(testing): migration for getJestProjects -> getJestProjectsAsync handles both CJS and ESM (#28299)
This PR updates the Jest migration so it handles both CJS and ESM format
for Jest config file. We now generate with ESM so those need to be
handled. There are four combinations:

1. `require` (CJS) with `module.export` (CJS)
2. `import` (ESM) with `export default` (ESM)
3. `require` (CJS) with `export default` (ESM)
4. `import` (ESM) with `module.export` (CJS)

(1) and (2) should cover almost all cases, and (3) and (4) are there
just in case. If the format isn't matching what we generate, then just
bail.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-04 11:04:21 -04:00
Mike Hartington 27beba8114 docs(core): release blog post (#28275)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-10-04 09:58:55 -04:00
Colum Ferry 63e0f278b8 fix(react): host generator should pass normalized name to remote generator (#28295)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-04 14:30:08 +01:00
Philip Fulcher c6bb33a49f docs(nx-dev): rename images with invalid Windows filenames 2024-10-04 10:21:56 +02:00
Austin Fahsl 7c0e34400e fix(release): ensure updateDependents only works for independent projects (#28283)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-03 21:54:44 -04:00
Jonathan Cammisuli d5c452194f feat(core): enable db cache by default (#28048)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
DB cache is disabled by default

## Expected Behavior
DB cache is enabled by default 

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

Fixes #
2024-10-03 21:53:57 -04:00
Isaac Mann d477ea7b6a docs(core): ts project references guide (#28281)
Adds a TS project references guide
2024-10-03 20:39:25 -04:00
Jason Jean 23bebd91e7 feat(devkit): bump compatibility to Nx 19 - 21.x (#28243)
BREAKING CHANGE

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/devkit` supports Nx 17 - 20.
* Node 18 - 22 is supported 
* `ExecutorContext.projectGraph`, `ExecutorContext.nxJsonConfiguration`,
and `ExecutorContext.projectsConfigurations` is marked as optional
because `ExecutorContext` in some versions of Nx did not have them.
* `ExecutorContext.workspace` is marked as optional because
`ExecutorContext` in some versions of Nx did not have the above
properties which contain the same information.
* `ProjectGraphNode` is deprecated.
* `NxPluginV1.processProjectGraph` was deprecated long ago and there has
been a warning since.
* `appRootPath` has been deprecated for a long time.
* `parseTargetString` had a variant that did not take either the project
graph or the executor context.
* `readNxJson` has a variant which does not take a tree. This was not
clearly deprecated.
* There are handlers to require from `@nx/` instead of `@nrwl`
* Nx tries to get a root install from `@nrwl/cli`


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

* `@nx/devkit` supports Nx 19 - 21.
* Node 20 - 22 is supported 
* `ExecutorContext.projectGraph`, `ExecutorContext.nxJsonConfiguration`,
and `ExecutorContext.projectsConfigurations` is marked as required
because `ExecutorContext` in Nx 19+ is guaranteed to have them.
* `ExecutorContext.workspace` is removed because the same information is
available in the above properties
* `ProjectGraphNode` is removed.
* `NxPluginV1` is no more. All plugins should be `NxPluginV2`.
* `workspaceRoot` is the replacement for `appRootPath`. `appRootPath` is
removed.
* `parseTargetString` no longer has a variant that did not take either
the project graph or the executor context.
* `readNxJson` still has a variant which does not take a tree but it's
clearly deprecated to be removed in Nx 21.
* `@nrwl` packages are no more so we don't have to redirect requires
anymore.
* `@nrwl/cli` is no more so Nx shouldn't try to get a root install there
* 

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

Fixes #
2024-10-03 17:35:47 -04:00
Isaac Mann d131b0b677 docs(core): nx 20 changelog (#28270)
- Add a changelog for Nx 20.0.0
- Demo the composite graph view in `Explore Your Workspace`
2024-10-03 16:57:27 -04:00
Jonathan Cammisuli 414f5c011d chore(repo): update to nx 20 (#28184)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

This repo uses Nx 19.8.0-beta.2

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

This repo uses Nx 20.0.0-beta.7

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

Fixes #
2024-10-03 16:25:33 -04:00
Leosvel Pérez Espinosa 0d7086646f feat(linter): update eslint-import-plugin to a version that supports eslint v9 (#28273)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-03 14:47:37 -04:00
Zachary DeRose 7ff387dcd2 Fixing target groups not merging (#28280)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 multiple plugins touch the `project > metadata` (note NOT `project
> target > metadata`), only the last plugin to run has their
`metadata.targetGroups` data present, meaning currently `targetGroups`
is clobbering instead of merging.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When multiple plugins write to `metadata.targetGroups`, that data is
merged together, so data written by all plugins is present.

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

Fixes #
2024-10-03 14:28:49 -04:00
Jonathan Cammisuli 89ae1289a0 feat(core): open sqlite databases with SQLITE_OPEN_FULL_MUTEX (#28276)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 database is currently opened with the following flag:
```
OpenFlags::SQLITE_OPEN_NO_MUTEX,
```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The database is opened with the following flag:
```
OpenFlags::SQLITE_OPEN_FULL_MUTEX
```

This allows sqlite itself to handle multiple connections to the database
and make all writes serial.

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

Fixes #
2024-10-03 14:24:26 -04:00
Jason Jean 3375734c0e chore(repo): deactivate heartbeat (#28278)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Heartbeat seems to be having issues.

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

Heartbeat is disabled.

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

Fixes #
2024-10-03 14:04:49 -04:00
Jack Hsu 810896caae docs(js): add a note to JS plugin overview that --preset=ts changed in Nx 20, and that --preset=app can still be used (#28277)
Since `--preset=ts` has changed, we want to provide users with a way to
generate the older, integrated setup if they need to.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-03 14:00:01 -04:00
Jack Hsu f22c63de2d feat(js): new workspace uses scoped named in root package.json (#28271)
This PR changes the root `package.json` to use a scoped name when using
`create-nx-workspace`. This was already done in most presets, but we
missed the old "package-based" setup.

e.g. These

```
create-nx-workspace acme --preset=ts
create-nx-workspace acme --preset=npm
```

Should all result in `@acme/source` being used in root `package.json`,
not `acme`. The scope will be used when generating projects if the user
doesn't pass `--importPath`.
2024-10-03 12:41:11 -04:00
Nicholas Cunningham 5be5ad8a74 fix(nx-dev): fix markdoc table data alignment (#28274)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Currently, our table heading generated from markdown files `.md` are
positioned `center` while the data `td` are positioned `left`.

It doesn't look uniform and on larger tables, it can be jarring.

Examples: 
- https://nx.dev/ci/reference/release-notes#helm-package-compatibility
- https://nx.dev/reference/releases#supported-versions
-
https://nx.dev/blog/reliable-ci-a-new-execution-model-fixing-both-flakiness-and-slowness#problem-in-numbers

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Both heading and data should have the same alignment to be symmetrical. 

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

Fixes #
2024-10-03 10:10:00 -06:00
Philip Fulcher a0a5740179 docs(nx-dev): migrate blog posts from 2023+ (#27946)
Migrating in blog posts from Medium and dev.to from 2023 onwards, along with any other post linked to from them
2024-10-03 09:37:07 -06:00
Philip Fulcher e3a304babf docs(nx-dev): fix heading case on GitHub integration page (#28206)
## Current Behavior
Headings on GitHub integration page are sentence case

## Expected Behavior
Headings on GitHub integration page are title case
2024-10-03 09:10:23 -06:00
Colum Ferry 874fad03da fix(angular): ensure @typescript-eslint/utils is used with eslint flat config (#28267)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 9 is installed for new angular workspace but v7 of
@typescript-eslint/utils package is being installed and is incompatible


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Esnure v8 of @typescript-eslint/utils is installed

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

Fixes #

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2024-10-03 15:58:39 +02:00
Leosvel Pérez Espinosa 9797475a49 docs(misc): use apps preset when creating an empty workspace in mf docs and update ci prompt in remix guide (#28268)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-03 08:23:21 -04:00
Benjamin Cabanes c655b6cf4f feat(nx-dev): add nx powerpack gcp & azure mentions (#28256)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2024-10-03 00:09:03 -07:00
Jason Jean 84a5c7a274 chore(core): expose utility to determine if db cache is enabled (#28262)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 function to determine if the db cache is enabled

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

There is a function to determine if the db cache is enabled.

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

Fixes #
2024-10-02 21:55:36 -04:00
Jason Jean 8c59a7eb40 fix(core): filter out task dependencies on itself (#28261)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Tasks can end up depending on themselves if they depend on a dummy task
which ends up depending back on itself. This throws a weird error like:

```
 NX   Could not execute command because the task graph has a circular dependency

devkit:build --> devkit:build-base --> nx:build-base --> nx:build-base
```

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

Tasks cannot depend on themselves. No errors are thrown in those cases.

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

Fixes #
2024-10-02 20:45:10 -04:00
Jason Jean 23a217d8dd feat(core): deprecate custom task runners (#28253)
## Current Behavior
<!-- This is the behavior we have today -->

Custom task runners are a high level abstraction to customize caching, a
relatively low level mechanism, to utilize other methods of remote
caching. The abstraction of custom task runners makes it hard for Nx to
make guarantees to make it faster.

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

Custom task runners are now deprecated. They will still work for Nx 20
but a warning will be shown when they are being used. The migration path
is to use Nx Cloud (the ideal caching solution) or a Nx Powerpack cache
(written by the Nx Core team which we can make guarantees about).

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

Fixes #
2024-10-02 20:33:10 -04:00
Jack Hsu 81892b51fd feat(misc)!: handle v20 deprecations in plugins (#28222)
This PR removes these from v20 since they were deprecated and slated for
removal:

- `executeWebpackDevServerBuilder` export from `@nx/angular/executors`,
users should use `executeDevServerBuilder`
- `withStylus` util from `@nx/next/plugins/with-stylus` since it was
deprecated in v17 and has just throw an error that users need to use
SASS with Next.js

The `getRollupOptions` function from `@nx/react/plugins/bundle-rollup`
has been deprecated as mention previously and slated for removal in v22.
New users are using inferred targets from Rollup, and existing projects
using this module should run `nx g @nx/rollup:convert-to-inferred` or
manually update rollup config to use `withNx` function.

Also, bumped some deprecation for later in v21:

- Remove inline builds from tsc/swc 
- Changes to SVGR to align with Webpack v5 (e.g. `import ReactComponent
from './img.svg?svgr'`)
- Remove `isolatedConfig` from Webpack executor -- requires a migration
that extracts to a standard webpack config just in case (different from
the original one that extracts to `withNx`)

The ESLint TODOs were rescoped to `TODO(eslint)` and we'll look at it in
further flat config work rather than tying it to an Nx release.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-02 15:29:31 -04:00
Shahar Kazaz 69109e48d9 fix(js): resolve VerdaccioWarning on the "logs" configuration property (#28234)
fix(js): resolve VerdaccioWarning: The configuration property "logs" has
been deprecated; Replaced with "log"

Currently, the Verdaccio configuration generated by running `nx generate
setup-verdaccio` contains the deprecated `logs` property. I have updated
this property to `log`, thereby removing the VerdaccioWarning that is
displayed when running `nx local-registry`

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

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

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

## Current Behavior
Currently, the Verdaccio configuration generated by running `nx generate
setup-verdaccio` includes the deprecated 'logs' property. When you run
`nx local-registry` Verdaccio displays the following warning:
<img width="1453" alt="image"
src="https://github.com/user-attachments/assets/ccd95587-ec1b-458c-8717-8173a95c1e5d">

## Expected Behavior
Run `nx local-registry` without the warning after using the
`setup-verdaccio` generator.
2024-10-02 14:52:04 -04:00
James Henry 2c0994ac87 feat(release)!: rewrite ChangelogRenderer to a class API and remove deprecated config (#28229)
BREAKING CHANGE

In Nx v19, implementing a custom changelog renderer would involve a lot
of work on the user side. They would need to create an additional
function making every property available in its declaration and then
call the underlying default one and customize the final string (or
reimplement the whole thing).

E.g.

```js
const changelogRenderer = async ({
  projectGraph,
  commits,
  releaseVersion,
  project,
  entryWhenNoChanges,
  changelogRenderOptions,
  repoSlug,
  conventionalCommitsConfig,
  changes,
}) => {
  const defaultChangelog = await defaultChangelogRenderer({
    projectGraph,
    commits,
    releaseVersion,
    project,
    entryWhenNoChanges,
    changelogRenderOptions,
    repoSlug,
    conventionalCommitsConfig,
    changes,
  });

  // ...Do custom stuff and return final string...
};

module.exports = changelogRenderer;
```

In Nx v20, changelog renderer are classes. The DefaultChangelogRenderer
can therefore easily and granularly be extended and customized, and the
config does not need to be redeclared on the user side at all. We will
improve things even further in this area, but this breaking change is an
important stepping stone.

E.g. for manipulating the final string equivalent to the previous
example:

```js
module.exports = class CustomChangelogRenderer extends (
  DefaultChangelogRenderer
) {
  async render() {
    const defaultChangelogEntry = await super.render();
    // ...Do custom stuff and return final string...
  }
};
```

E.g. for customizing just how titles get rendered:

```js
class CustomChangelogRenderer extends DefaultChangelogRenderer {
  renderVersionTitle(): string {
    return 'Custom Version Title';
  }
}
```
2024-10-02 22:20:23 +04:00
James Henry fe01c61635 fix(core): add stub for conformance:check, add messaging (#28250) 2024-10-02 18:12:55 +00:00
Leosvel Pérez Espinosa 8821b70815 docs(core): document --skip-sync flag for run commands (#28246)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-02 14:08:43 -04:00
Jack Hsu e9d8d39239 fix(core): allow prompts during nx add (#28247)
This PR allows `nx add` to initialize plugins that have prompts.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-02 14:08:24 -04:00
Jonathan Cammisuli 161a3f1b0b fix(core): change getCache signature to only accept options (#28248)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
`getCache` has an argument for nxjson. This breaks nx cloud when using
the db cache.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`getCache` now only has options as an argument, and uses `readNxJson` in
the function body

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

Fixes #
2024-10-02 13:23:47 -04:00
Benjamin Cabanes 5a411540e7 feat(nx-dev): add nx powerpack to pricing page (#28232)
Add Nx Powerpack as included with Nx Cloud Enterprise plan on Pricing page.
2024-10-02 10:36:54 -04:00
Leosvel Pérez Espinosa 7e86de8f59 docs(misc): document NX_ADD_TS_PLUGIN environment variable (#28242)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-02 16:33:52 +02:00
Emily Xiong 10fb324746 chore(testing): add deprecated comment for getJestProjects (#28178)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-02 10:19:15 -04:00
Jack Hsu a637f9eef9 chore(repo): remove v16 migrations (#28220)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10-02 10:18:41 -04:00
Jason Jean 3b278e6755 fix(core): remove axios import from main code loading (#28230)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
`axios` is loaded before tasks are run which causes a 30 ms delay.

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

`axios` is not loaded before tasks are run.

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

Fixes #
2024-10-02 10:13:56 -04:00
James Henry 6b715ff96c feat(release)!: version.generatorOptions.updateDependents is "auto" by default (#28231)
BREAKING CHANGE

In Nx v19, `release.version.generatorOptions.updateDependents` is
"never" by default, meaning dependents are not automatically patched
when their dependencies change (applicable to independent projects).

In Nx v20, `release.version.generatorOptions.updateDependents` is "auto"
by default, meaning dependents are automatically patched when their
dependencies change (applicable to independent projects).
2024-10-02 17:52:03 +04:00
James Henry 69e9bb9ec9 feat(release)!: releasePublish always returns status code per project (#28224)
BREAKING CHANGE

In v19 of nx, the programmatic usage of `await releasePublish({ ... })`
would throw in the case that _any_ project failed to publish. It would
return the number `0` (to represent the overall exit code) in the case
that all projects were successfully published.

Now, in v20, the programmatic usage of `await releasePublish({ ... })`
will always return a `PublishProjectsResult` object, which is a mapping
of project names to an object of `{ code: number }` for each project.
This allows consumers to make informed decisions about which projects
failed to publish and decide how to handle it in their release scripts.

For example, where there are projects called "pkg-a" and "pkg-b" and
"pkg-a" is successfully published and "pkg-b" fails:

```ts
const result = await releasePublish({
  dryRun: false
});
// result is set to { "pkg-a": { code: 0 }, "pkg-b": { code: 1 } )
```
2024-10-02 17:34:37 +04:00
Colum Ferry 95d26c6bf4 fix(module-federation): normalize kebab-cased names to snake_cased (#28237)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 project names can be kebab-cased but module federation remotes that
use global or var will not support this.
They need to be snake cased


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

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

Fixes #
2024-10-02 14:22:27 +01:00
Jonathan Cammisuli 3c791c7133 feat(core): allow circular project dependencies to execute tasks (#28227)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
If there are project dependencies and not all projects contain the same
task target, a circular dependency error is shown.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
If not all circular dependent projects contain the same task target,
allow execution of the target.

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

Fixes #
2024-10-02 09:19:35 -04:00
Leosvel Pérez Espinosa ec801b4c16 feat(misc): enable new ts minimal setup by default and guard execution of generators with no support for it (#28199)
- Enable generating the new & minimal TS setup by default when
generating the `ts` preset with CNW.
The existing `NX_ADD_TS_PLUGIN` environment variable is kept with its
default value inverted and set to `true`. It can be used to opt out of
the new TS setup by running CNW with `NX_ADD_TS_PLUGIN=false`.
- Throw an error when running generators that don't yet support the new
TS setup.
- We'll add support for those generators incrementally in follow-up PRs.

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

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

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

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

Fixes #
2024-10-02 08:29:06 -04:00
Leosvel Pérez Espinosa 942f6fc2ea fix(js): throw an error when generating a publishable lib with --bundler=none (#28221)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Generating a JS publishable library with `--bundler=none` results in the
generator silently switching the `bundler` to `tsc` and generating a
`build` target.

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

Trying to generate a JS publishable library with `--bundler=none` should
throw an error.

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

Fixes #
2024-10-02 14:24:39 +02:00
Leosvel Pérez Espinosa b82ca22d65 fix(js): generate nx release config correctly for js libraries in new ts setup and set tags (#28218)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 setting the Nx configuration for a JS library in the `package.json`
file, the provided tags is not set and the relevant `nx release`
configuration in `nx.json` is not set either.

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

When setting the Nx configuration for a JS library in the `package.json`
file, the provided tags should be set and the relevant `nx release`
configuration in `nx.json` should be configured.

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

Fixes #
2024-10-02 11:40:51 +02:00
Andrew Goldis c24292abf4 fix(testing): add support for playwright --last-failed (#28161)
`--last-failed` allows running only the failed tests from the previous
run.
Example: `playwright test --last-failed`.
[Documentation](https://playwright.dev/docs/test-cli#reference)

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

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Cannot provide `--last-failed` flag to playwright

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Should be able provide `--last-failed` via configuration entry
`lastFailed: boolean`

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

Fixes #28096
2024-10-02 11:09:51 +02:00
Isaac Mann 471536cb38 docs(core): remove integrated docs (#28228)
- Move the integrated vs. package-based concept page to the deprecated
section
- Remove the integrated project in package-based repo recipe
- Remove the package-based project in integrated repo recipe
- Rename standalone to integrated recipe
- Update references to integrated or package-based terms in tutorials
2024-10-01 23:22:11 -04:00
Emily Xiong 1d10a19abc feat(graph): show owners in pdv (#28211)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

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


<img width="428" alt="Screenshot 2024-09-30 at 8 54 38 PM"
src="https://github.com/user-attachments/assets/59b47117-4136-4a59-8e08-c223eafa94b4">
<img width="445" alt="Screenshot 2024-09-30 at 8 53 49 PM"
src="https://github.com/user-attachments/assets/9f9586fa-ae7a-44fe-bd67-305331b46bd4">
<img width="337" alt="Screenshot 2024-09-30 at 8 52 46 PM"
src="https://github.com/user-attachments/assets/762a6aaa-7260-47db-87b4-b394b4da4df1">

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

Fixes #
2024-10-01 18:00:01 -04:00
Nicholas Cunningham c5bb723ed7 fix(nx-dev): 404 urls (#27599) 2024-10-01 08:40:35 -06:00
Jack Hsu 27edf71cef feat(misc): make directory a required option for generators (#28093)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-10-01 09:29:44 -04:00
Colum Ferry e0f2f02552 fix(module-federation): additionalShared should check node_modules when applying to support transitive deps #28137 (#28216)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Transitive deps may not exist on the project graph or be installed in
the root package.json file.
They could require the singleton pattern and should use the
`additionalShared` functionality.

However, the additionalShared will check project graph and root
package.json, erroring if the package cannot be found.

The last resort should be to use `require.resolve` to check the
node_modules folder to find the package.json of the package and select a
version from it.


## 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 #28137
2024-10-01 13:55:42 +01:00
Colum Ferry bc5d5efe58 fix(module-federation): exports could be objects and not strings #28129 (#28215)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Exports defined in `package.json` of packages could be objects rather
than strings such that we could see both:

```json
{
  "exports": {
    ".": {
       "default": "./src/index.js"
    },
    "index": {
       "default": {
           "default": "./src/index.js"
        }
    }
  }
}
```


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The logic currently assumes it can only be a string.
Ensure it checks if an object exists first


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

Fixes #28129
2024-10-01 13:55:26 +01:00
Colum Ferry 9cbcd1f207 fix(react): setup-ssr generator should infer bundler based on the executor for build #28128 (#28217)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/react:setup-ssr` defaults to webpack which causes issues when the
`react` app is already using rspack.



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Infer bundler based on the `build` target

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

Fixes #28128
2024-10-01 13:55:07 +01:00
Nicholas Cunningham bc8b71ac6c fix(core): Remove nameAndDirectoryFormat option from generators (#28110)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Currently, when we use generator's via the CLI passing the `name` arg
has more than one responsibility:
1.  it can be used as a path
2. it can be used as the generator's name (e.g. Component name)

This is not intuitive as if we use via Nx Console because it creates
some ambiguity around the `--name` property which is normally described
as only 2.

![image](https://github.com/user-attachments/assets/b05fa2a7-36e7-44a1-af82-6f55f53d6c43)

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

What is expected is that the `name` property should only have the
responsibility of determining the name of the generated module
(Component, Directive etc...).

The new property `path` replaces the `directory` property but fulfils
the same purpose as determining where the module should be created.

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

Fixes #

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-10-01 08:26:27 -04:00
Alonmizra e802d2c872 cleanup(misc): remove redundant return in esbuild.impl.ts (#27632) 2024-10-01 16:04:43 +04:00
Isaac Mann 29d889925d docs(core): update evolving nx post (#28210)
Update the evolving Nx blog post
2024-10-01 07:27:21 -04:00
Colum Ferry 54936f9574 fix(angular): ensure async webpack configs are awaited #28200 (#28213)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Custom webpack functions may return a promise that needs to be awaited
before we attempt to do any additional work on it


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure custom webpack functions are awaited. they will no-op for
synchronous functions

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

Fixes #28200
2024-10-01 12:26:18 +01:00
Phillip Barta 3c4fd355c7 chore(repo): updated husky to v9.1.5 (#27665) 2024-10-01 15:19:40 +04:00
James Garbutt 2f09285b30 cleanup(misc): migrate rollup to picocolors (#28186) 2024-10-01 15:07:49 +04:00
James Garbutt 74061cf5ef cleanup(nextjs): migrate to node FS (#28065) 2024-10-01 14:35:18 +04:00
James Garbutt 1378922496 cleanup(react): migrate to picocolors (#28187) 2024-10-01 14:32:27 +04:00
Jack Hsu 8fa7065cf1 docs(misc): update generator examples to use new directory/path positional args (#28144)
This PR updates examples in `.md` files (both docs and blog posts) to
use positional args. Nx 20 changes the position arg to be either
`directory` for apps/libs or `path` for artifacts (e.g. components).

So before you'd do this:

```
nx g app myapp --directory=apps/myapp
nx g lib mylib --directory=libs/mylib
nx g lib mylib --directory=libs/nested/mylib
nx g lib @acme/foo --directory=libs/@acme/foo --importPath=@acme/foo
nx g component foo --directory=libs/ui/src/foo --pascalCaseFiles
```

Will now be simplified to

```
nx g app apps/myapp
nx g lib libs/mylib
nx g lib libs/nested/mylib
nx g lib libs/@acme/foo # name and import path are both "@acme/foo"
nx g component libs/ui/src/foo/Foo
```

For cases where `name` and `importPath` need to be changed, you can
always manually specify them.

```
nx g lib libs/nested/foo # name is foo
nx g lib libs/nested/foo --name=nested-foo # specify name with prefix
nx g lib libs/@acme/foo --name # use "foo" as name and don't match importPath
nx g lib libs/@internal/foo --importPath=@acme/foo # different importPath from name

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

## Current Behavior
<!-- 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-09-30 13:20:10 -04:00
Colum Ferry 123cfdcd53 fix(module-federation): pin mf enhanced version (#28196)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-30 10:02:10 -04:00
Jack Hsu 85877e3e18 feat(react): make vitest the default test runner since it supports ESM and different moduleResolution better (#28153)
This PR updates the default test runner for React/Web apps to be
`vitest`. It aligned better with our emphasis on modern tooling, and the
lack of ESM and proper TS support (using `module` other than `commonjs`)
in Jest makes it hard to use in some workspaces.

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-30 09:00:01 -04:00
Nicholas Cunningham ac53df6c67 fix(nx-dev): Blog url (#27597) 2024-09-30 06:48:21 -06:00
Philip Fulcher 2a706290c8 docs(nx-cloud): add feature page for GitHub integration (#28063) 2024-09-28 07:09:59 -06:00
Jack Hsu f221a41dbd feat(misc): remove @nrwl/ scoped packages (#27858)
This PR removes the `@nrwl/*` packages. Also cleans up references to the
legacy packages.

NOTE: The rescope page is now under `/deprecated/rescope`. There is
still >1000K monthly traffic to it, which might be due to older Nx
users.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-27 17:19:01 -04:00
Jason Jean 0fd8b41e3e fix(core): fix link to powerpack plugins (#28182)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 link to show a list of powerpack plugins shows all plugins

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

The link to show powerpack plugins shows powerpack plugins

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

Fixes #
2024-09-27 17:03:24 -04:00
Jason Jean 29bbed5d06 feat(core): remove node task hasher (#28147)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 native task hasher is faster and has been default for quite a while.
There's still a node hasher implementation though.

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

The native task hasher is the only task hasher implementation. The node
task hasher is no more.

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

Fixes #
2024-09-27 16:15:15 -04:00
Jason Jean 3a7b8ac7b8 fix(rspack): update url repository url (#28181)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

`@nrwl/rspack` is not being released because the repository url is
incorrect.

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

`@nrwl/rspack` is released... for now because the repository url is
correct.

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

Fixes #
2024-09-27 16:07:02 -04:00
Emily Xiong ff25c8dc14 fix(expo): change force to be an option for yarn (#28115)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
- currently --force is passed into every `expo install` command -> then
the package install command
- but it is not supported in yarn, change it to an option so it would
not get passed in everytime

## 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/28062
2024-09-27 16:01:18 -04:00
Emily Xiong caae4cf0ff fix(core): fix env override run command (#28156)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/27821
2024-09-27 15:38:55 -04:00
Isaac Mann 86a43de09a docs(core): powerpack plugin icons (#28180)
- Add icons for powerpack plugins on /nx-api page
- Mention Powerpack requires Nx 19.8+
- Mention free OSS license in activate powerpack recipe
2024-09-27 14:39:13 -04:00
Emily Xiong 1a4959f9a7 fix(core): move getDetails to top (#28158)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/28035
2024-09-27 14:29:53 -04:00
Leosvel Pérez Espinosa 153451f32b fix(js): improve typescript-sync generator messaging (#28162)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-27 14:14:35 -04:00
Leosvel Pérez Espinosa 49c5a73cd0 feat(js): generate experimental simplified library with ts solution setup (#27910)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

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

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

Fixes #

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-09-27 14:14:19 -04:00
Emily Xiong 5724debed6 fix(storybook): only add @storybook/test-runner to externalDependencies if installed (#28060)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/26854
2024-09-27 12:46:06 -04:00
MaxKless 6634693f12 fix(core): adjust nx import messaging without relative source dir (#28052) 2024-09-27 12:37:51 -04:00
Nicholas Cunningham 0f360b8215 fix(nx-dev): Update Power pack docs to include OSS projects (#28176) 2024-09-27 10:10:15 -06:00
Emily Xiong 0061b858b2 fix(core): only stop daemon if enabled (#28146)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/27971
2024-09-27 12:09:04 -04:00
Isaac Mann 94932ec0e1 docs(core): fix powerpack purchase link (#28172)
Fix powerpack purchase link
2024-09-27 17:15:33 +02:00
Isaac Mann e90d2211af docs(core): fix syntax errors in conformance docs (#28169)
Fix some syntax errors in the conformance docs
2024-09-27 11:01:10 -04:00
Jason Jean c5cb015276 fix(core): calculate project dependencies upfront in the schedule (#28152)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Counting project dependencies during the sort resulted in a lot of
duplicate work.

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

Count project dependencies for all tasks up front.. so that this
information can be easily accessed during the sort.

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

Fixes #
2024-09-27 10:04:38 -04:00
Isaac Mann 198d2af81d docs(core): remove closed source github links (#28149)
Updates AWS S3 to Amazon S3
Removes Github links from closed source packages
2024-09-27 09:04:04 -04:00
Isaac Mann 3bb493f7a6 docs(core): powerpack docs edits (#28142) 2024-09-27 12:49:08 +00:00
Isaac Mann c4806f1f17 docs(core): powerpack landing page typo (#28143) 2024-09-27 08:48:47 -04:00
Isaac Mann 154aedefa8 docs(core): document NX_GRAPH_CREATION (#28111)
Documents the NX_GRAPH_CREATION environment variable

Related to #27244
2024-09-27 08:35:16 -04:00
James Henry 266fb09725 chore(nx-dev): fix import in conformancedoc (#28166) 2024-09-27 07:44:18 -04:00
James Henry 81b3fc901e docs(nx-dev): update conformance docs (#28151) 2024-09-27 14:59:21 +04:00
Rares Matei 2630e7f269 chore(repo): temp disable db cache (#28164) 2024-09-27 13:40:05 +04:00
Leosvel Pérez Espinosa 5d6b3576f8 fix(js): handle ts project refs pointing to non-existing files and prune ts refs for projects with no deps (#28130)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-27 08:08:56 +02:00
pralkarz 56eabffb2b cleanup(expo): replace fs-extra with node:fs (#28117) 2024-09-27 06:33:44 +04:00
pralkarz 28c12b50bd cleanup(bundling): replace fs-extra with node:fs (#28113) 2024-09-27 06:30:17 +04:00
pralkarz 151c8380fa cleanup(react-native): replace fs-extra with node:fs (#28131) 2024-09-27 06:29:01 +04:00
pralkarz 9dfa4dbbef cleanup(nx-plugin): replace fs-extra with node:fs (#28133) 2024-09-27 06:27:34 +04:00
Emily Xiong 7da6f85734 fix(core): remove strong-log-transformer (#28094)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/26904
2024-09-26 15:51:53 -04:00
Emily Xiong cc428c7782 fix(core): log error for runTaskInForkedProcess (#28078)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/26594
2024-09-26 15:50:07 -04:00
Jason Jean e76c7d1428 feat(rspack): move rspack into main nx repo (#27969)
- feat: add rspack plugin (#143)
- feat: add rspack plugin (#143)
- feat(rspack): update to latest rspack version (#159)
- feat(rspack): add missing features (less/sass/stylus, assets, etc.)
(#160)
- feat(rspack): add missing features (less/sass/stylus, assets, etc.)
(#160)
- feat(rspack): clean-up project setup (#161)
- feat(rspack): clean-up project setup (#161)
- fix(rspack): use correct app dir when generating non-root projects
(#162)
- fix(rspack): use correct app dir when generating non-root projects
(#162)
- chore(repo): migrate to Nx 15.8.5 (#169)
- feat(rspack): update and pin rspack to 0.1.0 (#173)
- fix(rspack): fix rspack build
- chore(rspack): remove comment (#175)
- feat(rspack): set mode in configuration and expose option (#177)
- fix(rspack): handle existing stylePreprocessorOptions (#182)
- fix(rspack): add dependency to ajv-keywords that match the version
used by rspack (#187)
- fix(rspack): pass devServer options to devServer (#193)
- fix(rspack): set externals for target node (#194)
- feat(rspack): install latest patch when configuring (#195)
- fix(rspack): add withWeb if web app (#200)
- chore(repo): fix release script (#202)
- chore(repo): fix release script (#202)
- feat(rspack): configuration generator better ux (#201)
- feat(rspack): builder returns outfile (#207)
- fix(rspack): use ensureTypescript before tsquery (#215)
- feat(rspack): simplify app generator (#212)
- feat(rspack): simplify app generator (#212)
- fix(rspack): implement watch mode (#217)
- fix(rspack): do not force cssmodules (#222)
- fix(rspack): use builtin minify instead (#172)
- fix(rspack): use built-in tsconfig paths support (#227)
- fix(rspack): add back `resolve.alias` configuration since
`resolve.tsConfigPaths` seem to be incorrect in some scenarios (#229)
- feat(misc): update to Nx 16 and rescoped packages (#235)
- feat(misc): update to Nx 16 and rescoped packages (#235)
- fix(misc): replace missed references to @nrwl scope (#239)
- chore(repo): add legacy packages for nx rescope (#238)
- chore(repo): add legacy packages for nx rescope (#238)
- fix(repo): fix publishing for legacy packages (#240)
- fix(repo): fix publishing for legacy packages (#240)
- fix(misc): target commonjs for legacy packages (#241)
- fix(repo): add json files to assets (#243)
- chore(repo): update to 16.0.3 (#244)
- chore(repo): update to nx 16.2.1 (#271)
- fix(rspack): lock version to 0.1.11 (#279)
- fix(rspack): refine output filename patterns (#280)
- chore(rspack): update to latest (#278)
- feat(rspack): Add extractLicenses option to rspack's project
configuration (#230)
- feat(rspack): Add extractLicenses option to rspack's project
configuration (#230)
- fix(rspack): add missing license-webpack-plugin dependency (#301)
- chore(repo): upgrade to nx 16.6.0 (#319)
- fix(rspack): add fileReplacements support (#231)
- chore(reop): update nx to 16.7.1 (#325)
- chore(rspack): add jest babel config to e2e (#321)
- chore: don't use rspack internal module (#328)
- chore(repo): update nx to 16.8.1 (#335)
- feat(rspack): add typecheck (#338)
- chore(repo): update nx to 17.0.1 (#342)
- feat(rspack): add generatePackageJson plugin (#341)
- feat(rspack): add generatePackageJson plugin (#341)
- feat: upgrade rspack to 0.4.4 (#352)
- fix(rspack): Add missing peer dep (#372)
- chore(repo): migrate to latest nx (#376)
- chore(repo): migrate to latest nx (#376)
- feat(rspack): update rspack to install the latest version (#379)
- feat(rspack): add option to keep existing versions of packages for
init generator (#378)
- fix(rspack): do not depend directly on ajv to allow for correct
hoisting (#384)
- fix(rspack): ensure react-refresh is installed (#385)
- fix(rspack): User port should be respected. (#387)
- feat(rspack_: update rspack to install latest version (#389)
- feat(rspack): support object configs (#402)
- feat(rspack): add crystal plugin for inferring projects (#407)
- feat(rspack): add crystal plugin for inferring projects (#407)
- feat(rspack): bump to latest rspack (#412)
- fix(rspack): add postcss-loader for css files (#415)
- feat(rspack): add module federation support (#416)
- feat(rspack): add module federation support (#416)
- fix(rspack): add hook for dev server to log when compilation completed
(#417)
- feat(rspack): add module-federation-static-server (#418)
- fix(rspack): ensure process is default import (#420)
- chore(repo): move packages/rspack to packages/rspack to prepare to be
imported
- chore(repo): move packages-legacy/rspack to packages-legacy/rspack to
prepare to be imported
- chore(repo): move e2e/rspack-e2e to e2e/rspack to prepare to be
imported
- chore(repo): fix e2e setup
- chore(repo): add rspack commit scope
- chore(rspack): configure correctly
- chore(rspack): final fixes
- docs(rspack): add docs for rspack
- chore(rspack): fix rspack e2e
- chore(react): add rspack bundler test

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-26 14:30:11 -04:00
Emily Xiong 741366d878 fix(graph): add spacing between graph details top (#28055)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

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

<img width="330" alt="Screenshot 2024-09-23 at 1 26 23 PM"
src="https://github.com/user-attachments/assets/fa62fcb6-a0a5-4684-a162-8003d1156418">
<img width="994" alt="Screenshot 2024-09-23 at 1 26 10 PM"
src="https://github.com/user-attachments/assets/8b2c8949-7aeb-4e9f-9502-14381ad980e4">

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

Fixes #
2024-09-26 14:12:06 -04:00
Colum Ferry e9cdc076dd chore(react): fix e2e 2024-09-26 17:07:13 +01:00
Isaac Mann fb543596a7 docs(core): blog and docs edits (#28138)
Copy editing
2024-09-26 17:12:44 +02:00
pawel-twardziak 4ed8e1ea36 fix(nx-dev): options of the affected are messed up (#28112)
Closes #27893

## Current Behavior
see #27893

## Expected Behavior
see #27893

## Related Issue(s)
see #27893

Fixes #
- docs for affected

---------

Co-authored-by: Isaac Mann <isaacplmann@gmail.com>
2024-09-26 11:07:41 -04:00
Johanna Pearce 621ac786a9 docs(nx-cloud): update access tokens recipe with new screenshot and link 2024-09-26 15:34:26 +01:00
Colum Ferry 4ae8886a04 chore(react): fix e2e 2024-09-26 15:26:12 +01:00
Isaac Mann fb92b68209 docs(core): better looking powerpack features category page 2024-09-26 16:25:00 +02:00
Emily Xiong f2dfe90f3c fix(core): fix output for 0 task (#28122)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-26 10:21:27 -04:00
Juri Strumpflohner 77a80c05ab feat(nx-dev): add Powerpack video to the landing page (#28126) 2024-09-26 05:10:25 -07:00
Juri 8f3269d8b1 docs(core): embed videos for powerpack features 2024-09-26 13:49:04 +02:00
Colum Ferry b1dae52101 fix(rspack): pin rspack to 1.0.5 2024-09-26 09:38:51 +01:00
Colum Ferry 27213f0c59 Merge branch 'master' into move-rspack-into-main 2024-09-26 09:37:02 +01:00
Juri fc39beae7a fix(nx-dev): adjust powerpack mobile view 2024-09-26 10:18:16 +02:00
Juri Strumpflohner 529ab9455c feat(nx-dev): powerpack landing page (#27963)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-25 19:24:54 -04:00
pralkarz 7f4c39ead4 cleanup(core): replace fs-extra with node:fs (#28019) 2024-09-26 00:00:39 +04:00
Jack Hsu 37523fa441 fix(js): @nx/js:init ensures tslib is installed if importHelpers is true (#28083)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
Sometimes tslib is missing even though it is needed for typechecks.

## Expected Behavior
tslib is installed when needed. i.e. `importHelpers: true`

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

Fixes #27656
2024-09-25 13:43:58 -04:00
Chau Tran 3c95965e7c feat(graph): enable composite graph functionality (#27789)
This PR enables composite graph functionality:
- Experimental feature to enable Composite Graph
- In Composite Graph mode:
  - Nodes are shown by default.
  - Show/Hide All Projects function similarly to regular mode
- Focus a Composite Node renders the inner nodes with up-to 3 additional
containers: Green area contains external nodes that depend on the inner
nodes; Orange area contains external nodes that the inner nodes depend
depend on; Purple area contains external nodes with circular
dependencies with the inner nodes.
    - Focused node can be unfocus/reset.
- Only one node can be focused at one given time. - Show All projects
while having a focused node will unfocus the node.
- Expand a Composite Node renders the inner nodes of the composite node
in-place (i.e: still keep the context of the current graph). Expanded
node can be collapsed to go back.
2024-09-25 13:20:48 -04:00
Jack Hsu 7e1cf531ca fix(linter): add files entry to angular flat config to avoid applying TS rules to JSON files (#28102)
This PR fixes an issue with buildable/publishable Angular libs, where TS
rules are being applied to JSON files.

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

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

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

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

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

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

Fixes #28069

---------

Co-authored-by: James Henry <james@henry.sc>
2024-09-25 13:12:24 -04:00
Craigory Coppola 04cf92a58c fix(core): hide no file server process json log (#27626)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

Co-authored-by: James Henry <james@henry.sc>
2024-09-25 11:19:06 -04:00
Louie Weng 4fe7cbe679 docs(nx-cloud): update reference to start-ci-run and complete-ci-run (#27909)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

Updated references about start-ci-run to include mentions of warnings
that you get if you don't include the `--distribute-on` flag.

Also removed references to the legacy `--stop-all-agents` command in
favor of `--complete-ci-run`.

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

Fixes #
2024-09-25 08:06:15 -07:00
Isaac Mann 12eb5df469 docs(core): powerpack docs (#27904)
-  Activate powerpack recipe
-  Powerpack owners documentation
- [x] Powerpack custom remote cache documentation
- [x] Powerpack conformance documentation

Infrastructure for powerpack docs

- Adds the ability to generate API docs from ocean packages

To generate API documentation for plugins in the ocean repository, run
the `nx documentation` command with the `NX_OCEAN_RELATIVE_PATH`
environment variable set to the relative path to your checked out copy
of the ocean repo.

```
NX_OCEAN_RELATIVE_PATH=../ocean nx documentation
```

This will create generated API documentation in the
`docs/external-generated` folder. This API will be merged into the
normal `docs/generated` documentation when the docs site is built.

Because there are two separate output folders, if someone runs `nx
documentation` without the `NX_OCEAN_RELATIVE_PATH` environment
variable, the ocean documentation will not be overwritten. The ocean
documentation will only be updated or deleted when someone explicitly
chooses to do so.

---------

Co-authored-by: Juri Strumpflohner <juri.strumpflohner@gmail.com>
2024-09-25 10:15:47 -04:00
James Henry 5916c608ef chore(react): disable failing e2e test with rspack module federation (#28100) 2024-09-25 16:59:21 +04:00
Phillip Barta 2ae35dd66e fix(bundling): remove unused babel-plugin-transform-async-to-promises from @nx/rollup (#27669) 2024-09-25 15:08:36 +04:00
Julián Gómez Sibecas 0a2ce53b6f feat(core): update github action pnpm version (#27815) 2024-09-25 14:59:13 +04:00
Leosvel Pérez Espinosa 3c1cac7704 fix(linter): ignore dist and use compat helper for eslint-plugin-react-hooks (#28080) 2024-09-25 14:54:44 +04:00
Isaac Mann bf90e5857f chore(core): add nixallover to cloud docs owners (#28084) 2024-09-25 14:54:05 +04:00
James Garbutt 39352a563a cleanup(nextjs): migrate to picocolors (#28064) 2024-09-25 14:53:21 +04:00
James Henry 619dbe7316 fix(release): add groupPreVersionCommand to schema, improve logging (#28087) 2024-09-25 14:51:10 +04:00
Leosvel Pérez Espinosa 4fa50ad238 fix(js): ensure prettier is available for generators if it is meant to be installed (#28082)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-25 09:17:09 +02:00
Jason Jean 6182d20449 fix(core): remove wasi compatibility while db is unsupported in wasi (#28089)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Users get a `disk i/o` error from connecting to SQL because of a vfs.

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

Not really sure but this might address those errors. Might not. We don't
need this at the moment though because the SQL database is not compiled
for wasi.

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

Fixes #
2024-09-24 18:15:51 -04:00
Jason Jean 4081901b8d fix(core): several powerpack fixes (#28088)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 flag in `nx.json` to enable the db cache
* Typings for powerpack are `any`
* Powerpack errors are not shown in `nx report`
* 9999 workspaces show up when user purchases unlimited license
* There is no indication from caching that license has expired.

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

* There is an `enableDbCache` flag for `nx.json`. It'll probably be
changed soon.
* Typings for powerpack come from the powerpack packages
* Powerpack errors are shown in nx report
* "an unlimited number of workspaces" shows up when user purchases
unlimited license
* There is an indication when licenses expire.

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

Fixes #
2024-09-24 18:14:17 -04:00
Zachary DeRose fd99bae238 docs(misc): adding 19.8 video embed (#28085)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-24 18:59:11 +00:00
Jack Hsu d1194a9508 fix(core): nx add should show errors (#28079)
`nx add` errors should be surfaced to users.

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

## Current Behavior
Users do not see errors from init generator.

## Expected Behavior
Users see errors from init generator.

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

Fixes #
2024-09-24 14:02:57 -04:00
Leosvel Pérez Espinosa 5afece0ed6 fix(core): support more structured errors in sync generators (#28075) 2024-09-24 21:49:45 +04:00
MaxKless b73f1e0e00 fix(core): set windowsHide: true wherever possible (#28073)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-24 11:31:22 -04:00
Colum Ferry 8290969cb7 feat(storybook): remove cypress options for e2e testing (#27850)
- feat(storybook): remove cypress options from configuration generator
- feat(react): remove cypress options from storybook-configuration
- feat(react): remove cypress options from stories generator
- feat(react): remove component-cypress-spec generator
- chore(storybook): restore @nx/cypress dep
- feat(remix): remove cypress options from storybook
- feat(angular): remove cypress options from storybook-configuration
- feat(angular): remove cypress options from stories generator
- feat(angular): remove component-cypress-spec generator
- feat(vue): remove cypress options from stories generator

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

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

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

## Current Behavior
<!-- This is the behavior we have today -->
With Storybook Interaction Testing, there's no longer a need to setup
Cypress to specifically test storybook instances


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Remove cypress options for creating an e2e project specifically for
testing storybook instances.

Use Storybook Interaction Testing instead

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

Fixes #
2024-09-24 15:54:58 +01:00
Leosvel Pérez Espinosa 72cd1c15e6 feat(js): add the setup-prettier generator (#27996)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-24 17:24:09 +04:00
Emily Xiong 3e1a87917f fix(core): add flag when db is disabled for task history (#28059)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-23 18:38:29 -04:00
Jonathan Cammisuli 341306a0c0 fix(core): sort projects after updating from context (#28024)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Whenever a file is created in a project, the daemon will insert the
newly created file at the end of the project file map list. This causes
issues with cache determinism because the newly created file is not
sorted. When doing `nx reset`, the file will then be properly sorted
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Whenever a file is inserted into the project map, sort the changed file
map.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-23 11:10:06 -04:00
Emily Xiong 05f16cfbdd fix(core): fix output text for multiple targets (#28043)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-23 11:05:04 -04:00
Jack Hsu 4fedc409fa feat(core): allow prompts from init generators during nx init (#28003)
This PR allows init generators to prompt during `nx init`.

Demo (temporarily adds prompt to vite init):
https://www.loom.com/share/ad40e6f02186478596ea6e1f08dba7a4

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-23 10:43:47 -04:00
Leosvel Pérez Espinosa d454f25aad feat(testing): update test generators to exclude test files from the runtime tsconfig file (#27991)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-23 09:25:12 -04:00
Leosvel Pérez Espinosa c92528f65d feat(misc): remove derived generator paths (#27714)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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: Nicholas Cunningham <ndcunningham@gmail.com>
2024-09-23 09:19:42 -04:00
James Henry 5216f7aac4 fix(release): allow dynamically continuing when current version is unresolvable (#28034) 2024-09-23 13:32:47 +01:00
James Garbutt b717aaf67e cleanup(expo): migrate to picocolors (#28038) 2024-09-23 15:25:35 +04:00
James Garbutt 951baee460 cleanup(core): migrate esbuild to use picocolors (#28033) 2024-09-23 14:50:14 +04:00
Julián Gómez Sibecas 88d339a1a3 docs(core): replace yarn with pnpm (#28027) 2024-09-23 14:03:09 +04:00
James Garbutt 246494ae2d cleanup(web): migrate to picocolors (#28039) 2024-09-23 14:01:34 +04:00
Colum Ferry f9e1d6371e Merge branch 'master' into move-rspack-into-main 2024-09-23 09:27:44 +01:00
Julián Gómez Sibecas 0d50b13a25 chore(core): nx plugin submission nx-solhint (#28026)
<!-- 
_[Please make sure you have read the submission guidelines before
posting an
PR](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#submit-pr)_

# Community Plugin Submission

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

## Plugin Requirements

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

i.e.

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

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

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

Example:

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

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

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

# Community Plugin Submission

## nx-solhint

<!-- 
Describe what your plugin is and what is its goal or issues it
addresses. If you don't provide a description, we will not merge your
PR.
Is it focused on a technology, tooling or behaviour? Does the plugin
provide generators, executors or graph support?
Do you know who is already using the plugin? Mention who is the author
of the plugin.
-->
2024-09-22 21:18:28 -04:00
Jason Jean a510b3642d fix(core): allow creating a db cache without linking task details (#28023)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 db cache does not work without task details.

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

The db cache works without task details.

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

Fixes #
2024-09-20 18:02:21 -04:00
Jack Hsu 7af099c828 docs(core): add missing .DocSearch-VisuallyHiddenForAccessibility style (#28022) 2024-09-21 00:30:24 +04:00
Jack Hsu 1df8ad7563 docs(core): add missing .DocSearch-VisuallyHiddenForAccessibility style (#28020)
Add a missing class name causing the icon text to display on screen.

<img width="2033" alt="Screenshot 2024-09-20 at 3 58 36 PM"
src="https://github.com/user-attachments/assets/0a741e04-6467-463f-9e16-058aa495c095">

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-20 16:18:59 -04:00
James Henry 2e33230753 chore(misc): add custom lint rule for ensuring pnpm-lock.yaml version (#28010) 2024-09-20 23:17:05 +04:00
Zachary DeRose 53e11788f1 docs(misc): nx 19.8 blog and changelog (#28014)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-20 13:01:20 -04:00
Juri Strumpflohner c50acf793a fix(react): vite should be default bundler in app generator (#28013)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-20 12:12:03 -04:00
James Henry 57fe56edf8 chore(core): fix snapshots (#28011) 2024-09-20 18:19:27 +04:00
James Henry 00b3dd2fd9 fix(linter): do not generate docs.recommended property (#28009) 2024-09-20 17:31:10 +04:00
James Henry 21d1696ef5 feat(release): support github enterprise server (#26482) 2024-09-20 16:15:15 +04:00
James Garbutt 0d37ef98da cleanup(misc): migrate from chalk to picocolors (#27967) 2024-09-20 16:08:44 +04:00
Juri e9fd0a7e2b fix(graph): typo 2024-09-20 09:31:13 +02:00
Jason Jean 999abe9656 fix(core): do not check cache validity when putting into the cache (#28004)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Invalid cache message shown twice.

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

Invalid cache message shown once.

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

Fixes #
2024-09-19 14:58:10 -04:00
Colum Ferry f767bab941 fix(module-federation): collect secondary entry points from exports #26878 (#27999)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Some packages that use `exports` in the package.json may point to a
directory such as `esm/<entrypoint>`.
They would still be imported such as `mypackage/secondary-point`.
This needs to be shared still for Module Federation.

However, our current logic for finding secondary entry points for
packages looks at the sub dirs of the package and tries to match it with
the exports fiels.

Therefore if `mypackage/secondary-point` was set up such that

```
"./secondary-point": {
  default: "esm/secondary-point/index.mjs"
}
```

then it would never be found correctly, causing share problems.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
exports of secondary entrypoints should be shared correctly


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

Fixes #26878
2024-09-19 18:58:32 +01:00
Jason Jean f0f8de8959 fix(core): fix powerpack fs cache package name (#27997)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

The name is `@nx/powerpack-shared-fs-cache`

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

Fixes #
2024-09-19 13:40:37 -04:00
Jack Hsu 1e1bbf0389 chore(repo): update to nx 19.8.0-beta.2 (#28002)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-19 13:38:58 -04:00
Colum Ferry 7b3f45bd73 fix(angular): license-webpack-plugin should not scan root package.json #27989 (#27994)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `license-webpack-plugin` is trying to scan the root package.json on
windows, resulting in an error.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Patch the `license-webpack-plugin` to prevent it from scanning the root
package.json. A similar fix was needed for rspack.

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

Fixes #27989
2024-09-19 18:11:30 +01:00
Jack Hsu eec00147ff fix(core): link to sync generators page during sync prompt, and provide more info on docs page for disabling and applyChanges (#28001)
This PR expands the concept page for sync generators to show config
examples for `applyChanges` and `disableTaskSyncGenerators`. It also
adds a link when during the sync prompt for users to read more about it.

<img width="1392" alt="Screenshot 2024-09-19 at 12 00 14 PM"
src="https://github.com/user-attachments/assets/a13f50b7-557a-4c76-8903-49486ebf4ff2">

Preview:
https://nx-dev-git-feat-sync-docs-and-links-nrwl.vercel.app/concepts/sync-generators

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-19 13:11:02 -04:00
Leosvel Pérez Espinosa a1f69e3a01 feat(graph): add sync generators to target details in project details view (#27639)
Add a `Sync Generators` section to the target details in the PDV.

### Default


![image](https://github.com/user-attachments/assets/0390c301-a833-4230-8c6a-0d452a7b8c57)

### Heading tooltip


![image](https://github.com/user-attachments/assets/b8b1c19f-20f8-42e6-a914-16e4dd0b11f2)

### Source map


![image](https://github.com/user-attachments/assets/3b66d2e1-88b7-42e8-9771-5732a32b4cc3)

![image](https://github.com/user-attachments/assets/8b3b0f15-c2f1-411f-8eb6-1df6ff320c5c)

### Disabled sync generator tooltip


![image](https://github.com/user-attachments/assets/9fd35041-35fc-41c4-92b5-b613fed9e0ae)


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

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

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

Fixes #
2024-09-19 12:17:55 -04:00
Colum Ferry 7d0d834e42 fix(react): normalizing project names for module federation correctly #27901 (#27990)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
React Module Federation generators were normalizing names and using them
incorrectly


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The host and remote generators should always use the name provided by
the determineProjectNameAndRootOpitons

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

Fixes #27901
2024-09-19 13:44:22 +01:00
Colum Ferry d536b43eaa docs(angular): correct the angular dynamic mfe tutorial (#27992)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Some of the commands and file contents are outdated approaches for
Angular


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Correct the commands and file contents

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

Fixes #
2024-09-19 13:13:31 +02:00
Jason Jean 7f4a8777d2 docs(core): hide documentation for activate powerpack (#27980)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

It will cause confusion if this is documented without other
documentation.

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

`activate-powerpack` is undocumented for now.

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

Fixes #
2024-09-18 20:35:59 -04:00
Jason Jean 8c35229cd3 fix(core): fix powerpack license report and add back remote cache (#27983)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 remote cache was not being initialized on the new db cache.
Powerpack license expiration improperly assumed to be unix timestamp in
ms

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

The remote cache is being initialized on the new db cache. Powerpack
license expiration shows up properly.

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

Fixes #
2024-09-18 19:26:32 -04:00
Zachary DeRose 9f81d89d00 docs(misc): postcast #5 (#27981)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-18 16:38:21 -04:00
Benjamin Cabanes c3839204a9 feat(nx-dev): clean up enterprise section (#27979) 2024-09-18 13:45:29 -04:00
Jason Jean b06f515059 feat(core): add integration with nx powerpack (#27972)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Integration with Nx Powerpack is added. Nx Powerpack is optional, stay
tuned for more information which will be released soon.

## 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>
Co-authored-by: JamesHenry <james@henry.sc>
2024-09-18 13:41:24 -04:00
Isaac Mann fb91ed5e7f docs(core): links to set CI vars instructions (#27978)
Adds links to GitHub Actions and GitLab instructions for defining secret
environment variables in the UI.
2024-09-18 13:01:16 -04:00
Colum Ferry bb3837d871 Merge branch 'master' into move-rspack-into-main 2024-09-18 17:30:44 +01:00
Colum Ferry 392b4b82bc chore(react): add rspack bundler test 2024-09-18 16:59:18 +01:00
Zachary DeRose ee30d6ff76 Re add conf speaker pt 2 (#27975)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-18 11:53:06 -04:00
Isaac Mann 24ddbe7254 chore(nx-dev): honor prefers-reduced-motion (#27976)
Fixes #27114 (again)
2024-09-18 11:50:53 -04:00
Leosvel Pérez Espinosa 50927c2462 feat(core): handle prettier not installed when running nx format (#27970)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `prettier` is not installed, running `nx format` results in an
uncaught error.

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

When `prettier` is not installed, running `nx format` should handle the
error and log a more appropriate message.

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

Fixes #
2024-09-18 17:32:14 +02:00
Jack Hsu 91613d727b chore(repo): update to nx 19.8.0-beta.0 (#27973)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-18 11:29:03 -04:00
Colum Ferry c544a34c2b chore(rspack): fix rspack e2e 2024-09-18 10:27:18 +01:00
Colum Ferry 6c032ab800 docs(rspack): add docs for rspack 2024-09-18 10:27:05 +01:00
Colum Ferry a38eca2930 chore(rspack): final fixes 2024-09-18 10:26:52 +01:00
Colum Ferry 9cbc1af014 chore(rspack): configure correctly 2024-09-18 10:26:31 +01:00
Colum Ferry 1b819aa628 chore(repo): add rspack commit scope 2024-09-18 10:25:41 +01:00
Colum Ferry 099608f896 chore(repo): fix e2e setup 2024-09-18 10:25:28 +01:00
Colum Ferry 23c365f426 feat(repo): merge main from https://github.com/nrwl/nx-labs 2024-09-18 10:24:57 +01:00
Colum Ferry c9f3070aa8 chore(repo): move e2e/rspack-e2e to e2e/rspack to prepare to be imported 2024-09-18 10:24:57 +01:00
Colum Ferry b0ffe29e55 feat(repo): merge main from https://github.com/nrwl/nx-labs 2024-09-18 10:24:02 +01:00
Colum Ferry 4c1fed42aa chore(repo): move packages-legacy/rspack to packages-legacy/rspack to prepare to be imported 2024-09-18 10:24:02 +01:00
Colum Ferry e9b03641ac feat(repo): merge main from https://github.com/nrwl/nx-labs 2024-09-18 10:22:51 +01:00
Colum Ferry c85cc7b5f4 chore(repo): move packages/rspack to packages/rspack to prepare to be imported 2024-09-18 10:22:51 +01:00
Jack Hsu eb61254239 fix(core): nx import detects plugins synchronously (#27958)
This PR switches `globWithWorkspaceContext` with
`globWithWorkspaceContextSync` for `nx init` and `nx import`, since the
latter isn't guaranteed to have updated file map during the init/import
process.

Note: Also updates Gradle import test to ensure the destination repo
does not have uncommitted changes.

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

## Current Behavior
Sometimes plugins are not detected.

## Expected Behavior
Always detect plugins.

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

Fixes #
2024-09-17 16:43:18 -04:00
Emily Xiong adc1abd003 fix(core): fix env for running parallel tasks (#27889)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
- between this.tasksSchedule.scheduleNextTasks() and
this.tasksSchedule.nextTask(), scheduledTasks are different when in
parallel, so when calling `processAllScheduledTasks`, it does not
process the all scheduled tasks, so it did not populate env.

## 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/27586
2024-09-17 15:15:30 -04:00
Emily Xiong cf1ffdea00 feat(core): split runCommand to return status per project (#27705)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-17 14:55:22 -04:00
Jack Hsu 91e3ac089b fix(core): import handles argument escaping correctly in Windows (#27957)
This PR handles Windows arguments correctly, since Powershell and Cmd do
not support single quotes.

**Changes:**

- Properly escape '\' in Windows paths 
- Set source and destination using environment variables rather than
args to avoid pwsh handling of quotes
2024-09-17 14:48:55 -04:00
Leosvel Pérez Espinosa e0b3e73d7a feat(angular): add plugin for inferring nodes from angular.json files (#27804)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

Fixes #

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-09-17 11:00:15 -04:00
Colum Ferry 2be7424fc4 docs(angular): add esbuild information to incremental builds (#27952)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Setup angular incremental builds doc does not contain info on esbuild

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add information about using incremental builds with angular.
Also callout that the performance gain may not be as effective as it was
with webpack

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

Fixes #27716
2024-09-17 15:17:38 +01:00
Jack Hsu b92109164e fix(core): import should be rebasable (#27940)
When users run `nx import` and open a PR with the imported package, they
should be able to use `git rebase --rebase-merges` to update their
branch with latest main.

## Why this matters

If the repo requires the PR to be updated with latest main before merge,
the user must have a way to do this and avoid having to do the import
process all over again.

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

## Current Behavior
Rebase results in git error

## Expected Behavior
Rebase works

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

Fixes #
2024-09-17 09:50:57 -04:00
pralkarz d38bb78f27 cleanup(js): replace fs-extra with node:fs (#27932) 2024-09-17 15:48:42 +04:00
Colum Ferry 79443ff962 fix(storybook): do not duplicate cacheable operations #27866 (#27951)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
`build-storybook` is being added to cacheable operations multiple times
when the `@nx/storybook:init` generator is being invoked.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Do not add `build-storybook` multiple times

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

Fixes #27866
2024-09-17 14:34:53 +03:00
Leosvel Pérez Espinosa 67ecff198f fix(js): do not infer typecheck target for root tsconfig.json (#27950)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-17 12:54:30 +02:00
Colum Ferry 81d3529768 docs(nx-dev): add next-gen module-federation deployments blog post (#27892)
- docs(nx-dev): add blog for nx rspack mod fed
- docs(nx-dev): add next-gen module federation deployments blog post

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-17 11:49:57 +01:00
Jonathan Gelin 71fe65ffbd feat(release): support groupPreVersionCommand for release groups (#27474) 2024-09-17 14:23:08 +04:00
Austin Fahsl 786537efa8 fix(release): allow string array for commitArgs and tagArgs (#27797) 2024-09-17 14:19:33 +04:00
Colum Ferry 0a8202aee1 fix(angular): migrations should use correct namedInputs #27899 (#27929)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Should use correct namedInputs in the migration instead of assuming
'production' is available.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use the correct namedInputs based on what is listed in `nx.json`

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

Fixes #27899
2024-09-17 10:53:58 +01:00
Leosvel Pérez Espinosa 781f194bd3 cleanup(misc): fix outdated test snapshot (#27948) 2024-09-17 13:25:56 +04:00
Juri 57a201a562 docs(core): update watch command with new example and embed YT video 2024-09-17 09:43:48 +02:00
Benjamin Cabanes 5b34ea58a8 fix(nx-dev): update contributors value (#27944) 2024-09-16 16:39:31 -04:00
Jason Jean e5f52ca426 fix(core): add flag to disable the db and logs when there are errors … (#27930)
…connecting to the db

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

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 flag to disable the DB and little logs for when Nx fails to
connect to the DB.

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

There is a `NX_DISABLE_DB=true` flag which can be used to disable usage
of the DB. There are more logs which should help us identify what
exactly is failing when connecting to the DB.

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

Fixes #
2024-09-16 16:06:00 -04:00
Nicholas Cunningham 84dcbc80d7 fix(react): Add historyApiFallback to webpack config (#27942)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

Currently, if we generate a react app with `--routing` enabled navigate
to the 2nd page and doing a refresh fails the load.

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

Routing to another page and refreshing should work out of the box.

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

Fixes #23188
2024-09-16 13:52:57 -06:00
Craigory Coppola 581f2fd068 fix(release): ensure default release group has projects on windows (#27933) 2024-09-16 16:59:01 +00:00
Ali Yusuf 2546082852 fix(vite): exit from test if no files found (#27722)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
After running `nx test project` or `nx run-many -t test` with no test
files with `@nx/vite:test` plugin, vitest process exit directly but nx
reporter keep waiting for finish notification which cause to waiting
indefinitely.

vitest reference:

https://github.com/vitest-dev/vitest/blob/main/packages/vitest/src/node/core.ts#L409-L413

https://github.com/vitest-dev/vitest/blob/main/packages/vitest/src/node/cli/cli-api.ts#L102-L116

console log example:
```bash
nx test project

> nx run project:test


 RUN  v2.0.5 /path/to/project

include: src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}
exclude:  **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*
No test files found, exiting with code 0
```

```bash
nx run-many -t test --no-cache -p project

 NX   Running target test for project project

      With additional flags:
        --cache=false

   →  Executing 1/1 remaining tasks...

   ⠹  nx run project:test
```

## Expected Behavior
`nx test project` should exit directly in case vitest process exit
early.

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

Fixes #
2024-09-16 16:23:33 +01:00
Colum Ferry d682baea67 fix(angular): dynamic module federation should not reset remoteUrlDefinitions #27793 (#27927)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
When the `@nx/angular/mf` file is loaded, it sets `remoteUrlDefinitions
= {}`.
As this is a global, this can lead to erroneous behaviour by resetting
existing definitions. It is also always truthy, breaking logic on
whether urls need to be set or not.



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The object should be conditionally set if undefined when calling
`setRemoteDefinition`


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

Fixes #27793, #27842
2024-09-16 14:47:31 +01:00
Colum Ferry a7aab61ec3 fix(remix): vite plugin should be less strict on inference #27884 (#27923)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 Remix plugin is too strict when finding Remix Vite projects


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The Remix plugin should be more permissive in finding Remix Vite
projects

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

Fixes #27884
2024-09-16 09:08:29 -04:00
Colum Ferry d7233268d8 fix(angular): add serve static target more intentionally #27854 (#27924)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `serve-static` target is being added in the `add-e2e` file, however,
it has uses beyond e2e.



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `serve-static` target should be added with more intention

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

Fixes #27854
2024-09-16 13:45:46 +01:00
Colum Ferry 9c218e7606 fix(vite): typecheck infer plugin should use correct inputs (#27922)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
<!-- This is the behavior we have today -->
Vite typecheck target is not falling back to default if production does
not exist.
It also does not have an input on typescript itself

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

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

Fixes #
2024-09-16 12:23:56 +01:00
MaxKless dc821abd52 feat(graph): expose functions to render pdv & error page (#27833)
we have fully isolated graph & error components with a good api but no
way to access them directly from the outside (in console).

This PR adds two functions to the window object so that we can render
the PDV directly instead of needing the entire app with routing and
everything.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-09-13 14:48:30 -04:00
Emily Xiong 61b3503619 feat(core): able to import gradle project (#27645)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-13 14:28:59 -04:00
MaxKless 5bbaffbda8 feat(core): add metagenerator for convert-to-inferred (#27672)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 DX to migrate to project crystal isn't great right now - people have
to run `convert-to-inferred` generators manually.

## Expected Behavior
We should provide a smoother way to migrate, so we introduced an
`@nx/workspace:infer-targets` generator that can handle multiple
conversions at once, either for the whole workspace or at a project
level.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-09-12 20:06:45 -04:00
Jack Hsu 7232b392ba fix(js): set compilerOptions correctly when loading .ts that targets ESM (#27862)
When we load `.ts` files and the closest `package.json` specifies
`"type": "module"`, then the file may error upon loading. This happens
because we're not setting `compilerOptions` correctly when registering
`ts-node/esm`-- in fact there is no way to pass options through this
hook.

This PR sets defaults on `TS_NODE_COMPILER_OPTIONS` such that the
`module` and `moduleResolution` are correct values for ESM. It also
works for CJS since both `module` and `moduleResolution` check the
closest `package.json` to determine the format.

## 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 #23228
2024-09-12 18:47:15 -04:00
Craigory Coppola 1924bc30b6 fix(core): handleErrors should display error cause if it exists (#27886)
Some error messages are not displaying properly, as they pass their
original message as a cause. While `node` supports this, our
`handleErrors` function was not displaying error causes.

```
"Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
            CreateMetadataError: The "test-plugin" plugin threw an error while creating metadata: cause message
            at /Users/agentender/repos/nx/packages/nx/src/utils/handle-errors.spec.ts:17:29
            at handleErrors (/Users/agentender/repos/nx/packages/nx/src/utils/handle-errors.ts:11:26)
            at Object.<anonymous> (/Users/agentender/repos/nx/packages/nx/src/utils/handle-errors.spec.ts:15:23)
            at Promise.then.completed (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/utils.js:298:28)
            at new Promise (<anonymous>)
            at callAsyncCircusFn (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/utils.js:231:10)
            at _callCircusTest (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:316:40)
            at async _runTest (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:252:3)
            at async _runTestsForDescribeBlock (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:126:9)
            at async _runTestsForDescribeBlock (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:121:9)
            at async run (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:71:3)
            at async runAndTransformResultsToJestFormat (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
            at async jestAdapter (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
            at async runTestInternal (/Users/agentender/repos/nx/node_modules/.pnpm/jest-runner@29.7.0/node_modules/jest-runner/build/runTest.js:367:16)
            at async runTest (/Users/agentender/repos/nx/node_modules/.pnpm/jest-runner@29.7.0/node_modules/jest-runner/build/runTest.js:444:34)
        Caused by: 
            Error: cause message
              at /Users/agentender/repos/nx/packages/nx/src/utils/handle-errors.spec.ts:16:21
              at handleErrors (/Users/agentender/repos/nx/packages/nx/src/utils/handle-errors.ts:11:26)
              at Object.<anonymous> (/Users/agentender/repos/nx/packages/nx/src/utils/handle-errors.spec.ts:15:23)
              at Promise.then.completed (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/utils.js:298:28)
              at new Promise (<anonymous>)
              at callAsyncCircusFn (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/utils.js:231:10)
              at _callCircusTest (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:316:40)
              at async _runTest (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:252:3)
              at async _runTestsForDescribeBlock (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:126:9)
              at async _runTestsForDescribeBlock (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:121:9)
              at async run (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/run.js:71:3)
              at async runAndTransformResultsToJestFormat (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
              at async jestAdapter (/Users/agentender/repos/nx/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
              at async runTestInternal (/Users/agentender/repos/nx/node_modules/.pnpm/jest-runner@29.7.0/node_modules/jest-runner/build/runTest.js:367:16)
              at async runTest (/Users/agentender/repos/nx/node_modules/.pnpm/jest-runner@29.7.0/node_modules/jest-runner/build/runTest.js:444:34)"
    `
```
2024-09-12 17:02:13 -04:00
James Henry 68eeb2eeed feat(linter): create new workspaces with ESLint v9 and typescript-eslint v8 (#27404)
Closes #27451

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-09-12 16:02:27 -04:00
Craigory Coppola 2e0f374964 fix(misc): createNodesV2 plugins should show inference capabilities (#27896)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

## Current Behavior
Plugins that export `createNodesV2` are not considered as having
inference capabilities

## Expected Behavior
`createNodesV2` is the future API replacing `createNodes`, so it should
show the same capability

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

Fixes #
2024-09-12 15:59:01 -04:00
Louie Weng 7f7e4d0c4f fix(nx-cloud): include nxCloudId when generating connect urls (#27882)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

NxCloudId should be part of the URL that is created when connecting a
new workspace.

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

Fixes #
2024-09-12 13:57:01 -06:00
Emily Xiong 9c4092de8d feat(core): use durations from task history to schedule tasks (#27783)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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: FrozenPandaz <jasonjean1993@gmail.com>
2024-09-12 15:53:37 -04:00
Chau Tran 0e603af8a9 docs(nx-cloud): update azure saml setup (#27898)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-12 14:14:08 -05:00
Isaac Mann 514ce17b8c docs(core): import documentation (#27859)
Create an import project recipe
Creates the import command API reference
Adds the import command to the command landing page
2024-09-12 09:12:24 -04:00
Isaac Mann 4517d9f721 docs(core): nx sync (#27825)
- Adds nx sync to command reference
- Updates nx.json reference
- Update project configuration reference
- Adds a sync generators concept page
- Adds a Register a Sync Generator recipe under Extending Nx Recipes

---------

Co-authored-by: James Henry <james@henry.sc>
2024-09-12 07:30:46 -04:00
Nate Jacobs b6140d4590 fix(core): respect filenames of inputs when computing task hash (#27873) 2024-09-11 18:30:20 -04:00
Jack Hsu d8cb932422 fix(webpack): handle relative paths for additionalEntryPath (#27885)
The `NxAppWebpackPlugin` does not support relative paths in
`additionalEntryPoints`.

So this will fail:

```js
new NxAppWebpackPlugin({
  ...
  additionalEntryPoints: ['.src/foo.ts']
```

The resolved path is relative to workspace root when it should be
project root.

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

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

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

## Current Behavior
Build will fail.
## Expected Behavior
Build should work.

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

Fixes #
2024-09-11 16:37:25 -04:00
Isaac Mann 43eaa5a348 chore(nx-dev): increase timeout for nx-dev-e2e (#27872)
Increase timeout for nx-dev-e2e tasks
2024-09-11 15:32:52 -04:00
Louie Weng 7da48d022c docs(nx-cloud): add more information about setting up CI access tokens (#27883)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

More graphics for changing and viewing access tokens (both CI and
personal). Also update the CI access token page with more information on
how to set them and the purposes of read-only tokens.

## 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-09-11 19:28:15 +00:00
Jack Hsu 8b177bd60e feat(core): import warns when source and destination directories are different (#27875)
This PR adds a warning when the user choose different source and
destination roots. This is a problem for Nx workspaces using path
options in `project.json`, and possibly other config files such as
`tsconfig.json`, `jest.config.ts`, etc.

Note: Also included a guard that the destination directory isn't an
absolute path like `/tmp/foo`, because the behavior will not work as
expected.

The message when the source is an Nx workspace:
<img width="1392" alt="Screenshot 2024-09-11 at 9 32 54 AM"
src="https://github.com/user-attachments/assets/c8ebedba-fd66-4dbf-ada9-eacf86bd67fc">


The message when the source is not an Nx workspace:
<img width="1392" alt="Screenshot 2024-09-11 at 9 30 44 AM"
src="https://github.com/user-attachments/assets/ade9fbd1-4d5d-4d0c-93f6-eaad176af333">
2024-09-11 15:27:55 -04:00
Emily Xiong 24edc5ad99 fix(core): handle --no-interative for create-nx-workspace (#27702)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-11 15:02:59 -04:00
Emily Xiong 2eb5592ac3 fix(gradle): fix gradle app deps (#27865)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/27819
2024-09-11 14:39:08 -04:00
Jack Hsu 5784b885bd docs(webpack): add a breaking change for updating webpack-dev-server to v5 (#27604)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-11 10:12:16 -04:00
Philip Fulcher d6b87e5306 docs(nx-dev): fixes for personal access token blog (#27864)
* Updates screenshot of workspace settings
* Clarifies language around the personal access token
2024-09-11 07:46:17 -06:00
Isaac Mann 5576ba1159 docs(core): changes to login docs (#27863)
- Fixes typo for login/logout on commands landing page
- Mention that `nx-cloud login` is the same as `nx login`
- Update references to `npx nx-cloud login` to use `nx login` by default
instead
- Updates Workspace ID access level wording in the "Nx CLI and CI Access
Tokens" page
2024-09-11 09:12:21 -04:00
Leosvel Pérez Espinosa 2a3307cfad fix(js): keep refs to ignored files and allow opting out of pruning stale refs in typescript sync generator (#27636) 2024-09-10 20:46:55 +04:00
Leosvel Pérez Espinosa 4986b88bb2 fix(core): handle sync generator failures (#27650) 2024-09-10 20:45:59 +04:00
Isaac Mann 5d039c2dcd docs(core): reword import help text (#27732)
Updates the help text for the `nx import` command
2024-09-10 12:36:32 -04:00
Zachary DeRose fd5928406d docs(misc): turning on PAT blog and adding rspack to changelog (#27856)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-10 11:24:07 -04:00
James Henry 0b81de2639 fix(release): ensure git commits containing pipe can be parsed reliably (#27840) 2024-09-10 18:37:30 +04:00
James Henry 44da27d93d fix(core): take nx-release-publish target defaults into account for implicit target (#27764) 2024-09-10 18:35:13 +04:00
James Henry 431fe2a021 feat(release): allow local dependency version protocols to be preserved, pnpm publish support (#27787) 2024-09-10 17:56:56 +04:00
James Henry 0c449b449b fix(release): respect updateDependents being explicitly disabled in conventional commits (#27851) 2024-09-10 16:42:43 +04:00
Juri Strumpflohner e4a9650bc0 fix(core): make sure sharedGlobals is referenced in default namedInputs (#27813) 2024-09-10 12:39:08 +04:00
Jason Jean 72432d63cc chore(repo): enable db cache (#27843)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

The new db cache is not being used.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The new sqlite db cache is being used.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-10 01:58:41 -04:00
Louie Weng 62d4ad6e16 docs(nx-cloud): patch details about nxCloudId and access levels (#27844)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Default access level of workspace ID setting is read-only

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Default access level of workspace ID setting is read-write

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-09 21:20:52 -07:00
Zachary DeRose 9b3a96029c docs(misc): adding nx live episode w Mike and some fixes (#27837)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-09 17:00:35 -04:00
Isaac Mann 332a20fd08 docs(core): updates for login/logout (#27838)
Replaces references to `nxCloudAccessToken` with `nxCloudId`
Adds login/logout to the commands landing page
2024-09-09 16:14:57 -04:00
Jason Jean e800fbf816 chore(repo): update nx to 19.7.0-beta.6 (#27835)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx 19.7.0-beta.1

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx 19.7.0-beta.6

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-09 15:39:46 -04:00
Zachary DeRose 4707cbd122 docs(misc): nx 19.7 Changelog (#27807)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-09 14:34:47 -04:00
Jack Hsu 71aeb7a218 Revert "docs(core): import recipe" (#27836)
Reverts nrwl/nx#27734
2024-09-09 13:46:58 -04:00
Isaac Mann e0079ac781 docs(core): import recipe (#27734)
Creates an import recipe under Adopting Nx
2024-09-09 13:12:38 -04:00
Colum Ferry 2bc7d4e6e9 feat(react): add module federation static server (#27802)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
We can serve each application in a module federation setup statically,
but only individually.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add a serve static executor for module federation hosts which will also
spin up the remotes statically

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-09 12:50:52 -04:00
Jason Jean 24025c86fb fix(core): move daemon server-process.json watching to outputs watcher (#27832)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `server-process.json` for the daemon gets included in a root
project's **/* fileset when it changes after the daemon has started.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `server-process.json` watching is handled in the `outputs` file
watcher which will not add it to the workspace files and won't show up
in the **/* fileset.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-09 12:42:27 -04:00
MaxKless b8486fb53f feat(graph): update tags to render on a single line by default with expand option (#27829) 2024-09-09 18:07:24 +03:00
Colum Ferry f3ac0852c1 fix(rspack): ensure process is default import (#420) 2024-09-09 16:03:42 +01:00
Colum Ferry d72a1d4e6e fix(react): ensure interop between webpack and rspack module federation (#27824)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When we had initially designed our Module Federation support for React,
we had to get some changes put in place in webpack itself directly to
allow for ESM.

However, the best support for Module Federation for both Rspack and
Webpack comes from CJS.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure CJS is used to ensure interopability between webpack and rspack
module federation applications

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-09 15:52:16 +01:00
Jason Jean d47d41cd53 fix(core): fix wasm build (#27830)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

wasm build is broken, blocking releases.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

wasm build is not broken.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-09 10:25:22 -04:00
Isaac Mann e768de6296 docs(core): add ahmed elsakaan to champions (#27827)
Add Ahmed Elsakaan to the champions page
@ixahmedxi
2024-09-09 08:38:13 -04:00
Leosvel Pérez Espinosa 27b8649f5c fix(graph): fix "args" help tooltip in pdv and only show "args" usage in fallback example (#27808)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 help tooltip for an example using `args` is misleading. It states
that `args` are CLI positional arguments, but they can also be CLI
flags.
Additionally, the fallback example shows an example using `options`,
which has a few caveats.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The help tooltip for an example using `args` should state that `args`
are CLI flags or positional arguments.
The fallback example should show only an example using `args` to reduce
the likelihood of users bumping into any of the caveats of using
`options`, which could be frustrating.

Note: a separate change to the docs will be made to explicitly call out
these caveats. Users would still be able to use `options`, but it
shouldn't be the recommended way of providing args unless they are well
aware of the caveats.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-09 13:16:12 +02:00
Isaac Mann e5e242a46f docs(core): remove William Ghelfi from champions (#27826)
Removes William Ghelfi from the champions list
2024-09-09 07:07:39 -04:00
James Henry a9beb62b0d docs(nx-dev): explicit callout for plan:check in CI (#27784) 2024-09-09 12:14:37 +02:00
Leosvel Pérez Espinosa 4766031d07 feat(js): add metadata to the typescript inferred tasks (#27806) 2024-09-09 13:18:33 +04:00
Juri Strumpflohner 1a4e663c5f feat(core): update PNPM GH action setup to use v4 and pnpm version 9 (#27664)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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
-->

Newly generated `ci-workflow` setups should use the latest GH package +
v9 PNPM version

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-09 10:30:49 +02:00
Juri 0b99d1deff docs(misc): add videos plus details to performance profiling 2024-09-08 08:33:05 -04:00
Jason Jean 035b40620b fix(linter): fix plugin race condition (#27810)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 race condition in the `@nx/eslint/plugin` causing projects to
be missing lint.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `@nx/eslint/plugin` creates a map of lintable files up front before
analyzing any particular project and there is no race condition.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-06 18:07:56 -04:00
Craigory Coppola ac9da418bd fix(core): optimize daemon output glob matching (#27775)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
- Nonexistant outputs are considered globs
- Glob outputs are walked from workspace root, which is slow on large
repos

[NX Daemon Server] - 2024-09-06T19:44:39.674Z - Done responding to the
client outputsHashesMatch
[NX Daemon Server] - 2024-09-06T19:44:39.674Z - Handled
OUTPUTS_HASHES_MATCH. Handling time: 94. Response time: 0.
[NX Daemon Server] - 2024-09-06T19:44:39.775Z - [REQUEST]: Responding to
the client. recordOutputsHash
[NX Daemon Server] - 2024-09-06T19:44:39.775Z - Done responding to the
client recordOutputsHash
[NX Daemon Server] - 2024-09-06T19:44:39.775Z - Handled
RECORD_OUTPUTS_HASH. Handling time: 100. Response time: 0.
[NX Daemon Server] - 2024-09-06T19:44:39.818Z - [REQUEST]: Responding to
the client. PROCESS_IN_BACKGROUND
[NX Daemon Server] - 2024-09-06T19:44:39.818Z - Done responding to the
client PROCESS_IN_BACKGROUND
[NX Daemon Server] - 2024-09-06T19:44:39.818Z - Handled
PROCESS_IN_BACKGROUND. Handling time: 14. Response time: 0.

## Expected Behavior
- Nonexistant outputs are only globs if they should be
- Globs are a bit faster

[NX Daemon Server] - 2024-09-06T19:43:36.899Z - Handled
OUTPUTS_HASHES_MATCH. Handling time: 0. Response time: 0.
[NX Daemon Server] - 2024-09-06T19:43:36.900Z - [REQUEST]: Responding to
the client. recordOutputsHash
[NX Daemon Server] - 2024-09-06T19:43:36.900Z - Done responding to the
client recordOutputsHash
[NX Daemon Server] - 2024-09-06T19:43:36.900Z - Handled
RECORD_OUTPUTS_HASH. Handling time: 0. Response time: 0.
[NX Daemon Server] - 2024-09-06T19:43:36.944Z - [REQUEST]: Responding to
the client. PROCESS_IN_BACKGROUND
[NX Daemon Server] - 2024-09-06T19:43:36.944Z - Done responding to the
client PROCESS_IN_BACKGROUND
[NX Daemon Server] - 2024-09-06T19:43:36.944Z - Handled
PROCESS_IN_BACKGROUND. Handling time: 13. Response time: 0.
[NX Daemon Server] - 2024-09-06T19:43:36.949Z - Uploading file artifacts
[NX Daemon Server] - 2024-09-06T19:43:36.949Z - Done uploading file
artifacts

> Note timings are from Nx repo, close enough to be comparable. No real
improvement was expected here, mainly checking that things didn't get
worse.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2024-09-06 17:07:30 -04:00
Colum Ferry 819c3f5b90 feat(rspack): add module-federation-static-server (#418) 2024-09-06 13:30:02 -04:00
Jack Hsu e71e2f3da8 Revert "feat(core): add shutdown lifecycle hook to node executor" (#27794)
Reverts nrwl/nx#27354

This patch is causing issues that are more serious than what it fixes.
2024-09-06 10:55:47 -04:00
Colum Ferry 7351a1a25e feat(react): add rspack module federation support (#27696)
- feat(react): add remote rspack module federation support
- feat(react): add host rspack module federation support
- feat(react): add federate module rspack module federation support
- fix(react): migration test

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
We do not have an option to generate a react host and remote with rspack


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add rspack as an option when generating host and remote

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-06 09:54:27 -04:00
Juri 7b5c831630 docs(misc): add videos to feature pages 2024-09-06 09:49:42 -04:00
Philip Fulcher d152639c2e docs(nx-dev): add personal access token blog post (#27719) 2024-09-05 22:19:22 -06:00
Johanna Pearce a3c2db8b85 docs(nx-cloud): add new documentation for PATs and emphasise Access Tokens are for CI (#27227)
- adds a new Personal Access Tokens page
- updates the existing Access Tokens page to emphasise they're more for
CI
- adds `nx-cloud login` reference
- adds `nx-cloud configure` reference

---------

Co-authored-by: lourw <56288712+lourw@users.noreply.github.com>
2024-09-05 14:38:55 -07:00
Austin Fahsl 3d8c3ed4b5 docs(release): add recipe for preVersionCommand (#27782)
Adds a recipe for using `release.preVersionCommand` to ensure packages
are built before they are versioned.
2024-09-05 13:31:36 -06:00
Benjamin Cabanes d0293b28c0 fix(nx-dev): update Bill's website link (#27790)
It updates the link to Bill's website and adds the Amplify icon to the nx-dev site for better clarity and branding.
2024-09-05 14:24:47 -04:00
Louie Weng f6f928f3b0 feat(nx-cloud): remove env variable for login (#27791)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

You need to use NX_ENABLE_LOGIN=true to connect to Nx Cloud with
nxCloudId. Documentation also is hidden for `nx login` and `nx logout`
aliases.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`nx connect` automatically connects via nxCloudId. Documentation shows
up for `nx login` and `nx logout` commands.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-05 13:23:54 -04:00
Colum Ferry 44c553253b fix(rspack): add hook for dev server to log when compilation completed (#417) 2024-09-05 15:38:35 +01:00
Jason Jean 4068ecb6a7 chore(core): create get cache function (#27779)
## Current Behavior
<!-- This is the behavior we have today -->

The orchestrator creates the cache.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The cache file has a function which the orchestrator can use to get the
cache.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-05 09:59:00 -04:00
James Henry ddec7ad4b0 chore(repo): add valid-command-object lint rule (#27777) 2024-09-05 13:14:04 +04:00
Leosvel Pérez Espinosa ccda7f9f00 feat(core): allow skipping sync when running tasks (#27697)
- Add a new flag `--skipSync` to the run commands to skip running
syncing when running tasks.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## 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 NXC-946 -->

Fixes #
2024-09-04 17:12:53 -04:00
Chau Tran 6a4a510e8f fix(nx-dev): make sure graph height works and render mode is nx-docs (#27776)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Graphs in nx.dev not working

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Graphs in nx.dev works

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-04 16:52:37 -04:00
Jack Hsu eb7ac2c57a fix(vite): tsconfig paths plugin should resolve file extensions (#27774)
This PR updates the tsconfig paths plugin for Vite such that it resolves
paths with file extensions as well.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #22868
2024-09-04 14:31:25 -04:00
Benjamin Cabanes dbf7c2030c feat(nx-dev): add create-nx-workspace from nx-cloud on ci section (#27756)
It updates the "Connect to Nx Cloud" button link to point to dedicated
screen on the Nx Cloud application.
2024-09-04 12:13:51 -04:00
Colum Ferry f17e5efc08 fix(module-federation): ssr uses async-node with runtime plugin (#27492)
- fix(module-federation): SSR should work correctly
- fix(module-federation): ssr-dev-servers should wait for remotes before
starting final executor

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## 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-09-04 11:33:24 -04:00
James Henry 00b5d3927d fix(release): show version plan deletion log in dry-run (#27744) 2024-09-04 10:06:19 -04:00
James Henry 1108ebf0c6 fix(release): support forwarding the --access flag to npm publish (#27765) 2024-09-04 17:58:34 +04:00
Juri Strumpflohner 10b905100e docs(nx-cloud): improve nx agents feature page (#27606) 2024-09-04 15:44:00 +02:00
Benjamin Cabanes e516fd12d7 feat(nx-dev): make animations more performant (#27757)
It updates the animations to make them more performant, using variaous techniques to reduce the number of renders.
2024-09-04 06:28:48 -07:00
Miroslav Jonaš 963a1c5621 chore(repo): fix missing tsconfig paths (#27759)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-04 09:06:19 -04:00
Colum Ferry ef7b66800a feat(remix): infer targets for remix vite in @nx/remix/plugin (#27713)
- feat(remix): add createnodesv2
- feat(remix): support vite in the plugin
- feat(remix): support remix vite in plugin
- fix(remix): init should ues addPlugin v2

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 does not currently infer targets when someone is using remix w/ vite


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Nx should infer targets for remix vite apps

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-04 08:44:19 -04:00
Benjamin Cabanes 27a01861c3 feat(nx-dev): add Mike Hartington in the team section (#27755)
It add Mike Hartington to the Nx company team.
2024-09-04 08:41:58 -04:00
Colum Ferry 88f01a9d8d feat(rspack): add module federation support (#416)
* feat(rspack): add withModuleFederation util

* feat(rspack): add module federation required executors

* feat(rspack): add module federation support

* fix(rspack): dev server setup

* fix(rspack): cleanup package entry for module federation

* feat(rspack): migrate to rspack 1.0

* fix(rspack): ensure license plugin is not attempting to read root
2024-09-04 11:37:57 +00:00
Colum Ferry 2854ccaa43 feat(rspack): add module federation support (#416)
* feat(rspack): add withModuleFederation util

* feat(rspack): add module federation required executors

* feat(rspack): add module federation support

* fix(rspack): dev server setup

* fix(rspack): cleanup package entry for module federation

* feat(rspack): migrate to rspack 1.0

* fix(rspack): ensure license plugin is not attempting to read root
2024-09-04 11:37:57 +00:00
Benjamin Cabanes f39b995b88 fix(nx-dev): change connect to nx cloud link in home page 2024-09-04 00:23:46 +02:00
Miroslav Jonaš c4c8b0150d feat(linter): add option to exclude projects from circular deps check (#27504)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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: FrozenPandaz <jasonjean1993@gmail.com>
2024-09-03 14:33:41 -04:00
Julián Gómez Sibecas c30415e892 docs(core): improve typing (#27731)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2024-09-03 18:31:13 +02:00
Louie Weng 3b0fd38066 chore(nx-cloud): add feature flag to nx login (#27698)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 login and logout aliases point toward nx-cloud login and logout
- when you connect a new workspace, by default nxCloudId will be added
to your nx.json

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

- removed documentation and references to nx login and logout aliases
- when you connect a new workspace, by default nxCloudAccessToken will
be added to your nx.json


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-03 11:01:21 -04:00
MaxKless 72e3e89999 docs(misc): change 'editors support' to 'editor integration (#27740) 2024-09-03 17:46:29 +03:00
James Henry 71715363bf fix(release): version plan changelogs should contain authors and refs (#27737) 2024-09-03 17:11:24 +04:00
Rares Matei d46edc4ff2 docs(nx-cloud): update launch template props (#27735)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09-03 08:49:13 -04:00
Victor Berchet 07333a5c4d fix(misc): fix the URL of the @naxodev/nx-cloudflare plugin (#27723)
The former URL returns a 404
2024-09-03 06:10:42 -04:00
Nicolas Beaussart 9039e5e0a6 fix(core): bump plugin pool attempts to work with slow runtimes (#27726)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

With plugin isolation turned on, it works on CI but doesn't on slow
laptops due to corporate software.


We currently run nx with the following patch to figure out why it happen
:

```patch
diff --git a/src/project-graph/plugins/isolation/plugin-pool.js b/src/project-graph/plugins/isolation/plugin-pool.js
index b10ee0d28c994db4e39c4f650dd47496c22cdb60..5a4dfb015906de8a0f9028e09140c6a3f543ca28 100644
--- a/src/project-graph/plugins/isolation/plugin-pool.js
+++ b/src/project-graph/plugins/isolation/plugin-pool.js
@@ -266,6 +266,7 @@ async function startPluginWorker() {
         const id = setInterval(async () => {
             const socket = await isServerAvailable(ipcPath);
             if (socket) {
+                console.log('Managed to start the worker after', attempts, 'attempts.')
                 socket.unref();
                 clearInterval(id);
                 resolve({
@@ -273,10 +274,10 @@ async function startPluginWorker() {
                     socket,
                 });
             }
-            else if (attempts > 1000) {
+            else if (attempts > 10000) {
                 // daemon fails to start, the process probably exited
                 // we print the logs and exit the client
-                reject('Failed to start plugin worker.');
+                reject('Failed to start plugin worker after ' + attempts + ' attempts.');
             }
             else {
                 attempts++;

```

With the added logging, we can see the following:

On ci (nx agents, or circleci)
```
Managed to start the worker after 17 attempts.
Managed to start the worker after 20 attempts.
Managed to start the worker after 23 attempts.
Managed to start the worker after 26 attempts.
Managed to start the worker after 27 attempts.
Managed to start the worker after 27 attempts.
Managed to start the worker after 28 attempts.
Managed to start the worker after 39 attempts.
Managed to start the worker after 47 attempts.
Managed to start the worker after 34 attempts.
Managed to start the worker after 36 attempts.
Managed to start the worker after 40 attempts.
Managed to start the worker after 47 attempts.
Managed to start the worker after 52 attempts.
Managed to start the worker after 54 attempts.
Managed to start the worker after 54 attempts.
Managed to start the worker after 55 attempts.
Managed to start the worker after 41 attempts.
Managed to start the worker after 53 attempts.
Managed to start the worker after 59 attempts.
Managed to start the worker after 46 attempts.
Managed to start the worker after 60 attempts.
Managed to start the worker after 52 attempts.
Managed to start the worker after 67 attempts.
```


On local (Mac, silicon m1)
```
Managed to start the worker after 59 attempts.
Managed to start the worker after 112 attempts.
Managed to start the worker after 166 attempts.
Managed to start the worker after 221 attempts.
Managed to start the worker after 274 attempts.
Managed to start the worker after 160 attempts.
Managed to start the worker after 269 attempts.
Managed to start the worker after 436 attempts.
Managed to start the worker after 390 attempts.
Managed to start the worker after 480 attempts.
Managed to start the worker after 427 attempts.
Managed to start the worker after 655 attempts.
Managed to start the worker after 754 attempts.
Managed to start the worker after 745 attempts.
Managed to start the worker after 200 attempts.
Managed to start the worker after 158 attempts.
Managed to start the worker after 854 attempts.
Managed to start the worker after 852 attempts.
Managed to start the worker after 1011 attempts.
Managed to start the worker after 373 attempts.
Managed to start the worker after 1180 attempts.
Managed to start the worker after 628 attempts.
Managed to start the worker after 789 attempts.
Managed to start the worker after 747 attempts.
```

We even got to numbers as high as 2000 on some laptops.

For the reference, we have the following plugins on our `nx.json`

```json
{
  "plugins": [
    {
      "name": "tsc",
      "plugin": "./tools/nx-tools/src/plugins/tsc.ts",
      "options": {
        "targetName": "type-check"
      }
    },
    {
      "name": "eslint",
      "plugin": "./tools/nx-tools/src/plugins/eslint.ts",
      "options": {
        "targetName": "lint"
      }
    },
    {
      "plugin": "@nx/vite/plugin",
      "options": {
        "buildTargetName": "build",
        "previewTargetName": "preview",
        "testTargetName": "test",
        "serveTargetName": "dev",
        "serveStaticTargetName": "serve-static"
      }
    },
    {
      "plugin": "./tools/nx-tools/src/plugins/jest.ts",
      "options": {
        "targetName": "test"
      }
    },
    {
      "plugin": "./tools/nx-tools/src/plugins/tsup.ts",
      "options": {
        "targetName": "build"
      }
    },
    {
      "plugin": "./tools/nx-tools/src/plugins/storybook.ts",
      "options": {
        "buildStorybookTargetName": "build-storybook",
        "serveStorybookTargetName": "storybook",
        "testStorybookTargetName": "test-storybook",
        "staticStorybookTargetName": "static-storybook"
      }
    }
  ]
}
```

One thing we managed to find out is the more plugin on the project, the
bigger the number.

So for now, the current workaround is to bump to 10000 instead of 1000
tries

_Debugged in pair with @AgentEnder_

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Plugin worker should work and nx should be working with plugin isolation
2024-09-01 15:06:00 -04:00
Mike Hartington 18e5535940 docs(misc): add initial speaker post (#27715)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-30 13:43:31 -04:00
MaxKless 4abcf61748 fix(core): add parallelism to target defaults schema (#27710)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Parallelism is part of the project schema but not `targetDefaults`. This
means it's highlighted as a warning in `nx.json`

## Expected Behavior
There should be no warning.
2024-08-30 10:28:23 -04:00
Austin Fahsl 4c39ad76bd fix(release): release plan command should take filters and touched projects into account (#27706) 2024-08-30 17:38:02 +04:00
Isaac Mann 83a387a105 docs(core): create commands landing page (#27660)
Creates a [custom landing page for Nx
commands](https://nx-dev-git-docs-commands-landing-page-nrwl.vercel.app/reference/nx-commands)
2024-08-29 22:43:21 -04:00
Emily Xiong 79b75ad140 fix(detox): fix name with camel case (#27602)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 create an app with `--appName <app name in camel case>`, it
currently has an error. it is caused by line:
```
  const { root: appRoot } = readProjectConfiguration(
    host,
    names(options.appProject).fileName
  );
```
it should not convert appProject to fileName, it should just take the
appProject as it is:
```
const { root: appRoot } = readProjectConfiguration(host, options.appProject);
```

## 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/24080
2024-08-29 16:54:39 -04:00
Jack Hsu ab408ab30c fix(core): filter branch in preparation for nx import (#27652)
This PR fixes an issue with `nx import` where multiple directories
cannot be imported from the same repo. We now use `git filter-repo` (if
installed) or `git filter-branch` (fallback) to prepare the repo for
import so anything not in the subdirectory will be ignored (i.e. cleaner
history).

Note: `filter-repo` is much faster but requires the user to install it
first via their package manager (e.g. `brew install git-filter-repo` or
`apt install git-filter-repo`). We fallback to `git filter-branch` since
it comes with git, but it is slower, so the process may take 10+ minutes
on really large monorepos (e.g. next.js).

Also:
- Use `await` before returning a promise to Node can maintain correct
stacktrace
- Remove logic for `if (relativeSourceDir === '')` since using
`filter-branch` moves all the files to the root (`.`)
- Default destination project location to be the same as source (e.g.
importing `packages/a` will go to `packages/a` unless user types in
something else)
- Add `--depth` option if users don't want to clone with full history
(default is full history)
- Fix issues with special characters causing `git ls-files` + `git mv`
to since `mv` doesn't work with escaped names

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-29 16:38:41 -04:00
Emily Xiong 925672e20b fix(expo): add cacheVersion to metro.config (#27646)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
expo tends to cache the output if there is no change in metro.config.js
we don't need to explicitly set the args --clear when
https://github.com/expo/expo/issues/30930 is fixed

## 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/27392
2024-08-29 15:36:06 -04:00
Emily Xiong f64aa9a915 fix(react-native): change hermesCommand to build android (#27641)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/27367
2024-08-29 15:34:52 -04:00
Leosvel Pérez Espinosa 3562131820 fix(core): handle file change conflicts between sync generators (#27695)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 running sync generators in the background (daemon) to cache the
results for when needed, they are isolated from each other (each run
with its own `Tree`). This is done because there's no guarantee which
sync generator will be run together since that would depend on each
specific task graph being run. When a task is run, a task graph is
constructed, and sync generators are collected from it and run/retrieved
from the cache.

Currently, when we run a task and ask the daemon to run the relevant
generators, if there are cached results for a generator that ran in
isolation, we return it. We don't check if its file changes conflict
with those of another generator included in the task graph. This results
in the changes for those conflicting files of the first generator
getting overwritten by the changes of the second generator.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When running tasks for which there are conflicting file changes between
generators in the daemon, the conflicting generators should be re-run
sequentially using the same `Tree` to guarantee that file changes are
not overwritten and lost.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
<!-- Fixes NXC-903 -->

Fixes #
2024-08-29 13:35:51 -04:00
Isaac Mann a7b2787069 fix(nx-dev): show first tab if none selected (#27701)
Tabs are not displaying correctly on the second page that is viewed.

Should be able to select the `project.json` tab on `Run Tasks` and then
switch to `Cache Task Results` and have the `Nx >= 17` tab shown.
2024-08-29 13:16:17 -04:00
Benjamin Cabanes f95059917d feat(nx-cloud): add 'generate-token' option to connect (#27678)
This update introduces a new 'genreate-token' option to force local
token creation. It ensures tokens are not created for GitHub-based
setups unless explicitly overridden. Adjustments include updated logic
in the generator function and schema to accommodate the new option.
2024-08-29 09:29:58 -04:00
Philip Fulcher a0cc0a9735 docs(nx-dev): add Explain with AI doc links to blog 2024-08-29 14:38:24 +02:00
Emily Xiong 81acdedb18 fix(expo): fix unable to build expo local for yarn 4 (#26992)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/22631
2024-08-29 01:32:01 -04:00
Louie Weng 0ef6892a6e feat(nx-cloud): remove feature flag for nx login (#27657)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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
-->

Enables `nx connect` to use the V2 endpoint from Nx API such that it
creates an `nxCloudId`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-28 15:14:01 -04:00
Jack Hsu e28de09c40 fix(core): fixes an issue where using "node:test" results in infinite loop (#27685)
This PR fixes an issue with `node:test` not being recognized as a
built-in Node module, and since it is not in `node_modules` with a
resolvable `package.json`, it hits an infinite loop.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-28 15:08:04 -04:00
Jack Hsu d1c901df1e fix(js): respect "watch" option when "runBuildTargetDependencies" is true (#27677)
This PR fixes and issue when `watch: false` and
`runBuildTargetDependencies: true` results in the server process
restarting, but no build happens.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #20963
2024-08-28 14:09:45 -04:00
Jack Hsu adcefcc6da chore(bundling): rename env vars so we do not cause Nx Cloud connection errors (#27681)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-28 12:17:28 -04:00
Jack Hsu be37c35351 chore(storybook): rename env vars so we do not cause Nx Cloud connection errors (#27680)
The test to ensure we don't bundle secrets/tokens is causing an error
like this:

```
 NX   Connection to Nx Cloud failed with status code ERR_BAD_REQUEST
```

e.g. https://staging.nx.app/runs/0IjxPh53dK

Likely due to validation errors now in place. We shouldn't be hitting Nx
Cloud from the test project, so I've renamed the variables to be
something that isn't used to connect to Cloud.


<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-28 11:24:06 -04:00
Leosvel Pérez Espinosa 97fa7f16f9 feat(core): allow disabling registered task sync generators (#27638)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

There's no way to disable sync generators registered in inferred tasks
by a Crystal plugin.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There should be a way to disable sync generators registered in inferred
tasks by a Crystal plugin.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
<!-- Fixes NXC-904 -->

Fixes #
2024-08-28 10:31:30 -04:00
Jonathan Cammisuli a0dc0f1710 fix(core): change remoteCache to getRemoteCache (#27673)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Calling remoteCache directly for the Nx cloud package causes issues with
how nx cloud deals with imports

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`remoteCache` is now a function call so that the nx cloud package
functions properly

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-28 10:25:00 -04:00
Juri 56311ae959 chore(nx-cloud): blog post about the newest Nx Cloud table log view 2024-08-28 15:27:09 +02:00
James Henry 13170da88b fix(release): programmatic API types should not be any (#27647) 2024-08-27 18:49:34 +00:00
MaxKless 3fbaf7f873 fix(core): make sure env vars specified in run-commands envFile option take priority over other loaded env files (#27583)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
When you specify the `envFile` property on a `nx:run-commands` executor,
values in that file don't override values from other loaded env files
(like `.env` and others that are loaded by the task runner).


## Expected Behavior
`envFile` contents should take precedence. The properties specified in
the `env` option should still override this.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-27 13:05:47 -04:00
Emily Xiong 6cb0720009 fix(gradle): fix find root for projects (#27651)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-27 12:44:09 -04:00
Colum Ferry 564834462e fix(vite): plugin should infer ts project correctly for libs (#27649)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 vite plugin's typecheck target is not using the tsconfig.lib.json
project when running typecheck for libs

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
It should use the correct tsconfig


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27501
2024-08-27 11:08:45 -04:00
James Henry 4fd639b170 feat(core): refactor graph implementation details (#27267)
Co-authored-by: nartc <nartc7789@gmail.com>
2024-08-27 10:01:11 -04:00
Colum Ferry 320d9f223f fix(testing): application generators should accurately configure e2e projects (#27453)
- feat(devkit): add util for determining the e2e web server info
- feat(vite): add util for determining the e2e web server info
- feat(webpack): add util for determining the e2e web server info
- fix(webpack): allow port override
- fix(devkit): e2e web server info util should handle target defaults
- feat(webpack): export the e2e web server info utils
- fix(vite): rename util
- fix(devkit): util should determine the devTarget for cypress
- fix(react): improve accuracy of e2e project generation

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 logic for finding the correct targets and web addresses to use when
setting up e2e projects is flawed and missing some key considerations.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The logic is accurate and usage is simplified across plugins 

Projects:
- [x] Angular
- [x] Expo
- [x] Next
- [x] Nuxt
- [x] Vue
- [x] Web
- [x] Remix
- [x] React
- [x] React Native


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-27 10:00:43 -04:00
Juri 57f3701372 docs(nx-cloud): improve e2e test splitting feature page 2024-08-27 00:23:32 -07:00
Juri daf5837a21 feat(nx-dev): add deepdive callout component 2024-08-27 00:23:21 -07:00
Craigory Coppola 61ecd4b4f8 fix(core): negative workspace-root filesets should override positive filesets (#27524) 2024-08-26 18:28:16 -04:00
Jason Jean 036e5fcf3e fix(gradle): fix child project deps (#27643)
## Current Behavior
<!-- This is the behavior we have today -->

When the name of a gradle project is overwritten by a different plugin,
the plugin throws an error creating dependencies.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The plugin uses the `CreateDependenciesContext` to get the name of a
project at the project root and uses that to create the dependency.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-26 18:17:32 -04:00
Emily Xiong f02e2fc76e fix(core): fix --e2eTestRunner for create-nx-workspace with react native (#27543)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
--e2eTestRunner option is not working when create-nx-workspace with
preset react native

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
--e2eTestRunner option should be working when create-nx-workspace with
preset react native

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-26 18:15:26 -04:00
Jason Jean 45e088e066 fix(core): do not stream output when static output style is enabled (#27642)
## Current Behavior
<!-- This is the behavior we have today -->

Output is still streamed sometimes when `--outputStyle static` is used.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Output is not streamed when `--outputStyle static` is used.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-26 18:12:12 -04:00
Jason Jean 6fff9b5e81 feat(core): return task results from imperative task runner (#27640)
## Current Behavior
<!-- This is the behavior we have today -->

Imperatively running tasks does not return task results.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Imperatively running tasks returns task results along with the overall
status and the task graph

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-26 16:54:44 -04:00
Louie Weng c93f5d6f0d feat(nx-cloud): alias for login and logout (#27358)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

N/A

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When running `npx nx login`, a file server should open and take you to
Nx Cloud to create a new personal access token.

When running `npx nx logout`, the user should be prompted with Nx Cloud
URLs of instances that they can revoke personal access tokens to.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-26 14:26:29 -04:00
Jason Jean f0e419b04f chore(repo): update pnpm to v9.8 (#27637)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses pnpm `9.2.0`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses pnpm `9.8.0`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-26 13:31:07 -04:00
Colum Ferry 62c651272c fix(core): nx migrate should determine angular devkit migration from cli or schematics #20282 (#27634)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
We check the CLI property exists and if it's not `nx` we will use the ng
compat layer to run the migration.
If the CLI property does not exist, we check both if the migration is in
the `schematics` object on the `migrations.json` and if the contents of
the migration implementation contains an import from `@angular-devkit`.

The problem with the fallback is that if only types are imported from
`@angular-devkit` the import is stripped from the migration
implementation completely.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We had planned already to remove the fallback of reading the file
contents.
We had also planned to remove using the `cli` property to determine if
the migration needed the `ng compat layer`.

However, as the `cli` property is still useful for now for package's
that needed some manner to circumvent the flawed fallback logic, let's
continue to use it until v21.
Log a warning however if the `cli !== 'nx'` and it is placed in the
`generators` section of the `migrations.json` to provide ample time for
plugin developers to move them to the `schematics` property.

Fallback has been updated to whether or not the migration lives in
`schematics` and not flawed read file logic.


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #20282
2024-08-26 17:25:38 +01:00
Juri a139e91943 docs(nx-cloud): some improvements based on feedback 2024-08-26 08:00:24 -07:00
Juri f8fe80f87d docs(nx-cloud): improve dynamic agents feature page 2024-08-26 07:19:09 -07:00
Paweł Twardziak 2c0a50c0d8 feat(core): expose graph json type (#27496)
Closes #3283

## Current Behavior
See #3283

## Expected Behavior
See #3283

## Related Issue(s)
#3283

Fixes #
-  expose graph json type

---------

Co-authored-by: @NgDaddy Paweł Twardziak <contact@ngdaddy.com>
Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2024-08-23 18:20:59 -04:00
Emily Xiong ec53f315b9 fix(core): not parse hex to number (#27515)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/26889
2024-08-23 17:20:43 -04:00
Paweł Twardziak 15b8d49c4b docs(misc): recipes - update your global nx installation … (#27591)
… - update to yarn 2+

Closes #27588

## Current Behavior
See #27588

## Expected Behavior
See #27588

## Related Issue(s)
See #27588

Fixes #

Co-authored-by: @NgDaddy Paweł Twardziak <contact@ngdaddy.com>
2024-08-23 17:19:36 -04:00
Jason Jean 088a95b7e5 chore(repo): update to pnpm 9 (#27624)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses pnpm v8

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses pnpm v9

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: “JamesHenry” <james@henry.sc>
2024-08-23 16:02:00 -04:00
Isaac Mann 51ecd54ea1 docs(core): remove non-features from changelog (#27600)
Remove:
- Automatically update Nx
- Monorepo World Conference Speakers Announced

From changelog page, since those are not new features in 19.5
2024-08-23 15:54:09 -04:00
Zachary DeRose 560cbce65c docs(misc): trunk livestream (#27603) 2024-08-23 11:58:59 -07:00
Jason Jean 77cbfa0e87 fix(core): change order of CI providers to match their popularity (#27623)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 order of the CI providers prompt does not match their popularity

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The order of the CI providers prompt matches their popularity

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-23 14:45:20 -04:00
Jack Hsu f9bb3082b7 fix(webpack): add migration for proxy config (#27621)
Webpack-dev-server v5 changed the proxy config to only accept arrays.
This PR adds a migration for JSON proxy config files to automatically do
the conversion for users. If it's not a JSON format, then we log a
warning and point them to the v5 migration page.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-23 14:17:01 -04:00
Colum Ferry add4183d0a fix(react): tailwind with rspack should work on generation #27028 (#27619)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
React, Tailwind and Rspack is not working out of the box


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
It works out of the box.

In tandem with nrwl/nx-labs#415


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27028
2024-08-23 15:02:11 +01:00
Colum Ferry 692504f1c9 fix(core): ensure file watcher is looking for correct config on windows (#27594)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Nx build native isn't working correctly on windows, stating that
`window` is not a correct option for `cfg!`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use the `windows` option for `cfg!` as stated by the error message

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-23 14:37:35 +01:00
Colum Ferry e61790d286 fix(rspack): add postcss-loader for css files (#415) 2024-08-23 09:31:41 -04:00
Colum Ferry d9fed4b832 fix(angular): ensure target default for '@nx/angular:webpack-browser' is set #26483 (#27616)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When using incremental builds with `@nx/angular:webpack-browser` the
dependent libraries need to be built.
However, there is no target default to force a build to build
dependents.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add a targetDefault and update docs to reflect this requirement

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26483
2024-08-23 11:46:21 +01:00
Juri 004fc4bd07 docs(nx-cloud): fix missing e2e-ci mention on the CI tutorial command 2024-08-23 02:23:29 -07:00
Jason Jean 1824267788 fix(bundling): update snapshots for copy assets plugin (#27610)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Unit tests are failing due to failing snapshots

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Snapshots are updated appropritately.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-22 18:27:15 -04:00
Jack Hsu 042049c785 feat(js): generate package.json with overrides and resolutions (#27601)
This PR ensures that `overrides` and `resolutions` are in the generated
package.json file as well. If they are missing, then using
`--frozen-lockfile` will fail due to mismatched overrides in the
lockfile.

Also adds a `skipOverrides` flag to the affected executors and plugins
-- same as `skipPackageManger` that was added previously.

Affected executors/plugins:
- `@nx/vite:build`
- `@nx/webpack:webpack`
- `@nx/remix:build`
- `@nx/next:build`
- `NxAppWebpackPlugin`


<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #26884
2024-08-22 17:21:49 -04:00
Leosvel Pérez Espinosa 35899e3a25 docs(linter): call out up to date lock file requirement for @nx/dependency-checks rule (#27587)
Updated doc:
https://nx-dev-git-docs-dependency-checks-lock-file-callout-nrwl.vercel.app/nx-api/eslint-plugin/documents/dependency-checks

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #22442
2024-08-22 17:10:07 -04:00
Jack Hsu 3d940c8884 docs(misc): add more to 19.6 release notes (#27605)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-22 17:03:18 -04:00
Jason Jean 2ccf0d27c2 chore(repo): update nx to 19.7.0-beta.1 (#27576)
## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `19.6.0-beta.6`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `19.7.0-beta.1`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-22 16:51:43 -04:00
MaxKless eeb60b64af fix(core): enable using the daemon in docker if enabled explicitly (#27585)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 daemon is hard-disabled in docker, even if you try to explicilty
enable it using the `NX_DAEMON` env var.

## Expected Behavior
We should disable the daemon by default in docker but allow users to
opt-in using the env var. There might be issues that come with that but
since it's opt-in, it will be at their own risk.

## Related Issue(s)

Fixes https://github.com/nrwl/nx/issues/14126
2024-08-22 15:40:07 -04:00
Emily Xiong c0ebc16089 fix(react-native): remove upgrade command in migration (#27467)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/27357
2024-08-22 13:58:46 -04:00
Emily Xiong cc322eb01e fix(expo): add expoLibraryGenerator to export (#27520)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/26850
2024-08-22 13:58:36 -04:00
Jack Hsu ca9f3cce0b feat(bundling): add nxCopyAssetsPlugin for Vite to use in JS libs (#27593)
This PR adds a `nxCopyAssetsPlugin` for Vite to brings it to parity with
the other compilers/bundlers (tsc, swc, esbuild, rollup, and webpack).

When generate a lib with Vite (e.g.`nx g @nx/js:lib --bundler=vite` or
`nx g @nx/react:lib --bundler=vite`), we expect it to at least copy
`README.md` as an asset.

Note: Vite has support for copying assets from `public/` but that is
less flexible and more intended for apps, not libs.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #27351
2024-08-22 13:30:40 -04:00
Juri Strumpflohner adf9f2e444 chore(repo): update to nx-cloud@next to handle nxCloudId auth logic (#27581)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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
-->

Fixes login issue with nx Cloud due to switch to new nxCloudId auth
method

![image](https://github.com/user-attachments/assets/5d6c0765-f3ac-4bf1-b055-fab984e55e55)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-22 12:46:05 -04:00
Emily Xiong 00710b9187 fix(js): fix verdaccio windows for registry (#27350)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/27135
2024-08-22 12:28:35 -04:00
Jason Jean d6a0cfb119 fix(core): fix compat for old remote caches (#27574)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 old remote caches are broken with the new db cache.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The old remote caches are working properly with the new db cache.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-21 18:04:22 -04:00
Jack Hsu 16b2e028c0 fix(core): support import detection of packages installed from git remote URL (#27569) 2024-08-22 01:16:30 +04:00
Isaac Mann ecbd2cba04 fix(nx-plugin): allow create-package without e2eProject (#27572)
Current behavior:
`nx g create-package create-my-plugin --project my-plugin` fails because
`e2eProject` defaults to the root project.

Expected behavior:
`nx g create-package create-my-plugin --project my-plugin` succeeds.
2024-08-21 16:49:41 -04:00
Jack Hsu ca89950920 fix(node): generate webpack server apps with generatePackageJson:true by default (#27570)
We already do this for esbuild apps (e.g. express, fastify, koa), but we
don't do it for webpack (nest).

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #27389
2024-08-21 15:37:06 -04:00
Isaac Mann b6dd9251f5 docs(core): use nx release in create install package recipe (#27567)
Use `nx release` in the create install package recipe
2024-08-21 15:15:48 -04:00
Feliche-Demian Netliukh 73f12a322d fix(nextjs): schema type for unitTestRunner for library (#26824)
## Current Behavior
The [docs](https://nx.dev/nx-api/next/generators/library#unittestrunner)
say that you can use vitest as a unitTestRunner option. It also worked
when I tested with the following command:
```sh
nx g @nx/next:library shared --dir=modules/shared --style none --dry-run --projectNameAndRootFormat as-provided --component false --unitTestRunner vitest
```

But types say otherwise:
![CleanShot 2024-07-04 at 16 24
44@2x](https://github.com/nrwl/nx/assets/51330172/13a2d0ca-6950-413b-ac80-5d33cd64a714)

## Expected Behavior
Types will allow 'vitest' option for a unitTestRunner

## Related Issue(s)
none

Co-authored-by: Emily Xiong <xiongemi@gmail.com>
2024-08-21 14:36:17 -04:00
Leosvel Pérez Espinosa 0f3120712f fix(js): ensure assets option in tsc executor defaults to empty array for programmatic usage (#27565)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #19911 
Fixes #27421
2024-08-21 17:50:30 +00:00
Jason Jean cade5bc671 feat(core): add sqlite db for nx (#26891)
## Current Behavior
<!-- This is the behavior we have today -->

Nx has some persistent storage managed as separate files on disk. For
example, the local cache queries the file system for existing
directories.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Nx has a new more performant persistent storage via SQLite database. The
db is used for the following purposes now:
1. Storing task details of different hashes (This serves as reference
for other tables to get more information about a hash)
2. Storing a record of cached artifacts
3. Storing a history of tasks which have run

The cache in particular has the following benefits:
* It's faster, YMMV but it's definitely faster because it writes and
reads less from disk.
* It's able to track access of different cached artifacts
* It purges cached artifacts more intelligently by looking at when
artifacts were last ACCESSED rather than when they were CREATED. This
will also eliminate cache misses due to the cached artifacts being
purged simply because they were CREATED.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-21 13:12:20 -04:00
Jason Jean 9269de7763 fix(core): use withVerbose util (#27553)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `withVerbose` util is only used in a few places.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `withVerbose` util is used throughout and also contains middleware
to default to the value in `process.env.NX_VERBOSE_LOGGING === 'true'`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-21 13:07:33 -04:00
Colum Ferry c427717fc1 fix(esbuild): declaration:true should find the correct package root regardless of cwd #26261 (#27560)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 types that are generated for esbuild packages are not placed into
the correct folder structure in the built package and is very dependent
of the CWD.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The declaration files should be generated correctly to match the package
and not dependent on CWD

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26261 #26376
2024-08-21 17:08:13 +01:00
zack-derose d557fe207c docs(misc): adding episode 4 of the podcast 2024-08-21 08:50:04 -07:00
Leosvel Pérez Espinosa 2ffec0aa3f fix(testing): fix issues in static server target migrations (#27547)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #27470
2024-08-21 11:29:43 -04:00
Isaac Mann da823e04a9 docs(core): update create-install-package (#27562)
Updates the create-install-package recipe to match what is currently
generated

Fixes #22663
2024-08-21 10:43:21 -04:00
Guilherme Prezzi a08e2adda6 fix: missing export for setRemoteDefinition (#27491)
## Current Behavior
It's not possible to import `setRemoteDefinition` from `@nx/angular/mf`.

## Expected Behavior
Export `setRemoteDefinition` in `@nx/angular/mf`
2024-08-21 15:06:14 +01:00
Louie Weng 20650334e7 chore(repo): use nx cloud id for auth (#27546)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 Cloud uses the nxCloudAccessToken to authenticate and provide
permissions access the cache.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Users who want to use Nx Cloud locally with a read-write token will need
to run `nx-cloud login` to generate a personal access token and have
`nxCloudId` in their nx.json. These two pieces of identification are
needed together to provide permissions to access nx cloud features.

By default users who do not have a personal access token/do not have an
Nx Cloud account will have 'read' permissions.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-20 14:38:28 -07:00
Emily Xiong 7e158385fd fix(gradle): fix tasksFileLines might be undefined (#27548)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-20 16:31:02 -04:00
Jack Hsu 046abc4938 docs(react): add instructions for how to add SVGR for Vite + React (#27551)
This PR adds a section to the `Adding Images, Fonts, and Files` React
recipe to show how to use SVGR with Vite.

With our Vite setup, we're keeping the configuration minimal so we don't
want SVGR out of the box.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #19282
2024-08-20 15:41:47 -04:00
Nicholas Cunningham 554e979abf fix(nextjs): Should be able to run custom server targets with swc (#27526)
## Currently
When we installed swc from the Next.js generator it installed an older
version that expected version of swc this caused the node & build
generator to not work.

## Expected
With these changes the version will be in sync with what the
`@nx/js:swc` executor is expecting. With that in mind the build should
now work as expected and by extension the serve target for custom server
as well.

fixes: #27222
2024-08-20 11:53:24 -06:00
Emily Xiong 66ff751f0d feat(graph): add expandedTargets to project details on nx dev (#26911)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

https://nx.dev/getting-started/tutorials/gradle-tutorial#running-tasks

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->


https://nx-dev-git-feat-graph-add-expand-targets-nrwl.vercel.app/getting-started/tutorials/gradle-tutorial#running-tasks

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Max Kless <maxk@nrwl.io>
2024-08-20 13:46:43 -04:00
Nicholas Cunningham 31c5745126 fix(nextjs): should not fail when running outside of nx cli (#27523)
fixes: #22450

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, if you run any next target outside of nx the build will fail
because we only fallback for graph creation of if running prod server.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Targets should work if they are run outside of the Nx cli

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-20 11:43:28 -06:00
Isaac Mann d6c3b24eb8 feat(nx-dev): honor prefers-reduced-motion (#27541)
Disables animations when browser is set to `prefers-reduced-motion`

Fixes #27114
2024-08-20 11:25:29 -04:00
Isaac Mann 27fe4c6401 docs(core): add redirect for github setup recipe (#27542)
Fixes #27495
2024-08-20 11:24:38 -04:00
Isaac Mann 83a4db719e docs(core): fix changelog link (#27544)
Fixes a broken link
2024-08-20 10:56:38 -04:00
Jack Hsu fdb488b394 feat(bundling): add option to generate sourcemaps for Rollup build (#27539)
This PR adds `sourceMap` option to `@nx/rollup:rollup` executor and the
`withNx` util (for Project Crystal). The same option is used for
Webpack.

## 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 #9199
2024-08-20 14:28:45 +00:00
Juri 27982fbbe8 docs(misc): update pinned logic + set pinned blog posts 2024-08-20 06:47:35 -07:00
James Henry c22c0772dd fix(js): only sync references when composite is true, preserve comments in other parts of file (#27530) 2024-08-20 17:28:39 +04:00
Jack Hsu 83237a8670 feat(js): add skipPackageManager option to build executors in order to skip generating "packageManager" entry in package.json (#27518)
This PR adds `skipPackageManager` option to several build executors in
order to disable generating the `packageManager` field in the resulting
`package.json` file. This field may be problematic on different
platforms so we want a way to work around it.

Affected executors:
- `@nx/webpack:webpack`
- `@nx/vite:build`
- `@nx/next:build`
- `@nx/remix:build`




<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #27027
2024-08-20 09:18:30 -04:00
Colum Ferry 6d963fd21d fix(vite): add typecheck inferred target for vite plugin #27501 (#27531)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Vite intentionally does not run typechecking on projects. They recommend
running `tsc --noEmit` separately.
The `@nx/vite/plugin` could make this easier by adding a `typecheck`
when it detects a `tsconfig` file in the `projectRoot`.
This can then be added to the build pipeline on CI. Or users can add it
to a `dependsOn` for the `build` target if they wish.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `@nx/vite/plugin` could make this easier by adding a `typecheck`
when it detects a `tsconfig` file in the `projectRoot`.
This can then be added to the build pipeline on CI. Or users can add it
to a `dependsOn` for the `build` target if they wish.


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27501
2024-08-20 13:53:13 +01:00
Juri 59280014c6 docs(nx-cloud): improve AI feature pages 2024-08-20 05:50:41 -07:00
Leosvel Pérez Espinosa fd74969367 fix(react): handle more scenarios when collecting component props for generating stories (#27528)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Stories generation for React components only handles components
receiving a `props` argument typed with an `Interface`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Stories generation for React components should handle receiving the
props with any name or as a destructured object and typed with an
`Interface`, a type literal definition, or an inline type literal. In
case it's a destructured object, it also supports having no type, in
which case the story args will have those properties with type
`unknown`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #22053
2024-08-20 14:41:05 +02:00
Colum Ferry 6d6c3515fd docs(module-federation): improve creating a host recipe with some additional relevant information (#27534)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-20 13:39:11 +01:00
James Henry aafed19f9b fix(nx-dev): modify prompt (#27536) 2024-08-20 08:38:37 -04:00
Isaac Mann 8af66c1a00 docs(core): fix add astro typo (#27535)
Fixes #20140
2024-08-20 08:01:04 -04:00
Connor Sullivan 186e4c7606 chore(vite): allow experimental vitest 2 support (#27371)
Allows consumers to use vitest 2 with the @nx/vite plugin.

closed #27259

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Users cannot use Vitest 2 with @nx/vite.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Users can use Vitest 2 with @nx/vite.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27259
2024-08-20 13:08:41 +04:00
Isaac Mann 08536905a2 docs(core): update Nx tag line (#27481)
Update tag line everywhere
2024-08-19 21:14:34 -04:00
Emily Xiong 7c45589a71 fix(gradle): track childProjects in properties report (#27488)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/27160
2024-08-19 17:10:27 -04:00
Isaac Mann 839dc1585b feat(devkit): prefer strings over Linter enum (#27209)
We should be consistent about how options are defined in our plugins.
Currently, there are some options that use `enum`s and some that use
typed strings. I think typed strings are preferable because someone
extending a generator only needs to import the main generator that
they're extending, not all the transitive dependencies of that
generator.

Current extending code:
```
// ...
import { applicationGenerator as reactApplicationGenerator } from '@nx/react';
import { Linter } from '@nx/eslint';

export async function applicationGenerator(
  tree: Tree,
  options: ApplicationGeneratorSchema
) {
  reactApplicationGenerator(tree, {
    ...options,
    linter: Linter.EsLint,
  });
}
```

Desired extending code:
```
// ...
import { applicationGenerator as reactApplicationGenerator } from '@nx/react';

export async function applicationGenerator(
  tree: Tree,
  options: ApplicationGeneratorSchema
) {
  reactApplicationGenerator(tree, {
    ...options,
    linter: 'eslint',
  });
}
```

The problem is not just an extra line of code, the person extending the
`reactApplicationGenerator` has to dig into the implementation details
of the generator itself in order to know where to find the `Linter`
enum. The `e2eTestRunner` is already a typed string and is easily
extended.

The solution I'm proposing in this PR would define a typed string in the
same file as the existing enum. None of the implementations need to
change. No community plugin code will be broken.
2024-08-19 17:07:28 -04:00
Isaac Mann 14be63b337 docs(core): promote powershell env vars callout (#27521)
Makes the powershell env vars callout more prominent

Fixes #27287
2024-08-19 17:04:50 -04:00
Isaac Mann 3e871a9055 docs(core): changelog for 19.6.0 (#27519)
19.6.0 changelog
2024-08-19 17:04:42 -04:00
Jason Jean a5b93b8e83 fix(core): fix importing files with special characters (#27484)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Files which have special characters in the path cannot be imported.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Files which have special characters in the path can be imported.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27468
2024-08-19 16:48:43 -04:00
Jack Hsu d8d57c862b docs(node): update recipe on setting up proxies (#27517)
This PR expands the recipe for [Set Up App
Proxies](https://nx.dev/recipes/node/application-proxies). There is no
way for us to add proxy config automatically since `proxy.json` is
specific to our executor, and users should use the underlying tools'
proxy support instead.

Also adds an info for users using `--frontendProject` option in
crystalized workspaces.

Note: The proxy feature from Webpack and Vite allow more advanced use
cases, so it's preferred to the old `proxy.json` support anyway.

Preview:
https://nx-dev-git-docs-node-proxy-config-nrwl.vercel.app/recipes/node/application-proxies#set-up-application-proxies

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #27321, #23158
2024-08-19 15:40:27 -04:00
Jack Hsu aa59a69af2 docs(webpack): present correct config file formats for inferred tasks (#27516)
We're showing `.cts` and `.mts` files as supported, but Webpack CLI will
not load them.

The language support is outlined here:
https://webpack.js.org/configuration/configuration-languages/#typescript

This PR removes those extensions to match what our plugin actually
infers from.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #27438
2024-08-19 14:08:40 -04:00
Jack Hsu 402bae2ce1 fix(vite): load the correct config file from @nx/vite:test executor (#27514)
This PR ensures that we pass Vite config file to the programmatic
`startTest` API from Vitest. It fixes the issue with plugins not loading
as well as other issues with the config file not being used.

This mainly affects a custom `configFile` option being passed to the
executor. The previous fix to additionally load in `plugins` via
overrides is causing plugins to load twice when the Vite config file is
picked up by Vitest (e.g. #27500).

## 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 #27500, #22001
2024-08-19 14:08:29 -04:00
Isaac Mann 0de28ccfe1 docs(core): add bun tab to install commands (#27511)
Add a bun tab to everywhere we list package manager install commands
2024-08-19 13:13:05 -04:00
Colum Ferry 08fc13de5f fix(vite): plugin should infer serve target if server config defined #27370 (#27507)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Vite Plugin was originally only checking if the `lib` option was defined
in a vite config, and using that to avoid inferring serve targets.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Some libraries may still need a serve target, and if they have a server
config defined, the serve target should be inferred

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27370
2024-08-19 17:02:05 +01:00
Colum Ferry 813770862e fix(module-federation): ensure shared packages can be shared from host #27162 (#27513)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 application is never set as a candidate to share packages from.
Particularly in angular, this causes issues with the injection context


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Host application should be a valid option for sharing packages

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27162
2024-08-19 17:01:47 +01:00
Colum Ferry afe83b4b07 fix(storybook): should generate correct config for nextjs apps #27233 (#27510)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
With the introduction of App Router by NextJs, components may not live
in a `components` directory. Storybook config should reflect this.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Stories path should be a glob from project root

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27233
2024-08-19 16:52:34 +01:00
Juri a1a4b6e2db docs(nx-cloud): improve the flaky task feature page 2024-08-19 07:44:48 -07:00
Juri d848d3f5c3 docs(nx-cloud): improve nx affected feature page 2024-08-19 07:44:37 -07:00
Leosvel Pérez Espinosa 54f70c7587 fix(angular): bump ngrx version to 18.0.2 (#27506)
Bump the NgRx package versions to ensure the `@ngrx/signals` package is
migrated correctly. That package version was out of sync with the rest
of the NgRx packages. Starting on v18.0.2, the package version is in
sync with the rest.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-19 12:16:26 +02:00
Tine Kondo b91d78809e fix(nx-dev): fix use key instead of env to reference cache key in… (#26644)
… `launch-templates`

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-16 15:09:52 -04:00
mathis 8295275dc6 chore(core): update axios to ^1.7.4 (#27420)
Closes CVE-2024-39338



## Related Issue(s)

Fixes #27419
2024-08-16 15:06:20 -04:00
Kamenskih Dmitriy 4941be6197 fix(node): build-esbuild-options.ts browser user define envs by config (#27480)
## Current Behavior
When you use esbuild in 'browser' mode you have to provide all 'define'
attributes as environment variables and only with "NX_PUBLIC_" prefix

## Expected Behavior
Esbuild configuration has to work as it is described in docs. And prefix
feature has to work as an additional functionality

## Related Issue(s)
This issue will be fixed: https://github.com/nrwl/nx/issues/19106

Co-authored-by: Dmitrii Kamenskikh <dkamenskikh@devexperts.com>
2024-08-16 15:05:30 -04:00
Wei Liang b5a93364c5 feat(core): add shutdown lifecycle hook to node executor (#27354)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When the application are received a shutdown signal, the application
doesn't execute before shutdown functions and directly shutdown whole
application. The situation cannot execute before shutdown functions like
[NestJS Lifecycle
Events](https://docs.nestjs.com/fundamentals/lifecycle-events) and
custom shutdown hooks.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The application can run shutdown hooks like below output:

 NX   Successfully ran target build for project nest-test (5s)

Debugger listening on
ws://localhost:9229/e4bd44c0-9a6a-468a-8b46-b6fef1cef1c7
For help, see: https://nodejs.org/en/docs/inspector

```
 NX   Successfully ran target build for project nest-test (4s)

Debugger listening on ws://localhost:9229/75c8449b-43a4-4d8b-88c0-231761d7248c
For help, see: https://nodejs.org/en/docs/inspector

To exit the process with SIGINT, press Ctrl+C
[Nest] 393107  - 08/09/2024, 6:31:26 PM     LOG [NestFactory] Starting Nest application...
[Nest] 393107  - 08/09/2024, 6:31:26 PM     LOG [InstanceLoader] AppModule dependencies initialized +10ms
[Nest] 393107  - 08/09/2024, 6:31:26 PM     LOG [RoutesResolver] AppController {/api}: +7ms
[Nest] 393107  - 08/09/2024, 6:31:26 PM     LOG [RouterExplorer] Mapped {/api, GET} route +3ms
[Nest] 393107  - 08/09/2024, 6:31:26 PM     LOG [NestApplication] Nest application successfully started +2ms
[Nest] 393107  - 08/09/2024, 6:31:26 PM     LOG 🚀 Application is running on: http://localhost:3000/api
[Nest] 393107  - 08/09/2024, 6:31:29 PM     LOG onModuleDestroy
onModuleDestroy: 5.001s
[Nest] 393107  - 08/09/2024, 6:31:34 PM     LOG beforeApplicationShutdown SIGINT
beforeApplicationShutdown: 5.004s
[Nest] 393107  - 08/09/2024, 6:31:39 PM     LOG onApplicationShutdown SIGINT
onApplicationShutdown: 5.005s

 NX  Process exited with code 130, waiting for changes to restart...
```

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #9237 and #18037

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-08-16 14:23:18 -04:00
Benjamin Cabanes 958f188bd0 chore(nx-dev): change help section titles for clarity (#27465)
Renamed "Sales" to "Talk to Sales" and "Engineers" to "Learn more about Nx Cloud".
2024-08-16 12:27:07 -04:00
Benjamin Cabanes 289b23bfdf feat(nx-dev): add Monorepo World banner to hero (#27482)
Integrate a new Monorepo World banner with animations in the hero section using framer-motion. Updated the UI icons library to include Monorepo World icon and relevant SVG file.
2024-08-16 12:26:52 -04:00
Isaac Mann 15bc7ac69b docs(core): link blog to parallelism reference (#27483)
Link the parallelism blog post to the actual reference document.
Currently the blog post shows up in a search for `parallelism` but the
actual reference does not. This link can help while we work on the
search.
2024-08-16 12:26:11 -04:00
Jack Hsu 9dca7c7025 docs(core): add scroll_25, scroll_50, scroll_75, and scroll_90 events to track engagement (#27461)
This PR adds events to track engagement in our docs. Since we use a
scrollable `<div>` in our docs, the normal `scroll` events in GA do not
work.

A new `<ScrollableContent>` component is added that will do two things:
- Send `scroll_25`, `scroll_50`, `scroll_75`, and `scroll_90` events
whenever the user scrolls to 25%, 50%, 75%, of 90% of the content
- Optionally reset scroll top to zero whenever router changes (existing
behavior)

All of the places where we have content in a scrollable `<div>` is
replaced with `<ScrollableContent>`.

Note: 90% means user has reached the bottom, since it's not usually
possible to get to 100%.
2024-08-16 12:25:20 -04:00
Leosvel Pérez Espinosa b699207070 fix(linter): update the @nx/dependency-checks rule to read the package.json content from the rule context (#27476)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/dependency-checks` rule sometimes doesn't apply all identified
fixes and wrongly succeeds. ESLint performs multiple passes to try to
apply fixes, and in each pass the rule receives the updated source code
with the previously applied fixes. This allows merging different fixes,
but the `@nx/dependency-checks` rule always reads the `package.json`
file from the filesystem, caches it globally, and mutates it. It never
uses the updated source code provided in the rule context.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `@nx/dependency-checks` rule should apply all identified fixes [as
long as they don't
conflict](https://eslint.org/docs/latest/extend/custom-rules#conflicting-fixes).

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27412
2024-08-16 17:14:09 +02:00
Isaac Mann d378f2c449 docs(core): plugin atomizer set up (#27478)
Update plugin overview pages to describe atomizer set up
2024-08-16 10:53:56 -04:00
Isaac Mann c28148b70b docs(core): fix installation tutorial link (#27479)
Fix a link on the installation page
2024-08-16 10:40:06 -04:00
Leosvel Pérez Espinosa 89f6ad4d8d fix(js): handle arbitrary nested ts path mappings when re-mapping them to the outputs (#27429)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 re-mapping a TS path mapping like `"@foo/lib1/plugins/some-file":
["packages/lib1/src/plugins/some-file.ts"]`, it results in:

```json
"@foo/lib1/plugins/some-file": [
  "dist/packages/lib1/plugins/some-file",
  "dist/packages/lib1/src/plugins/some-file.ts"
]
```

The first path is wrong because it's missing the `src` directory, and
the second one has a file extension that's not in the output.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When re-mapping a TS path mapping like `"@foo/lib1/plugins/some-file":
["packages/lib1/src/plugins/some-file.ts"]`, it should result in:

```json
"@foo/lib1/plugins/some-file": [
  "dist/packages/lib1/plugins/some-file",
  "dist/packages/lib1/src/plugins/some-file",
  "dist/packages/lib1/src/plugins/some-file.ts"
]
```

In this case, the second path would correctly point to the output. It
doesn't have an extension, which allows the compiler to pick up the
correct one.

Note that while the first and third paths are still not valid for this
specific use case, they could still be valid for other use cases, and in
any case, they're still kept for backward compatibility. The util to
re-map these paths is currently very generic and generates potentially
valid paths. The invalid paths for a given use case won't throw an error
as long as there's one that's valid.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #21699
2024-08-16 16:00:51 +02:00
Colum Ferry 396a5deea9 fix(module-federation): ensure target defaults are set correctly #27448 (#27472)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Target Defaults set up for the Module Federation builds is incorrect or
missing.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Target Defaults for Module Federation builds is set up correctly

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27448
2024-08-16 15:00:45 +01:00
@NgDaddy 7f2c5565de fix(react): enable vitejs-plugin-react-swc for swc compiler (#27457)
## Current Behavior
see #27433 

## Expected Behavior
see #27433 

## Related Issue(s)
see #27433 

Fixes #
- if compiler is `swc`, `@vitejs/plugin-react-swc` is being imported;
otherwise `@vitejs/plugin-react` is being imported

Co-authored-by: Emily Xiong <xiongemi@gmail.com>
2024-08-16 10:00:11 -04:00
Colum Ferry 829f5fa758 fix(angular): module-federation-ssr-dev-server should call correct builder (#27477)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-ssr-dev-server` is calling `dev-server` builder
instead of `ssr-dev-server` builder

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`module-federation-ssr-dev-server` calls the correct builder

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-16 09:33:58 -04:00
Leosvel Pérez Espinosa 1ae3c2d8f9 fix(angular): generate @nx/angular in devDependencies and move to dependencies when using runtime helpers (#27405)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

New workspaces are generated with `@nx/angular` as a production
dependency even though the generated code does not use any runtime
helper from it.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

New workspaces should be generated with `@nx/angular` as a development
dependency. When generating a new MF host or dynamic MF application
(host or remote), the `@nx/angular` package should be moved to the
production dependencies because the generated code uses some runtime
helpers from it.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27333
2024-08-16 09:23:19 -04:00
satanluimm 44068b58c0 docs(misc): fix react monorepo tutorial link in installation page (#27388)
docs(react): fix link to react monorepo tutorial
2024-08-16 14:38:16 +02:00
Isaac Mann e7a9f36762 fix(nx-dev): bad link from home page (#27475)
Fixes #27417
2024-08-16 08:02:35 -04:00
Benjamin Cabanes 0b2f4527d9 chore(nx-dev): remove redundant period in plan table (#27464)
Corrects a minor formatting issue by removing an unnecessary period in
the explanation text for failed task outputs.
2024-08-16 07:52:15 -04:00
Leosvel Pérez Espinosa e368cd4ae1 fix(testing): fix misc issues in migrations (#27471) 2024-08-16 14:03:34 +04:00
robertIsaac 69c989ed9b cleanup(js): fix test cases on windows (#27300)
## Current Behavior
running `nx test js` fail on windows

## Expected Behavior
running `nx test js` succeed

## side notes
1. I was skipping `packages/js/src/plugins/typescript/plugin.spec.ts`
because it makes all tests fail, and even in wsl it's very flaky, it
fail 90% of the times, but I couldn't figure out why
I think it's worth looking at from someone with more experience with the
repo
2. for some of the cases that I fixed I'm not sure if I should change
the code to always return `/` or should change the test to adapt `/` in
linux and `\` in windows, so please if I mistaken one of them let me
know and I will do it the other way around but I believe it should be
fine since in windows `foo/bar` does work as a path still
2024-08-16 08:58:08 +02:00
Colum Ferry ce2dff303a fix(react): ensure @vitejs/plugin-react is installed for storybook (#27463) 2024-08-15 17:02:42 -04:00
Zachary DeRose f7eab14f6b Adding podcast episodes (#27462)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-15 16:12:25 -04:00
Jason Jean 01985c11db fix(repo): add dependsOn to native build (#27446)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

`nx:build-native` updates the typings which `graph-client:build-client`
uses. Not running it in the right order could result in a compilation
error.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`nx:build-native` updates the typings which `graph-client:build-client`
uses so it depends on `nx:build-native`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-15 14:48:10 -04:00
Nicholas Cunningham 6d7cdd7d41 Podcast page (#26971) 2024-08-15 14:32:48 -04:00
Craigory Coppola 4f1db3e07a chore(repo): docs generation should work on windows (#27444)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-15 13:18:34 -04:00
Nicholas Cunningham 2e48ebf433 fix(nx-dev): Og image path generation (#27456)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 og images for the blogs are not being generated.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The og images for all blogs should be generated.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
2024-08-15 10:26:11 -06:00
Juri 5c890de630 docs(nx-cloud): update remote caching feature page 2024-08-15 08:49:55 -07:00
EGonz1PCTY 8c7e3619a9 fix(misc): ensure custom reporters are usable with @nx/playwright:playwright (#27443)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Custom reporters are not usable because we enforce an enum on the schema

## Expected Behavior
Custom reporters can be specified

## 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-08-15 11:01:13 -04:00
James Henry f1ecad0a8e docs(release): file based versioning, version plans (#27428)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Version plans, stable in the imminent `19.6.0` release, is undocumented.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Version plans is a documented feature.

## 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-08-15 10:49:58 -04:00
Benjamin Cabanes 96b8133d85 feat(nx-dev): add Explain with AI to Enterprise and Pro Plans (#27455)
This commit integrates the "Explain with AI" feature into the Enterprise
and Pro plans for providing detailed explanations and insights for
failed task outputs. It also remove the Nx Workflows mention of the
pricing page. It also updates various links within the Hobby plan and
modifies plan table descriptions to reflect the accurate feature names.
2024-08-15 10:39:28 -04:00
Colum Ferry d8de0cd792 docs(module-federation): update host serve diagram (#27454)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-15 14:34:02 +00:00
Jack Hsu 99b0557fb9 docs(core): add a recipe for convert-to-inferred migrations (#27442)
This PR adds a recipe for converting executor-based configuration to
inferred configuration.

The goal of the recipe is to guide users on what commands to run,
understand what changes were applied, and how to verify the migrations.

Preview:
https://nx-dev-git-docs-inferred-migration-recipe-nrwl.vercel.app/recipes/running-tasks/convert-to-inferred

[x] Link to this from Project Crystal concept page
[x] Mark recipe as related to Migration feature page

<!-- Please make sure you have read the submission guidelines before
posting an PR -->


<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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@gmail.com>
2024-08-15 10:24:18 -04:00
Isaac Mann ba47c72981 docs(core): add organization plugin tutorial (#27279)
Updates the Extending Nx section.

- New intro content
- Enforce Organizational Best Practices tutorial
- Tooling Plugin tutorial
    - Flexible base generators
    - Inferred tasks
    - Executors
    - Migration generators
    - Publishing and listing the plugin
    - E2E testing with Verdaccio

In a separate PR:
- Repository Structure Plugin tutorial
    - Presets
    - Create-* script
    - Migration generators
2024-08-15 10:22:07 -04:00
MaxKless cf5dd4da08 chore(repo): add comments to make sure code stays manually synced with nx console (#27410)
this code is needed in a version-independent way in Nx Console and right
now there's no good place to share it.
So for now we will duplicate it
2024-08-15 10:18:57 -04:00
Jonathan Cammisuli 5cd08e2828 feat(docs): update OpenAI model to use gpt-4o-mini (#27434)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Current docs chat uses `gpt-3.5-turbo`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Docs are now using `gpt-4o-mini`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-15 09:22:04 -04:00
Benjamin Cabanes 5410794273 feat(nx-dev): add support section on contact page (#27437)
Simplify imports and content descriptions for engineering contact page. Added new Nx Cloud support section and adjusted links and icons in the contact links component for consistency.
2024-08-14 17:00:37 -04:00
Leosvel Pérez Espinosa c0f5c157ab feat(angular): support angular v18.2.0 (#27379)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-14 16:33:33 -04:00
Nicholas Cunningham 0d97039d5c Fix(webpack): If the style path is relative do not normalize (#27445)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When a style path is passed to the `NxAppWebpackPlugin` we normalize it
to the `projectRoot`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When a style path is passed to the `NxAppWebpackPlugin` if it is already
normalized i.e. it is relative to the project we should assume the path
is correct.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-14 16:10:40 -04:00
Colum Ferry 3d7f60afa3 fix(testing): migrations should look for existing target before attempting migration (#27441)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Migrations are naively setting `serve-static` or `preview` as the target
without checking if that target exists


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Check if the target exists based on executor usage as a last port of
call, and use the name of the target it is found on

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Closes https://github.com/nrwl/nx/pull/27439
2024-08-14 15:14:40 -04:00
Austin Fahsl 4d2793987c fix(release): allow specifier override for version command when version plans are enabled (#27436) 2024-08-14 14:35:23 -04:00
Jason Jean c17969665c chore(repo): update nx to 19.6.0-beta.6 (#27391)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `19.5.0-beta.5`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `19.6.0-beta.6`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-14 13:30:11 -04:00
Jason Jean 6d0ee075a2 fix(testing): do not migrate projects without webpack nor vite (#27431)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Projects which have neither webpack or vite configs were assumed to be
vite.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Projects which have neither webpack or vite configs are not migrated.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-14 13:03:03 -04:00
Nicholas Cunningham edced6c3ee fix(module-federation): Add migration for ssr server file to run on it's own port (#27411)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, if you have a SSR Mfe project and you run multiple ssr
projects using the 'serve' target it would fail due to conflicting ports
unless explicitly set `PORT=4202 node dist/acme/server.js`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Now the default is to have the server take the same port as it was
generated with so that if you run multiple server apps that depends on
other apps in dev mode there will be no conflicts.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-14 16:11:39 +00:00
Leosvel Pérez Espinosa f4659d7165 fix(testing): revert bump for ts-jest (#27432)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-14 18:10:20 +02:00
Colum Ferry b0a3e072a9 docs(module-federation): add technical overview page (#27427)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-14 16:47:15 +01:00
Colum Ferry 11f30dbd00 feat(storybook): add storybook 8 support (#27214)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #27175 #26914 #22941 #26531
2024-08-14 16:37:20 +01:00
Jonathan Cammisuli 3212bd12c0 chore(repo): use auto distributes on (#26795)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 Agents numbers are calculated by using the dynamic changeset feature,
where the agent counts are hardcoded.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Nx Agents are spawned using the "auto" keyword. 

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-14 11:36:43 -04:00
Colum Ferry c56bfbeab4 fix(core): ensure the error has message before reading indexOf #27078 (#27426)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Project graph error handling is always expecting the `message` property
to exist on the error. This may not always be the case.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Only attempt to run `indexOf` if the `message` property exists.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27078
2024-08-14 16:28:47 +01:00
Leosvel Pérez Espinosa 17f09bc1d6 fix(testing): resolve jest utils in plugin from the @jest/core package location that jest uses (#27422)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 the `@nx/jest/plugin` some jest utils are imported from the location
of the `jest` package to ensure the plugin uses the same utils the
`jest` package would use. This is not entirely correct because the
`jest` package doesn't directly depend on those utils, so they might not
be resolved correctly.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `@nx/jest/plugin` should import those jest utils from the location
of the `@jest/core` package resolved from the `jest` package location,
to ensure the plugin uses the same utils the `jest` package would use.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-14 10:48:43 -04:00
Leosvel Pérez Espinosa 8de36d7f14 fix(core): improve the dx of the sync commands and gracefully handle exiting the prompt when running tasks (#27418)
- Update the `nx sync` output when there are changes to sync (currently
there's no output)
- Update the `nx sync` and `nx sync:check` output when there are no
changes to sync (currently there's no output)
- Handle exiting the prompt for applying sync generator changes when
running tasks

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## 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-08-14 16:27:49 +02:00
Nicholas Cunningham ab162ebb54 feat(module-federation): Update SSR enabling static serving for remotes (#27345)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Currently, the default for remotes is to server them as development.
Which means a separate node process for each remote that is inside the
workspace.

This does not scale well and can lead to out of memory exceptions.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Remotes will start as static by default, which allows for better scaling
as the remotes increase.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

TODO
- [ ] Migrations
2024-08-14 09:14:58 -04:00
Colum Ferry 225a8e019c fix(module-federation): turn dts off by default #27198 (#27403)
- fix(angular): turn mf dts off by default #27198
- fix(react): turn mf dts off by default
- fix(react): add migration to turn module federation dts off by default
- fix(angular): add migration to turn module federation dts off by
default

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Nx already provides Typing support for Module Federation projects. The
`@module-federation/enhanced` package has typing support turned on by
default but it can be problematic.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Turn off `@module-federation/enhanced` own dts plugin providing typing
support in favour of Nx's own typing support

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27198
2024-08-14 14:14:37 +01:00
Jack Hsu d39624cbb1 feat(js): @nx/js:init generator does not generate prettier and tsconfig.base.json files by default (#27406)
In order to use `nx release` you must run `nx add @nx/js`. However, the
init generator will add Prettier and `tsconfig.base.json` files by
default, which is not what the user wants.

This PR adds two options:
- `addTsConfigBase` - generates `tsconfig.base.json` when `true`.
Default to`false`
- `setUpPrettier` - adds `prettier` and generates `.prettierrc` and
`.prettierignore` files when `true`. Defaults to `false`.

The programmatic `initGenerator` API defaults both options to `true` to
usages remain unaffected.

The one behavior change is if users run `nx g @nx/js:init` then the two
options default to `false`. However, since this is an internal API, the
actual usages should be through `nx add` or the programmatic API.



<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-14 09:08:56 -04:00
Trang Doan 22b654a3a9 fix(nextjs): Fix order, and wrong number call to createWebpackConfig() (#27337)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Assets are not copied to the dist folder after running @nx/next:build

## Expected Behavior
Assets should be copied to the dist folder after @nx/next:build

## Related Issue(s)
https://github.com/nrwl/nx/issues/26900

Fixes #
Fix the order, and wrong number of parameters call to
createWebpackConfig()

---------

Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-08-14 08:12:20 -04:00
Rares Matei 4279c2dd26 docs(nx-cloud): update release notes (#27271)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-14 10:18:55 +01:00
Jason Jean 6d83ae2fb1 fix(core): disable daemon in postinstall (#27415)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Daemon is stopped.. but then started in the postinstall process. The
results might be premature and cause issues for subsequent commands.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Daemon is stopped... and disabled in postinstall process. This won't
cause issues for subsequent commands.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-13 17:55:54 -04:00
Jack Hsu 54f52bb8e8 fix(nextjs): update @nx/next/babel preset to remove conflicting plugins when testing in Jest (#27414)
The `next/babel` and `babel-jest-preset` Babel presets bring in
conflicting plugins. This will cause Jest tests to fail.

This PR updates our own `@nx/next/babel` preset to remove the
conflicting plugin from `next/babel`. Import assertions are out of date
anyway, and we should be using import attributes (which
`babel-jest-preset` supports).

See: https://github.com/tc39/proposal-import-attributes
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-13 16:23:13 -04:00
Leosvel Pérez Espinosa e95c94571e feat(core): remove env var to enable sync generators (#27409)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-13 18:04:19 +02:00
Leosvel Pérez Espinosa a9ac3d950f fix(testing): cache resolved jest path in plugin correctly (#27407)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-13 11:41:18 -04:00
Leosvel Pérez Espinosa e01189230c feat(angular): deprecate data persistence operators (#27401)
- Deprecate the `@nx/angular` data persistence operators in favor of
importing them from `@ngrx/router-store/data-persistence`. The operator
will be removed from the `@nx/angular` package in Nx v21.
- Update the deprecation message for `@nx/angular/testing` helpers to
communicate that they will be removed in Nx v21.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-13 14:44:03 +02:00
Leosvel Pérez Espinosa 1ade19b242 fix(angular): update .gitignore and .prettierignore files in angular integrated migration (#27400)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #27322
2024-08-13 14:43:47 +02:00
Colum Ferry 28a0bb3a94 fix(testing): cypress update ci webserver to serve-static based on plugins (#27399)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
We're only checking for Vite and adding `preview` as a string on its own
when running the migration to update cypress.config.ts
ciWebServerCommand


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Check both Vite and Webpack and update according to plugin if one exists

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-13 13:16:20 +01:00
Michal Jez b224e7c732 feat(testing): support positional arg for jest executor (#27328)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 syntax to test a single file is different when using the jest
executor versus the jest cli

```sh
jest <file>
# vs
nx test project --testFile <file>
```

## Expected Behavior

I would expect the jest executor to support a single positional argument
as well

```sh
nx test project <file>
```

This is one of the common questions/complaints that I hear from
developers when transitioning from our standalone apps to our monorepo

This change supports both syntaxes so that this is not a breaking change
and prints a warning when both are used
2024-08-13 09:29:23 +02:00
Jason Jean 649905d44a fix(core): ensure context is available when updating files in context (#27395)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 an error when `updateFilesInContext` is called without a
`workspaceContext` available.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`updateFilesInContext` ensures there is a `workspaceContext` available.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-13 00:53:00 -04:00
Jason Jean c72ba9b504 feat(core): introduce nx import (#26847)
## Current Behavior
<!-- This is the behavior we have today -->

Importing other projects/ repositories into an Nx workspace is a natural
part of the Nx adoption story. However, there is no easy built in way of
handling this while maintaining `git` history.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`nx import` is a new command which allows teams to merge code from other
repositories into a Nx workspace.

https://asciinema.org/a/oQiA9qOvA2z85AQvVJ5QRVTp1

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-12 17:52:26 -04:00
Jack Hsu 903c4607d9 fix(react-native): migration handles case where plugins is missing from nx.json (#27387)
Otherwise, the migration will fail with an error.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-12 16:13:21 -04:00
Colum Ferry 010c6ec24c fix(module-federation): remote proxies should use https when host is configured with ssl #27360 (#27381)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
When the host uses SSL, the remote proxies are not created on a secure
server.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When the host uses SSL, the remote proxies should be created on a secure
server

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27360
2024-08-12 15:05:49 -04:00
Colum Ferry ef036b4a46 fix(testing): e2e-ci targetDefaults migration should handle self deps (#27380)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
If the `ciWebServerCommand` depends on a target that exists on the e2e
project, the `dependsOn` is still added with `^` expecting the project
to be an implicit dep.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The migration should handle when e2e project depends on itself for the
`e2e-ci` command

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-12 14:19:14 -04:00
Colum Ferry 64f1aaf282 fix(testing): playwright migration should find correct targetName (#27386)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Migration is not correctly finding the intended target name to use for
the config file


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Migration should find the correct target name for the config file

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-12 14:18:00 -04:00
James Henry 4108bfc8a6 feat(release): add nx release plan:check command to ensure relevant version plans exist (#27343)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When using version plans as a versioning strategy with `nx release`,
there is no way to enforce that version plan files are created when
changing files.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There is a new `nx release plan:check` subcommand, intended to be run in
CI (and/or potentially a git hook) which will return with exit code 1 if
touched projects are not represented in at least one version plan file
on disk.

What constitutes a touched file is shared with our `affected` logic in
other commands, with the additionally capability to be able to ignore
file patterns from consideration. This would be useful for not requiring
version plans when only documentation or spec files change, for example.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-12 13:44:17 -04:00
Leosvel Pérez Espinosa add5a675c3 feat(misc): add nx syncing mechanism and update the typescript-sync generator (#26793)
- Add the `nx sync` command to run sync generators and apply changes to
bring the workspace up to date according to their logic.
- Add the `nx sync:check` command to validate that the workspace is up
to date by running the sync generators without applying the changes. It
can be used on CI as a validation check.
- Update the task runner to run the sync generators (or obtain their
state from the daemon) and prompt the user whether to apply the changes,
if any
- This is only run if the `NX_ENABLE_SYNC_GENERATORS` environment
variable is set to `'true'`
  - Allow the user to configure a default value for the prompt
- Update the `@nx/js:typescript-sync` generator (keep tsconfig project
references in sync with the project graph) with misc fixes

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 NXC-787 -->
<!-- Fixes NXC-788 -->
<!-- Fixes NXC-789 -->

Fixes #
2024-08-12 10:44:04 -04:00
Colum Ferry f208acde54 fix(module-federation): optimization should not be overwritten #27201 (#27376)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
`withModuleFederation` is overwriting `config.optimization` rather than
merging it.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`config.optimization` should be merged

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27201
2024-08-12 15:29:55 +01:00
Colum Ferry 69fac0398f fix(webpack): bump webpack-dev-server to 5.0.4 #27310 (#27375)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
`webpack-dev-server` dependency is not up to date.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`webpack-dev-server` dependency is up to date

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27310
2024-08-12 10:28:37 -04:00
Louie Weng 1f8612aaaf fix(nx-cloud): add nxCloudId to nxJson when connecting with generator (#27356)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 connecting via NxCloudId, the resulting Id would not be written to
nx.json

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Correctly writes nxCloudId to nx.json after running `npx nx g
connect-to-nx-cloud`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-12 18:24:50 +04:00
Tine Kondo 8bba5b5d0e chore(repo): improve the devcontainer setup (#27221)
- respect `pnpm` version declared in root `package.json`
- improve performances when installing node modules
- add troubleshooting instructions in `CONTRIBUTING.md` to help solve
common issue related to outdated `GLIBC` version
2024-08-12 07:38:32 -04:00
abcdmku 3c2c46247d fix(storybook): update version check (#27278)
Previously the check would see if the version of storybook is less than
7 and would throw an error. This causes an issue when testing canary
releases of storybook since they are labeled 0.0.0-[pr-info...]

Update pleaseUpgrade text

One of the checks is to see if storybook is less than 7. The text is
updated so it matches for the very unlikely scenario that someone with
version 5 or lower runs this plugin.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 storybook plugin throws and error if the storybook version [is less
than
7](https://github.com/nrwl/nx/blob/239f47c8d0eaf4df191acf1844b87e333b956e84/packages/storybook/src/executors/storybook/storybook.impl.ts#L17-L20).

```ts
const storybook7 = storybookMajorVersion() >= 7;
if (!storybook7) {
  throw pleaseUpgrade();
}
```

When testing a canary release for storybook the version is 0.0.0-[pr
info] so when spinning up storybook it will display:

```
> nx run component-lib:storybook

 NX   

    Storybook 6 is no longer maintained, and not supported in Nx. 
    Please upgrade to Storybook 7.

    Here is a guide on how to upgrade:
    https://nx.dev/nx-api/storybook/generators/migrate-7

```

## Expected Behavior
Storybook spins up when running a canary release. Modifying the version
check to not include v0 solves the problem:
```ts
const sbVersion = storybookMajorVersion();
const sbLessThan7 = sbVersion < 7 && sbVersion > 0;

if (sbLessThan7) {
  throw pleaseUpgrade();
}
```

then running Storybook with that modification:

```
╭──────────────────────────────────────────────────────────────────────╮
│                                                                      │
│   Storybook 0.0.0-pr-28752-sha-a65743e5 for react-webpack5 started   │
│   307 ms for manager and 7.73 s for preview                          │
│                                                                      │
│    Local:            http://localhost:4402/                          │
│    On your network:  http://192.168.4.41:4402/                       │
│                                                                      │
╰──────────────────────────────────────────────────────────────────────╯
```

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27277
2024-08-12 10:39:53 +01:00
Ally a13961d8fc Remove brackets for list of capabilities of a plugin when using nx list if it has none (#27286)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 running `nx list`, if a plugin has no capabilities (i.e.
`@nx/eslint-plugin`), it will show brackets with an empty list of
capabilities.

```shell
$ nx list                                                                                                                                                                                                  
                                                                                                                                                                                                                                            
 NX   Installed plugins:                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                         
@nx/eslint (executors,generators)                                                                                                                                                                                                                        
@nx/eslint-plugin ()                                                                                                                                                                                                                                     
@nx/js (executors,generators)                                                                                                                                                                                                                            
@nx/workspace (executors,generators)                                                                                                                                                                                                                     
nx (executors,generators)                                                                                                                                                                                                                          
```

https://asciinema.org/a/XxJjVyoIoQgjj8fsM6fb0TXQT

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When running `nx list`, if a plugin has no capabilities (i.e.
`@nx/eslint-plugin`), it won't show brackets with an empty list of
capabilities.

```shell
$ nx list
nx list                                                                                                                                
                                                                                                                                                                                                      
 NX   Installed plugins:                                                                                                                                                                              
                                                                                                                                                                                                      
@nx/eslint (executors,generators)                                                                                                                                                                     
@nx/eslint-plugin                                                                                                                                                                                     
@nx/js (executors,generators)                                                                                                                                                                         
nx (executors,generators)                                                                                                                                                                             
```

https://asciinema.org/a/CHPkcO6hRURZRuBRJxUSRayGx

## Related Issue(s)
N/A
2024-08-09 23:17:11 -04:00
Craigory Coppola abfb25dc37 fix(core): prevent post install failures when socket path too long (#27366)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
We communicate with sockets during graph construction. Its possible for
the assigned path to be too long and this can cause issues. The issues
present as a strange error with no helpful information.

## Expected Behavior
There is a helpful error message, and post-install is not interrupted

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27040
2024-08-09 23:15:23 -04:00
Isaac Mann a4169a1291 docs(core): update remix created files list (#27365)
Fixes #27330
2024-08-09 22:01:16 -04:00
Leosvel Pérez Espinosa 6c0e70e574 feat(testing): allow usage of jest 30 pre-release versions (#27334)
Allow usage of Jest v30 pre-release version in preparation for the
upcoming stable release.

Note that this PR is not intended to change any current generator for
creating/setting up projects with Jest 30. That will be done when Jest
v30 becomes stable.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 NXP-860 -->

Fixes #
2024-08-09 18:21:21 -04:00
Isaac Mann f3ee14b895 docs(core): update angular monorepo icon (#27362)
Angular monorepo icon matches the normal Angular icon
2024-08-09 13:32:47 -06:00
Craigory Coppola c38de28a5c fix(misc): init should run add for .nx workspaces on windows (#27364)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
We execute `execSync('./nx ...')` inside nx init

## Expected Behavior
We use `runNx`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-09 14:59:29 -04:00
blitzkrieg 46c3949a96 docs(core): fix typo in npm-workspaces.md (#27280)
type(docs): fix typo in npm-workspaces.md

Someone's cat slept on their "G" key. `creggggggate` -> `create`

## Current Behavior
Typo exists:
> Does the "lint" script creggggggate any outputs? - Enter nothing

## Expected Behavior
Typo should not exist:
> Does the "lint" script ~~creggggggate~~ create any outputs? - Enter
nothing

## Related Issue(s)
N/A

Fixes #
N/A

Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-08-09 18:03:30 +00:00
Juri Strumpflohner cd228e538a fix(misc): update readmes (#27038)
updates
- Nx GitHub repository readme
- Generated readmes for all the available Nx presets (via CNW). Here's a
snapshot of the new readme for each preset that can be used:
https://github.com/juristr/nx_readme_updates/

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2024-08-09 13:57:34 -04:00
Emily Xiong 32dd7007a7 fix(gradle): change test-ci depends on testClasses (#27349)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-09 13:55:43 -04:00
Abdelwahab Hussein c848f2b259 docs(nx-cloud): edit incorrectly number of dynamic-agents (#26927)
Change wrong number in nx-cloud docs which determine number of agents
for small changes which is 3 not 1

The workflow is:
```yaml
distribute-on:
  small-changeset: 3 linux-medium-js
  medium-changeset: 6 linux-medium-js
  large-changeset: 10 linux-medium-js
```

but docs says:

`Now PRs that affect a small percentage of the repo will run on 1 agent,
.....`

Which is not matching the workflow and it should be 3 not 1  

https://nx.dev/ci/features/dynamic-agents#dynamically-allocate-agents
2024-08-09 13:47:12 -04:00
Wayne Maurer 10ee761c4a docs(misc): added additional required development dependencies (#27026)
Added vite-plugin-solid to development dependencies installation command

Co-authored-by: Wayne Maurer <2899448+wmaurer@users.noreply.github.com>
2024-08-09 13:46:37 -04:00
Arthur 264f727a8f docs(testing): moved the cleanup func calls into the func that be export default (#27268)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 cleanup function is called **immediately** when the file is imported
if it is placed outside of the exported function in jest global setup
file.

<img width="1202" alt="Screenshot 2024-08-02 at 7 45 12 AM"
src="https://github.com/user-attachments/assets/caa9cc2b-9212-4c91-b557-d44e6ba7ae05">

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The cleanup func in jest global setup file, should be call inside the
default export function.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

N/A!
2024-08-09 13:44:00 -04:00
Milan Kovacic ac02118327 docs(nest): add nest cli plugin usage section (#27293)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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)
https://github.com/nrwl/nx/discussions/23105#discussioncomment-9281248

Fixes #

---------

Co-authored-by: MilanKovacic <9189985+MilanKovacic@users.noreply.github.com>
2024-08-09 13:41:24 -04:00
Jack Hsu 9d852570be feat(testing): add missing targetDefaults migration entry for @nx/playwright (#27359)
The migration file is there but missing in `migrations.json`.
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-09 13:24:11 -04:00
Nicholas Cunningham 826e6ab397 feat(core): Refresh welcome screens based on Nx Cloud (#27313)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, when you create an app we always show `nx connect` regardless
if the workspace has already setup Nx Cloud.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Now, we:
- show `nx connect` if you have no opted into Nx Cloud
- show a CTA to finish your setup if you have setup your workspace on Nx
cloud but have yet to claim it
- show a CTA to learn more if your workspace has been claimed in Nx
Cloud

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
2024-08-09 13:23:51 -04:00
Emily Xiong 1d44d6cba9 feat(core): change e2e-ci,e2e to be same line affected command (#26951)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-09 11:37:17 -04:00
Craigory Coppola 413cbb8e4d fix(core): allow isolated plugins to shut themselves down (#27317) 2024-08-09 10:22:23 -04:00
Isaac Mann 6c8c0c43db docs(core): link to split tasks section of plugins (#27347)
Update split e2e tasks section to point directly to plugin sections
about splitting tasks
2024-08-09 09:28:48 -04:00
Juri 6f7bb90686 docs(misc): adjust image to align with the marketing img version 2024-08-09 05:16:07 -07:00
Juri Strumpflohner 2d84fb4666 docs(core): remove leftover tab that caused layout issues (#27352)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-09 08:00:19 -04:00
Elyahou Ittah 7c8bd7c3be fix(core): avoid mutating target defaults during task graph calculation (#27348)
Same copy of target default is shared along projects and is mutated,
leading to wrong task graph. Occur only when running without daemon,
probably because the daemon communication cause cloning by unmarshalling
the object.

Fix by deepcloning `targetDefaults`

Fixes https://github.com/nrwl/nx/issues/27346
2024-08-09 01:08:32 -04:00
Jack Hsu d3747e020f feat(react-native): add convert-to-inferred generator for Expo and React Native (#27326)
This PR adds `convert-to-inferred` generators to convert React Native an
Expo apps using executors to use the corresponding inference plugins.

Also:
1. Fixes casing for `@nx/react-native/plugin` so it is correctly set as
`upgradeTargetName` not `upgradeTargetname`
2. Migration for the above fix for existing projects
2024-08-08 14:31:19 -04:00
Juri 2ce679755f docs(core): update nx migrate feature page 2024-08-08 11:06:24 -07:00
Juri Strumpflohner e0c0548f5e docs(core): fix typo
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-08-08 11:06:04 -07:00
Juri Strumpflohner 3ef086614d docs(core): fix typo
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-08-08 11:06:04 -07:00
Juri Strumpflohner 8ca7e949ec docs(core): fix typo
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-08-08 11:06:04 -07:00
Juri Strumpflohner a7e8e6a022 docs(core): fix typo
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-08-08 11:06:04 -07:00
Juri Strumpflohner 8b8c06c228 docs(core): fix typo
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-08-08 11:06:04 -07:00
Juri Strumpflohner f863fa749a docs(core): fix typo
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-08-08 11:06:04 -07:00
Juri Strumpflohner 4666aa7027 docs(core): fix typo
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-08-08 11:06:04 -07:00
Juri 850cedfa9f fixup! docs(core): improve caching feature page 2024-08-08 11:06:04 -07:00
Juri a73bbfa7bb docs(core): improve caching feature page 2024-08-08 11:06:04 -07:00
Juri 2dadf98188 docs(core): improve run-tasks feature page 2024-08-08 11:05:11 -07:00
Juri e38033968e docs(core): improve the code generation section 2024-08-08 11:04:48 -07:00
Jason Jean 1ddf1eb090 fix(repo): fix native cache inputs (#27338)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 inputs for `build-native-wasm` and other native tasks are not set
properly resulting in incorrect cache hits/misses.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The inputs for `build-native-wasm` and other native tasks are set
properly resulting in correct cache hits/misses.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-08 13:57:36 -04:00
Jonathan Cammisuli c81493dffc fix(core): update napi-build dependency to 2.1.3 (#27341)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Current `napi-build` dependency causes some functions not to export
properly for wasm.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`napi-build` exports all functions properly. 

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-08 16:19:49 +00:00
Juri ff51fcd2cd feat(nx-dev): improve tab UX 2024-08-08 08:45:57 -07:00
Leosvel Pérez Espinosa 46dcee6dd2 fix(testing): resolve jest package from the project root in plugin (#27342)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-08 17:37:06 +02:00
Jack Hsu 712dbbc2d5 fix(webpack): return proper webpack plugin from useLegacyNxPlugin function (#27340)
The current `useLegacyNxPlugin` has two issues:
1. It doesn't pass the configuration object, but rather the compiler
instance.
2. It doesn't handle async correctly

This PR resolves both issues.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Legacy plugins don't actually work.

## Expected Behavior
Legacy plugins work.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-08 11:29:55 -04:00
Leosvel Pérez Espinosa 6e8a3e51b4 feat(testing): update jest to v29.7.0 (#27301)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-08 15:18:35 +02:00
Colum Ferry ca007a6065 feat(rspack): bump to latest rspack (#412) 2024-08-08 13:02:27 +00:00
Leosvel Pérez Espinosa 76268b7230 chore(repo): use nx-cloud@latest in pipeline (#27332) 2024-08-08 10:53:42 +02:00
Craigory Coppola 333ab7708f fix(misc): avoid terminal popups when checking package manager version (#27329) 2024-08-07 17:43:58 -04:00
James Henry 7e2266177d fix(release): allow version plans to have multi-line, arbitrarily formatted messages (#27323) 2024-08-08 01:27:34 +04:00
James Henry 555182353b feat(release): add logUnchangedProjects flag to version generator, true by default (#27231) 2024-08-07 15:22:52 -06:00
Leosvel Pérez Espinosa 40d3516020 fix(js): locate npm nodes correctly for aliased packages (#27124) 2024-08-07 13:29:27 -04:00
Craigory Coppola 0f193e21ce fix(core): allow configuring plugin message timeout (#27315)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 messages timeout if they don't hear back in 5 minutes. This adds
timeouts to createNodes and other plugin APIs invoked during graph
construction, which didn't previously exist

## Expected Behavior
Increased timeout + easy configuration via env var

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-07 12:27:16 -04:00
Colum Ferry dfd7241ed5 fix(testing): adding e2e projects should register e2e-ci targetDefaults (#27185)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-07 12:25:32 -04:00
Juri e74db498ca docs(nx-cloud): update CTA and connect instructions 2024-08-07 08:31:59 -07:00
Juri 04af849c66 docs(release): optimize the customize semver recipe 2024-08-07 08:24:58 -07:00
James Henry c2920a207a feat(release): dynamic release config via programmatic API (#27204) 2024-08-07 10:56:49 -04:00
Jason Jean 087928d1b8 fix(misc): track which CI providers being used (#27320)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

We don't have information about which CI providers that people are
using.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

We collect information about which CI providers people are using so we
can use it to inform which CI provider we create better integration with
next.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-06 16:55:20 -05:00
Louie Weng fbecedce0f feat(nx-cloud): add nxCloudId field for auth (#27197)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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
-->

Instead of `nxCloudAccessToken`, users can now connect to nx-cloud with
`nxCloudId`. This value will also default the runner to the cloud
runner.

Also modified the `connect-to-nx-cloud` generator such that it hits a
new API endpoint to grab a workspace's nxCloudId instead of access
token. (This feature is gated).

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-06 16:29:33 -05:00
Craigory Coppola 26f46c2534 fix(core): don't cache full dependency configuration when expanding target name (#27308)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
There is a cache that maps target pattern -> dependency configuration,
but the dependency configuration contains more than just the target
name. This results in retrieving cached dependency configurations that
contain the wrong projects to run.

## Expected Behavior
The cache maps target pattern -> target names, which we can then map to
the full dependency configuration with the extra info we know.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-06 16:36:44 -04:00
Craigory Coppola 25212e3dd0 fix(core): script-based targets should be able to be modified in a project.json file (#27309)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
We don't infer scripts if any info for that target is present in
project.json. This results in the target dissapearing if the user tries
to modify the inferred target by providing info in project.json, for
example by providing dependsOn or similar.

A minimal repro of the issue looks something like this:

> packages/foo/package.json
```json
{
  "name": "foo",
  "scripts": {
    "build": "echo build"
  }
}
```

> packages/foo/project.json
```json
{
  "name": "foo",
  "targets": {
    "build": {
      "dependsOn": []
    }
  }
}
```

Attempting to run `nx build foo` results in "Cannot find configuration
for task foo:build", as we remove the target for not having an executor.

## Expected Behavior
The target remains as it can run the script, so we have to infer the
script to begin with.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27258
2024-08-06 16:33:32 -04:00
Jason Jean 64294a7d20 fix(misc): end ab testing for onboarding message (#27316)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/B testing is being done on the message for the onboarding flow.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The onboarding flow will be the one which performed the best during A/b
testing:


![image](https://github.com/user-attachments/assets/7d8c81b7-196a-4bc3-b025-0583b72f06ba)

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-06 16:17:22 -04:00
Jason Jean bbd4dad2fa fix(nx-cloud): fix connect generator (#27314)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 generators is broken when run directly with `nx g
connect-to-nx-cloud`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The generator is not broken when running it directly via `nx g
connect-to-nx-cloud`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-06 14:38:54 -04:00
Katerina Skroumpelou 720681fcba fix(nx-dev): clean up heading text (#27205)
Fixing 3 issues when storing the page sections:

1. The heading of a node can be like this: `title: 'Angular Monorepo
Tutorial - Part 1: Code Generation' description: In this tutorial you'll
create a frontend-focused workspace with Nx`. We only want to keep the
`title` part.
2. Some headings have `{% highlightColor="green" %}`. We want to remove
that from the heading of the page section (and the link text)
3. There's an [error in `tags.json` where the path is
incorrect](https://github.com/nrwl/nx/blob/master/docs/generated/manifests/tags.json#L126).
We want to fix that on the fly, so that the embeddings script finds the
correct pages.
2024-08-06 09:13:03 -04:00
MaxKless 8464d80c7c feat(core): add nx-console installation source to nx connect (#27307) 2024-08-06 15:04:44 +02:00
Colum Ferry 85c1cac343 docs(module-federation): add callouts to @module-federation/enhanced (#27306)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Our docs state that we're abstracting Webpack's ModuleFederationPlugin.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The docs state that we're abstraction `@module-federation/enhanced`. 

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-06 13:48:16 +01:00
Miroslav Jonaš a3869a814d docs(nx-dev): add bitbucket cloud redirection (#27296)
Link on Nx Cloud is broken. This ensures the link is fixed also for
OnPrem customers.

## 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-08-05 17:06:06 +02:00
Lucas Marcolongo 4bf53d0749 chore(core): nx plugin submission @nx-extensions/helm (#27290)
<!-- 
_[Please make sure you have read the submission guidelines before
posting an
PR](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#submit-pr)_

# Community Plugin Submission

Thanks for submitting your Nx Plugin to our community plugins list. Make
sure to follow these steps to ensure that your PR is approved in a
timely manner.

## Plugin Requirements

Before you submit your plugin to be listed in our registry, it needs to
meet the following requirements:
- Run some kind of automated e2e tests in your repository
- Include `@nx/devkit` as a `dependency` in the plugin's `package.json`
- List a `repository.url` in the plugin's `package.json`

i.e.

```
{
  "repository": {
    "type": "git",
    "url": "https://github.com/nrwl/nx.git",
    "directory": "packages/web"
  }
}
```

Note: We reserve the right to remove unmaintained plugins from the
registry. If the plugins become maintained again, they can be
resubmitted to the registry.

## Steps to Submit Your Plugin
- Use the following commit message template: `chore(core): nx plugin
submission [PLUGIN_NAME]`
- Update the `community/approved-plugins.json` file with a new entry for
your plugin that includes `name`, `url`, `description`:

Example:

```json
// community/approved-plugins.json

[{
    "name": "@community/plugin",
    "url": "https://github.com/community/plugin",
    "description": "This plugin provides the following capabilities."
}]
```

Once merged, your plugin will be available when running the `nx list`
command, and will also be available in the Plugin Registry on
[nx.dev](https://nx.dev/plugin-registry)
-->

# Community Plugin Submission

## @nx-extensions/helm

This Nx plugin delivers comprehensive first-class support for Helm
charts, focusing on streamlining the processes of chart generation,
packaging, and publishing. By integrating Helm with Nx, the plugin
enhances workflow automation, reduces manual steps, and ensures
consistent deployment practices across projects.

**Goal/Issues Addressed**

The primary goal of this plugin is to simplify and standardize the
management of Helm charts within the Nx ecosystem. It addresses several
issues:

Automation: Automates the creation, packaging, and deployment of Helm
charts.
Consistency: Ensures uniform practices across different projects and
teams.
Efficiency: Reduces the manual effort required for managing Helm charts.

**Focus**

The plugin is focused on tooling and behavior:

Tooling: Provides generators and executors for Helm chart management.
Behavior: Enhances the developer experience by integrating Helm
operations into the Nx workflow.

**Features**

    Generators: Create new Helm charts with standardized templates.
Executors: Package and publish Helm charts directly from the Nx
workspace.
    
**Usage**

While this plugin is newly developed, it is intended for use by
development teams who utilize Helm and Nx for their DevOps workflows.

**Author**

This plugin is authored by me
2024-08-05 08:40:17 -04:00
robertIsaac 45fa90f197 test(nx-dev): make test pass on windows (#27284)
## Current Behavior
running `nx test nx-dev-ui-markdoc` fails on windows

## Expected Behavior
running `nx test nx-dev-ui-markdoc` pass on windows
2024-08-05 08:29:56 -04:00
Jason Jean bd7a2c9214 fix(misc): fix cloud setup (#27281)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 Cloud is excluded from the options for a new workspace.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Nx Cloud is not excluded from the options for a new workspace.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-02 19:59:08 -04:00
Jason Jean 2ec25640b3 fix(core): move token generation into new (#27266)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 Cloud token is generated after the workspace and preset have been
generated. This makes it hard to use the Nx Cloud token for generating
the workspace and preset.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The Nx Cloud token is generated in the workspace creation. This makes it
easier to use the Nx Cloud token during the workspace creation process.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-02 16:47:10 -04:00
Stefan F. cead18477c fix(core): remove additional quotes around cache path while pruning (#27273)
Old cache entries are not removed because the path to the cache is
wrong.

It throws a silent error `no such file or directory, scandir
'"PATH_TO_PROJECT/.nx/cache"/terminalOutputs'`

closed #27206
2024-08-02 12:05:19 -05:00
Nicholas Cunningham 8d7fe2f26c fix(nx-dev): Turn off next.js cache for careers api (#27275)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, in Next.js 14 the `fetch` API is cached by default, which we
do not want on the careers page.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Each visit to the careers page should do a fresh API call.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-02 09:59:37 -06:00
Colum Ferry 1dcfbeeeee feat(testing): e2e-ci should use serve-static or vite preview for playwright and cypress (#27240)
- fix(vite): preview should dependOn build
- fix(react): playwright should use vite preview
- fix(vue): playwright should use vite preview
- fix(web): playwright should use vite preview
- chore(testing): add e2e test

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, `playwright` uses the `vite serve` command when setting up
the web server to run the e2e tests against.

The `vite preview` command/target should also depend on `vite build`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`playwright` should use the `vite preview` command when setting up the
web server

`vite preview` targets add a `dependsOn["build"]`

Ensure `serve-static` has a dependsOn: ['build']

Cypress should use the `ciBaseUrl` if it exists when running the
`e2e-ci` targets

Migrations for Playwright and Cypress to use serve-static and preview
correctly

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-02 11:56:07 -04:00
MaxKless 97d4184709 chore(repo): switch macos e2e test to not use atomizer (#27272)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-08-02 15:18:51 +01:00
Craigory Coppola a07aa5e966 docs(core): add blurb about pattern matched target defaults (#27242)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Pattern matched target defaults are not documented

## Expected Behavior
There is some documentation explaining target defaults w/ glob patterns

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-02 09:52:53 -04:00
Jason Jean dacf0b0e18 fix(misc): add cloud token during new workspace like expected (#27265)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 cloud access token is not written to nx.json during
`create-nx-workspace`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The nx cloud access token is written to nx.json during
`create-nx-workspace`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-01 17:13:41 -05:00
Zachary DeRose 239f47c8d0 docs(misc): additional topics for 19.5 blogpost (#27236)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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: Juri <juri.strumpflohner@gmail.com>
2024-08-01 13:31:59 -04:00
Juri 90e29f078e fix(nx-dev): adjust scroll offset for headings on docs and blog container 2024-08-01 07:04:25 -07:00
Juri Strumpflohner 2f225d25ad docs(core): adjust video button position on npm workspaces tutorial (#27254)
small PR to adjusts the position of the video button on the npm
workspaces tutorial.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

<img width="853" alt="Screenshot 2024-08-01 at 11 16 46"
src="https://github.com/user-attachments/assets/a3d0c559-a7f1-46a9-a1e7-2b2aae8bbc86">


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-01 08:14:44 -04:00
Benjamin Cabanes 211184122b feat(nx-dev): add contact us button (#27248)
Add the contact us hero section button back.
2024-07-31 17:49:13 -04:00
Juri 777eea685c fix(nx-dev): plugin-registry title style 2024-07-31 12:40:08 -07:00
Jason Jean 2160cd974d fix(misc): hide git not a repository error (#27237)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

There's an error that leaks through during `create-nx-workspace`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The error is ok and it is hidden during `create-nx-workspace`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-31 14:24:16 -04:00
Jason Jean 381efa8e0d fix(core): show target description, add metadata to schema, and docum… (#27131)
…ent it

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Target description is not shown in the PDV.

Also, being able to set a description in `project.json` is not in the
schema nor is it documented.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Target descriptions are shown in the PDV.

Also, being able to set a description in `project.json` is in the schema
and documented on
https://nx-dev-git-metadata-docs-nrwl.vercel.app/project-configuration#target-metadata


![image](https://github.com/user-attachments/assets/2037eca8-d516-4513-81fd-12b8384a9411)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/19355
2024-07-31 11:45:56 -04:00
Leosvel Pérez Espinosa 59e9c413a7 cleanup(nx-dev): remove unused target messing with getJestProjectsAsync in root jest config (#27176)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-31 11:45:04 -04:00
Zach Tindall 0d2f76ca54 fix(linter): allow undefined options in eslint plugin (#27232) 2024-07-31 10:37:03 -04:00
Rares Matei 8040638b0f docs(nx-cloud): use correct base branch input (#27230)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-31 15:34:48 +01:00
Rares Matei 0c9eba9d73 chore(repo): update agent base image (#27179)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-31 10:33:43 -04:00
Nicholas Cunningham edf065115b fix(nx-dev): OG image meta tag (#27195) 2024-07-31 06:48:42 -07:00
Daniel Rose adbb861d8c feat(misc): add more logging while running migrations (#27063) 2024-07-31 17:16:06 +04:00
robertIsaac 7409aa2e01 docs(misc): fix azure yml (#22480) 2024-07-31 13:28:26 +02:00
Jason Jean 341f2951a8 feat(misc): add onboarding a/b testing (#27217)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 onboarding message during `create-nx-workspace` is not ideal.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

We are A/b testing some options for the `create-nx-workspace` onboarding
message.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-30 19:33:38 -04:00
James Henry 66a8c75f87 fix(release): deleted files should be staged alongside changed files (#27219) 2024-07-30 17:36:01 -04:00
James Henry 8c88968e0e fix(release): do not add groups to commit message when their projects have no changes (#27218) 2024-07-31 00:27:09 +04:00
James Henry 17c87a5df7 fix(release): ensure @org/package style names are wrapped in quotes in version plans (#27177) 2024-07-30 14:04:19 -04:00
MaxKless f19354419b fix(core): disable plugin isolation by default on windows for now (#27210) 2024-07-30 12:45:55 -05:00
MaxKless cc0dff2b9c fix(core): change link in e2e-ci error message (#27187) 2024-07-30 17:52:42 +02:00
Juri 9712fb2a83 feat(nx-dev): improve link visibility on docs pages 2024-07-30 08:24:23 -07:00
Craigory Coppola c400ea3002 chore(core): nx plugin submission nx-github-pages (#27199)
<!-- 
_[Please make sure you have read the submission guidelines before
posting an
PR](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#submit-pr)_

# Community Plugin Submission

Thanks for submitting your Nx Plugin to our community plugins list. Make
sure to follow these steps to ensure that your PR is approved in a
timely manner.

## Plugin Requirements

Before you submit your plugin to be listed in our registry, it needs to
meet the following requirements:
[x] Run some kind of automated e2e tests in your repository
[x] Include `@nx/devkit` as a `dependency` in the plugin's
`package.json`
[x] List a `repository.url` in the plugin's `package.json`

i.e.

```
{
  "repository": {
    "type": "git",
    "url": "https://github.com/nrwl/nx.git",
    "directory": "packages/web"
  }
}
```

Note: We reserve the right to remove unmaintained plugins from the
registry. If the plugins become maintained again, they can be
resubmitted to the registry.

## Steps to Submit Your Plugin
- Use the following commit message template: `chore(core): nx plugin
submission [PLUGIN_NAME]`
- Update the `community/approved-plugins.json` file with a new entry for
your plugin that includes `name`, `url`, `description`:

Example:

```json
// community/approved-plugins.json

[{
    "name": "@community/plugin",
    "url": "https://github.com/community/plugin",
    "description": "This plugin provides the following capabilities."
}]
```

Once merged, your plugin will be available when running the `nx list`
command, and will also be available in the Plugin Registry on
[nx.dev](https://nx.dev/plugin-registry)
-->

# Community Plugin Submission

## nx-github-pages

Provides an executor to publish built artifacts to github pages and a
configuration generator to set it up.

<!-- 
Describe what your plugin is and what is its goal or issues it
addresses. If you don't provide a description, we will not merge your
PR.
Is it focused on a technology, tooling or behaviour? Does the plugin
provide generators, executors or graph support?
Do you know who is already using the plugin? Mention who is the author
of the plugin.
-->
2024-07-30 07:36:22 -04:00
Alice Kile acd9bb7748 docs(core): document wildcard support for dependsOn field (#27029)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 feature is not yet documented...

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Document wildcard support in `dependsOn` field for project
configurations.

Note: Reading through the PR below that impls. this wildcard support, I
couldn't quite figure out if it was actually able to also work in case
of object syntax and whether this will also work for `targetDefaults`...
so if you know any better, please lemme know so I can update this PR 🙏

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

documents #19611
2024-07-29 17:08:31 -05:00
James Henry ee2c41b75d feat(release): allow {releaseGroupName} to be interpolated in releaseTagPattern (#27190) 2024-07-30 01:55:06 +04:00
Philip Fulcher 5e328cb371 docs(nx-dev): add CTA to explain with ai post (#27193) 2024-07-29 15:21:20 -06:00
Nicholas Cunningham 4835c9fb6c fix(nx-dev): Add png image file for ai blog socials (#27192) 2024-07-29 13:46:18 -06:00
Rares Matei 8f83df012b docs(nx-cloud): update release notes (#27142)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-29 17:45:37 +01:00
James Henry 9e6c7fa6e3 Revert "feat(release): allow {releaseGroupName} to be interpolated in releaseTagPattern" (#27189)
Reverts nrwl/nx#27188
2024-07-29 20:31:43 +04:00
James Henry 0b9672b4e6 feat(release): allow {releaseGroupName} to be interpolated in tag pattern (#27188) 2024-07-29 20:31:17 +04:00
James Henry 7c912a1b82 fix(release): only include relevant authors in project changelogs (#27181) 2024-07-29 10:57:51 -05:00
James Henry 408eb47e9e chore(testing): use consistent uniq suffix length to avoid flakiness (#27186) 2024-07-29 14:37:49 +00:00
Philip Fulcher 0a403c60e6 docs(nx-dev): add explain with ai blog post (#27141)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2024-07-29 07:50:26 -06:00
Jack Hsu 0710feab27 fix(webpack): include hash in asset filenames so they do not conflict (#27159)
Our assets are generated as flat assets in dist, which allows using
assets from workspace libs. This prevents users from having different
assets with the same filename (e.g. `foo/image.png` and
`bar/image.png`). This will error out in the dev server with conflicting
filenames.

We cannot use `[path][name]` because of assets that are outside of the
app folder (e.g. `../../libs/ui/src/assets/image.png`). Thus the best
option is to include hash.

Note: Also re-enabled the e2e tests for `react.test.ts` file since it is
now using Playwright instead of Cypress.

## Current Behavior
Assets with the same filename will error in dev-mode.

## Expected Behavior
Assets with the same filename works.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #18272
2024-07-29 07:47:33 -06:00
James Henry c02f254316 docs(release): document github authentication logic and requirements (#27183) 2024-07-29 08:41:54 -04:00
Leosvel Pérez Espinosa e8b77b7d75 fix(js): handle project references better in typescript plugin (#27178)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Internal project references to files in a nested directory (e.g.,
`libs/lib1/cypress/tsconfig.json`) are not handled. They are currently
identified as external project references.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Internal project references to files in a nested directory should be
handled as such. Project references to nested projects should still be
identified as external project references.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-29 14:35:07 +02:00
Juri Strumpflohner 132ce968b0 docs(core): add missing closing tab (#27166)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-28 13:29:36 -04:00
Isaac Mann efa59fa681 docs(core): add outputFileName to tsc executor schema (#27161)
Fixes #17397
2024-07-26 15:45:36 -04:00
Isaac Mann 078593e2ec docs(core): env var configuration files (#27163)
Fixes #26653
2024-07-26 15:45:28 -04:00
Craigory Coppola 3dbbfd73ca feat(devkit): allow updating package json based projects (#27138)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Calling `updateProjectConfiguration` on a package json based project
fails

## Expected Behavior
Calling `updateProjectConfiguration` on a package json based project
works

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26530
2024-07-26 15:07:57 -04:00
Craigory Coppola 9a556f45b8 feat(core): add --exclude-task-dependencies flag (#27137)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
There is no option to exclude dependent tasks when running Nx.

## Expected Behavior
There is a flag, `--exclude-task-dependencies`, to exclude task deps
from running. This is inline with other tools:

- [dotnet
cli](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build#:~:text=%2D%2Dno%2D-,dependencies,-Ignores%20project%2Dto)

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #18053
2024-07-26 13:48:50 -04:00
Nicholas Cunningham 04fb62dccb fix(nx-dev): add background on pricing tiles & blog link to pricing page #27157 2024-07-26 13:43:31 -04:00
Nicolas Belliard 0e083faff8 fix(webpack): fixing null pointer about projectGraph with nx enhance configuration (#26430)
Hello!

I fixing issue related to nx project with enhanced webpack config.

I created this repository to reproduce the bug:
https://github.com/NicolasBelliard/nx-enhance-example

## Current Behavior
When created an Nx repository with nx enhanced config, we faced the
current issue when we try to build the application.

```
> nx run nx-enhance:build

> webpack-cli build --node-env=production

[webpack-cli] TypeError: Cannot read properties of undefined (reading 'nodes')
    at calculateProjectDependencies (/home/test/dev/nx-enhance/node_modules/@nx/js/src/utils/buildable-libs-utils.js:24:30)
    at calculateProjectBuildableDependencies (/home/test/dev/nx-enhance/node_modules/@nx/js/src/utils/buildable-libs-utils.js:20:12)
    at NxTsconfigPathsWebpackPlugin.handleBuildLibsFromSource (/home/test/dev/nx-enhance/node_modules/@nx/webpack/src/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.js:37:111)
    at NxTsconfigPathsWebpackPlugin.apply (/home/test/dev/nx-enhance/node_modules/@nx/webpack/src/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.js:17:14)
    at createCompiler (/home/test/dev/nx-enhance/node_modules/webpack/lib/webpack.js:78:12)
    at create (/home/test/dev/nx-enhance/node_modules/webpack/lib/webpack.js:145:16)
    at webpack (/home/test/dev/nx-enhance/node_modules/webpack/lib/webpack.js:153:47)
    at WebpackCLI.f [as webpack] (/home/test/dev/nx-enhance/node_modules/webpack/lib/index.js:73:16)
    at WebpackCLI.createCompiler (/home/test/dev/nx-enhance/node_modules/webpack-cli/lib/webpack-cli.js:1785:29)
    at async WebpackCLI.runWebpack (/home/test/dev/nx-enhance/node_modules/webpack-cli/lib/webpack-cli.js:1877:20)
Warning: command "webpack-cli build --node-env=production" exited with non-zero status code


Process finished with exit code 1
```

## Expected Behavior
No error and the build is working.

## Related Issue(s)
https://github.com/nrwl/nx/issues/26303
2024-07-26 11:09:33 -06:00
Nicholas Cunningham bff23d1b75 fix(node): Ensure docker file is generated when nest framework is supplied (#27153)
When we generate a nest application and supply the `--docker` flag it
should generate a DockerFile.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Currently, no DockerFile is created.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

A DockerFile to be created.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #17343
2024-07-26 10:31:37 -06:00
Jack Hsu 2d2c0b5acb fix(bundling): explicitly set types for exports entries in package.json (#27152)
We currently rely on the TS behavior of matching `d.ts` files based on
the `.js` file names. e.g. `foo.js` matches `foo.d.ts`. However, it
isn't working for all tools so we should explicitly set it.

Most modern packages are still setting it even though it is not
technically needed. e.g.
[Nuxt](https://unpkg.com/browse/nuxt@3.12.4/package.json)

Note: If both ESM and CJS are present, then prefer `*.esm.d.ts` files
since the generated types are in ESM format.

## Current Behavior
`exports` entries are missing `types` field

## Expected Behavior
`exports` entries have `types` field set

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #18835
2024-07-26 12:23:46 -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
Colum Ferry e38830415f docs(remix): update the plugin overview to match the latest iteration of the plugin #26943 (#26977)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 information on the Remix Plugin Overview is out of date.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The information should be up to date

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26943
2024-07-18 14:36:36 +01:00
Jason Jean 8633f3d024 fix(misc): update concurrency in ci workflows to 3 (#26974)
## Current Behavior
<!-- This is the behavior we have today -->

Generated CI Workflows use 5 agents.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Generated CI Workflows use 3 agents.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-18 00:37:41 -04:00
Colum Ferry 483bcf3465 feat(module-federation): add nx-runtime-library-control-plugin (#26816)
- feat(module-federation): use @module-federation/enhanced for
withModuleFederation
- feat(module-federation): expose API for users to override module
federation plugin options
- fix(module-federation): angular mf ssr projects should not create
vendor chunks
- feat(module-federation): add nx-runtime-library-control-plugin

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 common occurrence when working with NX Module Federation is that a
shared library may get resolved from a static remote.
Any changes to the shared lib are therefore not reflected in the dev
server.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add the `nx-runtime-library-control-plugin` to ensure that shared
libraries are shared from a remote that is served via
webpack-dev-server.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #11615
2024-07-17 22:46:14 -04:00
Jack Hsu 7f53e568bf fix(devkit): remove --web from being logged to show project details (#26968)
The `--web` option isn't needed in Nx 19 as it is the default. Updating
the devkit util to reflect that change.
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-17 19:56:11 -04:00
Juri 1f34788c75 feat(nx-dev): improve hero section on homepage 2024-07-17 13:32:53 -07:00
Juri Strumpflohner ad2dcba093 feat(nx-dev): add announcement pill on top of hero section (#26961)
Adds back the announcement pill on the hero section
2024-07-17 16:16:14 -04:00
Nicholas Cunningham fb02e3d0d5 fix(nx-dev): Navigating to blogs should work (#26972)
Before:

![Screenshot 2024-07-17 at 2 42
10 PM](https://github.com/user-attachments/assets/bbc60e06-98b0-4752-bb07-e7d206877dec)

After: 
![Screenshot 2024-07-17 at 12 54
04 PM](https://github.com/user-attachments/assets/062e2e9c-36df-45d6-91e6-7ac16040bc52)
2024-07-17 16:06:04 -04:00
Jason Jean 064eb714cf chore(repo): update nx to 19.5.0-beta.5 (#26925)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `19.4.0-rc.1`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `19.5.0-beta.5`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-17 11:12:21 -04:00
Isaac Mann a0baab0d47 docs(core): update nx connect feature page (#26957)
Fix the title of "Connect to Nx Cloud" to be consistent

Old inconsistent titles:
![Screenshot 2024-07-16 at 10 09
47 AM](https://github.com/user-attachments/assets/8122aa79-edaf-46a9-b278-a3c4e2fa214d)

Also adds a sentence explaining the `nx-cloud record` line in step 3,
since that isn't obvious what it is doing.
2024-07-17 08:08:12 -04:00
Johanna Pearce 3a40d37f5e fix(nx-dev): website copy corrections and changes 2024-07-17 02:28:46 -07:00
Jason Jean 039f91dde4 fix(core): disable isolation in wasm (#26960)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Something is causing plugin isolation to fail on wasm environments.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Plugin isolation is disabled on wasm environments pending a fix.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-16 18:12:46 -05:00
Emily Xiong ccb0d7d244 feat(gradle): change test glob to include Tests and Test (#26913)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-16 18:31:36 -04:00
Jason Jean fa83b36131 fix(core): properly handle reading target defaults (#26959)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 targets have executors, they cannot be matched with a glob pattern

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When targets have executors, they can still be matched with a glob if
the executor does not have target defaults set.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-16 17:25:32 -05:00
Jason Jean 87021ecb85 fix(core): decrease initial memory for wasm (#26956)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 fails to import Wasm if there is not 16 gigs of memory available
which is.. pretty often.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Nx fails to import wasm if there 1 gig of memory available which should
be not often.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-16 18:20:10 -04:00
Jason Jean 31bef6a85a fix(misc): finalize ab testing (#26958)
## Current Behavior
<!-- This is the behavior we have today -->

There is ab testing for different messages for connecting to cloud.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There is no ab testing for connecting to cloud prompts

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-16 16:10:52 -04:00
Benjamin Cabanes 85d310a8c2 feat(nx-dev): update home page (#26893)
Add new sections and update information about Nx.

---------

Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2024-07-16 15:43:41 -04:00
Craigory Coppola facfc147f8 fix(core): running just 'nx' should show help (#26871)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Running `nx` errors

## Expected Behavior
`nx` show's help

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-16 13:49:28 -04:00
Jason Jean 51f5fe4434 fix(core): merge package.json plugins and updated project.json plugin… (#26952)
… using v2

## Current Behavior
<!-- This is the behavior we have today -->

The `package.json` handling is split between before and after plugins so
it's confusing. Also, `package.json` nodes will get overwritten by
plugins while others won't.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `package.json` handling is merged. Also, the `package.json` nodes
will always overwrite plugins as intended.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-16 12:46:57 -05:00
Jack Hsu 1a9429643f feat(core): ci-workflow adds workflow file to sharedGlobal inputs (#26948)
When we generate the workflow file, users should also add the new
workflow file to the `sharedGlobals` named input, otherwise changes may
land without verifying that all tasks are successful.

This is already called out in the CI tutorials, and doing it
automatically improves the DX.

## 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-16 13:38:32 -04:00
Jack Hsu 34da542ce6 fix(rollup): always generate package.json when using @nx/rollup:rollup (#26940)
Prior to Nx 19.4, the `@nx/rollup:rollup` executor generates
`package.json` outside of the actual Rollup build. Nx 19.4 changed this
to be a proper Rollup plugin in order to support inferred targets
better. This led to a slight regression, where projects that override
`plugins` array in their `rollup.config.js` file will also remove the
`generatePackageJson` plugin.

This PR brings the behavior back, so the `package.json` file is _always_
generated regardless of how the `plugins` array is customized.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-15 16:33:05 -04:00
Philip Fulcher 46497356ce chore: migrate links to blog (#26892)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Blog links point to Medium and dev.to blogs
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Blog links point to internal blog
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-15 15:28:06 -04:00
Gunter Chou a41a8d68cf fix(linter): Correctly collect lintable files for project in @nx/eslint plugin (#26638) 2024-07-15 12:48:20 -04:00
Jason Jean f3fa705b82 fix(core): do not mutate target defaults (#26941)
## Current Behavior
<!-- This is the behavior we have today -->

Target defaults is mutated when the target is normalized. Subsequent
targets are normalized with the mutated version yielding the incorrect
projects configuration.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Target defaults is not mutated and all targets are correct.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-15 11:12:36 -05:00
MaxKless 33d2bece53 fix(misc): add NX_E2E_RUN_E2E env to e2eInputs (#26939) 2024-07-15 08:46:34 -06:00
Nicholas Cunningham 6f50d9f4c3 fix(nx-dev): Update Next.js version (#26912)
Fix nx-dev hmr not working.
2024-07-12 21:02:27 +00:00
Emily Xiong 39e104b6c3 feat(core): add parallelism to target configuration (#26820)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-12 16:35:45 -04:00
Jason Jean 37f0ccaa20 chore(repo): update freebsd publish to run on ubuntu and use latest f… (#26924)
…reebsd to fix issue

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

There's an issue with running `npm` when building on freebsd

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There are no issues building on freebsd

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-12 15:26:09 -05:00
Craigory Coppola 92d0e15d1f feat(core): pattern matching for target defaults (#26870)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
TargetDefaults can be specified by keys matching either executor or
target name only

## Expected Behavior
TargetDefaults can match based on a glob pattern that may match the
target name. This is useful for things like `e2e-ci--*`. Only 1 target
default will ever apply to a given target. We recognize this may be
confusing, but is inline with current handling. If no default matches
the target name or key, the first default that matches by pattern will
be used.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-12 16:25:32 -04:00
Nicholas Cunningham f2e1f0fad9 feat(nx-dev): Add more OSS logos (#26922) 2024-07-12 13:52:33 -06:00
Emily Xiong fc1c04918b feat(gradle): add help metadata (#26810)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-12 14:28:28 -04:00
Emily Xiong 638647d77c chore(core): add check to run macos tests if packages changed (#26894)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-12 14:22:26 -04:00
Emily Xiong aa7c5dc3ea chore(core): add unit tests for not connected to nx cloud (#26885)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-12 13:25:55 -04:00
Jason Jean adacd983b7 fix(misc): add more ab testing for setting up ci and nx cloud (#26907)
## Current Behavior

There is AB testing

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There is more AB testing

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-12 13:03:56 -04:00
Jonathan Cammisuli 26c3d21f1e docs(core): add documentation for "Explain With AI" (#26656)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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: Caleb Ukle <caleb@nrwl.io>
2024-07-12 11:40:57 -04:00
Nicholas Cunningham 82831bcee6 feat(nx-dev): add customers & company pages (#26813)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2024-07-12 11:22:35 -04:00
Craigory Coppola 0b0db782f7 fix(core): report should work if project graph errors (#26858) 2024-07-11 17:35:02 -04:00
Leosvel Pérez Espinosa 58ba1ffc6d feat(angular): support angular v18.1.0 (#26504)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Angular v18.1.0 is not supported.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Angular v18.1.0 should be supported.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-11 11:17:00 -04:00
Craigory Coppola 2c4c2ae8ca feat(core): enable plugin isolation by default (#26888)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-10 17:16:13 -04:00
Craigory Coppola b3d2d957a2 feat(core): avoid forking process for nx:noop (#26869)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
When we run a task with executor nx:noop we still fork a process for
that executor to run.

## Expected Behavior
`nx:noop` is a fixed executor which never does anything. We can skip
forking the process.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-10 17:01:35 -04:00
Jason Jean 1cb4f65210 fix(misc): properly set the value of the bitbucket option for ci work… (#26890) 2024-07-10 16:58:34 -04:00
Craigory Coppola a6fde9ba95 fix(core): load isolated plugins in parallel (#26874)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Plugins are not loading in parallel correctly

## Expected Behavior
Plugins should load in parallel

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-10 16:57:57 -04:00
Rares Matei 550de60446 docs(nx-cloud): bitbucket data center docs (#26862)
- Adds docs for the new bitbucket data center integration + auth
- Refactors some of the other integration docs to be consistent with
each other and link to the Helm repo where possible
2024-07-10 09:47:15 -06:00
Leosvel Pérez Espinosa e31b1689c4 feat(js): add createNodesV2 for typescript plugin (#26788)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 implementation for the `CreateNodesV2` API.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There should be an implementation for the `CreateNodesV2` API.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
<!-- Fixes NXC-790 -->
<!-- Fixes NXC-791 -->

Fixes #
2024-07-10 10:21:58 +02:00
Emily Xiong 2b7b5231fb feat(core): uncomment start-ci-run (#26645)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-09 19:22:50 -04:00
Jasper McCulloch 8fd38cba9a fix(vite): Only attempt to amend test object if one exists (#26822)
Test object is assigned using optional chaining but previously did not
check that any value had actually been assigned which would cause the
`getStart` call to fail resulting in a failed migration.

## Current Behavior
Migration fails if no matching test object is found.

## Expected Behavior
Migration should not fail.

## Related Issue(s)
I haven't opened an issue, just the PR. I can open an issue if required
for tracking.
2024-07-09 07:47:37 -06:00
Leosvel Pérez Espinosa 73858a094e fix(vue): bump vue-tsc version to 2.x.x (#26867)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Building a newly created Nuxt workspace/application fails with:

```bash
Nuxt Build Error: Cannot find module '@volar/typescript/lib/node/proxyCreateProgram'
```

This can be seen in current CI runs like the following:
https://staging.nx.app/runs/bszKddEenc/task/e2e-nuxt%3Ae2e-ci--src%2Fnuxt.test.ts.

This is happening because the `vite-plugin-checker` (used by Nuxt)
requires `vue-tsc@>=2.0.0`, but the `@nx/vue` plugin installs
`vue-tsc@^1.8.8`.

```bash
└─┬ nuxt 3.12.3
  └─┬ @nuxt/vite-builder 3.12.3
    └─┬ vite-plugin-checker 0.7.1
      └── ✕ unmet peer vue-tsc@>=2.0.0: found 1.8.27
```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Newly created Nuxt workspaces/applications should build successfully.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-09 15:33:36 +02:00
Jason Jean 92e09d9322 fix(misc): adjust nx cloud ab test (#26866)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->


![image](https://github.com/nrwl/nx/assets/8104246/98c3b475-d213-4e81-8c80-4010714ad4f7)


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->


![image](https://github.com/nrwl/nx/assets/8104246/2a67ae6b-2718-45f3-adfe-2dcc88c8ecbd)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-08 18:28:59 -04:00
Pavlo 3e0d2de468 feat(core): add support for wildcards in dependsOn (#19611)
Now it is possible to define targets like this:

```
{
  "targets": {
    "build-css": {},
    "build-js": {},
    "test": {
      "dependsOn": ["build-*"]
    },
  }
}
```

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
No support for wildcard target dependencies.

## Expected Behavior
This PR is an example of what I described here:
https://github.com/nrwl/nx/issues/19414.

## Related Issue(s)
Closes #19414

---------

Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
2024-07-08 18:16:01 -04:00
Ben Snyder 81fe13250a feat(linter): support eslint.config.cjs and *.cjs extension with flat config (#26637) 2024-07-08 12:51:13 -04:00
Craigory Coppola 3cbe2abc25 fix(core): ensure better create nodes error messaging (#26811)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
We see a stack trace pointing to where the aggregate create nodes error
is thrown rather than the messaging about the individual errors

<img width="911" alt="image"
src="https://github.com/nrwl/nx/assets/6933928/61907d8c-bb77-4a39-b55f-42fa38c0ed19">

## Expected Behavior
The message is shown

<img width="946" alt="image"
src="https://github.com/nrwl/nx/assets/6933928/f79f5aeb-e5b2-4ff1-9cbc-a7f10e8f910e">


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-08 09:57:10 -04:00
Emily Xiong 4ae16b361f fix(gradle): fix gradle exclude src/test (#26741)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-05 16:09:54 -04:00
LongYinan 981eb30a0f feat(core): support compile to wasi target (#22870)
This pull request is trying to add wasm32-wasi target support for the
nx/native

To test the build, you can run the following commands:

- `rustup target add wasm32-wasip1-threads`
- `pnpm exec napi build --release --platform --package-json-path
packages/nx/package.json --manifest-path packages/nx/Cargo.toml --js
./native-bindings.js -o packages/nx/src/native --target
wasm32-wasip1-threads`

And the wasm file will be built at
packages/nx/src/native/nx.wasm32-wasi.wasm

Blocked by:

- Support @napi-rs/cli 3.0  Cammisuli/monodon#48
- https://github.com/napi-rs/napi-rs/issues/2009

The pseudo_terminal mod is excluded on the wasm32 targets, which is as
expected.

The watch mod is excluded because of the upstream `watchexec` deps
introduced by ignore-files don't support the wasi target at this moment
(but we can improve it).

## Related Issues
Fixes https://github.com/nrwl/nx/issues/21860
Fixes https://github.com/nrwl/nx/issues/23821

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2024-07-05 15:55:35 -04:00
Jonathan Gelin 23ce6af2cc fix(nx-plugin): tslib is not set as a dependency when using create-package generator (#22429)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
The linting failed on clean `create-nx-plugin` generation:

![image](https://github.com/nrwl/nx/assets/954509/80bfbaeb-0994-48d9-a6dc-20f8f723a95d)

## Expected Behavior
After a clean generation, build, test, and lint should be successful

Co-authored-by: Emily Xiong <xiongemi@gmail.com>
2024-07-05 15:29:48 -04:00
Emily Xiong 62baf4f307 feat(gradle): gradle atomizer (#26663)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-05 15:22:37 -04:00
Naymi e15479b691 fix(core): recursive resolve deps on create command graph (#22989)
## introductory
<img width="620" alt="image"
src="https://github.com/nrwl/nx/assets/21343944/1ef5e2a2-0f65-4fde-aa7d-b52152af59a7">


## Current Behavior

```shell
nx exec --projects=my-node-app -- pwd
TypeError: graph.dependencies[id] is not iterable
    at _findCycle (/Users/anatolijfedorov/prjcts/tmp/nx-nest-workspace/node_modules/nx/src/tasks-runner/task-graph-utils.js:8:39)
    at _findCycle (/Users/anatolijfedorov/prjcts/tmp/nx-nest-workspace/node_modules/nx/src/tasks-runner/task-graph-utils.js:11:23)
    at findCycle (/Users/anatolijfedorov/prjcts/tmp/nx-nest-workspace/node_modules/nx/src/tasks-runner/task-graph-utils.js:23:23)
    at createCommandGraph (/Users/anatolijfedorov/prjcts/tmp/nx-nest-workspace/node_modules/nx/src/commands-runner/create-command-graph.js:25:52)
    at getCommandProjects (/Users/anatolijfedorov/prjcts/tmp/nx-nest-workspace/node_modules/nx/src/commands-runner/get-command-projects.js:7:72)
    at runScriptAsNxTarget (/Users/anatolijfedorov/prjcts/tmp/nx-nest-workspace/node_modules/nx/src/command-line/exec/exec.js:60:73)
    at Object.nxExecCommand (/Users/anatolijfedorov/prjcts/tmp/nx-nest-workspace/node_modules/nx/src/command-line/exec/exec.js:44:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.handler (/Users/anatolijfedorov/prjcts/tmp/nx-nest-workspace/node_modules/nx/src/command-line/exec/command-object.js:11:13)

```


## Expected Behavior

```shell
nx exec --projects=my-node-app -- pwd
/tmp/nx-nest-workspace/my-node-lib-2
/tmp/nx-nest-workspace/my-node-lib
/tmp/nx-nest-workspace/apps/my-node-app
```

Fixes https://github.com/nrwl/nx/issues/22994
Added function that resolves dependencies recursively

Co-authored-by: afedorov <afedorov@rvision.ru>
2024-07-05 14:21:06 -04:00
Jack Hsu 2baf672b61 docs(nx-cloud): update onboarding flow to use "nx connect" (#26842)
The new Nx Cloud onboarding flow is to run `nx connect` and follow the
prompts. There's no need to explain beyond that in the docs since the
flow is prone to changes in nx.app.
2024-07-05 14:19:04 -04:00
Colum Ferry a6522f71a1 feat(module-federation): use @module-federation/enhanced for withModuleFederation (#26777)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
We currently use the `ModuleFederationPlugin` from `webpack` itself. 
This doesn't receive the same attention as the new
`@module-federation/enhanced` package, which is where all new work by
Zack Jackson and Bytedance is being conducted.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Our `withModuleFederation` utils should use the
`@module-federation/enhanced` package.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
#26322 
Fixes #
2024-07-05 09:48:17 -04:00
Jack Hsu c7878533ed docs(misc): disable prefetch on page load for links (#26837)
This PR changes `<Link>` to use `prefetch={false}` in the following
components:

1. Header
2. Sidebar
3. Docs header
4. Markdown content

This means that prefetch happens on hover of the link rather than page
load, and will reduce the amount of edge requests made from the app.

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-05 09:29:08 -04:00
Jack Hsu 653cad2492 feat(react): add support for React Compiler in @nx/react/babel (#26826)
This PR adds a check in `@nx/react/babel` preset to enable React
Compiler when `babel-plugin-react-compiler` is installed.

This affects:

- React apps using Webpack + Babel
- React libs using Rollup + Babel
- React Native apps using Webpack + Babel

If SWC is used, there is no way to use React Compiler currently.

Also adds a [new
recipe](https://nx-dev-git-feat-react-compiler-nrwl.vercel.app/recipes/react/react-compiler)
showing how to enable the compiler using `@nx/react/babel`.

## 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-04 16:18:34 -04:00
Jack Hsu 7caf9017f0 feat(react-native): update react-native-svg to 15.3.0 (#26827)
There's a bug in 15.2.0 so this PR updates the version. See:
https://github.com/software-mansion/react-native-svg/issues/2241#issuecomment-2115255421

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-04 15:27:28 -04:00
Emily Xiong 311710e56c feat(graph): add copy button for entire target configuration (#26284)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
<img width="540" alt="Screenshot 2024-07-03 at 5 29 12 PM"
src="https://github.com/nrwl/nx/assets/16211801/bed98c56-3bd5-4170-893b-cefe5fe292f9">

<img width="1195" alt="Screenshot 2024-07-03 at 5 29 03 PM"
src="https://github.com/nrwl/nx/assets/16211801/544a4c4e-299f-40fc-a767-215d9c758dd8">



## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-04 10:16:13 -04:00
MaxKless e09bad9363 fix(core): ignore errors from cleanupNativeFileCache (revert to previous behaviour) (#26806) 2024-07-04 14:59:16 +02:00
Nicholas Cunningham 295c4229db fix(node): Enable e2e test (#23508)
Re-enables e2e tests for node 

Docker changes to be merged first: https://github.com/nrwl/nx/pull/26365
2024-07-04 08:57:27 -04:00
Juri Strumpflohner 929a57c127 feat(nx-dev): update next to fix img fetchpriority error (#26766)
## Current Behavior

`fetchpriority` attribute error in Next image loading cmp. 

<img width="1260" alt="image"
src="https://github.com/nrwl/nx/assets/542458/9ba9f539-e0ad-4fe1-9a6a-64db856fd25c">

## Expected Behavior

Upgrading patch version of next fixes it.

//Edit: some context:
https://github.com/vercel/next.js/issues/65161#issuecomment-2087899325

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-04 08:53:32 -04:00
Juri Strumpflohner 6ce107d6e1 fix(nx-dev): plugin-registry menu (#26767)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 on https://nx.dev/plugin-registry the side-bar menu doesn't open on
mobile.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Should obviously open. Also adjusted the top-level header menu
"Documentation" -> "Docs" (just sounds better)

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-04 08:19:31 -04:00
Jason Jean 28939dd982 fix(core): always inherit output from plugins (#26797) 2024-07-03 17:04:59 -04:00
Jack Hsu 8cf96cc5b2 fix(core): register swc transpiler once per compilerOptions (#26807)
Apply the same patch for `@swc-node/register` that we did for `ts-node`.
This prevent errors during graph construction.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #26798
2024-07-03 14:55:48 -04:00
Craigory Coppola 2ae57dcfbe feat(core): move target defaults back to post graph step (#26596)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
We moved target defaults to a graph plugin around the release of Nx 18.
It never fit really perfectly, but because we wanted to apply them
before project.json / package.json configuration results which **_are_**
plugins and do make sense as a plugin it made sense at the time.

## Expected Behavior
We want to expand the behavior of target defaults in the near future to
better handle pattern matching. In doing this, we need more flexibility
in how its applied and that process will need to be aware of which
targets are going to be created by plugins. As such, we are moving it
back to being a post-step in the project configuration construction.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-03 14:50:12 -04:00
Isaac Mann 65c3e560e2 docs(core): react standalone tutorial (#26304)
Update the react standalone tutorial to start from `npm create vite --
--template=react-ts`
2024-07-03 14:34:56 -04:00
EugeneKruglei 6e84cbfac0 fix(core): cannot read properties of undefined (reading 'options') (#26721) 2024-07-03 14:10:08 -04:00
Isaac Mann 7cd35e0ca1 docs(core): sync top menu features with sidebar (#26814)
- Syncs top menu features drop down names with sidebar
- Moves Setup enterprise feature under Enterprise -> On Premise
- Collapse concepts section in CI tab
2024-07-03 14:04:58 -04:00
Isaac Mann fa3c5c42cd docs(core): vue cli tutorial (#26451)
Update the Vue standalone tutorial to start from a Vue CLI generated
project
2024-07-03 10:19:55 -04:00
Leosvel Pérez Espinosa adb81afa91 fix(js): normalize excluded paths to task inputs correctly in typescript plugin (#26801) 2024-07-03 14:26:17 +04:00
Katerina Skroumpelou 4c76b95271 fix(nx-cloud): onboarding cloud version handling (#26790)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-02 20:26:36 +03:00
Colum Ferry 54036397c8 fix(testing): pin cypress to 13.12.0 and re-enable skipped tests (#26751) 2024-07-02 11:46:00 -04:00
Colum Ferry 8f65944405 fix(vite): remove deprecated cache.dir from vitest generation (#26756)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `cache.dir` option for `vitest` is deprecated in favour of
`config.cacheDir` which we already generate.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Remove the deprecated option

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-02 16:24:00 +01:00
Jason Jean 0eed1bdf2c chore(repo): use the async api of getJestProjects (#26792)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses `getJestProjects` rather than `getJestProjectsAsync`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses `getJestProjectsAsync`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-02 09:49:46 -04:00
Jason Jean cf396f71a9 chore(repo): update nx to 19.4.0-rc.1 (#26763)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

This repo uses Nx `19.4.0-rc.0`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `19.4.0-rc.1`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-07-02 09:16:21 -04:00
MaxKless 86da1b5936 fix(gradle): pass process.env when running gradle (#26776) 2024-07-01 17:19:59 +02:00
Isaac Mann de68084db2 docs(core): add jonathan gelin to champions (#26779)
Adds Jonathan Gelin (@jogelin) as an Nx Champion
2024-07-01 09:43:36 -04:00
Jason Jean b2feceae4f fix(core): do not re-register ts-node twice for the same compiler opt… (#26758) 2024-06-28 16:38:22 -04:00
Caleb Ukle 22aa2d9a81 docs(nx-cloud): improve launch template docs with new image release (#26757)
- add info about `ubuntu22.04-node20.11-v9` image
- add debugging template starter
- add nvm to custom node section


https://nx-dev-git-docs-nx-agent-image-v9-nrwl.vercel.app/ci/reference/launch-templates
2024-06-28 13:17:16 -05:00
Isaac Mann 8935b18f57 docs(core): contact dpe for eu cluster (#26753)
Adds note explaining that enterprise customers need to work with their
DPE to use the EU hosted version of Nx Cloud
2024-06-28 13:30:51 -04:00
Isaac Mann 826f28fe08 docs(core): link to add plugin instructions 2024-06-28 19:09:22 +02:00
Maciej Łyskawiński 5245bedc41 fix(js): node executor now correctly kills tasks when exiting (#19219)
Previously, the node executor od @nx/js did not kill spawned processes
due to not awaiting finishing of killing and infinite loop.
This fix allows for seemless running nx in docker containers with
support for signals

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
When killing nx running `@nx/js:node`, child processes are not killed

## Expected Behavior
Child processes should be killed
2024-06-28 12:36:40 -04:00
Jack Hsu 31989c4d1e docs(core): clean-up outdated content from docs and CNW readme (#26748)
This PR:

1. Removes the `{{getting-started}}` template string from [CNW
README.md](https://www.npmjs.com/package/create-nx-workspace), which was
removed before from generation but this file missed an update.
2. Updates docs for `run-scripts` to show `project.json` examples, not
`workspace.json` (we link to this from PDV and it's very awkward).
3. Removes unused run-script and run-commands example files from
`packages/workspace/docs`. These were moved to `packages/nx/docs` but
somehow the old files remained even though they aren't used.
4. Updates host/remotes React generators to mention `nx.json` not
`workspace.json`. The option is already renamed `--skipNxJson` but the
description does not match.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-28 11:15:44 -04:00
Jack Hsu 412dade3b7 fix(vite): infer build and serve targets when rollupOptions.input is present (#26750)
This PR adds a check for `build.rollupOptions.input` in addition to
`build.rollupOptions.inputs`. Plugins like `sveltekit()` will use the
former property, and we should infer build/server targets correctly in
those cases.

## Current Behavior
`sveltekit()` is not supported

## Expected Behavior
`sveltekit()` and other setups using `input` are supported

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-28 11:15:03 -04:00
Jack Hsu e292500ef2 fix(misc): respect useInferencePlugin in nx.json when generating apps and libs (#26703)
The `@nx/vue:app` and `@nx/vue:lib` generators do not respect
`useInferencePlugins` set in `nx.json`. This PR fixes the generators.
Same for `@nx/rollup:init`.
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-28 09:49:47 -04:00
Miroslav Jonaš fdd89a6fe2 fix(core): handle packageManager property with createPackageJson (#26726)
This PR was originally authored by @stephenwade. It adds the `packageManager` property to the `createPackageJson` function that ensures the generated `package.json` uses the same package manager that was used when generating it.

## 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: Stephen Wade <stephen@stephenwade.me>
Co-authored-by: Stephen Wade <stephen.wade@avb.net>
2024-06-28 13:48:39 +02:00
Jason Jean 336d371ceb fix(testing): only add atomizer label for parent atomizer task (#26740)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Atomizer is shown for all split targets

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Atomizer is shown for only the parent atomizer target.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-27 15:03:29 -07:00
Jason Jean 5364e27d68 fix(gradle): fix migrations (#26739)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Gradle migrations aren't added properly.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Gradle migrations run

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-27 17:00:16 -04:00
James Henry dcaa0867e3 fix(core): do not load transpiler when within tsx environment (#26723) 2024-06-27 16:47:28 -04:00
Jason Jean a8742539e6 chore(repo): update nx to 19.4.0-rc.0 (#26728) 2024-06-27 16:22:02 -04:00
Juri Strumpflohner 6761091182 docs(misc): move videos further down because it looks weird (#26727)
Moves the videos further down in the blog post as otherwise the blog
thumbnail and video (which has the same) follow one after the other
which looks super weird.
2024-06-27 14:45:02 -04:00
Craigory Coppola 66140faeec fix(core): prevent cmd popups from isolation (#26730)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Isolation uses `fork` which can cause popups on windows

## Expected Behavior
Isolation uses `spawn` which doesn't cause popups when used with
windowsHide.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-27 14:42:40 -04:00
scottpledger f5c8eda6e1 fix(core): correctly detect Windows Bamboo agents as CI environments (#26699) 2024-06-27 14:28:31 -04:00
MaxKless 7f1e351cbb fix(graph): update atomizer metadata & pdv hint (#26733)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-27 14:28:21 -04:00
Jack Hsu c75e7ef683 fix(nextjs): fixes for convert-to-inferred (#26735)
…nferred

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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: Nicholas Cunningham <ndcunningham@gmail.com>
2024-06-27 13:58:16 -04:00
Jack Hsu d90a735540 feat(core): add --help content to project details view (#26629)
This PR adds help text for each inferred target that provides
`metadata.help.command`. To pass options/args to the target, users are
directed to open `project.json` and copy the values from `--help` output
into `options` property of the target.

To display the options help section, the inferred target must provide
metadata as follows:

```json5
 metadata: {
      help: {
        command: `foo --help`
        example: {
          options: {
            bar: true
          },
        },
      },
    },
```

The `help.command` value will be used to retrieve help text for the
underlying CLI (e.g. `jest --help`). The `help.example` property
contains sample options and args that users can add to their
`project.json` file -- currently rendered in the hover tooltip of
`project.json` hint text.

---

Example with `vite build --help`:

<img width="1257" alt="Screenshot 2024-06-21 at 3 06 21 PM"
src="https://github.com/nrwl/nx/assets/53559/b94cdcde-80da-4fa5-9f93-11af7fbcaf27">


Result of clicking `Run`:
<img width="1257" alt="Screenshot 2024-06-21 at 3 06 24 PM"
src="https://github.com/nrwl/nx/assets/53559/6803a5a8-9bbd-4510-b9ff-fa895a5b3402">

`project.json` tooltip hint:
<img width="1392" alt="Screenshot 2024-06-25 at 12 44 02 PM"
src="https://github.com/nrwl/nx/assets/53559/565002ae-7993-4dda-ac5d-4b685710f65e">
2024-06-27 13:33:35 -04:00
Uzhanin Egor df83dd4c6e feat(core): added the ability to split command property into an array in nx:run-commands executor (#20201)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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

In projects, you can often find teams that are too long. Example here:

```json
 "run:dev": {
    "executor": "nx:run-commands",
    "options": {
      "command": "docker compose -f .docker/compose/docker-compose.services.yml -f .docker/compose/docker-compose.dev.yml --project-directory . up -d"
    },
    "dependsOn": ["update:dev"]
  }
```
## Expected Behavior

Implemented splitting of the 'command' parameter, added the ability to
pass it as an array to avoid such *huge* strings:

```json
"run:dev": {
    "executor": "nx:run-commands",
    "options": {
      "command": [
	"docker compose -f",
        ".docker/compose/docker-compose.services.yml -f",
	".docker/compose/docker-compose.dev.yml",
	"--project-directory . up -d"
      ]
    },
    "dependsOn": ["update:dev"]
  },
```
Added a couple of tests and changed schema.json to 'run-commands'
executor.
2024-06-27 12:47:27 -04:00
Emily Xiong 412a450dae fix(expo): should support app.config.ts (#26713)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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/26467
2024-06-27 12:37:22 -04:00
Colum Ferry 2a803158ef chore(testing): disable cypress test (#26734)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-27 12:10:50 -04:00
Emily Xiong 5e022951da fix(graph): fix empty target group (#26704)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-26 at 2 56
04 PM](https://github.com/nrwl/nx/assets/16211801/d9cc93db-06a2-4c30-b88a-3054edfb619a)

when the others group are empty, it shows the container.
move the check to
graph/ui-project-details/src/lib/target-configuration-details-group-container/target-configuration-details-group-container.tsx.

## 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-06-27 11:51:43 -04:00
Nicholas Cunningham 4197a91845 feat(nextjs): Add convert-to-inferred generator (#26706)
This PR enables the ability to migrate project(s) from using nextjs
executors to inferred targets.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-06-27 11:21:35 -04:00
Miroslav Jonaš 7f8bb4ba1f fix(linter): dependency checks should respect pnpm workspace versions (#26709)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #26707
2024-06-27 17:19:35 +02:00
Colum Ferry 5843068d3b fix(vue): application generator should use normalized app name #26605 (#26729)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 `vue` app generator is not using the normalized name produced by
`projectRootAndFormat` util when creating the application.
This leads to errors in some cases.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use the `projectName` produced by the value to create the project
correctly.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26605
2024-06-27 15:48:37 +01:00
Altan Stalker 544eff02b4 fix(nx-cloud): do not use bff api for onboarding (#26712)
## Current Behavior
CLI uses BFF

## Expected Behavior
CLI should not use BFF
2024-06-27 10:41:40 -04:00
Katerina Skroumpelou 88efb216a2 fix(misc): restrict countries not supported by OpenAI (#26725)
Restrict countries that are not supported by OpenAI APIs:
https://platform.openai.com/docs/supported-countries


![Screenshot 2024-06-27 at 3 58
47 PM](https://github.com/nrwl/nx/assets/6603745/54a82c41-57b3-408e-a79e-c5907d8de193)
2024-06-27 17:11:26 +03:00
MaxKless 0cefa29eca fix(core): add windowsHide for depencies-and-lockfile plugin with bun (#26718)
## Current Behavior
Using bun as a package manager on windows causes cmd windows to pop up
when the project graph is computed.

## Expected Behavior
We shouldn't see any windows pop up.

## Related Issue(s)

Fixes https://github.com/nrwl/nx-console/issues/2149
2024-06-27 14:18:27 +02:00
Miroslav Jonaš acddf894a4 fix(core): fix create package json root parsing (#26717)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-27 12:12:28 +02:00
Katerina Skroumpelou 9aca5f30f2 fix(nuxt): api template typo (#26719)
Typo in the `nuxt` server api template.
2024-06-27 12:43:34 +03:00
Jason Jean c2c6a13514 fix(core): do not create projects twice from package.json (#26700)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

NPM scripts show up twice in the project details view.


![image](https://github.com/nrwl/nx/assets/8104246/98c55a03-7e71-430f-9fc3-de91ce180e26)


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

NPM scripts only show up once in the project details view.


![image](https://github.com/nrwl/nx/assets/8104246/27787794-a8ef-40be-b00a-c9b1d26182f2)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-26 17:31:49 -04:00
Craigory Coppola a0e8f83672 fix(core): move plugin worker to socket (#26558)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-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 isolation communicates with workers via built-in node IPC with
forked processes. When doing this, the parent process will not exit
until the child process has exited, in case more messages would be sent.
This requires an explicit call to shut down the plugin workers.

We set this up as a `process.on('exit')` listener, to shutdown the
workers whenever the main Nx process dies. This is "fine", but requires
explicit calls to `process.exit` as node won't exit on its own
otherwise.

## Expected Behavior
To allow plugin workers to clean themselves up on exit, but not require
explicit `process.exit` calls, we need to detach them from the main
process and call `unref`. This only works when IPC is not being used. As
such, we need a different way to communicate with the worker.

This PR updates the communication method to mirror the daemon, and
communicate over a socket. Additionally, this PR enables isolation
during the Nx repo's E2E tests.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-26 17:31:10 -04:00
Ilya Zyablitsev 24cc86b96f docs(core): update @nxext/ionic-* plugins github link (#26705)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
wrong link to @nxext/ionic-angular and @nxext/ionic-react plugins in
plugins registry

## Expected Behavior
correct link to @nxext/ionic-angular and @nxext/ionic-react plugins in
plugins registry

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-26 16:56:10 -04:00
dfr-exnaton 0ca7df7495 feat(nextjs): add experimental-build-mode option to support compile only (#26465)
## Current Behavior

The nextjs build executor does not support all build flags such as
`--experimental-build-mode` (see
https://nextjs.org/docs/app/api-reference/next-cli#build).

## Expected Behavior

For certain deployment models (e.g. mult-environment builds), it is
helpful to only compile but not generate pages at build time. See
https://github.com/vercel/next.js/discussions/46544 for a discussion.

---------

Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
2024-06-26 14:54:49 -06:00
Jack Hsu 86412cb99a fix(webpack): add comment to explain useLegacyNxPlugin and how to remove it (#26696)
This PR adds a comment when `useLegacyNxPlugin` is used so users know
what it is, and how they can remove it.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-26 14:44:21 -04:00
Jack Hsu 04bb1f7cd9 docs(core): add troubelshooting guide for convert-to-inferred migrations (#26630)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-26 14:15:09 -04:00
Katerina Skroumpelou 92be32c1a8 feat(nx-cloud): unhide new onboarding flow 2024-06-26 07:50:30 -07:00
Katerina Skroumpelou d928558bc4 feat(nx-cloud): updates to the new onboarding flow 2024-06-26 07:50:30 -07:00
Emily Xiong 88fd03be3b fix(core): expand env variables on load and unload (#26459)
This pr is meant to replace https://github.com/nrwl/nx/pull/22585 and
https://github.com/nrwl/nx/pull/20524

Env variables using other variables were not unloaded from the
environment and further customizations were impossible in more specific
env files.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## 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/23581

Co-authored-by: Mateo Tibaquira <nestormateo@gmail.com>
2024-06-26 10:19:57 -04:00
Leosvel Pérez Espinosa 7ba49ffc41 fix(linter): handle eslint flat config path correctly in lint executor (#26687)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #26424
Fixes #26586 
Fixes #26532
2024-06-26 10:19:35 -04:00
MaxKless 6528da3bd8 feat(graph): add atomizer label to target groups (#26622)
## Current Behavior
Atomized Groups are treated just like any other groups in the PDV

## Expected Behavior
We want to let people know that something was created by the Atomizer
and also surface more information to users.
2024-06-26 10:17:59 -04:00
Colum Ferry ce3f7f4ed8 fix(module-federation): dynamic remotes external to workspace should be skipped correctly #26551 (#26692)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 utils were not checking if the remotes defined
dynamically in the `module-federation.manifest.json` were in the project
graph.



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Check that the dynamic remotes exist in the project graph before trying
to do work with them

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26551
2024-06-26 10:09:17 -04:00
Leosvel Pérez Espinosa d3383caad3 fix(testing): accept a numeric value for the playwright executor's workers option (#26689)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #26437
2024-06-26 10:08:39 -04:00
Jack Hsu c24c20e990 fix(linter): ensure that @nx/eslint-plugin is installed when we add an extracted base eslintrc file (#26679)
The current eslint logic doesn't add the necessary `@nx/eslint-plugin`
package when we extract root config. This PR fixes the issue. This
applies to projects not generated using CNW but rather using something
like `npm create vite`, where the eslint setup isn't what we expect.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-26 12:38:31 +02:00
Colum Ferry 81dced7252 fix(angular): migration of browserTarget to buildTarget should handle empty config #26681 (#26690)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 migration from `browserTarget` to `buildTarget` assumed config would
not be undefined.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The migration should check if config is undefined

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26681
2024-06-26 10:12:24 +01:00
Leosvel Pérez Espinosa a871643b37 fix(angular): allow usages of ecmascript decorators in ng-packagr executors (#26691)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #26448
2024-06-26 09:06:08 +00:00
Josh Kim 93b3e2142c fix(module-federation): module-federation-dev-server hang caused by child process exiting too early (#26684) (#26685)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
See #26684 

## Expected Behavior
See #26684

Fixes #26684 

---

This fix is targeted at NX 19. For a backport to NX 18, a small, trivial
change is necessary. I will file another PR targeting NX 18.

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2024-06-26 10:04:55 +01:00
Thomas Dekiere 1e41672e6a fix(remix): don't add @remix-run/eslint-config dependency to new remix apps (#26568)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When a new remix app is generated with @nx/remix, it can't be installed
due to peer dependencies that are introduced by
@remix-run/eslint-config. This dependency though is not used in the nx
workspace and has also been removed from the official create-remix
method.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Running `npm install` should not throw errors after a remix application
was added to the nx workspace.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26540
2024-06-26 09:40:45 +01:00
James Henry 3a2e8d45f5 feat(release): allow disabling GitHub username matching in default changelog renderer (#26672) 2024-06-25 13:46:15 -04:00
Colum Ferry b42b6f7dbe fix(vite): incremental builds tmp tsconfig should have baseUrl set to workspace root (#26680)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 nxViteTsPaths resolves the tmp tsconfig we create for the buildable
libs, it uses the absoluteBaseUrl of the tsconfig to when creating the
ESM matcher for resolving files.
There is no baseUrl set, therefore the absoluteBaseUrl becomes the
directory of the tmp tsconfig
This means the paths to the built artifacts are incorrect


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use the workspace root, which lines up with the output locations for
built artifacts, for the baseUrl for the tmp tsconfig


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-25 18:15:23 +01:00
James Henry d356f61192 fix(release): skip dependents of projects without changes in conventional commits (#26671) 2024-06-25 12:56:23 -04:00
Colum Ferry e04b5761de fix(vite): setup-paths-plugin should only register import once (#26678)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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:setup-paths-plugin` generator is adding the import
multiple times


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `@nx/vite:setup-paths-plugin` should only add the import when it
does not exist

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-25 17:33:46 +01:00
Emily Xiong 6ebf676b5e fix(graph): fix search params reload when back to graph (#26580)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
- change useIntervalWhen
- when this function is used, it is mostly calling a fetch request,
change it to take an async function
- wait for the current fetch request to finish before firing the next
one
  - change the name to usePoll
- currently, when going back to graph, it needs to remove the search
params expand and sometimes need to add ?project= search params
- delete expand search params is called after adding the project search
params
  
```

 setSearchParams(
        (currentSearchParams) => {
          currentSearchParams.delete('expanded');
          return currentSearchParams;
        },
        { replace: true, preventScrollReset: true }
      );

```


this function does not contain the ?project= search param key, caused
the graph page to reload twice
- change the function useRouteConstructor to delete the search params
`expanded` there


## 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-06-25 10:05:05 -04:00
Leosvel Pérez Espinosa 89fbde996f fix(bundling): register plugin correctly in rollup migration generator (#26673)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-25 15:53:38 +02:00
Leosvel Pérez Espinosa c936f864b8 fix(misc): register plugins correctly in migration generators (#26670)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 NXP-816 -->

Fixes #
2024-06-25 08:33:24 -04:00
Leosvel Pérez Espinosa 8872ca5c8f fix(angular): fix chalk import and correctly skip invalid projects in ng-add generator (#26667)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 #26654
2024-06-25 10:37:31 +02:00
Leosvel Pérez Espinosa 47dfdcfc6b feat(webpack): add convert-to-inferred generator (#26621)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-06-24 21:13:24 -04:00
Jason Jean a3322f76ef fix(bundling): use vite createNodes v2 for add plugin (#26662)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

vite createNodesV1 is used during init

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

vite createNodesV2 is used during init

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-24 13:33:12 -07:00
Emily Xiong 0e7e4690f2 feat(gradle): support composite build (#25990)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
![Workspace Project Graph
(2)](https://github.com/nrwl/nx/assets/16211801/9776a642-16c6-45ee-a253-cfc4b86a12a8)



## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-24 16:05:32 -04:00
Craigory Coppola 3b2c42a8a5 fix(core): isolated plugins should provide cleanup function (#26657)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
- Isolated plugins return no-op cleanup function.

## Expected Behavior
- Isolated plugins cleanup fn shuts them down.

## Related Issue(s)
In #26625 we are starting to reload plugins when their configurations
change. This makes sense, but means we should actually shutdown + reload
workers.

Fixes #
2024-06-24 15:22:31 -04:00
Jason Jean cb4cff7251 fix(core): pick up changes to plugins configuration in daemon (#26625)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 previous set of plugins are reused even when the plugins
configuration change (plugins are added/removed or have their options
changed).

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Plugins are cleaned up and reloaded when the plugins configuration
change.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-24 14:06:28 -04:00
Jack Hsu 8e4db82709 fix(bundling): rename aliases for @nx/rollup:convert-to-inferred generator (#26659)
If you use `entryFile`, `f`, or `exports` in `project.json`, these
fields do not migrate correctly to `rollup.config.js`.

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-24 13:50:18 -04:00
MaxKless dece9afc0d feat(core): add lifecycle to record task history & retrieve via daemon (#26593)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-24 10:22:15 -04:00
Colum Ferry 65e0cb90de fix(storybook): output should match CLI flag (#26652)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Output option is not renamed to match CLI flag

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Output option shuold be renamed to match CLI flag

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-24 14:25:30 +01:00
MaxKless 8efe26c99a fix(core): repair sourcemaps that had file & plugin swapped (#26628) 2024-06-24 07:19:00 +00:00
Nicholas Cunningham 963f753ae8 fix(webpack): skip useLegacyNxPlugin during graph creation (#26626) 2024-06-21 11:14:12 -06:00
Colum Ferry f8ffc05e8d fix(bundling): convert to inferred should handle config file (#26619)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-21 11:32:04 -04:00
Leosvel Pérez Espinosa f66ac74b64 fix(webpack): handle nullable plugin options (#26624)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-21 17:06:48 +02:00
Colum Ferry b1713be2c3 feat(remix): add convert-to-inferred generator (#26601)
- feat(remix): add convert-to-inferred migration
- feat(remix): add serve executor logic

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-21 11:01:53 -04:00
Juri efd0994ee6 docs(nx-dev): update monorepo world links 2024-06-21 15:17:14 +02:00
Colum Ferry 18fdd9425b feat(storybook): add convert-to-inferred generator (#26595)
- feat(storybook): add convert-to-inferred generator
- feat(storybook): add post target transformers
- feat(storybook): convert-to-inferred handles kebab case flags

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-21 09:01:30 -04:00
Nicholas Cunningham b1dbf47aa2 feat(webpack): add convertConfigToWebpackPlugin (#26516)
This PR introduces functionality for users who currently use the
`withNx` and `withReact` plugins in their webpack configuration to
migrate to the `NxAppWebpackPlugin`.

The `nxUseLegacyPlugin` wraps the legacy style function so that it
continues to work with the standardized generated webpack config.

By implementing this change, the aim is to provide a consistent method
for users opting to transition to inferred targets. This ensures a
smoother migration process, offering better integration and reducing
potential configuration complexities.
2024-06-21 08:55:23 -04:00
Isaac Mann 1d1c699c81 docs(core): small tutorial updates (#26559)
Update the npm workspaces, react monorepo and angular monorepo tutorials
2024-06-21 07:40:14 -04:00
Isaac Mann 5b44085c81 docs(core): remove tasksRunnerOptions (#26615)
Remove the tasksRunnerOptions section in the nx.json docs
2024-06-21 07:40:05 -04:00
James Henry 472459d9f5 chore(repo): allow e2e workflows to publish relative versions (#26609) 2024-06-21 00:11:35 +04:00
Caleb Ukle 7699b33ea1 fix(nx-dev): allow linking to headers that are code wrapped (#26608)
before if a header that was using `code` in the title (i.e. launch
template) the header should so the link icon but would not link anywhere
because the rendered id tag would be an empty string

![empty id tag for
headers](https://github.com/nrwl/nx/assets/23272162/6ee2aa5f-7b1f-4a98-ad11-2e088dd5c36d)

after the id tag is correctly linked by checking the rendering children
contains a `code` tag and pulls the code children out.

added benefit includes the code headers being linked in the side nav
correct too

![side by side diff with
changes](https://github.com/nrwl/nx/assets/23272162/c4f7a166-44fa-4541-ae72-d095962bee5b)



Example showing working from preview:
https://nx-dev-git-docs-allow-linking-code-headers-nrwl.vercel.app/ci/reference/launch-templates#launchtemplatestemplatenameinitsteps
2024-06-20 13:00:26 -05:00
Jack Hsu 86954ae96b fix(misc): rename @nrwl/* to @nx/* in init generator descriptions (#26610)
We forgot to rename these in the init generator descriptions. This
affects tutorials since we've been including the terminal output with
the wrong scope.


## 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-06-20 13:08:39 -04:00
Juri bb3658a809 docs(misc): adjust blog urls 2024-06-19 22:21:01 +02:00
Leosvel Pérez Espinosa c15ac1b9ca fix(testing): handle different jest config files in configurations when migrating to inferred (#26591)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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-06-19 09:14:28 +02:00
Emily Xiong 5646b38c99 feat(expo): add to project package.json for install command (#26500)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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/22393
2024-06-18 21:09:04 -04:00
Emily Xiong fe30d02109 fix(expo): fix expo start windows (#26493)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
- interactive command does not work on windows, use executor instead

## 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/24138
2024-06-18 21:08:04 -04:00
Leosvel Pérez Espinosa 95a6e6864d feat(webpack): add createNodesV2 for plugin (#26588)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 implementation for `createNodesV2`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

There should be an implementation for `createNodesV2`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-18 15:06:08 +02:00
Leosvel Pérez Espinosa df3c7522ea feat(testing): add convert-to-inferred migration generator for jest (#26259)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-18 05:59:30 -07:00
Tycho Bokdam e5d7805d4b chore(core): nx plugin submissions @nx-extend/docusaurus (#26578) 2024-06-17 12:51:09 -04:00
Jack Hsu 09a08c6cef fix(graph): improve layout when target groups are empty or there are no groups (#26555)
This PR fixes empty target groups and adds consistency between grouped
and ungrouped targets.

## Before

Empty groups have bad empty state -- we should not show it. The
ungrouped targets being on their own without a group is also
inconsistent.

<img width="1153" alt="Screenshot 2024-06-14 at 9 46 11 AM"
src="https://github.com/nrwl/nx/assets/53559/b6e96187-fc6f-4c3f-9b45-39744d02b0ec">

## After

If group is empty, don't render it. Also, if there are no groups then
don't nest the ungrouped targets.

<img width="1190" alt="Screenshot 2024-06-14 at 9 46 29 AM"
src="https://github.com/nrwl/nx/assets/53559/76cd0b32-532b-470d-ad2f-85fc3aaf3997">

If there are groups, put the ungrouped targets into `Others`.

<img width="1152" alt="Screenshot 2024-06-14 at 9 45 55 AM"
src="https://github.com/nrwl/nx/assets/53559/465e64c7-e376-4555-b580-d6ecaafb61f5">
2024-06-17 09:28:58 -07:00
Leosvel Pérez Espinosa 59ab43ab79 fix(core): merge args and options in nx:run-commands executor (#26573)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

When a target using `nx:run-commands` has the `args` option set, the
rest of the options are completely ignored and not forwarded to the
command.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When a target using `nx:run-commands` has the `args` option set, the
rest of the options that don't match any of the options set in `args`
and are not specific to the executor should be forwarded to the command.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
<!-- Fixes NXP-811 -->

Fixes #
2024-06-17 16:35:17 +02:00
Colum Ferry 44565262a6 fix(vite): nxViteTsPaths plugin should not run-many for vitest (#26574)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
`nxViteTsPaths` does not check if the mode is test and only filters the
`run-many` command based on whether Vite's config.command === serve.

Vitest will set `config.command` to serve, even for `test` targets.
It does set `mode = test` however.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When `mode === test`, we do not invoke `nx run-many`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-17 06:52:28 -07:00
Nicholas Cunningham c467129758 fix(nest): Add missing props (#26534)
Add missing props back to the schema so that they can be
defaulted/overwritten.


closes: #26384
2024-06-17 06:23:11 -07:00
Pavlo Grosse 15b7e9f079 feat(angular): add helper function to devkit to add viewProviders to a component (#26526)
## Current Behavior

Angular Nx utils have `addProviderToComponent` function to add a
provider to an Angular component, but are missing a function to add
viewProviders.

## Expected Behavior

There should be a function like `addProviderToComponent` to add view
providers to a component.

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2024-06-17 10:51:49 +02:00
Craigory Coppola f431d0a6a1 feat(core): allow defining target with only dependsOn (#26545)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
You must specify either `executor` or `command`, otherwise the target is
removed.

## Expected Behavior
If a target specifies `dependsOn` it is not removed.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-14 16:49:09 -04:00
Callum Silcock df2ff2ded2 docs(misc): add .nx/workspace-data to .gitignore in manual setup (#26520)
folder is created during install but is not required to be committed

feel free to close if not required

resolves #26519

---------

Co-authored-by: Isaac Mann <isaacplmann@gmail.com>
2024-06-14 16:38:41 -04:00
Colum Ferry b36c39e331 feat(vite): add convert-to-inferred migration generator (#26249)
- feat(vite): add convert-to-inferred generator for migrating to
inference
- feat(vite): add build postTargetTransformer
- feat(vite): add serve, preview, test postTargetTransformer
- feat(vite): convert-to-inferred should clean up inputs and outputs
- docs(vite): add convert-to-inferred
- feat(vite): update outDir correctly

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->
There is currently no generator that can migrate projects that use
`@nx/vite:*` executors to use Inference plugins.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add `@nx/vite:convert-to-inferred` generator

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-06-14 14:53:25 -04:00
Emily Xiong e9b7439ce2 feat(graph): add description and tags to details page (#26252)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
<img width="1155" alt="Screenshot 2024-05-29 at 5 47 20 PM"
src="https://github.com/nrwl/nx/assets/16211801/025f08d5-52cf-4087-94a5-e3319c89f8b1">
<img width="1127" alt="Screenshot 2024-05-29 at 5 47 04 PM"
src="https://github.com/nrwl/nx/assets/16211801/ff19514d-2513-4b13-ac9c-4b124ac0ce4a">
<img width="387" alt="Screenshot 2024-06-04 at 11 56 54 PM"
src="https://github.com/nrwl/nx/assets/16211801/ea2f0c47-a444-4be8-9ccd-60fd2b534e12">



## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-14 14:27:14 -04:00
James Henry b61546fc1a chore(repo): remove pnpm cache from data step, improve messages (#26552) 2024-06-14 08:14:45 -04:00
James Henry 42749b8225 chore(repo): refactor publish.yml for PR releases (#26550)
Redo of #26509, with more guards for unexpected missing/relative values
within full releases in GitHub Actions.

---

Refactors our publish workflow to support PR releases, in addition to
our previous triggers.

**Tests:**

---

- Example of failure on non-PR release (comment skipped):
https://github.com/nrwl/nx/actions/runs/9480869812

---

- Example of failure on PR release (comment created on PR):
  - https://github.com/nrwl/nx/actions/runs/9480852880
  - https://github.com/nrwl/nx/pull/26515#issuecomment-2162646682

---

- Example of dry-run of full release (`workflow_dispatch` with no PR
number provided): https://github.com/nrwl/nx/actions/runs/9497871483

---

- Real PR release created here:

| Release details | 📑 |
  | ------------- | ------------- |
| **Published version** |
[0.0.0-pr-26515-856ef7f](https://www.npmjs.com/package/nx/v/0.0.0-pr-26515-856ef7f)
|
  | **Triggered by** | @JamesHenry |
| **Branch** |
[JamesHenry-patch-1](https://github.com/nrwl/nx/tree/JamesHenry-patch-1)
|
| **Commit** |
[856ef7f](https://github.com/nrwl/nx/commit/856ef7f353ec173d6e1dcdaa286147f4784d72ab)
|
| **Workflow run** |
[9497298216](https://github.com/nrwl/nx/actions/runs/9497298216) |

---------

Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com>
2024-06-14 07:07:06 -04:00
Leosvel Pérez Espinosa e22021da4e feat(angular): update ngrx packages to v18 (#26549)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 NXP-747 -->

Fixes #
2024-06-14 06:43:20 -04:00
Jack Hsu fbd7f80bc9 fix(bundling): set project type correct for buildable vite projects (#26420)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

This PR:

1. fixes `@nx/vite/plugin` so that it infers the correct `projectType`
2. changes the default `package-json-workspaces` plugin such that
`projectType` is not inferred is `appsDir` and `libsDir` are not set
3. Update PDV to look for the normalized `type` property on projects if
`projectType` is missing (due to no longer being inferred by any
plugin).

## 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-06-13 15:48:07 -04:00
Jason Jean 73c8c3343d Revert publish (#26544)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the 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 below commit caused the publish pipeline to publish a `minor`
version when it should have been a `next` version.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This reverts commit
https://github.com/nrwl/nx/commit/3750366ebc5a714912a85bfc0bae4724739847b2.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-13 14:27:36 -04:00
Jack Hsu 8804f12450 feat(bundling): add convert-to-inferred generator for @nx/rollup (#26280)
This PR adds `@nx/rollup:convert-to-inferred` generator.


## 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-06-13 13:52:55 -04:00
Colum Ferry 364198f03e feat(devkit): add aggregateLog util for executor to plugin migration (#26523)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
There is no way to aggregate logs and output at the end of execution for
the executor to plugin migrations

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
There should be a way to aggregate logs and output them at the end of
execution

Usage:
```ts
// Call with the executorName that is being migrated
// Make sure the log itself does not contain dynamic values
// Add the project root that is being migrated

aggregateLog({executorName: '@nx/vite:build', project: projectRoot, log: 'Encountered X in project.json. Do Y to handle this manually.'})

// Then in GeneratorCallback run a task
return () => { flushLogs() };
```

Example Output

![image](https://github.com/nrwl/nx/assets/12140467/9a36c855-7377-4ad5-946c-c50202d9b50c)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-13 19:31:20 +02:00
James Henry 92c94d8212 chore(repo): tweak publish.yml wording (#26542) 2024-06-13 11:47:00 -04:00
Leosvel Pérez Espinosa 6cf0dbdf22 fix(core): generate npm lockfile with correct hoisted dependencies (#26539)
Failing new test case covering the broken scenario:
https://staging.nx.app/runs/s0YaQGUVgq/task/nx%3Atest

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #22386
2024-06-13 16:28:48 +02:00
James Henry 3750366ebc chore(repo): refactor publish.yml for PR releases (#26509) 2024-06-13 09:28:43 -04:00
Jack Hsu c86de97b12 fix(core): convert-to-monorepo support for root project without project.json (#26507)
This PR fixes `convert-to-monorepo` generator, so it works after `nx
init` on a single project.

## Current Behavior

If you use :

```
npm create vite react-app -- --template=react-ts
cd react-app
npx nx init
```

Then, you'll get an error when running `nx g convert-to-monorepo`.

```
 NX   The following projects are defined in multiple locations:

- react-app:
  - .
  - packages/react-app

To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.

MultipleProjectsWithSameNameError: The following projects are defined in multiple locations:
- react-app:
  - .
  - packages/react-app
  - 
```

## Expected Behavior
The generator should work, and you can run commands successfully
afterwards (e.g. `nx serve react-app`).

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-12 18:24:32 -04:00
Colum Ferry 07fa8a6ffa feat(vite): add createNodesV2 function (#26484)
- chore(vite): move single file processing of plugin to own function
- feat(vite): add CreateNodesV2 function

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
There is no implementation for createNodesV2


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
There should be an implementation for createNodesV2

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-12 18:20:03 -04:00
Leosvel Pérez Espinosa bcac55178f cleanup(linter): batch globbing to improve @nx/eslint/plugin perf (#26475)
Below are the benchmark results running the changes in the Nx repo:

**No cache**:
Command: `NX_DAEMON=false NX_CACHE_PROJECT_GRAPH=false
NX_PERF_LOGGING=true NX_ISOLATE_PLUGINS=true pnpm nx graph --no-open`
Current: **1780ms**
After the changes: **1089ms**
**~39%** less time
**~1.6x** faster

**Full cache**:
Command: `NX_DAEMON=false NX_PERF_LOGGING=true NX_ISOLATE_PLUGINS=true
pnpm nx graph --no-open`
Current: **1527ms**
After the changes: **377ms**
**~75%** less time
**~4x** faster

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-12 18:18:04 -04:00
Emily Xiong c02eeac7c2 feat(core): extend option readyWhen to accept multiple strings (#26426)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
this pr is meant to replace https://github.com/nrwl/nx/pull/17310
Option readyWhen for nx:run-commands only accepts a single string.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Option readyWhen for nx:run-commands accepts either a single string or
an array of strings. In case the provided value is an array of strings,
we will wait until all strings have appeared in stdout or stderr.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

Co-authored-by: Karel Frederix <karelfrederix@gmail.com>
2024-06-12 16:40:34 -04:00
Leosvel Pérez Espinosa 783bfe61aa fix(testing): add the preset from the jest config to the inferred task inputs (#26511)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-12 16:16:44 -04:00
Jason Jean a8efe596e8 fix(js): fix typescript resolution for packages with different resolv… (#26533)
…ed package.json

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

When a package such as `@json2csv/plainjs` reroute their `package.json`
(maybe unintentionally) to an invalid `package.json`, the dependency
location logic fails.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When a package such as `@json2csv/plainjs` reroute their `package.json`
(maybe unintentionally) to an invalid `package.json`, the dependency
location logic traverses up to the right `package.json`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-12 15:29:36 -04:00
Isaac Mann 508fd862c6 chore(nx-dev): skip website publish for older minor versions (#26272)
Update the website publish flow to not publish if the current minor is
not the latest version.
Moves the logic into a node script
2024-06-12 15:14:17 -04:00
James Henry 2ba4cf23f6 fix(release): ensure given preid modifies conventional commits specifier (#26524) 2024-06-12 14:23:49 -04:00
Jack Hsu 078ac17004 feat(rspack): add crystal plugin for inferring projects (#407) 2024-06-12 11:48:57 -04:00
Jack Hsu 65669e9ca9 feat(rspack): add crystal plugin for inferring projects (#407) 2024-06-12 11:48:57 -04:00
Craigory Coppola 5d56e21163 fix(core): read project name from package json if not set in project json (#26386)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
If `project.json` exists without a name, we infer one based on the root
path. This can be confusing when there exists a `package.json` alongside
it that contains a name which doesn't match our inferred name.

## Expected Behavior
If `project.json` and `package.json` both exist, the name from
`package.json` will be used if `project.json` contains no name.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26347
2024-06-12 11:18:29 -04:00
Emily Xiong 471f82c991 fix(js): remove default port for verdaccio (#26502)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- remove default port for verdaccio so it can take port from config file

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/23007
2024-06-12 10:06:49 -04:00
Jack Hsu 4a5eb23302 fix(bundling): vite init generator supports updating vite projects to use workspace libraries (#26503)
This PR adds a `@nx/vite:setup-paths-plugin` generator to add
`nxViteTsPaths` plugin to all vite config files in the workspace. This
can also be used with init/add as follows:

```shell
nx add @nx/vite --setupPathsPlugin
nx g @nx/vite:init --setupPathsPlugin
```

Which takes a config such as:

```ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
})
```

And updates it to:

```ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';

export default defineConfig({
  plugins: [react(), nxViteTsPaths()],
})
```

Taking into account ESM (default) and CJS (deprecated).

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-11 16:55:58 -04:00
Leosvel Pérez Espinosa 0a4551c2f3 fix(linter): update eslint config lookup to correctly handle configs at the root (#26508) 2024-06-11 16:27:24 +02:00
Miguel 0018842424 fix(js): filter project dependencies when calculating topological ordering (#26491) 2024-06-11 18:04:09 +04:00
Nicholas Cunningham b9b89b2575 feat(nx-dev): Use app router for blogs (#23127)
The PR activates the app router for the Blog page at /blog. 

Its purpose is to test Next.js changes within nx-dev, allowing us to
identify and address any issues that users might encounter.
Integrating these changes into our environment, we can gain firsthand
experience and insights into potential problems, ensuring that the
updates are robust and reliable.

This approach helps us improve the overall quality and user experience
of our platform by proactively identifying and resolving any issues that
could affect consumers.
2024-06-11 09:28:29 -04:00
Katerina Skroumpelou 8351cb11f3 fix(core): remove devDependencies in production build (#21428) 2024-06-11 09:15:05 +00:00
Craigory Coppola 16008751ec fix(core): don't infer scripts as targets if sibling project json declares them (#26464)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
Inferring some scripts during package-json-workspaces causes some
thrashing

## Expected Behavior

We only infer a script as a target if its not in project.json

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: “JamesHenry” <james@henry.sc>
2024-06-10 18:19:38 -04:00
James Henry 3689c8881b fix(release): ensure git add related commands run from root (#26497) 2024-06-10 22:43:06 +04:00
James Henry 29af58f290 fix(release): false positive npm dist-tag add (#26496) 2024-06-10 22:18:28 +04:00
James Henry b54f5c3648 Revert "fix(release): false positive npm dist-tag add" (#26495)
Reverts nrwl/nx#26494
2024-06-10 21:14:40 +04:00
James Henry c764a62060 fix(release): false positive npm dist-tag add (#26494) 2024-06-10 21:13:51 +04:00
Colum Ferry 0327559ca4 fix(vite): ensure typecheck is using correct tsconfig #21844 (#26447)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
When running typecheck, we use the provided tsconfig or find the
projects tsconfig.
This doesn't take into consideration the buildLibsFromSource which
creates a tmp tsconfig to map buildable libraries.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure the correct tsconfig is used when running typecheck

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #21844
2024-06-10 12:56:19 -04:00
Isaac Mann c7401b5657 docs(core): clarify interpolated keywords (#26486)
Fixes #23511
2024-06-10 11:23:24 -04:00
Jason Jean ccc5ad5db4 fix(bundling): fix vite plugin caching (#26487)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

A missing await caused the hash for the cache file name to be the same
for different options.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The hash for the cache file name is different for different options.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-10 10:12:08 -04:00
Juri Strumpflohner 9280c9a8d9 fix(release): improve error msg to mention how to add the nx/js plugin (#26473) 2024-06-09 23:33:38 +04:00
Craigory Coppola 55197fb33f fix(misc): nx wrapper should work better on windows (#26460)
!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
- wrapper echo's its contents
- wrapper doesn't exit properly
- wrapper has LF line endings

## Expected Behavior
- wrapper is silent
- wrapper exits early
- wrapper has CRLF endings

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26254
2024-06-07 16:39:05 -04:00
Emily Xiong 4989865978 fix(core): fix duplicate nx entry in gitignore (#26461)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-07 16:38:54 -04:00
Jason Jean a7dc8f6d7f chore(repo): fix file formatting (#26463)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Files are unformatted.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Files are formatted.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-07 16:10:22 -04:00
Bastien c5f5320ef2 fix(web): add shell true (#26411)
Add option `shell: true` to allow child process on Windows

Closes #26161
2024-06-07 15:13:39 -04:00
Craigory Coppola 8891bdc3ab fix(core): ensure tuple passed to aggregate create nodes error (#26456) 2024-06-07 18:14:22 +00:00
Jason Jean 08a0e5cb59 fix(core): clean versions read from package.json when resolving depen… (#26457)
…dencies

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

When versions in published `package.json` files such as
https://unpkg.com/@trpc/server@11.0.0-rc.394/package.json are depended
on, the version is not cleaned of extra parts of the version, and the
dependency is resolved properly.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When versions in published `package.json` files such as
https://unpkg.com/@trpc/server@11.0.0-rc.394/package.json are depended
on, the version is cleaned and resolves properly as a dependency.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/26410
2024-06-07 13:55:57 -04:00
Craigory Coppola 6de382c8a2 fix(core): don't throw when hashing undefined object (#26455)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
Plugins call hashObject w/ options, which is sometimes undefined. This
causes hashObject to throw

## Expected Behavior
hashObject doesn't throw

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-07 17:36:49 +00:00
Colum Ferry 926d140d08 docs(module-federation): clarify --skipRemotes option #23574 (#26443)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Remotes not in the workspace are now skipped automatically. The
`--skipRemotes` option is now used to intentionally skip remotes in the
workspace that are served by other means

## 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 #23574
2024-06-07 13:01:15 -04:00
Colum Ferry 558c91c909 chore(webpack): update source-map-loader to 5.0.0 #21933 (#26446)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Linked GH issue explains it well.
## 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 #21933
2024-06-07 13:00:41 -04:00
Nicholas Cunningham a09c029f8f fix(nextjs): Generating an app using tailwind should not add module css (#26454)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
When you generate a Next.js app using `tailwind` it will also generate
an accompanying
- `page.module.css` for app router
- `index.module.css` for pages router

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When geneating a Next.js app using `tailwind` it does not generate
module css files.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-07 10:34:44 -06:00
James Henry 28b3d80f2f fix(core): correctly handle negative patterns in workspaces/packages config (#26453) 2024-06-07 19:21:34 +04:00
Craigory Coppola 356479b332 fix(core): handle projects inside dependsOn correctly (#26392) 2024-06-07 10:38:14 -04:00
Nicolas Belliard fea232ee32 docs(core): upgade major version in contributing doc (#26442)
Hello!

Little fix of the contributing doc that I faced during the install of nx
in my local environment.

## Current Behavior
The major version used in the contributing is the 18.0.0

## Expected Behavior
It should be the 20.0.0
2024-06-07 08:26:25 -04:00
Austin Fahsl ebfd4b75ba docs(release): publish from dist directory recipe (#26370) 2024-06-07 15:55:23 +04:00
Jason Jean 7495f0664b chore(repo): add sync generator for e2e configs (#26427) 2024-06-06 16:51:18 -04:00
Jack Hsu ec5461fa85 fix(react): prevent generating empty props since setting strict in tsconfig is not compatible with it (#26428)
This PR updates the React components so that interface for props is not
generated. Some components don't have them, and users know how to add
them if needed. This makes the generated component pass type checking if
`strict: true` is used in tsconfig.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-06 16:40:07 -04:00
Jack Hsu cc023c91f9 fix(js): add default baseUrl when extracting tsconfig.base.json or building libs will fail (#26432)
This PR ensures that `"rootDir": "."` is set in `tsconfig.base.json` is
set, or else generating libs in a standalone project will fail with and
error like this:

```
error TS5090: Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?
```

## 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-06-06 16:10:36 -04:00
Craigory Coppola b2e6662e19 chore(repo): dont use unit-test-setup during e2e (#26393)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-06 15:57:24 -04:00
Jason Jean e44199142d fix(core): fix postinstall when nx is not resolveable (#26433)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

`postinstall` task exits 1 when errors are thrown.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`postinstall` task always exits 0. Errors are OK because nothing here is
critical.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/26400
2024-06-06 15:52:56 -04:00
Craigory Coppola 795bec023b fix(misc): gitignore workspace-data when init run (#26429)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
`init` doesn't gitignore workspace-data

## Expected Behavior
`workspace-data` is ignored

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-06 15:13:34 -04:00
Emily Xiong 9ab31e435a fix(core): should not pass --no-color --no-parallel (#22763)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
- pass --no-parallel --no-color to underlying command

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- should handle --no-parallel and --no-color

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/22321
2024-06-06 14:23:29 -04:00
Craigory Coppola bb79c6deb3 fix(core): don't load env vars when insantiating daemon client (#26421) 2024-06-06 14:22:37 -04:00
Nicholas Cunningham 9eebe4980a feat(node): Add output path to setup docker (#26365)
This PR updates how we generate a DockerFile for inferred and non
inferred projects.

Now you need to provide a output path.
2024-06-06 10:42:50 -06:00
Jonathan Cammisuli 88161e00c0 docs(core): include documentation about inputs for launch templates (#26266)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
There is no documentation on how to use inputs with steps for launch
tempaltes
## Expected Behavior
There is now documentation on how to use/configure inputs for steps in
launch templates

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-06 11:17:08 -04:00
Leosvel Pérez Espinosa 15e1f78021 fix(angular): install @typescript-eslint/utils when using relevant angular eslint v18 packages (#26418)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Angular ESLint v18 packages now have `@typescript-eslint/utils` as a
peer dependency, but new projects don't install it, and existing
projects are not getting it installed in a migration.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `@typescript-eslint/utils` should be installed when creating new
Angular projects and when migrating when the workspace has the relevant
Angular ESLint packages in v18.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26408
2024-06-06 16:54:28 +02:00
Nicholas Cunningham cfcedb481a fix(nextjs): enable failing storybook tests (#22675) 2024-06-06 08:42:32 -06:00
Benjamin Cabanes 7b1073ebb5 feat(nx-dev): update text on enterprise & contact screens (#26416)
Adjusted the Contact Us wording and changed the primary contact link on the website from sales to engineering. The sales link is also presented with a more engaging prompt.
2024-06-06 10:16:25 -04:00
Leosvel Pérez Espinosa d2f4bdf254 fix(linter): improve error message for misconfigured parserOptions.project in @nx/eslint:lint executor (#26383)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #23088
2024-06-06 09:14:16 -04:00
Leosvel Pérez Espinosa b40ed1fa03 fix(linter): do not glob for invalid eslint config filenames in plugin (#26409)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 `@nx/eslint/plugin` globs for `.eslintrc.base.json` and
`eslint.base.config.js` workspace root files, which are not valid ESLint
config filenames. The ESLint CLI wouldn't pick them up directly, and we
shouldn't infer or process them. They are only used as part of a valid
config file name that extends from them.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `@nx/eslint/plugin` only globs for valid ESLint config filenames.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26388
2024-06-06 09:12:25 -04:00
Colum Ferry 94b1a210ab fix(nuxt): ensure .output directory is marked as an output (#26414)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Nuxt states that the `.output` folder is created with a production
build, regardless of the `buildDir` set in the `nuxt.config.ts` file.
We do not have this folder listed as an output and therefore it is not
cached and restored correctly


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure the `.output` folder is listed correctly as an output

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-06 08:29:18 -04:00
Colum Ferry faaa0f6d20 fix(nuxt): app generation should respect as-provided for app names (#26412)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Trying to generate an app called `myApp` fails because the
`@nx/nuxt:app` generator is using a mix of correct and incorrect mapped
project names when `as-provided` is used.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure the value coming from `determineProjectRootAndFormat` for
projectName is used when referencing the project

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-06 08:28:54 -04:00
Rares Matei fc33152d0c docs(nx-cloud): ami nxcloud update instructions (#26382)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-06 12:47:28 +01:00
Jack Hsu 00c1e3925a fix(bundling): load rollup config using the rollup version installed in the workspace (#26298)
This PR updates `@nx/rollup/plugin` so it loads the config file using
`loadConfigFile` from the Rollup version installed in the workspace.

This fixes the issue when initializing in the
[axios](https://github.com/axios/axios) repo, since the `require` call
in their config is no longer valid ESM in Rollup 4.

## 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: Emily Xiong <xiongemi@gmail.com>
2024-06-05 23:45:13 -04:00
Emily Xiong bccb2c5018 fix(core): add quotes around string to command (#23056)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
- nx run will not have quotes, but underlying command will have

<!-- This is the behavior we should expect with the changes in this PR
-->
<img width="524" alt="Screenshot 2024-05-23 at 2 07 20 PM"
src="https://github.com/nrwl/nx/assets/16211801/7c96f884-3c11-4f56-b6b4-b3fd41ac2187">
<img width="471" alt="Screenshot 2024-05-23 at 2 07 03 PM"
src="https://github.com/nrwl/nx/assets/16211801/b6746a25-ebfc-4cb2-ad1d-4f8600782037">



## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-05 17:02:48 -04:00
Emily Xiong 58041e893c fix(graph): make cacheable and nx release pill sticky to the right (#26157)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<img width="1098" alt="Screenshot 2024-05-28 at 10 26 50 AM"
src="https://github.com/nrwl/nx/assets/16211801/9f190b8e-fbdb-4a4f-9533-b467018d4fae">

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-05 16:59:40 -04:00
Emily Xiong 20529d4dc9 feat(graph): add source info for command and script (#26162)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

<img width="993" alt="Screenshot 2024-05-28 at 12 19 15 PM"
src="https://github.com/nrwl/nx/assets/16211801/35b95537-72ff-474f-b03a-68e20a7dfe55">
<img width="942" alt="Screenshot 2024-05-28 at 12 19 05 PM"
src="https://github.com/nrwl/nx/assets/16211801/b67d920b-2689-452c-9214-d96ce12331dc">
<img width="728" alt="Screenshot 2024-05-28 at 12 09 15 PM"
src="https://github.com/nrwl/nx/assets/16211801/c6e74976-83b5-44bf-b0b7-c99e22cd6e03">


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-05 16:56:50 -04:00
Jason Jean 7e984e11a6 fix(core): handle paths deleted by the ide (#26363)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

When IDEs delete directories on some operating systems, the watch events
are registered as deleted paths. These events were not handled so
plugins were continuing to process files which did not exist.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Watch events which are directories being deleted are handled and plugins
will not continue to process files which do not exist.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-05 16:38:23 -04:00
Benjamin Cabanes 9e3867e40c fix(nx-dev): update section layout in 'how-can-we-help' component (#26394)
The layout for a section in the 'how-can-we-help' component has been adjusted to better suit different screen sizes. The 'col-span-2' class has been moved within a media query ('md') to apply only for medium and larger screens, which will improve the responsiveness on smaller devices.
2024-06-05 15:49:52 -04:00
Jason Jean 3ff1b5b4f7 fix(core): make plugin pool cleanup to be synchronous (#26389) 2024-06-05 13:37:56 -04:00
Jack Hsu fcb6498e76 feat(web): allow additional http-server options to be passed from @nx/web:file-server (#26391)
This PR allows additional args such as `-d` (directory listing) and
`--mimetypes` to be passed from `serve` to the underlying `http-server`
module.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #22138
2024-06-05 13:08:42 -04:00
Colum Ferry 187569e0e1 fix(nuxt): generate tsconfig files correctly (#26385)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 TsConfig files we generate when creating a Nuxt application do not
apply the types from `nuxt.d.ts` correctly.
This leads to IDE errors with Nuxt Auto Imports.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure the TsConfig files are generated correctly

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26120 #21862
2024-06-05 17:14:36 +01:00
Emily Xiong 2a1898e428 fix(gradle): use shell to exec gradle for windows (#26361)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-05 11:38:48 -04:00
Nathanael a01ddcea11 feat(testing): cypress autoCancelAfterFailures (#26281)
Pass autoCancelAfterFailures to cypress executor

Fixes #26264

---------

Co-authored-by: Nathanael Smith <nathanael.smith@hilton.com>
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2024-06-05 17:33:27 +02:00
Nicolas Belliard 58f36170f7 docs(core): adding warning following the breaking change in the environment variable documentation (#26357)
Following the breaking change with the process environment variable are
no available.

I see that this [issue](https://github.com/nrwl/nx/issues/26023) has
been created.

Therefore, I think a warning in the documentation is needed to inform
that this variables are not accessible for Nx version greater or equal
to 19.

## Current Behavior
On the current Nx documentation, there is no information regarding this
breaking change:


![image](https://github.com/nrwl/nx/assets/22777121/ddc66b14-751a-4bc5-adf2-6c60981b2cd4)

Doc link:
https://nx.dev/reference/environment-variables#environment-variables

## Expected Behavior
Adding a warning to inform about this breaking change:


![image](https://github.com/nrwl/nx/assets/22777121/be03b76d-20e8-417e-9e51-604af10b921a)


## Related Issue(s)
[<!-- Please link the issue being fixed so it gets closed when this is
merged. -->](https://github.com/nrwl/nx/issues/26023)

Let me know if it is ok for you and if you want to rephrase the
following warning.

Nicolas Belliard
2024-06-05 11:16:39 -04:00
Attila Tóth 0038f55b92 fix(js): wrong compiler helper config file path for swc (#23193)
Fixes a bug that resulted in returning an object instead of a string for
JS executors.
There is also a helper type introduced that triggers TS to show an error
for similar problems.

Also this PR rises the minimum prettier version from 2.7.1 to 2.8.0,
because that supports the `satisfies` TS operator.

_I had another PR for this change, but that got messed up by a rebase,
so I closed that and opened this one._
_I wrote some comments there that describe what I did and why:
https://github.com/nrwl/nx/pull/22335 ._
_Also, since I created that PR many things have changed in the master
branch which allows this PR to be even simpler._

## Current Behavior
Currently build processes fail with this error message:
The "path" argument must be of type string or an instance of Buffer or
URL. Received an instance of Object .

I am experiencing it with a NestJS project.

## Expected Behavior
Builds pass without problems.

## Related Issue(s)
https://github.com/nrwl/nx/issues/22160

Fixes #22160

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-06-05 10:21:45 -04:00
Jack Hsu 0c1e2e08f4 feat(web): update postcss to a version without security advisory (#23478)
https://github.com/advisories/GHSA-7fh5-64p2-3v2j

## 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-06-05 09:10:56 -04:00
MaxKless c2d1a06a56 fix(core): catch nonexistent user error when requiring native code (#26381)
## Current Behavior
On certain environments, calling node's `userInfo()` errors, leading to
native code not being loaded correctly.

## Expected Behavior
We should be resilient towards this and not error.


Fixes https://github.com/nrwl/nx/issues/26351
2024-06-05 08:37:40 -04:00
Every a8c4e2479b fix(js): swc exclude config may not a array (#21904)
[swc config is not
required](https://swc.rs/docs/configuration/compilation#exclude)

## Current Behavior
if not configed `"exclude"` will get a error
```text
TypeError: Cannot read properties of undefined (reading 'concat')
    at generateTmpSwcrc (/Users/hongxu/repos/smallfish/node_modules/@nrwl/js/src/utils/swc/inline.js:7:41)
```

## Expected Behavior
give a default value for swc exclude if nx must need it
2024-06-05 08:09:51 -04:00
Rares Matei e658c16a8f docs(nx-cloud): clarify nx cloud deployment options (#26349)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-05 12:59:35 +01:00
Leosvel Pérez Espinosa d4370b9ba1 fix(misc): ignore .nx/workspace-data when generating new workspaces (#26378)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-05 13:11:17 +02:00
Leosvel Pérez Espinosa 51d651946b fix(vue): handle eslint flat config correctly in vue generators (#26377)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #21739
2024-06-05 12:46:47 +02:00
Leosvel Pérez Espinosa ffea1d5c6d fix(linter): handle paths correctly in enforce-module-boundaries eslint rule (#26373)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #21889
2024-06-05 12:38:21 +02:00
Leosvel Pérez Espinosa f4b379f459 fix(linter): check for flat config correctly in @nx/eslint:lint executor (#26350)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #22575
2024-06-05 12:36:48 +02:00
Katerina Skroumpelou f8239debd0 feat(nx-cloud): new cloud onboarding flow (#26262)
New Nx cloud onboarding flow.

![Screenshot 2024-05-30 at 5 29
43 PM](https://github.com/nrwl/nx/assets/6603745/c26f6416-f54b-4b6d-8b3c-4d4c1acfcbb1)

![Screenshot 2024-05-30 at 5 30
18 PM](https://github.com/nrwl/nx/assets/6603745/acb2b1d1-8437-4d8b-8b87-602cc918f12b)

![Screenshot 2024-05-30 at 5 31
26 PM](https://github.com/nrwl/nx/assets/6603745/e6b1f595-e3c1-4c09-83e7-9f71b5383a35)
2024-06-05 12:45:22 +04:00
Greg Westneat 260562e484 feat(expo): update expo sync-deps executor (#26086)
## Current Behavior

When running `@nx/expo:sync-deps` it includes many unexpected
dependencies.

If you add a backend project as an implicit dependency to the expo
project, then all of the backend project's dependencies are included in
the expo package.json when running `@nx/expo:sync-deps`

You can use the `exclude` option, but with hundreds of excluded
packages, this adds a lot of bloat to the targets in `project.json`

## Expected Behavior

Ideally, when using `sync-deps` as a part of the `build`, only packages
necessary in the context of the `build` would be synced.

Since the packages from `implicitDependencies` aren't typically relevant
to the expo build, we should optionally be able to not include them.

## Notes

### Default Value

I made the default `excludeImplicit: false` so that it doesn't diverge
from current behavior/expectations — but it's possible that it would
make more sense to have it be `true` by default — would defer to y'all
on that question.


## Additional Considerations

### Other Possible Options 


> [!NOTE]
> Let me know if you're interested in PRs to add any of these


<details>
  <summary>Other Possible Options</summary>

Here are some other options which might be worth considering.

- [x] `excludeImplicit` <- _added in this PR_
- [ ] `onlyNativeDependencies`*
- [ ] `onlyPodInstallDependencies`*
- [ ] `traceDependencyPaths`**
- [ ] `excludeDevDependencies`***
- [ ] `matchRootPackageJsonCatgeory`***
- [ ] `onlySrcFiles`****
- [ ] `filterByCacheInputs`****


#### Only Native / Pod Installs*
Based on the discussion in issue #18788 it seem like the primary reason
for `sync-deps`, is to support pod install.

#### Trace Dependency Paths**

When I was originally debugging "why is axios being added?" — before I'd
realized about the `implicitDependencies` — I wrote a utility to output
the trace for the included packages — that's how I realized what was
going on. Could be a useful feature addition.


![image](https://github.com/nrwl/nx/assets/2213636/e1cb1511-c518-47d8-85fb-69c6a6d88058)


#### Deps vs DevDeps***

By default, the `sync-deps` feature will find all dependencies
including(eg jest, storybook) and add them to `package.json` under the
`"dependencies":` key.

It might be useful to either match the root `package.json`'s
categorization or just exclude devDependencies altogether.

#### File aware filtering****

Currently the `findAllNpmDependencies` is filtering some hardcoded
external nodes:
```
  'npm:@nx/react-native',
  'npm:@nrwl/react-native',
  'npm:@nx/expo',
  'npm:@nrwl/expo',
```
These are in the dependency graph because they are used as executors in
`project.json` targets.

It might be useful to derive these exclusions dynamically, by only
considering relevant productions files.

A simple approach would be to only consider dependencies that stem from
files in the `src` directory

A more robust alternative would be to read the cache inputs from the
calling target, and filter dependencies based on matching files

</details>

### Fingerprinting?

<details>
  <summary>Fingerprinting</summary>

There's a related matter having to do with `@expo/fingerprint` where
having the native dependencies visible from the project-level
`package.json` is important to getting accurate project-level
fingerprints.

The more ideal solution would be to use the Nx graph to handle the
"fingerprinting" hash generation, but it would require some thought /
feature design.

So in the meantime the `sync-deps` (only need native deps) +
`@expo/fingerprint` recourse seems like the best option.

</details>

Thanks!
2024-06-05 01:04:10 -04:00
Jason Jean 5a06daac7a chore(repo): update nx to 19.2.0-rc.0 (#26371)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

This repo uses Nx `19.2.0-beta.4`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `19.2.0-rc.0`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-04 21:51:30 -04:00
Craigory Coppola 5e39cb0019 feat(core): allow partially resetting workspace (#23381) 2024-06-04 18:55:10 -04:00
Craigory Coppola d06992e5b9 fix(core): handleErrors returns an exit code (#26343) 2024-06-04 18:44:52 -04:00
Craigory Coppola cda799b8a6 feat(core): allow skipping lockfile for affected (#23509) 2024-06-04 18:15:00 -04:00
Emily Xiong 43ddd72aa2 fix(core): fall back to pacakgeManager if yarn --version failed (#26356)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-04 17:53:39 -04:00
Michal Jez 6d2e7cd2cf feat(nx-plugin): update executor generator to have context (#16982)
Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
2024-06-04 17:49:50 -04:00
Benjamin Cabanes a1c26d51ab feat(nx-cloud): add new Webinars link in menu-items (#26368)
The href for the Webinars section in the `menu-items.ts` file has been updated.
2024-06-04 17:19:36 -04:00
Benjamin Cabanes cddc69996d fix(nx-dev): correct typo in link (#26367)
Corrected a typo error in the 'Contact engineers' link from `/contact/enigeering` to `/contact/engineering`. Also, unused 'Contact us' section was removed from the file.
2024-06-04 17:15:26 -04:00
Craigory Coppola dd6eda84b0 feat(devkit): allow to customize overwrite mode in generateFiles (#26354)
Adds a new capability to choose how to handle already existing target
files when using a generator.

See #17925

Co-authored-by: Michael Monerau <micmo@qontrol.io>
2024-06-04 16:12:15 -04:00
Emily Marigold Klassen 8800a30022 fix(misc): support ts-node options in tsconfig files (#21723) 2024-06-04 16:08:49 -04:00
cdwheatley 56a3af6f9d docs(nx-plugin): update local-executors.md
Change path for generation of my-plugin to libs/my-plugin

nx g @nx/plugin:plugin libs/my-plugin

This makes it work with the plugin executor generate command.
2024-06-04 16:06:40 -04:00
Stefan Schweiger 215bc42c11 feat(core): additional .local patterns for .env files (#19163)
## Current Behavior
Loading order of .env files

1. `apps/my-app/.env.[target-name].[target-configuration-name]`
2. `apps/my-app/.env.[target-name]`
3. `apps/my-app/.[target-name].[target-configuration-name].env`
4. `apps/my-app/.[target-name].env`
5. `apps/my-app/.env.local`
6. `apps/my-app/.local.env`
7. `apps/my-app/.env`
8. `.env.[target-name].[target-configuration-name]`
9. `.env.[target-name]`
10. `.[target-name].[target-configuration-name].env`
11. `.[target-name].env`
12. `.env.local`
13. `.local.env`
14. `.env`

## Expected Behavior
1. `apps/my-app/.env.[target-name].[target-configuration-name].local`
2. `apps/my-app/.env.[target-name].[target-configuration-name]`
3. `apps/my-app/.env.[target-name].local`
4. `apps/my-app/.env.[target-name]`
5. `apps/my-app/.[target-name].[target-configuration-name].local.env`
6. `apps/my-app/.[target-name].[target-configuration-name].env`
7. `apps/my-app/.[target-name].local.env`
8. `apps/my-app/.[target-name].env`
9. `apps/my-app/.env.local`
10. `apps/my-app/.local.env`
11. `apps/my-app/.env`
12. `.env.[target-name].[target-configuration-name].local`
13. `.env.[target-name].[target-configuration-name]`
14. `.env.[target-name].local`
15. `.env.[target-name]`
16. `.[target-name].[target-configuration-name].local.env`
17. `.[target-name].[target-configuration-name].env`
18. `.[target-name].local.env`
19. `.[target-name].env`
20. `.env.local`
21. `.local.env`
22. `.env`

## Related Issue(s)
#19161
2024-06-04 16:06:03 -04:00
Simon Lipp 09705129d0 fix(core): resolve dependent task output files path (#22253) (#23179) 2024-06-04 15:55:17 -04:00
Craigory Coppola a6cddba9d4 chore(repo): fix formatting in commitizen.js (#26364)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-04 15:54:22 -04:00
Michal Gawrys c002b54fdc chore(misc): add test for move generator when there is a list export in the same file as path to update (#22070) 2024-06-04 15:28:21 -04:00
Emily Xiong 9c2162fadc fix(react-native): should not include ts in build (#26352)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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/22948
2024-06-04 15:02:41 -04:00
Craigory Coppola 0105fd20cc fix(linter): export createNodesV2 (#26360) 2024-06-04 18:40:59 +00:00
Nicholas Cunningham d2d06cdbab chore(nx-dev): Replace duplicate references to discord icon 2024-06-04 09:45:33 -07:00
Nicholas Cunningham 17a4c5a757 feat(nx-dev): Add community and discord to resources header 2024-06-04 09:45:33 -07:00
Sean Parmelee a8ae302ae4 fix(nextjs): support canary versions of next (#22672)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
When using a `canary` version of `next` in an nx monorepo where the
next.js application depends on a lib that's also in the monorepo,
running `nx build` results in `Module parse failed: Unexpected token`
errors start occurring.

The use of a `canary` version essentially reintroduces
https://github.com/nrwl/nx/issues/16658 because of how `semver` [handles
pre-release
tags](https://github.com/npm/node-semver/tree/main?tab=readme-ov-file#prerelease-tags).
As mentioned in the docs, we can suppress this behavior by passing the
`includePrerelease` option, which is what this PR does.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`nx build` successfully builds my Next.js application

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
https://github.com/nrwl/nx/issues/16658
https://github.com/nrwl/nx/issues/16516
https://github.com/nrwl/nx/issues/19635
2024-06-04 09:36:30 -06:00
Austin Fahsl b2855fd6e1 feat(release): add support for version plans (#23190) 2024-06-04 16:44:28 +04:00
Leosvel Pérez Espinosa e95204b037 fix(linter): generate flat config for new projects correctly (#26328)
- Change generated import for `FlatCompat`:
  ```diff
  - const FlatCompat = require('@eslint/eslintrc');
  + const { FlatCompat } = require('@eslint/eslintrc');
  ```
- Fix replacing overrides to be reflected in the end result (the updated
content with the replacements was not being assigned)
- Add extended plugins/configs to the start (matches behavior of the old
config)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #22350 
Fixes #26151
2024-06-04 14:11:28 +02:00
Craigory Coppola 0594debfef feat(linter): migrate to create-nodes-v2 (#26302)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
No cache for eslint nodes

## Expected Behavior
v2 cache for eslint nodes

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2024-06-03 20:01:03 -04:00
Jason Jean cf0142d711 fix(core): exit the process after postinstall (#26336) 2024-06-03 13:12:47 -04:00
Nicholas Cunningham 8525bba7c6 feat(nx-dev): Add No_NEXT_PUBLIC_NO_INDEX environment variable (#26330)
Add no index env var
Preview / Dev now will have the `noindex` while the main / production
will be indexed
![Screenshot 2024-06-03 at 9 46
26 AM](https://github.com/nrwl/nx/assets/338948/f6f1d581-fdfa-44b6-8f43-24a3ddd4f4eb)
2024-06-03 09:49:02 -06:00
Leosvel Pérez Espinosa fbc88f2e6d fix(linter): return callback to install deps when running eslint migration to flat config generator (#26323)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-03 09:18:35 -04:00
Leosvel Pérez Espinosa 030ede2c95 cleanup(devkit): prevent mutating targetDefaults in migration to crystal helper (#26316)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-06-03 09:17:40 -04:00
Leosvel Pérez Espinosa adc1d70744 fix(linter): handle configuration without "rules" in migration (#26317)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #26306
2024-06-03 09:17:13 -04:00
Colum Ferry b97a295fad fix(vite): ensure installed version matches defined peer in package.json (#26324)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Our `@nx/vite` package has a peer dep on `vite@^5.0.0` but we only
install `vite@~5.0.0` creating a conflict in dependencies.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The version we install should match the peerDep range we specify in the
package.json

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-03 09:12:40 -04:00
Miroslav Jonaš 77d1c15bf9 fix(core): fix daemon plugins caching (#26321)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #26001
2024-06-03 07:32:02 -04:00
Leosvel Pérez Espinosa ccd16b10dd fix(angular): normalize and handle dev remotes correctly (#26320)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #26169
2024-06-03 13:23:22 +02:00
Leosvel Pérez Espinosa 1ea0589641 fix(angular): update broken imports in ng-packagr executors (#26319)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #26235
2024-06-03 12:28:01 +02:00
Benjamin Cabanes d010267d83 feat(nx-dev): add engineering team contact page (#26293) 2024-06-02 16:48:05 -04:00
Craigory Coppola 6f223005b8 fix(misc): ensure plugins are not creating workspace context while creating nodes (#26253) 2024-05-31 18:54:56 -04:00
Craigory Coppola a308e1dc6b fix(core): prevent graph output from being truncated (#23446)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
--graph stdout and --file stdout aren't documented. When printing graph
to stdout, its possible for some output to get missed.

## Expected Behavior
Existing flags are documented, and `--print` is more discoverable. We
await stdout finishing before exiting the program.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #18689
2024-05-31 18:05:26 -04:00
Jason Jean 1e7cd7e9e6 feat(testing): use createNodesV2 for cypress and playwright (#26301) 2024-05-31 17:53:31 -04:00
Jason Jean 92718fd52b chore(repo): update nx to 19.2.0-beta.4 (#26270)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

This repo uses Nx `19.2.0-beta.1`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `19.2.0-beta.2`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-31 16:46:24 -04:00
Jason Jean b558f56c69 feat(testing): use createNodesV2 for jest (#26292)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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/jest/plugin` uses CreateNodesV1. Multiple Jest plugins are not able
to be run in parallel and in isolation.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`@nx/jest/plugin` uses CreateNodesV2. Multiple jest plugins are able to
run in parallel and in isolation.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-31 15:43:01 -04:00
Emily Xiong 1f7c0bc51d fix(linter): support lib as standalone src path (#26263)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Root projects are considered standalone projects which shouldn't lint everything if the `src` directory exists.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Root projects which have a `lib` directory should be treated the same way.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-31 14:16:48 -04:00
Leosvel Pérez Espinosa 2fe4def42f cleanup(testing): update out-of-sync test case expectation (#26294)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-31 13:00:11 -04:00
Jack Hsu 4e49d527ba feat(bundling): extract rollup plugins into withNx function for use with run-commands (#26168)
This PR adds `withNx` function to `@nx/rollup/with-nx` so it can be used
in `rollup.config.js` to replicate what `@nx/rollup:rollup` executor
does without needing to use the executor.

e.g. 

```js
// rollup.config.js
const { withNx } = require("@nx/rollup/with-nx");

module.exports = withNx(
  {
    main: "./src/index.ts",
    outputPath: "./dist",
    tsConfig: "./tsconfig.lib.json",
    compiler: "babel",
    external: ["react", "react-dom", "react/jsx-runtime"],
    format: ["esm"],
    assets: [{ input: ".", output: ".", glob: "README.md" }],
  },
  {
    // Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
    // e.g.
    // output: { sourcemap: true },
  }
);
```


## Notes

1. Existing `@nx/rollup:rollup` continues to encapsulate rollup options
and will not support an isolated mode.
2. Newly created JS and React libs with `--bundler=rollup` will use the
new `withNx` function and explicit `rollup.config.js`.
3. If `NX_ADD_PLUGINS=false` or `useInferencePlugins: false` is set,
then new projects will continue to use the `@nx/rollup:rollup` executor.
2024-05-31 10:50:10 -04:00
Leosvel Pérez Espinosa c05e4ac268 cleanup(devkit): ensure externalDependencies input from inferred task is merged into target inputs when migrating (#26273)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-31 16:24:29 +02:00
Emily Xiong d29e3147a6 feat(react-native): upgrade react native to 0.74 (#26143)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-31 10:19:30 -04:00
Leosvel Pérez Espinosa 2b583fdb94 fix(misc): add externalDependencies input to some plugins missing them (#26291)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-31 15:29:34 +02:00
Jason Jean fde4932ab9 fix(gradle): expose create nodes v2 (#26282)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

`createNodesV2` was written but not exported.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`createNodesV2` is exported.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-31 09:18:19 -04:00
Emily Xiong 2cb7ecb77b fix(expo): remove deprecated webpack. (#26137)
config.js

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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/26118
https://github.com/nrwl/nx/issues/25291
https://github.com/nrwl/nx/issues/23233
2024-05-30 22:49:46 -04:00
Emily Xiong a2ca3d3392 fix(react-native): not cache pod-install (#26279)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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/23084
2024-05-30 22:49:20 -04:00
James Henry ef0dc01ffa fix(core): multi module handling and fall back matching for external nodes (#26277)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

- Packages such as `minimatch` which block access to their
`package.json` AND have multi module format outputs are missed by the
target project locator
- There is no fall back matching of external nodes from the graph by
name

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

- The target project locator appropriately finds modules such as
`minimatch`
- There is fall back matching of external nodes from the graph by name

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-31 01:06:58 +04:00
Craigory Coppola a5682d1ca5 feat(core): add create nodes v2 for batch processing config files (#26250) 2024-05-30 15:28:59 -04:00
Isaac Mann 1277b22ce4 docs(core): link to pass args recipe (#26276)
Link to the `Pass Arguments to Commands` recipe
2024-05-30 13:31:27 -04:00
Colum Ferry fb0430012c feat(vite): set watch:false in test config by default (#26267)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Currently, running vitest with inference will result in a process that
waits for the user to end it as vitest defaults to running in watch
mode.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We should set watch:false to allow users to specifically choose watch
mode by passing `--watch`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-30 12:52:01 -04:00
Román Benjámin e647719a21 fix(gradle): use os specific line separator for dependency parsing (#26119)
## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2024-05-30 12:14:08 -04:00
Jason Jean 2787a588e5 chore(repo): re-enable failing swc e2e test (#26246)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 test was failing because of a bad swc version.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

A new version of swc has been released which fixes the issue.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-30 10:28:17 -04:00
James Henry 7001e350af fix(core): prefer project specific external deps (#23307)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

We only ever discover one version of an external dependency for the
file-map.json. This means the `@nx/dependency-checks` lint rule can
produce incorrect failures when multiple copies of a dependency exist
within a workspace.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

In the file-map.json the project specific version of a package (if
multiple exist) is preferred and therefore the lint rule produces
accurate results.

---

For example, in a repo where the root package.json has lodash@4.0.0
(which becomes `npm:lodash` on graph) and the foo project has
lodash@3.0.0:

**Before**


![image](https://github.com/nrwl/nx/assets/900523/fa0b3711-5004-4abc-9904-0433a37bc3cf)

**After**


![image](https://github.com/nrwl/nx/assets/900523/d0527368-44b4-486f-aa7a-79d996a20ef4)

## Performance

`NX_ISOLATE_PLUGINS=true NX_PERF_LOGGING=true NX_DAEMON=false nx show
project nx --json false`


** Before **

Time for 'build typescript dependencies' 505.52144700009376

** After **

Time for 'build typescript dependencies' 701.247584999539
2024-05-30 10:23:47 -04:00
Marcus Thelin 7cbecf3bbf docs(core): add changelog render options on manage releases page (#22810)
Add a "customize changelog output" section to describe the available
render options as described by in [this
file](https://github.com/nrwl/nx/blob/master/packages/nx/release/changelog-renderer/index.ts).

## Related Issue(s)
Fixes #22809
2024-05-30 09:53:18 -04:00
James Henry 063e3c9174 fix(angular): update angular-eslint to v18 (#26165) 2024-05-30 09:13:03 -04:00
Jason Jean 316dcb948c fix(core): handle relative paths after {projectRoot} in outputs (#26244)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Outputs such as `{projectRoot}/../relative/path` do not get interpolated
correctly.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Outputs such as `{projectRoot}/../relative/path` get interpolated
correctly.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-29 19:08:11 -04:00
Leosvel Pérez Espinosa 7b196dc630 cleanup(devkit): add util for processing outputs in crystal migration generators (#26247)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-29 21:35:13 +00:00
Jason Jean 7ab246b4be chore(repo): update nx to 19.2.0-beta.1 (#26140)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

This repo uses Nx `19.1.0-beta.5`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `19.2.0-beta.1`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-29 15:57:07 -04:00
Rares Matei 4966797ff1 docs(nx-cloud): update release notes (#26242)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-29 16:23:29 +01:00
Zoran Kokeza 14eb8de800 fix(react): disable react refresh overlay (#22013)
## Current Behavior
Currently when a user runs into a compile/runtime error in react
application 2 error overlays will show. One from react-refresh-plugin
and the second one from webpack-dev-server (which is enabled by default)

![image](https://github.com/nrwl/nx/assets/19208948/c6be47bc-3ffd-4148-bdc6-18b59affae7f)

![image](https://github.com/nrwl/nx/assets/19208948/65ebe2a4-ed47-4feb-b289-645f3e2303cc)

### Steps to reproduce

This is reproducible using both webpack config types when the react
refresh plugin is applied to the configuration.
1. create fresh nx react app with webpack
2. add `hot: true`in webpack dev server configuration, so
react-refresh-plugin gets applied
3. anywhere in the app code throw an error i.e.
```
useEffect(() => {
  setTimeout(() => {
    throw new Error('test');
  }, 1000);
}, []);
```
4. observe 2 error overlays shown
Or clone the repo https://github.com/zoran995/nx-react-error-overlay,
branch main is using nx enhanced config, branch default-config is using
plain webpack config. Here is also a codesandbox showcasing an issue
https://codesandbox.io/p/github/zoran995/nx-react-error-overlay/main?file=%2Fapps%2Forg%2Fsrc%2Fapp%2Fapp.tsx&import=true

## Expected Behavior
Only one error should be shown to the user, and this is the actual
configuration of the plugin that is used by react scripts. I went with
not exposing another config option for nx react webpack plugin as there
is already an option to configure webpack dev server error overlay and
most of the react community is used to have the react-refresh one
disabled.
2024-05-29 09:20:37 -06:00
Aushwin eb44f9b07e cleanup(react): improved error message throwed when executor is not available or not valid (#23282)
The error message which is throwed when executer is not available or not
valid is really confusing. Hence updating it to throw the exact issue
why it errored.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
The error message throwed is really vauge. And does't really tell
anything about why it happened.

Fixes #
Improved error message which is throwed when excuter is not valid or not
present in the project.json
<img width="1421" alt="Screenshot 2024-05-10 at 1 17 05 AM"
src="https://github.com/nrwl/nx/assets/54993680/455163e4-3197-419c-b511-040c35784a72">
2024-05-29 09:04:05 -06:00
Rares Matei 89ed6b12aa docs(nx-cloud): update release notes (#26003)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-29 16:43:07 +02:00
Jason Jean 27940d3fff fix(bundling): use watch mode for rollup plugin (#26139)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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/rollup/plugin` will not properly reload `rollup.config.js` files
when they are updated as they are cached.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`@nx/rollup/plugin` loads rollup configs with `watchMode` enabled so
that rollup utilizes the proper cache busting mechanism so that
`rollup.config.js` is properly reloaded.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-29 09:02:06 -04:00
Miroslav Jonas bdd3375256 feat(nx-dev): improve the enteprise page 2024-05-29 03:03:42 -07:00
Miroslav Jonas 87760eec0a fix(nx-dev): case study link should open in new tab 2024-05-29 03:01:16 -07:00
Ivens Diego Müller 6d0bbee9e7 fix(release): improve error handling for npm publish (#26159) 2024-05-29 14:00:25 +04:00
Mark Lindsey 52d04d9864 docs(core): documentation for github integration for private nx cloud (#22305)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
Adding documentation to show how to set up a GitHub app for private nx
cloud in order to make use of the full github integration.

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
Private Nx Cloud orgs cannot use the full GitHub integration as they
need to create their own GitHub app and set the required environment
variables.
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Docs should support the new GitHub integration by providing the
necessary steps to set up the integration.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Mark Lindsey <markl@nrwl.io>
2024-05-29 10:36:24 +01:00
Jason Jean 7088b09f47 chore(repo): disable failing swc e2e test (#26166)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
https://github.com/swc-project/swc/issues/8988 is causing e2e tests to
fail.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The failing e2e tests are disabled while the issue is resolved.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-28 18:48:02 -04:00
Jack Hsu 012ce7c12b fix(bundling): rollup watch mode yields result from async iterable (#26160)
This PR fixes the return from `@nx/rollup:rollup` executor so that it
yields results from the inner async iterable.

## 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-05-28 17:16:00 -04:00
Miroslav Jonaš c7bea55d59 fix(core): ensure correct hoisted packages detection with pnpm parser (#26153)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-28 13:49:34 -04:00
Leosvel Pérez Espinosa 2b820a274e docs(misc): update /packages/ links to /nx-api/ (#26128)
- Update `/packages/` links to `/nx-api/`
- Convert some unneeded absolute links to relative
- Remove leftover examples doc for the already removed `cypress-project`
generator

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## 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 #26126
2024-05-28 09:44:48 -04:00
Vadim Goy b9e190d22b fix(react): full support custom secure host for module federation (#25288)
## Related Issue(s)

Fixes #
https://github.com/nrwl/nx/issues/21210

Co-authored-by: Vadim Goy <vadim.goy@zoominfo.com>
2024-05-28 09:48:36 +01:00
Emily Xiong 7f11a1d7d3 fix(core): fix preset empty (#26142)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-27 20:40:17 -04:00
Jason Jean e8b0972850 fix(core): limit the amount of choices shown so that the prompt fits … (#26132)
…on screen

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

When multiselect prompts have too many choices, `enquirer` does weird
unexpected things with the terminal.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Multiselect prompts are limited to enough lines so that they fit in the
terminal view preventing unexpected behavior.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-27 16:55:35 -04:00
Emily Xiong a6e23c1b9f fix(js): fix swc version warning (#24034)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
npm warnings:
```
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @swc-node/core@1.13.1
npm WARN Found: @swc/core@1.3.107
npm WARN node_modules/@swc/core
npm WARN   dev @swc/core@"~1.3.85" from the root project
npm WARN   3 more (@swc-node/register, nx, ts-node)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer @swc/core@">= 1.4.13" from @swc-node/core@1.13.1
npm WARN node_modules/@swc-node/register/node_modules/@swc-node/core
npm WARN   @swc-node/core@"^1.12.0" from @swc-node/register@1.8.0
npm WARN   node_modules/@swc-node/register
npm WARN 
npm WARN Conflicting peer dependency: @swc/core@1.5.7
npm WARN node_modules/@swc/core
npm WARN   peer @swc/core@">= 1.4.13" from @swc-node/core@1.13.1
npm WARN   node_modules/@swc-node/register/node_modules/@swc-node/core
npm WARN     @swc-node/core@"^1.12.0" from @swc-node/register@1.8.0
npm WARN     node_modules/@swc-node/register
```

## 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/23688
2024-05-27 16:46:30 -04:00
Miroslav Jonaš 8403f03822 feat(core): add support for pnpm lockfile v9 (#22906)
- [X] Fix parenthesis separator detection
- [x] Fix leading dash detection
- [x] Migrate existing pnpm normalizer to latest code
- [X] Add unit tests for v9
- [X] Dogfooding Pnpm v9 to Nx repo and agents

Fixes regression with alias packages introduced via
https://github.com/nrwl/nx/pull/23017

## Benchmarks

PNPM v9 Branch (migrated to branch's code)
```
  Time (mean ± σ):      3.526 s ±  0.081 s    [User: 0.717 s, System: 0.948 s]
  Range (min … max):    3.390 s …  3.714 s    20 runs
```
Master (running nx 19.1.0-beta.3)
```
  Time (mean ± σ):     11.160 s ±  0.112 s    [User: 0.799 s, System: 0.979 s]
  Range (min … max):   10.955 s … 11.379 s    20 runs
```

## 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 #22850
Fixes #23256

---------

Co-authored-by: James Henry <james@henry.sc>
2024-05-27 16:12:18 -04:00
Emily Xiong c9f3c05ac9 fix(core): keep version for third party preset (#23284)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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/23174
2024-05-27 15:38:52 -04:00
Emily Xiong a7c5603691 feat(core): clean up show project --json false (#23486)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

<img width="657" alt="Screenshot 2024-05-27 at 1 54 08 PM"
src="https://github.com/nrwl/nx/assets/16211801/b66bbf57-1d75-485f-bf8e-17a28579a7e5">

## 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-05-27 15:37:04 -04:00
Nicholas Cunningham 6292055aba feat(webpack): Support incremental builds via buildLibsFromSource (#25060)
This PR adds the ability for incremental builds when using the Webpack
Plugin.

Instead of using the source library directly, you can now utilize the
output folder by utilizing the `buildLibsFromSource` option within your
webpack.config file, through `NxAppWebpackPlugin`. This means that
instead of accessing `mylib/src/index.ts`, it will access
`dist/mylib/index.js`.

This directly aligns with incremental builds as it ensures that the
build process only recompiles the source doe that has been modified
since the last build.
2024-05-27 14:04:15 -04:00
Jordan Hall ed1f7a68ea fix(core): prevent max buffer issues with bunlock files (#25985)
Fixes #25978 #25965
2024-05-27 13:29:12 -04:00
Jason Jean 901d17d273 chore(release): fix failing snapshots (#26133)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Snapshot tests are failing.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Snapshot tests are fixed

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-27 13:11:27 -04:00
Alice Kile e32b81961f docs(core): elaborate output-style option (#23521)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

`output-style` option's potential values are not explained.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

add description to `output-style` option's potential values

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #20159


![image](https://github.com/nrwl/nx/assets/5159834/15406dcf-80c3-444c-881a-268fcf9704e5)
2024-05-27 11:47:53 -04:00
Nicholas Cunningham 377667eb13 fix(nx-dev): Remove ToC from CI releases page (#26040)
Remove the ToC section from CI releases.

Ref:
https://nx-dev-git-fix-nx-dev-release-page-scroll-nrwl.vercel.app/ci/reference/release-notes
2024-05-27 15:44:32 +00:00
Emily Xiong ef4035a56a feat(graph): add target group for scripts (#26035)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
<img width="1131" alt="Screenshot 2024-05-24 at 3 58 30 PM"
src="https://github.com/nrwl/nx/assets/16211801/9aadeac3-ca74-4449-baf6-21d7c97118aa">

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-27 11:06:29 -04:00
Emily Xiong e0450f7969 fix(graph): show script in header (#26034)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<img width="771" alt="Screenshot 2024-05-24 at 3 48 22 PM"
src="https://github.com/nrwl/nx/assets/16211801/11ad5526-8449-4b9f-9e02-296903855dd5">

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-27 10:36:09 -04:00
James Henry aa2519ff62 fix(js): show lifecycle script contents in publish executor, scrub version in dry-run (#23850)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Lifecycle scripts related to publishing change the output of `npm
publish`, which mixes JSON with non-JSON content despite the `--json`
flag being set. Currently, we will error when attempting to parse the
whole thing as JSON.

The lifecycle scripts contents themselves are not shown to the user.

Additionally, during dry-run we have no choice but to print the version
that currently exists on disk, which can be confusing.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

We extract and parse the JSON from the `npm publish` output, even when
it is mixed with other output. We also show the lifecycle script outputs
to the user, where applicable.

During dry-run, we replace the version in the publish output with a
placeholder to avoid confusion around what would be published.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/22925
2024-05-27 10:20:01 -04:00
Jordan Hall 4cbb0f0988 fix(core): add missing bun PM support (#26084)
This fix add support for bun PM in daemon and affected changes.

Helps towards #26053 fix
2024-05-27 10:00:35 -04:00
Jason Jean 33ba03a81f fix(core): do not re-read from nx.json for dependsOn (#26033)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 `nx.json` `dependsOn` for targets already get merged into the
project configuration. When `nx.json` defines a dependsOn for a target
but a plugin overwrites it, the task graph still considers the dependsOn
from `nx.json`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The task graph is created based on the project configurations.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-27 09:54:22 -04:00
Jason Jean a5b92c53eb fix(core): include dependencies when hashing nx executors (#26024)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Dependencies of executors are not hashed when hashing a task.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Dependencies of executors are hashed when hashing a task.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-27 09:46:37 -04:00
Leosvel Pérez Espinosa e80edfe543 docs(angular): add angular 18 to nx and angular compatibility version docs (#23905)
https://nx-dev-git-docs-update-nx-ng-matrix-nrwl.vercel.app/nx-api/angular/documents/angular-nx-version-matrix

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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. -->
<!-- NXP-757 -->

Fixes #
2024-05-25 14:51:20 -04:00
Nicholas Cunningham af463c4833 feat(nx-dev): Add canary index (#25982)
This PR updates the Algolia search feature to now point to a canary
index for the master branch.

Adding a `.env.local` file allows local development off master.

I also added env vars to Vercel for both `master` and `website-19` to
point to `nx-canary-production` and `nx-production` respectively.
2024-05-24 11:49:29 -06:00
Leosvel Pérez Espinosa 9d6e5ad48c fix(linter): move eslint to peerDependencies and allow eslint 9 (#26013)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-24 17:31:36 +02:00
Jason Jean d7cd6a2597 chore(repo): update nx to 19.1.0-beta.4 (#25989)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

This repo uses Nx `19.1.0-beta.3`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `19.1.0-beta.4`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-24 10:22:47 -04:00
James Henry be6453cfbd fix(linter): migrate no-extra-semi rules into user config, out of nx extendable configs (#26011) 2024-05-24 09:59:58 -04:00
MaxKless 10f97b99bc fix(core): use current user when hashing native file & enable setting its directory via env (#24326) 2024-05-24 09:10:51 -04:00
Miroslav Jonaš 61e4ab2eef fix(core): use zkochan/js-yaml directly to avoid false audit errors (#25999)
Some of the audit tools have been falsely flagging the alias to
`@zkochan/js-yaml` as `js-yaml@0.0.7` (which has security holes) so we
decided to use the package explicitly.

## 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-05-24 12:43:18 +02:00
Jason Jean 12c6a734fc fix(core): cache getting the package manager to the module scope (#25992)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

This function is called many times and they all `exec` a command

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This function is called once and the result is cached.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-23 22:07:29 -04:00
Austin Fahsl 95cea78f66 chore(release): fix e2e test project configuration (#25984)
Fixes an issue with the e2e test project configuration for the Nx
Release e2e tests.
2024-05-23 17:56:52 -04:00
Jason Jean affb98b228 chore(repo): update nx to 19.1.0-beta.3 (#25981)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

This repo uses Nx `19.1.0-beta.1`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `19.1.0-beta.3`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-23 17:45:35 -04:00
Craigory Coppola a4a185f45b fix(misc): various inference plugins caching should track changes (#23315)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
Plugin's cache entries overwrite each other if multiple instances of the
same plugin are running. They also don't remember previous cache states.

## Expected Behavior
Plugin's caches grow as changes are made, and don't overwrite previous
entries.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-23 17:05:05 -04:00
Jack Hsu 445916f18a feat(testing): remove --watch=false from inferred vitest targets to keep things inlined with vitest recommendations (#25975)
Users should use `vitest`, which will run with watch mode for local dev,
and non-watch mode in CI.

If users need to run `affected` or `run-many` locally they can always
pass `--watch=false` manually. This is the same as running through npm
workspaces or other monorepo tools. IMO, users should be running tests
from their IDEs anyway.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-23 16:45:29 -04:00
Isaac Mann a1ba0ad700 fix(js): handle tsconfig file with no compilerOptions (#25966)
Handles adding a root `tsconfig.base.json` when there is a root
`tsconfig.json` with no `compilerOptions` property.

Prerequisites:
Have a repository has a root `tsconfig.json` with no `compilerOptions`
property and there is no root `tsconfig.base.json`.

Steps to reproduce:
1. Generate a js library (`nx g @nx/js:lib my-lib`)

Expected results:
Library is created.

Actual results:
There is an error.

```
 NX   Cannot read properties of undefined (reading 'rootDir')
```

This PR fixes the error.
2024-05-23 15:43:35 -04:00
Emily Xiong 94707d9575 fix(core): fix buildTargetFromScript takes a long time (#25209)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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/25923
2024-05-23 14:44:48 -04:00
Nicholas Cunningham c1b1c5b388 feat(nx-dev): Add more blogs (#25939)
- Add more blogs
- Add privacy policy link
- Fix blog footer link
- Fix discord server link for all blogs
2024-05-23 11:30:25 -06:00
Jason Jean f728058c7c fix(linter): only depend on eslint v8 (#25938)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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/eslint` is bringing in `eslint v9` prematurely.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`@nx/eslint` should not bring in `eslint v9` yet. Though, it does have
support for having `v9` installed at the workspace level.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/25319
2024-05-23 13:23:51 -04:00
James Henry 253de9b985 feat(release): updateDependents generator option for versioning, support circular dependencies (#23252)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

When releasing projects independently, if a dependent project is
untouched directly by the changes, it will not have its version updated
and there is no way to opt into this behavior.

Additionally, circular dependencies between packages are not supported.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

When releasing projects independently, if a dependent project is
untouched directly by the changes, **BY DEFAULT** it will not have its
version updated, **BUT** you can opt into it always being updated via a
generator option (`release.version.generatorOptions.updateDependents =
auto` and you can control what kind of semver bump should be applied to
the otherwise unchanged dependent project. Transitive local dependents
(`A -> B -> C`) will also be updated in this scenario.

Additionally, when opted into, such version only changes will appear in
the changelog under a new `Updated Dependencies` section.

Circular dependencies between packages are now supported for versioning,
changelog generation and publishing.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #22268
2024-05-23 12:51:38 -04:00
Leosvel Pérez Espinosa 37f02f7e6b feat(angular): support angular 18.0.0 (#22509)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #25284
2024-05-23 17:50:04 +02:00
Leosvel Pérez Espinosa 881adfb185 docs(misc): replace angular.io links with angular.dev (#25831)
[Angular.dev](https://angular.dev/) is now the new home for Angular
developers as mentioned in the [Angular 18 release blog
post](https://blog.angular.dev/angular-v18-is-now-available-e79d5ac0affe).

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 NXP-759 -->

Fixes #
2024-05-23 15:58:53 +02:00
Colum Ferry efd0967c7a feat(rspack): support object configs (#402) 2024-05-23 08:01:12 -04:00
dmcweeney 261b0ff002 fix(release): npm publish error when file path contains spaces (#24750)
## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #24682
2024-05-22 22:30:49 -04:00
Jason Jean 7705757c62 fix(misc): adjust npm keywords (#24743)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

NPM Keywords do not include those which are shown under the categories
under the `Discover packages` section. https://www.npmjs.com/

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

NPM Keywords include those which are shown under the categories under
the `Discover packages` section when applicable. https://www.npmjs.com/


![image](https://github.com/nrwl/nx/assets/8104246/ebbd4317-0336-4834-b4eb-0c673a358601)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-22 22:30:10 -04:00
Emily Xiong ebb9233bce fix(js): export setup verdaccio generator (#24008)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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/21500
2024-05-22 18:01:20 -04:00
Jack Hsu 58a28e5ddf fix(js): print warning when --generateLockfile is used with Bun rather than erroring out (#25158)
Currently if you pass `--generateLockfile` and use Bun, it'll error out
because the lockfile content is returned as `null`. There is no API to
prune `bun.lockb` files so it's better to skip it with a warning to the
user. We can discuss generating `yarn.lock` file instead as a follow-up.

## 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-05-22 17:58:59 -04:00
Jason Jean dc5f91beee fix(linter): only set flat config env for eslint v9+ (#25189)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 `ESLINT_USE_FLAT_CONFIG` env flag was set unnecessarily even if the
installed version of ESLint is < 9.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `ESLINT_USE_FLAT_CONFIG` env flag is only set if the value is
different than the default in the installed version of ESLint.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-22 17:48:48 -04:00
Jordan Hall 80702b59c7 feat(core): add bun package manager (#22602)
Bun uses yarn lock for it's binary file. Running the binary will produce
the content of a yarn lock file (v1)

Other option is to use the -y command on add and install. This will
create a yarn lock file and then createLockFile can just modify the
yarn.lock file instead?

This is the PR made from #19113 and pushed due to #22402 being closed.

PS Bun feels more stable since the PR was first created!

This PR will resolve #22283 and start of #21075
2024-05-22 16:51:21 -04:00
James Henry 383be1f7d4 fix(core): more helpful output for format:check --verbose (#23503) 2024-05-22 15:05:32 -04:00
TheWrightDev a9783c7627 docs(nx-cloud): Change exec to dlx for GHA Nx cloud agent command. (#24052)
Node modules are installed yet so exec causes `Command "nx-cloud" not
found. ` error.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
The suggested command in recommended position causes an error.

## Expected Behavior
The suggested command in recommended position would not cause an error.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-22 14:34:56 -04:00
Isaac Mann c412bf2d5e docs(core): ci section for tutorials (#24728)
- update CI section in tutorials to not include screenshots of
onboarding flow
- add CI section to `nx init` tutorials
2024-05-22 11:54:15 -04:00
Colum Ferry 64c6287b83 feat(vite): support incremental builds with nxViteTsPaths (#23908)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
We do not support incremental builds with vite when using inference
plugin


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Support incremental builds with vite when using inference plugin

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-22 16:30:53 +01:00
James Henry 8cfc0a0c08 fix(linter): support eslint v9 (#24632) 2024-05-22 19:27:06 +04:00
Jason Jean 6e6211d072 chore(repo): update nx to 19.1.0-beta.1 (#24023)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

This repo uses Nx 19.0.0-rc.1

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx 19.1.0-beta.1
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-22 10:18:53 -04:00
Chabbey François 32030435b7 docs(core): fix dependsOn snippet in project configuration reference (#23668)
I'm not totally sure, but by reading the docs, the intent of the first
example is to say that the test target depends of the build target.
Otherwise, it would mean that the build target depends of the build
target, which does not make sense. Or did I misunderstood something in
the doc ?

Co-authored-by: U812320 <francoisjulien.chabbey@mobi.ch>
2024-05-22 14:42:18 +02:00
Isaac Mann 89fdd42c80 chore(core): update devcontainer (#23479)
Updates the devcontainer so that it has the correct version of pnpm

Fixes #20419
2024-05-21 18:37:09 -04:00
Emily Xiong 08ef0e4bde feat(graph): show script content in header (#23257)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
![Screenshot 2024-05-15 at 10 32
54 AM](https://github.com/nrwl/nx/assets/16211801/1ef4d67f-94e5-46bd-bcee-b966984e86cd)

<img width="1023" alt="Screenshot 2024-05-08 at 5 53 06 PM"
src="https://github.com/nrwl/nx/assets/16211801/cb9161bd-fc4a-4965-89f7-09ce8d72226e">

<img width="585" alt="Screenshot 2024-05-08 at 5 52 51 PM"
src="https://github.com/nrwl/nx/assets/16211801/760ebe19-1c29-4fad-ba9d-174b8303a362">


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-21 18:11:04 -04:00
Nicholas Cunningham 992ae85192 docs(nx-dev): Add deprecation message for aws-lambda (#23971)
Adds deprecation message for `@nx/aws-lambda` since the module is
deprecated and unmaintained.

Ref: https://www.npmjs.com/package/@nx/aws-lambda

closes: #23520
2024-05-21 13:26:15 -06:00
James Henry b641852d9c chore(repo): teardown local registry in case of setup error (#23470) 2024-05-21 11:05:14 -04:00
Colum Ferry 44429451c8 fix(devkit): combineAsyncIterable should not be blocking when error occurs #21393 (#23400)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
`combineAsyncIterators` has a `finally` block which is blocking
execution waiting for all iterators to be `done` so it can call the
`return` function as cleanup.
This leads to prolonged execution when unnecessary, such as when an
error has occurred.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`finally` block should be non-blocking allowing errors to be immediately
surfaced and execution to stop.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #21393
2024-05-21 10:36:56 -04:00
Younes Jaaidi a7bc3006a4 fix(release): invalid tag for fixed groups without changes (#22800) 2024-05-21 18:29:38 +04:00
MaxKless d8f84893e8 docs(misc): add Nx Console Troubleshooting page to Troubleshooting section (#23869)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-21 10:18:32 -04:00
Isaac Mann aedea54624 chore(nx-dev): check for broken anchor links (#23580)
Checks for broken anchor links, except for links that go to `/nx-api` or
`/blog`
Fixes existing broken anchor links
2024-05-21 09:31:37 -04:00
Leosvel Pérez Espinosa 6be46cfe56 fix(core): install packages per migration when creating commits (#23820)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #23505
2024-05-21 13:34:01 +02:00
Colum Ferry 1255603203 fix(react): applications not using plugin usage should set target defaults (#23582)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Generating applications when `addPlugin: false` is not setting
targetDefaults that are expected to be added by inference plugins to the
individual targets


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When `addPlugin: false`, specifically set `targetDefaults.build`
correctly.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-20 16:41:07 +01:00
Colum Ferry 5813bb321c chore(repo): ensure changes to vite plugin are handled correctly (#23578)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Updating the vite plugin and the config it produces should correctly
fail where needed.
Currently, `@nx/vite` depends on `@nx/js`, however, `@nx/js` also
depends on `@nx/vite`.
There is a circular dependency there which is more difficult to
circumvent.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
To avoid circular dependency issues, move the tests that test the output
of `vite.config.ts` to the `@nx/vite:configuration` specs from the
`@nx/js:library` specs.


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-20 15:49:08 +01:00
Leosvel Pérez Espinosa c240c2685e feat(core): allow executor definition to point to another executor (#23576)
Add support for executor definitions that point to another executor. The
upcoming Angular 18 uses this feature:
https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/build_angular/builders.json#L4,
so we need to be able to resolve the builders correctly using such a
configuration.

Note: the change is also in [the Angular 18
PR](https://github.com/nrwl/nx/pull/22509), where it's tested with the
Angular version that requires it. I'm extracting the change to this PR
to facilitate reviews and reduce the size of the Angular 18 PR.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-20 15:51:14 +02:00
Miroslav Jonaš 0eb86c849c fix(core): fix alias package parsing and pruning for npm (#23474)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #22098
Fixes #21180
Fixes #21009

---------

Co-authored-by: James Henry <james@henry.sc>
2024-05-20 15:21:38 +02:00
Isaac Mann cf33e31be3 docs(core): fix common inputs set link (#23504)
Fix common inputs link
2024-05-20 08:12:09 -04:00
Miroslav Jonas 65e6727bdc chore(repo): remove leftover console from test 2024-05-20 11:18:12 +02:00
Phillip Barta f1ae1bc879 fix(core): remove duplicate js-yaml packages 2024-05-20 10:23:06 +02:00
Jason Jean 352372053c fix(repo): hash proper projects when nx (#23506)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 `prepopulate-local-registry` task was not being hashed according to
the packages properly.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The `prepopulate-local-registry` task is hashing the packages we build
for publishing.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-17 16:42:24 -04:00
Jack Hsu 53345f2241 fix(nextjs): additional experimental HTTPS options (#23334)
There are three additional flags if user wishes to generate their own
key, cert, ca files rather than the auto-generated ones by Next.js.



## Current Behavior
Cannot pass additional CLI options.

## Expected Behavior

Can  pass additional CLI options for custom files.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Closes https://github.com/nrwl/nx/discussions/23331
2024-05-17 14:50:47 -04:00
Emily Xiong 248949f905 feat(graph): change gradle and nextjs svg (#23201)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
change the SVG to match cloud
https://github.com/nrwl/ocean/pull/4907/files

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-17 14:35:12 -04:00
Colum Ferry b90f04ae9b chore(vite): update snapshots in other packages for emptyOutDir (#23502)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-17 19:07:16 +01:00
Nicholas Cunningham d289134bb0 fix(web): Add strict mode for @nx/web (#23497) 2024-05-17 20:29:32 +04:00
Colum Ferry 6f2c6ed352 fix(react): remote generator should update host's app routes (#23499)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
When parsing the source file for updating the host's app.tsx file,
typescript was not parsing the file as a TSX file.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The file should be parsed as TSX

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-17 16:05:51 +00:00
Colum Ferry 9451046a40 fix(vite): add prop to config to ensure output dir is emptied #23382 (#23466)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
We do not generate `emptyOutDir` when creating vite config, which throws
a warning and does not delete the output directory when it is outside
the project root.
This is common in integrated workspaces


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`emptyOutDir` should be added to the config

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23382
2024-05-17 10:05:17 -06:00
Jonathan Cammisuli 3bbc964688 fix(core): only check for err in handleWorkspaceChanges (#23500)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
When there are watch event changes, and we filter them all out, we get
an empty `changedEvents` array. There were previous checks that had a
`!changedEvents.length` condition that resolved to true when the length
was 0.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We now check to see if `err` is set before triggering the error branch

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23031
2024-05-17 11:55:09 -04:00
Emily Xiong a53fee8988 fix(react-native): fix test-setup for react native/expo jest (#23314)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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/23027
https://github.com/nrwl/nx/issues/22198
2024-05-17 11:43:06 -04:00
Leosvel Pérez Espinosa 217a349adc fix(testing): handle existing jest preset file correctly (#23437)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #20449
2024-05-17 08:26:29 -06:00
James Henry 937019b172 chore(repo): disable failing e2e-node test src/node-server.test.ts (#23488) 2024-05-17 08:19:44 -06:00
Colum Ferry 9f712770bf docs(core): clarify automate updating dependencies #23460 (#23465)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 current doc is ambiguous around whether third party packages will be
updated when running `nx migrate`


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Clarify that running `nx migrate` may sometimes update third party
packages

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23460
2024-05-17 15:10:01 +01:00
Jason Jean 443df168c5 docs(core): update node compatibility table (#23443)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 node compatibility table does not have v19 listed.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Node compatibility table has v19 listed with Node v22 supported.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-17 10:02:04 -04:00
James Henry c560b2bba6 Revert "fix(web): Add strict mode" (#23472)
Reverts nrwl/nx#23457
2024-05-17 15:05:29 +02:00
Colum Ferry 4315e91970 fix(angular): @angular/core should always be provided as a shared package #19121 (#23464)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
In our Module Federation utils for Angular, we set some packages that
should always be shared.
This array was missing `@angular/core` which should be shared at all
times for DI to function as expected


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure `@angular/core` is shared

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #19121
2024-05-17 10:59:41 +01:00
Nicholas Cunningham 0f47f03451 fix(web): Add strict mode (#23457)
This PR adds the option of `strict` when using `@nx/web:app` generator.

It also updates the application generator by separating utility
functions into their own modules.


closes: #9238
2024-05-16 21:38:19 -06:00
Craigory Coppola 312b271457 Revert "feat(core): support finding matching projects with only negative patterns (#22743)" (#23459)
This reverts commit 897578676d.

Fixes https://github.com/nrwl/nx/issues/23458
2024-05-16 17:46:34 -04:00
Nicholas Cunningham 1b7cf426c2 fix(node): Docker generator should work (#23452)
Also fixes the unit tests for node package

## Currently

When you generate a docker file using either the node generator or the
node:setup-docker generator using inferred targets would create the
DockerFile but the COPY command would be incorrect.

It would resemble something similar to
```
//...

COPY   acme 

//etc...

```

## Expected

Now it generates the correct command.

```
//...

COPY dist/acme  acme/

//etc...

```

closes: #23365
2024-05-16 15:15:40 -06:00
Nicholas Cunningham 2e630568eb fix(react): respect unitTestRunner passed to the generator (#23383)
closes: #22276
2024-05-16 14:59:57 -06:00
Jack Hsu e4a4121ca4 docs(core): add a page for Nx releases (#23455)
Add a page (under References > Releases) to show current LTS versions
and policies on deprecation and breaking changes. Also link to it from
the Changelog.

Preview:
https://nx-dev-git-docs-releases-nrwl.vercel.app/reference/releases



## 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 #23220
2024-05-16 16:36:36 -04:00
Isaac Mann 195e1824fc docs(core): list version for runtime input (#23456)
Specifies which version of Nx allows `runtime` inputs to be listed in
the `inputs` property.

Fixes #17594
2024-05-16 15:44:07 -04:00
Isaac Mann 04b2067ad5 fix(core): azure ci workflow (#23453)
The Azure pipelines CI generator had an invalid step

`displayName` can't be the first line of a step
2024-05-16 19:11:58 +00:00
Isaac Mann f1f2024ea8 docs(core): fix links (#23378)
Fixes #21793
2024-05-16 14:57:08 -04:00
Louie Weng 22d7ea21cc docs(nx-cloud): update start-ci-run docs with --force flag and cleanup command (#23168)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Updates docs to include `nx-cloud cleanup` command as an alternative to
resetting your system after running `nx-cloud start-ci-run`.

Also provides more context about `nx-cloud start-ci-run`'s check for
local environments and how to bypass this check with the `--force` flag.

## 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-05-16 11:42:06 -07:00
Leosvel Pérez Espinosa 8685e10173 feat(core): resolve nx migrate target version against registry (#23450)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #21418
2024-05-16 19:20:01 +02:00
Craigory Coppola 7a34a4603c fix(core): migrate should warn if package does not exist (#23317)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
Migrations are a noop if the package can't be fetched

## Expected Behavior
There is a warning if the package doesn't exist

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #22308
2024-05-16 12:55:59 -04:00
Colum Ferry 504d0482fa fix(webpack): only add entrypoints if they are intentionally injected #20049 (#23444)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
We are still injecting `styles` and `scripts` even if `inject=false` in
`project.json`.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Do not inject styles and scripts if `inject=false`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #20049
2024-05-16 12:48:14 -04:00
Leosvel Pérez Espinosa 5757350ebd fix(core): do not add an ending new line when serializing a json (#23440)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #19315
2024-05-16 17:44:51 +02:00
Colum Ferry 381e5cd494 fix(vue): ootb unit testing should work with --routing #19921 (#23441)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
When generating a vue application with routing and testing, the test
setup is incorrect and fails


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The test setup for vue applications with routing should work OOTB

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #19921
2024-05-16 09:38:16 -06:00
Phillip Barta e9bf1a2acb chore(misc): remove unused dependency tar-fs (#23421)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
unused dependency `tar-fs`

## 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-05-16 11:28:28 -04:00
Katerina Skroumpelou f0bfb56fae fix(js): fix update package.json (#21415)
Co-authored-by: xiejay97 <xiejay97@gmail.com>
2024-05-16 18:13:38 +03:00
Jonathan Cammisuli 62274c958e chore(core): fix cargo build warnings (#23436) 2024-05-16 11:01:56 -04:00
MaxKless c7f60fcf54 fix(graph): reload graph app only when hash changes in watch mode (#23434) 2024-05-16 10:23:53 -04:00
castleadmin 7f32d8643d feat(bundling): added support for declarations (*.d.ts) (#21084)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
esbuild doesn't support the creation of declaration files (*.d.ts) and
probably never will (see https://github.com/evanw/esbuild/issues/95).
Since declaration files are essential for published libraries,
it would be great if @nx/esbuild:esbuild would provide an option to
output them.

## Expected Behavior

- Introduced a new boolean valued `declaration` option for the `esbuild`
executor
- If `declaration` or the tsconfig option
[declaration](https://www.typescriptlang.org/tsconfig#declaration) is
true,
then the TypeScript compiler is used before esbuild to generate the
declarations
- The output directory structure of the declarations can be influenced
by setting the TypeScript rootDir via the `declarationRootDir` option

## Related Issue(s)
https://github.com/nrwl/nx/issues/20688

### Additional Comment
Please note that the generated declaration files directory structure is
affected by the tsconfig `rootDir` property.

For a library that doesn't reference other libraries inside the
monorepo, the `rootDir` property can be changed freely.
If a library inside the monorepo is referenced the `rootDir` property
must be set to the workspace root.

The `tsc` executor has a sophisticated check that automatically sets the
`rootDir` to the workspace root if a library is referenced.

https://github.com/nrwl/nx/blob/master/packages/js/src/executors/tsc/tsc.impl.ts#L104

This check is quite complex and specific to the `tsc` executor options.
Therefore, it hasn't been included inside the esbuild implementation.

The current implementation leaves it to the user to solve the edge case
by removing the `declarationRootDir` option or by setting the
`declarationRootDir` to `.`.

In the future, it might make sense to generalize and use the `tsc`
executor check.
2024-05-16 17:16:43 +03:00
James Henry 24060dc650 chore(repo): prepopulate verdaccio storage for e2e-ci (#23429) 2024-05-16 10:06:25 -04:00
Colum Ferry b164569e9d docs(angular): bring incremental build docs up to date (#23424)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 incremental build docs for angular are currently outdated


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Bring the incremental build docs up to date


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-16 11:24:07 +01:00
Colum Ferry 34547b30d1 fix(angular): libraries should not contain tslib by default #21023 (#23423)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
When generating buildable and publishable angular libraries, we always
add `tslib` to the `package.json#dependencies`.
These libaries may not actually use this dependency and therefore it is
redundant.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Do not add `tslib` by default.
If users need it, they can add it when they do.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #21023
2024-05-16 11:23:55 +01:00
Jason Jean d581cef194 chore(js): update verdaccio to 5.30 (#23413)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

This repo uses `verdaccio@5.14.4`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses `verdaccio@5.30.0`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/20151
2024-05-15 17:12:12 -04:00
Nicholas Cunningham efdfb694f2 fix(js): Respect loose option provided from config (#23406)
closes: #21937
2024-05-15 14:05:17 -06:00
Craigory Coppola 425d442d44 feat(core): default show to web view when in interactive terminal (#23358)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 show projects` shows unformatted json by default

## Expected Behavior
In a TTY we open web view by default

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #20650
2024-05-15 13:32:27 -04:00
Jonathan Cammisuli 74a2166ca8 docs(core): add documentation about custom steps for nx cloud workflows (#23385)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
There is no documentation for creating custom steps for nx cloud agents

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
There is now a section dedicated to creating custom steps. 

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-15 12:19:02 -04:00
Craigory Coppola 1acbc7e555 fix(core): retry interrupted errors when writing to stdout (#23359)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-15 10:57:07 -04:00
MaxKless 5ce53374c7 fix(core): copy native files to tmp file location instead of .nx/cache (#23375)
## Current Behavior
Currently, the `.node` files required to load native code are saved in
`.nx/cache`. This can cause different issues:
- users on windows sometimes experience errors during `nx reset` because
it's trying to delete the entire folder and some process is still
locking the file
- `@angular-eslint` users are seeing the `.nx/cache` folder in their
workspace since it uses `@nx/devkit`

## Expected Behavior
We want no errors and for noone to be bothered by the `.node` file. This
is why we move the `.node` file to a tmp location outside the workspace
instead of `.nx/cache`. We still make sure to delete it during `nx
reset` but throw no errors if that fails. It will simply be deleted by
the next invocation of `nx reset`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx/issues/23224
2024-05-15 10:46:38 -04:00
Leosvel Pérez Espinosa 9af7386d61 fix(testing): check for project eslint config file in cypress and pla… (#23401)
…ywright configuration generators

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #21301
2024-05-15 10:45:36 -04:00
Colum Ferry c8c1304738 chore(gradle): use -version when logging java version in e2es (#23372)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Java 9 has changed the version flag to single `-`
Our e2es are trying to use `--`


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Use `-version`


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-15 10:16:42 -04:00
MaxKless 5221103242 fix(graph): properly remove <base> tag when generating static graph file (#23399) 2024-05-15 15:31:48 +02:00
Leosvel Pérez Espinosa c4343948ca fix(testing): ignore jest-sequencer- paths in jest resolver (#23396)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #20865
2024-05-15 14:45:07 +02:00
Barry Michael Doyle 38a947f7f8 docs(nx-dev): update define-environment-variables.md changed NX_ to… (#23397)
## Current Behavior
Incorrect environment variable prefix `NX_` in docs.

## Expected Behavior
Correct environment variable prefix `NX_PUBLIC_` in docs.

## Related Issue(s)
https://github.com/nrwl/nx/issues/23362
2024-05-15 12:32:16 +02:00
Emily Xiong a2a7d7eaf7 fix(core): fix eslint --help command (#23274)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-14 21:53:58 -04:00
Jason Jean 722b2d0fac fix(core): fix affected detection for inputs after named inputs (#23354)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Inputs after named inputs are not considered for affected.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Inputs after named inputs are considered for affected...

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-14 20:23:50 -04:00
Jason Jean 09fd1bbd0c chore(core): fix failing unit test (#23392)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Getting inputs sometimes may cause Nx to panic

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Getting inputs will return an error rather than panic which should come
along with stack traces.

Also, a test which sometimes.. triggered the panic... is maybe fixed?

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-14 18:51:14 -04:00
Jason Jean cfadd7d8cf Revert "fix(core): addPlugin should not conflict on project.json targ… (#23391)
…ets (#23264)"

This reverts commit 85c89160

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-14 18:01:30 -04:00
castleadmin e28d872bf6 chore(core): nx plugin submission nx-serverless-cdk (#21085)
<!-- 
_[Please make sure you have read the submission guidelines before
posting an
PR](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#submit-pr)_

# Community Plugin Submission

Thanks for submitting your Nx Plugin to our community plugins list. Make
sure to follow these steps to ensure that your PR is approved in a
timely manner.

## Plugin Requirements

Before you submit your plugin to be listed in our registry, it needs to
meet the following requirements:
- Run some kind of automated e2e tests in your repository
- Include `@nx/devkit` as a `dependency` in the plugin's `package.json`
- List a `repository.url` in the plugin's `package.json`

i.e.

```
{
  "repository": {
    "type": "git",
    "url": "https://github.com/nrwl/nx.git",
    "directory": "packages/web"
  }
}
```

Note: We reserve the right to remove unmaintained plugins from the
registry. If the plugins become maintained again, they can be
resubmitted to the registry.

## Steps to Submit Your Plugin
- Use the following commit message template: `chore(core): nx plugin
submission [PLUGIN_NAME]`
- Update the `community/approved-plugins.json` file with a new entry for
your plugin that includes `name`, `url`, `description`:

Example:

```json
// community/approved-plugins.json

[{
    "name": "@community/plugin",
    "url": "https://github.com/community/plugin",
    "description": "This plugin provides the following capabilities."
}]
```

Once merged, your plugin will be available when running the `nx list`
command, and will also be available in the Plugin Registry on
[nx.dev](https://nx.dev/plugin-registry)
-->

# Community Plugin Submission

## nx-serverless-cdk

nx-serverless-cdk is an Nx plugin for creating AWS CDK applications and
construct libraries inside an Nx monorepo.
It offers the possibility to test and debug infrastructure code and AWS
Lambda functions locally.
The plugin provides the full flexibility of the AWS CDK CLI and the
local AWS SAM CLI commands.
It aims to make the usage of these tools as easy as possible inside an
Nx monorepo.

Author: Tobias Willig
2024-05-14 16:12:55 -04:00
Jonathan Gelin 1393679932 Nx Plugin Submission @huge-nx/conventions (#23291)
HugeNx is a toolkit designed to dynamically generate and manage [Nx
workspaces](https://nx.dev/) by adhering to established workspace
conventions.


![image](https://github.com/nrwl/nx/assets/954509/5ff5153d-eae6-4d99-a9e7-0f3c21e35353)

More info: https://github.com/jogelin/huge-nx
2024-05-14 14:30:22 -04:00
Isaac Mann 6c0ba0ee3a docs(core): local links should not use nx.dev (#23380)
Ensure that local links start with `/` instead of `https://nx.dev/`
2024-05-14 14:19:49 -04:00
Emily Xiong 9122b85616 fix(core): not load env files when NX_LOAD_DOT_ENV_FILES is false (#23231)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #23090
2024-05-14 13:54:24 -04:00
Jason Jean a25c2f6a81 chore(misc): fix failing remove unit tests (#23373)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-14 13:32:17 -04:00
Nicholas Cunningham 66b910644b feat(nextjs): Update Next & Tailwindcss Package (#23313)
Update next.js to `14.2.4`
Update tailwindcss to `3.4.3`
closes: #22918
2024-05-14 10:33:47 -06:00
MaxKless 6c36bef06b fix(core): read socket dir on demand & load .env files on client startup (#23348)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
The daemon doesn't correctly read the `NX_DAEMON_SOCKET_DIR` env
variable if it's set in `.env`.
Also, the `.env` files aren't loaded if the daemon client is imported &
used directly (like it is in Nx Console).


## Expected Behavior
The daemon should correctly read the `NX_DAEMON_SOCKET_DIR` variable
regardless of where it's specified and setting it shouldn't cause any
issues with Nx Console.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes https://github.com/nrwl/nx-console/issues/2114
2024-05-14 11:09:31 -04:00
arekkubaczkowski d4140b06fc feat(react-native): add optional syncDeps param to storybook executor (#22032)
closed #22009

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
storybook executor runs syncDeps automatically without option to disable
it

## Expected Behavior
as per #22009 we might need to disable syncDeps step at some
circumstances.
2024-05-14 10:09:10 -04:00
Piotr Kuczynski 7611671994 docs(release): add configure changelogs (#23324)
## Current Behavior
Documentation is missing

## Expected Behavior
Documentation should be there...

---------

Co-authored-by: Isaac Mann <isaacplmann@gmail.com>
2024-05-14 09:51:26 -04:00
Colum Ferry 88297dd727 fix(vite): migration should handle config object correctly #20921 (#23364)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 migration to update vite config is incorrectly matching other object
literal and arrow functions


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure more accurate updating of vite config file

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #20921
2024-05-14 14:21:22 +01:00
Colum Ferry 3e8496721d fix(webpack): apply-base-config should initialize options it will set #23296 (#23368)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 `@nx/webpack/plugin` will resolve and read webpack options from user
defined config files.
However, it does not set the env vars indicating that a task is being
run, because tasks are not being run at this stage.

This means that certain config properties are not being set by
`applyBaseConfig`.

Users' webpack configs may rely on these properties being set so they
can modify them.
When not set, this throws, meaning the graph cannot be constructed.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Initialize the properties that we usually set when `applyBaseConfig` is
used.


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23296
2024-05-14 14:19:47 +01:00
Colum Ferry 61b7549ba9 chore(repo): e2e matrix (#23363)
## Current Behavior
<!-- This is the behavior we have today -->
E2E Matrix is not running because python 3 on macos does not come with
required modules pre-installed

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Install the required python modules before running `pnpm install`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-14 10:44:29 +01:00
Nicholas Cunningham cc9b7f3b39 Fix/nx dev header enterprise (#23355) 2024-05-13 20:47:36 -04:00
Denis Bendrikov b5d477580e fix(core): properly indent command output with mixed line endings (#23321)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
The command output is not indented when it has mixed line endings
(`crlf` and `lf`)


![image](https://github.com/nrwl/nx/assets/1770529/5f65e9c4-ded2-4fba-a6c8-9f22297b2b35)

## Expected Behavior

![image](https://github.com/nrwl/nx/assets/1770529/c8111456-407e-47af-8129-4efa6f5792ca)

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
2024-05-13 18:53:58 -04:00
Craigory Coppola 593790d471 fix(misc): guard against failure to decode file in migration (#23069)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
A migration in `nx` (escape-dollar-sing-env-variables) does not guard
against non utf-8 files, and can result in a crash during the migration
run.

## Expected Behavior
If it fails to parse a file, we'll log a message and keep going.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #22956
2024-05-13 16:34:59 -04:00
Craigory Coppola 897578676d feat(core): support finding matching projects with only negative patterns (#22743)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
Passing `--projects !tag:someTag` would select 0 projects, since the
only pattern is negative

## Expected Behavior
Passing `--projects !tag:someTag` would select X projects, where X is
the number of projects without someTag.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-13 16:33:06 -04:00
Nicholas Cunningham d879279fc1 fix(nextjs): Moving a library using @nx/workspace:move should update … (#23311)
## Current
When you using `@nx/workspace:move` after create a Next.js library the
server path remains unchanged.

## Expected
The server path is changed as well as the main entry point for the
library path.

Fixes: #20821
2024-05-13 12:48:27 -06:00
Colum Ferry 61255ce540 fix(js): copy assets handler should correctly handle assets on windows (#23351)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
CopyAssetsHandler was not outputting the assets in the correct location
due to issues with `path/posix`.
`path/posix` is required for some areas of this code, like `minimatch`.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`minimatch` ignores should continue to work as expected
assets should be output to the correct location

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-13 19:44:53 +01:00
Jason Jean 461b901a38 fix(linter): fix migrating projects with the eslint plugin (#23147)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Creating a new project with ESLint is mistakenly creating a
`eslint.base.config.js`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Creating a new project with ESLint only creates a
`eslint.base.config.js` file when the repo was originally standalone and
the second project is made.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-13 14:27:56 -04:00
Leosvel Pérez Espinosa 5fea49a980 fix(vite): generate vitest cache dir scoped to each project root and normalize vite cache dir (#23330)
- Update Vitest `cache.dir` to be scoped to each project root to avoid
collisions (same as what's already done for Vite)
- Normalize Vite `cacheDir` to avoid trailing `/.` paths for root
projects
- Fix Remix & Storybook Vite `cacheDir` generation 

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #21775
2024-05-13 14:14:43 -04:00
Isaac Mann 0bfd75f8b3 fix(nx-dev): move table of contents down (#23350)
Move the top of the table of contents down
2024-05-13 14:02:48 -04:00
Colum Ferry 61129f49c2 fix(storybook): should handle inferred cypress when generating cypress project #21770 (#23327)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 `@nx/storybook:cypress-project` generator expects there to be a
defined target for e2e target.
However, since the introduction of inference, this may not be the case.
This results in the generator erroring


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `@nx/storybook:cypress-project` generator should handle inference
and generate an appropriate cypress.config.ts file


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #21770
2024-05-13 18:23:14 +01:00
Jack Hsu 99543b5a01 docs(core): update rescope message from Nx 19 to 20 (#23349)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-13 12:55:21 -04:00
Leosvel Pérez Espinosa 1a981f749e fix(testing): resolve absolute paths for ts path mappings in jest resolver (#23346)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #22617
2024-05-13 18:42:16 +02:00
Jason Jean 6f197e910c fix(core): throw a specific error for print-affected and affected graph (#23336)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

A non-descriptive error is thrown when using the recently removed
`print-affected` and `affected:graph` commands.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

A descriptive error is thrown when using the recently removed
`print-affected` and `affected:graph` commands.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-13 12:04:03 -04:00
Jack Hsu 0f5e14ce2c chore(repo): update deps to remove critical vulnerabilities (#23338)
The root `package.json` has two deps that resulting critical
vulnerabilities.

```
$ pnpm audit --audit-level=critical
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ critical            │ Cross-realm object access in Webpack 5                 │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ webpack                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ >=5.0.0 <5.76.0                                        │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=5.76.0                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │                                                        │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-hc6q-2mpp-qw7j      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ critical            │ Babel vulnerable to arbitrary code execution when      │
│                     │ compiling specifically crafted malicious code          │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ @babel/traverse                                        │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ <7.23.2                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=7.23.2                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │                                                        │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-67hx-6x53-jw92      │
└─────────────────────┴────────────────────────────────────────────────────────┘
46 vulnerabilities found
Severity: 6 low | 26 moderate | 12 high | 2 critical
```

`webpack` is caused by outdated `@nestjs/cli`, which is now `^10.0.2` in
`packages/nest/src/utils/versions.ts`. `styled-components` is not needed
so is removed.

## 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-05-13 12:03:36 -04:00
Colum Ferry 85c8916087 fix(core): addPlugin should not conflict on project.json targets (#23264)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Calculating conflicts in target names does not consider if the
project.json defined targets will actually be impacted by the plugin
that wants to be added creating false negatives

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Calculating conflicts should be more accurate

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #22476
2024-05-13 10:53:09 -04:00
Isaac Mann 08654e1966 feat(nx-dev): put banner above menu (#23335)
Moves the banner above the menu
2024-05-13 10:40:13 -04:00
Nicholas Cunningham 9cd0b420d1 feat(react): Add SvgOptions for NxReactWebpackPlugin and WithNx (#23283)
This PR adds the ability to now override our svg options by providing
them either using `NxReactWebpackPlugin` for react apps or `withNx` for
Next.js apps

```
new NxReactWebpackPlugin({
  svgr: {
    svgo: true,
    titleProp: true,
    ref: true,
  }
}),
  ```

This now gives you control on customizing how the svg is handled. Should you need to enable svgo you can provide the config using `svgr.config.js`

https://react-svgr.com/docs/options/#svgo

closes: #9487
2024-05-13 08:15:44 -06:00
James Henry 8cda56ed36 fix(nx-cloud): ensure generated ci workflows use dlx for nx-cloud (#23333) 2024-05-13 17:50:30 +04:00
Colum Ferry 4f316085d8 fix(core): workspace remove generator should handle no root jest config (#23328) 2024-05-13 16:34:49 +04:00
Dmitry Zakharov 7561e71b1a fix(linter): rename languageSettings to languageOptions for flat config migration (#22924) 2024-05-11 14:58:30 +04:00
Denis Bendrikov 1ef6f27aba fix(linter): log transpilation errors of workspace rules (#21503) 2024-05-11 14:55:08 +04:00
Mehrad Rafigh f7dcf433c3 fix(core): include more binary extensions (#22788) (#22861) 2024-05-10 18:50:11 -04:00
Isaac Mann 186a420a74 docs(core): decisions section (#23038)
Create an "Organizational Decisions" section under Concepts for
recommendations and discussions about how to set up Nx that aren't firm
requirements.
2024-05-10 15:42:46 -04:00
Patrick P 88ac601798 fix(js): Adds mjs files to prettierrcNameOptions (#21796)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
when running a generator, it does not check for the existence of a
prettier.config.mjs or .prettierrc.mjs file

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When using a generator, it check for the existence of all config file
names specified in the docs.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->


Fixes https://github.com/nrwl/nx/issues/21795

adds .mjs file names to checks
2024-05-10 13:26:34 -06:00
Jason Jean efe4cb1e47 fix(misc): move e2e-ci to a separate parallel 1 command (#23305)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 generated `ci-workflow` runs `e2e-ci` with `parallel: 3` by default.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The generated `ci-workflow` runs `e2e-ci` in a separate step with
`parallel: 1`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-10 14:47:52 -04:00
MaxKless e4223b3b31 docs(nx-cloud): fix nx-cloud validate command example path (#23306) 2024-05-10 17:42:14 +02:00
Patrick Sullivan 77e926a057 docs(core): fix jest link text (#23286)
- revised the user-facing link name for the Jest link in the "Set up"
section to accurately read `@nx/jest` instead of `@nx/playwright`
2024-05-10 17:29:45 +02:00
Leosvel Pérez Espinosa fd71b6bcab cleanup(misc): improve check for whether stats should be recorded (#23234)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-10 11:22:06 -04:00
Colum Ferry 7cf09a677f fix(vite): support passing --watch to inferred vitest commands (#23298)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
We currently do not handle passing `--watch` when running inferred
`vitest` commands

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We should support handling `--watch`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23185
2024-05-10 15:31:59 +03:00
James Henry 613fdb07c2 fix(linter): ensure all spreads are removed from rules before parsing (#23292) 2024-05-10 14:03:05 +04:00
Zz 16217634e5 docs(core): fix deployment docs example code (#23289)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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

Using example code directly will result in an error because a
`PackageJson` object cannot be parsed to the `writeFileSync` function.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Replace the `writeFileSync` fn with the `writeJsonFile` fn from
'@nx/devkit'
2024-05-10 10:30:06 +02:00
Isaac Mann 1a85787e1c docs(core): fix reference to missing example (#23281)
Fixes #20946
2024-05-09 22:04:54 -04:00
Isaac Mann 0e199cdf11 feat(nx-dev): check for missing images (#23248)
Checks for broken image links
2024-05-09 15:59:47 -04:00
Jonathan Cammisuli 6dd9455b67 docs(core): add launch template validation section (#23268)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
There is no documentation on how to use `nx-cloud validate`

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
There is now documentation showing how to validate custom launch
templates using `nx-cloud validate`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-09 14:37:36 -04:00
Nicholas Cunningham 0322b9804f fix(module-federation): Throw an error if remote is invalid (#23100)
If you are generating a remote using `--dynamic` either by using the
`host` generator or the `remote` generator we now check to ensure that
the remote name is a valid JavaScript variable.

If this is not done the app with be invalid and unable to be ran or
bundled.


closes: #23024
2024-05-09 11:19:50 -06:00
Nicholas Cunningham bdac1e2a6f docs(nx-dev): Add 404 for unknown blog urls (#23267)
This PR adds the 404 fallback if a user navigates to a specified blog
that does not exist.

Currently, we are showing a 500 error.
2024-05-09 09:30:33 -06:00
Isaac Mann f489fbef8e feat(nx-dev): show banner on documentation pages (#23266)
Show the banner on documentation pages
2024-05-09 10:36:34 -04:00
Isaac Mann 25574ae614 docs(core): rearrange tutorial files (#23265)
Moving files around.
No visible website changes.
Deleted core tutorial files (that wasn't linked anywhere in the
navigation)
2024-05-09 09:12:54 -04:00
James Henry d5945bd173 fix(linter): ensure config.rules is spread into rules in flat config migration (#23263) 2024-05-09 15:06:27 +02:00
Isaac Mann bf51d19600 docs(core): redirect bad nx 19 blog link (#23260)
Redirects incorrect link to the Nx 19 blog post
2024-05-09 14:25:12 +02:00
Edward Wang 8f25ade650 fix(webpack): publicPath and rebaseRootRelative (#20992)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
 can not configure webpack publicPath with NX option.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
 make the publicPath work with postcssCliResources.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2024-05-09 12:39:29 +01:00
Jason Jean 8f705e31e2 fix(misc): adjust deprecation messages to v20 (#23223)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Breaking Changes:


BREAKING CHANGE: `nx print-affected` was deprecated in 16.4.0 and has
been removed.
BREAKING CHANGE: `nx affected:graph` was deprecated in 16.4.0 and has
been removed.
BREAKING CHANGE: The `criticalPath` and `affectedProjects` properties of
the JSON created by `nx graph --file graph.json` was deprecated in
16.2.0 and has been removed.

## Current Behavior
<!-- This is the behavior we have today -->

Some deprecation messages still reference v19.

`nx print-affected` was deprecated in 16.4.0 to be removed in Nx 19 but
was not removed.
`nx affected:graph` was deprecated in 16.4.0 to be removed in Nx 19 but
was not removed.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Deprecation messages reference v20 now.

`nx print-affected` is removed.
`nx affected:graph` is removed.

There are redirects to a `deprecated` page describing those commands for
Nx users using Nx <19

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-08 21:54:41 -04:00
Jason Jean dc20a3b462 chore(repo): update stale bot configuration (#23255) 2024-05-08 18:07:51 -04:00
Jack Hsu 4106691d33 fix(core): update getLastValueFromAsyncIterableIterator to support AsyncIterables returned from executors (#23229)
When an executor returns an `AsyncIterable` Nx fails because it cannot
read the value using `getLastValueFromAsyncIterableIterator` (which only
supports `AsyncIterableIterator`. This PR updates it to support both so
executors like `@nx/rollup:rollup` will work.


<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
Running Nx command fails if executor returns `AsyncIterable` e.g. by
calling `createAsyncIterable`.

## Expected Behavior
Nx command succeeds when executor returns `AsyncIterable`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23028
2024-05-08 18:07:14 -04:00
Bouzid Badreddine 078dd06dd9 add missing minus (#22252)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-08 16:22:32 -04:00
Nicholas Cunningham 79ee857380 docs(nx-dev): Update docs sidemenu enabling the close button (#23254)
This PR fixes the issue where the close button was not working in the
nx-dev documentation pages after opening the overflow menu.
Now, the close button functions correctly.
2024-05-08 14:18:37 -06:00
Taylor Braun-Jones 0bfeea6be3 preserving-git-histories.md: Move files _before_ merging (#20289)
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-05-08 15:28:51 -04:00
mot 3e63bc0754 docs(core): update define-environment-variables.md (#21727)
add `dotenvx` example. 


## Current Behavior

* env-cmd only

## Expected Behavior

* include dotenvx example 

## Related Issue(s)
N/A

Fixes #
N/A
2024-05-08 15:22:27 -04:00
Craigory Coppola 5542350e16 fix(core): show project --web shouldn't error (#23251)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-08 14:57:03 -04:00
Leosvel Pérez Espinosa 2460c89047 fix(core): set yarn berry nodeLinker correctly in migrate command (#23249)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #23222
2024-05-08 19:55:26 +02:00
Robin Csutorás a08133f440 feat(module-federation): add remote configuration override (#19694)
## Current Behavior

The configuration of the served MFE always passed to the remotes. If a
new configuration is needed to skip one remote (e.g.
`serve:skip-remote1`) but `remote2` then a configuration called
`skip-remote1` is needed in the `remote2`.

## Expected Behavior

Add an ability to override the configuration and the empty
configurations in the remotes can be deleted.

## Related Issue(s)

Fixes #19693
2024-05-08 18:52:37 +01:00
Isaac Mann 0066543096 fix(nx-dev): fix home page mobile menu (#23250)
Fix the home page mobile menu
2024-05-08 11:47:23 -06:00
James Henry 3970a1e288 fix(release): ensure changelog renderers are resolvable when processing config (#23214) 2024-05-08 13:21:47 -04:00
Isaac Mann 8363ba4a5e docs(core): intro updates (#23247)
Update the Editor setup page
Add more features to the intro page
2024-05-08 12:34:52 -04:00
Isaac Mann a05d38931b docs(core): collapse concepts and recipes (#23246)
Collapse concepts and recipes top level sections

Also make sure that sidebar expands to the active link even if it is
multiple sections down
2024-05-08 12:34:46 -04:00
Emily Xiong a2d9f9cc16 fix(gradle): run gradle init if no settings.gradle (#23226)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-08 12:23:25 -04:00
Jack Hsu dfb994d185 docs(core): fix more images to point to webp (#23245)
Missed two images in last PR.

<!-- Example: `fix(nx): must begin with lowercase` -->

## 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-05-08 11:57:20 -04:00
Jack Hsu 3a7e657f4f docs(core): fix images to point to webp (#23244)
A few images were missed when converting to webp.

## 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-05-08 11:38:53 -04:00
Jack Hsu ef85a63073 docs(core): add missing option for dep-checks lint rule (#23238)
This option was added in https://github.com/nrwl/nx/pull/20157 but never
made it into docs.

<img width="951" alt="Screenshot 2024-05-08 at 9 34 00 AM"
src="https://github.com/nrwl/nx/assets/53559/b43fc774-2a68-49b2-8709-b43a685a520b">
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-08 10:50:20 -04:00
Isaac Mann c8576261c9 docs(core): revert (#23239)
Revert "docs(core): collapse concepts and recipes (#23219)"

This reverts commit f13a9608b1.
2024-05-08 10:24:29 -04:00
Zachary DeRose 59bd199e33 docs(core): Nx 19 blogpost (#23207)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->


https://nx-dev-git-feat-nx-19-blogpost-nrwl.vercel.app/blog/2024-05-07-nx-19-release

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-05-08 10:22:39 -04:00
Mike Peters 1449d1acc1 fix(webpack): don't overwrite output config (#22116)
## Current Behavior

Some webpack output options, like `filename` are overwritten when using
the `NxWebpackPlugin`, e.g.

```ts
module.exports = {
  output: {
    path: join(__dirname, '../../dist/apps/my-app'),
    // this has no affect:
    filename: ({ runtime }) =>
      migrationEntryPoints.some(({ entryName }) => entryName === runtime)
        ? 'migrations/[name].js'
        : '[name].js',
  },
  plugins: [
    new NxWebpackPlugin({ ... }),
  ]
};
```

## Expected Behavior

The `NxWebpackPlugin` should preserve base config where it makes sense.

I think this is the intended behaviour, but required some extra
parentheses to behave correctly.
2024-05-08 14:12:08 +00:00
Leosvel Pérez Espinosa 4cc3dc6960 fix(misc): create workspaces and default app with the name as provided (#23196)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 #19253
2024-05-08 17:33:47 +04:00
Isaac Mann f13a9608b1 docs(core): collapse concepts and recipes (#23219)
Collapse the concepts and recipes sections by default

![Screenshot 2024-05-07 at 11 34
05 AM](https://github.com/nrwl/nx/assets/861504/1428c5e9-9c46-4001-b9dc-d06e2efa086d)
2024-05-08 08:32:24 -04:00
andriizavoiko 46336df3a4 fix(bundling): resolve index files from ts paths when running esbuild without bundling (#23098)
## Current Behavior
During build process a file `tmp/<path>/main-with-require-overrides.js`
is generated to handle `paths` resolutions from `tsconfig` when
`esbuild` is not running in `bundle` mode.

Having following `tsconfig.json` as example
```json
{
  ...
  "compilerOptions": {
    ...
    "paths": {
      "@lib/lib1": ["libs/lib1/src/index.ts"],
      "@app1/*": ["apps/app1/src/*"],
    }
  }
}
```

We can use `lib1` in code as follows and during runtime it will
automatically be resolved to `dist/apps/app1/libs/lib1/src/index.js`:
```js
// apps/app1/src/main.ts
import lib1 from '@lib/lib1';
```

Hovewer, when trying to use paths with wildcards, e.g.:
```js
// apps/app1/src/config/index.ts
const config = {};
export default config;

// apps/app1/src/main.ts
import config from '@app1/config';
```

It gets resolved to `dist/apps/app1/apps/app1/src/config.js` and
`isFile` condition fails as such module doesn't exist, thus path is not
replaced and runtime error is produced.

## Expected Behavior
During resolution of following code:
```js
import config from '@app1/config';
```

`_resolveFilename` should consider all possible combinations of module
path - `dist/apps/app1/apps/app1/src/config.js` and
`dist/apps/app1/apps/app1/src/config/index.js`
2024-05-08 13:17:10 +01:00
Mateo Tibaquirá 7dd7c2bab8 fix(webpack): fix default compiler option (#22762)
Given a configuration without `options.tsConfig` the `babel` compiler
breaks in `createLoaderFromCompiler` where the babel case uses
`path.join(options.root, options.tsConfig)` and throws an exception if
it's undefined.

## Current Behavior


In my case, the root `package.json` generates a dependency in the tree
with "empty" options:
```
{
  root: '/root/of/my/monorepo/monorepo',
  projectRoot: '',
  sourceRoot: '',
  outputFileName: undefined,
  outputPath: undefined,
  assets: [],
  target: 'web',
  projectName: undefined,
  targetName: undefined,
  configurationName: undefined,
  projectGraph: undefined
}
``` 
which breaks the project graph with this exception:
```
Unable to read angular.json
[Failed to process project graph.
  The "@nx/webpack/plugin" plugin threw an error while creating nodes from src/backend/server/webpack.config.js:
    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
        at new NodeError (node:internal/errors:405:5)
        at validateString (node:internal/validators:162:11)
        at Object.join (node:path:1171:7)
        at createLoaderFromCompiler (/monorepo/node_modules/.pnpm/@nx+webpack@18.2.2_@swc-node+register@1.9.0_@swc+core@1.3.107_@types+node@18.16.9_nx@18.2.2_t_auhl3zn4afi4laot7gdsrcezcy/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/compiler-loaders.js:50:58)
        at applyNxDependentConfig (/monorepo/node_modules/.pnpm/@nx+webpack@18.2.2_@swc-node+register@1.9.0_@swc+core@1.3.107_@types+node@18.16.9_nx@18.2.2_t_auhl3zn4afi4laot7gdsrcezcy/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:314:61)
        at applyBaseConfig (/monorepo/node_modules/.pnpm/@nx+webpack@18.2.2_@swc-node+register@1.9.0_@swc+core@1.3.107_@types+node@18.16.9_nx@18.2.2_t_auhl3zn4afi4laot7gdsrcezcy/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:36:5)
        at configure (/monorepo/node_modules/.pnpm/@nx+webpack@18.2.2_@swc-node+register@1.9.0_@swc+core@1.3.107_@types+node@18.16.9_nx@18.2.2_t_auhl3zn4afi4laot7gdsrcezcy/node_modules/@nx/webpack/src/utils/with-nx.js:15:49)
        at combined (/monorepo/node_modules/.pnpm/@nx+webpack@18.2.2_@swc-node+register@1.9.0_@swc+core@1.3.107_@types+node@18.16.9_nx@18.2.2_t_auhl3zn4afi4laot7gdsrcezcy/node_modules/@nx/webpack/src/utils/config.js:23:28)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async readWebpackOptions (/monorepo/node_modules/.pnpm/@nx+webpack@18.2.2_@swc-node+register@1.9.0_@swc+core@1.3.107_@types+node@18.16.9_nx@18.2.2_t_auhl3zn4afi4laot7gdsrcezcy/node_modules/@nx/webpack/src/utils/webpack/read-webpack-options.js:17:18)] {
  name: 'ProjectGraphError'
}
```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

The default values should fallback properly without throwing an
exception for this case.

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2024-05-08 13:16:26 +01:00
Matthias Stemmler b4f6e425c4 fix(vite): get tsconfig from new path including target (#22775)
## Current Behavior
Since v18.2.3 (e4c4697f69) the
`tsconfig.generated.json` file generated if `"buildLibsFromSource":
false` is placed under a path containing the current build target. The
`nx-tsconfig-paths` plugin of `@nx/vite` was not updated accordingly, so
now it doesn't find `tsconfig.generated.json`, effectively causing
`@nx/vite` to ignore the `"buildLibsFromSource": false` setting.

## Expected Behavior
With this PR, `nx-tsconfig-paths` finds `tsconfig.generated.json` at the
correct path, so `"buildLibsFromSource": false` works as it did before
v18.2.3.
2024-05-08 12:30:07 +01:00
Sean Sanker 1502433673 fix(vite): don't generate tasks for remix projects (#22551)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
Attempting to use Remix + Vite results in a few errors. I assume this is
due to the vite and remix plugins conflicting with each other.

One of which being:
```
Failed to process project graph.
  The "@nx/vite/plugin" plugin threw an error while creating nodes from myremixapp/vite.config.ts:
    Error: Missing "root" route file in /Users/username/work/remix-demo/app
        at Object.resolveConfig (/Users/username/work/remix-demo/node_modules/@remix-run/dev/dist/config.js:154:11)
        at updateRemixPluginContext (/Users/username/work/remix-demo/node_modules/@remix-run/dev/dist/vite/plugin.js:367:9)
        at config (/Users/username/work/remix-demo/node_modules/@remix-run/dev/dist/vite/plugin.js:598:7)
```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
It should work just like it currently does for Remix Classic.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
#22035

## PR Status
This is a very early draft. I don't think this is a good approach but it
does work for me at the moment. I'm not sure exactly how we can discern
a remix project from a vanilla vite project (that you can use standard
tooling for) without parsing the `package.json` or `vite.config.ts` and
searching for remix-specific content.

## Steps to reproduce my current state
Set up a standard @nx/remix project as shown
[here](https://nx.dev/recipes/react/remix).
Follow the instructions
[here](https://remix.run/docs/en/main/future/vite#migrating) from
`Migrating` down to but NOT including `Migrating a custom server`.

Once I use the modified @nx/vite code provided in this PR, I'm able to
run `npx nx dev [app-name]` successfully.

## A Personal Note
I'd love to contribute more to nrwl/nx.
I'm quite a fan of Nx and use it in a few separate projects. 
That being said, I don't currently have a comprehensive knowledge of its
internals.
If anyone wants to give me some guidance (text-based or we can hop on a
call), I'd be more than happy to contribute the rest of this myself (and
other fixes).

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2024-05-08 11:45:46 +01:00
Krystian Sowiński ea5c910e12 fix(bundling): rollup does not log build errors (#23141)
closed 22896

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
given using @nx/rollup:rollup executor
when an error is thrown
then no message is logged (just stacktrace)

## Expected Behavior
error message to be displayed (as it was till v18.2.0)

## Related Issue(s)

Fixes #22896
2024-05-08 11:22:24 +01:00
Isaac Mann fd78152377 docs(core): monorepo world banner (#23225)
Add a banner on the nx.dev home page pointing to monorepo.tools/conf
2024-05-07 16:28:42 -04:00
Emily Xiong b666c6b38a fix(gradle): use local gradlew instead of sdkman (#23205)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-07 14:03:48 -04:00
Daniel Santiago d9a97120f6 feat(core): add an option to seperate the output of show with provide… (#23172)
Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
2024-05-07 13:55:41 -04:00
Nicholas Cunningham 5edc64af92 docs(core): Add blog author details to nx-dev blog page (#23206)
This PR adds a context view for blog authors that displays details about
their social.

It will be show on the blog details page.

Here is an example:
![Screenshot 2024-05-07 at 7 31
16 AM](https://github.com/nrwl/nx/assets/338948/3abb1cce-e4bd-400c-9a1b-151254630bef)

![Screenshot 2024-05-07 at 7 37
38 AM](https://github.com/nrwl/nx/assets/338948/042bf376-a33d-44a3-addd-812953dd4d65)
2024-05-07 10:20:01 -06:00
Leosvel Pérez Espinosa 8160f5879b feat(testing): updates cypress and @cypress/webpack-dev-server (#22902)
Updates `cypress` and `@cypress/webpack-dev-server` versions in
preparation to support the upcoming Angular v18, which requires support
for `webpack-dev-server` v5. The new versions are backwards compatible,
so they can be updated in advance.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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 NXP-705 -->

Fixes #
2024-05-07 18:03:18 +02:00
Isaac Mann 53693fdd1c docs(core): remove nx connect flow from docs (#23204)
Recommend people log in to `nx.app` and connect their repository instead
of running `nx connect` from the command line
2024-05-07 11:37:29 -04:00
Leosvel Pérez Espinosa d1c4073809 feat(misc): improve nx cloud setup prompts and messaging (#23218)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-07 11:36:29 -04:00
Nicholas Cunningham d8ab165009 Feat/migrate more blogs (#23203)
This PR adds 4 more blogs to the `/blog` on nx.dev
2024-05-07 09:18:43 -06:00
Isaac Mann 62431372f1 docs(core): gradle webp images (#23217)
Squoosh images
2024-05-07 10:43:35 -04:00
Colum Ferry bf90604180 fix(module-federation): nested projects should be ordered first when reading from tsconfig paths #20284 (#23212)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->
When using nested projects (note: not secondary entry points), the
`shareWorkspaceLibraries` needs to order the nested projects first for
webpack to resolve the import path aliases correctly.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure nested projects are ordered first when reading tsconfig path
aliases

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #20284
2024-05-07 09:57:09 -04:00
Isaac Mann e8041bbb90 docs(core): monorepo world menu item 2024-05-07 14:58:48 +02:00
Leosvel Pérez Espinosa 0e56533d01 docs(angular): call out @nx/angular:dev-server is required when using @nx/angular build executors (#22883)
- Calls out the `@nx/angular:dev-server` executor as required when using
`@nx/angular` build executors
- Improves & aligns executor descriptions and examples

Main docs updated with the callouts:


https://nx-dev-git-fork-leosvelperez-docs-angular-executors-nrwl.vercel.app/nx-api/angular/executors/application

https://nx-dev-git-fork-leosvelperez-docs-angular-executors-nrwl.vercel.app/nx-api/angular/executors/browser-esbuild

https://nx-dev-git-fork-leosvelperez-docs-angular-executors-nrwl.vercel.app/nx-api/angular/executors/webpack-browser

https://nx-dev-git-fork-leosvelperez-docs-angular-executors-nrwl.vercel.app/nx-api/angular/executors/dev-server

The rest of the Angular executors' descriptions were also updated.

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-07 11:34:22 +02:00
Isaac Mann 1fe262ad7d docs(core): gradle tutorial (#22942)
Create a Gradle tutorial


https://nx-dev-git-fork-isaacplmann-docs-gradle-tutorial-nrwl.vercel.app/getting-started/tutorials/gradle-tutorial

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2024-05-06 14:18:07 -04:00
Jason Jean 41d21ab9ac fix(misc): make generated ci workflow work without nx-cloud (#23199)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

`ci-workflow` generators error if Nx Cloud has not been enabled.

With the new Github onboarding flow, there is a chicken or the egg
problem.

The Github onboarding flow creates a PR but we don't have a pipeline to
run against it. To create the pipeline, Nx Cloud has to be enabled...
which... creates a lackluster PR.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`ci-workflow` generators do not error if Nx Cloud has not been enabled.
This way, the `ci-workflow` generator will be able to create a workflow,
which the PR made by Nx Cloud's Github onboarding flow will be run
against.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-06 12:54:53 -04:00
Leosvel Pérez Espinosa f13dcce8a9 fix(core): ensure setting up nx cloud in nx migrate using the generator from the installed latest version (#23194)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

Choosing to set up Nx Cloud during `nx migrate` executes the generator
from the locally installed packages. This leads to the user getting an
outdated flow and messaging.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Choosing to set up Nx Cloud during `nx migrate` should execute the
generator from the installed latest version to ensure the user gets the
up-to-date flow and messaging.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-06 16:31:11 +02:00
Leosvel Pérez Espinosa 35dec92b92 chore(repo): fix windows nightly pipeline definition (#23191)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 -->

## 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-05-06 16:30:46 +02:00
Leosvel Pérez Espinosa 1ab1fa5e0b fix(core): forward process execArgv when using the native runner (#23195) 2024-05-06 10:00:24 -04:00
Zack Chapple dd38050713 feat(rspack_: update rspack to install latest version (#389) 2024-04-16 11:01:42 +01:00
Nicholas Cunningham d3e7363b1c fix(rspack): User port should be respected. (#387)
closes: https://github.com/nrwl/nx/issues/22726
2024-04-09 08:46:05 -04:00
Colum Ferry 0f2218f003 fix(rspack): ensure react-refresh is installed (#385) 2024-03-08 13:21:43 -05:00
Colum Ferry 461e017d93 fix(rspack): do not depend directly on ajv to allow for correct hoisting (#384) 2024-03-08 11:00:19 -05:00
Colum Ferry 55d1d56ff7 feat(rspack): add option to keep existing versions of packages for init generator (#378) 2024-03-06 12:28:30 +00:00
Colum Ferry a2d91f0c8e feat(rspack): update rspack to install the latest version (#379) 2024-03-06 11:59:15 +00:00
Colum Ferry d29336e1fa chore(repo): migrate to latest nx (#376) 2024-02-22 08:41:07 -05:00
Colum Ferry 2cbdbb0e7c chore(repo): migrate to latest nx (#376) 2024-02-22 08:41:07 -05:00
Nicholas Cunningham 1e39bb3d00 fix(rspack): Add missing peer dep (#372) 2024-01-23 15:15:27 -05:00
Gengkun 712688cada feat: upgrade rspack to 0.4.4 (#352)
* feat: upgrade rspack

* fix less

* disableTransformByDefault

* update

* enable disableTransformByDefault

* fix

* rebase

* fix

* fix

* clean

* fix
2023-12-21 08:39:51 -05:00
Travis Tarr 768bea744d feat(rspack): add generatePackageJson plugin (#341)
Co-authored-by: Travis Tarr <travis.tarr@streamersonglist.com>
2023-10-30 17:05:47 +02:00
Travis Tarr 66169bd63e feat(rspack): add generatePackageJson plugin (#341)
Co-authored-by: Travis Tarr <travis.tarr@streamersonglist.com>
2023-10-30 17:05:47 +02:00
Jason Jean 68003f3b2f chore(repo): update nx to 17.0.1 (#342) 2023-10-20 16:02:58 -04:00
Douglas Machado c4667924d8 feat(rspack): add typecheck (#338)
* feat(rspack): add typecheck

* Reusing the type-check existing on the @nx/js
2023-09-14 14:33:31 -04:00
Jason Jean dd060a8d00 chore(repo): update nx to 16.8.1 (#335) 2023-09-08 16:48:24 -04:00
hardfist afc5a69cb2 chore: don't use rspack internal module (#328) 2023-08-23 07:03:42 +00:00
Katerina Skroumpelou 41c077a0ec chore(rspack): add jest babel config to e2e (#321) 2023-08-22 10:55:42 -04:00
Jason Jean d86ae220f7 chore(reop): update nx to 16.7.1 (#325) 2023-08-18 11:51:01 -04:00
Douglas Machado 332e5021e2 fix(rspack): add fileReplacements support (#231) 2023-08-08 17:15:36 +03:00
Colum Ferry 87c0012524 chore(repo): upgrade to nx 16.6.0 (#319) 2023-08-02 10:21:10 -04:00
Jack Hsu 92c71c640c fix(rspack): add missing license-webpack-plugin dependency (#301) 2023-06-15 16:34:16 -04:00
Douglas Machado 2da625b9cd feat(rspack): Add extractLicenses option to rspack's project configuration (#230) 2023-05-24 16:38:25 +00:00
Douglas Machado 519b3a1dfa feat(rspack): Add extractLicenses option to rspack's project configuration (#230) 2023-05-24 16:38:25 +00:00
Katerina Skroumpelou 4d62f10620 chore(rspack): update to latest (#278) 2023-05-24 16:09:30 +00:00
Katerina Skroumpelou 930db7c18a fix(rspack): refine output filename patterns (#280) 2023-05-24 08:17:09 -04:00
Katerina Skroumpelou e219d4b940 fix(rspack): lock version to 0.1.11 (#279) 2023-05-23 18:22:14 +03:00
Jack Hsu 03497ade7a chore(repo): update to nx 16.2.1 (#271) 2023-05-17 11:39:51 -04:00
Caleb Ukle 26610d378a chore(repo): update to 16.0.3 (#244)
* chore(repo): update to 16.0.3

* chore(repo): bump deps
2023-05-02 23:13:39 +00:00
Caleb Ukle 6fe2c7be00 fix(repo): add json files to assets (#243) 2023-05-02 17:02:15 -04:00
Jack Hsu a862df2982 fix(misc): target commonjs for legacy packages (#241) 2023-05-02 15:27:19 -05:00
Jason Jean b91b002c68 fix(repo): fix publishing for legacy packages (#240) 2023-05-02 15:50:39 -04:00
Jason Jean 78983a08f7 fix(repo): fix publishing for legacy packages (#240) 2023-05-02 15:50:39 -04:00
Caleb Ukle 56631b89a9 chore(repo): add legacy packages for nx rescope (#238) 2023-05-02 14:21:36 -05:00
Caleb Ukle aa5578f181 chore(repo): add legacy packages for nx rescope (#238) 2023-05-02 14:21:36 -05:00
Jack Hsu 55b24e4e89 fix(misc): replace missed references to @nrwl scope (#239) 2023-05-02 12:07:37 -06:00
Jack Hsu fe6058a87d feat(misc): update to Nx 16 and rescoped packages (#235) 2023-05-02 10:45:48 -04:00
Jack Hsu ffb91bcabb feat(misc): update to Nx 16 and rescoped packages (#235) 2023-05-02 10:45:48 -04:00
Jack Hsu a5a7fa2f46 fix(rspack): add back resolve.alias configuration since resolve.tsConfigPaths seem to be incorrect in some scenarios (#229) 2023-04-24 13:46:00 -04:00
Jack Hsu b6be2c1370 fix(rspack): use built-in tsconfig paths support (#227) 2023-04-20 14:42:41 -04:00
Gengkun f0f2a65ac4 fix(rspack): use builtin minify instead (#172) 2023-04-20 13:52:00 -04:00
Katerina Skroumpelou e058b43c42 fix(rspack): do not force cssmodules (#222) 2023-04-19 09:16:00 -04:00
Katerina Skroumpelou fbdb46dea3 fix(rspack): implement watch mode (#217) 2023-04-13 16:25:02 +03:00
Katerina Skroumpelou 9c67a8a659 feat(rspack): simplify app generator (#212)
Co-Author: Douglas Machado <douglas.machado@valor-software.com>
2023-04-11 18:36:06 +03:00
Katerina Skroumpelou 8d50f89f4f feat(rspack): simplify app generator (#212)
Co-Author: Douglas Machado <douglas.machado@valor-software.com>
2023-04-11 18:36:06 +03:00
Katerina Skroumpelou 394d661534 fix(rspack): use ensureTypescript before tsquery (#215) 2023-04-11 17:57:48 +03:00
Katerina Skroumpelou 0869fed772 feat(rspack): builder returns outfile (#207) 2023-04-06 17:16:23 +03:00
Katerina Skroumpelou 8f9daa0c51 feat(rspack): configuration generator better ux (#201) 2023-04-06 17:11:48 +03:00
Jack Hsu 54bdea0fad chore(repo): fix release script (#202) 2023-03-31 15:02:23 -04:00
Jack Hsu fb84eb4527 chore(repo): fix release script (#202) 2023-03-31 15:02:23 -04:00
Katerina Skroumpelou cba3374267 fix(rspack): add withWeb if web app (#200) 2023-03-30 08:11:39 -04:00
Katerina Skroumpelou fb002b0690 feat(rspack): install latest patch when configuring (#195) 2023-03-29 17:56:24 +03:00
Katerina Skroumpelou cc6ac25045 fix(rspack): set externals for target node (#194) 2023-03-28 12:02:34 -04:00
Katerina Skroumpelou f7fb57cec4 fix(rspack): pass devServer options to devServer (#193) 2023-03-28 10:41:26 -04:00
Jack Hsu 4297648730 fix(rspack): add dependency to ajv-keywords that match the version used by rspack (#187) 2023-03-27 13:47:36 +03:00
Katerina Skroumpelou e16ce1b0ce fix(rspack): handle existing stylePreprocessorOptions (#182) 2023-03-21 15:31:31 +02:00
Katerina Skroumpelou b172d2219b feat(rspack): set mode in configuration and expose option (#177) 2023-03-16 15:16:54 +02:00
Jason Jean 463ece0f3f chore(rspack): remove comment (#175) 2023-03-15 13:55:30 -04:00
FrozenPandaz cab70e5487 fix(rspack): fix rspack build 2023-03-10 21:28:19 +01:00
Jack Hsu 18e3443532 feat(rspack): update and pin rspack to 0.1.0 (#173) 2023-03-09 08:30:08 -05:00
Philip Fulcher bd4b3244bc chore(repo): migrate to Nx 15.8.5 (#169)
* chore(repo): migrate workspace to Nx 15.8.5

* chore(gatsby): fix init generator after migration

* chore(repo): remove Jest snapshot format

---------

Co-authored-by: Philip Fulcher <philipfulcher@Philips-MacBook-Pro-2.local>
2023-03-08 08:26:57 -05:00
Jack Hsu 8e7aa32f85 fix(rspack): use correct app dir when generating non-root projects (#162) 2023-03-03 09:55:49 -05:00
Jack Hsu 173d5e0e48 fix(rspack): use correct app dir when generating non-root projects (#162) 2023-03-03 09:55:49 -05:00
Jack Hsu 885e763c44 feat(rspack): clean-up project setup (#161) 2023-03-02 16:41:26 -05:00
Jack Hsu c20f38179d feat(rspack): clean-up project setup (#161) 2023-03-02 16:41:26 -05:00
Jack Hsu 3975404c88 feat(rspack): add missing features (less/sass/stylus, assets, etc.) (#160) 2023-03-02 08:11:46 -05:00
Jack Hsu 133bd2c273 feat(rspack): add missing features (less/sass/stylus, assets, etc.) (#160) 2023-03-02 08:11:46 -05:00
Jack Hsu 0850023f71 feat(rspack): update to latest rspack version (#159) 2023-02-28 09:41:22 -05:00
Jack Hsu c8df947e32 feat: add rspack plugin (#143) 2023-02-15 13:30:52 -07:00
Jack Hsu 63021dd72a feat: add rspack plugin (#143) 2023-02-15 13:30:52 -07:00
5635 changed files with 329414 additions and 148579 deletions
+20 -55
View File
@@ -48,7 +48,7 @@ commands:
- run:
name: Install pnpm package manager (linux)
command: |
npm install --prefix=$HOME/.local -g @pnpm/exe@8
npm install --prefix=$HOME/.local -g @pnpm/exe@9.8.0
- when:
condition:
equal: [<< parameters.os >>, macos]
@@ -56,7 +56,7 @@ commands:
- run:
name: Install pnpm package manager (macos)
command: |
npm install -g @pnpm/exe@8
npm install -g @pnpm/exe@9.8.0
- run:
name: Install Dependencies
command: |
@@ -69,50 +69,6 @@ commands:
- ~/.pnpm-store
- ~/.cache/Cypress
- node_modules
install-sdkman:
description: Install SDKMAN
steps:
- restore_cache:
name: Restore SDKMAN executable and binaries from cache
keys:
- sdkman-cli-{{ arch }}-v2
- run:
name: Installing SDKMAN
command: |
if [ ! -d ~/.sdkman ]
then
curl -s "https://get.sdkman.io?rcupdate=false" | bash
sed -i -e 's/sdkman_auto_answer=false/sdkman_auto_answer=true/g' ~/.sdkman/etc/config
fi
echo -e '\nsource "/home/circleci/.sdkman/bin/sdkman-init.sh"' >> $BASH_ENV
source $BASH_ENV
sdk version
- save_cache:
name: Save SDKMAN executable and binaries to cache
key: sdkman-cli-{{ arch }}-v2
paths:
- ~/.sdkman
install-gradle:
description: Install gradle
parameters:
gradle-version:
type: string
default: ''
steps:
- restore_cache:
name: Restore Gradle binary from cache
keys:
- gradle-cli-{{ arch }}-v1
- run:
name: Installing Gradle
command: |
sdk install gradle << parameters.gradle-version >>
gradle --version
- save_cache:
name: Save Gradle binary to cache
key: gradle-cli-{{ arch }}-v1
paths:
- ~/.sdkman/candidates/gradle/
# -------------------------
# JOBS
# -------------------------
@@ -126,24 +82,23 @@ jobs:
NX_E2E_CI_CACHE_KEY: e2e-circleci-linux
NX_DAEMON: 'true'
NX_PERF_LOGGING: 'false'
NX_VERBOSE_LOGGING: 'false'
NX_NATIVE_LOGGING: 'false'
NX_E2E_RUN_E2E: 'true'
NX_CI_EXECUTION_ENV: 'linux'
NX_CLOUD_DTE_V2: 'true'
NX_CLOUD_DTE_SUMMARY: 'true'
NX_CLOUD_NO_TIMEOUTS: 'true'
steps:
- checkout
- nx/set-shas:
main-branch-name: 'master'
- run: npx nx-cloud@next start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
- run: npx nx-cloud@next start-ci-run --distribute-on="./.nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
- run:
command: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- install-sdkman
- install-gradle:
gradle-version: '8.5'
- run-pnpm-install:
os: linux
- run:
@@ -159,11 +114,16 @@ jobs:
pnpm nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD &
pids+=($!)
pnpm nx-cloud record -- nx sync:check
pids+=($!)
pnpm nx-cloud record -- nx-cloud conformance:check
pids+=($!)
pnpm nx run-many -t check-imports check-commit check-lock-files check-codeowners documentation --parallel=1 --no-dte &
pids+=($!)
(pnpm nx affected --targets=lint,test,build --base=$NX_BASE --head=$NX_HEAD --parallel=3 &&
pnpm nx affected --targets=e2e,e2e-ci --base=$NX_BASE --head=$NX_HEAD --parallel=1) &
pnpm nx affected --targets=lint,test,build,e2e,e2e-ci --base=$NX_BASE --head=$NX_HEAD --parallel=3 &
pids+=($!)
for pid in "${pids[@]}"; do
@@ -206,7 +166,12 @@ jobs:
- run:
name: Run E2E Tests for macOS
command: |
pnpm nx affected -t e2e-macos-ci --parallel=1 --base=$NX_BASE --head=$NX_HEAD
HAS_CHANGED=$(node ./scripts/check-react-native-changes.js $NX_BASE $NX_HEAD);
if $HAS_CHANGED; then
pnpm nx affected -t e2e-macos-local --parallel=1 --base=$NX_BASE --head=$NX_HEAD
else
echo "Skip E2E tests for macOS as there are no changes in React Native projects."
fi
no_output_timeout: 45m
# -------------------------
+24 -6
View File
@@ -3,28 +3,46 @@
{
"name": "NxDevContainer",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:20-bullseye",
// Starting from a base image that already contains GLIBC v2.33 or higher (required by Nx)
// Try a more recent distribution, if your are having build issues related to GLIBC version
// Here we use 'bookworm', which is based on `Debian-12`, which comes with `GLIBC v2.36`
// (Nx tools currenlty requires `GLIBC v2.33` or higher)
"image": "mcr.microsoft.com/devcontainers/typescript-node:20-bookworm",
"features": {
"ghcr.io/devcontainers/features/rust:1": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// 4211 = nx graph port
"forwardPorts": [4211],
// 4873 = verdaccio (local npm registry) port
"forwardPorts": [4211, 4873],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"nrwl.angular-console",
"firsttris.vscode-jest-runner",
"eamodio.gitlens"
"eamodio.gitlens",
"mhutchie.git-graph",
"mutantdino.resourcemonitor" // to monitor cpu, memory usage from the dev container
],
"settings": {
"debug.javascript.autoAttachFilter": "onlyWithFlag" // workaround for that issue: https://github.com/microsoft/vscode-js-debug/issues/374#issuecomment-622239998
"debug.javascript.autoAttachFilter": "disabled" // workaround for that issue: https://github.com/microsoft/vscode-js-debug/issues/374#issuecomment-622239998
}
}
}
},
// To improve disk performances when installing node modules
// See https://code.visualstudio.com/remote/advancedcontainers/improve-performance
"mounts": [
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume"
],
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
"remoteUser": "root"
}
+17 -5
View File
@@ -1,11 +1,23 @@
#!/bin/sh
# Update the underlying (Debian) OS, to make sure we have the latest security patches and libraries like 'GLIBC'
sudo apt-get update && sudo apt-get -y upgrade
echo "⚙️ Updating the underlying OS..."
sudo apt-get update && sudo apt-get -y upgrade
# Update pnpm
#npm install -g pnpm
# Uninstall globally installed PNPM (required version will be reinstalled through corepack)
echo "❌ Uninstalling globally installed PNPM..."
npm uninstall -g pnpm
# Install dependencies
# Prevent corepack from prompting user before downloading PNPM
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
# Enable corepack
corepack enable
# Install the PNPM version defined in the root package.json
echo "⚙️ Installing required PNPM version..."
corepack prepare --activate
# Install NPM dependencies
echo "⚙️ Installing NPM dependencies..."
pnpm install --frozen-lockfile
-35
View File
@@ -1,35 +0,0 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
}
+19
View File
@@ -61,8 +61,27 @@
}
]
}
],
"@nx/workspace/valid-command-object": "error"
}
},
{
"files": ["pnpm-lock.yaml"],
"parser": "./tools/eslint-rules/raw-file-parser.js",
"rules": {
"@nx/workspace/ensure-pnpm-lock-version": [
"error",
{
"version": "9.0"
}
]
}
},
{
"files": ["*.ts"],
"rules": {
"@angular-eslint/prefer-standalone": "off"
}
}
]
}
+1
View File
@@ -1,6 +1,7 @@
name: 🐞 Bug Report
description: This form is to report unexpected behavior in Nx.
labels: ["type: bug"]
type: Bug
body:
- type: markdown
attributes:
+2
View File
@@ -4,6 +4,8 @@
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. -->
## Current Behavior
<!-- This is the behavior we have today -->
+145 -22
View File
@@ -25,35 +25,48 @@ jobs:
- ubuntu-latest
- macos-latest
node_version:
- 20
- 18
- 20
- 22
# - 23
exclude:
# run just node v20 on macos
- os: macos-latest
node_version: 18
- os: macos-latest
node_version: 22
# - os: macos-latest
# node_version: 23
name: Cache install (${{ matrix.os }}, node v${{ matrix.node_version }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PNPM
run: |
npm install -g @pnpm/exe@8.14
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
run_install: false
- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
lookup-only: true
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ github.run_id }}
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Ensure Python setuptools Installed on Macos
if: ${{ matrix.os == 'macos-latest' }}
id: brew-install-python-setuptools
run: brew install python-setuptools
- name: Install packages
if: steps.cache-modules.outputs.cache-hit != 'true'
@@ -66,7 +79,7 @@ jobs:
- name: Cache Homebrew
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/cache@v3
uses: actions/cache@v4
with:
lookup-only: true
path: ${{ steps.homebrew-cache-dir-path.outputs.dir }}
@@ -76,7 +89,7 @@ jobs:
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v3
uses: actions/cache@v4
with:
lookup-only: true
path: '${{ github.workspace }}/.cypress'
@@ -99,8 +112,10 @@ jobs:
- ubuntu-latest
- macos-latest
node_version:
- 20
- 18
- 20
- 22
# - 23
package_manager:
- npm
- yarn
@@ -261,6 +276,106 @@ jobs:
project: e2e-vue
- node_version: 18
project: e2e-webpack
- node_version: 22
project: e2e-angular
- node_version: 22
project: e2e-cypress
- node_version: 22
project: e2e-detox
- node_version: 22
project: e2e-esbuild
- node_version: 22
project: e2e-expo
- node_version: 22
project: e2e-gradle
- node_version: 22
project: e2e-jest
- node_version: 22
project: e2e-js
- node_version: 22
project: e2e-eslint
- node_version: 22
project: e2e-next
- node_version: 22
project: e2e-node
- node_version: 22
project: e2e-nuxt
- node_version: 22
project: e2e-nx-init
- node_version: 22
project: e2e-nx
- node_version: 22
project: e2e-plugin
- node_version: 22
project: e2e-playwright
- node_version: 22
project: e2e-react
- node_version: 22
project: e2e-react-native
- node_version: 22
project: e2e-web
- node_version: 22
project: e2e-remix
- node_version: 22
project: e2e-rollup
- node_version: 22
project: e2e-storybook
- node_version: 22
project: e2e-vite
- node_version: 22
project: e2e-vue
- node_version: 22
project: e2e-webpack
# - node_version: 23
# project: e2e-angular
# - node_version: 23
# project: e2e-cypress
# - node_version: 23
# project: e2e-detox
# - node_version: 23
# project: e2e-esbuild
# - node_version: 23
# project: e2e-expo
# - node_version: 23
# project: e2e-gradle
# - node_version: 23
# project: e2e-jest
# - node_version: 23
# project: e2e-js
# - node_version: 23
# project: e2e-eslint
# - node_version: 23
# project: e2e-next
# - node_version: 23
# project: e2e-node
# - node_version: 23
# project: e2e-nuxt
# - node_version: 23
# project: e2e-nx-init
# - node_version: 23
# project: e2e-nx
# - node_version: 23
# project: e2e-plugin
# - node_version: 23
# project: e2e-playwright
# - node_version: 23
# project: e2e-react
# - node_version: 23
# project: e2e-react-native
# - node_version: 23
# project: e2e-web
# - node_version: 23
# project: e2e-remix
# - node_version: 23
# project: e2e-rollup
# - node_version: 23
# project: e2e-storybook
# - node_version: 23
# project: e2e-vite
# - node_version: 23
# project: e2e-vue
# - node_version: 23
# project: e2e-webpack
# run just npm v20 on macos
- os: macos-latest
package_manager: yarn
@@ -268,6 +383,10 @@ jobs:
package_manager: pnpm
- os: macos-latest
node_version: 18
- os: macos-latest
node_version: 22
# - os: macos-latest
# node_version: 23
fail-fast: false
name: ${{ matrix.os_name }}/${{ matrix.package_manager }}/${{ matrix.node_version }} ${{ join(matrix.project) }}
@@ -278,22 +397,24 @@ jobs:
- name: Prepare dir for output
run: mkdir -p outputs
- name: Install PNPM
run: |
npm install -g @pnpm/exe@8.7.4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
run_install: false
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ github.run_id }}
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install packages
run: pnpm install --frozen-lockfile
@@ -317,7 +438,7 @@ jobs:
- name: Cache Homebrew
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.homebrew-cache-dir-path.outputs.dir }}
key: brew-${{ matrix.node_version }}
@@ -326,7 +447,7 @@ jobs:
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '${{ github.workspace }}/.cypress'
key: ${{ runner.os }}-cypress
@@ -391,10 +512,12 @@ jobs:
echo "$matrix" > $path
- name: Upload matrix config
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: outputs
overwrite: true
if-no-files-found: 'ignore'
path: ${{ steps.save-matrix.outputs.path }}
- name: Setup tmate session
@@ -403,7 +526,7 @@ jobs:
timeout-minutes: 15
process-result:
if: ${{ always() }}
if: ${{ always() && github.repository_owner == 'nrwl' }}
runs-on: ubuntu-latest
needs: e2e
outputs:
@@ -413,7 +536,7 @@ jobs:
codeowners: ${{ steps.process-json.outputs.CODEOWNERS }}
steps:
- name: Load outputs
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: outputs
path: outputs
@@ -426,7 +549,7 @@ jobs:
- name: Make slack outputs
id: process-json
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ github.token }}
with:
+108 -25
View File
@@ -16,28 +16,30 @@ env:
permissions: { }
jobs:
if: ${{ github.repository_owner == 'nrwl' }}
preinstall:
if: ${{ github.repository_owner == 'nrwl' }}
runs-on: windows-latest
strategy:
matrix:
node_version:
- 20
- 18
- 20
- 22
# - 23
name: Cache install (node v${{ matrix.node_version }})
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
version: 9.8.0
run_install: false
- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
@@ -48,14 +50,15 @@ jobs:
with:
lookup-only: true
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ github.run_id }}
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install packages
if: steps.cache-modules.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v3
uses: actions/cache@v4
with:
lookup-only: true
path: '${{ github.workspace }}/.cypress'
@@ -74,8 +77,10 @@ jobs:
strategy:
matrix:
node_version:
- 20
- 18
- 20
- 22
# - 23
package_manager:
- npm
project:
@@ -109,14 +114,8 @@ jobs:
codeowners: 'S04SS457V38'
- project: e2e-cypress
codeowners: 'S04T16BTJJY'
- project: e2e-detox
codeowners: 'S04TNCNJG5N'
- project: e2e-esbuild
codeowners: 'S04SJ6HHP0X'
- project: e2e-expo
codeowners: 'S04TNCNJG5N'
- project: e2e-gradle
codeowners: 'S04TNCNJG5N'
- project: e2e-jest
codeowners: 'S04T16BTJJY'
- project: e2e-js
@@ -139,8 +138,6 @@ jobs:
codeowners: 'S04SYHYKGNP'
- project: e2e-react
codeowners: 'S04TNCNJG5N'
- project: e2e-react-native
codeowners: 'S04TNCNJG5N'
- project: e2e-web
codeowners: 'S04SJ6PL98X'
- project: e2e-rollup
@@ -205,6 +202,90 @@ jobs:
project: e2e-vue
- node_version: 18
project: e2e-webpack
- node_version: 22
project: e2e-angular
- node_version: 22
project: e2e-cypress
- node_version: 22
project: e2e-esbuild
- node_version: 22
project: e2e-jest
- node_version: 22
project: e2e-js
- node_version: 22
project: e2e-eslint
- node_version: 22
project: e2e-next
- node_version: 22
project: e2e-node
- node_version: 22
project: e2e-nuxt
- node_version: 22
project: e2e-nx-init
- node_version: 22
project: e2e-nx
- node_version: 22
project: e2e-plugin
- node_version: 22
project: e2e-playwright
- node_version: 22
project: e2e-react
- node_version: 22
project: e2e-web
- node_version: 22
project: e2e-remix
- node_version: 22
project: e2e-rollup
- node_version: 22
project: e2e-storybook
- node_version: 22
project: e2e-vite
- node_version: 22
project: e2e-vue
- node_version: 22
project: e2e-webpack
# - node_version: 23
# project: e2e-angular
# - node_version: 23
# project: e2e-cypress
# - node_version: 23
# project: e2e-esbuild
# - node_version: 23
# project: e2e-jest
# - node_version: 23
# project: e2e-js
# - node_version: 23
# project: e2e-eslint
# - node_version: 23
# project: e2e-next
# - node_version: 23
# project: e2e-node
# - node_version: 23
# project: e2e-nuxt
# - node_version: 23
# project: e2e-nx-init
# - node_version: 23
# project: e2e-nx
# - node_version: 23
# project: e2e-plugin
# - node_version: 23
# project: e2e-playwright
# - node_version: 23
# project: e2e-react
# - node_version: 23
# project: e2e-web
# - node_version: 23
# project: e2e-remix
# - node_version: 23
# project: e2e-rollup
# - node_version: 23
# project: e2e-storybook
# - node_version: 23
# project: e2e-vite
# - node_version: 23
# project: e2e-vue
# - node_version: 23
# project: e2e-webpack
fail-fast: false
name: ${{ matrix.project }} (v${{ matrix.node_version }})
@@ -215,21 +296,21 @@ jobs:
- name: Prepare dir for output
run: mkdir -p outputs
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8.7.4
version: 9.8.0
run_install: false
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ github.run_id }}
@@ -239,7 +320,7 @@ jobs:
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '${{ github.workspace }}/.cypress'
key: ${{ runner.os }}-cypress
@@ -289,10 +370,12 @@ jobs:
echo "$matrix" > $path
- name: Upload matrix config
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: outputs
overwrite: true
if-no-files-found: 'ignore'
path: ${{ steps.save-matrix.outputs.path }}
- name: Setup tmate session
@@ -303,7 +386,7 @@ jobs:
sudo: false # disable sudo for windows debugging
process-result:
if: ${{ always() }}
if: ${{ always() && github.repository_owner == 'nrwl' }}
runs-on: ubuntu-latest
needs: e2e
outputs:
@@ -311,7 +394,7 @@ jobs:
codeowners: ${{ steps.process-json.outputs.CODEOWNERS }}
steps:
- name: Load outputs
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: outputs
path: outputs
@@ -325,7 +408,7 @@ jobs:
- name: Make slack outputs
id: process-json
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ github.token }}
with:
+4 -4
View File
@@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
node-version: [18]
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -25,7 +25,7 @@ jobs:
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 7
version: 8
run_install: false
- name: Get pnpm store directory
@@ -46,8 +46,8 @@ jobs:
run: pnpm install --no-frozen-lockfile
- name: Run embeddings script
run: pnpm exec nx run tools-documentation-create-embeddings:run-node
run: pnpm exec nx run tools-documentation-create-embeddings:run-node
env:
NX_NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NX_NEXT_PUBLIC_SUPABASE_URL }}
NX_SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.NX_SUPABASE_SERVICE_ROLE_KEY }}
NX_OPENAI_KEY: ${{ secrets.NX_OPENAI_KEY }}
NX_OPENAI_KEY: ${{ secrets.NX_OPENAI_KEY }}
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
- uses: pnpm/action-setup@v2
with:
version: 8.2
version: 8
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
+4 -8
View File
@@ -8,25 +8,21 @@ on:
permissions: {}
jobs:
audit:
if: ${{ github.repository_owner == 'nrwl' }}
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install PNPM
run: |
npm install -g @pnpm/exe@8.3.1
- uses: pnpm/action-setup@v4
with:
version: 9.8.0 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync)
- name: Run a security audit
run: pnpm dlx audit-ci --critical --report-type summary
# - name: Run Dependency confusion supply chain check
# run: npx snync -d .
report:
if: ${{ always() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: audit
+219 -53
View File
@@ -1,19 +1,121 @@
name: publish
on:
# Automated schedule - canary releases from master
schedule:
- cron: "0 3 * * 2-6" # Tuesdays - Saturdays, at 3am UTC
# Manual trigger - PR releases or dry-runs (based on workflow inputs)
workflow_dispatch:
inputs:
pr:
description: "PR Number - If set, a real release will be created for the branch associated with the given PR number. If blank, a dry-run of the currently selected branch will be performed."
required: false
type: number
release:
types: [ published ]
# Dynamically generate the display name for the GitHub UI based on the event type and inputs
run-name: ${{ github.event.inputs.pr && format('PR Release for {0}', github.event.inputs.pr) || github.event_name == 'schedule' && 'Canary Release' || github.event_name == 'workflow_dispatch' && !github.event.inputs.pr && 'Release Dry-Run' || github.ref_name }}
env:
DEBUG: napi:*
NX_RUN_GROUP: ${{ github.run_id }}-${{ github.run_attempt }}
CYPRESS_INSTALL_BINARY: 0
NODE_VERSION: 18
PNPM_VERSION: 9.8.0 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync)
jobs:
# We first need to determine the version we are releasing, and if we need a custom repo or ref to use for the git checkout in subsequent steps.
# These values depend upon the event type that triggered the workflow:
#
# - schedule:
# - We are running a canary release which always comes from the master branch, we can use default ref resolution
# in actions/checkout. The exact version will be generated within scripts/nx-release.ts.
#
# - release:
# - We are running a full release which is based on the tag that triggered the release event, we can use default
# ref resolution in actions/checkout. The exact version will be generated within scripts/nx-release.ts.
#
# - workflow_dispatch:
# - We are either running a dry-run on the current branch, in which case the version will be statica and we can use
# default ref resolution in actions/checkout, or we are creating a PR release for the given PR number, in which case
# we should generate an applicable version number within publish-resolve-data.js and use a custom ref of the PR branch name.
resolve-required-data:
name: Resolve Required Data
if: ${{ github.repository_owner == 'nrwl' }}
runs-on: ubuntu-latest
outputs:
version: ${{ steps.script.outputs.version }}
dry_run_flag: ${{ steps.script.outputs.dry_run_flag }}
success_comment: ${{ steps.script.outputs.success_comment }}
publish_branch: ${{ steps.script.outputs.publish_branch }}
ref: ${{ steps.script.outputs.ref }}
repo: ${{ steps.script.outputs.repo }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
# Default checkout on the triggering branch so that the latest publish-resolve-data.js script is available
- uses: actions/checkout@v4
# Set up pnpm and node so that we can verify our setup and that the NPM_TOKEN secret will work later
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
check-latest: true
# Ensure that the NPM_TOKEN secret is still valid before wasting any time deriving data or building projects
- name: Check NPM Credentials
run: npm whoami && echo "NPM credentials are valid" || (echo "NPM credentials are invalid or have expired." && exit 1)
- name: Resolve and set checkout and version data to use for release
id: script
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ github.event.inputs.pr }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('${{ github.workspace }}/scripts/publish-resolve-data.js');
await script({ github, context, core });
- name: (PR Release Only) Check out latest master
if: ${{ steps.script.outputs.ref != '' }}
uses: actions/checkout@v4
with:
# Check out the latest master branch to get its copy of nx-release.ts
repository: nrwl/nx
ref: master
path: latest-master-checkout
- name: (PR Release Only) Check out PR branch
if: ${{ steps.script.outputs.ref != '' }}
uses: actions/checkout@v4
with:
# Check out the PR branch to get its copy of nx-release.ts
repository: ${{ steps.script.outputs.repo }}
ref: ${{ steps.script.outputs.ref }}
path: pr-branch-checkout
- name: (PR Release Only) Ensure that nx-release.ts has not changed in the PR being released
if: ${{ steps.script.outputs.ref != '' }}
env:
FILE_TO_COMPARE: "scripts/nx-release.ts"
run: |
if ! cmp -s "latest-master-checkout/${{ env.FILE_TO_COMPARE }}" "pr-branch-checkout/${{ env.FILE_TO_COMPARE }}"; then
echo "🛑 Error: The file ${{ env.FILE_TO_COMPARE }} is different on the ${{ steps.script.outputs.ref }} branch on ${{ steps.script.outputs.repo }} vs latest master on nrwl/nx, cancelling workflow. If you did not modify the file, then you likely just need to rebase/merge latest master."
exit 1
else
echo "✅ The file ${{ env.FILE_TO_COMPARE }} is identical between the ${{ steps.script.outputs.ref }} branch on ${{ steps.script.outputs.repo }} and latest master on nrwl/nx."
fi
build:
needs: [ resolve-required-data ]
if: ${{ github.repository_owner == 'nrwl' }}
strategy:
fail-fast: false
@@ -36,7 +138,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
npm i -g pnpm@8.15.7 --force &&
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-gnu
@@ -45,7 +147,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
npm i -g pnpm@8.15.7 --force &&
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl
@@ -63,7 +165,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |-
set -e &&
npm i -g pnpm@8.15.7 --force &&
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-gnu
@@ -73,7 +175,7 @@ jobs:
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf -y
build: |
pnpm nx run-many --target=build-native -- --target=armv7-unknown-linux-gnueabihf
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=/usr/bin/arm-linux-gnueabihf-gcc pnpm nx run-many --target=build-native -- --target=armv7-unknown-linux-gnueabihf
# Android (not needed)
# - host: ubuntu-latest
# target: aarch64-linux-android
@@ -89,7 +191,7 @@ jobs:
build: |-
set -e &&
rustup target add aarch64-unknown-linux-musl &&
npm i -g pnpm@8.15.7 --force &&
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-musl
@@ -100,16 +202,19 @@ jobs:
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
repository: ${{ needs.resolve-required-data.outputs.repo }}
ref: ${{ needs.resolve-required-data.outputs.ref }}
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup node
uses: actions/setup-node@v4
if: ${{ !matrix.settings.docker }}
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}
check-latest: true
cache: 'pnpm'
@@ -120,7 +225,7 @@ jobs:
targets: ${{ matrix.settings.target }}
- name: Cache cargo
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
@@ -129,30 +234,36 @@ jobs:
.cargo-cache
target/
key: ${{ matrix.settings.target }}-cargo-registry
- uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
with:
version: 0.10.0
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- name: Setup node x86
if: matrix.settings.target == 'i686-pc-windows-msvc'
run: yarn config set supportedArchitectures.cpu "ia32"
shell: bash
- name: Install dependencies
if: ${{ !matrix.settings.docker }}
run: pnpm install --frozen-lockfile
timeout-minutes: 30
- name: Setup node x86
uses: actions/setup-node@v4
if: matrix.settings.target == 'i686-pc-windows-msvc'
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}
check-latest: true
cache: pnpm
architecture: x86
- name: Build in docker
uses: addnab/docker-run-action@v3
if: ${{ matrix.settings.docker }}
@@ -160,29 +271,38 @@ jobs:
image: ${{ matrix.settings.docker }}
options: --user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build
run: ${{ matrix.settings.build }}
- name: Build
run: ${{ matrix.settings.build }}
if: ${{ !matrix.settings.docker }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: packages/**/*.node
path: |
packages/**/*.node
packages/**/*.wasm
if-no-files-found: error
build-freebsd:
needs: [ resolve-required-data ]
if: ${{ github.repository_owner == 'nrwl' }}
runs-on: macos-13-large
runs-on: ubuntu-latest
name: Build FreeBSD
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'schedule' }}
if: ${{ github.event_name != 'schedule' && !github.event.inputs.pr }}
with:
repository: ${{ needs.resolve-required-data.outputs.repo }}
ref: ${{ needs.resolve-required-data.outputs.ref }}
- name: Build
id: build
if: ${{ github.event_name != 'schedule' }}
uses: cross-platform-actions/action@v0.22.0
if: ${{ github.event_name != 'schedule' && !github.event.inputs.pr }}
uses: cross-platform-actions/action@v0.25.0
env:
DEBUG: napi:*
RUSTUP_IO_THREADS: 1
@@ -190,15 +310,15 @@ jobs:
PLAYWRIGHT_BROWSERS_PATH: 0
with:
operating_system: freebsd
version: '13.2'
version: '14.0'
architecture: x86-64
environment_variables: DEBUG RUSTUP_IO_THREADS CI NX_PREFER_TS_NODE PLAYWRIGHT_BROWSERS_PATH
shell: bash
run: |
env
whoami
sudo pkg install -y -f node libnghttp2 npm git
sudo npm install --location=global --ignore-scripts pnpm@8.15.7
sudo pkg install -y -f node libnghttp2 www/npm git
sudo npm install --location=global --ignore-scripts pnpm@9.8.0
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
source "$HOME/.cargo/env"
@@ -213,8 +333,6 @@ jobs:
whoami
env
freebsd-version
mkdir -p /Users/runner/work/_temp/_github_workflow
echo "{}" > /Users/runner/work/_temp/_github_workflow/event.json
pnpm install --frozen-lockfile --ignore-scripts
pnpm nx run-many --verbose --outputStyle stream --target=build-native -- --target=x86_64-unknown-freebsd
pnpm nx reset
@@ -223,9 +341,10 @@ jobs:
echo "KILL ALL NODE PROCESSES"
killall node || true
echo "COMPLETE"
- name: Upload artifact
if: ${{ github.event_name != 'schedule' }}
uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'schedule' && !github.event.inputs.pr }}
uses: actions/upload-artifact@v4
with:
name: bindings-freebsd
path: packages/**/*.node
@@ -238,7 +357,9 @@ jobs:
permissions:
id-token: write
contents: write
pull-requests: write
needs:
- resolve-required-data
- build-freebsd
- build
env:
@@ -247,51 +368,96 @@ jobs:
NPM_CONFIG_PROVENANCE: true
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
repository: ${{ needs.resolve-required-data.outputs.repo }}
ref: ${{ needs.resolve-required-data.outputs.ref }}
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
check-latest: true
cache: 'pnpm'
- name: Check NPM Credentials
run: npm whoami && echo "NPM credentials are valid" || (echo "NPM credentials are invalid or have expired." && exit 1)
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts
# This command will appropriately fail if no artifacts are available
- name: List artifacts
run: ls -R artifacts
shell: bash
- name: Build Wasm
run: |
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-23/wasi-sdk-23.0-x86_64-linux.tar.gz
tar -xvf wasi-sdk-23.0-x86_64-linux.tar.gz
pnpm build:wasm
- name: Publish
env:
VERSION: ${{ needs.resolve-required-data.outputs.version }}
DRY_RUN: ${{ needs.resolve-required-data.outputs.dry_run_flag }}
PUBLISH_BRANCH: ${{ needs.resolve-required-data.outputs.publish_branch }}
run: |
git checkout -b publish/$GITHUB_REF_NAME
# If triggered by the cron, create a canary release
if [ "${{ github.event_name }}" = "schedule" ]; then
VERSION="canary"
else
# Otherwise, use the tag name (if triggered via release), or explicit version (if triggered via workflow_dispatch)
VERSION="${GITHUB_REF_NAME}"
fi
# If triggered via workflow_dispatch, perform a dry-run
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
DRY_RUN="--dry-run"
else
DRY_RUN=""
fi
echo ""
# Create and check out the publish branch
git checkout -b $PUBLISH_BRANCH
echo ""
echo "Version set to: $VERSION"
echo "DRY_RUN set to: $DRY_RUN"
echo ""
pnpm nx-release --local=false $VERSION $DRY_RUN
- name: Trigger Docs Release
- name: (Stable Release Only) Trigger Docs Release
# Publish docs only on a full release
if: ${{ !github.event.release.prerelease }}
run: |
# The GITHUB_REF_NAME is a full version (i.e. 17.3.2). The branchName will only use the major version number.
# We will publish docs to the website branch based on the current tag (i.e. website-17)
branchName=website-${GITHUB_REF_NAME%.*.*}
# We force recreate the branch in order to always be up to date and avoid merge conflicts within the automated workflow
git branch -f $branchName
git push -f origin $branchName
if: ${{ !github.event.release.prerelease && github.event_name == 'release' }}
run: npx ts-node ./scripts/release-docs.ts
- name: (PR Release Only) Create comment for successful PR release
if: success() && github.event.inputs.pr
uses: actions/github-script@v7
env:
SUCCESS_COMMENT: ${{ needs.resolve-required-data.outputs.success_comment }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const successComment = JSON.parse(process.env.SUCCESS_COMMENT);
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.inputs.pr }},
body: successComment
});
pr_failure_comment:
# Run this job if it is a PR release, running on the nrwl origin, and any of the required jobs failed
if: ${{ github.repository_owner == 'nrwl' && github.event.inputs.pr && always() && contains(needs.*.result, 'failure') }}
needs: [ resolve-required-data, build, build-freebsd, publish ]
name: (PR Release Failure Only) Create comment for failed PR release
runs-on: ubuntu-latest
steps:
- name: Create comment for failed PR release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# This script is intentionally kept inline (and e.g. not generated in publish-resolve-data.js)
# to ensure that an error within the data generation itself is not missed.
script: |
const message = `
Failed to publish a PR release of this pull request, triggered by @${{ github.triggering_actor }}.
See the failed workflow run at: https://github.com/nrwl/nx/actions/runs/${{ github.run_id }}
`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.inputs.pr }},
body: message
});
+39 -106
View File
@@ -4,7 +4,7 @@ on:
name: Stale Bot workflow
permissions: {}
permissions: { }
jobs:
build:
@@ -16,163 +16,96 @@ jobs:
name: stale
runs-on: ubuntu-latest
steps:
# This handles issues that need more info
- name: stale-more-info-needed
id: stale-more-info-needed
uses: actions/stale@v3.0.13
uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 14
days-before-close: 14
days-before-stale: 7
days-before-close: 21
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "blocked: more info needed"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
This issue has been automatically marked as stale because more information has not been provided within 7 days.
It will be closed in 21 days if no information is provided.
If information has been provided, please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
# This handles PRs that need to be rebased
- name: stale-needs-rebase
id: stale-needs-rebase
uses: actions/stale@v3.0.13
uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 14
days-before-close: 14
days-before-stale: 7
days-before-close: 21
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "blocked: needs rebased"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
This PR has been automatically marked as stale because it has not been rebased in 7 days.
It will be closed in 21 days if it is not rebased.
If the PR has been rebased or you are working on rebasing it, please reply to keep it active.
If you do not have time, please let us know and we can rebase it.
Thanks for being a part of the Nx community! 🙏
# This handles issues that do not have a repro
- name: stale-repro-needed
id: stale-repro-needed
uses: actions/stale@v3.0.13
uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 14
days-before-close: 14
days-before-stale: 7
days-before-close: 21
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "blocked: repro needed"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
This issue has been automatically marked as stale because no reproduction was provided within 7 days.
Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue.
Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues.
This issue will be closed in 21 days if a reproduction is not provided.
If a reproduction has been provided, please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
- name: stale-retry-with-latest
id: stale-retry-with-latest
uses: actions/stale@v3.0.13
uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 14
days-before-close: 14
days-before-stale: 7
days-before-close: 21
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "blocked: retry with latest"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days.
It will be closed in 21 days if no results are provided.
If the issue is still present, please reply to keep it active.
If the issue was not present, please close this issue.
Thanks for being a part of the Nx community! 🙏
# This handles issues are really old and were made with a previous major
- name: stale-bug
id: stale-bug
uses: actions/stale@v3.0.13
uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 180
days-before-close: 14
days-before-close: 21
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: bug"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
- name: stale-cleanup
id: stale-cleanup
uses: actions/stale@v3.0.13
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 180
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: cleanup"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
- name: stale-docs
id: stale-docs
uses: actions/stale@v3.0.13
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 180
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: docs"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
- name: stale-enhancement
id: stale-enhancement
uses: actions/stale@v3.0.13
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 250
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: enhancement"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
- name: stale-feature
id: stale-feature
uses: actions/stale@v3.0.13
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 250
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: feature"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
- name: stale-question
id: stale-question
uses: actions/stale@v3.0.13
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 45
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: question / discussion"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
This issue has been automatically marked as stale because it hasn't had any activity for 6 months.
Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore.
If at this point, this is still an issue, please respond with updated information.
It will be closed in 21 days if no further activity occurs.
Thanks for being a part of the Nx community! 🙏
+9 -3
View File
@@ -22,6 +22,7 @@ jest.debug.config.js
/graph/client/src/assets/generated-source-maps
/nx-dev/nx-dev/public/documentation
/nx-dev/nx-dev/public/images/open-graph
**/tests/temp-db
# Issues scraper creates these files, stored by github's cache
/scripts/issues-scraper/cached
@@ -37,15 +38,15 @@ out
.angular
# Local dev files
.env
.env.local
.bashrc
.nx
*.node
# Fix for issue when working on the repo in a dev container
.pnpm-store
.nx/cache
.nx
!.nx/workflows
.cargo/.package-cache
.cargo/bin/
@@ -55,3 +56,8 @@ out
.npm/
.profile
.rustup/
target
*.wasm
/wasi-sdk*
vite.config.*.timestamp*
+1 -2
View File
@@ -1,3 +1,2 @@
#!/bin/sh
changedFiles="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
node ./scripts/notify-lockfile-changes.js $changedFiles
node ./scripts/notify-lockfile-changes.js $changedFiles
+1 -2
View File
@@ -1,3 +1,2 @@
#!/bin/sh
changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
node ./scripts/notify-lockfile-changes.js $changedFiles
node ./scripts/notify-lockfile-changes.js $changedFiles
+3 -5
View File
@@ -1,6 +1,4 @@
#!/usr/bin/env sh
pnpm check-lock-files &&
pnpm check-commit &&
pnpm documentation &&
pnpm check-lock-files
pnpm check-commit
pnpm documentation
pnpm pretty-quick --check
+67 -26
View File
@@ -1,7 +1,7 @@
launch-templates:
linux-medium:
resource-class: 'docker_linux_amd64/medium+'
image: 'ubuntu22.04-node20.11-v3'
image: 'ubuntu22.04-node20.11-v10'
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
@@ -9,28 +9,27 @@ launch-templates:
GIT_COMMITTER_NAME: Test
SELECTED_PM: 'pnpm'
NPM_CONFIG_PREFIX: '/home/workflows/.npm-global'
NX_NATIVE_LOGGING: 'nx::native::db'
init-steps:
- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v3.6/workflow-steps/checkout/main.yaml'
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml'
- name: Cache restore
uses: 'nrwl/nx-cloud-workflows/v3.6/workflow-steps/cache/main.yaml'
env:
KEY: 'pnpm-lock.yaml'
PATHS: |
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
inputs:
key: 'pnpm-lock.yaml'
paths: |
node_modules
~/.cache/Cypress
~/.cache/ms-playwright
~/.pnpm-store
~/.sdkman
~/.sdkman/candidates/gradle
BASE_BRANCH: 'master'
base_branch: 'master'
- name: Install e2e deps
script: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Install Pnpm
script: |
npm install -g pnpm@8.15.5
npm install -g pnpm@9.8.0
- name: Pnpm Install
script: |
@@ -39,7 +38,7 @@ launch-templates:
- name: Install Browsers
script: |
pnpm exec cypress install
pnpm exec playwright install
pnpm exec playwright install --with-deps
- name: Install Rust
script: |
@@ -57,18 +56,60 @@ launch-templates:
- name: Install zip and unzip
script: sudo apt-get -yqq install zip unzip
- name: Install SDKMAN and gradle
linux-large:
resource-class: 'docker_linux_amd64/large'
image: 'ubuntu22.04-node20.11-v10'
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
SELECTED_PM: 'pnpm'
NPM_CONFIG_PREFIX: '/home/workflows/.npm-global'
NX_NATIVE_LOGGING: 'nx::native::db'
init-steps:
- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml'
- name: Cache restore
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
inputs:
key: 'pnpm-lock.yaml'
paths: |
node_modules
~/.cache/Cypress
~/.cache/ms-playwright
~/.pnpm-store
base_branch: 'master'
- name: Install e2e deps
script: |
if [ ! -d $HOME/.sdkman ]
then
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
fi
sdk version
if [ ! -d $HOME/.sdkman/candidates/gradle/8.5 ]
then
sdk install gradle 8.5
fi
gradle --version
echo "PATH=$HOME/.sdkman/candidates/gradle/8.5/bin:$PATH" >> $NX_CLOUD_ENV
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Install Pnpm
script: |
npm install -g pnpm@9.8.0
- name: Pnpm Install
script: |
pnpm install --frozen-lockfile
- name: Install Browsers
script: |
pnpm exec cypress install
pnpm exec playwright install --with-deps
- name: Install Rust
script: |
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup toolchain install 1.70.0
- name: Configure git metadata (needed for lerna smoke tests)
script: |
git config --global user.email test@test.com
git config --global user.name "Test Test"
- name: Load Cargo Env
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
- name: Install zip and unzip
script: sudo apt-get -yqq install zip unzip
+9 -3
View File
@@ -1,4 +1,10 @@
distribute-on:
small-changeset: 8 linux-medium
medium-changeset: 10 linux-medium
large-changeset: 12 linux-medium
default: auto linux-medium, 1 linux-large
assignment-rules:
- project: nx-dev
target: build-base
runs-on:
- linux-large
- target: test
runs-on:
- linux-medium
+1 -1
View File
@@ -1,2 +1,2 @@
nx-dev/**/jest.config.js
.next
.next
+7
View File
@@ -17,6 +17,11 @@ packages/nx/src/plugins/js/lock-file/__fixtures__/**/*.*
packages/**/schematics/**/files/**/*.html
packages/**/generators/**/files/**/*.html
packages/nx/src/native/**/*.rs
packages/nx/src/native/browser.js
packages/nx/src/native/nx.wasi-browser.js
packages/nx/src/native/nx.wasi.cjs
packages/nx/src/native/wasi-worker-browser.mjs
packages/nx/src/native/wasi-worker.mjs
packages/nx/src/native/native-bindings.js
packages/nx/src/native/index.d.ts
nx-dev/nx-dev/.next/
@@ -40,3 +45,5 @@ CODEOWNERS
/.nx/cache
.pnpm-store
/.nx/workspace-data
+9 -2
View File
@@ -10,7 +10,7 @@ rust-toolchain @nrwl/nx-native-reviewers
# Docs Site + Graph
/docs @nrwl/nx-docs-reviewers
/docs/nx-cloud @StalkAltan @rarmatei @nrwl/nx-docs-reviewers
/docs/nx-cloud @StalkAltan @rarmatei @nixallover @nrwl/nx-docs-reviewers
/graph/** @philipjfulcher @FrozenPandaz @bcabanes @MaxKless @xiongemi
/images @nrwl/nx-docs-reviewers
/nx-dev/** @nrwl/nx-docs-reviewers
@@ -79,12 +79,14 @@ rust-toolchain @nrwl/nx-native-reviewers
/docs/generated/packages/js/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/generated/packages/web/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/generated/packages/webpack/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/generated/packages/rspack/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/generated/packages/esbuild/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/generated/packages/rollup/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/generated/packages/vite/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/shared/packages/js/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/shared/packages/web/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/shared/packages/webpack/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/shared/packages/rspack/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/shared/packages/esbuild/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/docs/shared/packages/vite/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers
/packages/js/** @nrwl/nx-js-reviewers
@@ -92,8 +94,9 @@ rust-toolchain @nrwl/nx-native-reviewers
/packages/web/** @nrwl/nx-js-reviewers
/e2e/web/** @nrwl/nx-js-reviewers
/packages/webpack/** @nrwl/nx-js-reviewers
/packages/webpack/src/utils/module-federation @jaysoo @Coly010
/e2e/webpack/** @nrwl/nx-js-reviewers
/packages/rspack/** @nrwl/nx-js-reviewers
/e2e/rspack/** @nrwl/nx-js-reviewers
/packages/esbuild/** @nrwl/nx-js-reviewers
/e2e/esbuild/** @nrwl/nx-js-reviewers
/packages/rollup/** @nrwl/nx-js-reviewers
@@ -101,6 +104,9 @@ rust-toolchain @nrwl/nx-native-reviewers
/packages/vite/** @nrwl/nx-js-reviewers
/e2e/vite/** @nrwl/nx-js-reviewers
## Module Federation
/packages/module-federation/** @nrwl/nx-js-reviewers
## Tools
/docs/generated/packages/cypress/** @nrwl/nx-testing-tools-reviewers @nrwl/nx-docs-reviewers
/docs/shared/packages/cypress/** @nrwl/nx-testing-tools-reviewers @nrwl/nx-docs-reviewers
@@ -172,6 +178,7 @@ rust-toolchain @nrwl/nx-native-reviewers
/CONTRIBUTING.md @FrozenPandaz @isaacplmann
/CODE_OF_CONDUCT.md @FrozenPandaz @isaacplmann
/CODEOWNERS @FrozenPandaz @AgentEnder
/packages/nx/src/nx-cloud/utilities/url-shorten.ts @MaxKless
# Scripts
/scripts/documentation @nrwl/nx-docs-reviewers
+29 -7
View File
@@ -49,15 +49,33 @@ The repo comes with a preconfigured `devcontainer.json` file (located in `.devco
If you open the repo in [Github Codespace](https://github.com/features/codespaces), it will also leverage this config file, to setup the codespace, with the same required tools.
> 💡 **Troubleshooting**
>
> If you are having issues when running Nx commands like `build`, `test`... related to the version of `GLIBC`,
> it probably means the version that is installed on the devcontainer, **is outdated** compare to the minimum version required by Nx tools.
>
> You can check currently installed version by running the following command, in a terminal within the container:
>
> `ldd --version`
>
> Then, try updating the base image used in [devcontainer.json](.devcontainer/devcontainer.json) and rebuild it, to see if it solved the issue.
>
> Current base image is `"mcr.microsoft.com/devcontainers/typescript-node:20-bookworm"` which is based on `Debian-12 (bookworm)`,
> which comes with `GLIBC v2.36` pre-installed (Nx tools currenlty requires `GLIBC v2.33` or higher).
## Building the Project
> Nx uses Rust to build native bindings for Node. Please make sure that you have Rust installed via [rustup.rs](https://rustup.rs)
> If you have VSCode + Docker, this can be automated for you, see [section](#development-workstation-setup) above
> 💡 Nx uses `Rust` to build native bindings for Node. Please make sure that you have Rust installed via [rustup.rs](https://rustup.rs)
> If you have `VSCode` + `Docker`, this can be automated for you, see [section](#development-workstation-setup) above
After cloning the project to your machine, to install the dependencies, run:
```bash
pnpm i
pnpm install
// or prefer...
pnpm install --frozen-lockfile // if you haven't changed any dependency
```
To build all the packages, run:
@@ -76,13 +94,13 @@ Check out [this video for a live walkthrough](https://youtu.be/Tx257WpNsxc) or f
- Run `pnpm local-registry` in Terminal 1 (keep it running)
- Run `npm adduser --registry http://localhost:4873` in Terminal 2 (real credentials are not required, you just need to
be logged in. You can use test/test/test@test.io.)
- Run `pnpm nx-release 18.0.0 --local` in Terminal 2 - you can choose any nonexistent version number here, but it's recommended to use the next major
- Run `pnpm nx-release 20.0.0 --local` in Terminal 2 - you can choose any nonexistent version number here, but it's recommended to use the next major
- Run `cd ./tmp` in Terminal 2
- Run `npx create-nx-workspace@18.0.0` in Terminal 2
- Run `npx create-nx-workspace@20.0.0` in Terminal 2
If you have problems publishing, make sure you use Node 18 and NPM 8.
**NOTE:** To use this newly published local version, you need to make a new workspace, run `nx migrate` or change all of your target packages to this new version, eg: `"nx": "^18.0.0",` and re-run `pnpm i` in your testing project.
**NOTE:** To use this newly published local version, you need to make a new workspace, run `nx migrate` or change all of your target packages to this new version, eg: `"nx": "^20.0.0",` and re-run `pnpm i` in your testing project.
### Publishing for Yarn 2+ (Berry)
@@ -345,7 +363,7 @@ Including the issue number that the PR relates to also helps with tracking.
```plain
feat(angular): add an option to generate lazy-loadable modules
`nx generate lib mylib --lazy` provisions the mylib project in .eslintrc.json
`nx generate lib libs/mylib --lazy` provisions the mylib project in .eslintrc.json
Closes #157
```
@@ -355,3 +373,7 @@ Closes #157
To simplify and automate the process of committing with this format,
**Nx is a [Commitizen](https://github.com/commitizen/cz-cli) friendly repository**, just do `git add` and
execute `pnpm commit`.
#### PR releases
If you are working on a particularly complex change or feature addition, you can request a dedicated Nx release for the associated pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate.
Generated
+604 -677
View File
File diff suppressed because it is too large Load Diff
+34 -15
View File
@@ -21,26 +21,45 @@
# Smart Monorepos · Fast CI
Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
A few links to help you get started:
Create a new Nx workspace with
- [Nx.Dev: Documentation, Guides, Interactive Tutorials](https://nx.dev)
- [Nx.Dev: Core Tutorials](https://nx.dev/getting-started/intro)
- [Recipe: Adding Nx to an Existing Monorepo](https://nx.dev/recipes/adopting-nx/adding-to-monorepo)
- [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
- [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
```shell
npx create-nx-workspace
```
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="./images/nx-courses-and-videos.svg"
...or run
```
npx nx init
```
to add Nx to your existing workspace to get faster task scheduling, caching and more. More [in the docs](https://nx.dev/getting-started/intro#try-nx-yourself).
## Learn about CI with Nx Cloud
[Nx Cloud](https://nx.dev/nx-cloud) connects directly to your existing CI setup, helping you scale your monorepos on CI by leveraging [remote caching](https://nx.dev/ci/features/remote-cache?utm_source=nxrepo&utm_medium=readme&utm_campaign=nxrepo), [task distribution across multiple machines](https://nx.dev/ci/features/distribute-task-execution?utm_source=nxrepo&utm_medium=readme&utm_campaign=nxrepo), [automated e2e test splitting](https://nx.dev/ci/features/split-e2e-tasks?utm_source=nxrepo&utm_medium=readme&utm_campaign=nxrepo) and [automated task flakiness detection](https://nx.dev/ci/features/flaky-tasks?utm_source=nxrepo&utm_medium=readme&utm_campaign=nxrepo)
Connect your existing Nx workspace with
```
npx nx connect
```
Learn more in the [Nx CI docs &raquo;](https://nx.dev/ci/intro?utm_source=nxrepo&utm_medium=readme&utm_campaign=nxrepo)
## Useful links
- [Our docs](https://nx.dev/docs)
- [Our blog](https://nx.dev/blog)
- [Our community discord, live stream,...](https://nx.dev/community)
- [Our YouTube channel](https://www.youtube.com/@NxDevtools)
- [Our Twitter/X](https://x.com/nxdevtools)
<p style="text-align: center;"><a href="https://www.youtube.com/@nxdevtools/videos" target="_blank" rel="noreferrer"><img src="./images/nx-courses-and-videos.svg"
width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
# Engage with the Core Team and the Community
- [Nx.Dev Community Page: Community Discord Channel, Newsletter, etc.](https://nx.dev/community)
- [The Nx Show Playlist on YouTube](https://www.youtube.com/playlist?list=PLakNactNC1dE8KLQ5zd3fQwu_yQHjTmR5). It's a
regular YouTube stream where we talk all things Nx. Join the stream, ask questions, etc.
- [Follow Nx on Twitter](https://twitter.com/NxDevTools)
## Want to help?
If you want to file a bug or submit a PR, read up on
+38 -3
View File
@@ -29,6 +29,11 @@
"description": "Nx plugin integrations with Vite.",
"url": "https://nx-plugins.netlify.app/"
},
{
"name": "nx-serverless-cdk",
"description": "Create CDK applications and construct libraries. Test and debug infrastructure code and AWS Lambda functions locally.",
"url": "https://github.com/castleadmin/nx-plugins/tree/main/nx-serverless-cdk/plugin"
},
{
"name": "@ago-dev/nx-aws-cdk-v2",
"description": "An nx plugin for the aws-cdk v2.",
@@ -72,12 +77,12 @@
{
"name": "@nxext/ionic-react",
"description": "An Nx plugin for developing Ionic React applications and libraries",
"url": "https://github.com/nxext/nx-extensions/tree/main/packages/ionic-react"
"url": "https://github.com/nxext/nx-extensions-ionic/tree/main/packages/ionic-react"
},
{
"name": "@nxext/ionic-angular",
"description": "An Nx plugin for developing Ionic Angular applications and libraries",
"url": "https://github.com/nxext/nx-extensions/tree/main/packages/ionic-angular"
"url": "https://github.com/nxext/nx-extensions-ionic/tree/main/packages/ionic-angular"
},
{
"name": "@nxext/capacitor",
@@ -294,6 +299,11 @@
"description": "Nx plugin for working with shadcn/ui",
"url": "https://github.com/tripss/nx-extend/tree/master/packages/shadcn-ui"
},
{
"name": "@nx-extend/docusaurus",
"description": "Nx plugin adding first class support for Docusaurus in your Nx workspace.",
"url": "https://github.com/tripss/nx-extend/tree/master/packages/docusaurus"
},
{
"name": "@nativescript/nx",
"description": "Nx Plugin adding first class support for NativeScript in your Nx workspace",
@@ -369,6 +379,11 @@
"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.",
@@ -442,7 +457,7 @@
{
"name": "@naxodev/nx-cloudflare",
"description": "Nx plugin for Cloudflare, in particular Cloudflare workers. It allows to generate build and run Cloudflare workers in your Nx workspace.",
"url": "https://github.com/naxodev/oss/tree/main/packages/plugins/nx-cloudflare"
"url": "https://github.com/naxodev/oss/tree/main/packages/nx-cloudflare"
},
{
"name": "@ziacik/azure-func",
@@ -473,5 +488,25 @@
"name": "@getlarge/nx-heroku",
"description": "Plugin to deploy and promote Nx apps on Heroku",
"url": "https://github.com/getlarge/nx-heroku"
},
{
"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"
},
{
"name": "nx-solhint",
"description": "Solhint generators and inferred tasks for Nx",
"url": "https://github.com/juliangsibecas/nx-solhint"
},
{
"name": "nx-foundry",
"description": "Foundry generators and inferred tasks for Nx",
"url": "https://github.com/juliangsibecas/nx-foundry"
}
]
+54 -6
View File
@@ -32,7 +32,6 @@ We also have different audiences in mind when writing docs:
👦 Intermediate User
- They know how to create an Nx repo or add Nx to an existing repo
- They have heard the terms integrated and package-based
- They know what a project is and how to make one
- They understand how to run a task and the basics of caching
- They can launch the graph
@@ -94,14 +93,14 @@ Your content goes here.
{% /callout %}
```
#### Disclosure
#### Deep Dives
A disclosure can be used for less important information that is initially collapsed.
These are special callouts that are collapsed with the intention of containing more deep-dive information about the topic which isn't required to understand right away.
```markdown
{% disclosure title="string" %}
Your content goes here.
{% /disclosure %}
{% callout type="deepdive" title="string" %}
Your deep-dive content goes here.
{% /callout %}
```
#### Cards
@@ -183,6 +182,14 @@ To display a terminal command, use:
```
````
You can also add a title to the shell as follows:
````
```shell {% title="Build the app" %}
npx nx build
```
````
#### Terminal Output
You can display your terminal output with a dedicated component the same way you would show code.
@@ -408,3 +415,44 @@ Embed an Nx Graph visualization that can be panned by the user.
{% /graph %}
````
## Generating API Documentation
To generate API documentation for the codebase and update the menu for the docs on nx.dev, you can run:
```
nx documentation
```
This will happen automatically in a `git push` hook, so you'll be reminded if you forget.
### Generate API Documentation for Ocean Plugins
To generate API documentation for plugins in the ocean repository, run the `nx documentation` command with the `NX_OCEAN_RELATIVE_PATH` environment variable set to the relative path to your checked out copy of the ocean repo.
```
NX_OCEAN_RELATIVE_PATH=../ocean nx documentation
```
This will create generated API documentation in the `docs/external-generated` folder. This API will be merged into the normal `docs/generated` documentation when the docs site is built.
Because there are two separate output folders, if someone runs `nx documentation` without the `NX_OCEAN_RELATIVE_PATH` environment variable, the ocean documentation will not be overwritten. The ocean documentation will only be updated or deleted when someone explicitly chooses to do so.
## Publishing Process
There are multiple versions of the `nx.dev` site.
- [canary.nx.dev](https://canary.nx.dev) contains the documentation on the `master` branch
- [nx.dev](https://nx.dev) contains the documentation as of the latest release of Nx to npm. The main site will not include reference documentation for APIs that have been merged to the codebase, but not yet released to the public.
- `[version].nx.dev` contains the documentation for that version of Nx. `[version]` in this case is the major version up to the current LTS version of Nx. So [18.nx.dev](https://18.nx.dev) will show the Nx documentation as of the last released version of Nx 18.
When a commit that contains documentation is merged into `master`, it will be immediately published to `canary.nx.dev`. Whenever a new release of Nx is published to npm, that documentation will then be available on the main site.
### Immediately Publishing Time-Sensitive Documentation
If you have a documentation change that should be published immediately, you'll need to create 2 PRs.
1. First, create a PR against `master` in the normal manner.
2. Your second PR needs to be made against the website branch with the latest major version of Nx. So your second PR can be created against `website-19` if the latest version of Nx is `19.1.0`. Once `website-19` is updated with your changes, the main `nx.dev` site will be updated.
Later, when Nx `19.1.1` is released, `website-19` will be overwritten with whatever is on `master` and the first PR you created will take effect.
@@ -0,0 +1,329 @@
---
title: 'Taming Code Organization with Module Boundaries in Nx'
slug: 'mastering-the-project-boundaries-in-nx'
authors: ['Miroslav Jonaš']
cover_image: '/blog/images/2021-12-17/PIUl1QGk7mOpSFdEwFQ8OA.png'
tags: [nx]
---
As your repository grows, it becomes more challenging to organize and name the applications and libraries. This organization, when done right, feels intuitive and allows team members to easily find projects and understand how they work together. When done poorly, it results in a mess we eventually end up calling “the legacy software”. This article will show you different ways how you can prevent your repo from descending into chaos.
Our book [Enterprise Angular Monorepo Patterns](https://go.nx.dev/angular-enterprise-monorepo-patterns-new-book) presents an in-depth guide to assist you with naming and organization. If you still havent read this book, we warmly recommend you do. Dont let the name fool you, though — the architecture guidelines explained in this book apply to any framework.
On large projects, you will most likely find multiple teams working on different parts of the solution. Those projects are usually split into logical domains, where each team focuses on a single domain. Each domain block can have a clear public API which other domains can use to consume the information.
But the code organization is just one piece of the puzzle. The physical organization does not prevent developers from consuming the domains or parts of those domains, that should otherwise be outside of their reach. Nx ships with `enforce-module-boundaries` ESLint rule that helps restrict that possibility.
## Understanding the default configuration
When you generate the first project in your workspace using one of our generators, one of the things you get for free is the full linter setup. The linter is preconfigured with a default ruleset that includes a set of best practices. Alongside the standard set of rules, the initial generated configuration includes a setup for `enforce-module-boundaries` rule.
```json5 {% fileName=".eslintrc.json" %}
{
// ... default ESLint config here
overrides: [
{
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
rules: {
'@nrwl/nx/enforce-module-boundaries': [
'error',
{
allow: [],
depConstraints: [
{
sourceTag: '*',
onlyDependOnLibsWithTags: ['*'],
},
],
enforceBuildableLibDependency: true,
},
],
},
},
// ... more ESLint overrides here
],
}
```
Lets dissect what each of these properties does.
The `allow` array acts as a whitelist listing the import definitions that should be omitted from further checks. You can read more about it in the **Overriding the overrides** section below.
The `depConstraints` section is the one you will be spending most time fine-tuning. It represents an array of constraints, each consisting of `sourceTag` and `onlyDependOnLibsWithTags` properties. The default configuration has a wildcard `*` set as a value for both of them, meaning that any project can import (depend on) any other project.
> Note, the wildcard only applies to libraries. Applications and E2E applications cannot be imported. It wouldnt make any sense. If you want to combine applications, you should use the [micro-frontends](/recipes/angular/dynamic-module-federation-with-angular) approach with the module federation.
The circular dependency chains such as `lib A -> lib B -> lib C -> lib A` are also not allowed. The self circular dependency (when lib imports from a named alias of itself), while not recommended, can be overridden by setting the flag `allowCircularSelfDependency` to true.
```json5 {% fileName=".eslintrc.json" %}
// ... more ESLint config here
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"allowCircularSelfDependency": true,
"depConstraints": [
// ...list of constraints
]
}
]
// ... more ESLint config here
```
Finally, the flag `enforceBuildableLibDependency` prevents us from importing a non-buildable library into a buildable one. You can read more on what buildable libraries are used for in [our docs](/concepts/buildable-and-publishable-libraries).
## Using tags to enforce boundaries
To best express the need for the boundaries and assist us through the explanation, we will be using the repository represented by the following graph:
![](/blog/images/2021-12-17/z3ap5kyCXG4p8bcBQXx9tA.avif)
_The graph representation of the repository_
Our repository consists of two applications — Store and Admin. Each of them is composed of several feature libraries — Products (for Store), Sales, and Invoices (for Admin). Also, both of these applications depend on the Core library, and every project in our repo depends on our Shared library. Using common sense, we would like to enforce certain boundaries:
- A shared or core library should not be able to depend on a feature library
- A feature library can depend on another feature library or a shared library
First, we will use the project configuration to annotate our projects with `tags`.
- Tags used to live in `nx.json` but were in the recent version moved closer to the project, so you can locate them now in your `project.json` or `workspace.json`
Lets define the types of projects. We will use the following tags:
- `type:app` for application
- `type:feature` for feature library
- `type:util` for utility library
Your changed project configuration should now have the tags section defined.
```json5 {% fileName="project.json" %}
{
// ... more project configuration here
tags: ['type:app'],
}
```
Your enhanced graph will now look similar to this:
![](/blog/images/2021-12-17/kTiRazA4qhZ7kD-lGgGyjg.avif)
_Graph with type tags set_
The above list of library types is not complete. You might add specific ones for E2E projects or UI component libraries. Using the naming format `type:*` is just a suggestion. Consider this being a hashtag on your favorite social app. You can use any prefix or format you feel fitting. The important thing is that it's readable and intuitive to all the members of your team.
Now, that we have marked all of our projects, we can continue to define the rules in the root `.eslintrc.json.`
```json5 {% fileName=".eslintrc.json" %}
{
// ... more ESLint config here
'@nrwl/nx/enforce-module-boundaries': [
'error',
{
// update depConstraints based on your tags
depConstraints: [
{
sourceTag: 'type:app',
onlyDependOnLibsWithTags: ['type:feature', 'type:util'],
},
{
sourceTag: 'type:feature',
onlyDependOnLibsWithTags: ['type:feature', 'type:util'],
},
{
sourceTag: 'type:util',
onlyDependOnLibsWithTags: ['type:util'],
},
],
},
],
// ... more ESLint config here
}
```
## Adding a second dimension
We said that a feature library can depend on any other feature library, but there is a small catch. Our two apps could be built with a different framework so mixing feature libraries would not be possible. To avoid any future impediments, we dont want to allow a feature library used in `Store` to depend on the feature library from `Admin` and vice versa. Additionally, only our apps should be able to load the `Core` library.
![](/blog/images/2021-12-17/mr_MbGgWVbBcfBhss0hNqA.avif)
_Project graph with type tags and technology badges_
Lets add another dimension to allow such restrictions. We will define the necessary scope tags:
- `scope:store` for store app-related projects
- `scope:admin` for admin app related projects
- `scope:shared` for shared projects
- `scope:core` for core projects
Our diagram should now look like this:
![](/blog/images/2021-12-17/KeO1ZnEkUtmS2uj8M2rqKA.avif)
_Full project graph with two-dimensional tags_
Let us now define our missing rules!
```json5 {% fileName=".eslintrc.json" %}
{
// ... more ESLint config here
'@nrwl/nx/enforce-module-boundaries': [
'error',
{
// update depConstraints based on your tags
depConstraints: [
// ...previous project type related rules
{
sourceTag: 'scope:store',
onlyDependOnLibsWithTags: [
'scope:store',
'scope:shared',
'scope:core',
],
},
{
sourceTag: 'scope:admin',
onlyDependOnLibsWithTags: [
'scope:admin',
'scope:shared',
'scope:core',
],
},
{
sourceTag: 'scope:core',
onlyDependOnLibsWithTags: ['scope:shared'],
},
{
sourceTag: 'scope:shared',
onlyDependOnLibsWithTags: ['scope:shared'],
},
],
},
],
// ... more ESLint config here
}
```
## Fine-grained external dependencies
You may want to constrain what external packages a project may import. In our example above, we want to make sure projects in the `scope:store` does not import any angular packages, and projects from the `scope:admin` do not import any react library. You can ban these imports using `bannedExternalImports` property in your dependency constraints configuration.
We can now enhance our rule configuration by providing additional information.
```json5 {% fileName=".eslintrc.json" %}
{
// ... more ESLint config here
'@nrwl/nx/enforce-module-boundaries': [
'error',
{
// update depConstraints based on your tags
depConstraints: [
// ...previous project type related rules
{
sourceTag: 'scope:store',
onlyDependOnLibsWithTags: [
'scope:store',
'scope:shared',
'scope:core',
],
// this covers all @angular pacakges
bannedExternalImports: ['@angular/*'],
},
{
sourceTag: 'scope:admin',
onlyDependOnLibsWithTags: [
'scope:admin',
'scope:shared',
'scope:core',
],
// this covers react, but also react-router-dom or react-helmet
bannedExternalImports: ['react*'],
},
{
sourceTag: 'scope:core',
onlyDependOnLibsWithTags: ['scope:shared'],
bannedExternalImports: ['@angular/*', 'react*'],
},
{
sourceTag: 'scope:shared',
onlyDependOnLibsWithTags: ['scope:shared'],
bannedExternalImports: ['@angular/*', 'react*'],
},
],
},
],
// ... more ESLint config here
}
```
Using the wildcard `*` to match multiple projects e.g. `react*` we can save ourselves the effort of manually specifying every single project we want to ban.
## Restricting transitive dependencies
Our solution doesnt contain only internal projects but also depends on various external NPM packages. These external dependencies are explicitly declared in our `package.json`. Unfortunately, a package is rarely an island. They often consist of a tree of transitive dependencies branching out leading to thousands of packages being installed in your `node_modules` folder. Although we have control over what version or which direct dependency we install, we have no control over what versions of what packages this dependency depends on. The transitive dependencies are often the source of our app's vulnerabilities. We can also never guarantee those dependencies will be there. Just by simply running `npm install` parent may get updated to a patch or minor version that would wipe out one of the transitive dependencies or replace it with one with breaking changes.
Therefore its wise not to allow developers to import transitive dependencies in their projects. Our ESLint plugin provides a simple flag to turn this restriction on.
```json5 {% fileName=".eslintrc.json" %}
{
// ... more ESLint config here
'@nrwl/nx/enforce-module-boundaries': [
'error',
{
// ... more rule config here
banTransitiveDependencies: true,
},
],
// ... more ESLint config here
}
```
If you now try to import a transitive dependency, your linter responds with an error. This flag is disabled by default for now, but we highly recommend you enable it.
## Overriding the overrides
Sometimes, we just need to override this configuration for a given project. The scenario for this might be testing or during the development, if we are unsure yet how a certain project will be tagged. While we strongly encourage you to plan your architecture carefully and never override the boundaries configuration, you still have an option to bale out and override it.
```json5 {% fileName=".eslintrc.json" %}
{
// ... default ESLint config here
overrides: [
{
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
rules: {
'@nrwl/nx/enforce-module-boundaries': [
'error',
{
// ignore any checks for these projects for now
allow: ['a-wip-project', 'this-one-is-broken-so-ignore-it'],
depConstraints: [
// ...dependency constraints here
],
},
],
},
},
// ... more ESLint overrides here
],
}
```
## Summary
Monorepos are often viewed only from the technical side, but they also bring a shift in human resources organization. Teams that were once isolated, now have to work together on the same solution.
Having a clean separation of concerns and well-defined cohesive units helps us scale our organization more easily and gives us more confidence in our architecture. not only does Nx provide tools to speed up the overall performance, but it provides tooling to enforce the organizational constraints in an automated way.
In this post, we listed several strategies which you can use to restrict your packages from being misused or use unplanned external resources. Use them thoroughly and on time, before things go out of hand.
> Prefer a visual presentation over text? Then check out this talk recording by Juri Strumpflohner: [https://www.youtube.com/watch?v=pER_Ak1yUaA&t=687s](https://www.youtube.com/watch?v=pER_Ak1yUaA&t=687s)
@@ -0,0 +1,97 @@
---
title: 'Single File Monorepo Config, Custom Workspace Presets, Improved Tailwind Support, and more in Nx 13.4!'
slug: 'single-file-monorepo-config-custom-workspace-presets-improved-tailwind-support-and-more-in-nx-13'
authors: ['Brandon Roberts']
cover_image: '/blog/images/2021-12-23/4u3Fw49H5U-sqgyBoGsqw.png'
tags: [nx, release]
---
Nx is a smart, extensible build framework to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, computation caching, dependency management, and more.
## One Million Weekly Downloads 🎉
Nx reached a major milestone this week of one million weekly downloads. Nx has been working to push monorepos forward for a long time, and this milestone is a reflection of work between us and the Nx community to grow and expand in this space.
![](/blog/images/2021-12-23/WC4RQRZhTtOCsiATOL1cBg.avif)
_One million weekly downloads_
## Single File Monorepo Configuration ☝️
When operating with a monorepo, some level of configuration is needed to provide context about the tools and structure for inferring information about projects. Nx has traditionally done this with 2 files, the **nx.json** that contains global configuration for the Nx CLI, and the **workspace.json** that contains references to projects within your workspace.
With the latest release of Nx and add-nx-to-monorepo 2.0, there is only the **nx.json** configuration file added to your existing monorepo, with the project information done through analyzing your workspace for existing projects. This allows you to **incrementally adopt** Nx into your monorepo to run tasks, cache computations, and more.
```shell
npx add-nx-to-monorepo
```
> Victor Savkin demoed the flexibility of Nx by migrating Metas (Facebook) React repository: [video link](https://youtu.be/XLP2RAOwfLQ)
Learn more in our guide of [adding Nx to an existing workspace](/recipes/adopting-nx/adding-to-monorepo) and the config inside the [**nx.json**](/reference/project-configuration)**.**
## Custom Workspace Presets 🎨
Nx provides many presets by default to support many different ecosystems. Nx for monorepos is like VSCode, where plugins allow you to extend the functionality of your monorepo to fit your ecosystem or platform of choice. To make it easier for scaffolding a pre-defined setup, weve introduced the ability to use custom presets when creating Nx workspaces with a provided npm package.
```shell
npx create-nx-workspace --preset=your-npm-package-name
```
Nicholas Cunningham just joined Nrwl and already implemented this new Nx feature! In the following video, [Juri Strumpflohner](https://twitter.com/juristr) walks you through the process of creating a new Nx Plugin with a custom preset.
{% youtube src="https://www.youtube.com/watch?v=yGUrF0-uqaU" /%}
This allows you to enhance the initial experience for new workspaces directly for your organization, and allows the Nx Plugin community to offer more tailored experiences. Please try out the new feature and [let us know](https://github.com/nrwl/nx) how we can improve it!
## Dedicated TypeScript and JavaScript support with @nrwl/js
Nx has always shipped with great TypeScript support. In version 13.4 we improve it even further by releasing a brand new package: `@nrwl/js` .
This is particularly useful if you have framework-agnostic TS/JS packages within an existing Nx workspace but also for those scenarios where you want to build and publish a TS/JS-based library to some package registry. The setup is very lightweight, but still provides all benefits youd expect from an Nx-based setup such as Jest, ESLint, Prettier etc.
Read all the details on [our new TypeScript guide](/getting-started/intro) or check out the video walkthrough below.
{% youtube src="https://www.youtube.com/watch?v=-OmQ-PaSY5M" /%}
## Improved Tailwind support for Angular 💅
![](/blog/images/2021-12-23/1yacozydc1muZ74G.avif)
_Tailwind Logo_
Tailwind is a utility-first CSS framework packed with classes that can be composed to build any design, directly in your markup. If youve used Tailwind with Angular applications previously, it's supported out of the box with Nx. Were continually looking to improve the developer experience of using Tailwind in Angular applications and libraries. We already added support to the Angular plugin for Nx, and have added a new generator to configure Tailwind in **existing** apps and buildable/publishable libs, allowing you to set up and configure Tailwind without manual steps. The ability to configure new apps and libs is also supported, with support for Tailwind V2 and the latest V3 release.
```shell
nx g @nrwl/angular:app my-app --addTailwind
```
Read more about Angular and Tailwind in our [docs](/nx-api/angular/generators/setup-tailwind).
### Other Highlights 🗒
- Added SWC support for compiling JavaScript libraries and React apps/libs when building projects
- Added migration support Create React App version 5
- Updated the Angular framework to version 13.1
- Update support for Cypress to version 9
- Added additional SCAM generators for Angular for pipes and directives.
- Improved developer experience for using Module Federation with Angular v13
## How to Update Nx
Updating Nx is done with the following command, and will update your Nx workspace dependencies and code to the latest version:
```shell
nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
nx migrate --run-migrations
```
## Explore More
- Get our [free basic Nx workspaces course on YouTube](https://youtu.be/2mYLe9Kp9VM)!
- Purchase our premium video course on advanced practices for Nx workspaces: [here](https://nxplaybook.com/p/advanced-nx-workspaces)!
Follow us [on Twitter](https://twitter.com/NxDevTools), and subscribe to the [YouTube Channel](https://youtube.com/nrwl_io?sub_confirmation=1) for more information on [Angular](https://angular.io/), [React](https://reactjs.org/), Nx, and more!
@@ -0,0 +1,110 @@
---
title: 'New Terminal Output & Performance Improvements in Nx 13.5'
slug: 'new-terminal-output-performance-improvements-in-nx-13-5'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-01-25/PIUl1QGk7mOpSFdEwFQ8OA.png'
tags: [nx]
---
Nx is a smart, extensible build framework to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, computation caching, dependency management, and more.
### New Terminal Output 💅
Folks that have been following along in our journey for quite some time know already that at Nx we strive for the best possible DX. The current terminal output was always something we havent been super happy with, especially if you run some of the commands that trigger the execution of multiple tasks (e.g. affected commands, run-many etc). This is why were even more excited about this feature: the new dynamic Nx terminal output is now the default for everyone.
![](/blog/images/2022-01-25/81krRElSXV5w2T54DiCBAA.avif)
_New dynamic terminal output in Nx 13.5_
It clearly separates the terminal output into an upper part where all the completed tasks and their corresponding execution time are listed and a lower part where the currently running tasks show up. Of course, errors are always shown immediately and therefore easy to spot.
There are a few things to note here (and which kinda emphasize our love with details & dev ergonomics 😉)
- **Off in CI —** On CI youll still see the full output.
- **The full terminal output is still cached —** this is purely UI cosmetic. We still cache the entire terminal output. Hence, if you run the build of a single project that has previously been cached as part of a run-many command, you will see still the full output.
Thanks to [James Henry](https://twitter.com/mrjameshenry) for working on this feature!
### Nx keeps getting faster and faster 🚀
Performance is a feature, and we take it seriously with Nx. We landed a number of different performance improvements over the last couple of minor versions, ranging from optimizing how we store & restore our cache to improving the Nx workspace analysis and boot time. With v13.5 weve seen some Nx operations being
- 1.8x — 2.3x faster in the [Interstellar repo](https://github.com/vsavkin/interstellar)
- about 2x faster on some large client repositories
And we will not rest 😉.
### Performance Profiling with Nx 🧐
When running an Nx command there might potentially be many tasks running at different times, in parallel, and using different processes. Optimizing those runs or better understanding where things go wrong might be a hard and cumbersome process. Being able to visualize things usually helps.
Thats why we introduced the ability to profile and visualize Nx commands in the Chrome Devtools.
![](/blog/images/2022-01-25/7vk8AUWRGkDI0vcVX4Ql-g.avif)
Use the `NX_PROFILE=<filename>` environment variable attached to your Nx CLI command:
```shell
NX_PROFILE=profile.json nx build cart
```
Itll produce a JSON file which you can then open with Chromes devtools. [Read more about it on the Nx Docs](/troubleshooting/performance-profiling).
Thanks [Jason](https://twitter.com/FrozenPandaz) for working on this feature!
### React Native now supports Environment Variables
Whenever you set up React Native support within an Nx workspace, it should now automatically come with the [react-native-config](https://github.com/luggit/react-native-config) package installed. That allows you to have a `.env` file in the React Native app folder which can then be loaded from within your React Native application.
You can find all the details on the [Nx docs](/recipes/react/react-native).
Thanks [Emily Xiong](https://twitter.com/xiongemily) for implementing this!
### Improvements to the Project Graph Visualization
The project graph is always a nice feature to show off in videos, talks, and blog posts. But if done naively, it just remains that. We always wanted it to be more than that. As your workspace grows, your project graph visualization should become more useful, rather than a mess to look at. This is why we kept adding features for filtering, zooming, highlighting, focusing on specific nodes, incrementally expanding the view by using the proximity feature and more.
In v13.5 we now also store the current filter status in the URL. That makes it easy to pinpoint a certain view and share it with a co-worker. Actually, this could just be the beginning of some more interesting features when we think about CI and visualizations 🤔.
![](/blog/images/2022-01-25/RM9hDFIsgLn1X4EX5qsgGg.avif)
_Nx dep graph now stores filters in the URL_
Heres our deployed live example of the above screenshot: [https://nrwl-nx-examples-dep-graph.netlify.app/?focus=products-home-page](https://nrwl-nx-examples-dep-graph.netlify.app/?focus=products-home-page)
Thanks [Philip Fulcher](https://twitter.com/PhilipJFulcher) for adding this feature!
Theres one more thing: As developers, we like to be as efficient as possible. We wanted to help by saving you some keystrokes. The project graph visualization can now be launched with
```shell
nx graph
```
`nx dep-graph` is registered as an alias and will continue to work 🙂.
### New improvements to our Angular plugin
There have been a number of improvements to our Angular plugin ( `@nrwl/angular` ) :
- Option to skip the Angular Module creation when generating new libraries by passing `--skipModule`
- Support for multiple state slices when using the Nx Angular Data Persistence utilities. Thanks [David](https://medium.com/u/6e7f9350fcdf?source=post_page-----c407bb1c963a--------------------------------) for this community contribution !([#8216](https://github.com/nrwl/nx/pull/8216))
- New Angular Nx workspaces now use v2 of the workspace configuration (Nxs format of the `angular.json` )
- Lots of improvements to the Angular SCAM generator
## How to Update Nx
Updating Nx is done with the following command, and will update your Nx workspace dependencies and code to the latest version:
```shell
nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
nx migrate --run-migrations
```
## Explore More
- Get our [free basic Nx workspaces course on YouTube](https://youtu.be/2mYLe9Kp9VM)!
- Purchase our premium video course on advanced practices for Nx workspaces: [here](https://nxplaybook.com/p/advanced-nx-workspaces)!
Follow us [on Twitter](https://twitter.com/NxDevTools), and subscribe to the [YouTube Channel](https://youtube.com/nrwl_io?sub_confirmation=1) for more information on [Angular](https://angular.io/), [React](https://reactjs.org/), Nx, and more!
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,473 @@
---
title: 'Share code between React Web & React Native Mobile with Nx'
slug: 'share-code-between-react-web-react-native-mobile-with-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2022-02-01/lL-fGNaIGYBC_eOBwSvdBw.png'
tags: [nx, tutorial]
---
**A problem I try to solve:** I got this awesome idea, not only do I want to create a web app, but I also want to create a mobile app for it. Usually creating web and mobile apps require totally different tech stacks, and it is pretty hard to share code. This article shows how I added a React web app and a React Native mobile app in the same monorepo using Nx, and how I optimized codeshare between the two.
I am mostly a web developer, so lets start with the web app first: [https://xiongemi.github.io/studio-ghibli-search-engine](https://xiongemi.github.io/studio-ghibli-search-engine). It is a search engine for movies and characters under Studio Ghibli:
![](/blog/images/2022-02-01/TILaEjwvKtDTODE8Zo7wFA.avif)
_Screenshot of web app_
Example Repo: [xiongemi/studio-ghibli-search-engine](https://github.com/xiongemi/studio-ghibli-search-engine)
Github page: [https://xiongemi.github.io/studio-ghibli-search-engine](https://github.com/xiongemi/studio-ghibli-search-engine)
Now lets create the corresponding mobile version of this app.
## Tech Stack
- Monorepo: Nx
- Web Frontend: [React](https://reactjs.org/)
- API: [https://ghibliapi.herokuapp.com/](https://ghibliapi.herokuapp.com/)
Currently, theres only a React web app within our Nx workspace. If I run `nx graph`, the dependency graph looks like the below:
![](/blog/images/2022-02-01/AkrRrJ1pbALScj64T8rc_g.avif)
_Dependency graph_
## React Native Setup
To get started we need to add React Native support to our Nx workspace:
```shell
# npm
npm install @nrwl/react-native --save-dev# yarn
yarn add @nrwl/react-native --dev
```
Next, we can generate a new React Native app by running:
```shell
npx nx generate @nrwl/react-native:app studio-ghibli-search-engine-mobile
```
> Note, if youre using VSCode you might want to try [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console) for a more visual experience of running such commands.
As a result of running the above command, you should now have two new folders under the `apps` directory: `studio-ghibli-search-engine-mobile` and `studio-ghibli-search-engine-mobile-e2e`
![](/blog/images/2022-02-01/pKHufw-OEbTmDRyNcsAd4A.avif)
_studio-ghibli-search-engine-mobile created under apps_
If we now run `nx dep-graph` again, the dependency graph looks like this:
![](/blog/images/2022-02-01/UN-VoWFKTqExCCFzQeZkYA.avif)
_Dependency graph_
Note that there is no code shared between `studio-ghibli-search-engine-mobile` and `studio-ghibli-search-engine-web`. However, our goal is to reuse some of the functionality that we have previously written for the web version on our new React native version of the app.
## Code that Could NOT be Shared
Even though our goal is to share as much as possible between our React web app and the React Native app, there are parts that simply cannot be shared.
### UI
We have to rewrite all the UI components for the mobile app. Unlike [Cordova](https://cordova.apache.org/) or [Ionic](https://ionicframework.com/), React Native is NOT a webview. The JavaScript we wrote got interpreted and converted to mobile native elements. Hence we cannot simply reuse UI HTML elements written for the React web app.
Heres a quick list of libraries weve used for the React web app and a corresponding React Native counterpart library we can use.
**Routing**
- [react-router-dom](https://reactrouter.com/docs/en/v6/getting-started/overview) for web
- [@react-navigation/native](https://reactnavigation.org/) for mobile
**Material Design Library**
- [@mui/material](https://mui.com/) for web
- [react-native-paper](https://callstack.github.io/react-native-paper/) for mobile
Besides the above React Native libraries, there are some core utility libraries that need to be installed:
- react-native-reanimated
- react-native-gesture-handler
- react-native-screens
- react-native-safe-area-context
- @react-native-community/masked-view
- react-native-vector-icons
The corresponding install command would be:
```shell
# npm
npm install @react-navigation/native @react-navigation/native-stack react-native-paper react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view --save# yarn
yarn add @react-navigation/native @react-navigation/native-stack react-native-paper react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
```
### Storage
For the React Web app, we use [redux-persist](https://github.com/rt2zz/redux-persist), which persists the redux store in [`localstorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage). However, `localstorage` is not supported by React Native.
For the web, the variable `persistConfig` passed to persistStore from redux-persist is:
```typescript
import storage from 'redux-persist/lib/storage';
const persistConfig = {
key: 'root',
storage: storage,
whitelist: ['search', 'films', 'people'],
transforms: [transformEntityStateToPersist],
};
```
However, for the mobile, we need to install the library [`@react-native-async-storage/async-storage`](https://github.com/react-native-async-storage/async-storage):
```shell
# npm
npm install @react-native-async-storage/async-storage --save-dev# yarn
yarn add @react-native-async-storage/async-storage --dev
```
As a result, the `persistConfig` passed to persistStore from redux-persist becomes:
```typescript
import AsyncStorage from '@react-native-async-storage/async-storage';
const persistConfig = {
key: 'root',
storage: AsyncStorage,
whitelist: ['search', 'films', 'people'],
transforms: [transformEntityStateToPersist],
};
```
### History
On the React web app, we use [connected-react-router](https://github.com/supasate/connected-react-router) to put the router state into the Redux store. However, the [History API (windows.history)](https://developer.mozilla.org/en-US/docs/Web/API/History_API) is not supported by React Native. As an alternative, we can use `createMemoryHistory`.
For the web app, the history is:
```typescript
import { createHashHistory, History } from 'history';
const history: History = createHashHistory();
```
For the mobile app, the history is:
```typescript
import { createMemoryHistory, History } from 'history';
const history: History = createMemoryHistory();
```
To make our code more re-usable we could slightly refactor the creation of the root reducer with [connected-react-router](https://github.com/supasate/connected-react-router), such that it takes the `history` object as an argument:
```typescript
import { combineReducers } from '@reduxjs/toolkit';
import { connectRouter } from 'connected-react-router';
import { History } from 'history';
import { filmsSlice } from '../films/films.slice';
import { peopleSlice } from '../people/people.slice';
import { searchSlice } from '../search/search.slice';
import { RootState } from './root-state.interface';
export const createRootReducer = (history: History) =>
combineReducers<RootState>({
films: filmsSlice.reducer,
router: connectRouter(history) as any,
search: searchSlice.reducer,
people: peopleSlice.reducer,
});
```
### Query Parameters
When you develop on the web, the easiest way to pass ahead state or information, in general, is to leverage the URL query parameters. In our search app example, we can simply have something like `?search=searchText`.
We can use [react-router-dom](https://v5.reactrouter.com/web/guides/quick-start) to push a new history entry.
```typescript
import { useHistory } from 'react-router-dom';
const history = useHistory();
const submitSearchForm = (text: string) => {
history.push(`${AppRoutes.results}?search=${text}`);
};
```
To read and parse the current query parameter `search`:
```typescript
import { useLocation } from 'react-router-dom';
const params = new URLSearchParams(useLocation().search);
const searchParam = params.get('search');
```
Although the mobile app URLs are not visible, we can still pass parameters. Note that we have to use a different package `@react-navigation/native` though.
```typescript
import { useNavigation } from '@react-navigation/native';
const navigation = useNavigation();
const submitSearchForm = () => {
navigation.navigate(AppRoutes.results, { search: text });
};
```
To read and parse the parameter:
```typescript
import { RouteProp, useRoute } from '@react-navigation/native';
const route = useRoute<RouteProp<{ params: { search: string } }>>();
const searchParam = route.params?.search;
```
To type checking with typescript for react-navigation, we need to create a type `RootStackParamList` for mappings of route name to the params of the route:
```typescript
export type RootStackParamList = {
[AppRoutes.search]: undefined;
[AppRoutes.results]: { search: string };
};
```
We also need to specify a global type for your root navigator:
```typescript
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace ReactNavigation {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface RootParamList extends RootStackParamList {}
}
}
```
So we create the stack navigator, we need to pass the above `RootStackParamList` type:
```typescript
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator<**RootStackParamList**>();
```
### Environment Variables
Nx comes with a set of different options for [handling environment variables](/reference/environment-variables). In our workspace, we have a simple `.env` file at the workspace root:
```text
NX_REQUEST_BASE_URL=://ghibliapi.herokuapp.com
```
This works nicely for our React web build, but it doesnt for our React Native application. This is because React Native and React apps use different Javascript bundlers. React Native uses [Metro](https://facebook.github.io/metro/) and React uses [Webpack](https://webpack.js.org/). Therefore, when we try to access `process.env.NX_REQUEST_BASE_URL`, we get `undefined`.
To solve this, we can use the [react-native-config](https://github.com/luggit/react-native-config) library
```shell
# npm
npm install react-native-config --save-dev# yarn
yarn add react-native-config --dev
```
Heres an example of how to set up [react-native-config](https://github.com/luggit/react-native-config): [https://github.com/luggit/react-native-config#setup](https://github.com/luggit/react-native-config#setup).
After that, we can have a simple utility function to retrieve the environment variables in our app.
```typescript
import Config from 'react-native-config';
export function getEnv(envName: string) {
return process.env[envName] || Config[envName];
}
```
To access the environment variable `NX_REQUEST_BASE_URL`, we can then simply use the above function:`getEnv(NX_REQUEST_BASE_URL)`.
### Fetch With HTTP
On the web, you most probably lean on the [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make network requests. On iOS, however, youll get an error saying: `TypeError: Network request failed`.
It turns out that React Native does not allow HTTP requests by default: [https://stackoverflow.com/questions/38418998/react-native-fetch-network-request-failed](https://stackoverflow.com/questions/38418998/react-native-fetch-network-request-failed).
To fix this, for iOS, open `apps/studio-ghibli-search-engine-mobile/ios/StudioGhibliSearchEngineApp/Info.plist` and add the request URL to `NSExceptionDomains` under `NSAppTransportSecurity`:
```xml
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>ghibliapi.herokuapp.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
```
Similarly, for Android, open `apps/studio-ghibli-search-engine-mobile/android/app/src/main/res/xml/network_security_config.xml`, and add the request URL to this config file:
```xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">10.0.2.2</domain>
<domain includeSubdomains="true">localhost</domain>
<domain includeSubdomains="true">herokuapp.com</domain>
</domain-config>
</network-security-config>
```
This should get rid of the network error.
It seems like there are quite a few customizations that need to be done for React Native apps. However, the majority of non-UI code could be reused.
## Code that Could be Shared
All the business logic code that is not UI could be shared. For this example, I got 3 libraries in my monorepo and all of them could be shared:
- models: types and interface definitions
- services: services that interact with API
- store: redux store
With Nx, it requires zero configuration to share the above library code. Even though when I created these libraries for a web app, I used commands like `nx generate @nrwl/react:lib store`, I could still use them directly in my react native mobile app.
For example, I need to create a film page to display film details with film id passed in as a parameter:
![](/blog/images/2022-02-01/zD_5omXSG-hIVHbgpCb-bA.avif)
_Screenshot of Film Page on Mobile (left: iOS, right: Android)_
I would do import from the store library directly:
```typescript
import {
filmsActions,
filmsSelectors,
RootState,
} from '@studio-ghibli-search-engine/store';
```
The film component would become:
```typescript {% fileName="film.props.ts" %}
import { AnyAction, ThunkDispatch } from '@reduxjs/toolkit';
import {
filmsActions,
filmsSelectors,
RootState,
} from '@studio-ghibli-search-engine/store';
const mapStateToProps = (state: RootState) => {
return {
getFilm: (id: string) => filmsSelectors.selectFilmById(id)(state),
};
};
const mapDispatchToProps = (
dispatch: ThunkDispatch<RootState, void, AnyAction>
) => {
return {
fetchFilms() {
dispatch(filmsActions.fetchFilms());
},
};
};
type mapStateToPropsType = ReturnType<typeof mapStateToProps>;
type mapDispatchToPropsType = ReturnType<typeof mapDispatchToProps>;
type FilmProps = mapStateToPropsType & mapDispatchToPropsType;
export { mapStateToProps, mapDispatchToProps };
export type { FilmProps };
```
```tsx {% fileName="film.tsx" %}
import { RouteProp, useRoute } from '@react-navigation/native';
import { FilmEntity } from '@studio-ghibli-search-engine/models';
import { getEnv } from '@studio-ghibli-search-engine/services';
import React, { useEffect, useState } from 'react';
import { SafeAreaView, ScrollView, Image, View } from 'react-native';
import {
Button,
Divider,
Headline,
Paragraph,
Subheading,
Title,
} from 'react-native-paper';
import { styles } from 'react-native-style-tachyons';
import { connect } from 'react-redux';
import Loading from '../shared/loading/loading';
import { useLink } from '../shared/open-link/open-link';
import { FilmProps, mapDispatchToProps, mapStateToProps } from './film.props';
export function Film({ getFilm, fetchFilms }: FilmProps) {
const [film, setFilm] = useState<FilmEntity>();
const route = useRoute<RouteProp<{ params: { id: string } }>>();
const id = route.params?.id;
const openHboMax = useLink(getEnv('NX_HBO_STREAMING_URL'), 'HBO Max');
const openNetflix = useLink(getEnv('NX_NETFLIX_STREAMING_URL'), 'Netflix');
useEffect(() => {
fetchFilms();
}, [fetchFilms]);
useEffect(() => {
setFilm(getFilm(id));
}, [id, getFilm]);
return film ? (
<SafeAreaView>
<ScrollView contentInsetAdjustmentBehavior="automatic">
<View style={[styles.pa3]}>
<Image
style={{ height: 200, width: '100%', resizeMode: 'contain' }}
source={{ uri: film.movieBanner }}
/>
<Headline>{film.title}</Headline>
<Subheading>
{film.originalTitle} / {film.originalTitleRomanised}
</Subheading>
<Paragraph>Release: {film.releaseDate}</Paragraph>
<Paragraph>Director: {film.director}</Paragraph>
<Paragraph>Producer: {film.producer}</Paragraph>
<Paragraph>Running Time: {film.runningTime} minutes</Paragraph>
<Paragraph>Rotten Tomatoes Score: {film.rtScore}</Paragraph>
<Divider />
<Title>Plot</Title>
<Paragraph>{film.description}</Paragraph>
<Divider />
<Button onPress={openHboMax}>Watch on HBO Max</Button>
<Button onPress={openNetflix}>Watch on Netflix</Button>
</View>
</ScrollView>
</SafeAreaView>
) : (
<Loading />
);
}
export default connect(mapStateToProps, mapDispatchToProps)(Film);
```
Note I could import from `@studio-ghibli-search-engine/models`, `@studio-ghibli-search-engine/services` and `@studio-ghibli-search-engine/store` directly.
Now when I run `nx dep-graph`, it shows the dependency graph below where all these 3 libraries are shared between web and mobile:
![](/blog/images/2022-02-01/697qjtaGr4mTSnuRq6vpPw.avif)
_Dependency graph_
For this example project, to create the mobile app, it took me some time to rewrite the entire UI. However, I do not need to make any changes to the above libraries.
![](/blog/images/2022-02-01/Ldob3R4V50WG4gP-UzKAOg.avif)
_Screenshots of Mobile App (left: iOS, right: Android)_
## Conclusion
In this article, we ended up building both, a React-based web application and a corresponding React Native app in the same repository using Nx.
Nxs architecture promotes the separation of concerns, splitting things into `apps` (which are technology-specific) and `libs` which can be technology-specific or technology-independent. That allows us to easily have our common business logic in a technology-independent library which in turn (thanks to Nxs setup) be easily linked to both, our React web and React Native mobile app.
Although there are UI-specific differences we need to account for, that simply comes with one being a web tech stack and the other being a native app, we were still able to share big chunks of the technology-independent business logic of our application. That ultimately helps with maintenance and having feature parity across different platforms.
_(Note, the repository with the code for this article is linked at the very top)_
@@ -0,0 +1,307 @@
---
title: 'Introducing Expo Support for Nx'
slug: 'introducing-expo-support-for-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2022-03-23/yYc8g4ifk9RApSjAhQysag.png'
tags: [nx, release]
---
We are very excited to announce our support for Expo with our new package `@nrwl/expo`. In addition to the React Native support, with this release of `@nrwl/expo`, you will be able to easily develop mobile apps in the monorepo. If you use Expo in a monorepo then Nx is the tool for you.
This blog will show you how to create a one-page app to display a poem:
![](/blog/images/2022-03-23/vDAGnOKsuXDhMDDtw7Swcg.avif)
_Page Screenshot (left: Android, right: iOS)_
Github Repo: [xiongemi/nx-expo-poetry](https://github.com/xiongemi/nx-expo-poetry)
## Before We Start
When I just started to try out Expo, the first questions came to my mind were “what is the difference between Expo and React Native” and “when to choose Expo and when to choose React Native”? In short, Expo is a set of tools built on top of React Native. You can read it more at [https://stackoverflow.com/questions/39170622/what-is-the-difference-between-expo-and-react-native](https://stackoverflow.com/questions/39170622/what-is-the-difference-between-expo-and-react-native).
Now I have created an app with Expo, to me, the most significant differences are developer experience and the build process.
![](/blog/images/2022-03-23/JqkWuBAXkfVVDZbQ7Kzffg.avif)
_Left: managed Expo project folder, right: React Native project folder_
For a managed Expo project, notice that it only has a `src` folder; whereas for a React Native project, besides the `src` folder, it also contains the `android` and `ios` folder. For a managed Expo project, developers do not need to worry about maintaining code for iOS and Android. However, you can still write customized native code for Expo, you can use Expo with [bare workflow](https://docs.expo.dev/introduction/managed-vs-bare/#bare-workflow) after running the command `expo eject`.
Moreover, Expo provides [Expo Application Services(EAS)](https://docs.expo.dev/eas/) to build and distribute your app. React Native developers can bundle and build locally using Android Studio or Xcode. However, with EAS Build, it will build on a hosted service. Of course, there is potentially a fee involved: [https://expo.dev/pricing](https://expo.dev/pricing).
**Something to note:** [@nrwl/expo](https://www.npmjs.com/package/@nrwl/expo) and [@nrwl/react-native](https://www.npmjs.com/package/@nrwl/react-native) cannot exist in the same monorepo due to dependency version conflicts. Expo usually tails the latest React Native by a few versions, whereas [@nrwl/react-native](https://www.npmjs.com/package/@nrwl/react-native) tries to align with the latest React Native version.
## Setup
First, lets create an Nx workspace:
```shell
npx create-nx-workspace nx-expo-poetry --preset=empty
```
Then you need to install @nrwl/expo package:
```shell
cd nx-expo-poetry
# npm
npm install @nrwl/expo --save-dev
# yarn
yarn add @nrwl/expo --dev
```
Then you need to generate an expo app:
```shell
nx generate @nrwl/expo:app poetry-app
```
Now you should notice that under the apps folder, there are 2 folders generated: `peotry-app` and `poetry-app-e2e:`
![](/blog/images/2022-03-23/xLRdddGDLfGSD5wJLOpzuQ.avif)
_apps folder_
Now run the command to serve up the Expo Development Server:
```shell
nx start poetry-app
```
You should see the starter app in the simulator:
![](/blog/images/2022-03-23/QTtTs_ggIHyzv0b4vSGX3w.avif)
_Expo Development Server_
## Create First Page
Now we got the app running, lets create our first page. In this example, we are going to use the [React Native Paper](https://callstack.github.io/react-native-paper/) as the material design library. To install:
```shell
# npm
npm install react-native-paper --save
# yarn
yarn add react-native-paper
```
Then, lets create our first component. This component simply displays a poem on the page.
First, to add a component file under the app, run the below command:
```shell
nx g @nrwl/expo:component poem-of-the-day --directory=components
```
Now you should see the components under apps/components:
![](/blog/images/2022-03-23/HZUqQJbNUqBfPns7qqvN5w.avif)
Then paste the below code to the `App.tsx` and `poem-of-the-day.tsx`:
```tsx {% fileName="App.tsx" %}
import React from 'react';
import { SafeAreaView, ScrollView } from 'react-native';
import { Provider as PaperProvider } from 'react-native-paper';
import PoemOfTheDay from '../components/poem-of-the-day/poem-of-the-day';
const App = () => {
return (
<PaperProvider>
<SafeAreaView>
<ScrollView contentInsetAdjustmentBehavior="automatic">
<PoemOfTheDay></PoemOfTheDay>
</ScrollView>
</SafeAreaView>
</PaperProvider>
);
};
export default App;
```
```tsx {% fileName="poem-of-the-day.tsx" %}
import React from 'react';
import { Card, Title, Paragraph, Subheading } from 'react-native-paper';
/* eslint-disable-next-line */
export interface PoemOfTheDayProps {}
export function PoemOfTheDay(props: PoemOfTheDayProps) {
return (
<Card>
<Card.Cover source={{ uri: `https://picsum.photos/300/200` }} />
<Card.Content>
<Title>Ozymandias</Title>
<Subheading>Percy Bysshe Shelley</Subheading>
<Paragraph>
I met a traveller from an antique land {'\n'}
Who said: Two vast and trunkless legs of stone {'\n'}
Stand in the desert...Near them, on the sand, {'\n'}
Half sunk, a shattered visage lies, whose frown,{'\n'}
And wrinkled lip, and sneer of cold command, {'\n'}
Tell that its sculptor well those passions read {'\n'}
Which yet survive, stamped on these lifeless things, {'\n'}
The hand that mocked them, and the heart that fed: {'\n'}
And on the pedestal these words appear: {'\n'}
'My name is Ozymandias, king of kings: {'\n'}
Look on my works, ye Mighty, and despair!' {'\n'}
Nothing beside remains. Round the decay{'\n'}
Of that colossal wreck, boundless and bare{'\n'}
The lone and level sands stretch far away.
</Paragraph>
</Card.Content>
</Card>
);
}
export default PoemOfTheDay;
```
Now, if you run command `nx start poetry-app` and then run the app on the simulator, you should see:
![](/blog/images/2022-03-23/563FtEWPwo4m93qOvFmk1Q.avif)
_Page Screenshot (left: Android, right: iOS)_
To see it in the real device, run `nx publish poetry-app`.
Awesome! Now you have built your first page. However, notice this page only displays a static poem. The next step is to integrate with the API. In this example. We are going to use PoetryDB: [https://github.com/thundercomb/poetrydb](https://github.com/thundercomb/poetrydb).
## Create a Workspace Library
To create a library that gets a random poem from the API, run the command:
```shell
nx generate @nrwl/expo:library services
```
This should generate a services folder under libs:
![](/blog/images/2022-03-23/7jNkHVOQpfZ6XAoWnDFc8A.avif)
Create a `poetry.service.ts` file to call the PoetryDB API and get a random poem:
```typescript {% fileName="poem-response.interfacve.ts %}
// at libs/services/src/models/poem-response.interface.ts
export interface PoemResponse {
title: string;
author: string;
lines: string[];
linecount: string;
}
```
```typescript {% fileName="poetry.service.ts" %}
// at libs/services/src/poetry/poetry.service.ts
import { PoemResponse } from '../models/poem-response.interface';
const POETRY_BASE_URL = 'https://poetrydb.org/';
export async function getPoemOfTheDay(): Promise<PoemResponse[]> {
const response: Response = await fetch(POETRY_BASE_URL + 'random', {
method: 'GET',
});
if (response.ok) {
return await response.json();
}
throw response;
}
export const poetryService = { getPoemOfTheDay };
```
For the service we created above, we can import it in the app directly like:
```shell
import { PoemResponse, poetryService } from '@nx-expo-poetry/services';
```
Then the `apps/poetry-app/src/components/poem-of-the-day/poem-of-the-day.tsx` would become:
If you now run the app using `nx start poetry-app`, you should see the poem loaded from API:
![](/blog/images/2022-03-23/ytjIE4sXlqWHG10ltVw-Dw.avif)
_Page Screenshot (left: Android, right: iOS)_
## Using Expo Build
Now you want to build and possibly publish your app. To build the standalone app, you can use the Expo build. First, you need to create an Expo account. You can do it at [https://expo.dev/signup](https://expo.dev/signup) or using the command line:
```shell
npx expo login
```
Then you can run the build command:
```shell
# iOS
nx build-ios poetry-app
# Android
nx build-android poetry-app
```
You can monitor your builds after logging in at [https://expo.dev/](https://expo.dev/):
![](/blog/images/2022-03-23/MlV6Ph6KEeA6L-kMpL8FEQ.avif)
_Builds page at https://expo.dev/_
You can read more at [https://docs.expo.dev/classic/building-standalone-apps/](https://docs.expo.dev/classic/building-standalone-apps/) to debug.
## Using EAS Build
Before you start to use EAS build, you need to install EAS CLI:
```shell
npm install -g eas-cli
```
Then, you can sign up and log in to your Expo:
```shell
npx expo login
```
Then go to the app folder using `cd apps/poetry-app` and simply run:
```shell
eas build
```
You can monitor your builds after logging in at [https://expo.dev/](https://expo.dev/):
![](/blog/images/2022-03-23/84j3XYXVDVlvSXbX2xR29Q.avif)
_Builds page at https://expo.dev/_
To submit to the app store, run:
```shell
eas submit
```
## Conclusion
In this article, we have:
- successfully built an expo app using Nx
- add UI in the app
- create a separate library to handle services
- use EAS to build the app
With Nx, we can create as many libraries as we want to handle different concerns. It would be very handy to share and reuse libraries or have multiple apps in the same monorepo.
I hope you found this useful, and we look forward to hearing your [feedback](https://github.com/nrwl/nx-labs/issues).
If youre new to Nx and want to learn more, visit [our docs](/getting-started/intro)**.**
_(Note, the repository with the code for this article is linked at the very top.)_
This app is also available in the app store, just search “Poem of the Day”:
Android:
[Poem of the Day](https://play.google.com/store/apps/details?id=com.exiong.poetryapp)
iOS:
![](/blog/images/2022-03-23/VnB0y4EDRPFExB9E8KRf1A.avif)
_Screenshot in iOS app store_
@@ -0,0 +1,453 @@
---
title: 'The React CLI you always wanted but didnt know about'
slug: 'the-react-cli-you-always-wanted-but-didnt-know-about'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-03-29/YR6QUEZel3nlNcTo6Pdlwg.png'
tags: [nx]
---
_In this article, Id like to specifically talk about developer tooling, why it is so massively important and how you might have missed out on Nx as your main React CLI for kickstarting new awesome projects._
It is awesome to be a JavaScript developer nowadays. The JavaScript ecosystem has evolved a lot in recent years. For the better! Speed has become a major focus, both from the framework perspective of running the app in production, as well as the speed of developing, testing, and building JavaScript/TypeScript from a developer tooling point of view. Frameworks and libraries such as Next.js, Astro, Qwik and Remix (just to name a few) have brought some great innovations to push the web even further.
While speed is of major importance, developer ergonomics shouldnt be left behind. Both of them greatly contribute to the overall productivity and also developer happiness 🙂. Lets see how Nx can help with that.
**Prefer the video version?**
{% youtube src="https://www.youtube.com/watch?v=QghilgRe-pw" /%}
## Update (Aug 2023): Want a non-monorepo setup?
This article walks you through how to setup a new Nx monorepo workspace with React. If you rather prefer starting with a single-project setup (also named “standalone”) then you might want to have a look at this tutorial (including video):
[/getting-started/tutorials/react-standalone-tutorial](/getting-started/tutorials/react-standalone-tutorial)
## Why use a devtool CLI?
Regardless of whether youre a seasoned developer or someone new just getting started with React: the last thing you want to have to deal with is to manually set up all the tooling to actually get started and be productive. You want to be able to focus on the actual task, like learning React or kicking off that new shiny project.
Still, we definitely want to **have good defaults set up for us**. Things like the latest build tooling, tooling for writing unit tests as well as e2e tests, code quality tools like linters, and we definitely also dont want to argue about tabs vs spaces or spend time formatting our code: Prettier can help with that.
Taking the time to set up a starter kit or template would work. But it is time-consuming, requires a lot of knowledge, and especially needs maintenance to update the tools over time. That rarely works out well in the long run, unless this is your job.
## Nx — from a birds eye view
What you usually want is a CLI, a command-line interface that helps you develop and deal with the underlying build infrastructure, something that sets you up with modern up-to-date tooling and also keeps those updated!
Nx comes with such a CLI, it is widely adopted by the Angular, React and Node community currently being downloaded more than 1.3 million times a week. Nx is [fully open source](https://github.com/nrwl/nx) (MIT licensed), baked by [Nrwl](/company) and the [community](https://go.nx.dev/community).
From a birds eye view, Nx comes with
- Code generators to generate new projects, configuration but also components, Redux setup, routes…
- Out of the box support for modern tools such as TypeScript, Webpack, Babel, SWC, Jest, Cypress, ESLint, Prettier, Storybook and more
- It keeps tooling up to date via dedicated migration commands
- Speed! Nx uses local computation caching that can be extended with Nx Cloud (which is basically free) to remote caching and DTE (Distributed Task Execution).
But lets have a deeper look at how Nx works exactly.
## Using Nx
Let me give you an overview of the most used functionality that Nx gives you such that you get a good understanding of whether it might suit your needs.
## Creating a new Nx React project
Open your favorite terminal window and type:
```shell
npx create-nx-workspace@latest myorg
```
> _Note, Im using_ `_npx_` _to not have to install the Nx CLI globally. If you want to, you totally can:_ `_npm i nx -g_`
`myorg` is the scope of your Nx workspace. Think of it as your NPM scope in case youd publish an npm package. In the case you create libraries in this new Nx workspace (more about that later), it would be used to import those, like
```typescript
import { someFunc } from '@myorg/somelib';
```
What youll get is a setup wizard that guides you through creating your application. We would most likely choose “React” in this case.
![](/blog/images/2022-03-29/zLwqiNgVNDrLJMir1BV5TA.avif)
_Nx CLI guides through the setup process_
As part of this process, youll be asked to pick an “Application name”. This is simply the application Nx is going to generate for us to get started: `happynrwl` would be a nice name 🙂.
You should end up with a new Nx workspace and our `happynrwl` React app in the `apps/` folder.
![](/blog/images/2022-03-29/3OToVs1mu94M0Bt4WHvYMg.avif)
_Layout of a Nx workspace in VSCode_
## Serving our React app
To serve our React app, run
```shell
npx nx serve happynrwl
```
> _Note I prefix the commands with_ `_npx_`_, which is just a way to use the local_ `_nx_` _binary from the_ `_node_modules_` _folder of our workspace. Also, this way we dont have to install Nx globally. If you prefer doing that, run_ `_npm install -g nx_`_._
Going to [http://localhost:4200](http://localhost:4200/) should show the running React app located in `apps/happynrwl`.
![](/blog/images/2022-03-29/TCZXh6HHJ7t9mEl3WzACrg.avif)
_Welcome screen when launching the React application with Nx_
## Build our React app
Similarly, to build our React application, run
```shell
npx nx build happynrwl
```
This should build the app into `dist/apps/happynrwl`, which we can then take and deploy to wherever we want to deploy it.
![](/blog/images/2022-03-29/JvmIPkyEijF7akQwgr201w.avif)
_Output folder assets when building the React app_
Nx has another nice feature that basically comes for free: [computation caching](/concepts/how-caching-works). For every command Nx runs, it computes a unique hash that contains information about the involved source code, environment variables and the command itself. Next time the same conditions are met, the command is not executed again, but rather pulled out of a cache. As you can imagine, this drammatically speeds up things.
If youre curious and want to learn more, check out the docs page on [computation caching](/concepts/how-caching-works) and how to leverage [Nx Cloud](/nx-cloud) to store the cache remotely for sharing it with your team members. Also, Nx Cloud pricing recently changed, which makes it basically free for everyone.
## Code Generators!
One of the core parts of Nx is code generators. As the name already suggests, code generators generate source code and configuration. That can range from a single React component file to an entire project with all that is needed. You basically already saw them in action when you created the initial project setup. But theres more to explore! Every Nx plugin (e.g. `@nrwl/react`, `@nrwl/next`,...) come with their own set of generators. All of them are invoked with the `npx nx generate` or short `npx nx g` command.
Lets for instance generate a new component for our React application:
```shell
npx nx generate @nrwl/react:component HelloWorld
```
This generates a new component in our `happynrwl` application
![](/blog/images/2022-03-29/LSrJe2d93wPWzKwZ-gGzXw.avif)
_Example of a React component generated by Nx_
> _Note, you can also use_ `_nx g @nrwl/react..._` _as a shorthand for_ `_generate_`_. Also, if you attach_ `_--dry-run_` _to the end of the command it will just simulate the run without touching the file system._
Many of these generators come with a rich set of flags. For example, passing `--routing` to our component generator from before, generates a component with routes already set up, adds `react-router-dom` to the `package.json` and executes a `npm install`.
**How do we find all these generators though?** There are different options:
- **Nx documentation** — use the search function there or just navigate the docs. All the reference pages are structured like `nx.dev/packages/<packagename>`. As an example for React that would look like: [/nx-api/react](/nx-api/react).
- `npx nx list` - lists a set of installed plugins as well as other available plugins that can be installed. To get a list of generators for a specific plugin - say for the `@nrwl/react` plugin - run `npx nx list @nrwl/react`. Similarly, you can then run `npx nx g @nrwl/react:lib --help` to get help for a particular generator
However, the absolute easiest way to explore the potential and even use Nx if you are not the “terminal type of person” is [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)! Ill go a bit deeper into that in a later section.
## State of the Art Tooling Preconfigured
When setting up a new React project (that also holds for Angular, Node, Next.js,…), you do not only get the React project, but also a set of tools preconfigured that help you stay productive and produce higher quality code. These are
- TypeScript
- ESLint
- Jest
- Cypress
- Prettier
The Nx core team closely collaborates with these open source projects to not only make sure they integrate seamlessly with the React setup but also to keep them updated over time as those tools evolve. In fact, by using [automated code migrations](https://egghead.io/lessons/javascript-update-your-nx-workspace-with-nx-migrations) updating your Nx workspace will automatically also update those tools and the corresponding config files for you.
Lets have a closer look.
## TypeScript as a first-class citizen!
The Nx core team strongly believes in the benefits of TypeScript (in fact, check out the [new Nx and TypeScript setup](/getting-started/intro)). As such, by default every project is automatically set up and configured to use TypeScript, making sure builds, as well as IDEs, are able to properly pick up TypeScript definitions. All without you having to worry about it.
Now, if you really want to use pure JavaScript you totally can. Just pass the `--js` when running a generator. Read [more on the docs](/recipes/tips-n-tricks/js-and-ts).
## ESLint preconfigured!
Every new Nx workspace comes with [ESLint](https://eslint.org/) already preconfigured. Having proper linting in place is a great way to help contribute to overall better code quality by statically analyzing your source code and finding potential issues early in the process.
Every project generated by Nx comes with a `.eslintrc.json` file. That configuration extends from an ESLint plugin `@nrwl/nx/react` , containing a set of best practices rules, and at the same time allows you to add further rules that are specific to your needs.
![](/blog/images/2022-03-29/dK6mtSHmsgiMDWF1XotMEA.avif)
_ESLint configuration in an Nx workspace_
Linting can be run similarly to the other commands:
```shell
npx nx lint happynrwl
```
## Jest preconfigured!
Similar to the linting setup, every project in an Nx workspace has a test runner preconfigured already. By default, Nx comes with [Jest](https://jestjs.io/).
At the root of every project, theres a `jest.config.js` which already comes with proper transformers to support TypeScript and TSX/JSX. If you need to further customize how Jest should behave for this project, this is the place to do that.
![](/blog/images/2022-03-29/JyIIbncCwSqDMg3gWzUPBw.avif)
_Jest configuration in an Nx workspace_
Running Jest tests is as easy as
```shell
npx nx test happynrwl
```
Obviously, you can pass parameters to customize the Jest run, like
- `--watch` for interactive mode
- `--t` to execute tests that match a given pattern
- `--testFile="apps/happynrwl/src/app/hello-world/hello-world.spec.tsx”` to run a specific file
-
If you happen to use [VSCode](https://code.visualstudio.com/), the easiest way however is to install [Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) and leverage its code lens feature to run and debug Jest tests:
![](/blog/images/2022-03-29/11HC8HeQER_YIbyd9RpdNA.avif)
_Using VSCode extensions to run Jest tests directly via Code Lens support_
## Cypress preconfigured!
[Cypress](https://www.cypress.io/) has revolutionized e2e testing by making it more developer-friendly. Who likes to write tests after all. That just gets even worse if the DX sucks. Cypress successfully tackled that by listening and addressing the pain of existing e2e testing solutions.
Whenever you generate a new project in an Nx workspace, you have the option to automatically also create a Cypress-based e2e project alongside it. In our case, it is called `happynrwl-e2e`.
![](/blog/images/2022-03-29/OA1d-lV54ylpNFd9ayJ07Q.avif)
_Cypress e2e app generated by Nx along-side the main React app_
The awesome part of this is that you dont have to configure anything at all. No need to
- make sure TypeScript runs smoothly with Cypress
- set up linting for our e2e project (yes writing good quality test code is just as important)
- spinning up our development server manually first that serves our React app such that we are able to load it in our Cypress tests environment
Just execute
```shell
npx e2e happynrwl-e2e
```
You can also pass `--watch` to run it interactively with the Cypress test runner such that the tests get re-executed whenever we change our source.
## Dont argue over code formatting — use Prettier!
Are you a `tabs` or `spaces` person? Use semicolons or not? What about trailing commas? We all know that we devs can have some strong opinions on this 😅. But honestly, there are probably more important things to focus on. Luckily [Prettier](https://prettier.io/) can help a ton with these issues. It is opinionated with just very few configuration options and just takes away the burden of formatting the code.
When you set up a new Nx workspace, it has Prettier already preconfigured. The best way is to integrate it with your code editor such that formatting is run on every save of a file. Alternatively, you can also run
```shell
npx nx format
```
## Nx Console — A dedicated VSCode extension for Nx
![](/blog/images/2022-03-29/1gRcDUmEkjOn6DR8vO9MHA.avif)
Nx really is an advanced CLI based development tool. But regardless of whether you are a command line person or not, if you happen to use [VSCode](https://code.visualstudio.com/) make sure you install the [Nx Console extension](/getting-started/editor-setup) from the [marketplace](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console).
> _For_ [_Webstorm_](https://www.jetbrains.com/webstorm/) _there are two community extensions that can be used:_ [_nx-webstorm_](https://plugins.jetbrains.com/plugin/15000-nx-webstorm) _and_ [_Nx Console Idea_](https://plugins.jetbrains.com/plugin/15101-nx-console-idea)_._
Once you have the extension installed, you can click its icon in the VSCode Activity Bar (1) which reveals the Nx Console UI.
![](/blog/images/2022-03-29/GPrI7Pta18FuEljgm9h4pQ.avif)
_Nx Console VSCode extension_
A couple of things:
- (2) is the panel where you see a fixed command “Generate” to invoke the Nx generator for creating new projects, libraries etc as we mentioned before. In addition you see a list of available commands to run.
- (3) shows additional commands that are commonly used in an Nx workspace. Feel free to click and explore them.
- (4) shows a list of projects in your workspace. We really just have our React app and Cypress e2e application, but potentially you could add more. See [Nx applications and libraries](/concepts/decisions/project-size) for more.
Lets take the example of generating a new React component, just as we did before, but this time using Nx Console. This is how youd do that:
![](/blog/images/2022-03-29/wJ4ZldDh_Glvxwl_0SDxHA.avif)
_Actions to generate a new React component with Nx Console_
Once you click the entry in the dropdown list, the Nx Console generate form opens, showing all the options the Nx generator supports:
![](/blog/images/2022-03-29/0F8baQFGgATjnQn30CqVeg.avif)
_Detail form shown by Nx Console to generate a new React component_
Whenever you change something in the form (1), youll automatically see a dry-run in the console that opens below (2). That shows what would happen if you run the command and is equivalent of adding the `--dry-run` flag whenever youd run the command on the terminal. Once youre ready, hit the “Run” button (3), or click the copy symbol (4) to copy the full command into your clipboard s.t. you can then paste it into your terminal.
As you can see this approach is also really powerful for exploring different commands and their corresponding options.
Besides running generators, Nx Console also adds [VSCode Code Lens](https://code.visualstudio.com/blogs/2017/02/12/code-lens-roundup) abilities to the configuration files that help you navigate more quickly across the workspace. This is particularly useful if you happen to add more [apps and libraries](/concepts/decisions/project-size) to the workspace at some point.
![](/blog/images/2022-03-29/WIbxp7um-f4CK2-N-zRing.avif)
_Nx Console Code Lens support to navigate easily among config files_
## Evergreen Workspace Setup
One of the advantages of using Nx over — say CRA or a custom starter template — is that your **Nx workspace is evergreen**. What do I mean by that: by now we all know how fast the frontend space is moving, and so are the corresponding devtools. Today you might be using [Rollup](https://rollupjs.org/) to build your libraries, tomorrow you use [swc](https://swc.rs/), [vite](https://vitejs.dev/) or [esbuild](https://esbuild.github.io/). Same with [Webpack](https://webpack.js.org/). Webpack 5 has been around for a while already, and still, a lot of projects are stuck at v4.
Just to mention an example: when upgrading Nx to v13, all Nx users automatically got migrated to Webpack 5.
This is possible with Nxs [migrate command](/nx-api/nx/documents/migrate) that allows you to keep up to date with your framework in a mostly automated fashion. Whenever you upgrade Nx, you run
```shell
npx nx migrate latest
```
Running this command, Nx
- analyzes the current packages
- fetches the latest Nx packages and plugins (or whatever version was specified in the migration command)
- creates a `migrations.json` file containing all migration scripts that need to be executed
- updates the `package.json` to the new package versions
The `migrations.json` file can be inspected and potentially modified. Once it is ready, running the following command executes the migration:
```shell
npx nx migrate --run-migrations=migrations.json
```
These migrations not only update the `package.json` version. They also update corresponding configuration files and even source code by leveraging ASTs to query and manipulate files.
It is not even only about upgrading the frameworks such as React or Angular themselves, though. A common pain point is their integration with other tools, such as Jest, Storybook, ESLint etc. The Nx core team closely collaborates with these communities to make sure that a particular combination of versions works and is tested before migrating your workspace.
{% youtube src="https://www.youtube.com/watch?v=Ss6MfcXi0jE" /%}
## Common Questions
Here are some common questions developers have. Have some more? Feel free to ping me on Twitter ([@juristr](https://twitter.com/juristr)), the official Nx account ([@NxDevtools](https://twitter.com/nxdevtools)) or in the [Nx community Discord](https://go.nx.dev/community).
## Q: How can I customize how my project is built and served?
Every Nx project comes with a `project.json` which contains the basic setup of targets (example: `build`, `serve`, `test`, `lint`,..) that can be run against the project.
Heres the `project.json` for our `happynrwl` React application. I clipped out the non-relevant parts here:
```json5
{
...
"targets": {
"build": {
"executor": "@nrwl/web:webpack",
...
"options": {
"compiler": "babel",
"outputPath": "dist/apps/happynrwl",
"index": "apps/happynrwl/src/index.html",
"baseHref": "/",
"main": "apps/happynrwl/src/main.tsx",
"polyfills": "apps/happynrwl/src/polyfills.ts",
"tsConfig": "apps/happynrwl/tsconfig.app.json",
"assets": [
"apps/happynrwl/src/favicon.ico",
"apps/happynrwl/src/assets"
],
"styles": ["apps/happynrwl/src/styles.css"],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
},
"configurations": {
"production": {
...
}
}
},
"serve": {
...
},
...
},
"tags": []
}
```
As you can see, all these “targets” (`build`, `serve`,...) have a so-called `options` property that allows you to configure how the target behaves. The actual configuration is abstracted behind the “[Nx Executor](/concepts/executors-and-configurations)”, in our case `@nrwl/web:webpack`. You can find the details of how to configure that on the Nx docs in the CLI reference for the `@nrwl/web` package: [/nx-api/webpack/executors/webpack](/nx-api/webpack/executors/webpack).
To read more about how the `project.json`, its executors, and configuration options are structured, check out the official docs: [/reference/project-configuration](/reference/project-configuration).
> _Note, Nx is also able to just pick up NPM scripts registered in the_ `_package.json_` _of your project root. This scenario is most useful if youre adding Nx to an existing monorepo (see_ [_add-nx-to-monorepo_](https://www.npmjs.com/package/add-nx-to-monorepo)_). Read more here:_ [_/reference/project-configuration_](/reference/project-configuration)
Nxs extensibility and customizability have really no limits, allowing it to really adapt to your needs. Here are some resources to learn more if you need some advanced features.
- [Custom workspace executors](/extending-nx/recipes/local-executors)
- [Custom workspace generators](/extending-nx/recipes/local-generators)
- [Create Nx plugins](/nx-api/plugin)
- Control the entire workspace setup with [custom presets](/nx-api/plugin)
## Q: Can I customize my Webpack config used to build my React app?
As mentioned previously, the underlying build machinery is usually hidden by a so-called [Nx Executor](/concepts/executors-and-configurations). As we have seen you can customize its behavior via the corresponding `options` property. By abstracting the underlying build tool, Nx is able to fulfill its evergreen promise as mentioned previously and allows to seamlessly upgrade workspaces to the latest versions of the build tooling that is being used.
If the available `options` are not enough, you can further customize the Webpack configuration using the `webpackConfig` property:
```json5
{
...
"targets": {
"build": {
"executor": "@nrwl/web:webpack",
...
"options": {
...
"webpackConfig": "@nrwl/react/plugins/webpack"
},
...
},
...
},
"tags": []
}
```
By default it links to `@nrwl/react/plugins/webpack`, but you can point to your own custom file in the Nx workspace. The file needs to look like the following:
```javascript {% fileName="apps/my-app/webpack.config.js" %}
const fromNrwlReact = require('@nrwl/react/plugins/webpack');
function getWebpackConfig(config) {
// invoke the Nrwl specific config to preserve the original
// behavior
config = fromNrwlReact(config); // add your own customizations HERE return config;
}
module.exports = getWebpackConfig;
```
Notice how the default Nrwl provided Webpack configuration is invoked first to not lose the default behavior, followed by your own customizations.
## Q: Why is there an “apps” folder? Can I change it?
Sure! Nx allows to host multiple applications and libraries in a single workspace: a monorepo scenario basically. In fact, even in our simple setup we have two applications: `happynrwl` and the corresponding e2e application, `happynrwl-e2e`.
In a default setup Nx generates an `apps` folder for hosting applications, and `libs` folder for hosting libraries. Read more about [“Apps and Libs” on the Nx docs](/concepts/decisions/project-size).
You can change this setup in `nx.json` by adjustijng the `workspaceLayout` property which has an `appsDir` and `libsDir` configuration.
```json5
{
...
"workspaceLayout": {
"appsDir": "apps",
"libsDir": "libs"
},
...
}
```
## Q: Is there a way to migrate from CRA?
Absolutely. Check out this guide on the Nx docs that has all the details (including a video walkthrough): [/recipes/adopting-nx/adding-to-existing-project](/recipes/adopting-nx/adding-to-existing-project)
## Q: This looks like a lot 🤯. Do I really need it from the get go?
Agreed. Luckily Nx is plugin based, so you can start with the bare minimum (see using [Nx without plugins](/getting-started/intro)) and then slowly add them as you need them. Similarly you can add Nx to an existing workspace (say a Yarn workspace) by using the [add-nx-to-monorepo](https://www.npmjs.com/package/add-nx-to-monorepo) package.
From my own experience, what usually happens is that teams start light and then over time end up with a similar stack, but hand-woven and therefore loosing out on a lot of the benefits Nx comes with.
## Q: Isnt Nx just for monorepos?
Nx has been designed to support monorepo scenarios, and it really shines at scale. However, a lot of the features Ive been mentioning in this article, such as generators, out of the box setup of best practices development tools, automated migrations and more make it an excellent choice, even if your intention is not to create a monorepo.
From my experience, Ive often seen teams start with a single application, which then over time gets company by other apps, in the form of React applications, also Node based backends or even a React Native application. Mainly because adding new applications is easy and the possibility to [share functionality (even across platforms)](/blog/share-code-between-react-web-react-native-mobile-with-nx) is appealing.
> _If youre interested in monorepos or want to learn more about it, check out_ [_https://monorepo.tools_](https://monorepo.tools/)_._
## Q: Isnt Nx just for Angular projects?
This is a common but understandable misconception. Although Nx was heavily inspired by the Angular CLI initially, it is now a completely independent build system and CLI with first-class support for Angular, React, Node, Next.js, TypeScript and more. And with tons of [community plugins](/community) that extend Nx beyond that.
## Conclusion
Congrats, you made it to the end of this article. By now you should have gotten a pretty good overview of what Nx is about, its strengths and how it can be useful in your next React project. If you still got questions or are hesitant to adopt Nx, [reach out to me on Twitter](https://twitter.com/juristr)!
Where to go from here?
- [Nx Official Discord Server](https://go.nx.dev/community)
- [follow me on Twitter](https://twitter.com/juristr)
- [follow Nx on Twitter](https://twitter.com/nxdevtools)
- subscribe on the [Nx Youtube channel](https://youtube.com/c/Nrwl_io)
- join more than 200+ developers and [take the free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038) on how to scale React development with Nx.
@@ -0,0 +1,270 @@
---
title: 'What is new in Nx 13.10?'
slug: 'what-is-new-in-nx-13-10'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-04-08/PJ3SRAadq0DxGiC9mCIWsA.png'
tags: [nx, release]
---
It has been a while since our last release blog post [which was on Nx 13.5](/blog/new-terminal-output-performance-improvements-in-nx-13-5). A lot has happened since then. So here we go!
## Housekeeping and “core” cleanup
We keep optimizing the Nx core. This round we started doing some housekeeping and cleanup that will allow us to move more quickly in the future and add new features more easily. In particular we now have a single package `nx` that contains all the core and CLI related functionality that have previously been in `@nrwl/cli` and `@nrwl/tao`. This also results in a reduce number of packages you need to install in any Nx workspace. In fact, if you run `add-nx-to-monorepo` - our easy migration command for [adding Nx to Yarn/NPM workspaces](/recipes/adopting-nx/adding-to-monorepo) - you should now see a single `nx` package and not have any `@nrwl/*` packages at all.
## Nx Daemon on by default
One of the core features of Nx is the calculation of the project graph. It is the basis for most other features in Nx like the [affected commands](/ci/features/affected), computation caching and calculation and topological sorting of parallelizing tasks [during DTE](/ci/features/distribute-task-execution). This is a I/O heavy operation. Whenever you change a file, the project graph needs to be re-calculated which involves reading the source files, analyze imports from other packages source files and external libraries.
Such a crucial and central feature like the project graph need to be as fast as possible. Thats the reason why we introduced the Nx Daemon, which is started automatically and runs in the background, watching for file changes and asynchronously recomputes and caches the project graph. As a result, whenever Nx runs an operation that requires the project graph, it is already there and ready to be used, without adding any additional delay to the operation that needs to be executed.
Read more on the docs: [/guides/nx-daemon](/concepts/nx-daemon)
## Nx Cloud opt-in now points to “Yes” by default
When you set up a new Nx workspace with `create-nx-workspace` the question about opting into Nx Cloud will be pointed on “Yes” by default now.
![](/blog/images/2022-04-08/2N8T5oP1MUgmBTF_Q0bF-A.avif)
_Nx Cloud opt-in when setting up a new Nx workspace_
## Build and run Nx Plugins locally in your Nx workspace
Nx can be used in a wide range of scenarios, from small open source projects, startup environments to massive enterprise monorepos. This is thanks to its modular plugin based architecture consisting of
- Nx core which provides the fundamental features such as the dependency graph calculation, computation caching and task execution
- `@nrwl/*` plugins which are those actively maintained by the Nx core team
- [Community plugins](/community)
This illustration should give you a rough idea. obviously some of the plugins may be built on top of others, leveraging common functionality. An example is the [@nrwl/js](/nx-api/js) plugin which not only can be used as a standalone plugin but also builds the basis for of many others by providing core JavaScript/TypeScript features.
![](/blog/images/2022-04-08/iMPg692nMj5ty709M7tTQQ.avif)
You can just use the [Nx core without any plugins](/getting-started/intro) to get started and later decide to add more plugins such as `@nrwl/react` or `@nrwl/js` etc depending on your specific use case.
As you can see, plugins are at the very core and for quite some time now weve had a [fully featured Devkit and Nx Plugin package](/extending-nx/intro/getting-started) to create your own. And the community followed: have a look at [all the community Nx plugins that are available out there](/community).
And we keep improving. Starting with Nx 13.10 you can now use Nx plugins to automate your local workspace. Install `@nrwl/nx-plugin` into your Nx workspace and generate a new plugin:
```shell
npx nx generate @nrwl/nx-plugin:plugin --name=workspace-extensions
```
This creates a new library with a pre-configured setup to develop a Nx plugin. Similarly to other libraries you can now use those in your local Nx target configurations.
```json5
{
root: 'apps/demo',
sourceRoot: 'apps/demo/src',
projectType: 'application',
targets: {
mybuild: {
executor: '@myorg/workspace-extensions:build',
outputs: ['{options.outputPath}'],
options: {
outputPath: 'dist/apps/someoutput',
},
},
},
}
```
Note the `executor` definition of the `mybuild` target. It was never easier to create custom workspace executors.
And it doesnt stop at the executors level. The local plugin setup comes with a generator setup too, which can be invoked just like
```shell
npx nx g @myorg/workspace-extensions:<generator-name>
```
where `@myorg` is your Nx workspace name you defined and `workspace-extensions` the plugin library name weve chosen. You are free to choose whatever suits you best. This new setup opens up a wide range of new possibilities including defining default workspace generators.
[Subscribe to our Youtube Channel](https://youtube.com/nrwl_io) for some upcoming tutorials and walkthroughs around this topic.
## Project Graph Visualization
We keep improving our project graph and make it more and more useful for visually exploring your Nx workspace. You can now click on an edge and list the files that cause it which can be extremely valuable during debugging.
![](/blog/images/2022-04-08/a2bXoE4fGcDmqPTrxDyEFg.avif)
_Improved Project Graph visualization showing information about the edges that connect nodes_
And this is just a sneak peak of whats coming in Nx v14, so stay tuned!
## New “notDependOnLibsWithTags” Linter option
Having a decent monorepo setup is not always just about speed but also to have features in place that help you keep your code-base healthy and maintainable in the long run. The Nx module boundary lint rules are an example for that.
![](/blog/images/2022-04-08/ceWCqFUBimFNl8VOONDFsQ.avif)
_Tagging Nx projects_
By assigning tags to your projects you can then configure which relationships among libraries and applications are allowed, and which are forbidden.
```json5
{
// ... more ESLint config here "@nrwl/nx/enforce-module-boundaries": [
"error",
{
// update depConstraints based on your tags
"depConstraints": [
{
"sourceTag": "type:app",
"onlyDependOnLibsWithTags": ["type:feature", "type:util"]
},
{
"sourceTag": "type:feature",
"onlyDependOnLibsWithTags": ["type:feature", "type:util"]
},
{
"sourceTag": "type:util",
"onlyDependOnLibsWithTags": ["type:util"]
}
]
}
] // ... more ESLint config here
}
```
Read more about it in this article: [blog/mastering-the-project-boundaries-in-nx)
So far you have only been able to specify which tags a library is allowed to depend on using the `onlyDepndOnLibsWithTags` property. This made it cumbersome to define in some situations. Now you have a brand new property `notDependOnLibsWithTags`
```json5
{
// ... more ESLint config here "@nrwl/nx/enforce-module-boundaries": [
"error",
{
// update depConstraints based on your tags
"depConstraints": [
{
"sourceTag": "type:util",
"notDependOnLibsWithTags": ["type:feature"]
}
]
}
] // ... more ESLint config here
}
```
More on Miroslavs tweet:
{% tweet url="https://x.com/meeroslav/status/1505844090713292808" /%}
## Automatic Lint rule fixes for self circular dependencies and wrong imports across library boundaries
Whether by accident or by letting your IDE auto-add the import. It often happens that the path that is being used is via the librarys TS path mapping through the `index.ts` entry point. This leads to a circular dependency when also `tslib-c-another.ts` is exported via the `index.ts`. Nxs module boundary lint rule correctly highlights this as can be seen in this screenshot.
![](/blog/images/2022-04-08/Nh5uHJxDvqxppHF5kJJjZw.avif)
_Self circular dependency issue within a Nx based library_
Adjusting these circular self references is easy, but can be cumbersome to find the correct imports and time consuming if you have hundreds of libs that might be affected by this. In the latest version of Nx we shipped a fix implementation for these lint rules, such that you can now conveniently add `--fix` to auto-adjust the imports:
```shell
npx nx lint tslib-c --fix
```
This will analyze your imports, find the correct file and adjust them accordingly:
![](/blog/images/2022-04-08/y81cryDv1j2uug38EgQsNg.avif)
_Automatic adjustment of circular self references when running the lint rule fix_
Similarly if you have relative or absolute imports across library boundaries rather than using the NPM scope, youll get a linting error.
![](/blog/images/2022-04-08/S69zum8bULwD_EXOT3xT6g.avif)
_Lint error about relative import across library boundaries_
Such imports will also be adjusted by applying the `--fix` to your linting command:
![](/blog/images/2022-04-08/tKX2DSDSKhR8UEN04_ckQg.avif)
_Automatic fixes for cross-library imports_
## React 18 support
Nx 13.10 introduces support for the latest React v18 release such that users can benefit from the latest features React has to offer. Check out our latest blog post on [“The React CLI you always wanted but didnt know about”](/blog/the-react-cli-you-always-wanted-but-didnt-know-about) to learn more how to use Nx for React development.
## React Native gets Storybook support
Weve drastically improved our support for React Native within Nx workspaces. Check out our latest blog posts on
- [Share code between React Web & React Native Mobile with Nx](/blog/share-code-between-react-web-react-native-mobile-with-nx)
- [Introducing Expo Support for Nx](/blog/introducing-expo-support-for-nx)
We are happy to announce that in addition to the before mentioned improvements, the React Native integration in Nx now also supports Storybook. Just use
```shell
npx nx generate @nrwl/react-native:storybook-configuration
```
or use Nx Console to get some more help in generating the Storybook setup.
## Ability to show all prompts when creating a new Nx workspace
By default when you create a new Nx workspace with `create-nx-workspace` you will see a couple of questions that help you find the correct setup for your needs. However, we just show a couple of the possible options, to not overwhelm you.
If however youre curious, you can now append `--allPrompts` to get all possible questions asked 🙂
```shell
npx create-nx-workspace@next myorg --allPrompts
```
Alternatively you can browse the [API docs on the Nx website](/nx-api/nx/documents/create-nx-workspace) to find out more.
## Deliver the best possible TypeScript experience with `@nrwl/js`
You might have noticed our new `@nrwl/js` package we released a couple of months ago.
[We have big plans with this one](https://github.com/nrwl/nx/discussions/9716), not only making it the foundation for many of our other packages that need TypeScript compilation and support, but also the goto package for the best possible TypeScript experience.
## Nx Console Improvements
Here are some of the highlights in the latest Nx Console release.
## Nx Targets of VSCode Command Menu
You can now open the VSCode Command menu (Cmd + Shift + P or Win + Shift + P) and enter “Nx: Run Target” to invoke the Run Target menu which allows to choose the target to run as well as the project to execute the target on.
![](/blog/images/2022-04-08/PuzwriM96qHohP28-_q3jA.avif)
_Commands can be invoked from the VSCode Command menu_
## Run Target View now in sync with workspace commands
While initially the “Generate and Run Target” panel was a static list of the usual Nx targets, it is now a dynamically generated list based on your actual workspace commands. Hence, also your custom defined targets will automatically show up.
![](/blog/images/2022-04-08/qILNK9-yQOtbgwE9uFMMiw.avif)
_Nx Console dynamically reads Nx targets from your Nx workspace now_
## Prompts for Angular CLI users
Nx Console has out of the box support to also be used on plain Angular CLI projects. With the latest version of Nx Console, Angular CLI users will receive a prompt about decorating their CLI setup with Nx to benefit from the improved performance brought by computation caching and Nx Cloud.
Learn more in this short video walkthrough:
{% youtube src="https://www.youtube.com/watch?v=vRj9SNVYKrE" /%}
## Our docs keep getting more and more awesome
Besides delivering awesome features, we keep improving our docs. They are essential to help discover new features and better understand existing ones. In the last weeks weve improved the navigation support, allowing you to navigate to a specific package with `/packages/<package-name>` such as [/nx-api/react](/nx-api/react) listing executors and generators that come with that Nx package, also improving the API docs of the individual executor options including a live embedded editor playground to experiment with different configuration setup.
Check out Benjamin Cabanes tweet with some short videos:
{% tweet url="https://x.com/bencabanes/status/1509641445086535687" /%}
## How to Update Nx
Updating Nx is done with the following command, and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Exciting?
Then wait for Nx v14 to land 😉.
- Check out the [release changelog](https://github.com/nrwl/nx/releases/tag/13.10.0)
- Follow us [on Twitter](https://twitter.com/NxDevTools), and
- subscribe to the [YouTube Channel](https://youtube.com/nrwl_io?sub_confirmation=1) for more information on [Angular](https://angular.io/), [React](https://reactjs.org/), Nx, and more!
@@ -0,0 +1,309 @@
---
title: 'Use Storybook with Nx React Native'
slug: 'use-storybook-with-nx-react-native'
authors: ['Emily Xiong']
cover_image: '/blog/images/2022-04-25/64nWVfUBihlYTLGWOvnc1g.png'
tags: [nx, release]
---
In my previous [blogs](/blog/share-code-between-react-web-react-native-mobile-with-nx) _(see links at the end)_, I wrote about how to develop Nx React Native applications. However, as developers, we are constantly searching for ways to make the developer experience better.
This blog will show how to add Storybook to Nx React Native applications. With Nx, you dont need to go through [this long guideline](https://storybook.js.org/tutorials/intro-to-storybook/react-native/en/get-started/) to set up the Storybook, you can quickly get it running.
Example Repo: [xiongemi/studio-ghibli-search-engine](https://github.com/xiongemi/studio-ghibli-search-engine)
Storybook:
![](/blog/images/2022-04-25/bDKKjnrt2D6XIBDnWN1z2Q.avif)
_Storybook View (left: Android, right: iOS)_
## Setup
First, you need to add `@nrwl/storybook` to your existing Nx React Native workspace:
```shell
# npm
npm install @nrwl/storybook --save-dev
# yarn
yarn add --dev @nrwl/storybook
```
Then you need to generate the storybook configuration for your app or lib:
```shell
nx g @nrwl/react-native:storybook-configuration **<your app or lib>**
```
As shown in the example below, 3 folders got generated:
- `.storybook` at workspace root
- `.storybook` in your app or lib
- `storybook` in your app (Note: this folder is for creating the Storybook UI component. It will only be created for the app, you will not see this for lib.)
![](/blog/images/2022-04-25/q1sX4VQKdRzQpye6Qcs2Ow.avif)
If you choose to automatically generate `*.stories` file, you should see the default story looks like below:
```tsx {% fileName="loading.stories.tsx" %}
import { storiesOf } from '@storybook/react-native';
import React from 'react';
import { Loading } from './loading';
const props = {};
storiesOf('Loading', module).add('Primary', () => <Loading {...props} />);
```
To gather the stories you created, run the command:
```shell
nx storybook **<your app or lib>**
```
You should see in the terminal saying:
```shell
Writing to <your workspace>/.storybook/story-loader.js
```
In your `<your workspace>/.storybook/story-loader.js`, it should list your stories created under your app or lib similar to the below example:
```javascript {% fileName="story-loader.js" %}
// Auto-generated file created by react-native-storybook-loader
// Do not edit.
//
// https://github.com/elderfo/react-native-storybook-loader.git
function loadStories() {
require('../apps/studio-ghibli-search-engine-mobile/src/app/App.stories');
require('../apps/studio-ghibli-search-engine-mobile/src/app/film/film.stories');
require('../apps/studio-ghibli-search-engine-mobile/src/app/results/film-list-item/film-list-item.stories');
require('../apps/studio-ghibli-search-engine-mobile/src/app/results/people-list-item/people-list-item.stories');
require('../apps/studio-ghibli-search-engine-mobile/src/app/results/result-list-item/result-list-item.stories');
require('../apps/studio-ghibli-search-engine-mobile/src/app/search/search.stories');
require('../apps/studio-ghibli-search-engine-mobile/src/app/shared/film-card/film-card.stories');
require('../apps/studio-ghibli-search-engine-mobile/src/app/shared/loading/loading.stories');
}
const stories = [
'../apps/studio-ghibli-search-engine-mobile/src/app/App.stories',
'../apps/studio-ghibli-search-engine-mobile/src/app/film/film.stories',
'../apps/studio-ghibli-search-engine-mobile/src/app/results/film-list-item/film-list-item.stories',
'../apps/studio-ghibli-search-engine-mobile/src/app/results/people-list-item/people-list-item.stories',
'../apps/studio-ghibli-search-engine-mobile/src/app/results/result-list-item/result-list-item.stories',
'../apps/studio-ghibli-search-engine-mobile/src/app/search/search.stories',
'../apps/studio-ghibli-search-engine-mobile/src/app/shared/film-card/film-card.stories',
'../apps/studio-ghibli-search-engine-mobile/src/app/shared/loading/loading.stories',
];
module.exports = {
loadStories,
stories,
};
```
Also, notice that in your apps main file, the import of the App changed to `storybook/toggle-storybook`:
```typescript
import App from './storybook/toggle-storybook';
```
### View Storybook for App
To view the storybook on the simulator/emulator/device, start the app like you usually do:
```shell
# iOS
nx run-ios <your app>
# Android
nx run-android <your app>
```
In your simulator/emulator/device, open the Debug Menu by entering `d` in terminal. You should see the menu option Toggle Storybook in the Debug Menu:
![](/blog/images/2022-04-25/aziO6KSwVhtXWwfyADGbAA.avif)
_Screenshot of Debug menu (left: Android, right: iOS)_
When switching on the toggle, you should see the list of your component stories:
![](/blog/images/2022-04-25/KYn3sPUpBU_ewRh2zJ7niQ.avif)
_Storybook View (left: Android, right: iOS)_
### View Storybook for Lib
Note: the storybook can only be viewed inside an app. To view the storybook for lib in the workspace, you need to first set up the storybook for an app in the workspace.
Then run the command:
```shell
nx storybook **<your lib>**
```
This should update the `.storybook/story-loader.js` with stories in your lib.
Then just run the command to start your app, you should see the storybook for your lib.
## Troubleshooting
### Error: Couldnt find a navigation object
If you are using the library `@react-navigation/native` and you are using hooks like `useNavigtion` and `useRoute` inside your component, you are likely to get the below error:
![](/blog/images/2022-04-25/oKNqqay19gpvIRgW1QGbkA.avif)
_Render Error for Couldnt find a navigation object_
The easiest way is just to mock this library and create a [decorator](https://storybook.js.org/docs/react/writing-stories/decorators) for it:
```typescript {% fileName="src/storybook/mocks/navigation.tsx" %}
import { NavigationContainer } from '@react-navigation/native';
import React from 'react';
export const NavigationDecorator = (story) => {
return (
<NavigationContainer independent={true}>{story()}</NavigationContainer>
);
};
```
_Mock Navigation Decorator_
Then in your story, you just need to add the above `NavigationDecorator`:
```tsx
import { storiesOf } from '@storybook/react-native';
import { mockFilmEntity } from '@studio-ghibli-search-engine/models';
import React from 'react';
import { NavigationDecorator } from '../../../storybook/mocks/navigation';
import FilmListItem from './film-list-item';
storiesOf('FilmListItem', module)
.addDecorator(NavigationDecorator)
.add('Primary', () => <FilmListItem film={mockFilmEntity} />);
```
_Add NavigationDecoration to the story_
Now, this error should go away and you should see your component in your storybook.
If your component is using the `useRoute` hook and expecting certain routing parameters, then you need to customize the mock `NavigationDecorator` for your component. For example, below is a component that is expecting an id from the route parameters:
```typescript
const route = useRoute<RouteProp<{ params: { id: string } }>>();
const id = route.params?.id;
```
The mock `NavigationDecorator` will become:
```tsx
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import React from 'react';
const NavigationDecorator = (story) => {
const Stack = createNativeStackNavigator();
return (
<NavigationContainer independent={true}>
<Stack.Navigator>
<Stack.Screen
name="MyStorybookScreen"
component={story}
initialParams={{ id: 123 }}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
```
### Error: Could not find “store”
If you are using Redux store and your component is stateful and connected to the store, you are likely to get the below error:
![](/blog/images/2022-04-25/T-Lj4PjuAlb_TbpSU5_1PQ.avif)
_Render Error for Could not find “store”_
The simple solution is to mock the store. First, you need to install the library [redux-mock-store](https://github.com/reduxjs/redux-mock-store) and its typing:
```shell
# npm
npm install redux-mock-store @types/redux-mock-store --save-dev# yarn
yarn add redux-mock-store @types/redux-mock-store --dev
```
Similarly, like how you mock up the navigation, you need to mock up the store. The below example mocks the store with the initial root state:
```typescript {% fileName="src/storybook/mocks/store.tsx" %}
import {
initialRootState,
RootState,
} from '@studio-ghibli-search-engine/store';
import React from 'react';
import { Provider as StoreProvider } from 'react-redux';
import configureStore from 'redux-mock-store';
export const StoreDecorator = (story) => {
const mockStore = configureStore<RootState>([]);
const store = mockStore(initialRootState);
return <StoreProvider store={store}>{story()}</StoreProvider>;
};
```
You can add this store decorator to your story:
```tsx {% fileName="people-list-item.stories.tsx" %}
import { storiesOf } from '@storybook/react-native';
import { mockPeopleEntity } from '@studio-ghibli-search-engine/models';
import React from 'react';
import { NavigationDecorator, StoreDecorator } from '../../../storybook/mocks';
import PeopleListItem from './people-list-item';
storiesOf('PeopleListItem', module)
.addDecorator(StoreDecorator)
.addDecorator(NavigationDecorator)
.add('Primary', () => <PeopleListItem people={mockPeopleEntity} />);
```
### Error: Actions must be plain objects
If you use an async action (for example, an action created using `createAsyncThunk` from `@reduxjs/toolkit`), you would likely run into the below error: Actions must be plain objects.
![](/blog/images/2022-04-25/sJXG_eFpItyPt7ilyF19fw.avif)
_Render Error for Actions must be plain objects_
Now to resolve this, add thunk to mock store middleware:
```tsx {% fileName="store.tsx" %}
import {
initialRootState,
RootState,
} from '@studio-ghibli-search-engine/store';
import React from 'react';
import { Provider as StoreProvider } from 'react-redux';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
export const StoreDecorator = (story) => {
const mockStore = configureStore<RootState>([thunk]);
const store = mockStore({ ...initialRootState });
return <StoreProvider store={store}>{story()}</StoreProvider>;
};
```
## Conclusion
Here are how to use Storybook with Nx React Native and some common errors you may run into. With Nx React Native, you can quickly view Storybook with a toggle option in Debug Menu. It allows developers to interact and test with components during development.
### Where to go from here?
- [Step by Step Guide on Creating a Monorepo for React Native Apps using Nx](/blog/step-by-step-guide-on-creating-a-monorepo-for-react-native-apps-using-nx)
- [Share code between React Web & React Native Mobile with Nx](/blog/share-code-between-react-web-react-native-mobile-with-nx)
- [join the Nx Official Discord Server](https://go.nx.dev/community)
- [follow Nx on Twitter](https://twitter.com/nxdevtools)
- subscribe to the [Nx Youtube channel](https://youtube.com/c/Nrwl_io)
@@ -0,0 +1,307 @@
---
title: 'Nx v14 is out — Here is all you need to know!'
slug: 'nx-v14-is-out-here-is-all-you-need-to-know'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-05-02/UAN1p_RMt38_IvB3CRpYTA.png'
tags: [nx, release]
---
A lot happened since we released Nx version 13 back in October 2021. Nx has roughly a 6-month major release cycle and so that time has come again: Im happy to announce the **release of Nx v14**.
Those last 6 months have been incredible and Nx probably got the biggest boost ever in terms of simplicity, features, and speed. We even made Nx more beautiful. Join me to explore some of the biggest highlights and what makes v14 so incredible.
> _Nx is open source, so feel free to browse the_ [_repo_](https://github.com/nrwl/nx) _and_ [_changelog_](https://github.com/nrwl/nx/releases/tag/14.0.0) _by yourself 🙂_
**💡Did you have a chance to watch Nx Conf Lite 2022 last Friday?** Many of the new features have been discussed there, and more. You can watch the [entire stream on Youtube](https://youtu.be/iIZOfV0GFmU). All the single talk videos will be released over the next weeks too, so make sure you subscribe and switch on notifications 🙂: [https://youtube.com/nrwl_io](https://youtube.com/nrwl_io)
## Over 1.6 Million Downloads per week 🎉
We hit a major milestone with Nx v13 when we reached 1 million weekly downloads back in December 2021. Only 3 months later, were already over 1.6 million per week and growing fast!
{% tweet url="https://x.com/victorsavkin/status/1504465520640278533" /%}
Nx also outgrew Lerna in February in weekly downloads. Up until that point, [Lerna](https://lerna.js.org/) was considered the go-to choice when it comes to JS-based monorepos. But just recently, they made it [even more evident](https://github.com/lerna/lerna/pull/3092) that Lerna has been and is [largely unmaintained](https://github.com/lerna/lerna/issues/2703).
![](/blog/images/2022-05-02/mPx5PywQEPHBayAO.avif)
We saw that coming and made it easy for people to migrate to Nx.
```shell
npx add-nx-to-monorepo
```
Theres a detailed guide helping with some of the doubts and misconceptions which commonly come up with Lerna users: [https://lerna.js.org/](https://lerna.js.org/)
The future for monorepo tools looks bright as the awareness of monorepos, especially in the JS ecosystem, has grown a lot in recent months. Nx is doing great compared to those tools. But this movement excites us and we are more than ever committed to keep pushing forward and making Nx even better.
![](/blog/images/2022-05-02/3nUxgDpXZ82yx6r8.avif)
## Nx Console reaches 1 million installs
While were talking numbers. We just hit another milestone 🎉
{% tweet url="https://x.com/NxDevTools/status/1518620884570820608" /%}
## Nx Core
We made a lot of improvements in Nx core since v13 that can roughly be categorized into: making Nx faster, simpler and improved dev ergonomics. Lets explore some of the highlights there
## Making Nx even faster!
Being as fast as possible is a key design principle in Nx. Back in December we [tweeted about our speed benchmarks](https://twitter.com/victorsavkin/status/1471582667212738562?s=20&t=fZQ82vUXMztNXFRMmuYQTw) and we keep running them against our releases to see how we compare.
Turns out the latest Nx v14 release is considerably faster than Nx v13:
- Nx v13: 1.587 seconds
- Nx v14: 0.259 seconds
You can check and run the benchmarks by yourself: [https://github.com/vsavkin/large-monorepo](https://github.com/vsavkin/large-monorepo)
How can Nx be so fast? One thing we did introduce after v13 and [recently enabled by default](/blog/what-is-new-in-nx-13-10) is the **Nx Daemon**. There is a fixed amount of computation that needs to happen in every workspace and which increases as the workspace grows. In order to still keep operations fast, we can now use the Nx Daemon to precompute a lot of the operations in the background. Then whenever some Nx operation is triggered, they can directly benefit from that.
> **_Running into a performance issue?_** _Try to debug it by using_ `_NX_PERF_LOGGING=true_` _in combination with your Nx command:_ `_NX_PERF_LOGGING=true nx build crew_`_. Alternatively, you can also have Nx generate a_ `_profile.json_` _and import it into Chrome Devtools._ [_Read more about that here_](/troubleshooting/performance-profiling)_._
While a lot of the above improvements help with local development, one of the biggest pain points of having a large monorepo can be CI times. This is where **distributed task execution (DTE)** makes all the difference\*_._\* Nx Clouds DTE understands which commands your CI is running, how many agents are typically being used, and how long a given task typically takes. It leverages that information along with task dependencies to create an execution plan that prioritizes builds of shared libraries first to unblock upstream builds. This results in a more even utilization of CI agents, optimizing the overall running time of your CI.
![](/blog/images/2022-05-02/k4ayjIt_OMEedxn-.avif)
Over time, Nx Clouds DTE learns about your workspace, keeping metrics about running times to allow the best possible distribution of a given task with the given amount of agents. This comes with Nx Cloud.
> _Note, if you are a large enterprise, you might want to look into the_ [_Nx Private Cloud_](/enterprise) _offering which allows to self-host Nx Cloud within your own infrastructure._
Also see this example repository with some more information: [https://github.com/vsavkin/interstellar](https://github.com/vsavkin/interstellar)
## Simplifying Nx
Nx follows a modular plugin architecture. There is the core part of Nx which has the main logic around managing the project graph, computation caching, hashing and more. On top of that we have a series of Nx provided plugins for some of the most common frameworks and libraries out there, like [TypeScript/Javascript](/nx-api/js), [Angular](/nx-api/angular), [React](/nx-api/react) & [React Native](/nx-api/react-native), [Next.js](/nx-api/next), [Nest.js](/nx-api/nest), [Node](/nx-api/node) and many more, not to forget about [all the community plugins](/community). We also have a [labs project section](https://github.com/nrwl/nx-labs) which is our incubator for potentially new, natively supported Nx plugins.
This modular structure allows you to just use [Nx core without plugins](/getting-started/intro). An ideal approach if you want to add Nx to an [existing Lerna/Yarn/NPM/PNPM workspace](/recipes/adopting-nx/adding-to-monorepo). With v14 we made it even simpler s.t. now you only have a single `nx` package in your dependencies with the core setup.
From there you can go ahead and add new plugins as you need them, thus gradually enhancing the capabilities of your Nx workspace.
Nx is also able now to directly pick up your `package.json` scripts which are common in NPM/Yarn workspaces. Read more here: [/reference/project-configuration](/reference/project-configuration)
## Terminal Output
Developer experience is highly important to us. And that doesnt stop at the terminal output which is something we developers constantly interact with throughout our entire workday. We, therefore, put a lot of love for the details into how we present our terminal output, improving it in a way to show all completed tasks towards the top, while information about the current progress is shown below
_(here executed by skipping the cache to show some progress running_ 🙂*)*
![](/blog/images/2022-05-02/Sodlw6nDI6l9LgsB.avif)
We now even filter out the build of dependent projects. Say you build the `react` project in your workspace which depends on 11 other projects. Nx needs to first incrementally build those 11 dependent projects, which it does now in a very subtle way by just reporting the overall progress at the top of the terminal output, while the main `react` project build output is printed just as normal.
![](/blog/images/2022-05-02/jXaiowGZpPMC6PlJ.avif)
Obviously, all errors would be reported properly, and on CI this behavior is disabled by default. If you want to disable it, you can always set `NX_TASKS_RUNNER_DYNAMIC_OUTPUT` to false.
## “Local Plugins” for your Nx Workspace
[Check out our previous release post](/blog/what-is-new-in-nx-13-10) where we went into some of the details on how local plugins work. But in a nutshell, you can now generate a plugin into an existing Nx workspace:
```shell
npx nx generate @nrwl/nx-plugin:plugin --name=workspace-extensions
```
Now normally you would develop it there, and then publish it to npm s.t. others can install it into their Nx workspaces. Since one of our recent versions of Nx, we now also allow you to directly use them in the same Nx workspace, without the need to pre-compile or publish your plugin.
```json
{
"root": "apps/demo",
"sourceRoot": "apps/demo/src",
"projectType": "application",
"targets": {
"mybuild": {
"executor": "@myorg/workspace-extensions:build",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/someoutput"
}
}
}
}
```
This can be a game changer for automating your Nx workspace.
## Automating CI Setup
Ever struggled with setting up CI? Especially in a large monorepo? We got your back now, with the new `--ci` generator that we introduced in Nx v14.
```shell
npx nx generate @nrwl/workspace:ci-workflow --ci=github
```
Or just use [Nx Console](/getting-started/editor-setup), as always.
![](/blog/images/2022-05-02/XFXDdGUWc3dF9ZMC.avif)
This sets you up with an automated CI workflow that properly uses the Nx affected command together with the power of [Nx Clouds distributed task execution](/ci/features/distribute-task-execution).
You can also use the `--all` flag when generating a new workspace, for seeing all the available options, including to setup CI.
## nx-cloud record
The [Nx Cloud GitHub app](https://github.com/apps/nx-cloud) is so useful for not having to go to your CircleCI logs and try to find the entry youre searching for. Instead all the executed targets nicely show up as a comment in your PR.
![](/blog/images/2022-05-02/4zTea6s4BTMyDToD.avif)
Once you click them, you get a nicely formatted and structured page within Nx Cloud.
![](/blog/images/2022-05-02/WnsKJB1ceufeHGPZ.avif)
Until now, you had to have a task that is being executed through Nx Cloud. But what about those workspace utility scripts, like checking the commit format etc. You can now use `nx-cloud record` for those, like
```shell
npx nx-cloud record -- npx nx format:check
```
and they will automatically show up in the Nx Cloud viewer. 🤫 you dont even have to have Nx Cloud installed in the workspace.
## Module Federation for Faster Builds
For many workspaces it is enough to leverage [Nx affected commands](/ci/features/affected), [computation caching](/concepts/how-caching-works) and [distributed task execution](/ci/features/distribute-task-execution).
However, if you have a huge monorepo, this might not be enough. You can add incremental builds and benefit from caching, but still, you might run into the issue of the final linking process taking a long time, which can hardly be optimized further. Unless you can split up your app into smaller pieces. No, were not talking about micro frontends necessarily (more on that in the next section). Rather we can leverage Webpacks Module Federation support.
We added dedicated generators to create a new module federation setup for Angular and React:
```shell
# React
nx g @nrwl/react:host shell --remotes=shop,cart,about
#a Angular
nx g @nrwl/angular:host shell --remotes=shop,cart,about
```
By specifying the `implicitDependencies` in Nx ([see docs](/reference/project-configuration)) Nx knows what the relation between the various apps is, even though there are not direct imports
![](/blog/images/2022-05-02/1VDr0oYKNn4j4gWm.avif)
Combining this with the power of Nx Cloud distributed caching, you can now serve your shell project
```shell
npx nx serve shell
```
and all the other remotes are statically served from the cache. Your entire infrastructure is working, without you having to worry about building and serving all of the separate remotes. As you can imagine this speeds up local serve times by an order of magnitude.
If you want to work on one of the remotes, simply explicitly pass their name using `--devRemotes` flag and it will be served just normally with the Webpack dev server, with all the features youre used to.
```shell
npx nx serve shell --devRemotes=cart,shop
```
This can be a game-changer when building huge apps. Stay tuned for more content around this as were really just getting started.
We recommend this approach if you want to speed up local serve and build times, but you still deploy the application as a whole.
Read more on our docs: [/concepts/module-federation/faster-builds-with-module-federation](/concepts/module-federation/faster-builds-with-module-federation)
## Micro Frontend Architecture with Nx
As mentioned in the previous section, Nx v14 comes with out-of-the-box for Webpack Module Federation. The Micro Frontend architecture builds on top of that and adds the ability for independent deployability. While Module Federation enables faster builds by vertically slicing your application into smaller ones, the MFE architecture layers _independent deployments_
on top of federation. Teams should only choose MFEs if they want to deploy their host and remotes on different cadences.
Read more on our docs: [/concepts/module-federation/micro-frontend-architecture](/concepts/module-federation/micro-frontend-architecture)
## Dark mode for Project Graph as well as path tracking
You asked for it, the community responded. [Luís Carvalho](https://github.com/Lcarv20) - a first time contributor - worked together with Nx core team members Philip and Ben to deliver dark mode for the project graph visualization!!
![](/blog/images/2022-05-02/TzVbTnDmzgInCw6H.avif)
Also, have you ever wondered whether in your gigantic graph theres a connection between two nodes?
![](/blog/images/2022-05-02/eMk2cAwrdHmaK07h.avif)
Now you can easily find out! Just click on a node and hit the “Start” button.
![](/blog/images/2022-05-02/gDnkyfnnAHy2P0Z8.avif)
Then click the target node youre interested in and hit “End”.
![](/blog/images/2022-05-02/BMoc7FuUD94GzOXO.avif)
The project graph now renders the path between those nodes.
![](/blog/images/2022-05-02/I2E5CvnLb-C8z95L.avif)
And by clicking on the edges you can even get a more detailed output of why the connection exists in the first place 🤯
![](/blog/images/2022-05-02/EnPbSRFUD3KeOH4w.avif)
Oh wait, you didnt want the shortest path? Theres a button for showing all possible paths too 😉
![](/blog/images/2022-05-02/OlhUXFMhEwshLoTV.avif)
## JavaScript & TypeScript library support
In version 13.4 we released a brand new dedicated package for developing pure JavaScript/TypeScript packages: `@nrwl/js`
We kept improving it, adding SWC support (including an easy migration between TSC → SWC using an Nx generator) and were currently looking into automated publishing support.
Read all the details on our docs: [/getting-started/intro](/getting-started/intro)
## React
Nx v14 ships with React 18 support for React DOM and React Native. The latter has seen some drastic improvements since Nx v13, adding [guides on how to create a monorepo for React Native](/blog/step-by-step-guide-on-creating-a-monorepo-for-react-native-apps-using-nx) apps with Nx as well as how to [share code between a React Web and React Native app](/blog/share-code-between-react-web-react-native-mobile-with-nx). We also added Storybook support to React Native. Read all about that in [our recent blog post](/blog/use-storybook-with-nx-react-native).
In addition to that, Expo and Expo Application Service support has been added which has lead already to some drastic speed improvements with some of our clients.
Finally, it is the first version which ships the built-in module federation support for React as weve mentioned a couple of sections above. Check out the React package docs page and search for the `host` and `remote` generator: [/nx-api/react](/nx-api/react)
## Angular
There have been a lot of highlights for the Nx Angular plugin since v13. Here are some:
- Support and migrations for Angular 13 (Angular v14 coming soon. We will release that as a minor upgrade in Nx once the Angular team releases v14)
- Tailwind CSS support (generators, added support to library executors). Read [our blog detailed post](/blog/set-up-tailwind-css-with-angular-in-an-nx-workspace).
- Single Component Application Modules (SCAM) generators for components, directives and pipes ([see our docs](/nx-api/angular))
- Improved Angular CLI to Nx migration support. We invested quite some time refactoring our current migration support from the Angular CLI which not only will allow us to implement more migration scenarios in the future but it also provides better error messages and hints during the migration process. This also allowed us to add support for multi-project Angular CLI workspaces which can now be seamlessly migrated. Multi-application Angular CLI workspace support will be added soon.
Finally, similar to React also Angular gets built-in support for Webpack Module federation and hence also Microfrontends within Nx. See the sections about Module Federation and Microservices for more info and links to the docs.
## Improved docs
Docs are hard! But we keep investing and a lot of work has gone into making docs more organized and even more interactive.
{% tweet url="https://twitter.com/bencabanes/status/1509641445086535687" /%}
## Theres more
Check out our previous release blog posts for all the details:
- [Single File Monorepo Config, Custom Workspace Presets, Improved Tailwind Support, and more in Nx 13.4!](/blog/single-file-monorepo-config-custom-workspace-presets-improved-tailwind-support-and-more-in-nx-13)
- [New Terminal Output & Performance Improvements in v13.5](/blog/new-terminal-output-performance-improvements-in-nx-13-5)
- [Whats new in Nx v13.10?](/blog/what-is-new-in-nx-13-10)
## How to Update Nx
Updating Nx is done with the following command, and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Exciting?
We already started working on v15. You can [find the roadmap on our GitHub repository](https://github.com/nrwl/nx/discussions/9716). There are some exciting things coming up, like
- “Negative” Configuration
- React Server Side Rendering and Server Components support
- React Native + Detox
- Cypress v10 migration and Cypess Component Testing
- ...
Make sure you dont miss anything by
- Following us [on Twitter](https://twitter.com/NxDevTools), and
- Subscribe to the [YouTube Channel](https://youtube.com/nrwl_io?sub_confirmation=1) for more information on [Angular](https://angular.io/), [React](https://reactjs.org/), Nx, and more!
- Subscribing to [our newsletter](https://go.nx.dev/nx-newsletter)!
@@ -0,0 +1,56 @@
---
title: 'Lerna is dead — Long Live Lerna'
slug: 'lerna-is-dead-long-live-lerna'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-05-11/gtsrJ-tMDZf9bvDLVSjQ.png'
tags: [nx]
---
If youre in a hurry, heres the **TL;DR:**
> _We,_ [_Nrwl_](/company)_, the company behind Nx, are taking over the stewardship of Lerna.js, the popular JS monorepo tool._ [_Heres the official announcement on the Lerna repo_](https://github.com/lerna/lerna/issues/3121)_. We are thrilled and committed to helping the Lerna community move forward!_
## Who is Nrwl?
We (Nrwl) are the company behind Nx ([GitHub](https://github.com/nrwl/nx)) and we have been founded by two ex-Googlers and Angular core team members [Jeff Cross](https://twitter.com/jeffbcross) and [Victor Savkin](https://twitter.com/victorsavkin). Experiencing a large-scale monorepo in action at Google, gave them a lot of insights into the advantages and productivity gains for software teams as well as the features and tooling support that is required to make monorepos work, especially at a large scale. When they left Google, they decided to bring such a tool to the masses, but with a clear goal of
- building it in the open as an open-source product and
- making it approachable and easy to use by focusing on great DX
This is when Nx started.
We think we are the best fit for helping the Lerna community continue and thrive because we have a good combination of real-world experience with open source community work. As part of Nrwl, we work with some of the worlds biggest companies, helping them improve productivity and ship great quality software through monorepos. In addition, Jeff and Victor have a lot of knowledge of managing a big open source project such as Angular when they were at Google and obviously at Nrwl from managing Nx as an open-source project with its quickly growing community.
Long story short, Nrwl ❤️ open source and community work, and we are thrilled to work with the Lerna community!
## Whats the story about Lerna being dead?
_(Spoiler: It is not dead, we took over stewardship_ 😀*. But apart from that, heres the whole story)*
- August 2020 — Issue is being opened [mentioning that Lerna is largely unmaintained](https://github.com/lerna/lerna/issues/2703)
- April 2022 — A [PR gets merged](https://github.com/lerna/lerna/pull/3092) that properly highlights the fact of Lerna being unmaintained at the very top of the repository README. This made the “Lerna is dead” discussions flare up again.
- May 2022 — Lerna got resurrected: Nrwl takes over
While that last PR didnt really change the fact that Lerna has been in that state for the past years already, it just made it more apparent and also how many still rely on Lerna today.
And this is not to blame its contributors at all. They did an amazing job. However, Open Source can be a tough place, especially if it is not backed by a large community and/or company that helps make the work sustainable in the long run. Taking the weight of maintaining such a widely used tool, and then mostly for free, is a huge one. Burnout is real folks, so take care. And weve had lots of such open-source examples in the past years.
## Nrwl is taking over: now what?
Lerna has definitely pioneered the JS monorepo space, however, the tooling space has progressed a lot in recent years. Some of its features are now baked into NPM, YARN, PNPM, and Lerna [lacks many other important monorepo features](https://monorepo.tools/#tools-review) such as computation caching to mention one example.
Nx can fill in many of these gaps. When the first discussions about Lerna being unmaintained came up in 2020, we implemented a set of features, allowing for easy migration from [Lerna/NPM/Yarn/PNPM workspaces to Nx](/recipes/adopting-nx/adding-to-monorepo). In addition, some recent [improvements in Nx](/blog/nx-v14-is-out-here-is-all-you-need-to-know) make this even easier, allowing it to basically co-exist in any of these workspaces. This can be done for instance by leveraging [Nxs powerful task scheduling capabilities](/getting-started/intro) while still continuing on relying on Lernas publishing process. Maintaining now both projects, Lerna & Nx, puts us in the unique position of allowing us to work on some seamless integration between the two.
With Nx, we are known to have a clear roadmap shared with the community of what our next 6 months focus will be (heres an [example of our roadmap for v15](https://github.com/nrwl/nx/discussions/9716)). As we get our hands dirty on Lernas codebase in the coming weeks, we are going to define a set of action items, prioritize them and elaborate a proper roadmap as well, which we will share with the community as soon as we have a more concrete plan. Since we know many organizations still depend on Lerna or may not be able to migrate away soon, some of our immediate to mid-term actions will be to **provide critical bug fixes and security updates to the project** and regularly release those to NPM.
## Stay tuned for more!
We think Lernas and Nxs future is bright and we are excited to help move the monorepo space forward, more than ever before!
Make sure you dont miss anything by
- Following us [on Twitter](https://twitter.com/NxDevTools)
- Subscribing to our [YouTube Channel](https://youtube.com/nrwl_io?sub_confirmation=1)
- Subscribing to [our newsletter](https://go.nx.dev/nx-newsletter)!
✌️
@@ -0,0 +1,101 @@
---
title: 'How Lerna just got 10x faster!'
slug: 'lerna-used-to-walk-now-it-can-fly'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-05-25/WPGHapKqT3IguWjeN5UgWg.png'
tags: [nx]
---
**_TL;DR:_** _We released a new beta version of Lerna and it happens that it is now 5.3 times faster than Turbo 👀…by turning on a flag. Keep reading to learn more._
> _ICYMI: A couple of weeks ago we (Nrwl) announced that we take over stewardship of Lerna. Read all about it in our_ [_recent blog post_](/blog/lerna-is-dead-long-live-lerna)_.
> We also just released Lerna v5 as a first maintenance release:_ [_Read more here_](https://github.com/lerna/lerna/releases/tag/v5.0.0)_._
For folks that want to migrate to Nx, we always had a dedicated [Nx and Lerna](/recipes/adopting-nx) docs page that shows you how you can easily integrate the two. However, we felt we could do better and allow you to get all the speed benefits that come from Nxs task scheduling abilities, without needing to change nearly anything in your Lerna workspace.
And it got fast, like really fast!!
## Want the video walkthrough of Lerna 5?
Here you go
{% youtube src="https://www.youtube.com/watch?v=WgO5iG57jeQ" /%}
## How fast is it?
We just published Lerna v5.1 which introduces a `useNx` flag. Adding that makes Lerna to be on par with Nx in terms of speed, and is significantly faster than other tools.
Comparing Lerna with and without the flag isnt really an apples-to-apples comparison because one comes with caching abilities, while before, Lerna didnt have that at all. But just to give you an idea: enabling Nx on your existing Lerna workspace can **speed it up in the range of 210 times**, depending on the repo setup.
But lets do some more real “apples-to-apples” comparison of Lernas speed with `useNx` enabled. For benchmarking Nx we have set up a repo in the past which we regularly use to measure the speed of new Nx releases with other similar tools on the market such as [Lage](https://microsoft.github.io/lage/) and [Turborepo](https://turborepo.org/): [https://github.com/vsavkin/large-monorepo](https://github.com/vsavkin/large-monorepo). We now added Lerna+Nx (Lerna with `useNx` enabled) to that repo to measure the impact.
Heres a gif of running the benchmark of Lerna+Nx and Turborepo:
![](/blog/images/2022-05-25/MrhEU4wPZlwp4dbKsj876g.avif)
**Lerna+Nx is 5.3 times faster** than Turborepo 🚀.
As always, you can reproduce the benchmark by yourself by going to the [benchmark repo](https://github.com/vsavkin/large-monorepo). The readme includes all the details on how to run it on your own machine. We verified it in detail, but if for some reason we got something wrong, please reach out!
## What do I need to do to upgrade?
First of all, upgrade to Lerna v5.1. That release comes with the ability to delegate task running to Nx. Next you need to add Nx as a dependency: `npm i nx --save-dev`
Finally, add the following to your `lerna.json`.
```json5 {% fileName="lerna.json" %}
{
...
"useNx": true
}
```
Thats mostly it. You can continue using the usual Lerna commands, but at this point Lerna would delegate its operations to Nx underneath.
To get more out of it, you might want to create a small `nx.json` file (or run `npx nx init` to generate one) for going into some more details on configuring the cacheable operations:
```json5 {% fileName="nx.json" %}
{
extends: 'nx/presets/npm.json',
tasksRunnerOptions: {
default: {
runner: 'nx/tasks-runners/default',
options: {
cacheableOperations: ['build'],
},
},
},
}
```
Note that `useNx` is opt-in and set to `false` by default. Also, if someone is worried about the license, Nx has been open source from the very beginning, using the MIT license.
## How does this work under the hood?
So how does this work on a technical level. So far Lerna (`lerna run` to be more specific) has been delegating the task scheduling to `p-map` or `p-queue`. Meanwhile though, the industry has advanced and tools like Nx are much more powerful and efficient in their task orchestration and in addition also support caching.
With the change we made in Lerna 5.1 we are adding Nx (MIT licensed) as a third option in addition to the already existing `p-map` and `p-queue`. By having `nx` installed and configured (as mentioned in the previous section), Lerna can now delegate its `lerna run` command to Nx directly. All of this is done in a backwards-compatible way: every `lerna run` command will work but will be significantly faster and can optionally even be distributed across multiple machines without any config (more about that in the next section).
## Whats more?
By having Nx integrated, you not just get faster builds but also some other Nxs features for free!
[**Nx Project graph**](/features/explore-graph) — By running `npx nx graph` you get the visualization of the graph. You can interactively explore what your workspace looks like and the relationships between the packages. We actually used this same graph on the Lerna repo itself, which helped us to get a better understanding of how the repo is structured when we took over the maintenance. Heres an example of filtering the lerna packages to understand what `@lerna/exec` is about and how it relates to other packages in the repo.
![](/blog/images/2022-05-25/uW4TaZQy7smwCDEj.avif)
**Distributed caching** — Right now when you enable `useNx` in your existing Lerna repo, you will get local caching, meaning the cache sits in a local folder on your machine. You get much more value out of it when you start distributing and sharing it with your teammates but especially in CI. This can be done by adding Nx Cloud, which comes with a no-credit card, 500 hours free / month offer which is more than what most workspaces need. Adding that is easy and can be done by adding `@nrwl/nx-cloud` to your root-level `package.json` and then by running:
```shell
npx nx connect-to-nx-cloud
```
**Distributed task execution** — Distribution of the cache is one thing, but the real speed improvements come from also [distributing the task execution](/ci/features/distribute-task-execution) to speed up your CI. Having the Nx project graph and as well as the cache and historical data about previous runs, Nx Cloud DTE is able to maximize the CI agent utilization by evenly distributing tasks based on their (historical) duration as well as based on their topological order. In addition, the DTE process makes sure to properly move cached assets between the agents. Setting up DTE is straightforward, read more on our [Nx Cloud docs](/ci/features/distribute-task-execution). Hint: we also have a CI generator in Nx (you need the `@nrwl/workspace` package) that allows you to generate your CI setup using a single command: `npx nx generate @nrwl/workspace:ci-workflow --ci=github`
**Lerna roadmap** — We also just published a roadmap of the next steps for the Lerna repository. Check it out here: [https://github.com/lerna/lerna/discussions/3140](https://github.com/lerna/lerna/discussions/3140)
## Conclusion
This is the first beta which we are trying out on some projects already. We arent worried about task orchestration, caching or distribution — all of those are done by Nx, which has been around for 5 years and is solid. We are trying to see if there is something in the integration that is confusing. We hope to release s stable version by mid-June.
Please have a look, upgrade your repo and [open an issue](https://github.com/lerna/lerna/issues) if you run into some weird behavior with the new `useNx` enabled. But not only that, feel free to ping us on the [@NxDevTools](https://twitter.com/nxdevtools) account with your success stories too. We'd love to hear 😃.
@@ -0,0 +1,747 @@
---
title: 'Setup a Monorepo with PNPM workspaces and speed it up with Nx!'
slug: 'setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-07-14/ABrBjQPg4SrYzFQQXFxY-Q.png'
tags: [nx, tutorial]
---
In this article were going to have a deep dive into setting up a new monorepo using [PNPM workspaces](https://pnpm.io/workspaces) that hosts a Remix application as well as a React-based library. We will learn how to run commands with PNPM, how to run them in parallel and finally were going to add Nx for a more sophisticated task scheduling, including command caching and more.
**Important:** If you are already familiar with the setup and configuration of a new PNPM workspace, feel free to skip to the part where we add Nx later in the article.
**Prefer a video walkthrough?**
{% youtube src="https://www.youtube.com/watch?v=ngdoUQBvAjo" /%}
### Table of Contents
· [Initialize a new PNPM workspace](#initialize-a-new-pnpm-workspace)
· [Setting up the Monorepo structure](#setting-up-the-monorepo-structure)
· [Adding a Remix application](#adding-a-remix-application)
· [Create a Shared UI library](#create-a-shared-ui-library)
· [Consuming our shared-ui package from the Remix app](#consuming-our-sharedui-package-from-the-remix-app)
· [Running commands with PNPM](#running-commands-with-pnpm)
· [Speeding up with Nx](#speeding-up-with-nx)
· [Installing Nx](#installing-nx)
· [Running tasks with Nx](#running-tasks-with-nx)
· [Configure Caching](#configure-caching)
· [Fine-tuning the caching](#finetuning-the-caching)
· [Reusing Cache Input Globs](#reusing-cache-input-globs)
· [Defining task dependencies (aka build pipeline)](#defining-task-dependencies-aka-build-pipeline)
· [Running just what changed](#running-just-what-changed)
· [Additional features](#additional-features)
· [Dynamic Terminal Output](#dynamic-terminal-output)
· [Project Graph Visualization](#project-graph-visualization)
· [Conclusion](#conclusion)
## Initialize a new PNPM workspace
To get started, lets make sure you have PNPM installed. The [official docs have an installation page](https://pnpm.io/installation) with detailed instructions. I also recommend using something like [Volta](https://volta.sh/) in particular if you have to deal with multiple different versions of NPM/PNPM and node versions.
Lets create a new folder named `pnpm-mono`, cd into it and then run `pnpm init` to generate a top-level `package.json`. This will be the root `package.json` for our PNPM monorepo.
```shell
mkdir pnpm-mono
cd pnpm-mono
pnpm init
```
It is probably also handy to initialize a new Git repository such that we can commit and backup things as we progress in the setup:
```shell
git init
```
At this point lets also create a `.gitignore` file to immediately exclude things like `node_modules` and common build output folders.
```.gitignore {% fileName=".gitignore" %}
node_modules
dist
build
```
## Setting up the Monorepo structure
The structure of a monorepo might vary depending on what you plan to use it for. There are generally two kinds of monorepo:
- **package centric** repositories which are used for developing and publishing a cohesive set of reusable packages. This is a common setup in the open source world and can be seen in repositories such as [Angular](https://github.com/angular/angular), [React](https://github.com/facebook/react), [Vue](https://github.com/vuejs/vue) and many others. Those repos are characterized by most commonly having a `packages` folder and which are then commonly published to some public registry such as [NPM](https://npmjs.com/).
- **app centric** repositories which are used mainly for developing applications and products. This is a common setup in companies. Such repos are characterized in having an `apps` and `packages` or `libs` folder, where the `apps` folder contains the buildable and deployable applications, while the `packages` or `libs` folder contains libraries that are specific to one or multiple applications that are being developed within the monorepo. You can still also publish some of these libs to a public registry.
In this article were going to use the “app centric” approach, to demonstrate how we can have an application that consumes packages from within the monorepo.
Create an `apps` and `packages` folder within `pnpm-mono`:
```
mkdir apps packages
```
Now lets configure PNPM to properly recognize the monorepo workspace. Basically we have to create a `pnpm-workspace.yaml` file at the root of the repository, defining our monorepo structure:
```yaml {% fileName="pnpm-workspace.yaml" %}
packages:
# executable/launchable applications
- 'apps/*'
# all packages in subdirs of packages/ and components/
- 'packages/*'
```
## Adding a Remix application
We should now be ready to add our first application. For this example I picked [Remix](https://remix.run/) but you can really host any type of application in here, it wont really matter.
> _Info: We use the normal_ [_Remix installation & setup procedure_](https://remix.run/docs/en/v1) _here which you can find on their docs page._
Since we want to have the app within the `apps` folder, we need to `cd` into it:
```shell
cd apps
npx create-remix@latest
```
You will be asked for an app name. Lets just go with “my-remix-app” which well be using for the rest of this article. Obviously feel free to use a different one. In addition, the Remix setup process is also going to ask you a couple of questions that customize the exact setup. The particular options are not really relevant for our article here, so feel free to choose whatever best suits your needs.
You should have now a Remix app, within the `apps/my-remix-app` folder or whatever name you chose. Remix has already a `package.json` with corresponding scripts configured:
```json
{
"private": true,
"sideEffects": false,
"scripts": {
"build": "remix build",
"dev": "remix dev",
"start": "remix-serve build"
},
...
}
```
Usually, in a monorepo you want to run commands from the root of the repository to not have to constantly switch between folders. PNPM workspaces have a way to do that, by passing a `filter` argument, like:
```shell
pnpm --filter <package-name> <command>
```
Now it happens (at the writing of this article) that Remixs default `package.json` doesn't have a `name` property defined which PNPM wants to run the package. So let's define one in the `apps/my-remix-app/package.json`:
```json
{
"name": "my-remix-app",
"private": true,
"sideEffects": false,
...
}
```
You should now be able to serve your Remix app in dev-mode by using:
```shell
pnpm --filter my-remix-app dev
```
![](/blog/images/2022-07-14/QXjUpc402IKnVSwJC9cw9g.avif)
## Create a Shared UI library
Now that we have our app set up, lets create a library package that can be consumed by our application.
```shell
cd packages
mkdir shared-ui
```
Next, lets create a `package.json` with the following content (you can also use `pnpm init` and adjust it):
```json
{
"private": true,
"name": "shared-ui",
"description": "Shared UI components",
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {},
"devDependencies": {}
}
```
Note, we declare it as `private` because we don't want to publish it to NPM or somewhere else, but rather just reference and use it locally within our workspace. I also removed the `version` property since it is not used.
As the technology stack Ive chosen to go with [React](https://reactjs.org/) (so we can import it in Remix) and [TypeScript](https://www.typescriptlang.org/) (because it can almost be considered a standard nowadays). Lets install these dependencies from the root of the workspace:
```shell
pnpm add --filter shared-ui react
pnpm add --filter shared-ui typescript -D
```
By passing `--filter shared-ui` to the installation command, we install these NPM packages locally to the `shared-ui` library.
> _Info: Be aware that this might potentially cause version conflicts if the React/TypeScript version used by the library package and the consumer (e.g. our app) differs. Adopting a_ [_single version policy_](https://opensource.google/documentation/reference/thirdparty/oneversion)_, where you move the packages to the root of the monoreopo, is a possible solution for that._
Our first component will be a very simple `Button` component. So let's create one:
```tsx {% fileName="packages/shared-ui/Button.tsx" %}
export function Button(props: any) {
return <button onClick={() => props.onClick()}>{props.children}</button>;
}
export default Button;
```
We also want to have a public API where we export components to be used outside of our `shared-ui` package:
```tsx {% fileName="packages/shared-ui/index.tsx" %}
export * from './Button';
```
For sake of simplicity we just use the TypeScript compiler to compile our package. We could have some more sophisticated setup for bundling multiple files together etc with something like [Rollup](https://rollupjs.org/guide/en/) or whatever you prefer using, but thats outside the scope of this article.
To create the desired compilation output create a `packages/shared-ui/tsconfig.json` file with the following configuration.
```json
{
"compilerOptions": {
"jsx": "react-jsx",
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"module": "commonjs",
"outDir": "./dist"
},
"include": ["."],
"exclude": ["dist", "node_modules", "**/*.spec.ts"]
}
```
> _In a monorepo it is good practice to extract the common config part into a higher-level config (e.g. at the root) and then extend it here in the various projects. This to avoid a lot of duplication across the various monorepo packages. For the sake of simplicity I kept it all in one place here._
As you can see the `outDir` points to a package-local `dist` folder. So we should add a main entry point in the `shared-ui` package's `package.json`:
```json
{
"private": true,
"name": "shared-ui",
"main": "dist/index.js"
}
```
Finally, the actual build consists of deleting some residual folders from the previous output and then invoking the TypeScript compiler (`tsc`). Here's the complete `packages/shared-ui/package.json` file:
```json
{
"private": true,
"name": "shared-ui",
"description": "Shared UI components",
"main": "dist/index.js",
"scripts": {
"build": "rm -rf dist && tsc"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"react": "^17.0.2"
},
"devDependencies": {
"typescript": "^4.6.4"
}
}
```
Use the following command to run the build from the root of the PNPM workspace:
```shell
pnpm --filter shared-ui build
```
If the build succeeds, you should see the compiled output in the `packages/shared-ui/dist` folder.
## Consuming our shared-ui package from the Remix app
Our `shared-ui` library is ready so we can use it in the Remix application hosted within the `apps` folder of our repository. We can either manually add the dependency to Remix's `package.json` or use PNPM to add it:
```shell
pnpm add shared-ui --filter my-remix-app --workspace
```
This adds it to the dependency in the `apps/my-remix-app/package.json`:
```json
{
"name": "my-remix-app",
"private": true,
"sideEffects": false,
...
"dependencies": {
...
"shared-ui": "workspace:*"
},
...
}
```
`workspace:*` denotes that the package is resolved locally in the workspace, rather than from some remote registry (such as [NPM](https://npmjs.com/)). The `*` simply indicates that we want to depend on the latest version of it, rather than a specific one. Using a specific version really just makes sense if you're using external NPM packages.
To use our `Button` component we now import it from some Remix route. Replace the content of `apps/my-remix-app/app/routes/index.tsx` with the following:
```tsx {% fileName="apps/my-remix-app/app/routes/index.tsx" %}
import { Button } from 'shared-ui';
export default function Index() {
return (
<div>
<Button onClick={() => console.log('clicked')}>Click me</Button>
</div>
);
}
```
If you now run the Remix app again you should see the button being rendered.
```shell
pnpm --filter my-remix-app dev
```
If you happen to get the following error, then it is because you need to build `shared-ui` first
```shell
Error: Cannot find module '/Users/juri/nrwl/content/pnpm-demos/pnpm-mono/apps/my-remix-app/node_modules/shared-ui/dist/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:353:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/juri/nrwl/content/pnpm-demos/pnpm-mono/apps/my-remix-app/app/routes/index.tsx:1:24)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
```
To build that, run
```shell
pnpm --filter shared-ui build
```
Why? This is due to the symlinks PNPM creates in order to be able to reference and resolve local dependencies. By adding `shared-ui: "workspace:*"` to Remix's `package.json` you instruct PNPM to add a symlink to Remix's `node_modules` folder.
![](/blog/images/2022-07-14/MYLr1kb3cscQo7JW9_Jg8Q.avif)
_PNPM creates a symlink in the local node_modules folder to be able to import local packages_
## Running commands with PNPM
PNPM comes with handy features to run commands across the monorepo workspace. We have already seen how to scope commands on single packages using the `--filter` :
```shell
pnpm --filter my-remix-app dev
```
You can also run a command recursively on all the packages in the workspace using the `-r` flag. Imagine for instance running the build for all projects.
```shell
pnpm run -r buildScope: 2 of 3 workspace projects
packages/shared-ui build$ rm -rf dist && tsc
└─ Done in 603ms
apps/my-remix-app build$ remix build
│ Building Remix app in production mode...
│ The path "shared-ui" is imported in app/routes/index.tsx but shared-ui is not listed in your package.json
│ Built in 156ms
└─ Done in 547ms
```
Similarly you can parallelize the run by using `--parallel`
```shell
pnpm run --parallel -r buildScope: 2 of 3 workspace projects
apps/my-remix-app build$ remix build
packages/shared-ui build$ rm -rf dist && tsc
apps/my-remix-app build: Building Remix app in production mode...
apps/my-remix-app build: The path "shared-ui" is imported in app/routes/index.tsx but shared-ui is not listed in your package.json dependencies. Did you forget to install it?
apps/my-remix-app build: Built in 176ms
apps/my-remix-app build: Done
packages/shared-ui build: Done
```
## Speeding up with Nx
PNPM workspaces come with some basic facilities for running tasks on the monorepo packages, even in parallel. As the monorepo grows, you might want to have a more sophisticated approach that allows to
- run tasks on only the packages that changed
- advanced caching based on file contents to not run anything that has already been computed previously
- remote distributed caching to speed up your CI
This is exactly where Nx can help. It is optimized for monorepo scenarios and comes with an advanced task scheduling mechanism. We still rely on the package installation and package linking mechanism that PNPM workspaces provide us, but use Nx instead to run our tasks in the most efficient way.
## Installing Nx
Since Nx will be used for running operations across the entire monorepo workspace were going to install it at the root level `package.json`.
```shell
pnpm add nx -D -w
```
Thats it.
## Running tasks with Nx
Nx uses the following form to run your commands:
```shell
npx nx <target> <project>
```
`target` is the NPM script in this specific case you want to execute.
Lets try to run the build for our `shared-ui` package using the following command:
```shell
npx nx build shared-ui
```
This produces the following output
```shell
nx run shared-ui:build
shared-ui@ build /Users/juri/nrwl/content/pnpm-demos/pnpm-mono/packages/shared-ui
rm -rf dist && tsc
NX Successfully ran target build for project shared-ui (1s)
```
Nx automatically finds `shared-ui` and runs the `build` script defined in `packages/shared-ui/package.json`.
Similarly, to launch our Remix app, run `npx nx dev my-remix-app`.
We can also run commands in parallel across the projects with:
```shell
npx nx run-many --target=build --all
✔ nx run my-remix-app:build (1s)
✔ nx run shared-ui:build (1s)
NX Successfully ran target build for 2 projects (1s)
```
Or selectively specify projects with
```shell
npx nx run-many --target=build --projects=my-remix-app,shared-ui
✔ nx run my-remix-app:build (1s)
✔ nx run shared-ui:build (1s)
NX Successfully ran target build for 2 projects (1s)
```
> _Note Im prefixing the commands with_ `_npx_` _which runs the Nx executable in the_ `_node_modules_` _folder. In this way I don't have to install_ `_nx_` _globally. If you prefer doing that, feel free to do so._
## Configure Caching
One of the main benefits of adding Nx to our PNPM workspace is **speed via caching**. [Computation caching](/concepts/how-caching-works) is a feature where different inputs (source files, env variables, command flags, etc.) are collected and a hash computed & stored in a local folder. Next time you run the command again, Nx looks for a matching hash, and if it finds one it just restores it. This includes restoring the terminal output as well as build artifacts (e.g. JS files in `dist` folders).
Not all operations are cacheable, only side-effect free ones are. For example, if you run an operation with the same inputs, it reliably always has to produce the same output. If as part of that operation you call some API for instance, it wouldnt be cacheable because the result of that API might vary given the same input parameters.
In order to enable caching, lets configure our cacheable operations. To do that we create an `nx.json` at the root of our workspace with the following content
```json {% fileName="nx.json" %}
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "test"]
}
}
}
}
```
Note the `cacheableOperations` array where we specify `build` and `test` . You can add more such as linting.
Having enabled this, if we now run our Remix app build the first time it is executed just as normal and well see it takes roughly 1s.
```shell
npx nx build my-remix-app
nx run my-remix-app:build
my-remix-app@ build /Users/juri/nrwl/content/pnpm-demos/pnpm-mono/apps/my-remix-app
remix buildBuilding Remix app in production mode...
The path "shared-ui" is imported in app/routes/index.tsx but shared-ui is not listed in your package.json dependencies. Did you forget to install it?
Built in 163ms
NX Successfully ran target build for project my-remix-app (1s)
```
If you re-run the same command, it will now be pulled out of the cache and take only a few milliseconds.
```shell
npx nx build my-remix-app> nx run my-remix-app:build [existing outputs match the cache, left as is]
my-remix-app@ build /Users/juri/nrwl/content/pnpm-demos/pnpm-mono/apps/my-remix-app
remix buildBuilding Remix app in production mode...
The path "shared-ui" is imported in app/routes/index.tsx but shared-ui is not listed in your package.json dependencies. Did you forget to install it?
Built in 163ms
NX Successfully ran target build for project my-remix-app (9ms)
Nx read the output from the cache instead of running the command for 1 out of 1 tasks.
```
You can also see that from the terminal output mentioning “existing outputs match the cache, left as is” as well as at the end “Nx read the output from the cache instead of running the command for 1 out of 1 tasks.”
Having caching in place can drastically improve command execution times. It also gets even more useful if the cache is remotely distributed so that it can be shared with CI as well as other developer machines. In the case of Nx this can be done by enabling [Nx Cloud](/ci/features/remote-cache), which comes with 500 hours saved/month for free (no credit card required) and unlimited hours for open source projects.
## Fine-tuning the caching
By default the caching mechanism takes [all project-level files as an input](/concepts/how-caching-works). We might want to distinguish though which files are being considered based on the target that we execute. Example: you might not want to invalidate the cache for the `build` task if only spec files for unit testing got changed.
To illustrate this on our example, run `npx nx build my-remix-app` twice, such that the caching gets activated. Next, change the `README.md` of the Remix project (`apps/my-remix-app/README.md`). If you re-run the Remix app build the cache will be invalidated due to the change of the README file. This might definitely not be a desirable operation.
We can fine-tune the caching by adding a `targetDefaults` node in the `nx.json` and define that the default `input` for the `build` target should exclude `*.md` files.
```json
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "test"]
}
}
},
"targetDefaults": {
"build": {
"inputs": ["!{projectRoot}/**/*.md"]
}
}
}
```
With this change, MD files would not be considered as part of the cache input whenever you run the `build` task.
> _Note that all path globs are_ **_relative to the root of the workspace_**_. This avoids confusion as the inputs could also be defined at the project level in the_ `_package.json_` _(_[_more here_](/reference/project-configuration)_). You can use the interpolation variables_ `_{projectRoot}_` _and_ `_{workspaceRoot}_` _do distinguish whether the path should be targeting the project specific files or workspace level files._
## Reusing Cache Input Globs
You can also go a step further as you might re-use this glob for excluding markdown files also for a hypothetical `test` target. You can do so by extracting the glob into a `namedInputs` property:
```json
{
"tasksRunnerOptions": {
...
},
"namedInputs": {
"noMarkdown": ["!{projectRoot}/**/*.md"]
},
"targetDefaults": {
"build": {
"inputs": ["noMarkdown", "^noMarkdown"]
},
"test": {
"inputs": ["noMarkdown", "^noMarkdown"]
}
}
}
```
By adding `^` in front of the `namedInput` we indicate that this should also apply for changes in any dependencies of the project.
## Defining task dependencies (aka build pipeline)
We have seen previously that when running our Remix dev server, but not having compiled the dependent `shared-ui` package first, we got an error when running our Remix app.
```
Error: Cannot find module '/Users/juri/nrwl/content/pnpm-demos/pnpm-mono/apps/my-remix-app/node_modules/shared-ui/dist/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:353:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/juri/nrwl/content/pnpm-demos/pnpm-mono/apps/my-remix-app/app/routes/index.tsx:1:24)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
```
To fix it, we had to manually build `shared-ui` first. Normally you want to avoid this, which is exactly why Nx comes with a `targetDefaults` definition (often also denoted as the "build pipeline").
We can define such task dependencies in `nx.json` at the root of the workspace in the `targetDefaults` property.
As the first dependency we want to define that whenever we run the `build` target on a project, all the `build` targets of its dependent projects should be executed first. We can express that by adding an additional `dependsOn` property to the `build` task definition:
```json
{
"tasksRunnerOptions": {
...
},
...
"targetDefaults": {
"build": {
...
"dependsOn": ["^build"]
}
},
}
```
Similar as we have seen in the definition of the `inputs`, the `^` here denotes that the target should be run on all dependent projects. If you remove the `^`, then the target would be invoked on the same project. That can be useful if you have a `prebuild` step that always needs to be invoked.
Next, we also want to define a targetDefault for our Remix `dev` command, such that first the `build` on all dependent packages (e.g our `shared-ui`) is run.
```json
{
"tasksRunnerOptions": {
...
},
...
"targetDefaults": {
"build": {
...
"dependsOn": ["^build"]
},
"dev": {
"dependsOn": ["^build"]
}
}
}
```
Heres the entire `nx.json` file again as a reference point:
```json
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "test"]
}
}
},
"namedInputs": {
"noMarkdown": ["!{projectRoot}/**/*.md"]
},
"targetDefaults": {
"build": {
"inputs": ["noMarkdown", "^noMarkdown"],
"dependsOn": ["^build"]
},
"dev": {
"dependsOn": ["^build"]
}
}
}
```
If we now run `npx nx build my-remix-app` we can see that Nx first runs tasks on dependent projects, and only then runs the command we invoked.
![](/blog/images/2022-07-14/DhI4glb7lrvW_nSgHZz9KA.avif)
_Nx highlights dependent projects being built, but it keeps the main attention to the current task at hand without distracting_
## Running just what changed
In addition to providing caching, Nx also allows to just run what changed in a given branch with respect to a base branch by using the so-called [“affected command”](/ci/features/affected).
```shell
npx nx affected:<target>
```
You can use any target you have defined in your workspace. For example
- `npx nx affected:build`
- `npx nx affected:test`
- `npx nx affected:lint`
- `npx nx affected:publish`
**How does this work?** Nx builds a project graph based on the structure and dependencies among packages in your monorepo workspace. Lets assume the following hypothetical graph:
![](/blog/images/2022-07-14/wdMo0VwoyAdZbAmDbn6uMw.avif)
_Potential graph of a monorepo workspace_
Whenever we run the affected commands on a branch, Nx compares all the commits and relative changes with the base branch. By default that is `main`, but you can fine-tune that in the `nx.json` file:
```json
{
"affected": {
"defaultBase": "main"
}
}
```
If `lib2` gets changed in our feature branch, running tests against the workspace using `affected:test` would only run tests for `lib2` and `appB`.
![](/blog/images/2022-07-14/FACbo_7-AlbPOna_6-hDaw.avif)
_Affected projects if “lib2” gets changed_
Be aware however, if we run `affected:build` and we defined a dependency in our `nx.json` indicating that dependent projects need to be built first as well (see section "Defining task dependencies"), then `affected:build` would build
- `lib3`
- `lib2`
- `appB`
It would not build `lib1` or `appA` though.
## Additional features
Besides speed and task scheduling improvements, we also get some additional features by adding Nx to our PNPM workspace. Lets explore some:
## Want to automate the creation of packages?
Once you have a good setup for a package, you obviously want to replicate that as you create new ones. The usual approach: copy & paste and then remove all stuff that's not needed.
That's tedious and potentially error prone. Nx has a concept of "generators", basically code scaffolding which allows you to generate new packages in the monorepo rather than copy & pasting old ones.
If that sounds interesting, here's a walkthrough:
{% youtube src="https://www.youtube.com/watch?v=myqfGDWC2go" /%}
## Dynamic Terminal Output
Running tasks in parallel with PNPM results in quite a messy terminal output. The logs are hard to parse as the messages from the different commands being executed in parallel are interleaved.
```shell
pnpm run --parallel -r buildScope: 2 of 3 workspace projects
apps/my-remix-app build$ remix build
packages/shared-ui build$ rm -rf dist && tsc
apps/my-remix-app build: Building Remix app in production mode...
apps/my-remix-app build: The path "shared-ui" is imported in app/routes/index.tsx but shared-ui is not listed in your package.json dependencies. Did you forget to install it?
apps/my-remix-app build: Built in 176ms
apps/my-remix-app build: Done
packages/shared-ui build: Done
```
When using Nx to run tasks you get a dynamic terminal that shows just what is necessary and most relevant to the current command that has been executed. Running the same parallel build task results in the following output when using Nx:
![](/blog/images/2022-07-14/GbaJL87ZfOpBQm-W6lBheQ.avif)
_Terminal output of Nx dynamically showing the parallel tasks being computed as well as the ones that already succeeded_
## Project Graph Visualization
```shell
npx nx graph
```
This launches an interactive visualization of the workspaces project graph with some advanced capabilities of filtering, debugging your workspace structure and more.
![](/blog/images/2022-07-14/KpUCyj6SvYR3t7tmADloog.avif)
_Nx project graph visualization of our PNPM workspace_
> _As a side-note: you can run the project graph on any PNPM workspace, even if you dont have Nx installed. Running_ `_npx nx graph_` _should work._
## Conclusion
We did it! Here are some of the things we covered:
- how to setup a PNPM based monorepo workspace
- create a Remix and shared React library within a PNPM monorepoe
- how to run different commands with PNPM
- how to add Nx & incrementally adopt it in the monorepo
- benefits and features that come with adding Nx to a PNPM workspace
You can find an example of such setup on the **Nx Recipe GitHub repository**:
[https://github.com/nrwl/nx-recipes/tree/main/pnpm-workspace](https://github.com/nrwl/nx-recipes/tree/main/pnpm-workspace)
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
@@ -0,0 +1,97 @@
---
title: 'Helping the Environment by Saving Two Centuries of Compute time'
slug: 'helping-the-environment-by-saving-two-centuries-of-compute-time'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-08-18/FBQVoC9YXF7wlq3dhxfQMQ.png'
tags: [nx]
---
Among the core features of Nx is the ability to save computation time by applying different strategies. Scroll to the end of the article for some more info, but first, **how much time is actually being saved?**
## How much time is being saved?
This is how much got saved so far (data from August 16th, 2022). Pretty crazy!
![](/blog/images/2022-08-18/pT5u_K51oZBHGll7lz5VzA.avif)
Here are the raw numbers:
- **Last 7 days:** 5 years 4 months 2 days 2 hours 32 minutes 46 seconds
- **Last 30 days:** 23 years 8 months 25 days 8 hours 57 minutes 19 seconds
- **Since the beginning of Nx Cloud:** 200 years 10 months 13 days 19 hours 37 minutes 57 seconds
## The Effect on the Environment
Calculating the CO2 emissions can be tricky. It really depends on what machines are being used to run the computation saved by Nx Cloud. We gave it a try by using [https://green-algorithms.org/](https://green-algorithms.org/).
**Last 7-day savings correspond to:**
![](/blog/images/2022-08-18/wtlsJfqliTPK677u.avif)
[See all the details](https://green-algorithms.org//?runTime_hour=46752&runTime_min=0&appVersion=v2.2&locationContinent=North+America&locationCountry=United+States+of+America&locationRegion=US&coreType=CPU&numberCPUs=2&CPUmodel=Xeon+E5-2683+v4&memory=4&platformType=cloudComputing&provider=aws)
**Last 30-day savings correspond to:**
![](/blog/images/2022-08-18/20CiOx5JE5Lr0zaU.avif)
[See all the details](https://green-algorithms.org//?runTime_hour=207462&runTime_min=0&appVersion=v2.2&locationContinent=North+America&locationCountry=United+States+of+America&locationRegion=US&coreType=CPU&numberCPUs=2&CPUmodel=Xeon+E5-2683+v4&memory=4&platformType=cloudComputing&provider=aws)
**Since the beginning of Nx Cloud:**
![](/blog/images/2022-08-18/BvLzgEHLCJg9_isq.avif)
[See all the details](https://green-algorithms.org//?runTime_hour=1760505&runTime_min=0&appVersion=v2.2&locationContinent=North+America&locationCountry=United+States+of+America&locationRegion=US&coreType=CPU&numberCPUs=2&CPUmodel=Xeon+E5-2683+v4&memory=4&platformType=cloudComputing&provider=aws)
## Help me out! A Primer on how Nx saves computation
Nx has various strategies to help you reduce computation time, locally and on CI. Heres a very short overview of the strategies Nx applies with some links for further reading.
### Affected Commands
Example: Run tests only for changed projects in a given PR.
```
nx affected:test
```
[Nx affected commands](/ci/features/affected) allow you to only run commands against projects that changed with respect to a baseline. Usually, this is applied in PRs processed by your CI system. Nx analyzes the Git commits and identifies all projects that got changed with respect to a base branch (usually `main` or `master`). It then makes sure to run the given command only for those projects as well as all projects depending on them since they might be affected by the change too.
This helps save computation by reducing the set of projects that need to be processed.
### Local Computation Caching
Nx comes with a so-called [computation caching](/concepts/how-caching-works) feature. For every cacheable operation, Nx takes a set of input parameters, computes a hash and stores the result.
![](/blog/images/2022-08-18/MusIEMCW5NlEtaaA.avif)
Whenever a hash matches, the computation is not run, but rather the previous result is restored. This can dramatically speed up things and avoid running any computation that has already been run previously.
### Distributed Remote Caching (with Nx Cloud)
By default, the Nx computation cache is stored locally (usually within the `node_modules/.cache/nx` folder). The real benefits come from sharing it with others, that being your co-workers or CI agents.
[Nx Cloud](/nx-cloud) allows to distribute the Nx computation cache across machines.
![](/blog/images/2022-08-18/0uisxJ76ycdSZdA1.avif)
Connecting an existing Nx workspace to Nx Cloud can be done with
```
nx connect-to-nx-cloud
```
[More on the docs](/ci/features/remote-cache). Nx Cloud comes with [500 hours of computation time saved per month](/pricing) which is plenty for most workspaces. If you go over, you can buy more, or in the worst case, caching simply stops until the next month.
## Bonus! Lerna can do this too!!
[Nrwl](/company), the company behind Nx, recently [took over stewardship of Lerna](/blog/lerna-is-dead-long-live-lerna). Meanwhile, Lerna 5.4 just got released which features a nice integration with Nx, allowing existing Lerna users to keep using the very same commands, but still benefit from the improved task scheduling and caching abilities Nx comes with.
How to enable it? [Read more on the Lerna docs](https://lerna.js.org/docs/features/cache-tasks)
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
@@ -0,0 +1,206 @@
---
title: 'Lerna reborn — Whats new in v6?'
slug: 'lerna-reborn-whats-new-in-v6'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-10-12/RGQCNNO-SSQ8PHnIZ4BVTQ.png'
tags: [nx, release]
---
Lerna v6 is out!! Heres everything you need to know about the **new Lerna experience!**
**Table of Contents**
· [Lerna continues to evolve](#lerna-continues-to-evolve)
· [Fast Lerna with caching by default](#fast-lerna-with-caching-by-default)
· [Remote caching with Lerna](#remote-caching-with-lerna)
· [Defining a task pipeline](#defining-a-task-pipeline)
· [Lerna add-caching command](#lerna-addcaching-command)
· [PNPM support for Lerna](#pnpm-support-for-lerna)
· [Dynamic terminal output](#dynamic-terminal-output)
· [VSCode extension for Lerna workspaces](#vscode-extension-for-lerna-workspaces)
· [Lerna Repair](#lerna-repair)
· [Lerna and Prettier](#lerna-and-prettier)
· [Migrating to Lerna v6](#migrating-to-lerna-v6)
· [Lerna is using Nx now. Can I keep using my Lerna commands?](#lerna-is-using-nx-now-can-i-keep-using-my-lerna-commands)
· [Are you maintaining an OSS repository using Lerna?](#are-you-maintaining-an-oss-repository-using-lerna)
## Lerna continues to evolve
If you already know this, feel free to skip ahead. But surprisingly many still havent heard that **Lerna is back**, far from obsolete or deprecated and is getting brand new features. We from [Nrwl](/company) are the creators of Nx and given our long history in the monorepo space, we offered to [take over stewardship of Lerna](/blog/lerna-is-dead-long-live-lerna) when it was declared “dead” in April 2022.
Since we took over, in May 2022, it has been an absolute rollercoaster. We launched [a brand new website](https://lerna.js.org/), updated the content of the docs, and [made Lerna 10x faster](/blog/lerna-used-to-walk-now-it-can-fly). And now, **Lerna v6 is out!**
## Fast Lerna with caching by default
Up until Lerna v4, either the `p-map` or `p-queue` npm packages have been used to delegate the task scheduling. With [v5.1](/blog/lerna-used-to-walk-now-it-can-fly) we introduced `nx` as an additional mechanism to schedule tasks. The advantage? Nx has caching built-in, which **also gives Lerna caching support**, making it lightning fast. A recent benchmark test resulted in **Lerna being 2.5x faster than Lage** and around **4x faster than Turbo** (as of Oct 2022; [test it out by yourself](https://github.com/vsavkin/large-monorepo)).
So far you had to enable “Nx support” by setting the `useNx` flag in `lerna.json`:
```
// lerna.json
{
...
"useNx": true
}
```
Weve been testing this opt-in for the last couple of months and got tons of amazing feedback from companies and open source projects. As a result, **with v6 all Lerna workspaces have the useNx set to** `**true**` **by default** even if you don't have it in your Lerna config file. If you don't want to use it, you can disable it by setting the flag to false.
To experience fast caching, ensure you have a `nx.json` file at the root of your Lerna workspace where you define the cacheable operations. Check out [the docs for more details](https://lerna.js.org/docs/features/cache-tasks). Here's an example configuration file:
```json
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "test"]
}
}
}
}
```
Note that you can also run..
```shell
npx lerna add-caching
```
..to automatically generate a `nx.json` configuration file based on your existing Lerna workspace.
## Remote caching with Lerna
By using Nx as the task scheduler for Lerna it inherits all the capabilities Nx comes with. That not only just includes local caching, but also the possibility of having **remote caching** and **distributed task execution**.
Remote caching allows you to distribute your local cache with your co-workers and your CI system. This is done via [Nx Cloud](/nx-cloud). But distributed caching is just one aspect. Nx Cloud also comes with a “run view” that visualizes your CI run with easy grouping and filtering capabilities, but in particular, it comes with the ability to distribute your tasks dynamically across multiple machines. All by optimizing for the best parallelization and machine utilization.
![](/blog/images/2022-10-12/CtvU5Me27YRidzG1.avif)
All you need to set this up is to run..
```shell
npx nx connect-to-nx-cloud
```
..in your Lerna workspace, which will guide you through a couple of questions and set you up with an [Nx Cloud](/nx-cloud).
Read more [on the docs](https://lerna.js.org/docs/features/cache-tasks#distributed-computation-caching).
## Defining a task pipeline
When running tasks in a monorepo environment, you want to maximize the parallelization, but **still account for potential dependencies among tasks**. For example, assume you have a Remix application that depends on some `shared-ui` library. You want to ensure that `shared-ui` is built before either building or serving the Remix application.
With Lerna v6 you can do so in the `nx.json` file by defining the `targetDefaults`:
```
// nx.json
{
...
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
},
"dev": {
"dependsOn": ["^build"]
}
}
}
```
In this case, whenever you run either `build` or `dev`, Lerna would first run the `build` task on all the dependent packages.
[Read more on our docs](https://lerna.js.org/docs/concepts/task-pipeline-configuration).
## Lerna add-caching command
If you dont have caching or your task pipeline set up just yet, no worries. We wanted to make it as easy as possible by providing a dedicated command:
```shell
npx lerna add-caching
```
This will scan your workspace, find all your `package.json` scripts and then guide you through the **configuration of both, your cacheable operations as well as your task pipeline**.
Heres a quick walkthrough video:
{% youtube src="https://www.youtube.com/watch?v=jaH2BqWo-Pc" /%}
You are obviously always free to create the `nx.json`by hand.
## PNPM support for Lerna
In the past, Lerna didnt properly support PNPM. We fixed this in v6. Now whenever you use Lerna in combination with PNPM, we make sure to detect packages based on the `pnpm-workspace.yaml`, to enforce `useWorkspaces: true` , we update the `pnpm-lock.yaml`
accordingly when using `lerna version` and we also added proper support for the `workspace:` protocol that PNPM uses.
You can now finally use one of the fastest package managers in combination with a new fast Lerna experience. Also, make sure to check [out our docs for all the details](https://lerna.js.org/docs/recipes/using-pnpm-with-lerna).
## Dynamic terminal output
When running tasks in parallel across a large number of projects, it can become quite difficult to follow along in the terminal with what got built and where tasks failed. Thats why the new Lerna version comes with a dynamic terminal output that only shows what is most relevant at a given moment.
![](/blog/images/2022-10-12/8hPYG2wuAMk5hri0.avif)
Note that you would still see all of the output as usual on CI.
## VSCode extension for Lerna workspaces
Lerna now has a [dedicated VSCode extension](https://lerna.js.org/docs/features/editor-integrations) to help you navigate your monorepo. This allows you to run commands directly from the context menu (by right-clicking on a project):
![](/blog/images/2022-10-12/TlHvP1Kd46Vzbfg.avif)
Or visualize a project and its relationships with other projects in the workspace.
![](/blog/images/2022-10-12/ZFhpQX9xS59eZD7Q.avif)
You will also get intelligent autocompletion in configuration files. Heres an example of Nx console providing context-based information when editing the `nx.json` task dependencies.
![](/blog/images/2022-10-12/pMotejmmm1TUsLR2.avif)
## Lerna Repair
Lerna v6 comes with a built-in `lerna repair` command. Running this command will automatically fix your Lerna configuration. For instance, in Lerna v6, there's no need to have `useNx: true` in your `lerna.json` since that will be the new default going forward. Running `lerna repair` fixes this.
![](/blog/images/2022-10-12/SNKZvHYE2CG7jX7A.avif)
This allows you always to have the most up-to-date Lerna setup and it will become even more powerful as we keep adding migrations in the future.
## Lerna and Prettier
Prettier is part of the standard toolchain of every developer nowadays. In Lerna v6 we added a feature to detect whether Prettier is set up in the workspace. If so, we automatically apply it to all files that get updated by running the `lerna version` command. No more follow-up commits just to fix the file formatting!
## Migrating to Lerna v6
Migrating from Lerna v5 to v6 is non-breaking. We increased the major because we changed some defaults and wanted to be cautious about that and communicate it properly.
{% youtube src="https://www.youtube.com/embed/kOD7880DNEE" /%}
Similarly, if youre still on v4 and want to migrate to v6 it should be pretty straightforward and not be breaking in most cases.
Just update the Lerna package version to the latest and then run..
```shell
npx lerna add-caching
```
..to enable and configure caching for your workspace.
## Lerna is using Nx now. Can I keep using my Lerna commands?
Absolutely! One of the key advantages of the new integration of Lerna with Nx is that you can keep using your existing Lerna commands without migrating them to a new syntax. They will now just be a lot faster.
You can read more about that [on our docs](https://lerna.js.org/docs/lerna-and-nx).
## Are you maintaining an OSS repository using Lerna?
If you are an OSS maintainer and you use a Lerna workspace, let us know!
Ping the Lerna team [on Twitter](https://twitter.com/lernajs) or ping [me directly](https://twitter.com/juristr). Wed love to have a look and help with the migration, look at the repository and make sure it is configured in the best optimal way in terms of monorepo setup and features like caching.
That said, as an open-source maintainer you also get unlimited free computation caching with Nx Cloud. So wed love to set you up with that.
## Learn more
- 🧠 [Lerna Docs](https://lerna.js.org/)
- 👩‍💻 [Lerna GitHub](https://github.com/lerna/lerna)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)(join the `#lerna` channel)
- 📹 [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io)
@@ -0,0 +1,43 @@
---
title: 'From Bootstrapped to Venture-Backed: Nx Raises $8.6M'
slug: 'from-bootstrapped-to-venture-backed'
authors: ['Jeff Cross']
cover_image: '/blog/images/2022-11-17/a3eT-mjLsXTiHU5m.png'
tags: [nx]
---
Im excited to let the Nx Community know about our first round of outside financing, led by [Nexus Venture Partners](https://nexusvp.com/) and [A16z](https://a16z.com/), with several amazing angel investors. Weve raised a seed round of $8.6M to scale the growth of open source Nx, [Nx Cloud](/nx-cloud), and [Nx Enterprise](/enterprise). With this new capital, were able to allocate significantly more resources to rapidly evolving our open source and commercial products to help development teams **ship faster at any scale**.
![](/blog/images/2022-11-17/RYpEUOFtvrtdGwKx3RgGLA.avif)
_Just a few of the companies powered by Nx_
When Victor Savkin and I left Google to start this company in December 2016, we saw a big gap between how enterprises were building software and how companies like Google were building software. So in 2017, we released the first version of our developer toolkit, Nx, which focused on enabling monorepo-style development for large software teams. Nx has continued to evolve and grow in adoption since then, at more than 5x year-over-year in npm downloads to now 12M+ monthly downloads! Were proud that the worlds top brands depend on Nx to help their development teams iterate faster on critical products.
![](/blog/images/2022-11-17/WIkl00uLsSt6p6dmQbIA0g.avif)
[Nx Cloud](/nx-cloud) has also seen a significant uptake in adoption, thanks in large part due to the addition of [Distributed Task Execution](/ci/concepts/parallelization-distribution) last year. With the combination of Distributed Task Execution and Distributed Caching, Nx Cloud is having a massive impact on the time it takes to validate and merge pull requests, drastically reducing product time-to-market. There are now more than 100k connected Nx Workspaces on nx.app. With Nx Cloud, Nx and Lerna workspaces can drastically reduce build times by letting Nx Cloud manage task cache distribution, and optimal distribution of tasks across many machines using Nxs deep understanding of project relationships and task timings. Weve determined that Nx and Nx Cloud have [saved over 250 years of compute time](/blog/helping-the-environment-by-saving-two-centuries-of-compute-time) since we started measuring.
![](/blog/images/2022-11-17/ysWZ8fn2K3m3GjCNGRwshw.avif)
Our most significant commercial innovation in the past year has been [Nx Enterprise](/enterprise), which allows companies to deploy Nx Cloud on their own infrastructure. Some of the worlds leading brands are relying on Nx Enterprise to help their developers get products and features to market significantly faster. One repository powered by Nx Enterprise is saving over 40,000 hours per month of compute time thanks to Distributed Caching and Distributed Task Execution, drastically reducing the time it takes to validate and merge pull requests.
![](/blog/images/2022-11-17/zkOkZXDTZiNB6TAk.avif)
_Monorepo.tools, by Nx in collaboration with other monorepo projects_
With Nx and Lerna under our stewardship, we now maintain [more than 75% of leading JavaScript monorepo tooling](https://npmtrends.com/@bazel/typescript-vs-@microsoft/rush-vs-@nrwl/tao-vs-lerna-vs-turbo). Were sharing this space with some other great teams, who are all pushing the state of the art forward. We developed the site [monorepo.tools](https://monorepo.tools/) in collaboration with these teams to spread the monorepo love and help developers decide which tool is right for them.
## Why Outside Funding?
Victor Savkin and I originally decided not to raise funding when starting the company, to give ourselves space to experiment with different business models and find product-market fit. Weve revisited the idea of funding from time to time, but our consulting business has provided more than enough income to sustain the companys growth. It wasnt until Nx Cloud and Nx Enterprise started growing at a much more rapid pace that we decided we could provide a lot more value, more quickly to our community and customers by taking on some partners and capital to help us with our next phase of growth.
We couldnt be more excited to partner with our co-lead investors, [Nexus Venture Partners](https://nexusvp.com/) and [Andreesen Horowitz (a16z)](https://a16z.com/). Both firms have deep expertise in developer tooling and strongly believe in our vision of helping development teams scale. Were excited to have them bring their own unique talents, experience, and resources to help us execute on that vision. Abhishek Sharma from Nexus has tremendous commercial open source experience, and has been excited about Nx for years. A16z is a powerhouse with an extremely talented enterprise infrastructure team led by Martin Casado and Jennifer Li, alongside amazing partners including, Satish Talluri, and Yoko Li. Were also excited to be joined by many angels, including Tom Preston-Werner, Matt Biilmann, and several other notable CEOs, founders and technologists.
![](/blog/images/2022-11-17/37ySQYL9U1xF7ezq.avif)
_Most of the Nx team at Nx Conf in Tempe, AZ, October 2022_
We are only scratching the surface of how we can help teams scale their development, and were drastically increasing our R&D time to move even faster on new innovations in build performance and team scaling. Fortunately, we already have a world-class team of top engineers whove helped us build Nx and Nx Cloud, while also helping our customers succeed with Nx. With this new capital, our engineers are able spend significantly more R&D time building industry-changing products and features, while continuing to work with and learn from our Nx Cloud and Nx Enterprise customers.
Well be sharing more exciting announcements soon, so make sure to follow our journey on [@NxDevTools](https://twitter.com/nxdevtools)!
Jeff Cross
CEO, Nx
@@ -0,0 +1,419 @@
---
title: 'Nx 15.3 — Standalone Projects, Vite, Task Graph and more!'
slug: 'nx-15-3-standalone-projects-vite-task-graph-and-more'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2022-12-06/VXYjjWhOUpNuHFGCoF63OQ.png'
tags: [nx, release]
---
What a massive release! Here are all the news 👇
**Table of Contents**
· [Funding — Nx raises $8.6M](#funding-nx-raises-86m)
· [3 million downloads per week](#3-million-downloads-per-week)
· [New Task Graph Visualization](#new-task-graph-visualization)
· [Standalone Projects](#standalone-projects)
· [Integrated Vite and Vitest support is here!](#integrated-vite-and-vitest-support-is-here)
· [Adopting Nx has never been easier](#adopting-nx-has-never-been-easier)
· [Adding Nx to an Existing Standalone Project](#adding-nx-to-an-existing-standalone-project)
· [Root-level Scripts](#rootlevel-scripts)
· [Simplified Nx run-commands](#simplified-nx-runcommands)
· [Coming up](#coming-up)
· [How to Update Nx](#how-to-update-nx)
Prefer **a video version?**
{% youtube src="https://www.youtube.com/watch?v=KBFQZw5ynFs" /%}
## Funding — Nx raises $8.6M
In case you missed it, we raised $8.6 million a couple of weeks ago. Heres the official blog post from our CEO Jeff: [/blog/from-bootstrapped-to-venture-backed](/blog/from-bootstrapped-to-venture-backed)
It is exciting for us as we can now have more employees focused on pushing Nx and Nx Cloud forward, which will significantly boost development speed!
For most of our workforce, working on Nx and Nx Cloud was only part of their “20% project”. Yet we released terrific features over the last years and have seen tremendous growth with Nx (which brings us to the next section)
## 3 million downloads per week
2022 has been a particularly crazy but successful year for us. And Nxs growth confirms that were on the right track:
- January: Nx crosses 1 million downloads per week
- June: Nx crosses 2 million downloads per week
- November: Nx crosses 3 million downloads per week
On to 4 million!
![](/blog/images/2022-12-06/TxO8bDuJW6pJZ-zy.avif)
## New Task Graph Visualization
{% youtube src="https://www.youtube.com/watch?v=wOE3r4299fs" /%}
One of our most loved features also just got more powerful: the Nx graph!
Nx already visualizes your project graph, mapping the dependencies different projects have on one another through imports and exports in your code. But your tasks also have a graph. Your task can either depend on another target on the same project, lets say you have a `prebuild`
and a `build` target. Whenever you run `build`, you want to run `prebuild` first. Similarly, if your project depends on other projects, you might want to make sure to build them first as well. This is called a [task pipeline](/concepts/task-pipeline-configuration) and can be defined in `nx.json` as follows:
```json5 {% fileName="nx.json" %}
{
...
"targetDefaults": {
"build": {
"dependsOn": ["prebuild", "^build"]
}
}
}
```
This example is pretty straightforward, but such pipelines can become much more involved.
Therefore, let me introduce you the **task graph**. You might already be used to seeing the project graph after running the `nx graph` command. But there's now a dropdown in the corner that enables you to switch to the task graph. Select a target from the "Target Name dropdown" to filter the list of projects to only those with that target. Click on a project to show that target's task graph.
You can add another project as well, showing what the task graph looks like for a command that runs tasks for multiple projects like `nx run-many` or `nx affected`. Click on the `Group by project` checkbox to group related tasks by their project, and click on a task to see what executor it uses.
![](/blog/images/2022-12-06/NZWdLWLIxwzwcfmp.avif)
## Standalone Projects
{% youtube src="https://www.youtube.com/watch?v=qEaVzh-oBBc" /%}
Nx is widely known as [THE developer tool](https://monorepo.tools/) people look at when it comes to implementing monorepos in the frontend space. However, a lot of the unique features that Nx ships (in particular when it comes to implementing [Integrated Monorepos](/deprecated/integrated-vs-package-based)) can be beneficial even outside of the typical monorepo scenario. In particular, Nx plugin features such as code generation, pre-configured build tooling setup, and battle-tested integration with best practices tools (e.g. Cypress, Jest, ESLint, Vite, …).
But one stands out most prominently: the **ability to easily modularize** your codebase.
![](/blog/images/2022-12-06/wBnyRIMm8_K6K9k3.avif)
A lot of our users adopt Nx for precisely this reason. They have a large app and want to break it into smaller pieces while still having the comfort of deploying it as a single one.
In 15.3 we are therefore making **standalone projects** a first-class feature. Suppose you now create a new workspace with `npx create-nx-workspace` alongside the usual monorepo options. In that case, you will now see two more options for scaffolding a standalone React or Angular application (we will add more in the future).
![](/blog/images/2022-12-06/z3UOtkyCIKcL2LNg.avif)
In a standalone project setup, you dont have the typical `apps` and `libs` structure you might be accustomed to if you have been using Nx in the past. Instead, the app lives directly at the root of your workspace. The structure looks similar to the following:
```text
e2e/
src/
cypress.config.ts
project.json
...
src/
app/
main.tsx
...
public/
index.html
project.json
tsconfig.spec.json
tsconfig.app.json
tsconfig.json
vite.config.ts
nx.json
package.json
```
The critical part here is that you can still have multiple nodes. Even in this example, we have the app itself at the root of the workspace and a nested `e2e` project for that application (using Cypress).
To modularize your application, you can add libraries as you would do in a more traditional integrated Nx monorepo setup, but you can now have those alongside your application. Either create them directly at the root-level or group them in one or more root-level folders. In the example below, I have a `features` as well as `utils` folder, both of which can host multiple libraries.
```text
e2e/
...
src/
app/
main.tsx
...
features/
feature1/
feature2/
utils/
...
index.html
...
nx.json
package.json
```
It is really up to you how you want to structure them.
Think of it as a supercharged development tool, providing powerful generators, features like [module boundary rules](/blog/mastering-the-project-boundaries-in-nx) and obviously the ability to run tests, linting, building on individual libraries. Not to forget about Nxs powerful caching ability. And if youre ready for a “real” monorepo because you want to add multiple applications, there will be paths for you to “upgrade” to that structure.
## Integrated Vite and Vitest support is here!
Finally! We talked about it; now it is here! Official Vite and Vitest support for Nx-based integrated monorepos and standalone app projects! That adds the Vite community into the Nx family, and weve been chatting with core members there recently, and we love it!
So before we dive into this: if you are using a package-based monorepo with Nx, you could already use Vite or whatever other technology you want. Nx does just the task scheduling there, running your `package.json` scripts efficiently. Whatever those scripts do "internally" is up to you.
But if you power an integrated setup, youd want more support via a dedicated Nx plugin. And there has already been a [Nx community plugin](/community) created by the folks from [https://nxext.dev/](https://nxext.dev/). Given the high demand for Vite support, we (the Nx core team) started to look into creating and maintaining our own. We reached out to the out [Dominik Piper](https://mobile.twitter.com/dominik_pieper) and [Jordan Hall](https://mobile.twitter.com/JordanHall_dev) from the NxExt team and they were on board from the beginning! We got lots of helpful input, while designing the new Vite plugin. Huge shoutout to them!!
`@nrwl/vite` (just like `@nrwl/webpack`) is a package that can be integrated as part of other packages. Right now, we're prioritizing our React setup. If you generate a new Nx workspace and choose the new "Standalone React app" version, you will get a React application powered by Vite and Vitest.
Similarly, you can add a new Vite-powered React app to an existing Nx workspace using the `vite` bundler option:
```shell
npx nx generate @nrwl/react:application --bundler=vite
```
This new setup gives you an easy jumpstart as it does all the configuration for you:
- React with Vite
- Tests with Vitest
- Making sure it nicely works with TypeScript (both in src and spec files)
Open the applications `project.json` to inspect the setup:
```json
{
"name": "viteapp",
...
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/vite:build",
...
},
"serve": {
"executor": "@nrwl/vite:dev-server",
"defaultConfiguration": "development",
...
},
"test": {
"executor": "@nrwl/vite:test",
"outputs": ["{projectRoot}/coverage"],
"options": {
"passWithNoTests": true
}
},
...
}
}
```
Furthermore, theres a `vite.config.ts` at the project root level, which you can further customize to your needs. It is already pre-configured to seamlessly work in a monorepo scenario and has the Vitest setup. Just run `npx nx serve` or `npx nx build` or `npx nx test` to serve, build or test your standalone React app.
If you are currently using the NxExt based Vite plugin, or even a Webpack based Nx React setup, you can easily transition to the new Vite plugin by just running the following generator:
```shell
npx nx g @nrwl/vite:configuration
```
This will adjust the NxExt Vite plugin configuration to match the one provided by our core team. Check out our docs for more info: [/nx-api/vite/generators/configuration](/nx-api/vite/generators/configuration)
You can also find all the details about the new Vite package on our docs: [/nx-api/vite](/nx-api/vite)
## Adopting Nx has never been easier
Many developers dont necessarily start with a greenfield project, but rather have an existing reality where they want to use Nx. Weve been improving this process of adopting Nx over this year to the point where it has never been easier than now!
Regardless of whether you have
- an existing package-based monorepo setup using NPM/Yarn or PNPM workspaces
- an existing Lerna workspace (for this you probably want to consult the [Lerna docs](https://lerna.js.org/upgrade) for some awesome feature updates)
- a Create-React-App (CRA) application
- a Angular CLI standalone application
- or really any other form of project
You can just run
```shell
npx nx@latest init
```
Running this command will install the `nx` package, and then analyze your existing project structure and correctly identify whether it is a monorepo workspace or some standalone project, whether it's a CRA app or whether you're coming from the Angular CLI. Based on that, you'll get a couple of questions asked and then your workspace gets configured to run it with Nx.
Check out our docs for all the details on
- [adding Nx to an existing monorepo](/recipes/adopting-nx/adding-to-monorepo)
- [adding Nx to any non-monorepo setup](/recipes/adopting-nx/adding-to-existing-project)
- [migrating your CRA project to Nx](/recipes/adopting-nx/adding-to-existing-project)
- [migrating your Angular CLI app to Nx](/recipes/angular/migration/angular)
Oh..youre wondering why you would want to add Nx to an existing non-monorepo project? Then keep reading 👇
## Adding Nx to an Existing Standalone Project
{% youtube src="https://www.youtube.com/watch?v=VmGCZ77ao_I" /%}
Adding Nx to a single application? Why would that be useful? Well, most apps have multilple scripts in their `package.json`, which includes building, testing, linting your app and potentially much more. Nx can cache these! Obviously it is just app-level caching (since you didn't modularize it with libraries), but imagine your CI setup running these:
```shell
npx nx build
npx nx test
npx nx lint
npx nx e2e
```
If your change just modified a couple of “spec files”, then theres no point on running `build` or `e2e` again, but just `test` and potentially `lint`. Nx can restore the results of the other operations from the cache.
To add Nx to an existing standalone project, all you need to run is
```shell
npx nx@latest init
```
This process will ask you a few questions about which operations are cacheable. We optimized it so that you dont necessarily have to use `nx` to run your build, linting or serving your app. You can keep using `npm run build` or `npm start`. This is because Nx wraps your scripts in the `package.json`. Notice how `build` and `lint` are wrapped because they are cacheable operations.
```json
{
...
"scripts": {
"build": "nx exec -- vite build",
"lint": "nx exec -- eslint \"src/**/*.ts*\"",
...
"dev": "vite",
"start": "vite --open",
},
"devDependencies": {
...
"nx": "15.3.0"
}
}
```
Read more on our docs: [/recipes/adopting-nx/adding-to-existing-project](/recipes/adopting-nx/adding-to-existing-project)
## Root-level Scripts
{% youtube src="https://www.youtube.com/watch?v=PRURABLaS8s" /%}
Most of the tasks in a workspace run against a specific project, like building or testing it. Thats why they live in the corresponding `package.json` or `project.json`. But sometimes you have workspace-wide commands which you want to run through the "Nx pipeline" to get the benefits of caching.
Assume you already have a script called `docs` in your root-level `package.json`.
```json5
// package.json
{
name: 'myorg',
scripts: {
docs: 'node ./generateDocsSite.js',
},
}
```
To allow it to be cached and to be run with Nx, all you need to do is add the follow `nx` property to your `package.json`:
```json5
// package.json
{
"name": "myorg",
"scripts": {
"docs": "node ./generateDocsSite.js"
}
"nx": {}
}
```
You can then run it with
```shell
npx nx docs
```
As the next steps you might obviously want to add `docs` to the [cacheable operations](/ci/reference/config) and [fine-tune it's cache inputs](/recipes/running-tasks/configure-inputs).
Read more about it on our docs: [/recipes/running-tasks/root-level-scripts](/recipes/running-tasks/root-level-scripts)
## Simplified Nx run-commands
{% youtube src="https://www.youtube.com/watch?v=iygb-KhAeik" /%}
Nx can automatically detect your scripts in `package.json`. But if you have an integrated setup using Nx plugins, they usually come with a `project.json` . There you have targets like `build`, `test`, `lint` etc.. and they mostly look as follows:
```json5 {% fileName="project.json" %}
{
"name": "demoapp",
...
"targets": {
"build": {
"executor": "@nrwl/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/demoapp"
},
...
},
"serve": {
"executor": "@nrwl/vite:dev-server",
...
},
...
}
}
```
The task itself is handled by an [Nx executor](/extending-nx/recipes/local-executors) that comes with the plugin, in this case `@nrwl/vite:build` to build a Vite project.
To add a custom command, like invoking a node script, Nx has the so-called [“run-commands”](/recipes/running-tasks/run-commands-executor). So far you had to wrap those commands as follows:
```json5 {% fileName="project.json" %}
{
"name": "demoapp",
...
"targets": {
"prebuild": {
"executor": "nx:run-commands",
"options": {
"command": "echo 'hi'"
}
},
"build": {
...
},
...
}
}
```
For simple commands this was a huge overhead, so we simplified it to just this:
```json5 {% fileName="project.json" %}
{
"name": "demoapp",
...
"targets": {
"prebuild": {
"command": "echo 'hi'"
},
"build": {
...
},
...
}
}
```
Simple, isnt it! Obviously the expanded form is still there and also useful for when you need more options, run multiple commands or features such as argument forwarding.
You can read all about it on our docs: [/recipes/running-tasks/run-commands-executor](/recipes/running-tasks/run-commands-executor)
## Coming up
Wow, what a launch! But more features are on the way in the coming weeks that didnt make it for this release. Super excited about these, which most prominently include
- Workspace watching
- Lock-file pruning
- Nx Cloud integration into Nx Console
Follow us [on our socials](https://twitter.com/nxdevtools) and on [Youtube](https://www.youtube.com/@nxdevtools) to make sure to see it when we announce them!
## How to Update Nx
Updating Nx is done with the following command and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -0,0 +1,163 @@
---
title: 'Nx 15.4 — Vite 4 Support, a new Nx Watch Command, and more!'
slug: 'nx-15-4-vite-4-support-a-new-nx-watch-command-and-more'
authors: ['Zack DeRose']
cover_image: '/blog/images/2022-12-22/N4_XxtYFr-V2cF6fPoBO3g.png'
tags: [nx, release]
---
Nx just had a massive release 2 weeks ago with Nx 15.3 — if you missed it be sure to check out [our article](/blog/nx-15-3-standalone-projects-vite-task-graph-and-more) featuring some huge improvements including Vite support, Standalone Angular and React presets, and a Task Graph visualization!
But over the past couple of weeks, weve been able to land quite a few awesome features, so were going back at it again releasing Nx 15.4 today, including:
- [Vite 4.0 Support](#vite-40-support)
- [Nx Watch](#nx-watch)
- [Webpack-less Cypress Support for Our React Standalone preset](#webpackless-cypress-support-for-our-react-standalone-preset)
- [Server-Side Rendering support for Module Federation for both Angular and React Applications](#serverside-rendering-support-for-module-federation-for-both-angular-and-react-applications)
- [Running Multiple Targets in Parallel for Multiple Projects](#running-multiple-targets-in-parallel-for-multiple-projects)
- [Interactive Prompts for Custom Preset](#interactive-prompts-for-custom-preset)
Prefer a **video version**?
{% youtube src="https://www.youtube.com/watch?v=G02THNy3PcE" /%}
## Vite 4.0 Support
Nx 15.4 brings in the latest Vite major version following the Vite 4 release earlier this month.
![](/blog/images/2022-12-22/w-TkOJGLJpif48RN.avif)
As the [Vite launch article](https://vitejs.dev/blog/announcing-vite4.html) mentions, we are investing in the Vite ecosystem, and now officially support a first-party Vite plugin. Nx 15.4 continues this investment with timely support for Vite 4, and were excited to be a part of the Vite ecosystem and a part of bringing more value to our devs through Vite support!
Projects already using our [@nrwl/vite plugin](/nx-api/vite) will be automatically upgraded to Vite 4 when they upgrade to the latest Nx version with the `nx migrate` command, and we've also simplified the configuration required to support Vite.
Weve also spent some effort into making the conversion of existing projects to use Vite simpler, including:
- the ability to choose which targets you want to convert
- enhanced `vite.config.ts` file configuration
- better DX with detailed messages during conversion
- [better documentation around converting using our generator](/nx-api/vite/generators/configuration)
- [adding a guide to our docs for converting manually](/recipes/vite/configure-vite)
You can check out more details about our Vite plugin including how to add Vite and Vitest to your existing Nx workspace by visiting our docs at [nx.dev/nx-api/vite](/nx-api/vite)
## Nx Watch
{% youtube src="https://youtu.be/0eVplUl1zBE" /%}
Nx 15.4 includes a new feature to support file-watching with Nx! Heres how it works:
Syntax:
```shell
nx watch [projects modifier option] -- [command]
```
Example:
```shell
nx watch --all -- nx build $NX_PROJECT_NAME
```
For the projects modifier option:
- you can use `--all` for all projects in the workspace
- or you can filter down to specific projects with the `--projects=[comma separated list of project names]` option that can be used in conjunction with a `--includeDependentProjects` option as well
The `nx watch` command will support the variables `$NX_PROJECT_NAME` and `$NX_CHANGED_FILES`. This feature opens the door for nice developer workflows where we can provide an out-of-the-box mechanism for Nx to run relevant tasks on save, and were excited to see our users get their hands on this feature.
Personally, Im excited to use the following command:
```shell
npx -c 'nx watch all npx nx affected --target=test --files=$NX_FILE_CHANGES'
```
To link in `nx watch` with the `nx affected` command to have a single watch command to run all my affected tests on save as they are affected!
Check out [our docs](/recipes/running-tasks/workspace-watching) for more details.
## Webpack-less Cypress Support for Our React Standalone preset
![](/blog/images/2022-12-22/wF2QV3h_G5ZjBfLK.avif)
_Running e2e with React Standalone Projects_
We added a React Standalone preset in 15.3 to support single react application workspaces with Nx, and in 15.4, weve added back in Cypress for this preset.
With Nx 15.4, a standalone React application will be created with an e2e directory preconfigured and optimized for running Cypress with the command `npx nx e2e e2e` as soon as your initial workspace is generated.
## Server-Side Rendering support for Module Federation for both Angular and React Applications
![](/blog/images/2022-12-22/3pXE3lHOtndkH8jO.avif)
Now you can get the benefits of both Server Side Rendering and Module Federation for your applications, which will improve page loads, Search Engine Optimization, and build times!
Our existing `host` and `remote` Module Federation generators have an added `--ssr` flag that will enable Server-Side Rendering by generating the correct server files.
Weve also added a new executor to allow you to serve the host server locally, along with all remote servers from a single command.
Learn more about this new feature [in our docs](/recipes/react/module-federation-with-ssr)!
## Running Multiple Targets in Parallel for Multiple Projects
{% youtube src="https://www.youtube.com/watch?v=ROTO89i5m_4" /%}
Nx 15.4 includes updates to the `nx run-many` command, allowing you to add multiple whitespace-separated targets, as well as globs in the `projects` option, for example:
```shell
npx nx run-many --target test build lint
```
^ this would run all `test`, `build`, and `lint` targets in your workspace, and you can now filter this down to select projects via globbing:
```shell
npx nx run-many --target test build lint --projects "domain-products-*"
```
^ this will now run all `test`, `build`, and `lint` targets for all projects in your workspace that start with "domain-products-".
## Interactive Prompts for Custom Preset
Last but not least, weve added support for interactive prompts for Custom Presets!
In Nx, [presets](/extending-nx/recipes/create-preset#create-a-custom-plugin-preset) are special code generation scripts that can be used to create a brand new Nx Workspace, using our `create-nx-workspace` command.
![](/blog/images/2022-12-22/d4gI6k61RAEU_XfF.avif)
For instance, I happen to know [Shai Reznik](https://twitter.com/shai_reznik) at [builder.io](https://builder.io/) has been working on a qwik plugin for Nx, and since the [qwik-nx](https://www.npmjs.com/package/qwik-nx) plugin that hes published includes an [Nx generator called “preset”](https://github.com/qwikifiers/qwik-nx/blob/main/packages/qwik-nx/generators.json#L33), I can run the command:
```shell
npx nx create-nx-workspace preset=qwik-nx
```
As we can see, the preset option matches the name of the published npm package.
This custom preset feature has been around for a while, but as of 15.4 weve added support for these custom presets to interactively prompt the user following the initial installation step!
This should open up some powerful functionality for plugin and package authors to parameterize their code generation scripts with Nx, and were excited to see folks like [Shai](https://twitter.com/shai_reznik), [builder.io](https://builder.io/), and [qwik](https://qwik.builder.io/) leverage this new feature!
## Thats it for this release.
Follow us on our socials and on [Youtube](https://www.youtube.com/channel/UCF8luR7ORJTCwSNA9yZksCw) to make sure to see more news and releases as we announce them!
You can find [full changelogs for the release](https://github.com/nrwl/nx/releases/tag/15.4.0) on github.
## How to Update Nx
Updating Nx is done with the following command and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Learn more
- [🧠 Nx Docs](/getting-started/intro)
- [👩‍💻 Nx GitHub](https://github.com/nrwl/nx)
- [💬 Nx Official Discord Server](https://go.nx.dev/community)
- [📹 Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -0,0 +1,127 @@
---
title: 'Setting up Module Federation with Server-Side Rendering for Angular'
slug: 'setting-up-module-federation-with-server-side-rendering-for-angular'
authors: ['Colum Ferry']
cover_image: '/blog/images/2023-01-10/kyMChnJ-X6jK9sbuaOdOiw.png'
tags: [nx, tutorial]
---
[Module Federation](https://webpack.js.org/plugins/module-federation-plugin/) is a technology provided by [Webpack](https://webpack.js.org/) that enables modules to be federated across different origins at runtime. This means that Webpack will simply ignore these modules at build time, expecting them to be available to be fetched across the network at runtime.
This technology has enabled a much cleaner approach to Micro Frontend Architecture but also is employable as a strategy to implement incremental builds for large applications, reducing overall build times. This can lead to faster feedback cycles and less money spent on CI workflows.
Nx offers great out-of-the-box support and developer experience for Module Federation for Angular and React. You can learn more about it from the resources below:
📄 [Module Federation Recipes on Nx](/recipes/module-federation)
📺 [Speed up your Angular serve and build times with Module Federation and Nx](https://www.youtube.com/watch?v=JkcaGzhRjkc)
However, until now, it has only supported Client-Side Rendering (CSR). Essentially it worked only for Single Page Applications (SPAs). While this is still valuable, it is becoming ever more apparent that Server-Side Rendering (SSR) is becoming the de-facto standard for building web applications, due to the multitude of benefits it provides.
> [What is server-side rendering: definition, benefits and risks](https://solutionshub.epam.com/blog/post/what-is-server-side-rendering)
Since [version 15.4](/blog/nx-15-4-vite-4-support-a-new-nx-watch-command-and-more), Nx now offers Module Federation with support for SSR! 🎉
Now we can get both, the benefits of Module Federation and SSR in our Nx Workspaces!
## How it works
A traditional SSR application is rendered on the server. It receives the requested route from the browser, Angular evaluates that route, and the server generates the HTML and sends it back to the browser.
![](/blog/images/2023-01-10/ZqG4jdD8DaqmG_It.avif)
With Module Federation and SSR, it takes that concept and the concept of MF to allow portions of the app to be run on their own server. The host server will receive the route and if its a route pointing to a remote, it will ask the remote to process the route, then send the rendered HTML to the browser.
![](/blog/images/2023-01-10/eQis_bQnsj-MToCa.avif)
This gives us full power of SSR but also still allowing us to break our build into multiple smaller builds. It also means that we _could_ redeploy the remote server with new changes without having to redeploy the host server, allowing for independent deployability of features within the overall application.
## Example
Lets walk through how to set this up with Nx for Angular. We will generate a host application (dashboard) and a remote application (login).
```shell
npx create-nx-workspace@latest myorg
```
Youll be prompted for the type of workspace you want to create, and the preset to use.
Answer with the following:
✔ Choose what to create · integrated
✔ What to create in the new workspace · apps
✔ Enable distributed caching to make your CI faster · No
> _You will also be prompted whether to add Nx Cloud to your workspace. We wont address this in this article, but it is highly recommended to use this along with Module Federation to allow for the cache of your remote applications to be shared amongst teammates and CI, further improving your build times. You can learn more about Nx Cloud here:_ [_https://nx.app_](https://nx.app/)_._
When your workspace is created, run `cd myorg`.
Next, we will need to install the [Official Nx Angular Plugin](/nx-api/angular):
```
npm install @nrwl/angular
```
Once this is installed, we only need one command to scaffold out our full Module Federation with SSR architecture:
```shell
npx nx g host dashboard --remotes=login --ssr
```
We will see in the terminal that this generates a bunch of files. What it actually creates is:
Two applications with Angular Universal (SSR)
Webpack Configuration for Browser and Server with Module Federation
We can serve our dashboard (host) application, along with our login (remote) application, by simply running the command:
```shell
npx nx serve-ssr dashboard
```
This will build the browser and server bundles of our login application, then run the login using node.
The login application will be run without any file watchers, meaning that if you make a change to the code for the login application, it will not be reflected automatically. More on this later.
> Note: Nx will cache the build of the browser and server bundles for the login application. If you were to run the command again, it would simply use the cache rather than actually rebuilding the application! 🔥.
Once this is complete, it will then build and run the server for the dashboard application, _with_ file watchers, allowing it to pick up changes to the code.
You should see a success message like this in the terminal:
```
Compiled successfully.
\*\* Angular Universal Live Development Server is listening on http://localhost:4200, open your browser on http://localhost:4200 \*\*
```
Lets open a new tab in our browser, and open Network tab in the DevTools. After this, navigate to [http://localhost:4200](http://localhost:4200/). You should see the following:
![](/blog/images/2023-01-10/3irxzNENB79JiQmR.avif)
The most interesting piece here is the first entry in the network log. Lets look at it more closely:
![](/blog/images/2023-01-10/Ikvgk8dF8rKmutTY.avif)
We can see that the server returned the fully rendered HTML for the page!
Angular Universal will switch to CSR after the initial page load, which means if we were to click on the `login` link, it would use CSR to render that page. The Angular Module that is resolved and rendered still lives on the remote server, but Module Federation will still resolve this correctly! 🔥
But to see where the real magic happens, lets manually navigate the browser to [http://localhost:4200/login](http://localhost:4200/login). You should see that in the Network tab, the fully rendered HTML for the login page has been returned!
Despite the code for that page living on a different, remote, server, the host server composed it correctly and was still able to return the correct HTML for that route, thanks to Module Federation!
And thats it! Its super simple to get Module Federation and SSR up and running with Nx!
## Serving the login application and watching for changes
If youre working on the login application, and are iteratively checking the results of your changes, youll want the server to rebuild when you make your change. You can easily enable that by using the `devRemotes` flag::
```shell
npx nx serve-ssr dashboard --devRemotes=login
```
## Learn More
🧠 [Nx Docs](/getting-started/intro)
👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
💬 [Nx Official Discord Server](https://go.nx.dev/community)
📹 [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools)
🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
🧐 [Need help with Angular, React, Monorepos, Lerna or Nx? Talk to us 😃](https://nx.app/enterprise)
@@ -0,0 +1,535 @@
---
title: 'React, Vite and TypeScript: Get started in under 2 minutes'
slug: 'react-vite-and-typescript-get-started-in-under-2-minutes'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-01-12/ucL7YQ2v8aaOy426soLPZA.png'
tags: [nx]
---
Lets be honest. Dealing with tooling is not something enjoyable if you have to deliver code. It should just work and not be in the way. So lets explore how to kickstart your next React project using Vite, in under 2 minutes, without worrying about the setup.
## Table of Contents
· [How do I create a new project setup?](#how-do-i-create-a-new-project-setup)
· [Running, building and testing the app](#running-building-and-testing-the-app)
· [Building the app](#building-the-app)
· [Testing the app](#testing-the-app)
· [Running integration tests with Cypress](#running-integration-tests-with-cypress)
· [Linting](#linting)
· [Customize Vite and Vitest](#customize-vite-and-vitest)
· [Hidden gem: Caching](#hidden-gem-caching)
· [Hidden gem: Easily modularize your app](#hidden-gem-easily-modularize-your-app)
· [Hidden gem: Visualize your architecture](#hidden-gem-visualize-your-architecture)
· [Hidden gem: Guard your boundaries](#hidden-gem-guard-your-boundaries)
· [Hidden gem: Just run what changed](#hidden-gem-just-run-what-changed)
· [Hidden gem: A dedicated Editor extension](#hidden-gem-a-dedicated-editor-extension)
· [Hidden gem: Automated Upgrades](#hidden-gem-automated-upgrades)
· [Using CRA? Automatically migrate to Vite + Nx](#using-cra-automatically-migrate-to-vite-nx)
· [Conclusion](#conclusion)
{% youtube src="https://youtu.be/fkTz6KJxhhE" /%}
Traditionally, you might lean towards [Create-React-App (CRA)](https://create-react-app.dev/) started to do precisely that. But what if I told you theres a better alternative, providing
- not just scaffolding for the initial setup but helping you along the way to generate components, routing, etc
- automatically sets you up with best practices tools for e2e testing, unit testing, code formatting, and linting
- has built-in support for Vite and Vitest (alternatively Webpack & Jest)
- caches your scripts to speed up things
- helps you modularize your application
- comes with automated upgrade features to keep your tooling evergreen
Im talking about Nx. Nx comes with a set of plugins that come with code generation abilities and help abstract some of the lower-level tooling setups. And this can be really interesting for the use case we wanna tackle today.
> **_Reader:_** _“Wait a minute, I heard about Nx. Isnt that for monorepos?”_**_Me:_** _“Yeah youre right. But in 15.3 they introduced something called standalone apps’”
> Reader: “Standalone?”
> _**_Me:_** _“Yeah, a fancy term for a setting up a single app and allows for some cool modularization. Theres a video introducing that feature here:_ [_https://youtu.be/qEaVzh-oBBc_](https://youtu.be/qEaVzh-oBBc)_"
> _**_Reader:_** _“ha, interesting 🤔”_
So lets go and set up our **React + Vite + TypeScript project**.
## How do I create a new project setup?
To set up a new project, just invoke the following command:
```shell
npx create-nx-workspace@latest awesomereactapp --preset=react-standalone
```
Note `awesomereactapp` is the name of the app and folder being created, and `--preset=react-standalone` tells Nx which template to use when scaffolding the initial setup. You can also invoke it like:
```shell
npx create-nx-workspace@latest awesomereactapp
```
And then choose the option you prefer in the terminal prompt:
![](/blog/images/2023-01-12/WceoJTEWec2ZTp5X.avif)
In the end, what youll get is the following structure:
![](/blog/images/2023-01-12/mykjIRKX-a5VtyQl.avif)
## Running, building and testing the app
First off, lets run our new, shiny application. Just invoke
```
npm start
```
And in a matter of milliseconds, your app should be served at [http://localhost:4200/](http://localhost:4200/).
`npm start` just invokes the script defined in the `package.json`:
```json {% fileName="package.json" %}
{
"name": "awesomereactapp",
...
"scripts": {
"start": "nx serve",
"build": "nx build",
"test": "nx test"
}
...
}
```
Internally this delegates to `nx serve`, where `serve` is the [Nx target](/reference/glossary#target) to be invoked. You can find those in the `project.json`:
```json {% fileName="project.json" %}
{
"name": "awesomereactapp",
"$schema": "node_modules/nx/schemas/project-schema.json",
"sourceRoot": "./src",
"projectType": "application",
"targets": {
"build": {...},
"serve": {
"executor": "@nrwl/vite:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "awesomereactapp:build"
},
"configurations": {
"development": {
"buildTarget": "awesomereactapp:build:development",
"hmr": true
},
"production": {
"buildTarget": "awesomereactapp:build:production",
"hmr": false
}
}
},
"test": {...},
"lint": {...}
},
"tags": []
}
```
This is where you can see all the targets available for a given project, and you can [add your own](https://youtu.be/iygb-KhAeik)! In a Nutshell, an Nx target contains
- `executor` - a function (here `dev-server`) exposed by the plugin (here `@nrwl/vite`) to run the task at hand. Think of it as the wrapper of your usual Npm scripts
- `options` - this is where you can pass options to the `executor`
- `configurations` - allows you to create different versions of the `options` . You control which configuration is used by passing it via the `--configuration=production` flag to your commands. Also, note the `defaultConfiguration`.
You can go more in-depth if you want on the [Nx docs](/concepts/executors-and-configurations).
## Building the app
Just in the same way as serving our web app, we can build it with
```shell
npx nx build
```
This places an output into a `dist` folder. Now that we've seen the `project.json` targets, you probably guessed that you could customize that output folder directly in those settings.
## Testing the app
This setup also comes with testing baked in using [Vitest](https://vitest.dev/). And you probably guessed it, you can just run tests as follows:
```shell
npx nx test
```
## Running integration tests with Cypress
You might have noticed the `e2e` folder. That's a fully-functioning setup of [Cypress](https://cypress.io/) for doing integration-level or even full end-to-end tests.
This is excellent because you dont have to configure anything at all. No need to
- Cypress configured to use Vite (instead of Webpack)
- set up linting for the e2e project (yes writing good quality test code is just as important)
- spinning up our development server manually first that serves our React app such that we can load it in our Cypress tests environment
All we need to do is to use
```shell
npx nx e2e e2e
```
This might look weird initially, but basically, we run the `e2e` target (see `e2e/project.json`) on the `e2e` project.
```json {% fileName="e2e/project.json"" %}
{
"name": "e2e",
"$schema": "../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "e2e/cypress.config.ts",
"devServerTarget": "awesomereactapp:serve:development",
"testingType": "e2e"
},
"configurations": {
"production": {
"devServerTarget": "awesomereactapp:serve:production"
}
}
},
...
}
}
```
By default, these tests run in headless mode, but you can pass `--watch` to run it interactively with the Cypress test runner such that the tests get re-executed whenever we change our source.
> _Want Cypress Component testing? Theres an Nx generator that can help set that up. Check out the docs:_ [_/nx-api/react/generators/cypress-component-configuration_](/nx-api/react/generators/cypress-component-configuration)
## Linting
And similarly, linting can be triggered by running the following command:
```shell
npx nx lint
```
Theres a `.eslintrc.json` file already at the workspace's root that contains some best practices rules.
## Customize Vite and Vitest
The project setup is made in a way that you can easily customize your [Vite](https://vitejs.dev/) and [Vitest](https://vitest.dev/) setup. Just open the pre-generated `vite.config.ts` at the root of your workspace and add custom Vite plugins or fine-tune Vitest.
```typescript
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsConfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
server: {
port: 4200,
host: 'localhost',
},
plugins: [
react(),
viteTsConfigPaths({
root: './',
}),
],
// vitest config
test: {
globals: true,
cache: {
dir: './node_modules/.vitest',
},
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
},
});
```
## Hidden gem: Caching
Nx is known for its caching that helps optimize the speed in monorepos. Caching takes the inputs (the command, source files, environment variables…) and computes a hash.
![](/blog/images/2023-01-12/Af7lMrhaO0gcIUeY.avif)
On every run, Nx compares that hash against a local cache folder. If the hash exists, Nx restores the command line output and potential artifacts (JS, CSS,… files) produced by a previous run. This helps speed up computation because you dont run it if you dont need to.
> _See Nx the docs for more info:_ [_/concepts/how-caching-works_](/concepts/how-caching-works)
While this obviously makes a lot of sense in a monorepo, it can also help **speed up single-project workspaces**. Most projects have multiple targets, such as `build`, `test`, `lint`. These can be cached! Imagine you have a PR where you change some `*.spec.ts` files because you add a test or fix some. Your CI script probably runs all the targets (`build`, `test`, `lint`) all the time. And it should totally do that. But you could avoid the `build` step because your spec file should not influence that outcome. As such, it could be restored from the cache. `test` needs to run and potentially also `lint` if you run linting also for spec files.
You can fine-tune what goes into the cache for each command. [More on the Nx docs](/recipes/running-tasks/configure-inputs)
## Hidden gem: Easily modularize your app
Imagine a storefront application. You will probably have domain areas like
- Product list — which would have facilities for listing all currently available products, their ratings, user reviews etc
- Orders — for viewing your currently open orders as a user or browsing past orders. Things like placing a new order or triggering a refund on a previously acquired product
- Payments — for handling the payment flow, asking for the credit card, triggering the payment, and starting the order placement process once the payment is successful
- Authentication — which handles the whole signup/login flow and provides lower-level utilities for other domain areas in the app, like getting access to the current user.
- User Profile — which manages everything user related. Think of it when you access Amazon and go to your account. Things like managing your addresses
- …
Were just scratching the surface here. This can become big quickly. The only way to manage such a structure with the current tooling (including CRA) is to organize these domains in folders. So youd have something like this in a CRA setup:
```
cra-app
├─ public/
├─ src/
│ ├─ authentication/
│ │ ├─ current-user/
│ │ │ ├─ ...
│ │ │ └─ index.ts
│ │ ├─ login/
│ │ └─ signup/
│ ├─ orders/
│ │ ├─ checkout/
│ │ ├─ place-order/
│ │ ├─ refund/
│ │ └─ order-list/
│ ├─ payments/
│ ├─ products/
│ ├─ user-profile/
│ │ ├─ addresses/
│ │ └─ credit-cards/
│ ├─ App.css
│ ├─ App.tsx
│ ...
├─ package-lock.json
├─ package.json
└─ README.md
```
Most devtools (including CRA) force you into a monolithic structure, where you divide your features into folders. Folders are limited in terms of isolation, though; as your application grows, this might quickly go out of hand.
We can impose a different, stronger structure with Nx by extracting these areas into dedicated libraries or modules. These live side-by-side with your application. Lets say we have a folder named “domains” which contains these domain areas. Then you can easily generate a new library with the following command:
```shell
npx nx g @nrwl/react:lib checkout --directory=domains/orders/checkout --bundler=none
```
The above command creates a new “ checkout “ library in the `domains/orders/` folder. Here's what it looks like:
```
awesomereactapp
├─ public
│ └─ favicon.ico
├─ src
│ ├─ app
│ ├─ ...
├─ domains
│ └─ orders
│ └─ checkout
│ ├─ src
│ │ ├─ index.ts
│ │ └─ lib
│ │ ├─ domains-orders-checkout.module.css
│ │ ├─ domains-orders-checkout.spec.tsx
│ │ └─ domains-orders-checkout.tsx
│ ├─ tsconfig.json
│ ├─ tsconfig.lib.json
│ ├─ tsconfig.spec.json
│ └─ vite.config.ts
├─ ...
├─ index.html
├─ package-lock.json
├─ package.json
├─ ...
├─ tsconfig.app.json
├─ tsconfig.base.json
├─ tsconfig.json
├─ tsconfig.spec.json
└─ vite.config.ts
```
Notice the `domains/orders/checkout/src/index.ts`: this is the public API of the `checkout` library where you can decide what to export and what should remain private within the library. This conscious process of selecting what to expose and what not leads to a much stronger encapsulation than just a folder structure. It also greatly helps with the maintainability aspect as your app grows.
When generating the library, a TypeScript path mapping is automatically created in the root-level `tsconfig.base.json`:
```json
{
"compileOnSave": false,
"compilerOptions": {
...
"paths": {
"@awesomereactapp/domains/orders/checkout": [
"domains/orders/checkout/src/index.ts"
]
}
},
"exclude": ["node_modules", "tmp"]
}
```
In this way, anything thats being exported from the `checkout` library can be consumed like
```typescript
import { SomeComponent } from '@awesomereactapp/domains/orders/checkout';
```
You can also just run linting or testing in isolation for these new libraries:
```shell
npx nx test domains-orders-checkout
```
And obviously, caching (as seen previously) would work on these new libraries as well.
> _Note,_ `_domains-orders-checkout_` _is the unique name of the project, composed by its file structure. You can change the name in the_ `_domains/orders/checkout/project.json_` _if you'd like._
## Hidden gem: Visualize your architecture
Another side-effect of splitting up your codebase into libraries is that your code structure and architecture emerge and becomes visible. Nx comes with a `graph` command built-in, so you can even visualize it:
```shell
npx nx graph
```
![](/blog/images/2023-01-12/lQqPKUstJg1JHD-f.avif)
It becomes even more interesting if you select the “Group by folder” checkbox as the domains become visible at that point:
![](/blog/images/2023-01-12/5s3J449vgsfYVLkL.avif)
> _Note this is a hypothetical app to demo some of the features of the Nx graph visualization. Some of the connections might only make a little sense._
## Hidden gem: Guard your boundaries
Scaling a software product is more than just the initial structuring and modularization. It consists of a constant ongoing process of ensuring modules stay in shape and dont contain any undesired cross-references or circular dependencies. You could leverage the Nx graph to verify that visually, but that doesnt scale.
To help with that, Nx has a built-in [module boundary lint rule](/features/enforce-module-boundaries). Projects can be assigned “tags”, like `type:domain`, `type:utils`, `type:shared` and `domain:products`, `domain:orders`, `domain:auth`. These tags can be assigned in the `project.json`, like
```json
{
// ... more project configuration here
"tags": ["domain:products", "type:domain"]
}
```
> _Note that_ `_type:domain_` _or_ `_domain:products_` _are really just strings. You can define them however you want._
In the `.eslintrc.base.json` you can then define the rules. Here for instance we're stating that a library of `type:utils` can only depend on other utility libraries, while a `type:domain` can depend on both, other domain libraries as well as utility libraries.
```json {% fileName=".eslintrc.base.json" %}
{
"overrides": [
{
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"depConstraints": [
{
"sourceTag": "type:utils",
"onlyDependOnLibsWithTags": ["type:utils"]
},
{
"sourceTag": "type:domain",
"onlyDependOnLibsWithTags": ["type: domain", "type:utils"]
},
{
"sourceTag": "domain:products",
"onlyDependOnLibsWithTags": ["domain:products", "domain:orders"]
}
]
}
]
}
}
]
}
```
If some of these lint rules need to be followed, your editor will show it right in your code, and you can also run lint checks for each PR on CI.
If youre curious, you can read more [here](/blog/mastering-the-project-boundaries-in-nx).
## Hidden gem: Just run what changed
In such a modular structure (as shown above) where your code is organized in smaller modules/libraries, it is very common that a given team member just works within a single domain area. Hence, very often PRs just touch a subset of the entire set of libraries. Nx comes with a backed-in command that allows you to take advantage of that on CI, using the so-called “[affected commands](/ci/features/affected)”.
Lets say we make a change in the `product-detail` library of our application. This would affect all other libraries that depend on it. You can also visualize it by running
```shell
npx nx affected:graph
```
![](/blog/images/2023-01-12/W_ttiuzGHhjnUC2I.avif)
To run tasks only for the affected areas, use:
```shell
npx nx affected:<target>
```
To make a concrete example, running just tests for those projects:
```shell
npx nx affected:test
```
## Hidden gem: A dedicated Editor extension
If you are not the “command line interface type” developer and youd rather prefer something integrated within your IDE, then theres good news. The Nx core team also ships a dedicated VSCode extension: [Nx Console](/getting-started/editor-setup).
It has a dedicated view within VSCode to trigger common commands, browse the workspace structure and even inline render the graph.
![](/blog/images/2023-01-12/ekMC03F1rFd_acmu.avif)
It also comes with contextual menus to quickly access most of the commonly used functionality:
![](/blog/images/2023-01-12/0wOJ7DPKcNV25D-V.avif)
Heres a walkthrough video showing some of the powerful capabilities of Nx Console:
{% youtube src="https://youtu.be/ZST_rmhzRXI" /%}
## Hidden gem: Automated Upgrades
To keep workspaces evergreen, Nx comes with automated code migrations that
- upgrade your `package.json` packages to the next version
- can automatically update your configuration files if necessary
- can automatically update your source files if necessary (in case of breaking changes in the API)
This allows for smooth transitions even if there are breaking changes. Just run
```shell
npx nx migrate latest
```
Nx gathers the currently installed packages and updates them to the latest version. If a package comes with Nx migration scripts, Nx collects them in a `migrations.json` file. You can inspect and then run them. This dramatically helps to keep your project tooling up to date.
Read more about how [Nx migrations work](/features/automate-updating-dependencies) on the docs.
## Using CRA? Automatically migrate to Vite + Nx
If youre currently on a [CRA](https://create-react-app.dev/) setup, you can easily migrate to an Nx + React + Vite-based setup by running the following command in your CRA project:
{% youtube src="https://youtu.be/zvYb7XCLQzU" /%}
```shell
npx nx init
```
Read more on the Nx docs: [/recipes/adopting-nx/adding-to-existing-project](/recipes/adopting-nx/adding-to-existing-project)
> _If for some reason you cannot migrate to Vite just yet, you can pass_ `_--vite=false_` _to keep a Webpack-based setup for now._
## Conclusion
Ready? Give it a try:
```shell
npx create-nx-workspace mycoolapp --preset=react-standalone
```
And let us know what you think :)
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
- 🧐 [Need help with Angular, React, Monorepos, Lerna or Nx? Talk to us 😃](/enterprise)
@@ -0,0 +1,116 @@
---
title: 'Nx Console meets Nx Cloud'
slug: 'nx-console-meets-nx-cloud'
authors: ['Max Kless']
cover_image: '/blog/images/2023-01-18/Mkqkadhkk7DydWvPg5L0bA.png'
tags: [nx]
---
We just released Nx Console 17.28.0 and it comes with a huge new feature: Nx Cloud Integration, right in VSCode! 🎉
In case youre not sure what it does, Nx Cloud takes your Nx workspace to the next level with awesome features like:
- **Remote Caching** — share your Nx cache with your coworkers and CI agents. By using Nx Cloud, you can be sure that no computation is done twice — throughout your company.
- **Distributed Task Execution** — the most important feature for truly scaling up repositories. Nx already knows about your project graph and what tasks depend on each other. With Nx Cloud, you can leverage this knowledge to distribute tasks smartly across multiple agents while making sure that everything is run in the correct sequence. This can speed up your CI times by orders of magnitude!
- **VCS \[version control system\]** **Integration** — see the results of your CI runs right on your pull request! Nx Cloud can talk to GitHub and other version control systems in real-time, giving you an overview of successes and failures as they happen.
And the best part? Its free! You wont pay anything for the first 500 hours of computation time saved per month. If you exceed 500 hours of computation saved, you can buy more; in the worst case, caching stops until the next month. For open-source projects, its free even beyond that. 😍
Head over to [http://nx.dev/nx-cloud](/nx-cloud) to learn more.
**Prefer a video walkthrough? Here we go**
{% youtube src="https://www.youtube.com/watch?v=WfWmK1x52HE" /%}
## Show me the new features already!
Now that were caught up, lets look at how Nx Console will make connecting to and working with Nx Cloud even easier.
To follow along, ensure you have installed the latest Nx Console version:
[Nx Console — Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)
In the Nx sidebar, you will see a new Nx Cloud section.
![](/blog/images/2023-01-18/JHNQd88EKmPVfnWBRqSidQ.avif)
If your workspace is not using Nx Cloud, click the “Set up Nx Cloud” button to set up the cloud runner automatically.
You will see that some changes happen in your `nx.json`:
```
"default": {
- "runner": "nx/tasks-runners/default",
+ "runner": "@nrwl/nx-cloud",
"options": {
+ "accessToken": "NDM2MmU2YmUtNDFl…ifHJlYWQtd3JpdGU=",
"cacheableOperations": [
"build",
"lint",
"test",
"e2e"
],
}
}
```
**Thats it. You can now use Remote Caching and Distributed Task Execution (DTE). 🎉**
## Running your first task
Lets try it out! Select a task to run and see the results in the run list. You can get an even more detailed breakdown in the Nx Cloud web app.
![](/blog/images/2023-01-18/hFG4lqGwEYV3imSFATeKog.avif)
If you rerun the same task, you can see that the time it took to complete is under a second. This is because of Nxs [advanced computation caching](/features/cache-task-results). Whenever a task is executed, Nx caches it. If the task has been run before, it just restores the result from the cache. By default, this cache is local to your own workstation. However, with Nx Cloud, you can distribute and share it between machines.
![](/blog/images/2023-01-18/kMKh30ojVJC-hSkZA5c46A.avif)
To see it in action, push your newly created access token and have a coworker (or CI pipeline) run a task on their machine. If you execute that same task again, it will be pulled from the cache just like it did locally! 🔮
![](/blog/images/2023-01-18/DkuIHQ6engBhAyhN1TTUGQ.avif)
To learn more about Nx Cloud access tokens, head over to the docs: [Access Tokens Documentation](/ci/recipes/security/access-tokens).
## Claiming your workspace
If youve just started using Nx Cloud, you will probably see this message prompting you to claim your workspace:
![](/blog/images/2023-01-18/vNRM1u3J5dixcXjoJWkHLQ.avif)
Out of the box, Nx Cloud works without the need to register. It is, however, highly recommended to create an account and associate it with your workspace. This process is called _claiming your workspace_ and has become much easier with Nx Console! After claiming, you can take full control of your cloud workspace, manage access restrictions and other settings.
Just click on Login and claim your workspace to be redirected to the browser where you can sign in to Nx Cloud or create an account. After successful authentication, you will come back to VSCode, where you can select one of your organizations and connect your workspace to it.
From now on, Nx Console will be able to make authenticated requests to the cloud API, so even if you choose to make your workspace private, logged-in users that are authorized to access it can do so.
## Distributed Task Execution
Distributed Task Execution (DTE) becomes very important as your workspace grows. With Nx, powerful features like [computation caching](http://√) and [affected analysis](/ci/features/affected) help you drastically cut down your CI times. Most of the time, large parts of your codebase will not need to be rebuilt and retested. However, we also have to consider the worst-case-scenarios. Lets say you do change a core lib that everything in your monorepo depends on. This could mean hundreds or even thousands of projects needing to be rebuilt and retested, which would mean hours of CI time. This is obviously very impractical and you should consider solutions that allow you to parallelize all this work and keep worst-case CI times at a reasonable level. [There are different approaches to achieving this](/ci/concepts/parallelization-distribution) but its hard to get right and not something most teams want to spend engineering resources on.
![](/blog/images/2023-01-18/EZhpRG2t-vp8Y7pGNnuRpA.avif)
Distributed Task Execution with Nx Cloud solves this issue — it allows you to optimally parallelize tasks without thinking about their interdependencies or agent management. You dont have to use it immediately, but its useful if you want to keep your CI times low even as your workspace grows. 🚀
DTE is available for all Nx Cloud workspaces with minimal setup. If you see a yellow DTE status in Nx Console, that just means you havent used it yet. [Check out the docs](/ci/features/distribute-task-execution) to [learn more about the motivation for DTE](/ci/concepts/parallelization-distribution) and [how to test it out in your workspace](/ci/features/distribute-task-execution).
![](/blog/images/2023-01-18/T-GAMsmUCVVeO2ZCGuO3WA.avif)
## VCS Integration
Nx Cloud isnt just great for its remote caching and DTE features, it also generates readable and searchable reports for any executed tasks — whether it be 10 or 10.000. In a monorepo, your CI pipelines will seldom run just a single task. Its more common to have commands like `nx affected — -target=build` which amounts to “rebuild everything that changed”. This could potentially be dozens, hundreds or thousands of tasks. If something goes wrong, combing through thousands upon thousands of lines of logs quickly becomes tedious. So having a nicely structured, per-target view that you can filter and sort while still preserving all terminal styling is incredibly useful!
![](/blog/images/2023-01-18/i-eyF1ED2_mBkB1A_4piqg.avif)
To take advantage of this valuable information without changing your development workflow, use the Nx Cloud integration for your favourite platform: Github, GitLab or Bitbucket Cloud. You can see the results of your cloud runs in a PR comment with an overview of failed tasks and links to easily readable outputs. No more scrolling through endless logs until you find what you need!
![](/blog/images/2023-01-18/UPAL-352xTPsm-Pf_7sROw.avif)
To set it up, just click on the button in the Nx Console cloud view and follow the prompts in your browser. Read more in the [full guide on connecting your workspace to](/ci/recipes/set-up/monorepo-ci-github-actions) VCS.
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 🎮 [Nx Console GitHub](https://github.com/nrwl/nx-console)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -0,0 +1,74 @@
---
title: 'Configuration Files and Potholes in Your Codebase'
slug: 'configuration-files-and-potholes-in-your-codebase'
authors: ['Isaac Mann']
cover_image: '/blog/images/2023-01-31/T-xiDccBOxMQpDrG.png'
tags: [nx]
---
Lets talk about configuration. The detractors call it boilerplate while proponents call it scaffolding or infrastructure. No matter what your feelings are, configuration code is all the setup that needs to be done before you can work on the features that actually accomplish something for your business. Like road maintenance, infrastructure code is often unnoticed when it is done well, but as soon as problems crop up, everyone feels the pain. How can this crucial configuration code be effectively maintained without dragging down the productivity of your development team?
## Less Configuration
There have been many attempts over the years to make it easier to bypass configuration code.
![](/blog/images/2023-01-31/RHP5AYxe6DD7UaYx.avif)
Ruby on Rails popularized the philosophy of Convention over Configuration. In this philosophy, the default configuration settings are derived from your folder structure or the way you name your files. These unwritten conventions are used as a way of bypassing writing configuration files that most of the time will follow a set pattern.
![](/blog/images/2023-01-31/y-gFItbtvrFYx9_3.avif)
Parcel advertises itself as a zero configuration bundler. This is mostly a reaction to webpack, which requires a fairly complex config file before it can do anything useful. As application grow more complex, so does the config file. These often become so complicated that developers dread fixing any problems with them, because once it becomes known that they have fixed a problem with webpack, they will be forever saddled with the burden of maintaining that file. In contrast, Parcel does all the tasks required of a typical SPA web app without any config file.
![](/blog/images/2023-01-31/sWVhhyftTBiuMef.avif)
Apple also leveraged this sentiment with marketing slogan “It Just Works”. Compared to Windows or Linux ecosystems that require modifying settings to get software from different companies to work together, Apple provides its own suite of tools and hardware that have a major selling point of being intentionally designed to all work together. Theoretically, any hardware or software produced by Apple should fit seamlessly into the rest of the system.
All of these efforts to skip the configuration step reach their limits at some point. The idea of hiding default configuration works well, until you need to modify that default and have no starting point. The Zen of Python philosophy of “explicit is better than implicit” is a direct contradiction to Convention over Configuration. If you like most of what the zero config tool gives you, but you want to tweak it a little bit, it can be hard to find where to do the tweaking. Apple is great when It Just Works. But sometimes, It Just Doesnt.
![](/blog/images/2023-01-31/8f5YjBkc6SqPBA5E.avif)
## How much configuration is the right amount of configuration?
When your application is just getting started or when the configuration defaults work just fine for you, any time spent writing those defaults is wasted time and mental space. This applies to default configuration for initializing a project as well as default configuration for adding a new route or component in your application. When a developer is starting a new project or feature, we want their initial burst of energy to go as much as possible toward code that is valuable for the business, rather than code that is just infrastructure.
On the other hand, when the infrastructure code needs to be modified to make your application faster or modify the way the app behaves in some way, that infrastructure code needs to be easily accessible and clearly organized so that developers dont need to understand everything about the system before they can change a single part.
## Skip the Scaffolding
A cursory glance at the repos on Github will reveal numerous starter repos that people use to bypass the initial time investment involved in setting up the initial configuration files. Yeoman was a tool used to help generate scaffolding code, both for starting a project and for creating new sections of an application.
The problem with both of these tools is that any code they generate for you is instantly technical debt. By definition, no one in your company wrote the code that was created by those tools. But developers in your company will now have to maintain this code that they didnt write. Even if the starter project or Yeoman generator was well maintained and always used the latest state of art practices, any application built using them will only be state of the art the instant its created. The infrastructure code grows stale without constant maintenance.
## Nx Generators and Migration Generators
![](/blog/images/2023-01-31/p-fVnh5Cwp1rTZPhehl14g.avif)
Nx has an elegant solution to this dilemma. There are three key parts.
1. Use [code generators](/features/generate-code) to create configuration files that you can safely ignore
2. Modify those configuration files whenever your application needs some custom setting
3. Run [migration generators](/features/automate-updating-dependencies) to maintain state of the art defaults
If you never think about a configuration file is it still technical debt? Some people are put off by the number of configuration files that Nx generates when creating a new application. Perhaps these developers have been burned by starter repos burdening them with instant technical debt that must be maintained. These config files are created only for the eventuality that some day youll need to modify them.
When you do need to modify a setting for Webpack, Vite or Jest (or any of the other tools for which we maintain plugins) the configuration file provides you an easy access point to make your own modifications without needing to understand all the default settings.
Every Nx plugin provides migration generators that will automatically update the default settings to the latest state of the art. With these generators, Nx can take on the burden of maintaining your infrastructure code, except for the specific portions that your developers have customized.
## One Size Never Fits All
While the generators that Nx provides work for most people, there will always be infrastructure that is unique to your own organization. Nx makes it easy to extend generators so that your developers can use generators that create code that has been tailored to your own organizations set up. Instead of having a manual check list to run through every time a developer makes a new feature, you can automate that check list with a generator.
## Negative Configuration?
Nx provides the ability to define default configuration settings at the global level and have individual projects inherit those settings from the global defaults. If a lot of your projects have the same settings, adding Nx to your repo will actually reduce the lines of code in your codebase — thus negative configuration. This isnt convention over configuration or zero configuration, because the configuration settings are still explicitly defined. The configuration code is just better organized and defined in a predictable way.
If youre ready to have Nx help you manage your infrastructure so that your developers can speed down the highway without needing to avoid configuration potholes, check out [nx.dev](/getting-started/intro) to get started.
## Learn more
- [🧠 Nx Docs](/getting-started/intro)
- [👩‍💻 Nx GitHub](https://github.com/nrwl/nx)
- [💬 Nx Official Discord Server](https://go.nx.dev/community)
- [📹 Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -0,0 +1,92 @@
---
title: 'Setup React and Tailwind — The Easy Way'
slug: 'setup-react-and-tailwind-the-easy-way'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-02-09/TK4Kdj-cc890gQkgUtKNyA.png'
tags: [nx, tutorial]
---
Developers love to argue about whether Tailwind is good, almost like arguing about code formatting or tabs vs. spaces (I use spaces!!). But whether you love it or hate it, Tailwind has found massive adoption among the frontend developer community. In fact, Im right now in the process of refreshing and rebuilding my personal site (it will be at [https://juri.dev](https://juri.dev/) soon, so keep an eye on that).
## Prefer a video? Ive got you covered!
{% youtube src="https://www.youtube.com/watch?v=hHh0xhzSnx8" /%}
## Configuring Tailwind for React
Tailwind has good docs around getting started quickly. There are options to set up Tailwind with their Tailwind CLI, PostCSS, and framework-specific guides.
![](/blog/images/2023-02-09/Z6SYFsnv-oA5FHz-.avif)
These steps mostly involve
- installing `tailwindcss`, `postcss` and `autoprefixer`
- configuring your `tailwind.config.js` to make sure Tailwind can properly "purge" its generated CSS file based on the content files (usually your `html`, `[j|t]sx`, `[t|j]s` )
- adjusting your main CSS file to include the Tailwind base classes (in case you want to use Tailwind also in your CSS files, a heated topic)
**One important thing:** if you use [Create-React-App](https://create-react-app.dev/) you might want to check out [what the Tailwind docs say](https://tailwindcss.com/docs/guides/create-react-app) first.
![](/blog/images/2023-02-09/tcPmgZM4SjA2QM80.avif)
This came up a couple of weeks ago due to a [PR opened on the CRA repo](https://github.com/reactjs/reactjs.org/pull/5487) asking to kinda deprecate it as the main choice for new React projects. I couldnt help but share my opinion on this as well:
{% youtube src="https://youtu.be/fkTz6KJxhhE" /%}
And so did also [Fireship](https://youtu.be/2OTq15A5s0Y) and ultimately [Dan Abramov](https://github.com/reactjs/reactjs.org/pull/5487#issuecomment-1409720741). Anyway, if youre in the **“CRA situation”, read on**. Theres a way to get unblocked there.
## There is an easier way — Code Generators
Code generators speed up such configuration tasks. They are valuable for scaffolding the initial project structure and adding new features to the app setup, such as Tailwind.
Nx has such generators. To use them, you need an Nx-based React setup. If youre starting new, you can create an [Nx Standalone React project](/getting-started/tutorials/react-standalone-tutorial) easily using the following command
```shell
$ npx create-nx-workspace reactapp --preset=react-standalone
```
![](/blog/images/2023-02-09/Zw73l-Hm4PBi1mBD.avif)
As you can see, this allows you to choose which bundler to use as well as other options (such as the CSS setup). Again, this is already such a code generator that creates this initial project scaffold.
Alternatively, **if you happen to use CRA already**, you can easily convert to an Nx and Vite (or also Webpack) based setup by running:
```shell
$ npx nx@latest init
```
You can pass `--vite=false` if you still want to keep the Webpack configuration or pass `--integrated` if you already plan to have a monorepo instead of a single-project setup. The [Nx docs go into more detail here](/recipes/adopting-nx/adding-to-existing-project).
## Generating a Tailwind Setup
Once you have a [Nx-based React](/getting-started/tutorials/react-standalone-tutorial) setup, adding Tailwind is as easy as running:
```shell
$ npx nx g @nrwl/react:setup-tailwind
```
This launches a generator that will guide you through the setup. It works **not only for Nx React-based projects** but **also if you use Next.js** in an Nx workspace.
Youll get
- Tailwind, PostCSS, and Autoprefixer installed
- Tailwind configured together with PostCSS
- your main `styles.css` file updated with the Tailwind base classes
![](/blog/images/2023-02-09/lOVFEvRc7Wrsm5V_.avif)
## Thats it!
You should be all setup and ready now! Here are some related resources to explore:
- [Nx docs: React Standalone tutorial](/getting-started/tutorials/react-standalone-tutorial)
- [Nx docs: React Monorepo tutorial](/getting-started/tutorials/react-monorepo-tutorial)
- [Youtube: Is CRA Dead](https://youtu.be/fkTz6KJxhhE)
- [Nx docs: Migrate CRA to React and Vite](/recipes/adopting-nx/adding-to-existing-project)
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
@@ -0,0 +1,188 @@
---
title: 'Nx 15.7 — Node Support, Angular LTS, Lockfile Pruning'
slug: 'nx-15-7-node-support-angular-lts-lockfile-pruning'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-02-16/2AAo-mng7QyJP9yC80zNFQ.png'
tags: [nx, release]
---
Heres all you need to know about our latest Nx release.
### Table of Contents
· [10k Subscribers on Youtube](#10k-subscribers-on-youtube)
· [Updates to our Nx Plugin Guides](#updates-to-our-nx-plugin-guides)
· [Nx meets Node — First-Class Support landed](#nx-meets-node-firstclass-support-landed)
· [Detaching Angular versions](#detaching-angular-versions)
· [Bootstrapping a new Angular app with Standalone API support](#bootstrapping-a-new-angular-app-with-standalone-api-support)
· [Lockfile parsing and pruning](#lockfile-parsing-and-pruning)
· [Storybook 7.0 beta support](#storybook-70-beta-support)
· [More flexible Webpack config](#more-flexible-webpack-config)
· [How to Update Nx](#how-to-update-nx)
· [Coming up](#coming-up)
### Prefer a video? Weve got you covered!
{% youtube src="https://www.youtube.com/watch?v=IStJODzZSoc" /%}
## 10k Subscribers on Youtube
Its almost a tradition to have some stats at the beginning of our Nx release blog posts. This time, about our YT channel: incredibly, we crossed 10k subscribers [on our Youtube channel](https://www.youtube.com/@nxdevtools)!!
![](/blog/images/2023-02-16/s8uTPTC3X01sE3u2.avif)
Apart from delivering high-quality engineering work, were very invested in producing educational content around developer tooling and monorepos. Weve been almost consistently shipping new content every week, whether that is blog posts on the [Nx blog](/blog) or in the form of new videos and live streams on our channel. Seeing our audience grow on Youtube confirms were on the right track and gives us new fuel to keep pushing!!
If you havent subscribed yet, please do 🙏: [https://www.youtube.com/@nxdevtools](https://www.youtube.com/@nxdevtools). We also announce most of our new videos and live streams [on Twitter](https://twitter.com/nxdevtools).
## Updates to our Nx Plugin Guides
Nx has been designed to be extensible from the ground up. Which is precisely why Nx Plugins are so powerful. They dont just come as part of an Nx integrated monorepo or standalone setup. Still, you can leverage them in the same way to automate your local workspace or even share them as proper Nx plugins with the community.
Please have a look at our updated guide: [/extending-nx/tutorials/organization-specific-plugin](/extending-nx/tutorials/organization-specific-plugin)
## Nx meets Node — First-Class Support landed
{% youtube src="https://youtu.be/K4f-fMuAoRY" /%}
Due to a lack of time we never invested much more into streamlining the Node experience within Nx, though. This [changed now](/blog/from-bootstrapped-to-venture-backed), which is why were committed to making Nx the best developer tool for node based apps. Starting with v15.7 we improved support for [ExpressJS](https://expressjs.com/), [Fastify](https://fastify.io/) and [Koa](https://koajs.com/).
When starting a new Nx workspace, you now have a new option: “Standalone Node Server app”.
![](/blog/images/2023-02-16/yTl82iMY0EsbjmBQ.avif)
This is when you want a single-project Nx workspace to build out your Node backend.
All the features Nx is known for also apply to backend development. That includes
- **code generation support** for all the previously mentioned Node frameworks
- avoiding monolithic codebases via **modularizing it with local libraries** (with code generation support)
- Ability to **automatically setup a Dockerfile** for packaging your app
- **Optionally bundle** your Node app for easy deployment in the case of edge-functions
- **Speed** via running building, linting, testing for only **(**[**affected**](/ci/features/affected)**) parts of your applications**, via [caching](/concepts/how-caching-works) and [optimized CI setups](/ci/features/distribute-task-execution)
- the ability to use and/or expand to a monorepo
This is the first iteration with first-class Node support. But were already working on a whole set of improvements for the Nx + Node story. So stay tuned!
## Detaching Angular versions
{% youtube src="https://youtu.be/AQV4WFldwlY" /%}
The Angular CLI supports a single version of Angular and requires the user to upgrade them together with the help of automated upgrade mechanisms like `ng update`. On the other hand, Nx operates on a different release cycle and is independent of Angular versions. However, prior technical limitations resulted in each Nx major version only being compatible with a specific Angular major version. This caused challenges for Angular developers and corporations who were either stuck on an older Angular version or unable to upgrade promptly but still wanted access to the latest and greatest Nx features for increased productivity.
Starting with v15.7.0, the `@nrwl/angular` plugin will support both Angular v14 and v15, and our goal is to continue supporting the Angular LTS versions from Angular v14 onwards.
New workspaces will always be created with the latest Angular version, but during migration, you can skip some package updates as defined by Nx plugin authors. For Angular, this means you can skip migrating to newer versions. This feature can be enabled by running the following command in an interactive mode:
```
$ nx migrate latest --interactive
```
When collecting migrations in interactive mode, youll be prompted to apply any optional migrations, and any updates you choose to skip wont be applied. The rest of the updates will be used as usual.
If you need to apply an Angular update that you previously skipped, you can collect migrations from an older version of Nx by running:
```
$ nx migrate latest --from=nx@<version>
```
In particular, were working on making that part more intuitive in upcoming versions.
Also, have a look at our [updated docs](/recipes/tips-n-tricks/advanced-update) as well as our [Nx and Angular compatibility matrix](/nx-api/angular/documents/angular-nx-version-matrix) for more details.
## Bootstrapping a new Angular app with Standalone API support
{% youtube src="https://youtu.be/Hi3aJ0Rlkls" /%}
Angulars new [standalone APIs](https://angular.io/guide/standalone-components) is exciting as it provides a new, more lightweight way of developing and composing Angular applications without the need for `NgModules`. Nx has had the ability to generate new Angular components using the Standalone API for a while. With v15.7, we now also allow you to quickly bootstrap a new single-project Nx workspace with a NgModule-less Angular application.
```shell
npx create-nx-workspace@latest ngapp
--preset=angular-standalone
--standaloneApi
```
## Lockfile parsing and pruning
Lockfiles can be highly complex, and different formats across the NPM, Yarn, and PNPM package managers dont make it easier. Nx used to consider the lock-file a black box. Starting with 15.7, this changes! Nx can now properly process the lock-file of all three major package managers (and their different versions!).
Why is this useful? Glad you asked! Mostly for three reasons:
- more **accurately map the nodes and dependencies** in the Nx graph (yep the graph also includes npm packages used by every single project)
- generate a `package.json` with **precise snapshot of the used versions** (especially useful in a monorepo with single-version policy)
- ability to **generate a pruned lock-file** that can be used along-side the `package.json` when packaging your app in a Docker container
Some of our plugins `build` executors include:
- `generatePackageJson` flag (`@nrwl/webpack:webpack` and `@nrwl/node:webpack`) that automatically generates `package.json` and lock file.
- `generateLockfile` flag (`@nrwl/js:swc`, `@nrwl/js:tsc` and `@nrwl/next:build`) that generates lock file
If youre an Nx plugin developer, you can generate `package.json` and lock file using the following functions from the `@nrwl/devkit` package:
```
import { createPackageJson, createLockFile } from '@nrwl/devkit';
const projectGraph = await createProjectGraphAsync();
const packageJson = createPackageJson(projectName, projectGraph);
const lockFile = createLockFile(packageJson);
// save files using e.g. `fs.writeFileSync`
```
Stay tuned for a more in-depth blog post coming soon to [our blog](/blog).
## Storybook 7.0 beta support
Nx provides support for Storybook version 7.0 beta, with generators and executors, so that you can try it out now, either in a new or in your existing Nx workspace. Storybook version 7 is a major release that brings a lot of new features and improvements. You can read more about it in the [Storybook 7 beta announcement blog post](https://storybook.js.org/blog/7-0-beta/). Apart from the new features and enhancements, it also brings some breaking changes. You can read more about them in the [Storybook 7 migration docs](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-65x-to-700) and the [Storybook 7 migration guide](https://chromatic-ui.notion.site/Storybook-7-migration-guide-dbf41fa347304eb2a5e9c69b34503937). Do note that _version 7 is still in beta_, and so is the Nx support for it.
You can try out Storybook 7.0 beta in a new Nx workspace by passing the `--storybook7betaConfiguration` flag when generating the Storybook configuration for your projects. Read more in our [Storybook 7 setup guide](/nx-api/storybook/documents/storybook-7-setup). If you want to migrate your existing Storybook configuration to Storybook 7.0 beta, please read our [migration guide](/nx-api/storybook/generators/migrate-7).
## More flexible Webpack config
{% youtube src="https://youtu.be/CIT4MFMraXg" /%}
Previously when you created a new React application with the Nx `@nrwl/react` plugin, the actual Webpack config was hidden within the plugin itself.
![](/blog/images/2023-02-16/1rWmKSybkBC8I-0O.avif)
It was for a good reason, but at the same time, it is a thin line to walk between giving more flexibility and ensuring integrity and consistency (not to speak about features such as [automated code migrations](/features/automate-updating-dependencies)). We wrote a [blog post about it last week](/blog/configuration-files-and-potholes-in-your-codebase).
Inspired by our new [Vite setup](/nx-api/vite), which allows for a more modular configuration in the `vite.config.ts`, we wanted to bring some of the same flexibility to our Webpack setup as well. As such, now every Nx Webpack setup (e.g. a new React + Webpack based app) have a `webpack.config.js` in the project root. Old project are automatically migrated to this new setup.
![](/blog/images/2023-02-16/emRP2gF7umWc4UE-.avif)
If you want to upgrade but still retain the previous behavior, we introduced an `isolatedConfig` mode that can be set to `false`. More details on our docs: [/recipes/webpack/webpack-config-setup](/recipes/webpack/webpack-config-setup)
## How to Update Nx
Updating Nx is done with the following command and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Coming up
We are currently working on some exciting stuff, including
- Deno support
- Improvements to Nx Console, including support for IntelliJ
- NestJS
- Rust 👀
- Nx for non-JS environments
-
So keep an eye on our [Twitter](https://twitter.com/nxdevtools), [Youtube](https://www.youtube.com/@nxdevtools) and [blog](/blog) to not miss those announcements.
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nrwl Youtube Channel](https://www.youtube.com/nrwl_io)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
@@ -0,0 +1,181 @@
---
title: 'Using NgRx Standalone APIs with Nx'
slug: 'using-ngrx-standalone-apis-with-nx'
authors: ['Colum Ferry']
cover_image: '/blog/images/2023-02-21/pJHhA04d6jIjOb5vpCDjyw.png'
tags: [nx, tutorial]
---
Version 15 of [NgRx](https://ngrx.io/) introduced Standalone APIs to the package, enabling usage of the NgRx with Standalone Component-based [Angular](https://angular.io/) applications. This allows for a simpler integration of NgRx to your application.
Nx has added support for using these Standalone APIs from NgRx when generating NgRx stores with our `@nrwl/angular:ngrx` generator when you give it a path to a `Routes` definition file. _(Usually denoted by_ `_*.routes.ts_`_)_
In this article, well walk through using Nx to create a new Standalone Component-based Angular application and add NgRx to it, using _ONLY_ Nx Generators!
**Prefer a video version? Weve got you covered!**
{% youtube src="https://www.youtube.com/watch?v=fp9E5G9C61Q" /%}
## Create a new Nx Workspace
`npx create-nx-workspace myorg`
Select:
- Standalone Angular app
- Yes to using Standalone Components
- Yes to add routing
- Any option for the stylesheet format
- Yes to Nx Cloud
The result should look something like this:
![](/blog/images/2023-02-21/91CdqmMaqFjMDVK.avif)
Now run `cd myorg` to enter the workspace.
The `src/main.ts` should look different than you remember with standard NgModule-based Angular applications.
You should see something similar to
```
import { bootstrapApplication } from '@angular/platform-browser';
import {
provideRouter,
withEnabledBlockingInitialNavigation,
} from '@angular/router';
import { AppComponent } from './app/app.component';
import { appRoutes } from './app/app.routes';
bootstrapApplication(AppComponent, {
providers: \[provideRouter(appRoutes, withEnabledBlockingInitialNavigation())\],
}).catch((err) => console.error(err));
```
This is important, as this is the file where your root NgRx providers need to be placed, within the `providers` option of the `bootstrapApplication` function.
Nx will aid this also!
## Generate the root state
`nx g @nrwl/angular:ngrx --root --parent=src/main.ts`
Youll be asked for a name for the feature state, but you can ignore this and simply press enter in your terminal, it is not necessary at this stage.
Say false to Facades also.
![](/blog/images/2023-02-21/6igpc5F6dk9UMswf.avif)
The generator will now make changes to your `main.ts` file and install the NgRx packages for you!
Your `main.ts` file should now look like this
```
import { bootstrapApplication } from '@angular/platform-browser';
import {
provideRouter,
withEnabledBlockingInitialNavigation,
} from '@angular/router';
import { AppComponent } from './app/app.component';
import { appRoutes } from './app/app.routes';
import { provideStore, provideState } from '@ngrx/store';
import { provideEffects } from '@ngrx/effects';
bootstrapApplication(AppComponent, {
providers: \[
provideEffects(),
provideStore(),
provideRouter(appRoutes, withEnabledBlockingInitialNavigation()),
\],
}).catch((err) => console.error(err));
```
Notice the addition of `provideEffects()` and `provideStore()` to the `providers` array.
## Generate a new feature library
NgRx works better when you split your store based on the features you have within your application. This is a pretty common use case. Nx allows you to do this very easily and in a very structured way.
First, lets generate a new feature library, called `feature-users`, in Nx that will house everything related to our feature including the NgRx State.
`nx g @nrwl/angular:lib feature-users --standalone --routing --lazy --parent=src/app/app.routes.ts`
This command does a few things:
- It creates a new library in our Nx Workspace
- It uses an Angular Standalone Component as the entrypoint
- It adds a routing configuration to the library and adds the component as the default route.
- It will add a lazy-loaded route to the applications `app.routes.ts` file, wiring up the application to the library!
Some files you may want to explore in your own time are:
`src/app/app.routes.ts`
`feature-users/src/lib/lib.routes.ts`
## Add feature state to the feature library
Now that we have a feature library for our users feature, lets generate the feature state! Its as simple as one command.
`nx g @nrwl/angular:ngrx users --parent=feature-users/src/lib/lib.routes.ts --route=''`
Youll be asked if this is the root state of the application, enter `N`. Then say no to Facades (unless you really want them).
The `--route` option here is used to dictate what `route` within our routes definition file (`lib.routes.ts`) should have the state attached to it. This is to allow the NgRx Standalone APIs to be attached to that route.
We can see that if we look at the `lib.routes.ts` file
```
import { Route } from '@angular/router';
import { FeatureUsersComponent } from './feature-users/feature-users.component';
import { provideStore, provideState } from '@ngrx/store';
import { provideEffects } from '@ngrx/effects';
import \* as fromUsers from './+state/users.reducer';
import { UsersEffects } from './+state/users.effects';
export const featureUsersRoutes: Route\[\] = \[
{
path: '',
component: FeatureUsersComponent,
providers: \[
provideState(fromUsers.USERS\_FEATURE\_KEY, fromUsers.usersReducer),
provideEffects(UsersEffects),
\],
},
\];
```
The command will also have generated our
- Actions
- Reducers
- Selectors
- Effects
And with that, we now have NgRx installed and integrated into our application!
If youd like to confirm the integration, you can run the following commands and see successful outputs!
`nx build`
`nx test`
`nx test feature-users`
## Conclusion
This guide has shown how easy it is to set up NgRx with Nx and how to take advantage of the latest Standalone APIs with your application. All with just 5 Nx commands!
With the Angular roadmap pointing to Standalone Components becoming the preferred option for developing Angular applications, this support will be crucial in the future, and Nx will help you achieve it with the best possible DX!
> Btw, did you know you can now scaffold a single-project Angular Nx workspace that fully leverages the Standalone APIs? Check it out here: [https://youtu.be/Hi3aJ0Rlkls](https://youtu.be/Hi3aJ0Rlkls)
You can check out an example repository that was created following the steps above here: [https://github.com/Coly010/nx-ngrx-standalone](https://github.com/Coly010/nx-ngrx-standalone)
## Learn More
🧠 [Nx Docs](/getting-started/intro)
👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
💬 [Nx Official Discord Server](https://go.nx.dev/community)
📹 [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools)
🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
🧐 [Need help with Angular, React, Monorepos, Lerna or Nx? Talk to us 😃](https://nx.app/enterprise)
@@ -0,0 +1,126 @@
---
title: 'Whats New With Lerna 6.5?'
slug: 'whats-new-with-lerna-6-5'
authors: ['Zack DeRose']
cover_image: '/blog/images/2023-02-22/izlWzEYnkZ9myXi58Rmv8A.png'
tags: [nx, release]
---
In case you missed it, Lerna version 6.5 recently launched. Well catch you up on the latest Lerna news and newest features.
## Table of Contents
- [Lerna: Brought to You by Nx](#lerna-brought-to-you-by-nx)
- [Still On Lerna 4?](#still-on-lerna-4)
- [Idempotency Added to the `lerna publish from-git` Command](#idempotency-added-to-the-lerna-publish-fromgit-command)
- [`lerna run` Can Run Multiple Scripts In a Single Command](#lerna-run-can-run-multiple-scripts-in-a-single-command)
- [New --include-private Option Added To lerna publish](#new-includeprivate-option-added-to-lerna-publish)
- [Massive Refactor](#massive-refactor)
- [Getting Started With Lerna From The Lerna Team](#getting-started-with-lerna-from-the-lerna-team)
- [The Future of Lerna](#the-future-of-lerna)
## Lerna: Brought to You by Nx
In case you missed it, Lerna, the OG JavaScript monorepo tool, went largely unmaintained for a while, starting around 2020. Then, it officially declared itself to be unmaintained in April of 2022, only for Nx to step in to take over maintenance of the project in May of 2022!
You can find a more detailed account of Lernas “Maintainance Odyssey” in [this article](/blog/lerna-is-dead-long-live-lerna).
Since Nx took over in Lerna 4, weve added a brand new site to refresh the Lerna Docs:
![](/blog/images/2023-02-22/3GKvhzStrTwq7re5.avif)
The top of our priorities for Lerna 5 was to resolve all vulnerabilities and outdated dependencies facing Lerna. We went on to make Lerna faster by allowing users to [opt into Nxs task caching inside of Lerna with the new `lerna add-caching` command](https://github.com/lerna/lerna/tree/main/packages/lerna/src/commands/add-caching#readme), and [add support for distributed caching to share task results amongst your organization in Lerna with Nx Cloud](https://lerna.js.org/docs/features/share-your-cache).
We were proud to go on to launch [Lerna 6](/blog/lerna-reborn-whats-new-in-v6) last October, where we began focusing on further improving Lernas feature set — focusing specifically on its unique strengths: versioning and publishing.
## Still on Lerna 4?
[Heres how to upgrade to the latest and greatest](https://lerna.js.org/upgrade).
Weve also started an initiative to assist Open Source projects in getting the most out of Lerna. Projects that use Lerna can now request free consulting to learn how to take advantage of Lernas newest features.
Weve just started this initiative and have already been able to help [Sentry](https://github.com/getsentry/sentry-javascript) get optimized with task caching and task pipeline optimizations for their workspace!
![](/blog/images/2023-02-22/7Wu1y3L6BNPZmZwE.avif)
This initiative complements [our free tier of unlimited Nx Cloud](/pricing) for any Open Source project.
If youre interested in optimizing your Open Source project to take advantage of the latest Lerna features, [reach out to us on Twitter!](https://twitter.com/lernajs)
Now lets jump into the newest Lerna 6.5 features!
## Idempotency Added to the `lerna publish from-git` Command
{% youtube src="https://youtu.be/kh4TaiKbC8c" /%}
“Idempotent” is a word used to describe an operation you can perform any number of times, and the resulting state is the same as if you had only run the operation once.
The [`lerna publish` command](https://github.com/lerna/lerna/tree/main/libs/commands/publish#readme) is a beneficial tool for quickly publishing multiple packages from your workspace:
- Running `lerna publish` by itself will version and publish all packages in the workspace since your latest release
- Running `lerna publish from-git` will publish all projects tagged in the latest commit
- Running `lerna publish from-package` will publish all projects whose version does not yet exist in the target registry based on the version listed in their `package.json` file.
As we can see, `lerna publish from-package` is already idempotent (since it only publishes packages whose version doesn't exist, any run past the first will not adjust the state of the registry).
With 6.5, weve added the same idempotency to `lerna publish from-git`. This update is handy for recovering from a situation where some of your packages failed to publish initially (maybe due to a networking issue).
[For more information, check out the PR](https://github.com/lerna/lerna/pull/3513)
## `lerna run` Can Run Multiple Scripts In a Single Command
For 6.5, weve added the ability to run multiple scripts in a single `lerna run` command! Checkout this quick video demonstrating this below:
{% youtube src="https://youtu.be/Ey73CEGcVKw" /%}
Learn more [here](https://github.com/lerna/lerna/pull/3527).
## New `--include-private` Option Added To `lerna publish`
[Npm supports a `["private": true]` configuration](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#private) as a way of preventing the publication of a library that is private.
```shell
lerna publish from-git --include-private my-private-package
```
Running `lerna publish` with this new [`--include-private`](https://github.com/lerna/lerna/tree/main/libs/commands/publish#--include-private) option (as above) will strip this `"private": true` configuration from the `package.json` of the packages listed in the command.
This new option is beneficial for the use case where youd like to run e2e for a package that will eventually be public but is currently private to prevent getting published too soon.
{% youtube src=" https://youtu.be/7TgjCk7Diks" /%}
You can find more information on this change [here](https://github.com/lerna/lerna/pull/3503).
## Massive Refactor
Unlike the other updates mentioned for 6.5, this update does not affect Lernas public API, but as you can see from the numbers, this was quite an undertaking:
![](/blog/images/2023-02-22/AKQyRtbrKzzOUdPZ.avif)
![](/blog/images/2023-02-22/GUSOJi5vj5fGYYj3.avif)
The result is a significant improvement to the Typescript support for Lernas internals and a substantial simplification of the codebase. This investment will make Lerna significantly more approachable to other would-be contributors!
Find more on this change [here](https://github.com/lerna/lerna/pull/3517).
## Getting Started With Lerna From The Lerna Team
We recently ran a live stream with [James Henry](https://twitter.com/MrJamesHenry) and [Austin Fahsl](https://twitter.com/AustinFahsl) from our Lerna team to show how to get started with Lerna, all the way through to versioning and publishing our packages to npm!
{% youtube src="https://youtu.be/HqPOoU35xzA" /%}
Check out the recap of this session above, and check out [the repo from our session on GitHub](https://github.com/ZackDeRose/for-the-lulz).
## The Future of Lerna
Looking to the future, we are targeting Q2 of 2023 for Lerna v7 (including a `--dry-run` option for both `lerna version` and `lerna publish` commands - you can catch a sneak-peak of this in James' talk from Nx Conf 2022 below!)
{% youtube src="https://youtu.be/CNdDv2MsBuw" /%}
You can find [a roadmap for all the features we plan to add in Lerna 7](https://github.com/lerna/lerna/discussions/3410) on Github!
## Lerna More!
- [🧠 Lerna Docs](https://lerna.js.org/)
- [👩‍💻 Lerna GitHub](https://github.com/lerna/lerna)
- [💬 Nx Official Discord Server](https://go.nx.dev/community)
- [📹 Nrwl Youtube Channel](https://www.youtube.com/nrwl_io)
@@ -0,0 +1,248 @@
---
title: 'Bundling a Node API with Fastify, esbuild, and Nx'
slug: 'bundling-a-node-api-with-fastify-esbuild-and-nx'
authors: ['Jack Hsu']
cover_image: '/blog/images/2023-02-28/PADY_RKrkXj39p4nj79ESw.png'
tags: [nx, tutorial]
---
There are many decisions to make when it comes to building a Node API. There are a variety of frameworks to choose from (Express, Fastify, Koa, etc.), and a million different ways to build and deploy the application.
In this article, Ill show you the easiest way to go from zero to production by using Nx to create a Node API project.
Well be using [Fastify](https://www.fastify.io/) as the framework of choice. Fastify is a fast (as the name implies) and low-overhead server in Node. It has grown in popularity, recently crossing the 1 million weekly download mark on npm. Im a fan of Fastifys plugin architecture, and the ecosystem is quite impressive, boasting over [250 core and community plugins](https://www.fastify.io/ecosystem/).
## **Table of Contents**
· [Creating the project](#creating-the-project)
· [Running tests](#running-tests)
· [Building for production using esbuild](#building-for-production-using-esbuild)
· [Docker support](#docker-support)
· [Deploying the server](#deploying-the-server)
· [Summary](#summary)
**Prefer a video version? Weve got you covered!**
{% youtube src="https://www.youtube.com/watch?v=K4f-fMuAoRY" /%}
## Creating the project
You can create a new API with a single command.
```shell
$ npx create-nx-workspace@latest \
--preset=node-standalone \ # create a Node.js project
--framework=fastify \ # other options are express and koa
--docker # we'll touch on this later on
```
To run the server in dev-mode, use `npx nx serve` (aliased to `npm start`), and you should see the server starting at port 3000.
```
$ curl <http://localhost:3000>
{"message":"Hello API"}
```
A couple of notable files:
- The `src/main.ts` file is responsible for starting the Fastify server and registering plugins.
- The `src/app/app.ts` file is the app plugin that provides an initial endpoint at `/` that replies with `{"message": "Hello API"}`.
When you edit the source code, the server will reload. You can pass `--no-watch` to disable this behavior.
## Running tests
In additional to generating the source code, Nx will also create two test suites:
1. Unit tests via `npx nx test` (aliased to `npm run test`).
2. E2E tests via `npx nx e2e e2e` (aliased to `npm run e2e`).
Unit tests take advantage of Fastifys plugin architecture, and allows you to test each plugin in isolation. It runs using [Jest](https://jestjs.io/), which is the most popular test runner in Node.
```
// src/app/app.spec.ts
// This file is generated by Nx.
import Fastify, { FastifyInstance } from 'fastify';
import { app } from './app';
describe('GET /', () => {
let server: FastifyInstance; beforeEach(() => {
server = Fastify();
server.register(app);
}); it('should respond with a message', async () => {
const response = await server.inject({
method: 'GET',
url: '/',
}); expect(response.json()).toEqual({ message: 'Hello API' });
});
});
```
The E2E tests run against the actual server (with all plugins registered), which gives better real-world guarantees.
```shell
$ npx nx serve & # run server in background
$ npx nx e2e e2e # run test suite
GET /
✓ should return a message (27 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.429 s
Ran all test suites.Tearing down... ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— >
NX Successfully ran target e2e for project e2e (3s)$ lsof -i:3000 -t | xargs kill # stop server process
```
There are trade-offs between speed versus confidence when it comes to unit versus E2E tests, which is a topic that is out of scope for this article. I think you should do both, but this is a discussion be held with your team. Nx supports both cases out of the box.
## Building for production using esbuild
Now that we have our production-ready app, lets examine how Nx handles the build process using [`esbuild`](https://esbuild.github.io/).
`esbuild` is a bundler written in Go that is extremely fast — it is much faster than other bundlers like webpack and parcel, but that may change in the future as other tools make their own speed improvements.
When you run the build command, Nx uses `esbuild` to generate a self-contained app bundle, which does not require `node_modules`.
```shell
$ npx nx build # aliased to npm build
> nx run api:build
—————————————————————————————————————————————————————
NX Successfully ran target build for project api (2s)
```
A cool feature of Nx, is that commands such as `build` and `test` are cached if the project (or its dependencies) have not changed. If we run the build a second time, youll see it completes in a few milliseconds.
```shell
$ npx nx build
> nx run api:build # existing outputs match the cache, left as is
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— >
NX Successfully ran target build for project api (16ms) Nx read the output from the cache instead of running the command for 1 out of 1 tasks.
```
Well touch more on the caching when we look at Docker support.
And now that the server bundle is ready, we can run it.
```
$ node dist/api
{"level":30,"time":1675880059720,"pid":70605,"hostname":"mbp.lan","msg":"Server listening at http://\[::1\]:3000"}
{"level":30,"time":1675880059721,"pid":70605,"hostname":"mbp.lan","msg":"Server listening at <http://127.0.0.1:3000>"}
[ ready ] <http://localhost:3000>
```
You can even run the e2e suite against the production bundle: `npx nx e2e e2e`.
## Docker support
Recall that we passed the `--docker` option when creating the API project. WIth this option, Nx will generate a default `Dockerfile` and a `docker-build` target.
```shell
# This file is generated by Nx.
#
# Build the docker image with `npx nx docker-build api`.
# Tip: Modify "docker-build" options in project.json to change docker build args.
#
# Run the container with `docker run -p 3000:3000 -t api`.
FROM docker.io/node:lts-alpine
ENV HOST=0.0.0.0
ENV PORT=3000WORKDIR /appRUN addgroup --system api && \
adduser --system -G api apiCOPY dist/api api
RUN chown -R api:api .CMD [ "node", "api" ]
```
To build the image, run `npx nx docker-build`. The image copies only the self-contained bundle, so no `npm install` at all!
Nx is smart enough to bundle the app before building the Docker image — because of the `dependsOn` configuration in `project.json`. You can visualize this dependency with `npx nx graph`.
![](/blog/images/2023-02-28/HRfoF6hPy-XH-MSL42PSIQ.avif)
Now that the image is built, we can run it.
```
$ docker run -p 3000:3000 -t api
{"level":30,"time":1675880993256,"pid":1,"hostname":"248744de020a","msg":"Server listening at <http://0.0.0.0:3000>"}
[ ready ] <http://0.0.0.0:3000>
```
**Note:** The server binds to `0.0.0.0` so that it can be access from the host machine. You can run curl to verify that it indeed works, or better yet use the E2E test suite (`npx nx e2e e2e`)!
## Deploying the server
There are numerous platforms that we can deploy our app to. I like [Fly.io](https://fly.io) since it very easy to deploy all over the world using the CLI, and it comes with good [Docker support](https://fly.io/docs/languages-and-frameworks/dockerfile/).
If you havent used Fly before, please follow their [short getting started guide](https://fly.io/docs/speedrun/) (510 mins).
Once you are ready, lets configure our project.
```
$ fly launch --generate-name --no-deploy
```
Follow the prompts and a `fly.toml` file will be generated, which contains the Fly configuration. We need to update this file with the correct port used by our image.
```
[[services]]
http_checks = []
internal_port = 3000 # Make sure this matches what the app listens on
```
Now we can deploy the app.
```
$ fly deploy
```
Fly will log out the monitoring link when the app is successfully deployed.
![](/blog/images/2023-02-28/oAuTGrLZCV87OEC0e-6KpQ.avif)
And you can open the deployed server using `fly open`.
![](/blog/images/2023-02-28/tV8aAtjRoRMwlj1Tv17IAw.avif)
Thats it! Our server is now deployed for the world to use.
## Summary
In this post, we saw how easy it is to go from zero code to a deployed server using Nx. Here is a quick summary of the points.
1. Use `create-nx-workspace --preset=node-standalone --framework=fastify --docker` to quickly create a Fastify server project.
2. Nx provide both unit test and E2E test suites — `npx nx test` and `npx nx e2e e2e`.
3. Nx builds the server using esbuild — `npx nx build`.
4. Docker support is provided out of the box via the `--docker` option, and Nx understands that Docker build depends on the app to be bundled. Run it via `npx nx docker-build`.
5. Deploying to Fly (or other platforms) is easy since we have a Docker image.
To learn more about Nx and what else it can do, refer to the [intro page](/getting-started/intro) in the docs.
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
- 🚀 [Speed up your CI](/nx-cloud)
@@ -0,0 +1,234 @@
---
title: 'Expanding Nx Console to JetBrains IDEs'
slug: 'expanding-nx-console-to-jetbrains-ides'
authors: ['Max Kless']
cover_image: '/blog/images/2023-03-02/lEAhfd3d17hGichyT-oGbw.png'
tags: [nx]
---
**_Co-authored by_** [**_Jon Cammisuli_**](https://twitter.com/jcammisuli)
Nx Console has been on the Visual Studio Code marketplace for years, and with over 1.2 million downloads, we know that a
lot of folks enjoy using it for their day to day Nx related tasks.
That makes it even more **exciting for us to officially announce that Nx Console is now available for JetBrains IDEs**!!
Go grab it on the official store.
👉 **Install link:
** [https://plugins.jetbrains.com/plugin/21060-nx-console](https://plugins.jetbrains.com/plugin/21060-nx-console)
![](/blog/images/2023-03-02/gnMRzttFFaoTX0tVw-zZbQ.avif)
Before we go into details of Nx Console for IntelliJ, wed really want to go and **thank our community**. [\* \*_Issam Guissouma_\*\*](https://twitter.com/iguissouma) and [**_Edward Tkachev_**](https://twitter.com/etkachev) from the
Nx community had their own Nx Console plugins for IntelliJ out there already for a while. And they have been super
popular. As such wed like to take the occasion to give them a shout-out for the awesome work on the community plugins,
but also for closely collaborating with us over the last weeks to build our official IntelliJ support for Nx Console.
Especially Issam has been actively helping us port over all the features he built to the official Nx Console plugin. So
be sure to look out for the upcoming release because its going to be another huge one!
### Table of Contents
· [Going from one IDE to two](#going-from-one-ide-to-two)
· [Nx Language Server](#nx-language-server)
· [Generate UI](#generate-ui)
· [Communicating with IntelliJ](#communicating-with-intellij)
· [Adapting Styling](#adapting-styling)
· [JCEF](#jcef)
· [Glueing it together](#glueing-it-together)
· [Looking ahead](#looking-ahead)
**Prefer a video version? Weve got you covered!**
{% youtube src="https://www.youtube.com/watch?v=xUTm6GDqwJM" /%}
## Going from one IDE to two
Nx Console has a ton of features to improve your development experience while working on Nx and Angular repos, some
small and some big.
To provide the most value from the get-go for JetBrains users, we first focused on integrating two main areas: The Nx
Language Server and the Generate UI.
**The Nx Language Server (nxls)** is based on
the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/). It serves as a single
source of truth for all information about your workspace and its projects. With it, you get features such a code
completion for `project.json` and `nx.json` files, clickable links for all kinds of files and more. Being a standalone
process, its editor-agnostic per default, which is great! However, IntelliJ doesnt natively support the language
server protocol yet, so we had to write some code that bridges the gap between the two. More about that in the following
section!
The great thing about having a central “brain” for both extensions is that it saves a lot of time writing the same
functionality multiple times. We only have to deal with platform-specific code for rendering UI or defining actions
instead of parsing `nx.json` files and the like. This makes both VSCode and IntelliJ extensions thin, DRY wrappers
around the nxls.
Another major part of Nx Console is the **Generate UI**. Instead of combing through CLI commands to fit your specific
use-case, you can use the form-based view it provides. Its a separate web application (currently built with Angular)
that runs inside VSCode as a webview. Again, being a standalone application means that we didnt have to rewrite it
completely in order to integrate it into JetBrains-based editors!
## Nx Language Server
Development of the Nx Language Server (nxls) began as a way to provide autocompletions in Nx specific files. But we came
to the realization that the `nxls` could also provide much more information.
The language server is a separate process that is called by the running IDE (that being VSCode, and now Intellij) that
communicates via json rpc.
With the Language Server Protocol, there are certain methods that are called between the IDE and the language server,
such as
[`textDocument/completion`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_completion)
that must be implemented.
When the `nxls` does Language Server Protocol related things (like autocomplete), it uses the local workspace copy of Nx
to get information about the workspace. Since this workspace information is already loaded in memory, it presented a
solution to just use that same workspace info in the IDEs without us having to rewrite this logic in multiple
languages (ie, TypeScript and Kotlin).
We found out quickly that we can implement custom requests within the `nxls` to respond to other queries that arent
actually part of the Language Server Protocol. These requests are what allows us to use the `nxls` in multiple IDEs and
allow us to quickly iterate.
One of these custom requests is
[`nx/workspace`](https://github.com/nrwl/nx-console/blob/756fdfb545de413436193227d273d078628d7829/libs/language-server/types/src/index.ts#L18-L23).
Calling this endpoint gives us the same information that you can find when you run `nx graph --file=output.json`. (Plus
a little more information that is needed for IDEs 🙂)
There are more custom requests that are implemented that help with IDE integration, some of these include:
- Nx version
- Available generators
- Finding projects based on file paths
You can see all the custom requests
on [Github](https://github.com/nrwl/nx-console/blob/756fdfb545de413436193227d273d078628d7829/libs/language-server/types/src/index.ts).
**VSCode**
Language Server Protocol support is built into the core of VSCode, so using the language server there was straight
forward. Previously the logic to get workspace information was just part of the VSCode extension. This was the logic
that moved to the `nxls` .
**IntelliJ**
For JetBrains editors (IntelliJ/Webstorm), calling a language server wasnt so obvious.
Thankfully, there were already plugins that integrated language servers using
the [lsp4j](https://github.com/eclipse/lsp4j) library. This was a great starting out point for us and we quickly got
IntelliJ/Webstorm to boot up `nxls` and start sending requests.
In future versions of IntelliJ/Webstorm, language server support is going to be fully baked into the core of the IDE
using the same lsp4j library. This means that we can remove some of the scaffolding that we had to do to get it working
without the core support.
## Generate UI
![](/blog/images/2023-03-02/BMjrO5LdBCWK2TU.avif)
_Screenshot of the generate UI in IntelliJ_
As mentioned, the generate UI is a key feature of Nx Console. It allows users to easily generate code by using a
form-based view, rather than having to remember and type a series of CLI commands.
For VSCode, the only way to add a custom UI like this is to render it from inside
a [webview](https://code.visualstudio.com/api/extension-guides/webview) — similar to an iframe. IntelliJ provides the
functionality to build more complex native UIs. However, this would mean rewriting everything from scratch: how to
process Nx schemas, how to render each kind of field, validation and more. And then, each change to the UI would have to
be made in two places, greatly increasing the maintenance overhead and complexity of the codebase. This is why we
decided to reuse the existing generate UI for IntelliJ.
The generate UI is a standalone app written in Angular. It consists of a few components for the different field types
and a main component that deals with processing the schema, filtering fields and communicating with the IDE. This entire
component was quite tightly coupled with VSCode in two regions: receiving and sending data to the IDE and styling.
Naturally, these aspects had to be refactored out in order to accommodate a new host IDE.
## Communicating with IntelliJ
First, we ripped out all VSCode-specific code from the main component and moved it to a separate
[`ide-communication.service.ts`](https://github.com/nrwl/nx-console/blob/f7de7f9d1f7ae5f59b0605b2e54ef28e6325e839/libs/generate-ui/feature-task-execution-form/src/lib/ide-communication/ide-communication.service.ts#L91).
Communication with the host IDE is now done via one of two methods:
- for VSCode, we continue to use the straightforward (
and [fully typed](https://www.npmjs.com/package/@types/vscode-webview)) `acquireVsCodeApi()` method,
`window.addEventListener` and `webview.postMessage` .
- for IntelliJ, there is no such helper method, so we wrote a custom `window.intellijApi` object. This api will then be
called from both the Angular app and from within Kotlin code by injecting it into JCEF (more on that later). This is
definitely a more involved solution and less developer-friendly, but it works perfectly fine.
The service uses whatever API it finds to send and receive messages, with the rest of the app none the wiser. The
structure of the messages is identical between VSCode and IntelliJ. The fact that the Typescript-based VSCode extension
natively understands JSON is a nice upside, since we can just pass around objects between the browser and extension
without having to convert anything. For the Kotlin-based IntelliJ plugin, this needs an additional de-/serialization
step, which is easily done with [`kotlinx.serialization`](https://github.com/Kotlin/kotlinx.serialization) or
[`gson`](https://github.com/google/gson).
## Adapting Styling
One aspect that makes designing webviews for VSCode a breeze is the massive stylesheets they ship by default. Every UI
elements colors are available in primary, secondary and disabled variants as well as fonts, background colors and more.
However, this ended up being a struggle as all styling was very tightly coupled to these VSCode stylesheets, which are
obviously not present within a different host IDE. We replaced all of the VSCode styles with custom css variables. In a
separate `generate-ui-styles` library, we map the VSCode styles to our matching variables. For IntelliJ, we extract the
the same style variables using `UIUtil` and pass them to the app.
## JCEF
To integrate the web application into IntelliJ, Nx Console
uses [JCEF (Java Chromium Embedded Framework)](https://plugins.jetbrains.com/docs/intellij/jcef.html). JCEF enables Java
applications to render web pages using Chromium. It comes with great debugging support using Chrome Devtools and we
havent run into any issues with it yet. The docs are sadly a bit lacking, but with some trial and error we managed to
wire everything up. I want to give a special shoutout to Rafal Mucha and his
article [Creating IntelliJ plugin with WebView](https://medium.com/virtuslab/creating-intellij-plugin-with-webview-3b27c3f87aea).
It explains how to enable JCEF to load files from the `/resources` folder bundled in the plugin JAR. Theres not much
info on this topic so this one blog post was a true lifesaver. Its written in Scala but I learned a lot rewriting it to
Kotlin. Now we have
a [Kotlin version](https://github.com/nrwl/nx-console/blob/master/apps/intellij/src/main/kotlin/dev/nx/console/generate_ui/CustomResourceHandler.kt)
out there too!
Communication with whatever is running in the browser works by **_injecting_** javascript code to be run into the
browser - kind of like running something in the console. This creates a little more overhead than simply posting
messages to be consumed from a listener like in VSCode. The upside is that it theoretically gives you a lot more
flexibility in what you want to do in the browser - you could talk to multiple, independent APIs and register distinct
callbacks on the host side.
## Glueing it together
One of the unique aspects of the Nx Console for IntelliJ is that it combines different technologies in a polyglot
monorepo. While Nx is often used for Typescript- or Javascript-based repos, its actually technology-agnostic and can
host apps and libraries in any language. With the newly released [**_Encapsulated Nx_
**](/recipes/installation/install-non-javascript) setting, this is even taken a step further! Now you dont need a
`package.json` or `node_modules` to run Nx.
The codebase contains both Typescript code for the VSCode extension and Kotlin code for the IntelliJ plugin. Currently,
all the Kotlin code resides in a single app. Targets defined in `project.json` are available that wrap different gradle
tasks like running a development instance, building or formatting the plugin using the
[`nx:run-commands`](/nx-api/nx/executors/run-commands) executor.
Since the plugin depends on artifacts provided by other Nx apps (namely the `nxls` and `generate-ui`), we have also
created gradle tasks that call Nx to build these dependencies under the hood. This roundabout way of calling one tool
from the other (and back again) could definitely be improved and we might look into having a more straightforward
integration later.
For the generate UI, we were able to keep it as a single app. Using different configurations for the `build` target,
were including the different stylesheets needed for each configuration and copying the files to where they need to be.
## Looking ahead
In the upcoming releases, we plan to integrate more features that already exist in VSCode like the nx project view as
well as add more IntelliJ-native functionality and quality-of-life changes. Our goal is to provide the same experience
and level of productivity, regardless of which IDE you prefer to use. You can join the discussion and vote on what you
think should be added on [the roadmap issue on GitHub](https://github.com/nrwl/nx-console/issues/1578).
We are also looking into automatic type generation for both TypeScript and Kotlin. Currently, all return types of the Nx
Language Server have to be maintained in both languages, but maybe we could use a tool
like [Dukat](https://github.com/Kotlin/dukat). This would help us to save time and reduce the risk of inconsistencies
between the TypeScript and Kotlin codebases.
**Learn more**
- 🎮 [Nx Console GitHub](https://github.com/nrwl/nx-console)
- 🚀 [Nx Console JetBrains plugin](https://plugins.jetbrains.com/plugin/21060-nx-console)
- 🤖 [Nx Console VSCode extension](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -0,0 +1,213 @@
---
title: 'Nx 15.8 — Rust Hasher, Nx Console for IntelliJ, Deno, Node and Storybook'
slug: 'nx-15-8-rust-hasher-nx-console-for-intellij-deno-node-and-storybook'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-03-08/2gKrC6_Yx3hVkQaHxnw5xw.png'
tags: [nx, release]
---
Just weeks after the [release of Nx 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning) (release video [here](https://www.youtube.com/watch?v=IStJODzZSoc)), the Nx team has now launched Nx 15.8, with exciting new features and enhancements aimed at improving developer experience, productivity, and efficiency. Lets dive straight in.
**Table of Contents**
· [Rustifying the Nx Hasher](#rustifying-the-nx-hasher)
· [Deno Support](#deno-support)
· [Nx Console — IntelliJ Support](#nx-console-intellij-support)
· [Nx Console Field Prioritization (x-priority)](#nx-console-field-prioritization-xpriority)
· [Modular Node Applications](#modular-node-applications)
· [Storybook](#storybook)
· [How to Update Nx](#how-to-update-nx)
· [Learn more](#learn-more)
## Prefer a video? Weve got you covered!
{% youtube src="https://www.youtube.com/watch?v=4XdHT5Y7zj4" /%}
## Heads-up: Release Live stream tomorrow
We have the Nx live stream on Thursday, March 9th at 7 PM CET, to talk about all the features that went into Nx 15.7 and 15.8. So tune in to ask your questions :)
Enable notifications here:
[https://www.youtube.com/live/P3TinTe3O2g?feature=share](https://www.youtube.com/live/P3TinTe3O2g?feature=share)
## Rustifying the Nx Hasher
Starting with Nx 15.8, we now have a Rust-based Hasher enabled by default!
Performance is at the core of what we do at Nx. Hence it isnt surprising that Nx is the fastest JS-based monorepo solution out there. Weve shown [that a couple of times](https://github.com/vsavkin/large-monorepo). But every millisecond counts! As such, we decided to experiment with Rust to see whether we could further optimize our project graph creation as well as the hasher function that is used for the [computation cache](/features/cache-task-results).
Our original implementation used Git to calculate the hash. But it had some downsides as
- it didnt work if you dont have or use Git (obviously)
- it didnt work if you used Git submodules
- it became super slow if you had a lot of file changes on your Git working tree, like when switching between branches
- it triggered a lot of `execSync` calls to get different git status which was a fragile implementation
In some situations where we couldnt rely on or use the Git hasher, we did a fallback to a node implementation which made things even slower.
**All nice and good, but show me the numbers!**
So we did run some experiments on a small repo:
- avg. time for Rust hasher: 17ms
- avg. time for Git hasher: 24ms
We also tried it on the [Nx repository](https://github.com/nrwl/nx) itself:
- Rust hasher: 50ms
- Git hasher: 69ms
When running these tests on Windows (not WSL), the Nx repo hashing timings turned out to be
- Rust hasher: 72ms
- Git hasher: 330ms
Right now, we only observed the Rust hasher to be slightly slower on large repositories when you dont have any changes. Once you start making changes the Git hasher becomes slower again and is overtaken by the Rust version which remains stable in performance.
An interesting side-effect of using the Rust-based hasher is the size of the generated hashes, which are much smaller and thus allow for a quicker serialization between the [Nx Daemon](/concepts/nx-daemon) and Nx.
**Future work**
While we started with the hasher optimization, the next implementation were exploring is using a binary format to communicate between the Nx Daemon and the Nx client. Currently, we serialize the JSON to a string and pass that through an IPC socket. Using a binary format will significantly speed up the communication here.
**Opting out**
We build the binary for the Rust hasher for:
- macOS x64
- macOS arm
- linux arm
- linux gnu
- linux musl
- windows arm64
- windows x64
As such, it should work on most CI and local developer machines. If we missed something, please reach out an [open an issue on GitHub](https://github.com/nrwl/nx)! In case something breaks though, you can also disable the Rust hasher by using the environment variable `NX_NON_NATIVE_HASHER=true`.
## Deno Support
{% youtube src="https://youtu.be/NpH8cFSp51E" /%}
Nx Deno support [already landed in 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning), but didnt make it into the blog post. So here we go: we have a brand new Nx Deno plugin published at `@nrwl/deno`. For now, it is experimental and lives in our [labs repository](https://github.com/nrwl/nx-labs).
This plugin features the ability to generate Deno applications and libraries inside of an Nx workspace. Obviously, all the other much-loved Nx features such as caching, affected commands and the project graph visualization work out of the box as well.
To use Deno in an existing Nx workspace, just install the `@nrwl/deno` plugin:
```
npm i -D @nrwl/deno
```
Then run the generator to create a new application:
```shell
npx nx g @nrwl/deno:app mydenoapp
```
Or generate a new library with:
```shell
npx nx g @nrwl/deno:lib mydenolib
```
Were excited to see folks welcome in Deno APIs to their Nx workspaces and be able to easily share their Typescript packages across Deno, Node, and web applications, all inside the same monorepo.
Given this is still experimental, were more than happy to receive feedback and hear about ways you are using Deno right now and/or plan to use it in an Nx workspace.
To see some of this in action, be sure to check out our [recent livestream with Caleb and Chau](https://youtu.be/Um8xXR54upQ), two of our engineers that have been working on this plugin:
## Nx Console — IntelliJ Support
{% youtube src="https://youtu.be/xUTm6GDqwJM" /%}
Developer tool CLIs are known for being, well, command-line interfaces. Nx comes with many such CLI commands for scaffolding projects, running tasks, and more. We wanted to make some of this more approachable, so we introduced Nx Console, an extension to the Visual Studio Code editor. And it turned out to be highly successful. Nx Console now has over 1.2 million downloads on the [Visual Studio Code marketplace](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console). We kept improving it over the years,
- adding support for [rendering the Nx graph](https://youtu.be/ZST_rmhzRXI)
- [providing IntelliSense](https://twitter.com/NxDevTools/status/1573323012476051456) support for Nx configuration files
- [integrating Nx Cloud](https://youtu.be/WfWmK1x52HE)
With the growing popularity, the ask for an equivalent extension for JetBrains IntelliJ & WebStorm editors got louder and louder. At Nx, were lucky to have an awesome community. [Issam Guissouma](https://twitter.com/iguissouma) and [Edward Tkachev](https://twitter.com/etkachev) from the Nx community jumped in and provided their implementation of Nx Console for IntelliJ.
Since our team [now works full-time on Nx](/blog/from-bootstrapped-to-venture-backed) and the surrounding tooling, we decided to have a dedicated Nx Console extensions for IntelliJ and WebStorm that is actively maintained and developed by the core team. We reached out to Issam and Edward and started collaborating on it. The result can now be installed from the JetBrains marketplace:
[https://plugins.jetbrains.com/plugin/21060-nx-console](https://plugins.jetbrains.com/plugin/21060-nx-console)
Read all the details [on our blog post](/blog/expanding-nx-console-to-jetbrains-ides) or check out our docs page about [integrating with editors](/getting-started/editor-setup).
## Nx Console Field Prioritization (x-priority)
{% youtube src="https://youtu.be/JJ12zKedwIs" /%}
Nx Console has proven a highly valuable tool for exploring Nx generators. Especially if you cannot recall all the various parameters, you can possibly pass. And sure, you could always pass the `--help` or browse [the docs](/nx-api/react/generators/library), but it is just less convenient.
![](/blog/images/2023-03-08/xFSreZ1G_zifIsdf.avif)
With a growing number of parameters that a generator can take, it started to get messy and overwhelming. Furthermore, in 80% of the cases, you would probably need the main parameters such as the name, bundler, and directory where to generate the output.
This is the main reason we introduced a `x-priority` flag to our generator metadata, to have a way to prioritize certain flags and show them more prominently to the end user. Available values are `important` and `internal`.
The property can be defined for the desired parameters in the generators `schema.json`:
```json
{
"directory": {
"description": "The directory of the new application.",
"type": "string",
"x-priority": "important"
}
}
```
All required properties and those marked with an `x-priority: important` will be shown at the top of both, the CLI output (when using `--help`) as well as the Nx Console UI.
![](/blog/images/2023-03-08/eDOHabm8ca96lwul.avif)
Read all about it [in the doc about Customizing Generator Options](/extending-nx/recipes/generator-options).
## Modular Node Applications
Nx has had Node backend support since the beginning, where you could add an [ExpressJS](/nx-api/express) or [Nest.js](/nx-api/nest) based application to your monorepo. This is a powerful approach as it allows you to colocate your frontend and backend code, which helps share code and, in particular, TypeScript types for your APIs!!
In [Nx 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning), we then announced [Nx Standalone Projects](https://youtu.be/qEaVzh-oBBc) support for Node. This allows to develop a Node backend in isolation but still leverages all the features from Nx in terms of code generators, automated migrations, and speed features such as [affected commands](/ci/features/affected), [caching](/concepts/how-caching-works), and [optimized CI setups](/ci/features/distribute-task-execution).
In 15.8, we kept improving our Node support. Our main focus was on
- allowing to have a non-bundled output, while still being able to modularize the codebase with local libraries
- generating a pruned lock file when building in production mode
- improving our docker setup to account for non-bundled output and properly install node packages
Check out the following video walkthrough on using these features for modularizing a Fastify application:
{% youtube src="https://youtu.be/LHLW0b4fr2w" /%}
## Storybook
Nx now generates stories using [Component Storybook Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). If you are using our `@nrwl/react:storybook-configuration`, `@nrwl/angular:storybook-configuration`, `@nrwl/react:stories` and `@nrwl/angular:stories` generators, you will notice that the stories are now generated in the new format. You can check out our documentation for [Storybook and Angular](/recipes/storybook/overview-angular) or [Storybook and React](/recipes/storybook/overview-react) to see the new syntax.
As the Storybook doc mentions, CSF3 _reduces boilerplate code and improves ergonomics. This makes stories more concise, faster to write and easier to maintain._
You can migrate your existing stories in your Nx workspace to CSF3 using the Storybook [`csf-2-to-3` migrator](https://storybook.js.org/blog/storybook-csf3-is-here/#upgrade-to-csf3-today):
```shell
npx storybook@next migrate csf-2-to-3 --glob="**/*.stories.ts"`
```
## How to Update Nx
Updating Nx is done with the following command and will update your Nx workspace dependencies and code to the latest version:
```shell
npx nx migrate latest
```
After updating your dependencies, run any necessary migrations.
```shell
npx nx migrate --run-migrations
```
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
- 🚀 [Speed up your CI](/nx-cloud)
@@ -0,0 +1,82 @@
---
title: 'Rspack — Getting up to speed with Nx'
slug: 'rspack-getting-up-to-speed-with-nx'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-03-10/fWQ53mw2itEs3SGAOJVonQ.png'
tags: [nx]
---
At Nx, we are excited to see the JavaScript tooling ecosystem evolve, particularly when it comes to improving speed! Performance is at the core of Nx. Faster tools with which we can integrate make our lives easier and allow us to provide a better experience for developers.
Almost a year ago [ByteDance](https://www.bytedance.com/) started developing a new, faster Webpack alternative: **Rspack**. [Valor Software](https://valor-software.com/) joined the collaboration and reached out to us about developing a dedicated Nx plugin. The goal: give developers an easy onboarding path to Rspack and React!
## Faster than Webpack? What is Rspack?
Rspack is a rewrite of Webpack with the primary goal of improving performance. Rust is the main language, allowing for a highly parallelized architecture that takes full advantage of modern multi-core CPUs. In addition, it also comes with essential bundling features already built-in to avoid further bottlenecks from 3rd-party packages. It also highly optimizes HMR (Hot Module Replacement) using a specialized incremental compilation strategy.
ByteDance developed Rspack to solve performance issues they faced when developing and maintaining their internal monolithic applications, all of which rely heavily on complex Webpack configurations. Rspack being a rewrite allows to rely on Webpacks mature architecture and is, at the same time, an easy drop-in replacement.
ByteDance already applied Rspack on some of their internal business applications and has seen between 5 to 10x improvement in compilation performance.
More on the official Rspack docs: [https://rspack.dev](https://rspack.dev/)
## Getting up to speed with Rspack & Nx!
Our goal at Nx is to be the best CLI for your framework of choice. We want to remove friction so developers can easily leverage these new tools and focus on shipping features using a production-ready setup. This is why we developed a dedicated Rspack plugin that lets everyone quickly get up to speed.
Check out the following video for a complete walkthrough of how Nx and Rspack work together to create production-ready React applications.
{% youtube src="https://youtu.be/jGTE7xAcg24" /%}
## React Standalone App with Rspack
You can create a new Rspack-based React application using the following command:
```shell
npx create-nx-workspace myrspackapp --preset=@nrwl/rspack
```
This creates a pre-configured setup with React, TypeScript, ESLint, Jest (optionally Vite), Cypress for e2e testing, and obviously Rspack as the bundler.
All the usual Nx features, such as
- [affected commands](/ci/features/affected)
- [computation caching](/features/cache-task-results)
- remote caching with [Nx Cloud](/nx-cloud)
..work out of the box.
But not just the “speed features”. All the code generators, automate code migrations, and [code editor extensions](/getting-started/editor-setup) work too.
## Rspack in an Nx Monorepo
Similarly, you can use Rspack-based applications in existing Nx monorepos. Just install the NPM package:
```
npm i @nrwl/rspack -D
```
Then generate a new application:
```shell
npx nx g @nrwl/rspack:app myrspackapp
```
This creates a new application in your Nx monorepo that uses Rspack as the bundler. You can even import existing React libraries, which can also be an excellent way to experiment with Rspack in an existing production setup.
## Wrapping up
Go and learn more on the
- official Rspack website: [https://rspack.dev](https://rspack.dev/)
- learn about the Nx Rspack plugin: [/nx-api/rspack](/nx-api/rspack)
## Learn more
- 🦀 [Rspack and Nx docs](/nx-api/rspack)
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
- 🚀 [Speed up your CI](/nx-cloud)
+122
View File
@@ -0,0 +1,122 @@
---
title: Nx Cloud 3.0 — Faster Cache, More Powerful DTE, Better Ergonomics
slug: 'nx-cloud-3-0-faster-more-efficient-modernized'
authors: [Juri Strumpflohner]
cover_image: '/blog/images/2023-04-19/featured_img.webp'
tags: [nx, nx-cloud]
---
It has been almost 2 years since we released [Nx Cloud 2.0](/nx-cloud). Since then, it has saved over 400 years of computation by leveraging its distributed caching and task execution. And we keep adding 8 years every single week. Not only does this tremendously [impact our environment](/blog/helping-the-environment-by-saving-two-centuries-of-compute-time), but it also helps developers be more productive and companies save money.
In the last couple of months we have quadrupled the team and have done some amazing things. And we have some big plans for what is coming next. Heres all you need to know!
**Table of Contents**
- [New, Streamlined UI](#new-streamlined-ui)
- [Prefetching and Faster Cache Uploading](#prefetching-and-faster-cache-uploading)
- [DTE Just got Better](#dte-just-got-better)
- [Direct Integration With GitHub, GitLab and Bitbucket](#direct-integration-with-github-gitlab-and-bitbucket)
- [Enterprise Support](#enterprise-support)
- [New, Simplified Plans and Pricing Model](#new-simplified-plans-and-pricing-model)
- [Coming Next](#coming-next)
- [Learn more](#learn-more)
**Prefer a Video? Weve got you Covered!**
{% youtube src="https://www.youtube.com/embed/cG2hEI5L3qI?si=9frDSD8_HK1iTNEi" /%}
## New, Streamlined UI
This latest release of Nx Cloud comes with a new, streamlined design that offers users a more modern and visually appealing experience. This includes the main [Nx Cloud website](/nx-cloud), where we improved our messaging, including interactive visualizations to better explain some core concepts around remote caching and distributed task execution.
![](/blog/images/2023-04-19/bodyimg1.webp)
The Nx Cloud application — showing your runs, cache saved, and stats — also got a significant overhaul, making the UI more lightweight and easier to parse.
![](/blog/images/2023-04-19/bodyimg2.webp)
More UI-related updates and improvements are already underway.
## Prefetching and Faster Cache Uploading
![](/blog/images/2023-04-19/bodyimg3.webp)
At Nx, we are performance addicts! Especially when it comes to local development, every millisecond counts! In the latest update of the Nx CLI, we added the ability to **offload some of the remote cache management to the [Nx Daemon](/concepts/nx-daemon)**. As a result you no longer have to wait for the cache to upload. This saves valuable time, allowing the command to complete instantly and immediately providing you with the necessary link.
We also **prefetch cache results in the background** to have them ready when needed.
Both optimizations can save seconds.
## DTE Just got Better
![](/blog/images/2023-04-19/bodyimg4.webp)
[Distributed Task Execution (short DTE)](/ci/features/distribute-task-execution) is a core part of what makes Nx Cloud stand out compared to other solutions. And we made some significant improvements to both the ergonomics and speed.
**Identify failed tasks early** — You can now view information about the in-progress DTEs, allowing you to quickly identify and address any failed functions without waiting for the command to complete.
**Simplified CI setup** — We simplified the setup process for most CI systems, eliminating the need to pass environment variables manually. Instead, everything is automatically derived from the context.
**Improved performance and efficiency** — Nx Cloud now intelligently figures out which tasks will be cache hits before sending them to agents. Rather it can directly send them to the main job, reducing unnecessary round trips and drastically speeding up CI runs.
**Efficient agent management** — We have introduced a new command, `npx nx-cloud start-ci-run stop-agents-after=e2e`, that allows you to notify Nx Cloud when specific commands, such as long-running e2e tasks, have started. This helps Nx Cloud proactively identify and shut down agents that will not be needed, improving compute efficiency.
**Reduce fix costs** — Even though cache hits are basically free, spinning processes still have fixed costs. We fixed that (see what I did there) by leveraging a new Nx feature that allows to have a long-running process on an agent to which we can arbitrarily feed new tasks. This removed the DTE overheads and also improved the predictability of runs.
## Direct Integration With GitHub, GitLab and Bitbucket
Our GitHub integration has been enhanced. Now, the list of runs is updated in real-time as soon as they are created or their status changes, providing developers with up-to-date information directly on GitHub.
![](/blog/images/2023-04-19/bodyimg5.webp)
In addition to the GitHub, we expanded our Nx Cloud live status updates to work on GitLab and BitBucket.
![](/blog/images/2023-04-19/bodyimg6.webp)
## Enterprise Support
![](/blog/images/2023-04-19/bodyimg7.webp)
We have extensive experience working with Fortune 500 companies, helping them scale their development using monorepos. This has given us valuable insight into the unique security requirements of these companies. Our [Enterprise plan](/enterprise) reflects that allowing organizations to have a **fully self-contained version of Nx Cloud** that can be **hosted on their own servers** and comes with dedicated support from the Nx and Nx Cloud core team.
Weve recently made a couple of improvements to our enterprise offering.
- **Helm Charts** — We added a **Helm chart** to simplify the process of deploying Nx Cloud to on-premises infrastructure, allowing organizations to quickly set up and manage their own instance of Nx Cloud within their secure environment.
- **Stability improvements** — We significantly reworked our on-premises solution to be identical to our SaaS deployment. This revamp resulted in a more robust and reliable on-premises deployment of Nx Cloud, ensuring enterprise-grade performance and reliability.
- **SSO** — We now support AWS Identity and Access Management (IAM) for seamless integration with existing AWS environments and the SAML protocol for a more flexible single sign-on integration across various providers. This enables organizations to leverage their existing identity management systems for authentication and authorization.
Learn more at [enterprise](/enterprise).
## New, Simplified Plans and Pricing Model
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.
![](/blog/images/2023-04-19/bodyimg8.webp)
Our Free plan allows one administrator and up to 300 CI pipeline executions per month. Our Pro plan allows more administrators, and uncapped CI pipeline executions, with a flat fee and incremental charges per 100 CI pipeline executions. The OSS plan comes with unlimited CI pipeline executions. Nx has been open source from the beginning and we care a lot about that ecosystem. So this is our contribution to help OSS projects and make their CI pipeline executions faster.
Finally, the **Enterprise plan** is for companies that want full control over where their data is hosted, get hands-on, dedicated support from the Nx & Nx Cloud team, and enterprise features such as SSO & SAML-based authentication support.
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 [/pricing](/pricing).
## Coming Next
Weve got some big plans for Nx Cloud. You really want to write your CI script by focusing on what you want to achieve rather than thinking about making it fast. Were going to make this happen!
The current Distributed Task Execution (DTE) already goes a long way, but you still have to provision the agents by yourself. Providing the correct number of agents is crucial for maximizing efficiency and reducing idle time. And it is not even a static number but might depend on the actual run itself. Nx has extensive knowledge about the structure of the workspace and according tasks. We want to leverage that information. Imagine a setup where you have a roughly 20 line CI config for a repo with hundreds of developers and Nx Cloud automatically determines for each run the ideal number of agents required, provisions them, distributes all tasks efficiently and then disposes all agents again. All fully automatically. And it will be fast. To the point where you wouldnt even need your Jenkins, CircleCI etc at all.
In addition, we are actively exploring ways to provide advanced analytics for your workspace, including insights into the frequency and duration of specific tasks. This valuable information can help identify large tasks that could benefit from being broken down into smaller ones, leveraging caching and other speed improvements to optimize performance. Stay tuned for more to come!
---
## 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](/nx-cloud)
+142
View File
@@ -0,0 +1,142 @@
---
title: 'Nx 16 is Here!'
slug: 'nx-16-is-here'
authors: ['Zack DeRose']
cover_image: '/blog/images/2023-05-02/n8JTIcKSYkebBOl8zZuF9w.png'
youtubeUrl: 'https://youtu.be/JIhOyJtuxEA'
tags: [nx, release]
---
Were proud to announce the release of Nx version 16! In this article, well go over the major updates from Nx 16 and the key pieces of information youll need to know for the changes that Nx 16 brings!
But before we jump into the new features of Nx 16, lets recap some of the recent features from our Nx 15 minor releases!
- We introduced simpler presets for React, Angular, and [Node starter applications](https://youtu.be/K4f-fMuAoRY)
- We added official support for [Vite](/nx-api/vite) and Vitest for integrated Nx monorepos
- We introduced an [official Deno plugin](https://youtu.be/NpH8cFSp51E), including integration for Node and Deno project collocation and project graph support for Deno imports
- We added Rust into the Nx codebase to speed up core functionality
- We added support for [non-npm workspaces](https://youtu.be/QOhdL02f6BY) to support workspaces focused on other languages like C#, Java, and Kotlin, and saw some of those in action with community plugins for [.NET](https://www.nx-dotnet.com/) and [Java/Kotlin](https://github.com/tinesoft/nxrocks)
- Introduced [Nx Console for JetBrains IDEs like IntelliJ and WebStorm](https://youtu.be/xUTm6GDqwJM)
- We have [decoupled the Nx version from Angular](https://youtu.be/AQV4WFldwlY) versions allowing you to update Nx without updating Angular
### Table of Contents
· [Heres how to Upgrade with Nx Migrate](#heres-how-to-upgrade-with-nx-migrate)
· [Rescoping From @nrwl/_ to @nx/_](#rescoping-from-nrwl-to-nx)
· [Deno Standalone Apps, Edge Deployment and More](#deno-standalone-apps-edge-deployment-and-more)
· [Cypress Feature Testing](#cypress-feature-testing)
· [Task Graph](#task-graph)
· [The Nx Repo Switches to PNPM for its Package Manager](#the-nx-repo-switches-to-pnpm-for-its-package-manager)
· [Learn more](#learn-more)
## Heres how to Upgrade with Nx Migrate
As with all new Nx releases, `nx migrate` can be used to bump your Nx packages to the appropriate version, as well as run any necessary changes to your codebase.
To update to Nx 16, run
```
nx migrate latest
```
This will update your dependencies to the latest version, as well as update those dependencies in your root `package.json` file.
If further migrations are available, youll see a `migrations.json` file in the root of your workspace. This file will describe any further code generation scripts that should be run. To run these, use the command..
```
nx migrate --run-migrations
```
…as prompted in the terminal.
After the migrations have been run, you should be able to see them in your source control tools. Ensure that everything is still working properly by running any automated testing you have set up.
Check out this real-world example using the `nx migrate` command for the `Tanstack/query` repo:
{% youtube src="https://youtu.be/X1I1Aw2sV-Y" /%}
Also as a reminder to our Angular users — weve now **decoupled the Nx version from Angular versions**, so as long as youre on an LTS version of Angular, youre clear to migrate to the latest Nx version without having to touch your Angular version! To do so, be sure to use the `interactive` option (e.g. `nx migrate --interactive`). Check out this video for more info:
{% youtube src="https://youtu.be/AQV4WFldwlY" /%}
## Rescoping From @nrwl/_ to @nx/_
{% youtube src="https://youtu.be/HzkvhPKAepA" /%}
One of the more impactful changes from Nx 16 is that well be changing the npm scope that we publish our packages under from `@nrwl` to `@nx`. In other words, `@nrwl/react` will now be published as `@nx/react`.
Nx will handle this migration automatically via the `nx migrate` command to update your workspaces!
To ensure that community plugins are not broken, the `@nrwl/*` versions of these packages are deprecated but will continue to be published until Nx 17 which is scheduled for October 2023.
## Deno Standalone Apps, Edge Deployment and More
Nx has had support for developing Node-based backends for a while. It was a popular choice for building your BFF in a monorepo-based setup alongside your React or Angular application. [In Nx 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning) we decided to expand that support and really go deep into improving the overall DX.
**Deno got quite some love** in this iteration:
- Standalone App support — You can now scaffold a new single-project Deno workspace with Nx. Just run `npx create-nx-workspace --preset=@nx/deno`. Probably the fastest way to get up and running with Deno
- We also added Nx generators to set up Deno with [oak](https://oakserver.github.io/oak/). Just pass the `--framework` option when you set up a new Deno app (or use [Nx Console](/getting-started/editor-setup))
Its all about **Edge functions** recently (and, well, serverless in general). Especially when developing with Node it is common that you might want to deploy to the Edge or some serverless environment. Therefore, we..
- created a brand new `@nx/netlify` package (currently [in labs](https://github.com/nrwl/nx-labs/tree/main/packages/netlify)) which allows you to set up a brand new project for developing and pushing Netlify functions, or you can add serverless deployment support to an existing project, using the `@nx/netlify:setup-serverless` generator. Check out our in-depth recipe on the topic: [/recipes/node/node-serverless-functions-netlify](/recipes/node/node-serverless-functions-netlify)
- published anew `@nx/aws-lambda` for deploying [Lambda functions](https://aws.amazon.com/lambda/) to AWS. All details in our latest recipe: [/recipes/node/node-aws-lambda](/recipes/node/node-aws-lambda)
- Improved our existing Deno package to add support for serverless deployment to both Deno Deploy as well as Netlify. Such support can be added to an existing app using the `@nx/deno:setup-serverless` generator and providing the `--platform` flag that either point to `deno-deploy` or `netlify`.
## Cypress Feature Testing
{% youtube src="https://youtu.be/d5i9_Y8Ip54" /%}
Nx sets up e2e tests for apps that tend to collect many features. This ends up as a large atomic suite that Nx isnt good at separating out. With Nx 16, weve made it easier to distribute these tests closer to the actual feature they test. This will make it much easier for `nx affected` to determine which tests are actually necessary.
I also had the opportunity to have a live stream with Nxs own Caleb (who lead most of the development for this feature), as well as Cypresss Jordan Powell who also contributed to this effort — check it out:
{% youtube src="https://youtu.be/y3gFRSqarEo" /%}
## Task Graph
Nx 16.0 also introduces more helpful tools for visualizing your project and task graph as determined by Nx:
{% youtube src="https://youtu.be/9_Y6Mop-Kac" /%}
The task graph in particular is helpful for visualizing what actually runs when you run commands, and with Nx 16.0, you can now use the `--graph` option when running most Nx commands to visualize the graph of tasks that would have run - for example:
```
nx build react --graph
```
The task graph was also highlighted in a recent video demonstrating feature parity between our VsCode and JetBrains plugin:
{% youtube src="https://youtu.be/XCoeNiyM6hw" /%}
## The Nx Repo Switches to PNPM for its Package Manager
Internally, the [Nx repo](https://github.com/nrwl/nx) switched to using `pnpm` as its package manager. Since switching we have noted the following advantages:
- publish is 2x faster
- CI times decreased
- install times decreased
While we are using `pnpm` as our package manager, we are not using the `pnpm` workspaces functionality in the Nx repo, but we've found that Nx actually works extremely well with `pnpm` workspace setups. Juri had released [an article on this topic](/blog/setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx) previously, and we used this approach to introduce Task Caching and Distributed Caching (via Nx and Nx Cloud) to [the Tanstack/query repo](https://github.com/TanStack/query), which yielded excellent results:
{% youtube src="https://youtu.be/NvPXK6DVZGE" /%}
## Wrapping up!
Thats about it for Nx 16.0 — weve really loved the opportunity to bring you all this cool stuff, and were eager to start our next iteration with a steady focus on making Nx an awesome tool for increasing your productivity by taking all the repo management tasks out of the equation so you can focus on shipping great stuff.
### Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [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](/nx-cloud)
### More Nx Release Notes:
- Nx 15.3: [/blog/nx-15-3-standalone-projects-vite-task-graph-and-more-3ed23f7827ed](/blog/nx-15-3-standalone-projects-vite-task-graph-and-more)
- Nx 15.4: [/blog/nx-15-4-vite-4-support-a-new-nx-watch-command-and-more](/blog/nx-15-4-vite-4-support-a-new-nx-watch-command-and-more)
- Nx 15.7: [/blog/nx-15-7-node-support-angular-lts-lockfile-pruning](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning)
- Nx 15.8: [/blog/nx-15-8-rust-hasher-nx-console-for-intellij-deno-node-and-storybook](/blog/nx-15-8-rust-hasher-nx-console-for-intellij-deno-node-and-storybook)
@@ -0,0 +1,30 @@
---
title: 'Introducing the Nx Champions Program'
slug: 'introducing-the-nx-champions-program'
authors: ['Isaac Mann']
cover_image: '/blog/images/2023-05-16/cVGLh0H-uOpy7-D6.png'
tags: [nx]
---
The Nx community is too large to be adequately supported by the Nx team alone. Luckily, there are many people who volunteer their time and expertise to help others and share how they use Nx to solve their problems. We are launching the Nx Champions program as a way of acknowledging the work of key members of the community and supporting them in their ongoing efforts.
### What Does Champion Mean?
Champion is both a noun and a verb and the champion in Nx Champions is intended in both ways. Nx Champions have achieved a champion level of knowledge and expertise in some area of Nx. They also champion Nx to the community through content like blog posts, videos and conference talks or by contributing code through plugins or the Nx repo itself. In addition, they champion the ideas of the community back to the Nx team.
### Who are the Nx Champions?
A full list of Nx Champions is available at [/community](/community).
![](/blog/images/2023-05-16/j58ocCsWEnDe4-8ZMsQd5g.avif)
_List of Nx Champions_
We appreciate everyone who was part of the initial group of Nx Champions, but acknowledge that there are more people who could qualify. If you are interested in joining the program, fill out the [application form](https://forms.gle/wYd9mC3ka64ki96G7) and lets talk about it.
## Learn more about Nx
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 🐥 [Nx Twitter Handle](https://twitter.com/NxDevTools)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -0,0 +1,113 @@
---
title: 'Determine your User Location with Netlify Edge Functions'
slug: 'determine-your-user-location-with-netlify-edge-functions'
authors: ['Nicholas Cunningham']
cover_image: '/blog/images/2023-05-26/G2ynKDm6DIKLcZ2fJlV0dw.png'
tags: [nx, tutorial]
---
Today, we will explore how to use `@nx/netlify` serverless functions to determine a users location. This can be an incredibly useful feature in various applications, such as customizing user experiences based on their region, displaying localized content, or tracking user demographics for marketing purposes. In this post, well walk you through a step-by-step guide on implementing this functionality using `@nx/netlify` serverless functions.
Before we get started though, heres a video introduction to the new `@nx/netlify` package:
{% youtube src="https://youtu.be/idH6GCkWq0w" /%}
### Step 1: Set up your Nx workspace with Netlify
To get started, you need to have an Nx workspace. If you havent already, create a new Nx workspace by running:
```shell
npx create-nx-workspace user-location --preset=@nx/netlify
```
This should create a default function inside `src/functions/hello/hello.ts`, which can be _safely deleted_ if necessary.
### Step 2: Create a serverless function
```
mkdir src/functions/user-location
touch src/functions/user-location/user-location.ts
```
### Step 3: Determine the users location
To determine the users location, we will leverage the `request.headers` object, specifically the `x-forwarded-for` header containing the users IP address. We can then use an IP geolocation API like ipapi ([https://ipapi.co/](https://ipapi.co/)) to fetch location data based on this IP address.
_Note_ in **Node.js 18**, the experimental global fetch API is available by default. If you are using a node version **lower** than **18** you can install `node-fetch` to handle API requests:
```
npm install node-fetch
```
Now, update the `user-location.ts` file with the following code:
```
import { Handler } from "@netlify/functions";
import fetch from "node-fetch"; // Can be removed if node >= 18
export const handler: Handler = async (event, _) => {
const ip = event.headers["x-forwarded-for"];
const url = `https://ipapi.co/${ip}/json/`;
try {
const response = await fetch(url);
const data = await response.json();
return {
statusCode: 200,
body: JSON.stringify({
location: {
city: data.city,
region: data.region,
country: data.country,
},
}),
};
} catch (error) {
return { statusCode: 500, body: `Error fetching user location` };
}
};
```
### Step 4: Deploy your serverless function
When we created our workspace, the initial scaffolding generated a **deploy-target** inside our `project.json`.
> A **target** is a specific task you can run for a project.
> You can think of it as a script/command that does a specific job. The most common targets are “build”, “serve”, “test”, “lint”, “deploy”, etc. For more information regarding `project.json` you can read about it at [project-configuration](/reference/project-configuration)
We can start off by creating our site on Netlify by running:
```shell
npx netlify init
```
After you have answered all the prompts your site should be created. A `.netlify` folder should be created with references to your newly created site.
Now, to deploy your serverless function run:
```
nx run deploy
```
Finally, navigate to your Netlify sites Functions tab, and you should see your `user-location` function deployed and ready to use!
For example, ours can be found at: [https://644a9b17d0299b00b581b33f--find-user-location.netlify.app/.netlify/functions/user-location](https://644a9b17d0299b00b581b33f--find-user-location.netlify.app/.netlify/functions/user-location)
```json
{ "location": { "city": "Miami", "region": "Florida", "country": "US" } }
```
By following these steps, youve successfully used `@nx/netlify` serverless function to determine a users location!
### Wrapping up
Never used Nx before? Learn more about Nx [here](/getting-started/why-nx).
[Official recipe from Nx](/recipes/node/node-serverless-functions-netlify)
[Github example](https://github.com/ndcunningham/nx-netlify-serverless)
### Learn more
🧠 [Nx Docs](/getting-started/intro)
👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
💬 [Nx Official Discord Server](https://go.nx.dev/community)
📹 [Nrwl Youtube Channel](https://www.youtube.com/@nxdevtools)
🚀 [Speed up your CI](/nx-cloud)
@@ -0,0 +1,182 @@
---
title: 'Introducing Nx Ecosystem CI'
slug: 'introducing-nx-ecosystem-ci'
authors: ['Katerina Skroumpelou']
cover_image: '/blog/images/2023-06-20/EffyLKcVe5gE_x3MT8PJUQ.png'
tags: [nx]
---
The JavaScript ecosystem evolves at a rapid pace, frequently introducing new tools and packages. At Nx, we provide out-of-the-box integrations with the most popular among them so you dont have to worry when stitching them together. That, however…yes you guessed it… can be a challenging task. Theres just one way to keep up: automation.
We already run a ton of automated testing on our repository to ensure we dont break anything. But given Nxs popularity and vast usage across open source and enterprise projects, we want to go a step further: introducing the [Nx Ecosystem CI](https://github.com/nrwl/nx-ecosystem-ci). Inspired by the work done by our friends on the [Vite](https://vitejs.dev/) team, the [Nx Ecosystem CI](https://github.com/nrwl/nx-ecosystem-ci) is designed to enhance the stability of Nx by testing pre-release versions with projects in the Nx ecosystem.
### Inspired by the Vite Ecosystem CI
The [Vite Ecosystem CI](https://github.com/vitejs/vite-ecosystem-ci) is an innovative tool that has significantly enhanced the use of [Vite](https://vitejs.dev/). It monitors the compatibility of Vite with various other packages and projects in the ecosystem by running tests against the latest changes in the Vite codebase and the projects it integrates with. This allows the Vite team to catch issues early and maintain a high level of stability, ensuring that developers using Vite can trust that new contributions to either Vite or their project will not result in breaking changes.
This robust testing system is essential because it gives users confidence in Vites reliability, encouraging more developers to adopt Vite. Its a great example of proactive testing in a fast-paced ecosystem and an inspiration for other projects, including Nx. The concept of the Ecosystem CI introduces a framework-agnostic way of testing integrations of one tool with other tools in the ecosystem. It puts together a “syntax” with which tools can easily find the way to test their latest versions with one another.
### Nx Ecosystem CI
The [Nx Ecosystem CI](https://github.com/nrwl/nx-ecosystem-ci) is a fork of the [Vite Ecosystem CI](https://github.com/vitejs/vite-ecosystem-ci) but is tailored specifically for the Nx ecosystem. Its designed to ensure that Nx maintains its high standards of reliability and compatibility with all our users.
### How Nx Ecosystem CI Works
The Nx Ecosystem CI works in the following way:
1. It clones the provided repo which uses Nx
2. It installs the projects dependencies
3. It runs a number of scripts specified by the projects author (eg. `test`, `build`, `e2e`)
4. It migrates the repository to the `next` version of Nx (using `nx migrate next`)
5. It runs the scripts again
6. It reports the results of the runs to the [Nx Official Discord Server](https://go.nx.dev/community)
in the `#ecosystem-ci` channel.
The main difference between the Nx Ecosystem CI and the Vite Ecosystem CI is that Nx Ecosystem CI uses the \`next\` version of Nx as published on npm, rather than cloning and building Nx locally, like Vite does in the Vite Ecosystem CI. This approach ensures that the tests run against the same code that developers are most likely to use in their projects. It also makes it easier for the script to migrate to that version.
At its core, the Nx Ecosystem CI is a set of command-line tools that run tests for a specific or all available suites. Each test suite corresponds to a specific configuration and consists of a set of commands executed in a given repository. The test suite checks for the correct execution of Nx commands, such as build, test, and e2e tests, ensuring that Nx functions as expected in different environments and projects.
### Adding a new test suite
To add a new test suite for your project in the Nx Ecosystem CI, you would need to create a new file under the tests directory. The name of this file should reflect the suite it represents, for example, [`nx-rspack.ts`](https://github.com/nrwl/nx-ecosystem-ci/blob/main/tests/nx-rspack.ts) .
The first step is to import the necessary modules and types from `utils.ts` and `types.ts` at the top of your file:
```typescript
import { runInRepo } from '../utils';
import { RunOptions } from '../types';
```
`RunOptions` is a type that represents the options for running a test suite. It includes properties such as the repository to test, the branch to use, and the commands to run for building, testing, and performing e2e tests (all optional).
Next, you need to define the `test` function that accepts the `RunOptions`. Within this function, youll call the `runInRepo` function, passing in the options as well as any specific properties required for your suite:
Again, using the example of `nx-rspack`:
```
export async function test(options: RunOptions) {
await runInRepo({
…options,
repo: 'nrwl/nx-labs',
branch: 'main',
build: ['build rspack'],
test: ['test rspack'],
e2e: ['e2e rspack-e2e'],
})
}
```
In this example, the suite is set up to run on the nrwl/nx-labs repository on the `main` branch. It will run `build rspack`, `test rspack`, and `e2e rspack-e2e` as its build, test, and e2e tests respectively. These commands will be invoked using the package manager used by your repository. So, in the `nx-labs` case, it will run `yarn build rspack` in the `nrwl/nx-labs` repo.
For this reason, adding a new test suite to the Nx Ecosystem CI also requires setting up appropriate `scripts` in your repositorys `package.json` file. These scripts provide the commands that will be invoked by your package manager to carry out the `build`, `test`, and `e2e` steps.
Heres an example of how scripts might be configured in a package.json file for a repository using Nx:
```
"scripts": {
"build": "nx build",
"test": "nx test",
"e2e": "nx e2e"
},
```
These scripts should be set up in such a way that they can be invoked directly by your package manager. For example, in a repository using `pnpm`, you could run the build script with the command `pnpm run build`.
When you create your test suite file, youll specify these script names in the `build`, `test`, and `e2e` properties of the `options` object passed to `runInRepo`.
```
export async function test(options: RunOptions) {
await runInRepo({
…options,
repo: 'nrwl/nx-labs',
branch: 'main',
build: ['build'],
test: ['test'],
e2e: ['e2e'],
})
}
```
With this setup, the Nx Ecosystem CI will run these scripts in your repository as part of its CI process, or just when you run `pnpm test <name-of-suite>` locally.
In addition to creating the test suite and setting up the package.json scripts, you will also need to add the name of the new suite to the workflow configuration files in the `.github/workflows` directory of the Nx Ecosystem CI repository. This suite name should match the filename of your test suite script.
There are two workflow files youll need to update:
- `.github/workflows/ecosystem-ci-selected.yml`
- `.github/workflows/ecosystem-ci.yml`
In `.github/workflows/ecosystem-ci.yml` youll find a strategy section with a `matrix` property. This `matrix` property specifies an array of suite names for the workflow to run. Youll need to add your new suite name to this array.
Heres what the strategy section might look like after adding a new suite named `my-new-suite`:
```
strategy:
matrix:
suite:
- ….
- nx-remix
- nx-rspack
- …
- my-new-suite # your new suite
```
By adding your suite name to this file, youre instructing the Nx Ecosystem CI to include your suite in its test runs.
In addition to the `.github/workflows/ecosystem-ci.yml` file, you also need to include your suite in the `.github/workflows/ecosystem-ci-selected.yml` file.
The `ecosystem-ci-selected.yml` workflow is designed to allow manual selection of a test suite to run. To add a suite to this workflow, you add it to the options array under `workflow_dispatch > inputs > suite`. Heres what it might look like with a new suite named `my-new-suite`:
```
on:
workflow_dispatch:
inputs:
suite:
description: "testsuite to run"
required: true
type: choice
options:
- ….
- nx-remix
- nx-rspack
- …
- my-new-suite # your new suite
```
Adding your suite name to this file allows it to be manually selected for a test run via the GitHub Actions interface. This manual selection process provides additional flexibility and control over the testing process, allowing you to run individual suites as needed.
### Reporting the results
The Nx Ecosystem CI is integrated with GitHub Actions, which helps with its automation process. The CI pipeline is scheduled to run three times a week (on Mondays, Wednesdays, and Fridays) and can also be triggered manually. The workflow uses a matrix strategy to run the suites in parallel. Each suite is given a big amount of memory, and the pipeline is configured with a long timeout, meaning that even if one suite encounters an error, the rest will continue to run. This ensures that we get comprehensive feedback on the health of all the test suites, regardless of individual failures. Once the test suites run, Github sends a message to the [Nx Official Discord Server](https://go.nx.dev/community)
`#ecosystem-ci` channel with the status of each suite, enabling the team and the community to view the results. Each result points to the Nx tag that was used, and also the job logs on GitHub.
Here is an example of a test run:
[https://github.com/nrwl/nx-ecosystem-ci/actions/runs/5144215568/jobs/9260227337](https://github.com/nrwl/nx-ecosystem-ci/actions/runs/5144215568/jobs/9260227337)
### Benefits for the Nx Community
The introduction of the Nx Ecosystem CI is a significant win for both the Nx team and the Nx developer community. For us, it enables us to catch issues early, often before they affect most end-users. By running tests against the \`next\` version of Nx, we can ensure that any changes we make are compatible with the various configurations that our users maintain.
For developers using Nx, the Nx Ecosystem CI offers reassurance that the tools they rely on are being actively tested and maintained. This provides confidence in the stability of Nx and its plugins.
### Ecosystem CI as part of the Open Source community
We are not alone in recognizing the value of an Ecosystem CI approach. Other OSS projects including Nuxt, VueJs, VolarJs, and Rspack, have also adopted this strategy. You can explore their implementations here:
- Nuxt: [https://github.com/nuxt/ecosystem-ci](https://github.com/nuxt/ecosystem-ci))
- VueJs: [https://github.com/vuejs/ecosystem-ci](https://github.com/vuejs/ecosystem-ci)
- VolarJs: [https://github.com/volarjs/ecosystem-ci](https://github.com/volarjs/ecosystem-ci)
- Rspack: [https://github.com/web-infra-dev/rspack-ecosystem-ci](https://github.com/web-infra-dev/rspack-ecosystem-ci)
- Storybook: [https://storybook.js.org/blog/storybook-ecosystem-ci/](https://storybook.js.org/blog/storybook-ecosystem-ci/)
As we continue to improve and refine the Nx Ecosystem CI, we remain committed to the goal of making Nx a reliable and integral part of your development workflow. If youre an open-source maintainer, you can create your own Ecosystem CI either from scratch (like Storybook) or by cloning the Vite Ecosystem CI. If your project uses Nx, you can easily add a new test suite for it.
## Learn more
- 👩‍💻 [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](/nx-cloud)
+334
View File
@@ -0,0 +1,334 @@
---
title: Nx Console gets Lit
slug: 'nx-console-gets-lit'
authors: [Max Kless]
cover_image: '/blog/images/2023-06-29/featured_img.webp'
tags: [nx, nx-console]
---
Over the last few weeks, we rebuilt one of Nx Consoles most liked features from the ground up: The Generate UI. It looks better, loads faster, and preliminary research shows using it makes you happier, too ;)
You can use it today by installing the latest version of Nx Console for VSCode and JetBrains IDEs! 🎉🎉🎉
- [Nx Console on the VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)
- [Nx Console on the JetBrains Marketplace](https://plugins.jetbrains.com/plugin/21060-nx-console)
If youre curious to learn more about the rewrite and the motivations behind it, this is the blog post for you! Well touch on these topics and more:
- Why did we choose to rewrite?
- Whats Lit and why did we use it over Angular?
- How did the rewrite go and what Lit features were important for us?
- What does the performance look like before and after?
{% youtube src="https://www.youtube.com/embed/p455D4W7330?si=FRbiKJhGxT8dYzf9" /%}
## Background: Why Migrate from Angular to Lit?
### A Short History of Nx Console
Lets go back in time: Nx Console has been around for a while. It first launched in 2018 — then called Angular Console — as a standalone Electron app which let you run Angular schematics and builders from a graphical interface. Of course, it was built with Angular and looked something like this:
![Screenshot of the original Angular Console electron app](/blog/images/2023-06-29/bodyimg1.webp)
In 2019, it was ported to a VSCode extension with the now familiar UI and support for the standalone app was dropped.
In 2020, support for the entire Nx ecosystem was added, it was renamed to Nx Console and an amazing transformation began: Today, Nx Console is much more than just a single form — it tightly integrates Nx into your IDE, gives you the overview of your projects that you need and puts your task-running just a click away.
### Rewriting in Lit
This evolution brought significant improvements to the usability of Nx Console and the value we could provide to developers, but not without presenting its own set of challenges. Inevitably, the codebase grew complex and convoluted over time — the context in which it ran changed, the scope of the product changed, yet the technology remained the same. Adding small features or fixing bugs became increasingly time consuming, and every PR compounded the problem.
The UI looked somewhat outdated and had been built with only VSCode in mind — which became painfully obvious when support for JetBrains IDEs was added. While the web-based nature of the Generate UI allowed us to reuse the code in the new environment, the design looked out of place.
In addition, we started questioning our usage of Angular. Angular is a great framework for building web apps, and in the original context of Angular Console, it made a lot of sense: A tool built by and for Angular engineers — of course its written in Angular. But things changed, and Angular started to feel overkill for what we needed. Angular has a huge number of features right out of the box. But for our simple form, we didnt need routing, http requests or modules to organize our code. The amount of boilerplate and overhead Angular introduces is significant.
So, ultimately, **we decided to pull the plug and rewrite the entire thing in [Lit](https://lit.dev/).**
Lit is a lightweight framework built on top of web components and “adds just what you need to be happy and productive: reactivity, declarative templates and a handful of thoughtful features to reduce boilerplate and make your job easier” (taken from their docs). We had used it before to [build the Nx Cloud view](/blog/nx-console-meets-nx-cloud) and were happy with the simple setup and great DX. So the decision to reuse it here was an easy one, since it allowed us to reuse code, build tooling and expertise. The rewrite also gave us the opportunity to improve the design for both supported IDEs and give the entire UI a clean, new coat of paint.
![Screenshot of the reworked generate ui](/blog/images/2023-06-29/bodyimg2.webp)
Before I dive deeper into specifics, lets have a look at the general architecture of Nx Console first.
## Nx Console Architectural Overview
Nx Console is composed of 3 core parts:
- The **nxls** is a language server based on the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) and acts as the “brain” of Nx Console. It analyzes your Nx workspace and provides information on it, including code completion and more.
- The **Generate UI** is the form-based view for running Nx generators.
- The **platform-specific wrappers**. These are written in Typescript and Kotlin and connect the rest of Nx Console to IDE-specific APIs. Having the other parts separate greatly reduces the amount of duplicated code we have to write in order to support multiple IDEs
This architectures modularity meant we could quickly switch out the Generate UI for a new version without significantly impacting the rest of the codebase — only the parts that actually render the UI and communicate with it had to be adjusted slightly. It also allowed us to ensure backward compatibility: the old generate UI is still available via a feature toggle in the settings.
If you want to dive deeper, there are many more resources on the architecture of Nx Console and how its built:
- [In-depth blog post about expanding to JetBrains IDEs](/blog/expanding-nx-console-to-jetbrains-ides)
- [Accompanying Youtube video by Zack DeRose](https://www.youtube.com/watch?v=xUTm6GDqwJM)
- [The Power of Nx Console — talk by Jon Cammisuli](https://www.youtube.com/watch?v=3C_9g9kt2KM)
## Migrating to Lit: Step by Step
To rebuild our UI, we first needed a new Lit app to work on. While theres no native Nx plugin for Lit, generating the code we need was still very straightforward:
`nx generate @nx/web:app apps/generate-ui-v2`
This generates an entire project for us, with a `tsconfig.json`, `index.html`, `main.ts`, and a `project.json`, where our Nx-specific config lives.
I also installed a couple of dependencies:
- The `@nx/esbuild` plugin because I like fast build times 🏎️
- TailwindCSS because I dont like writing CSS 🤫
- `@vscode/webview-ui-toolkit` because it does all of the VSCode work for me 🤖
This is really where Nx shines, because it allows you to take these tools and quickly patch them together and build a pipeline that does exactly what you need. And it also allows you to think about your workspace visually. This is what this is what my task graph for building the Lit app ultimately looks like:
![Nx task graph for building the Lit webview](/blog/images/2023-06-29/bodyimg3.webp)
You can see three build steps:
- `generate-ui-v2:_build` uses esbuild to bundle my Lit components written in Typescript and spits out a `main.js` file
- `generate-ui-v2:extract-dependencies` copies the third party assets we need into the dist folder. Right now its just codicons `.css` and `.ttf` files.
- `generate-ui-v2:build` finally runs tailwind over the bundled code. This could also be done with `postCss` or a custom `esbuild` plugin but running tailwind directly is the easier, so why complicate things?
> 💡 There are different ways to generate this visualisation for your own workspaces:
>
> - In VSCode, use the Nx Project View or the `Nx: Focus task in Graph` action
> - In JetBrains IDEs, use the Nx Toolwindow or context menus
> - In the command line, run `nx build {{your project}} --graph`
In the bigger context of Nx Console, heres what happens when you build the VSCode extension:
![Nx task graph for building the VSCode extension](/blog/images/2023-06-29/bodyimg4.webp)
You can see that were still building both the new & old generate UI as well as the Nxls and the Nx Cloud webview before combining them all into one VSCode extension artifact.
### Building the Form
Lit is a very small library that provides useful abstractions over browser-native features like web components and messages. Heres what a simple Lit component, written with Typescript, looks like:
```ts {% fileName="main.ts" %}
@customElement('root-element')
export class Root extends LitElement {
render() {
return html`<p>Hello World</p>`;
}
}
```
```html {% fileName="index.html" %}
<!DOCTYPE html>
<html lang="en">
<body>
<script type="module" src="main.js"></script>
<root-element></root-element>
</body>
</html>
```
If you need to pass information up the DOM, you use normal events and you can set properties to send information to descendants. Check out the [Lit Docs](https://lit.dev/docs/components/rendering/) to learn more about how the render() method works, how to leverage reactivity, the shadow DOM and so much more.
> 💡 All code samples in this section have been adapted for brevity and clarity. So you wont find this exact code anywhere, but it demonstrates the concepts well.
### Communicating with the IDE — using Reactive Controllers
To communicate with the host IDE, we were able to reuse almost all the logic from the previous UI (for more details, see [Communicating with IntelliJ](/blog/expanding-nx-console-to-jetbrains-ides) from the last blog post). Instead of a service that exposes observables that our component can consume, we used a [Reactive Controller](https://lit.dev/docs/composition/controllers/). Controllers are a neat feature of Lit — they hook into a component and can request DOM updates on their behalf. This eliminates the need for observable streams and subscriptions while keeping the communication code self-contained. Look at this example:
```ts {% fileName="main.ts" %}
@customElement('root-element')
export class Root extends LitElement {
icc: IdeCommunicationController;
constructor() {
super();
this.icc = new IdeCommunicationController(this);
}
render() {
return html`${JSON.stringify(this.icc.generatorSchema)}`;
}
}
```
```ts {% fileName="ide-communication-controller.ts" %}
// ide-communication-controller.ts
export class IdeCommunicationController implements ReactiveController {
generatorSchema: GeneratorSchema | undefined;
constructor(private host: ReactiveControllerHost) {}
// ...
private handleMessageFromIde(message: InputMessage) {
// ...
this.generatorSchema = message.payload;
this.host.requestUpdate();
}
}
```
You can see that `root-element` can really just deal with rendering the form contents, delegating communicating with the IDE and when to update the DOM to the controller.
### Rendering the form fields — using Mixins
The core part of the UI is the form. We built all kinds of inputs: text fields, checkboxes, (multi-) select boxes and array fields. While those each have unique implementations, displaying them is also going to take a lot of repeated code. Every fields needs a label and description. Every field needs to know about its validation state, how dispatch change events and what aria attributes to set. In order to keep this code clean and DRY, we used [Class Mixins](https://lit.dev/docs/composition/mixins/). Mixins arent really a Lit-specific feature, but I dont see them used much in other frameworks. A mixin is essentially a factory that takes a class and returns another, modified class. Check out this example:
```ts {% fileName="field-mixin.ts" %}
const Field = (superClass) =>
class extends superClass {
// we can define (reactive) properties that every field is going to need
@property()
option: Option;
protected get fieldId(): string {
return `${this.option.name}-field`;
}
// we can define methods that should be available to all fields
dispatchValue(value: string) {
// ...
}
};
```
```ts {% fileName="field-wrapper-mixin.ts" %}
const FieldWrapper = (superClass) =>
class extends superClass {
// we can define a render() method so that fields are all rendered the same
protected render() {
return html` <label for="${this.fieldId}">${this.option.name}</label>
<p>${this.option.description}</p>
${this.renderField()}`;
}
};
```
```ts {% fileName="input-field.ts" %}
@customElement('input-field')
export class InputField extends FieldWrapper(Field(LitElement)) {
renderField() {
return html` <input
id="${this.fieldId}"
@input="${(e) => this.dispatchValue(e.target.value)}"
/>`;
}
}
```
You can see that each component and mixin deals with a specific subset of the overall logic, keeping our code cleanly separated and reusable. A checkbox, for example, is a special case because its layout on the page is slightly different — no problem, we simply wrote a CheckboxWrapper with some modifications without having to worry about changing the checkbox logic itself.
> 💡 Properly typing mixins is complicated so I left that part out. Refer to [Mixins in Typescript](https://lit.dev/docs/composition/mixins/#mixins-in-typescript) to learn more or [check out our source code on GitHub](https://github.com/nrwl/nx-console).
### Injecting Services & Data — Lit Context
If youre coming from the Angular world, you probably appreciate the great dependency injection (DI) mechanism they have. You can centrally define some services and reuse them across your app, without thinking about passing on props from component to component — the DI system takes care of it. Lit provides something similar via the []`@lit-labs/context`](https://lit.dev/docs/data/context/) package. Its based on the [Context Community Protocol](https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md) and similar to Reacts context API.
Under the hood, it still works with normal browser events, but it abstracts it away from you so you can easily share data and services across your app.
The Generate UI is rendered in both VSCode and JetBrains IDEs. In order to look appropriate, components need to know which environment theyre in and adjust styling accordingly. Instead of passing this information from component to component, we can make it available contextually! And with a proper mixin, reading the editor context only has to be implemented once, too.
Have a look at the following example:
```ts {% fileName="editor-context.ts" %}
export const editorContext = createContext<'vscode' | 'intellij'>(
Symbol('editor')
);
const EditorContext = (superClass) =>
class extends superClass {
@consume({ context: editorContext })
@state()
editor: 'vscode' | 'intellij';
};
```
```ts {% fileName="ide-communication-controller.ts" %}
export class IdeCommunicationController implements ReactiveController {
// ...
constructor(private host: ReactiveElement) {
const editor = isVscode() ? 'vscode' : 'intellij';
// provide the context to all DOM children of the host element
new ContextProvider(host, {
context: editorContext,
initialValue: editor,
});
}
}
```
```ts {% fileName="some-component.ts" %}
@customElement('some-component')
export class SomeComponent extends EditorContext(LitElement) {
render() {
return html`<p>I am rendered in ${this.editor}</p>`;
}
}
```
### VSCode Webview UI Toolkit
As we mentioned above, a big part of why we rewrote the UI is that it looked quite out of place in JetBrains IDEs. It was still useful, of course, but its important to make sure the form _feels_ right.
In VSCode, this is very easy to achieve, thanks to the [VSCode Webview UI Toolkit](https://github.com/microsoft/vscode-webview-ui-toolkit). Its a set of web components, provided by Microsoft, that are designed to look good and be used in VSCode webviews.
![Sample image of the VSCode Webview UI Toolkit showing the different components it provides](/blog/images/2023-06-29/bodyimg5.webp)
Using it, you get the native look, a11y, and theme-aware styling for free! Thanks to everyone who built it, its a huge help!
### E2E Testing with Cypress
One big upside of using a webview is the huge Javascript ecosystem is available to you! To make sure that no regressions are introduced later on, we use [Cypress](https://www.cypress.io/). We can mock the editor communication and provide different schemas, make sure the form is rendered correctly and the right messages are sent back to the IDE.
While theres no particular Lit integration for Cypress, the tool itself is framework agnostic so it still works perfectly fine. Using the [`@nx/cypress`](/nx-api/cypress) executors did most of the work for us so setup was pretty quick too.
### Results: Comparing Performance
Theres a number of different aspects to performance we can compare between the two implementations. The biggest one by far is not really quantifiable: The maintainability and looks of the new UI. In my opinion, it looks a lot fresher and more native in both environments. We got rid of a lot of legacy code and the new version is easier to reason about and work with.
But there are thing we _can_ measure, so lets talk numbers!
### Startup Time
It takes time to bootstrap a large framework like Angular, so skipping that, the UI should load quicker than before.
We measured the median time it took to render all options of the `@nx/angular:application` generator in both VSCode and IntelliJ. You can see that the results are pretty clear-cut, even though they are not hugely impactful.
Old UI (Angular)New UI (Lit)SpeedupVSCode65 ms39 ms~ 1.7xIntelliJ189 ms122 ms~ 1.5x
### Bundle Size
As mentioned earlier, Angular comes with a lot more features out-of-the-box than Lit, so it would make sense that the built bundle will be bigger.
We were able to reduce the bundle size (w/o compression) from about 733 kB to 282 kB, which comes out to about a 2,6x decrease. Unlike a website, where the bundle needs to be shipped to users when they load a page, Nx Console users only need to download it once when installing the plugin. This means were not affected by network speeds after installation, which makes the bundle size less critical.
> 💡 Because of a misconfiguration from a few Angular versions ago, the bundle size that we reported in [this tweet](https://twitter.com/MaxKless/status/1671095858182381569) was overly bloated. We corrected it, but Lit still came out ahead in terms of size and rendering times.
### Build Time
While it might not be important to users of Nx Console, the time it takes to build the project makes a difference to us developers.
Since Lit is just javascript files that dont require a custom compiler or build tooling, we decided to use [`esbuild`](https://esbuild.github.io/) (via `@nx/esbuild`), which is written in Go and extremely fast. On the other hand, the old UI used the `@angular-builders/custom-webpack:browser` builder, which uses webpack under the hood.
We went from about 3.5 seconds to less than 2 seconds of build time, which is less of an improvement than we expected. Since we also have to run tailwind over our files, some of that additional `esbuild` speed seems to be relativized.
## Looking Ahead
Rebuilding the UI has paved the road to reduce a lot of the maintenance burden of Nx Console. It will allow us to move even quicker on building new features to provide the best developer experience possible for you.
Specifically, the updated architecture enabled us to build a (still secret and WIP) plugin feature for Nx Console. Just like Nx, there are always going to be things that are unique to your workspace. We want to make it easy for you to extend and modify Nx Console in ways that help you make the most of using it.
So keep your eyes peeled for announcements and let us know via GitHub or Twitter if you have any ideas! Wed love to chat.
## One more thing!
Nx Console is a tool by developers for developers and theres one thing we love — keyboard shortcuts. So of course we had to build some in. In addition to being keyboard-friendly and tabbable, you can do the following:
- `Cmd/Ctrl + Enter` to run the generator
- `Cmd/Ctrl + Shift + Enter` to start a dry run
- `Cmd/Ctrl + Shift + S` to focus the search bar and look for a specific option. Just `tab` to get back to the form
If the prettier UI and better performance havent convinced you, this surely will! 😉
---
## Learn more
- [Nx Docs](/getting-started/intro)
- [X/Twitter](https://twitter.com/nxdevtools) -- [LinkedIn](https://www.linkedin.com/company/nrwl/)
- [Nx GitHub](https://github.com/nrwl/nx)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](/nx-cloud)
+237
View File
@@ -0,0 +1,237 @@
---
title: 'Nx 16.5 Release!!!'
slug: 'nx-16-5-release'
authors: ['Zack DeRose']
cover_image: '/blog/images/2023-07-06/Gm3s_wLWrAf_uH2AzfJvvQ.png'
tags: [nx, release]
---
We have launched SO MANY features since our last release blog on Nx 16.0, so were covering the major features in this blog!
{% youtube src="https://youtu.be/7XLoLOc3afY" /%}
Be sure to mark your calendars for our Nx 16.5 livestream as well! Well highlight the features you see here AND field any questions live! Follow the link to schedule a notification for when we go live:
{% youtube src="https://youtu.be/EYgkKmYbRNI" /%}
## Targetting Tasks By Tags
Our first major feature actually comes to us from the community. Nx has supported a tags property in your project.json file for awhile now — and its main purpose has been to be used in conjuncture with the [Nx Module Boundary lint rule](/features/enforce-module-boundaries) to define which projects in your Nx workspace can depend on what — for example, you dont want your frontend applications to depend on any backend-specific code.
With this new feature, you can add the `--tag` option to the [`nx affected`](/nx-api/nx/documents/affected) and [`nx run-many`](/nx-api/nx/documents/run-many) commands to specify to Nx to only run commands for projects that match the given tags.
{% youtube src="https://youtu.be/enQDQmFquGU" /%}
## NextJS 13 Support
React Server Components and the new NextJS app router are here, and Nx is here to support them. Weve added support for the latest versions of Next — complete with generators and executors. Weve also made sure that our [`withNx` NextJS plugin](/recipes/next/next-config-setup), which allows you to import from your other projects in your workspace while still working with the NextJS build scripts, works both for workspaces using our executors in an Integrated Monorepo approach, as well as for those using a Package-Based approach that are simply using the `next dev` command directly to start their dev server.
Theres also built-in support for the new turbopack builder option via the `--turbo` command, for example: `nx serve webapp --turbo`
Weve also launched a new preset for `npx create-nx-workpace` for a standalone NextJS app. Checkout it out using the command: `npx create-nx-workspace@latest --preset=nextjs-standalone` or use the interactive prompts to find it:
![](/blog/images/2023-07-06/EZrDq742M_PZZhgn.avif)
Weve added a couple videos specifically on Next development in an Nx workspace in the past month, so if youre looking for more on Next, be sure to check them out!
{% youtube src="https://youtu.be/RupxGAQ3fBY" /%}
{% youtube src="https://youtu.be/X3WfXAZZH7s" /%}
## New Nx Recipes!!!
Did you know that we maintain [a set of Nx workspaces](https://github.com/nrwl/nx-recipes) designed to serve as examples for different Nx Workspaces?
Weve recently added examples repos for:
- fastify + mongo
- fastify + postgres
- fastify + redis
- nextjs + trpc
- remix
- serverless + fastify + planetscale
Go check it out at [https://github.com/nrwl/nx-recipes](https://github.com/nrwl/nx-recipes) and let us know in the comments if there are more recipes youd like to see or if you want to see videos made from any of the existing recipes!
## Angular 16 Support And Migrations
Angular is continuing their pattern of releasing new and exciting features — and in Nx 16.1, we added support for Angular 16, including updates to our NgRx generators and cypress support.
As usual, we provide migrations to the most recent Angular version to cover your codebase for any breaking changes going to Angular 16.
And in case you missed it, Nx is no longer tied to your Angular version — the most recent version of Nx will now always [support all currently LTS versions of Angular](/nx-api/angular/documents/angular-nx-version-matrix), meaning you DONT have to upgrade your Angular version in order to get all these latest Nx Features. Be sure to use the `--interactive` flag to take advantage of this feature: `nx migrate latest --interactive`. You can find more details in [our docs for choosing optional packages to apply](/recipes/tips-n-tricks/advanced-update).
{% youtube src="https://youtu.be/AQV4WFldwlY" /%}
## New `verdaccio` support!
The `@nx/js` package now includes a new `setup-verdaccio` generator as well as a `verdaccio` executor!
{% youtube src="https://youtu.be/t1c925TzrzE" /%}
Running `nx g setup-verdaccio` will now add a new `local-registry` target to your workspace, that will use the new `verdaccio` executor.
To start your local registry, run the command `nx local-registry` in one terminal, and then you can publish via commands like `npm publish` as you normally would, but rather than publish packages to the npm registry, this will only publish those packages to your locally-running registry!
While the `local-registry` process is running, you will also be able to install packages published to your local registry as well.
These tools should help in particular with local testing of publishing packages to help support both manual and automated testing!
## Create your own CLI with Nx
The use of command-line interfaces (CLIs) to create new workspaces is common in various technologies. React has one, so does Angular, Vue, Vite and many more. Maintaining a good CLI experience can be tedious though, especially because framework authors would rather want to focus on the library or framework itself.
For a while now, Nx plugin authors had the possibility to create a so-called “preset” to control the entire Nx workspace structure. Once published it can be invoked by using the `--preset` flag:`npx create-nx-workspace myapp --preset=@my/plugin`. [Qwik-Nx](https://github.com/qwikifiers/qwik-nx) is an example of that.
However, many authors would rather want to have a more “branded” experience. Like being able to invoke the previous example as follows:
```shell
npx create-qwik-nx myapp
```
To fulfill this need, in 16.5 we ship with a new `create-package` generator that allows you to add and ship such "CLI package" with your Nx plugin.
You can either create a new Nx plugin workspace immediately with a CLI package using:
```shell
npx create-nx-plugin my-own-cli --create-package-name=create-my-own-cli-app
```
Or alternatively add it to an existing Nx plugin workspace using:
```
nx g @nx/plugin:create-package <cli name> --project=<existing plugin name> --e2eProject e2e
```
## New `externalDependencies` Input Type
Nx now supports a new input type: `externalDependencies` to add to the existing input types: `filesets`, `runtime` inputs, and `env` variables.
By default, Nx will take the defensive stance of assuming that all packages will affect your commands, meaning all external dependencies are taken into account when hashing your tasks dependencies.
The new `externalDependencies` input type allows you to specify a specific set of external dependencies for a given command, so you can configure your tasks to more accurately reflect their inputs.
For example, if you have a `publish-package` target that is using a `command` of `lerna publish` for your publishing, you can specify that the only external dependency for that specific input is `lerna`:
```json
{
"name": "mylib",
// ...
"targets": {
"publish-package": {
"command": "lerna publish",
"inputs": [{ "externalDependencies": ["lerna"] }]
}
}
}
```
This way you are free to change other dependencies that dont affect this task without invalidating your cached run of the task.
{% youtube src="https://youtu.be/FRqgWBmHmAU" /%}
## New `@nx/dependency-checks` EsLint Rule
Weve added a new `@nx/dependency-checks` lint rule to help with detecting any issues when specifying dependencies for your packages.
This rule will analyze your source code to determine any dependencies you are using in this specific package, and will catch any missing dependencies, mismatched versions, and unused dependencies in your projects `package.json` file.
Even better, this rule supports the `--fix` option to automatically fix any issues that are found - making it a great tool for automating your dependencies.
After migrating your Nx workspace, you should have access to this lint rule. To turn it on, youll need to adjust the `lint` targets in your `project.json` files to include your `package.json` files like so:
```json
{
"name": "webapp",
// ...
"targets": {
// ...
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/webapp/**/*.{ts,tsx,js,jsx}",
"apps/webapp/package.json" // here!
]
}
}
}
}
```
Then in “webapp” projects `.eslintrc.json` file you'll want to turn the rule on for your json files:
```json
{
...
"overrides": [
// ...
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
```
Now you should be able to run the linter via `nx run-many --target=lint` to catch any errors across any of your packages, and you can `nx run-many --target=lint --fix` to automatically fix all errors as well.
## Nx Goes Brrrrrr
Nx has continued to get faster!
Our biggest speed increase has come from moving our task hashing into the Nx Daemon. A daemon process refers to a process that runs continuously in the background.
Because the daemon persists between command runs, we are able to have more of the work that goes into hashing a task cached, which we added in Nx 16.3!
In Nx 16.4 we also moved to a rust-based watcher to further improve performance. We had already began the migration of some of the more performance-intensive computation of Nx to Rust in prior version, but were excited to bring more of the core of Nx into Rust and see more of these performance gains!
Since our last benchmarking of Nx in October of last year where we clocked Nx at 276.2ms per command, these speed boosts have now gotten us down to 149.3ms, nearly doubling our speed!!
You can see our results and the details of the benchmark — and even run the benchmarks for yourself in [this repo](https://github.com/vsavkin/large-monorepo).
## Nx Console Revamped
Nx Console got a new coat of paint in both the VsCode and JetBrains (IntelliJ/Webstorm) IDEs!
![](/blog/images/2023-07-06/5nr7ReGoDTIEw5kl.avif)
_New Nx Console Coat of Paint in VsCode_
![](/blog/images/2023-07-06/Uox5jg4O4DEM4kAJ.avif)
_New Nx Console Coat of Paint in IntelliJ_
As part of the redesign, we also moved our webviews to the Lit framework — checkout all the latest updates in this video:
{% youtube src="https://youtu.be/p455D4W7330" /%}
## Nx Changelog Launched
Last but CERTAINLY not least, weve launched [a new changelog](/changelog) to our docs site!
![](/blog/images/2023-07-06/RewMSU5fPazv_fn.avif)
This changelog includes links to all the release notes for all major and minor versions, as well as links to patch versions. We made sure to also include any deprecations or breaking changes brought about by each version as well.
## Wrap Up
Thats all for now folks! Were just starting up a new iteration of development on Nx, so be sure to subscribe to [our YouTube channel](https://youtube.com/@nxdevtools) to get updates when new features land! Until next time, KEEP WORKING HARD!
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
- 🚀 [Speed up your CI](/nx-cloud)
## More Nx Release Notes:
- [Nx 16.0](/blog/nx-16-is-here)
- [Nx 15.8](/blog/nx-15-8-rust-hasher-nx-console-for-intellij-deno-node-and-storybook)
- [Nx 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning)
- [Nx 15.4](/blog/nx-15-4-vite-4-support-a-new-nx-watch-command-and-more)
- [Nx 15.3](/blog/nx-15-3-standalone-projects-vite-task-graph-and-more)
@@ -0,0 +1,202 @@
---
title: 'Evergreen Tooling — More than Just CodeMods'
slug: 'evergreen-tooling-more-than-just-codemods'
authors: ['Juri Strumpflohner']
cover_image: '/blog/images/2023-07-26/CPiI60mSguYXJzPfAHMbEQ.png'
tags: [nx]
---
As developers we always want to use the latest shiny tools. Theres a new bundler? Lets try! A new code editor, Im in! For your side-project: for sure! At work: nah, not really. Keeping your tooling up to date with the rather fast moving JS ecosystem can be a major challenge. Nx provides a mechanism that can help mitigate that, by providing a command to upgrade your tooling automatically:
```shell
npx nx migrate latest
```
**Prefer a video? Ive got you covered!**
{% youtube src="https://www.youtube.com/watch?v=Ss6MfcXi0jE" /%}
## TL;DR
You can run the following command to automatically upgrade your Nx workspace to the latest version:
```shell
npx nx migrate latest
```
## The Balancing Act: Updating Tooling vs Shipping Features
If youre anything like me, youve probably found that discussions about updating tooling tend to fall to the bottom of the priority list when talking to your product owner. Its understandable — their primary goal is to ship features. However, sticking with outdated tooling can impact our ability to deliver these features swiftly (not to speak about potential security concerns due to outdated libraries).
Dont get me wrong, Im not suggesting that we should always be on the bleeding edge of technological innovation — especially in an enterprise environment.
> _Jason Lengstorf has some opinions there as well:_ [_“The Hidden Danger of Switching Tech Stacks in 2023_](https://youtu.be/u0j-DlsimZ4)_?)._
Its wise to let security patches land and initial bugs get fixed before jumping on the upgrade bandwagon. But heres the catch — dont wait too long. The **longer you delay upgrading, the more challenging and time-consuming** it becomes. And the more effort it requires, the harder it is to sell the idea to your product owner.
## The Key: Making Updates Easy(ier)!
Updating tooling is never easy, but the Nx team aims at making it “easier” at least. We try to embrace the concept of “evergreen tooling”, a strategy thats been around since Google decided to automatically update Chrome for all users. The Angular team adopted this approach for their Angular CLI, and Nx has followed suit. But what exactly is it, and how does it work?
> _What if I told you Nx users have been_ **_automatically_** _updating their React applications from Webpack 4 to Webpack 5!_
The “why” is pretty straightforward. From the perspective of an open-source project, you want users to adopt the latest version as quickly as possible. This minimizes the maintenance work involved in supporting older versions, which can be a real headache. Looking at how Nx manages it, it seems to be successful in this regard ([Source](https://www.craigory.dev/npm-burst/?package=nx)):
![](/blog/images/2023-07-26/M7X1nddld2oBJ736.avif)
The distribution of Nx installs by version demonstrates the effectiveness of this approach. For instance, v16.5, which accounts for 19.7% of all versions, has already been adopted by many users, despite [its recent release](/changelog). The latest major accounts for 34.7% already and 41.4% are on the previous v15, a large majority of which is on the latest 15.9 minor. Hence, v16 & v15 make up 3/4 of all Nx installs.
## How? Database Migration Scripts for Code?
If you know what “database migration scripts” are, then yes, its the same concept but applied at the code level. A series of small functions invoked to bring your workspace from version X to version Y (usually the latest). That includes:
- update `nx` itself
- update all Nx plugins and the technology they are responsible for (for example: `@nx/react` will upgrade React as well, `@nx/webpack` is upgrading Webpack)
- automatically adjust relevant config files and source code (e.g., adjusting imports, functions etc..)
Everything that is required to get you to the latest version and still have a running code, even if there have been breaking changes.
**How?!** Because the **Nx team (and plugin authors) do the work for you**! Nx has a built-in mechanism where you can define so-called “migrations” for each Nx package. Heres an excerpt of the `@nx/webpack`'s migration file.
```json
{
generators: {
"add-babel-inputs": {
cli: nx,
version: 15.0.0-beta.0,
description: Adds babel.config.json to the hash of all tasks,
"factory": "./src/migrations/update-15-0-0/add-babel-inputs"
},
"remove-es2015-polyfills-option": {
cli: nx,
version: 15.4.5-beta.0,
description: Removes es2015Polyfills option since legacy browsers are no longer supported.,
"factory": "./src/migrations/update-15-4-5/remove-es2015-polyfills-option"
},
"webpack-config-setup": {
cli: nx,
version: 15.6.3-beta.0,
description: Creates or updates webpack.config.js file with the new options for webpack.,
"factory": "./src/migrations/update-15-6-3/webpack-config-setup"
},
"add-babelUpwardRootMode-flag": {
cli: nx,
version: 15.7.2-beta.0,
description: Add the babelUpwardRootMode option to the build executor options.,
"factory": "./src/migrations/update-15-7-2/add-babelUpwardRootMode-flag"
},
"update-16-0-0-add-nx-packages": {
cli: nx,
version: 16.0.0-beta.1,
"description": "Replace @nrwl/webpack with @nx/webpack",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
}
},
...
}
```
They are defined in a `migrations.json` config file within the NPM package. Each entry defines a `version` for which the entry should be run, a `description` (just for humans to read) and a `factory` property which points to a TypeScript file.
Example: if youre on Nx 15.5 and you run `nx migrate latest` it would run the corresponding “factory functions” for:
- `webpack-config-setup`
- `add-babelUpwardRootMode-flag`
- `update-16-0-0-add-nx-packages`
Depending on the nature of the update, these functions can be as simple as performing text replacements to more complex AST parsing and TypeScript source file manipulations. Lets have a look at the `add-babelUpwardRootMode-flag` migration:
```
import {
formatFiles,
readProjectConfiguration,
Tree,
updateProjectConfiguration,
} from '@nx/devkit';
import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils';
import { WebpackExecutorOptions } from '../../executors/webpack/schema';
export default async function (tree: Tree) {
forEachExecutorOptions<WebpackExecutorOptions>(
tree,
@nrwl/webpack:webpack,
(
options: WebpackExecutorOptions,
projectName,
targetName,
_configurationName
) => {
if (options.babelUpwardRootMode !== undefined) {
return;
}
typconst projectConfiguration = readProjectConfiguration(tree, projectName);
projectConfiguration.targets[targetName].options.babelUpwardRootMode =
true;
updateProjectConfiguration(tree, projectName, projectConfiguration);
}
);
await formatFiles(tree);
}
```
It leverages the utility functions provided by the `@nx/devkit` package to read the various `projects.json` files to adjust the `babelupwardRootMode` property.
Nxs modular design helps as each plugin is responsible for a particular area and can thus contribute according migration scripts. To give you some context. There is the [nx package](https://www.npmjs.com/package/nx) at the core — which you can use nicely in combination with a [PNPM workspaces repo](/blog/setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx) to speed things up — and then there are plugins built on top.
![](/blog/images/2023-07-26/LNYWLmdgxQ07bqyt.avif)
_(Source:_ [_/getting-started/why-nx_](/getting-started/why-nx)_)_
These plugins are usually technology-specific, like a plugin to help you manage React, Next, Remix, or Angular projects and tooling like ESLint, Cypress, Playwright, Vite, Jest, and so on. There are no limits as you can [create your own](/extending-nx/intro/getting-started). They are **optional**, in that you can use Nx and React and set everything up on your own. But it might be worth relying on them for some better DX and automation, such as the update mechanism were currently looking at.
Plugins are helpful here, because each plugin has a clearly defined responsibility. Like the `@nx/webpack` we looked at earlier, handles everything related to Webpack. So itll be responsible for updating the `webpack` NPM package and adjusting config Webpack-related files.
## Performing the Update
Alright, weve learned how these updates work behind the scenes. Lets look at what the experience looks like as a developer performing the update on your codebase.
> _Note, it is highly recommended to start with a clean Git workspace s.t. you can quickly revert the update._
To run the update, use the following command:
```shell
npx nx migrate latest
```
Note `latest` stands for the target version. You can also provide a specific Nx version if you cannot update to the latest one for some reason.
At this point, Nx
- analyzes your workspace and finds all the plugins youre using
- downloads the version of the plugins specified in the migrate command above
- collects all the `migration.json` files from these plugins
- picks out the relevant ones based on your current workspace version
- creates a `migrations.json` at the root of your workspace
- updates the `package.json` to point to the matching NPM package versions (without performing an install just yet)
You can now inspect the `migration.json` and the `package.json` before you run the following command to run the migrations on your codebase.
```shell
npx nx migrate —-run-migrations
```
After that, your codebase should have been updated. Run your (ideally automated) sanity checks and fix the remaining issues that couldnt be adjusted automatically.
## Wrapping Up
Thats it! If you want to dive deeper, here are some potentially helpful links:
- [Watch our YT video about Code Migrations](https://youtu.be/Ss6MfcXi0jE)
- [/features/automate-updating-dependencies](/features/automate-updating-dependencies)
Also, if you havent already, give us a ⭐️ on Github: [https://github.com/nrwl/nx](https://github.com/nrwl/nx). Wed appreciate it 😃.
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [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](/nx-cloud)
@@ -0,0 +1,73 @@
---
title: 'Storybook Interaction Tests in Nx'
slug: 'storybook-interaction-tests-in-nx'
authors: ['Katerina Skroumpelou']
cover_image: '/blog/images/2023-08-03/NfJA7VBZvDwyyZHmV8qsiw.png'
tags: [nx]
---
In Nx 16.6 we are introducing our new generators for [Storybook interaction tests](https://storybook.js.org/docs/react/writing-tests/interaction-testing)! These new generators replace the default Cypress tests we used to generate along with a projects Storybook configuration, particularly for those already using Storybook. The intention is that if a user chooses to use Storybook and generate Storybook configuration, to integrate in that experience Storybook Interaction testing, and skip generating Cypress tests, to keep everything in one place, in an integrated experience.
**Prefer a video walkthrough? Weve got you covered**
{% youtube src="https://www.youtube.com/watch?v=SaHoUx-TUs8" /%}
## Understanding Storybook Interaction Tests
Interaction tests allow users to verify the functional aspects of UIs. This is done by supplying the initial state of a component, simulating user behavior such as clicks and form entries, and finally checking if the UI and component state update correctly. Very much like e2e tests are doing.
In Storybook, this workflow occurs in your browser, which makes it easier to debug failures since youre running tests in the same environment you develop components.
## How it works
You write a story to set up the components initial state, simulate user behavior using the [play function](https://storybook.js.org/docs/react/writing-stories/play-function), and then use the [test runner](https://storybook.js.org/docs/react/writing-tests/test-runner) to confirm that the component renders correctly and that your interaction tests with the play function pass. [Storybooks Test runner](https://storybook.js.org/docs/react/writing-tests/test-runner) is a standalone utility — powered by Jest and Playwright — that executes all of your interaction tests, and runs parallel to your Storybook.
## Setting Up Storybook Interaction Tests on Nx
You can read our detailed guide on how to set up Storybook interaction tests on Nx, here: [/recipes/storybook/storybook-interaction-tests](/recipes/storybook/storybook-interaction-tests).
## Writing Interaction Tests in Storybook
An interaction test is defined inside a play function connected to a story. The story simulates the users behavior once it loads in the UI and verifies the underlying logic.
Under the hood, Storybooks [@storybook/addon-interactions](https://storybook.js.org/addons/@storybook/addon-interactions) mirrors [Testing Library](https://testing-library.com/)s user-events API. So, you can use the same queries and assertions that you would use for Testing Library, like we already do with our unit tests.
For complex flows, it can be worthwhile to group sets of related interactions using the step function. This allows you to provide a custom label that describes a set of interactions.
## Debugging and Reproducing Errors
Storybook provides an interactive debugger that displays the step-by-step flow of your interactions, and provides UI controls to pause, resume, rewind, and step through each interaction.
![](/blog/images/2023-08-03/ZhrFxCwtYkO3gLaU.avif)
_Interaction test for the click of a button._
If an error occurs during a storys play function, itll be shown in the interaction addon panel to help with debugging. And since Storybook is a web app, anyone with the URL can reproduce the error with the same detailed information without any additional environment configuration or tooling required.
## Executing and Automating Tests
Storybook only runs the interaction test when youre viewing a story. Therefore, as a Storybook grows, it becomes unrealistic to review each change manually. The Storybook test-runner automates the process by running all tests for you. This can be executed via the command line or on CI environment.
## What should I choose? Interaction tests or E2E tests?
Setting up interaction tests with Nx and Storybook provides an extra layer of confidence in the functionality of your components. It ensures that they not only look right but also behave correctly in response to user interactions.
Storybook interaction tests provide a unique advantage over traditional e2e tests, especially when considering the development setup. With Storybook already in place, you essentially have a controlled environment set up for each of your components. This allows you to write interaction tests almost immediately, without the overhead of setting up and navigating through a full application environment, as is the case with e2e tests.
Moreover, since Storybook isolates each component, you can ensure that the tests are solely focused on individual component behavior rather than application-level concerns. This results in faster test execution, easier debugging, and more granular feedback during the development process. In essence, with Storybooks interaction tests, you get many of the benefits of e2e tests but with a setup thats quicker, more focused, and integrated right into your component development workflow.
## Screenshare
{% youtube src="https://www.youtube.com/embed/QvD3hJDa_1Q" /%}
## Useful Links
- [https://storybook.js.org/docs/react/writing-tests/interaction-testing](https://storybook.js.org/docs/react/writing-tests/interaction-testing)
- [/recipes/storybook/storybook-interaction-tests](/recipes/storybook/storybook-interaction-tests)
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [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](/nx-cloud)
@@ -0,0 +1,646 @@
---
title: 'Create Your Own create-react-app CLI'
slug: 'create-your-own-create-react-app-cli'
authors: ['Emily Xiong']
cover_image: '/blog/images/2023-08-10/j2QU-hjxt-1krFST8CGFiA.png'
tags: [nx]
---
Most technologies have a CLI to create a new workspace. In fact, it is so prevalent that NPM and other package managers support it natively. For example:
- Nx has [create-nx-workspace](/getting-started/installation)
- React has, well, had [create-react-app](https://create-react-app.dev/)
- Angular has [Angular CLI](https://angular.io/cli)
- Vite has [create-vite](https://vitejs.dev/guide/#scaffolding-your-first-vite-project)
Having a CLI to quickly scaffold a starting project is great for onboarding new people, but it can also be a burden for framework authors as they want to rather focus on building the framework. Additionally, building **and supporting** a good CLI is another beast to tackle. And this is where Nx comes in.
Nx has had support for [creating custom “presets”](/extending-nx/recipes/create-preset) for a while, allowing plugin authors to fully customize the workspace structure from the ground up. To use them you had to go via the `create-nx-workspace` command though, passing the name of your plugin as the `--preset` . This works, but you might want to have a more “branded command” experience, like `npx create-my-own-app` .
And this is exactly what were going to explore in this article. We will write our own CLI. And out of nostalgia, lets build our own version of Create-React-App.
If you want to check out the final result, heres the corresponding Github repo: [https://github.com/nrwl/nx-recipes/tree/main/nx-devkit-create-own-cli](https://github.com/nrwl/nx-recipes/tree/main/nx-devkit-create-own-cli)
**Prefer a video? We got you covered!**
{% youtube src="https://www.youtube.com/watch?v=ocllb5KEXZk" /%}
## What is Nx and what is an Nx plugin?
But before we jump right into the topic, what is Nx? And more specifically, what are Nx Plugins?
Nx is an open-source build system that provides tools and techniques to enhance developer productivity. [Check out this 10 min video overview](https://youtu.be/-_4WMl-Fn0w) of Nx if you want to learn more.
Our example, in particular, uses Nx as a dev tool for creating a CLI and plugin. Nx plugins are npm packages that provide integrations between Nx and other technologies. You can use Nx without them, but they can provide great value if applied properly. `my-own-react` is the plugin to integrate React and Nx.
## Step 1: Create a CLI workspace
Create a new Nx workspace that is preconfigured for plugin development, using the below command:
```shell
npx create-nx-plugin my-own-react --create-package-name=create-my-own-react-app
```
Note, if you already have an existing Nx plugin workspace, instead of creating a new workspace, you can simply run the following in your plugin repository to generate the create CLI:
```
nx g @nx/plugin:create-package <cli name> --project=<existing plugin name> --e2eProject e2e
```
![](/blog/images/2023-08-10/dL5XHPOGCtfFyTHhloaYcQ.avif)
_Project graph of the workspace_
The resulting workspace contains 2 projects: a CLI and an Nx plugin.
- **create-my-own-react-app:** The CLI project. It contains the code to run when developers invoke `npx create-my-own-react-app`. This will set up a workspace for the developer.
- **my-own-react:** Nx plugin to integrate react with Nx. It will contain the code for creating and serving an app. It is under the src folder. This will be installed in the users workspace.
### CLI Package Structure
Lets focus on the `create-my-own-react-app` project which is our CLI.
![](/blog/images/2023-08-10/00F7H_Z13uonZiflZSQd8Q.avif)
The `index.ts` file is the key part here. It is the one that gets invoked when someone runs `npx create-my-own-react-app` later once we publish it.
```
#!/usr/bin/env node
import { createWorkspace } from 'create-nx-workspace';
async function main() {
const name = process.argv\[2\]; // TODO: use libraries like yargs or enquirer to set your workspace name
if (!name) {
throw new Error('Please provide a name for the workspace');
}
console.log(`Creating the workspace: ${name}`);
// This assumes "my-own-react" and "create-my-own-react-app" are at the same version
// eslint-disable-next-line @typescript-eslint/no-var-requires
const presetVersion = require('../package.json').version;
// TODO: update below to customize the workspace
const { directory } = await createWorkspace(`my-own-react@${presetVersion}`, {
name,
nxCloud: false,
packageManager: 'npm',
});
console.log(`Successfully created the workspace: ${directory}.`);
}
main();
```
The main chunk of code is `` createWorkspace(`my-own-react@${presetVersion}`) ``. This function creates an Nx workspace with the `my-own-react` plugin installed.
2. `createWorkspace` will also generate the preset generator defined by `my-own-react` located at `src/generators/preset/generator.ts`. This is the logic which scaffolds a project which uses your technology.
## Step 2: Run the CLI Locally
To properly test your CLI you can either publish it to NPM as a beta version or use a local npm registry like [Verdaccio](https://verdaccio.org/). Luckily our Nx workspace already comes with a feature to make that a seamless process.
1. First, start a local Verdaccio-based npm registry using the following command:
```shell
npx nx local-registry
```
This will start the local registry on port 4873 and configure npm to use it instead of the real npm registry.
2\. In the second terminal, run the command to publish all the projects:
```shell
npx nx run-many --targets publish --ver 1.0.0 --tag latest
```
_(Note,_ `_publish_` _is a target defined in the_ `_project.json_` _of our projects.)_
This command will publish both `my-own-react` and `create-my-own-react-app` packages to your local registry. If open the running Verdaccio registry at [http://localhost:4873](http://localhost:4873) you should see the published packages.
![](/blog/images/2023-08-10/D72hvW4nrl_DSYyMQU0DQ.avif)
3\. Now, you can run `npx create-my-own-react-app` just like a developer using our CLI would. For example, go to the tmp directory and create a `my-own-react` workspace named `test`:
```shell
cd tmp
npx create-my-own-react-app@1.0.0 test
```
What youll get is an Nx workspace with the base setup and a `test` library project with a single TS file. Because thats exactly what our current `preset` generator does.
![](/blog/images/2023-08-10/v70qP_BS6LJm3NMAYkv2KQ.avif)
Lets fix that in the next step.
### Step 3: Change the CLI to Setup a React App
In this step, we dive a bit more into the actual Nx plugin development to create our CRA replica.
Well go rather quickly but if you want a slower walkthrough you might be interested in this video that leverages a generator for automating the creation of projects. Exactly what were going to do in our preset now.
{% youtube src="https://youtu.be/myqfGDWC2go" /%}
To do this, we will fill in the preset generator under `src/generators/preset`
A generator is a function that makes modifications to a file system representation known as the `Tree`. These modifications will then be applied to the real file system. In our case, the preset generator will create the files for a React app.
Currently, the file at `src/generators/preset/generator.ts` looks like:
```
import {
addProjectConfiguration,
formatFiles,
generateFiles,
Tree,
} from '@nx/devkit';
import * as path from 'path';
import { PresetGeneratorSchema } from './schema';
export async function presetGenerator(
tree: Tree,
options: PresetGeneratorSchema
) {
const projectRoot = `libs/${options.name}`;
addProjectConfiguration(tree, options.name, {
root: projectRoot,
projectType: 'library',
sourceRoot: `${projectRoot}/src`,
targets: {},
});
generateFiles(tree, path.join(__dirname, 'files'), projectRoot, options);
await formatFiles(tree);
}
export default presetGenerator;
```
The preset generator does 2 things:
- Create an Nx project using the`addProjectConfiguration` function. This creates a `project.json` file which allows Nx to run commands on it.
- Generates files in the project using the`generateFiles` function. This uses the templates under `src/generators/preset/files` which are interpolated to become the files that are generated for the user.
- Format the generated files with `prettier` with the`formatFiles` function
![](/blog/images/2023-08-10/38RvkLIwUAvVDDrEp5sFPQ.avif)
_preset generator_
The `addProjectConfiguration` and `generateFiles` functions are from [@nx/devkit](/nx-api/devkit/documents/nx_devkit), a library that contains utility functions for writing plugins for Nx. For the future, see the [complete list of utility functions](/nx-api/devkit/documents/nx_devkit).
1. Change the project which is created with `addProjectConfiguration`:
```
const projectRoot = '.';
addProjectConfiguration(tree, options.name, {
root: projectRoot,
projectType: 'application',
targets: {}
});
```
- The `projectRoot` will be ., the root of a workspace
- The `projectType` changes to `application`
2\. Next, change the files generated into the project under `src/generators/preset/files`. We will use the same template as `create-react-app` .
Rename the existing `index.ts.template` to `src/generators/preset/files/src/index.tsx.template` and add the following content:
```
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<div className="App">
<header className="App-header">
<svg className="App-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
<p>
Welcome <%= name %>!
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
</React.StrictMode>
);
```
Add another file to generate a CSS template at `src/generators/preset/files/src/index.css.template`:
```
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
```
And finally, another file to host the actual HTML template: `src/generators/preset/files/public/index.html.template`:
```shell
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
```
3\. Our application uses some npm dependencies so add those to the workspace as well with the [addDependenciesToPackageJson](/nx-api/devkit/documents/nx_devkit) function to the end of the export default function in `src/generators/preset/generator.ts`:
```
import {
addDependenciesToPackageJson,
...
} from '@nx/devkit';
...
export default async function (tree: Tree, options: PresetGeneratorSchema) {
...
return addDependenciesToPackageJson(
tree,
{
react: 'latest',
'react-dom': 'latest',
'react-scripts': 'latest',
},
{
"@types/react": "latest",
"@types/react-dom": "latest",
}
);
}
```
This line will add the latest `react`, `react-dom`, `react-scripts`, and their types to the `package.json` in the generated workspace.
### Final Preset Generator
Now `src/generators/preset/generator.ts` should look like this:
```
import {
addDependenciesToPackageJson,
addProjectConfiguration,
formatFiles,
generateFiles,
Tree,
} from '@nx/devkit';
import * as path from 'path';
import { PresetGeneratorSchema } from './schema';
export default async function (tree: Tree, options: PresetGeneratorSchema) {
const projectRoot = `.`;
addProjectConfiguration(tree, options.name, {
root: projectRoot,
projectType: 'application',
targets: {},
});
generateFiles(tree, path.join(__dirname, 'files'), projectRoot, options);
await formatFiles(tree);
return addDependenciesToPackageJson(
tree,
{
react: 'latest',
'react-dom': 'latest',
'react-scripts': 'latest',
},
{
"@types/react": "latest",
"@types/react-dom": "latest",
}
);
}
```
## Step 4: Run the New Version that Creates the React App
Now you can publish a new version of `my-own-react` and `create-my-own-react-app` and run it again:
```shell
cd ..
npx nx run-many --targets publish --ver 1.0.1 --tag latest
cd tmp
npx create-my-own-react-app@1.0.1 test2
```
The CLI now creates a workspace with the dependencies we want and the code for the react application just like `create-react-app`:
![](/blog/images/2023-08-10/gZ7ocdR49soEahM8TlGA4A.avif)
## Step 5: Add a Serve Target
The workspace setup is done, what were missing though is a way to easily serve our app. To stick to what CRA does we simply need to run `react-scripts start` , but ideally, we want to make that more convenient for the developer by pre-generating that script into the workspace.
We have two possibilities:
- add the script to the root-level`package.json` using the `updateJson` function exposed by `@nx/devkit`
- add a target to the `project.json` using the `addProjectConfiguration` function exposed by `@nx/devkit`
Nx can use both. The `project.json` is Nxs variant of a more evolved package.json scripts declaration, that allows to specify metadata in a structured way.
To keep things simple, lets just generate a new script for the root-level `package.json`. We need to modify our `src/generators/preset/generator.ts` as follows:
```shell
import {
updateJson,
...
} from '@nx/devkit';
...
export default async function (tree: Tree, options: PresetGeneratorSchema) {
...
addProjectConfiguration(...);
updateJson(tree, 'package.json', (json) => {
json.scripts = json.scripts || {};
// generate a start script into the package.json
json.scripts.start = 'npx react-scripts start';
return json;
});
...
}
```
Note, we want to keep our `project.json` file even though it doesnt have any targets defined. That way Nx recognizes it as a proper project and applies caching and other optimization strategies.
### Adding the target to the `project.json` rather than `package.json`
Alternatively, we could have adjusted the already present `addProjectConfiguration` function to add the `react-scripts` command:
```shell
import {
...
addProjectConfiguration,
...
} from '@nx/devkit';
...
export default async function (tree: Tree, options: PresetGeneratorSchema) {
...
addProjectConfiguration(tree, options.name, {
root: projectRoot,
projectType: 'application',
targets: {
serve: {
command: "npx react-scripts start",
}
},
});
...
}
```
## Step 6: Run it Again to Get a React App That Can Be Served
To test our changes, lets publish a new version and run it again.
```shell
npx nx run-many --targets publish --ver 1.0.2 --tag latest
```
Once we generate a new workspace with the new preset version (npx create-my-own-react-app@1.0.2 test3), we should now see our `package.json` `start`script being generated.
![](/blog/images/2023-08-10/Rb6xWqUiK51DsZsAGdtNbQ.avif)
To run the app we either run
- `npm start`
- or `npx nx start` which would automatically pick up the `start` script in the `package.json`
![](/blog/images/2023-08-10/qVf6zEOndAgYkIRgZxTYZA.avif)
![](/blog/images/2023-08-10/K7YZDNyIWp0Bu9tLl5VixA.avif)
_serve output_
## Step 7: Add a Prompt to the CLI to Customize the Starter App
Now, you have a CLI that creates a workspace that users can use to get started with React. But thats not all. Lets take it a step further and make it interactive by adding a prompt that can let different users customize the kind of workspace that they want to create.
Take a look at the CLI code at `create-my-own-react-package/bin/index.ts`, you will notice it is pretty barebone. It reads the`name` from the commands arguments.
You can use libraries like [enquirer](https://github.com/enquirer/enquirer) (or even fancier ones like [Clack](https://www.npmjs.com/package/@clack/prompts)) to prompt developers for options. For this example, prompt developers to select a light or dark theme for the starter app.
1. Install `enquirer` with `npm i enquirer`
2. Change `create-my-own-react-package/bin/index.ts` to import `enquirer` and prompt developers to enter the mode option:
```
#!/usr/bin/env node
import { createWorkspace } from 'create-nx-workspace';
import { prompt } from 'enquirer';
async function main() {
let name = process.argv[2];
if (!name) {
const response = await prompt<{ name: string }>({
type: 'input',
name: 'name',
message: 'What is the name of the workspace?',
});
name = response.name;
}
let mode = process.argv[3];
if (!mode) {
mode = (
await prompt<{ mode: 'light' | 'dark' }>({
name: 'mode',
message: 'Which mode to use',
initial: 'dark' as any,
type: 'autocomplete',
choices: [
{ name: 'light', message: 'light' },
{ name: 'dark', message: 'dark' },
],
})
).mode;
}
console.log(`Creating the workspace: ${name}`);
// This assumes "my-own-react" and "create-my-own-react-app" are at the same version
// eslint-disable-next-line @typescript-eslint/no-var-requires
const presetVersion = require('../package.json').version;
// TODO: update below to customize the workspace
const { directory } = await createWorkspace(`my-own-react@${presetVersion}`, {
name,
nxCloud: false,
packageManager: 'npm',
mode,
});
console.log(`Successfully created the workspace: ${directory}.`);
}
main();
```
You can assemble options for `createWorkspace`; however, youd like and they will be passed to the `my-own-react` preset.
3\. Change `src/generators/preset` to accept this option and apply it.
In `src/generators/preset/schema.d.ts`, add it to the type for the options:
```
export interface PresetGeneratorSchema {
name: string;
mode: 'light' | 'dark';
}
```
Also, change the CSS for `.App-header` in the CSS template file`src/generators/preset/files/src/index.css.template`:
```
.App-header {
background-color: <%= mode === 'dark' ? '#282c34' : 'white' %>;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: <%= mode === 'dark' ? 'white' : '#282c34' %>;
}
```
Now if you republish the projects and regenerate an app with the light mode, you should see the background color and text color of the header got changed:
![](/blog/images/2023-08-10/tifthl0LFTk1i3PcZWUo_A.avif)
![](/blog/images/2023-08-10/ruXAwt1cxeZsdN2AkZqPzA.avif)
_serve output_
## Step 8: E2E Testing
This is how users start using your technology so you should write e2e tests to ensure this does not break. This workspace was also generated with a testing file `packages/my-own-react-e2e/tests/create-my-own-react-app.spec.ts`.
You can modify this e2e test to test your CLI. Then, run it using the command `npx nx e2e my-own-react-e2e`. Before the tests run, as a global setup, a local registry is started and the packages are published.
The default test works like this:
1. Creates a test workspace at `tmp/`using the `create-my-own-react-app` CLI
2. Runs `npm ls my-own-react` to validate that the plugin is installed in the test workspace
3. Cleans up the test workspace
Make sure `dark` is passed into `create-my-own-react-app` :
```
exec1-app ${projectName} dark`, {
cwd: dirname(projectDirectory),
stdio: 'inherit',
});
```
Add to a test to check `react` and `react-dom` are installed:
```
it('react and react-dom should be installed', () => {
projectDirectory = createTestProject('dark');
// npm ls will fail if the package is not installed properly
execSync('npm ls react', {
cwd: projectDirectory,
stdio: 'inherit',
});
execSync('npm ls react-dom', {
cwd: projectDirectory,
stdio: 'inherit',
});
});
```
## Recap and next steps
Recap:
- We learned about what an Nx Plugin is and generated a new plugin workspace
- We generated a new CLI package into the workspace: `create-my-own-react-app` . This allows our users to easily scaffold a new workspace
- We adjusted the preset generator to setup a CRA-like React setup
- We wrote some e2e tests to ensure that things do not break
This should give you a good insight into how to get started. But theres more to explore:
- We could provide more [generators](/plugins/recipes/local-generators\) to our users that help with setting up new components, adding unit tests, configuring the React Router etc.
- Add a generator to add other Nx plugins such as Jest, ESLint, or Cypress
- We could also include “[executors](/extending-nx/recipes/local-executors)”, which are wrappers around tasks to abstract the lower-level details of it
- etc.
Now clearly this was a simple example of how you could build your own CRA using Nx. If you want to see a real-world React setup powered by Nx, check out our React Tutorial: [/getting-started/tutorials/react-standalone-tutorial](/getting-started/tutorials/react-standalone-tutorial)
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [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](/nx-cloud)
+7 -5
View File
@@ -1,11 +1,12 @@
---
title: Qwikify your Development with Nx
slug: 'qwikify-your-development-with-nx'
authors: ['Colum Ferry']
cover_image: '/blog/images/2023-08-15/featured_img.png'
tags: [nx, changelog, release]
---
In the ever-evolving web development landscape, efficiency and modularity have become paramount. This is where [Nx](https://nx.dev) and [Qwik](https://qwik.dev/) come into play.
In the ever-evolving web development landscape, efficiency and modularity have become paramount. This is where [Nx]() and [Qwik](https://qwik.dev/) come into play.
Qwik is a modern web framework that focuses on application performance by reducing the amount of JavaScript that needs to be shipped to the browser. You can learn more about how Qwik achieves this with [Resumability in their docs](https://qwik.dev/docs/concepts/resumable/).
@@ -13,7 +14,7 @@ Nx is a powerful tool that helps you build extensible and maintainable codebases
In this blog post, well explore how to combine the strengths of Nx and Qwik to create a todo app. To do this, well take advantage of an Nx Plugin that was created by the Qwikifiers team to maximise the integration between Qwik and Nx, called [`qwik-nx`](https://github.com/qwikifiers/qwik-nx).
> You do not necessarily need to use an Nx Plugin for Qwik. Instead, you could use the [Qwik CLI](https://qwik.dev/docs/getting-started/#create-an-app-using-the-cli) to create your application and [add Nx later](/recipes/adopting-nx/adding-to-existing-project#installing-nx-on-a-non-monorepo-project).
> You do not necessarily need to use an Nx Plugin for Qwik. Instead, you could use the [Qwik CLI](https://qwik.dev/docs/getting-started/#create-an-app-using-the-cli) to create your application and [add Nx later](/recipes/adopting-nx/adding-to-existing-project#install-nx-on-a-nonmonorepo-project).
> In this blog post we use the `qwik-nx` plugin to leverage better DX provided by the generators offered by the Plugin.
**Table of Contents**
@@ -25,11 +26,12 @@ In this blog post, well explore how to combine the strengths of Nx and Qwik t
- [Generate a Library](#generate-a-library)
- [Add a Qwik Context](#add-a-qwik-context)
- [Using the Context](#using-the-context)
- [Adding a routeLoader$ to load data on Navigation](#adding-a-to-load-data-on-navigation)
- [Adding a `routeLoader$` to load data on Navigation](#adding-a-routeloader-to-load-data-on-navigation)
- [Handle the Form Action to add todos](#handle-the-form-action-to-add-todos)
- [Improve the Architecture](#improve-the-architecture)
- [Conclusion](#conclusion)
- [Further Reading](#further-reading)
- [Learn more](#learn-more)
You can learn more about this integration in the video below:
@@ -47,7 +49,7 @@ npx create-nx-workspace@latest qwik-todo-app
> You can also use the `preset` created by the `qwik-nx` plugin by running `npx create-qwik-nx` or `npx -y create-nx-workspace@latest --preset=qwik-nx`. This will skip a few of the next steps by installing the appropriate dependencies and generating your Qwik app.
>
> The `create-qwik-nx` package is an example of creating an Install Package with Nx. You can learn more here: [https://nx.dev/extending-nx/recipes/create-install-package](/extending-nx/recipes/create-install-package)
> The `create-qwik-nx` package is an example of creating an Install Package with Nx. You can learn more here: [/extending-nx/recipes/create-install-package](/extending-nx/recipes/create-install-package)
Next, navigate into the workspace and install the `qwik-nx` plugin.
@@ -606,4 +608,4 @@ This journey through Qwik and Nx demonstrates how thoughtful architecture and th
- [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/)
- [Speed up your CI](/nx-cloud)
@@ -0,0 +1,368 @@
---
title: 'Step-by-Step Guide to Creating an Expo Monorepo with Nx'
slug: 'step-by-step-guide-to-creating-an-expo-monorepo-with-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2023-08-24/IpM0kZdUNXoDWV4r8J5xXQ.png'
tags: [nx, tutorial]
---
This blog will show you how to create an Expo monorepo with Nx. In this example, you will be creating two Expo apps in a monorepo with `@nx/expo`: one shows random facts about cats, and the other shows random facts about dogs.
![](/blog/images/2023-08-24/ZObpn_5XsfYX-My6d9n4Zw.avif)
![](/blog/images/2023-08-24/S6bzPlLbnM_Li_0Rh7mmWw.avif)
_Left: cats, right: dogs_
As shown in the above screenshots, these two apps have the same branding and reuse all components.
This blog will go through:
- How to create a monorepo workspace with Nx
- How to share a React Native library
- How to build an Expo app
- How to submit an Expo app to the app store
Github repo: [xiongemi/nx-expo-monorepo](https://github.com/xiongemi/nx-expo-monorepo)
## Creating an Nx Workspace
To create a new Nx workspace, run the command `npx create-nx-workspace <workspace name>` in the terminal. In this example, lets name it `nx-expo-monorepo`:
```
✔ Where would you like to create your workspace? · create-nx-monorepo
✔ Which stack do you want to use? · react
✔ What framework would you like to use? · expo
✔ Application name · cats
✔ Enable distributed caching to make your CI faster · No
```
This will create an [integrated](/deprecated/integrated-vs-package-based) repo. What is an integrated repo?
> An integrated repo contains projects that depend on each other through standard import statements. There is typically a [single version of every dependency](/concepts/decisions/dependency-management) defined at the root.
> [/deprecated/integrated-vs-package-based](/deprecated/integrated-vs-package-based)
Now, your Nx workspace should have cats and cats-e2e under the `apps` folder and an empty libs folder:
![](/blog/images/2023-08-24/9yWjfR4oV5B0KFSdNgCH0g.avif)
### Existing Nx Workspace
If you already have an Nx workspace, you need to install the @nx/expo package:
```shell
\# npm
npm install @nx/expo --save-dev
\# yarn
yarn add @nx/expo --dev
\# pnpm
pnpm add @nx/expo --save-dev
```
To create an Expo app, run:
```shell
npx nx generate @nx/expo:app cats
```
Alternatively, if you use Visual Studio Code as your code editor, you can also create apps using [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console):
![](/blog/images/2023-08-24/WB17bHQ4p3nXJYWJ_IHGaw.avif)
## Install Tech Stacks
Here are the tech stacks this example is going to use:
- Material design library: [react-native-paper](https://callstack.github.io/react-native-paper/)
```shell
\# npm
npm install react-native-paper react-native-safe-area-context --save
\# yarn
yarn add react-native-paper react-native-safe-area-context
\# pnpm
pnpm add react-native-paper react-native-safe-area-context --save
```
- Routing: [@react-navigation/native](https://reactnavigation.org/)
```shell
\# npm
npm install react-native-paper react-native-screens @react-navigation/native-stack --save
\# yarn
yarn add react-native-paper react-native-screens @react-navigation/native-stack
\# pnpm
pnpm add react-native-paper react-native-screens @react-navigation/native-stack --save
```
## Create a Shareable UI Library
With all the required libraries installed, you need to create a sharable UI library:
```shell
npx nx generate @nx/expo:lib ui
```
Now under the `libs` folder, a `ui` folder has been created:
![](/blog/images/2023-08-24/evR014EchmXEWHJfJnbJRg.avif)
_ui folder_
To create a component in the `ui` library, run:
```shell
npx nx generate @nx/expo:component carousel --project=ui --export
```
You can see that a `carousel` folder has been created in the `libs/ui/src/lib` folder:
![](/blog/images/2023-08-24/s_zYPQv0QVg5-juNRXmedw.avif)
_carousel folder_
Next, modify this component to display the content with props passed in:
```tsx
import React from 'react';
import { Card, Title, Paragraph } from 'react-native-paper';
export interface CarouselProps {
imageUri?: string;
title?: string;
content: string;
}
export function Carousel({ imageUri, title, content }: CarouselProps) {
return (
<Card>
{imageUri && <Card.Cover source={{ uri: imageUri }} />}
<Card.Content>
{title && <Title>{title}</Title>}
<Paragraph>{content}</Paragraph>
</Card.Content>
</Card>
);
}
export default Carousel;
```
Now you can use this component in your app directly using an import:
```
import { Carousel } from '@nx-expo-monorepo/ui';
```
## Add Navigation
This project is going to use the [stack navigator](https://reactnavigation.org/docs/stack-navigator) from [@react-navigation/native](https://reactnavigation.org/). So the app needs to import from @react-navigation/stack. In `apps/cats/src/app/App.tsx`, you can change the UI to have one screen displaying a carousel with mock data:
```tsx
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Carousel } from '@nx-expo-monorepo/ui';
const App = () => {
const Stack = createNativeStackNavigator();
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Cat Facts"
component={() => (
<Carousel
title="title"
content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec porta leo justo, id posuere urna tempor convallis. Nulla finibus, dolor sit amet facilisis pellentesque, velit nisi tempor ipsum, nec interdum libero felis a risus. Pellentesque bibendum, dolor vel varius pulvinar, tortor leo ultrices nisi, non sodales dui quam vitae nulla. Integer sed rhoncus dui. Vestibulum bibendum diam ut leo tempus, vel vulputate magna iaculis. Suspendisse tempus magna libero, sed facilisis tellus aliquet ac. Morbi at velit ornare, posuere tortor vitae, mollis erat. Donec maximus mollis luctus. Vivamus sodales sodales dui pellentesque imperdiet. Mauris a ultricies nibh. Integer sed vehicula magna."
/>
)}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
export default App;
```
Run the app with`nx start cats`, and you should be able to see the app on the simulator:
![](/blog/images/2023-08-24/1hFA_7uBgU2GpFofNtHBiQ.avif)
_Page on the simulator (left: iOS, right: Android)_
## Add Another App
In this example, there is already a `Cats` app. To create the `Dogs` app, run the command:
```shell
npx nx generate @nx/expo:app dogs
```
Alternatively, if you use Visual Studio Code as your code editor, you can also create apps using [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console):
![](/blog/images/2023-08-24/8ut9KSAOn-UBBNxHJMtVXQ.avif)
Under the apps folder, there should be `cats/`, `dogs/` and their e2es.
![](/blog/images/2023-08-24/juth4jstENJ4h1AvIibujA.avif)
_apps folder_
You can reuse the UI library in the Dogs app in `apps/dogs/src/app/App.tsx` with the below code:
```tsx
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Carousel } from '@nx-expo-monorepo/ui';
const App = () => {
const Stack = createNativeStackNavigator();
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Dog Facts"
component={() => (
<Carousel
title="title"
content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec porta leo justo, id posuere urna tempor convallis. Nulla finibus, dolor sit amet facilisis pellentesque, velit nisi tempor ipsum, nec interdum libero felis a risus. Pellentesque bibendum, dolor vel varius pulvinar, tortor leo ultrices nisi, non sodales dui quam vitae nulla. Integer sed rhoncus dui. Vestibulum bibendum diam ut leo tempus, vel vulputate magna iaculis. Suspendisse tempus magna libero, sed facilisis tellus aliquet ac. Morbi at velit ornare, posuere tortor vitae, mollis erat. Donec maximus mollis luctus. Vivamus sodales sodales dui pellentesque imperdiet. Mauris a ultricies nibh. Integer sed vehicula magna."
/>
)}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
export default App;
```
## Build Expo Apps
[EAS Build](https://docs.expo.dev/build/introduction/) is a hosted service for building app binaries for your Expo and React Native projects. To set up EAS locally:
### 1. Install EAS CLI
EAS CLI is the command-line app to interact with EAS services in the terminal. To install it, run the command:
```
npm install -g eas-cli
```
### 2. Login To EAS
If you are not logged in, run the command:
```
eas login
```
### 3. Build the Apps
After the EAS setup, you can build apps by running the command:
```shell
npx nx build cats
npx nx build dogs
```
There are different options you can specify with the build command. For example, you can specify the platform you want to build:
```shell
npx nx build cats --platform=all
npx nx build cats --platform=android
npx nx build cats --platform=ios
```
Alternatively, if you want to create a build to run on a simulator/emulator, you can run:
```shell
npx nx build cats --profile=preview
```
You can view your build status at [https://expo.dev/](https://expo.dev/):
![](/blog/images/2023-08-24/pQxTgypzL10_SmI71jaWVQ.avif)
If you want to create a build locally using your own infrastructure:
```shell
npx nx build cats --local
```
Here is the complete list of flags for the build command: [/nx-api/expo/executors/build](/nx-api/expo/executors/build).
## Submit to the App Store
Before you submit, you need to have paid developer accounts for iOS and Android.
- iOS: You need to create an Apple Developer account on the Apple [Developer Portal](https://developer.apple.com/account/).
- Android: You need to create a Google Play Developer account on the [Google Play Console sign-up page](https://play.google.com/apps/publish/signup/). You also need to manually create an app on [Google Play Console](https://play.google.com/apps/publish/) and upload your app for the first time.
### 1\. Run the production build
To submit to the app store, you can build the app by running:
```shell
npx nx build cats --profile=production
```
### 2\. Submit the Build
You can manually upload the build bundle binary to the app store, or you can submit it through EAS.
First, in `app.json` under the project `apps/cats/app.json`, you need to make sure`ios.bundleIdentifier` and `android.package` keys are correct:
![](/blog/images/2023-08-24/j9TAZZgqplZCcjD4hiWNpg.avif)
_app.json_
To submit your app to the app stores, run:
```shell
npx nx submit cats
```
Nx will prompt you to choose the platform to which you want to submit:
![](/blog/images/2023-08-24/PcBvY1SJCHZyOnJI1hskAQ.avif)
Or you can also specify the platform directly in the initial command:
```shell
npx nx submit cats --platform=all
npx nx submit cats --platform=android
npx nx submit cats --platform=ios
```
It will then ask you to choose which binary to submit from one of the following options:
- The latest finished Android build for the project on EAS servers.
- Specific build ID. It can be found on the [builds dashboard](https://expo.dev/builds).
- Path to an .apk or .aab or .ipa archive on your local filesystem.
- URL to the app archive.
Alternatively, you can submit your app on the [expo.dev](https://expo.dev/) site. Go to your build, under options, choose “Submit to an app store”:
![](/blog/images/2023-08-24/yQlEmKOy3TXdWPCk9ILiZA.avif)
## Summary
In this article, you have learned how to:
- Create multiple apps in a monorepo using @nx/expo
- Create a shared library
- Build your app using EAS
- Submit your app to the App Store
With Nx, it is easy to create and scale up an Expo app. Even though this app is currently a simple 2-page app, you can easily scale it up with more libraries and components. Furthermore, you can also reuse those libraries in the future if you decide to add another app to the repo.
## Learn more
- [Unit Testing Expo Apps With Jest](/blog/unit-testing-expo-apps-with-jest)
- 👩‍💻 [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/)
+376
View File
@@ -0,0 +1,376 @@
---
title: 'Nx 16.8 Release!!!'
slug: 'nx-16-8-release'
authors: ['Zack DeRose']
cover_image: '/blog/images/2023-09-06/16gTRcKon8B4IKYQAY9V8w.png'
tags: [nx, release]
---
As always, the Nx Team has been hard at work, and were here to launch our latest release: Nx 16.8! And its absolutely bursting with new features. Well go into all these in depth below, but be sure to check out our latest release video on YouTube!
If you have more questions — be sure to stop by our latest Nx Live to ask them there! You can sign up for a notification from the link below!
{% youtube src="https://youtu.be/wj-gb6jqyzA" /%}
## Nx Community News!
Before we jump into the features, be sure to get plugged in to get the most out of Nx in [our NEW discord server](https://discord.gg/Pzz9BW62gD)!
Be sure to checkout our livestream with Jay Bell (Nx Champion, former Nx Community Slack admin, and current Nx Discord Admin) all about the news:
{% youtube src="https://youtu.be/yBsXB8xuTog" /%}
Nx is also coming up on 20k Github stars [please help us get there!](https://github.com/nrwl/nx)
![](/blog/images/2023-09-06/MyOG_Cxg_EkhULxq.avif)
**Table of Contents**
· [NEW PROJECT GENERATOR BEHAVIOR: Project Creation Paths and Names in Nx Generators](#new-project-generator-behavior-project-creation-paths-and-names-in-nx-generators)
· [Packaging TypeScript Libraries — Secondary Entrypoints, ESM, CJS](#packaging-typescript-libraries-secondary-entrypoints-esm-cjs)
· [High Performance TypeScript Compilation: Introducing Batch Mode & Rust-based Dependency Resolution](#high-performance-typescript-compilation-introducing-batch-mode-rustbased-dependency-resolution)
· [NEW Nx PLUGIN: Playwright](#new-nx-plugin-playwright)
· [NEW INTEGRATION: Netlifys Improved Monorepo Experience](#new-integration-netlifys-improved-monorepo-experience)
· [NEW Nx CONSOLE FEATURE: Interactive Graph Functionality](#new-nx-console-feature-interactive-graph-functionality)
· [ENHANCEMENT: Storybook Support for Interaction Testing](#enhancement-storybook-support-for-interaction-testing)
· [NEW GENERATOR: convert-to-monorepo](#new-generator-converttomonorepo)
· [DOCS ENHANCEMENT: Third-Party Plugin Quality Indicators](#docs-enhancement-thirdparty-plugin-quality-indicators)
· [DOCS ENHANCEMENT: Redesigned Intro & Examples](#docs-enhancement-redesigned-intro-examples)
· [NEW GENERATOR: ESLint Flat Config](#new-generator-eslint-flat-config)
· [New Nx Cloud Overview Video](#new-nx-cloud-overview-video)
· [Nx Conf Coming Up](#nx-conf-coming-up)
## NEW PROJECT GENERATOR BEHAVIOR: Project Creation Paths and Names in Nx Generators
Alright, getting into the newest updates from Nx, the biggest change is coming in the form of Nx project generators.
Originally, all Nx workspaces had a directory structure where applications were always held in an `apps/` directory, while libraries were held in the `libs/` directory.
Over the years, we found this to be much too rigid, so we made these locations more configurable. We added a `workspaceLayout` category to the `nx.json` file, where you could set `appDir` and `libDir` options to customize the names of these directories.
We also simplified the definition of Nx projects to be any directory that had a `project.json` file in it, allowing for the ability to nest projects in your filesytem and also forego app or lib directories altogether!
With Nx 16.8, were introducing an all-new option in this `workspaceLayout` category: `projectNameAndRootFormat` where you can chose either the option to apply project names `as-provided` or `derived`.
![](/blog/images/2023-09-06/U5gxfZXk8pwgOXCE.avif)
If you dont set this option in your `nx.json` file, our generators will now prompt you as to how we should set:
- the name of your project (as in the projects `project.json` file)
- where to put the project in your filesystem
![](/blog/images/2023-09-06/eBwA23cwcMv8V5zF.avif)
You can avoid the extra prompt above by setting the `projectNameAndRootFormat` in the `workspaceLayout` category of your `nx.json` file, or by providing it in in your generate command:
```
> nx g app my-app --projectNameAndRootFormat=as-provided
```
This will change some of the default behaviors of our generators and for new Nx workspaces. By default, new workspaces will be set to `as-provided`, so longtime Nx users might notice that if they create a new workspace and start generating apps or libs, that they will now get generated at the root of the workspace instead of inside the `apps/` or `libs/` directory like they used to.
To get the legacy behavior, be sure to change the `projectNameAndRootFormat` to `derived` and/or use the `name` option to set the name of the project, and the `directory` option to set the full path of the target directory for your new projects:
```
> nx g app --name=my-app --directory=apps/my-app
```
## Packaging TypeScript Libraries — Secondary Entrypoints, ESM, CJS
{% youtube src="https://youtu.be/Vy4d0-SF5cY" /%}
Nx has always had first-class TypeScript support from the very beginning. You never really had to worry about Type Definition files being properly included or setting up TS support in the first place. But there are some aspects that can be tricky, like defining and properly exporting secondary entry points or packaging in multiple formats (ESM and CJS). Thats why we did some research to help make it easier.
The `package.json` format supports an [export field](https://nodejs.org/api/packages.html#package-entry-points) which is a modern alternative to the `main` property, allowing to have multiple such entry points.
```json
{
"exports": {
"./package.json": "./package.json",
".": "./src/index.js",
"./foo": "./src/foo.js",
"./bar": "./src/bar.js"
}
}
```
To make it easier to maintain these, weve added two new options to the `@nx/js` package: `additionalEntryPoints` and `generateExportsField`. Here's an example:
```
// packages/my-awesome-lib/project.json
{
"name": "my-awesome-lib",
"targets": {
"build": {
"executor": "@nx/js:tsc",
...
"options": {
"main": "packages/my-awesome-lib/src/index.ts",
...
"additionalEntryPoints": ["packages/my-awesome-lib/src/foo.ts"],
"generateExportsField": true
},
},
...
}
}
```
When building the library, the `@nx/js:tsc` executor automatically adds the correct `exports` definition to the resulting `package.json`.
This makes it easy to maintain the `exports` field, something that becomes even more relevant if we **want to add add multiple formats**. By switching to the `@nx/rollup:rollup` executor, we can also add the `format` option and define `esm` and `cjs` as the target formats we want to have. Note we still keep the `additionalEntryPoints` and `generateExportsField`.
```
// packages/my-awesome-lib/project.json
{
"name": "my-awesome-lib",
"targets": {
"build": {
"executor": "@nx/rollup:rollup",
...
"options": {
"main": "packages/my-awesome-lib/src/index.ts",
...
"format": ["esm", "cjs"],
"additionalEntryPoints": ["packages/my-awesome-lib/src/foo.ts"],
"generateExportsField": true
},
},
...
}
}
```
After compiling our package using `nx build my-awesome-lib` we'll get the following output in our `dist` folder.
```
my-awesome-lib
└─ .
├─ README.md
├─ foo.cjs.d.ts
├─ foo.cjs.js
├─ foo.esm.js
├─ index.cjs.d.ts
├─ index.cjs.js
├─ index.esm.js
├─ package.json
└─ src
├─ foo.d.ts
├─ index.d.ts
└─ lib
└─ my-awesome-lib.d.ts
```
And our `package.json` will look as follows:
```json
{
"name": "my-awesome-lib",
"version": "0.0.1",
...
"type": "commonjs",
"main": "./index.cjs.js",
"typings": "./src/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./index.esm.js",
"default": "./index.cjs.js"
},
"./foo": {
"import": "./foo.esm.js",
"default": "./foo.cjs.js"
}
},
"module": "./index.esm.js"
}
```
## High Performance TypeScript Compilation: Introducing Batch Mode & Rust-based Dependency Resolution
Speed is in our DNA! And TypeScript compilation can be slow which is mostly due to `tsc` being a costly operation. You feel this in particular in a monorepo where you have multiple projects that are being compiled independently, thus launching dozens of processes of the `tsc` compiler.
To help with this, the TypeScript team introduced [Project References](https://www.typescriptlang.org/getting-started/intro/handbook/project-references.html) which performs incremental compilation by caching intermediate results. However this comes with some [caveats you need to be aware of](https://www.typescriptlang.org/getting-started/intro/handbook/project-references.html#caveats-for-project-references) and it can be intense to maintain by hand on a large codebase.
We wanted to make it transparent though and not something the user needs to worry about. Thats why we introduced [“Batch Mode”](/showcase/benchmarks/tsc-batch-mode). Batch mode is still experimental, and you can enable it for any project using the `@nx/js:tsc` executor by adding the environment variable `NX_BATCH_MODE=true`:
```
> NX_BATCH_MODE=true nx run-many --target=build
```
When enabling batch mode, Nx leverages the underlying [project graph](/features/explore-graph) to generate TypeScript project references behind the scenes for you, to fully leverage TS incremental building. The results are amazing. According to [our benchmarks](https://github.com/nrwl/large-ts-monorepo), batch mode has the potential to speed up Typescript compilation by up to 5x for large monorepos.
![](/blog/images/2023-09-06/givRGKA05v55ICoC.avif)
In addition to batch mode, the processing of Typescript dependencies is **now using a faster and more accurate Rust implementation**. This should be transparent to most users — aside from your monorepo becoming even faster!
## NEW Nx PLUGIN: Playwright
A new Nx plugin has appeared!!
![](/blog/images/2023-09-06/QBwv5NKpT9tp2-8E.avif)
Nx now supports Playwright as an e2e option alongside our long-standing support for Cypress!
First off, this means weve added Playwright as an option when generating new frontend applications:
![](/blog/images/2023-09-06/kvqmp9n2pkivb8ba.avif)
If you want to add playwright to an existing project in your workspace you can also do that now by installing the plugin (here using `npm`):
```
npm add -D @nx/playwright
```
Then running our new generator to add playwright to your project (here Im adding it to my application called `my-app`):
```
nx g @nx/playwright:configuration --project=my-app
```
This will setup playwright for you, and add an `e2e` target to your project using playwright!
## NEW INTEGRATION: Netlifys Improved Monorepo Experience
On Netlifys enterprise tier, approximately 46% of builds are monorepos, with the majority leveraging Nx and [Lerna](https://lerna.js.org/). Recognizing this trend, Netlify has focused on enhancing the setup and deployment experiences for monorepo projects. In particular they worked on an “automatic monorepo detection” feature. When you connect your project to GitHub, Netlify automatically detects if its part of a monorepo, reads the relevant settings, and pre-configures your project. This eliminates the need for manual setup. This feature also extends to local development via the Netlify CLI.
[Juri Strumpflohner](https://twitter.com/juristr) from the Nx team sits down with [Lukas Holzer](https://twitter.com/luka5c0m) from Netlify to discuss what monorepos are, when you might need them, their challenges and benefits, and the tooling support Nx provides. But its not just talk; they also walk you through setting up a new Nx monorepo, adding Netlify Edge functions, and deploying it all to Netlify — both via the website and locally through the newly improved Netlify CLI.
{% youtube src="https://youtu.be/KL7PCwf-mtM" /%}
If you prefer the blog post, check out [“Elevating enterprise deployment: Introducing an enhanced monorepo experience on Netlify”](https://www.netlify.com/blog/elevating-enterprise-deployment-introducing-an-enhanced-monorepo-experience-on-netlify/) on the Netlify blog.
## NEW Nx CONSOLE FEATURE: Interactive Graph Functionality
If youre not familiar — Nx Console is our IDE enhancement for [VsCode (1.4 million installations!!)](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console) and [JetBrains Products (Intellij/WebStorm/etc — 52 thousand downloads!)](https://plugins.jetbrains.com/plugin/21060-nx-console).
Nx Console provides a Graphical User Interface for running tasks and generating code for your Nx Monorepos, and it also provides the ability to view your project graph
![](/blog/images/2023-09-06/uPA0E0HseySqzwPu.avif)
and task graph
![](/blog/images/2023-09-06/r3d7xr7yI1CPERKg.avif)
within your IDE!
As of our latest release, Nx Console has added the new feature of adding buttons inside the project graph to take you directly to the selected project in the project graph:
![](/blog/images/2023-09-06/NZdpBJ59gO-HdsV5.avif)
And gives you a “play button” to run any task within your task graph:
![](/blog/images/2023-09-06/AEht-0Pq7rdr-Uso.avif)
## ENHANCEMENT: Storybook Support for Interaction Testing
Storybook 7 introduces new [Interaction Testing](https://storybook.js.org/getting-started/intro/react/writing-tests/interaction-testing) to their platform!
![](/blog/images/2023-09-06/b7d1uLylXFjA4lU1.avif)
The Nx Storybook plugin has now been enhanced with a new `interactionTests` option on the `storybook-configuration` generator, that will automate setting up these interaction tests for you when you use Nx to generate stories for your components!
You can checkout everything about Storybook Interaction tests and our Nx support for it in this video:
{% youtube src="https://youtu.be/SaHoUx-TUs8" /%}
Nx has always provided similar functionality via our Storybook + Cypress integrations, where you can setup cypress tests to test your storybook showcases, and while you can use interaction testing to replace this integration, we will continue to support our Storybook + Cypress integrations going forward!
## NEW GENERATOR: convert-to-monorepo
Towards the start of the year, we added support for Nx standalone applications. These were designed as a way of using Nx features in a way where you didnt need to opt into a monorepo setup.
Ever since we introduced these, weve had requests from the community to add a generator to convert your standalone workspace to a monorepo setup — to support repos that grew to emcompass more than just the 1 application.
This is where our new [`convert-to-monorepo` generator](/nx-api/workspace/generators/convert-to-monorepo) comes into play!
```shell
nx g convert-to-monorepo
```
This will identify all library projects in currently in your repo and place them in the `libs/` directory that you might expect of a typical Nx monorepo. It will also hoist your application project from the root of your workspace into the `apps/` directory.
When all is said and done, you should be able to now add additional applications to your repo now!
## DOCS ENHANCEMENT: Third-Party Plugin Quality Indicators
One of the great things about Nx is the extensibility, and the wide range of plugins that are available for supporting languages, frameworks, and tools that the core Nx team does not directly support.
Our docs site has hosted [a registry of these plugins](/plugin-registry) for awhile now, but weve recently added npm downloads, github stars, release dates, and compatible Nx versions to this registry:
![](/blog/images/2023-09-06/f74VOjpr7u9RTmDE.avif)
We expect that these will be valuable signals to users as to the quality of the plugin.
Weve also added the ability to sort the registry by these metrics as a way of surfacing the higher quality plugins to the top!
![](/blog/images/2023-09-06/f0AhdlWaIcC96LXK.avif)
Go [check it out now](/plugin-registry) live on our docs site!
## DOCS ENHANCEMENT: Redesigned Intro & Examples
Our mission to improve Nx docs continues: this edition with some major updates to our [Docs intro page](/getting-started/intro).
We improved the messaging around Nx and more prominently emphasizing the [core features](/features) that distinguish Nx from other tools out there. We also linked a new “What is Nx” video. You should check it out 🐐
{% youtube src="https://youtu.be/-_4WMl-Fn0w" /%}
The core part of the intro page now has a dedicated section for “Learning Nx”, surfacing some of our Nx, Nx Cloud and Monorepo videos as well as our in-depth tutorial about monorepos and single-project Nx workspaces. And we already have more in the works, so stay tuned.
![](/blog/images/2023-09-06/VwG57cMDy9fGGI8l.avif)
Were also proud of all the new examples weve added in the last months. We have a brand new [Nx Recipe](https://github.com/nrwl/nx-recipes) repo with a variety of example projects that showcase Nx in combination with different technologies, even outside the JS ecosystem (e.g. with Rust, Go and .Net).
Go pick the ones youre most interested in!
![](/blog/images/2023-09-06/pMTW9GzZjRNrlyRH.avif)
You can find all of the examples and more on our “Showcase” section: [/showcase](/showcase).
## NEW GENERATOR: ESLint Flat Config
ESLint has announced a new config system — nicknamed “flat config” — whose intent is to be be familiar and much simpler than the current config system. You can read more about this [in their blog post](https://eslint.org/blog/2022/08/new-config-system-part-2/).
As part of our continued support for ESLint, weve introduced [a new generator](/nx-api/eslint/generators/convert-to-flat-config) to convert your Nx monorepo to this new system:
```
> nx g convert-to-flat-config
```
Flat config is still experimental, so you can use this as a way of easily previewing the new config system now. Just be sure not to mix the original configuration with this new configuration system!
## New Nx Cloud Overview Video
Weve been working hard on our premium product: Nx Cloud, and part of that has been this awesome video from our own Rares Matei on what exactly Nx Cloud is!
{% youtube src="https://youtu.be/NZF0ZJpgaJM" /%}
Be sure to checkout the [Nx Cloud landing site](/nx-cloud) for more details on all the additional features you unlock with the power of the cloud!
## Nx Conf Coming Up
Last but definitely not least, [Nx Conf 2023](/conf) is fast approaching! Well be coming to you live from New York City on September 26!
Be sure to [register to attend online FOR FREE](https://ti.to/nx-conf/nxconf2023online) and be sure to checkout our [lineup of talks](/conf#speakers) and [speakers](/conf#agenda)!
## Wrap Up
Thats all for now folks! Were just starting up a new iteration of development on Nx, so be sure to subscribe to our YouTube channel to get updates when new features land! Until next time, KEEP WORKING HARD!
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- 🥚 [Free Egghead course](https://egghead.io/courses/scale-react-development-with-nx-4038)
- 🚀 [Speed up your CI](/nx-cloud)
## More Nx Release Notes:
- [Nx 16.5](/blog/nx-16-5-release)
- [Nx 16.0](/blog/nx-16-is-here)
- [Nx 15.8](/blog/nx-15-8-rust-hasher-nx-console-for-intellij-deno-node-and-storybook)
- [Nx 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning)
- [Nx 15.4](/blog/nx-15-4-vite-4-support-a-new-nx-watch-command-and-more)
- [Nx 15.3](/blog/nx-15-3-standalone-projects-vite-task-graph-and-more)
@@ -0,0 +1,310 @@
---
title: 'Introducing Playwright Support for Nx'
slug: 'introducing-playwright-support-for-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2023-09-18/589bVpPTJ4D4IACBePXWQ.png'
tags: [nx, release, tutorial]
---
We are very excited to announce our support for Playwright with our new plugin `@nx/playwright`.
This blog will show you:
- What is Playwright
- How to create a new Nx workspace with Playwright support
- How to add Playwright to an existing Nx workspace
{% youtube src="https://youtu.be/k1U3PuBrZFQ?si=AVyXfyMJz4q6OJ70" /%}
## What is Playwright?
Before we start, lets answer this question: what is Playwright and why should we use it?
From [playwright.dev](https://playwright.dev/), it says: “Playwright is end-to-end testing for modern web apps”. It sounds good, what does it do for us developers? What developer experience does it provide?
### Multiple Browsers
It is easy to run e2e test suites across multiple browsers. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox. It also supports branded browsers and mobile viewports. For example, we can simply add the below code to the playwright configuration file to run the same test across these browsers:
```
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
projects: [
/* Test against desktop browsers */
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
/* Test against mobile viewports. */
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] },
},
/* Test against branded browsers. */
{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' }, // or 'chrome-beta'
},
],
});
```
### Auto Waiting
Playwright automatically waits for the relevant checks to pass, then performs the request action. What does it mean? For example, lets say we have a sign-up form where:
- while the app checks that the user name is unique, the submit button is disabled.
- after checking with the server, the submit button becomes enabled.
How do we write tests in the Playwright? Playwright performs a range of actionability checks on the elements before making actions to ensure these actions behave as expected. So we dont need to wait for the button to be enabled. Playwright will check it. We can simply write:
```
await page.getByTestId('submit-button').click();
```
### HTML Test Report
Playwright creates a nice HTML test report that allows filtering tests by browsers, passed tests, failed tests, skipped tests, and flaky tests.
![](/blog/images/2023-09-18/28KM1laCSbq9OwLYFaq8BQ.avif)
_HTML Test Report_
Clicking on the individual test shows more detailed errors along with each step of the test:
![](/blog/images/2023-09-18/slGx_vh9CQAD3er6XaNsjw.avif)
_Test error_
It also has other features like recording [screenshots](https://playwright.dev/docs/screenshots) and [videos](https://playwright.dev/docs/videos), [test generation](https://playwright.dev/docs/codegen), and [visual comparisons](https://playwright.dev/docs/test-snapshots). Read more about Playwright at [https://playwright.dev](https://playwright.dev/)
Next, lets write and run some Playwright tests.
## Create a new Nx Workspace with Playwright
In this example, we will create a React app using Playwright as its end-to-end testing framework. In the terminal, run the below command:
```shell
npx create-nx-workspace
✔ Where would you like to create your workspace? · nx-react-playwright
✔ Which stack do you want to use? · react
✔ What framework would you like to use? · none
✔ Integrated monorepo, or standalone project? · standalone
✔ Which bundler would you like to use? · vite
✔ Test runner to use for end to end (E2E) tests · playwright
✔ Default stylesheet format · css
✔ Enable distributed caching to make your CI faster · No
```
We get a standalone Nx React app named `nx-react-playwright`:
![](/blog/images/2023-09-18/czlvgB1lLaIHb9uuRj9Ig.avif)
_nx repo created_
What is a [standalone application](/deprecated/integrated-vs-package-based)? It is like an integrated monorepo setup but with just a single, root-level application. The repo has the same file structure as an app created from Create-React-App, but we can still leverage all the generators and executors and structure your application into libraries or submodules.
### Run E2E
The default e2e test is located in `e2e/src/example.spec.ts`:
```
import { test, expect } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('/');
// Expect h1 to contain a substring.
expect(await page.locator('h1').innerText()).toContain('Welcome');
});
```
The test verifies the `h1` header contains the text `Welcome`:
![](/blog/images/2023-09-18/ehJZTRfHfFF6hmSh3eJ-qA.avif)
_Page served up_
To run the e2e tests, run the below command:
```shell
npx nx e2e e2e
```
In the terminal, it shows the following log:
```shell
nx run nx-react-playwright:serve:development
➜ Local: http://localhost:4200/
3 passed (11.8s)
To open last HTML report run:
npx playwright show-report dist/.playwright/e2e/playwright-report
```
So the test passed and it also generated a report at `dist/.playwright/e2e/playwright-report/index.html`:
![](/blog/images/2023-09-18/xWKkHUozvDtk0Q9ihjDZbw.avif)
### Add Another Test
Let's add another test to check the Documentation button works:
![](/blog/images/2023-09-18/yTeWAR-3vE6Vdb6Cc6C5RA.avif)
_Documentation_
In `src/app/nx-welcome.tsx`, we need to add a test id to the link:
```
<a
href="/getting-started/intro?utm_source=nx-project"
target="_blank"
rel="noreferrer"
className="list-item-link"
data-testid="documentation-link"
>
```
Then in `e2e/src/example.spec.ts`, the test file will become:
```
import { test, expect } from '@playwright/test';
test.describe('navigation', () => {
test.beforeEach(async ({ page }) => {
// Go to the starting url before each test.
await page.goto('/');
});
test('has title', async ({ page }) => {
// Expect h1 to contain a substring.
expect(await page.locator('h1').innerText()).toContain('Welcome');
});
test('should go to documentation site', async ({ page, context }) => {
await page.getByTestId('documentation-link').click();
// Opening a new tab and waiting for the page to render
const pagePromise = context.waitForEvent('page');
const newPage = await pagePromise;
await newPage.waitForLoadState();
expect(await newPage.title()).toContain('Intro to Nx');
});
});
```
Now run `npx nx e2e e2e`, the test would still pass:
```shell
nx run nx-react-playwright:serve:development
➜ Local: http://localhost:4200/
6 passed (3.1s)
To open last HTML report run:
npx playwright show-report dist/.playwright/e2e/playwright-report
```
Now we have created a new Nx workspace with Playwright. However, if you already have an Nx repo, how do you add Playwright E2E configuration to an existing app?
## How to add Playwright to an existing Nx workspace
For this example, I am going to add Playwright e2e tests to this repo: [nrwl/nx-examples](https://github.com/nrwl/nx-examples)
We are going to focus on the cart app in this example. In the terminal, run `npx nx serve cart` and it should serve up the app at [http://localhost:4200/cart](http://localhost:4200/cart).
![](/blog/images/2023-09-18/F8KLtNUJvKtsZtUSU13vgQ.avif)
_Cart App_
### Install @nx/playwright
To install, run:
```shell
#npm
npm install @nx/playwright --save-dev
#yarn
yarn add @nx/playwright --dev
#pnpm
pnpm i -D @nx/playwright
```
### Apply Playwright Configuration
There are 2 ways to apply the E2E Playwright configuration.
1. **Apply directly on the cart app**
We can set up Playwright directly on the cart app:
```shell
npx nx generate @nx/playwright:configuration --project=cart ---webServerCommand="npx nx serve cart" --webServerAddress="http://localhost:4200"
```
It adds:
- an e2e target in `apps/cart/project.json`
- an e2e folder at `apps/cart/e2e` containing e2e tests
- `playwright.config.ts` containing Playwright configuration
![](/blog/images/2023-09-18/IEwONcILNaIYHmjTyhF3Bw.avif)
_new cart folder_
Let's update the default test `apps/cart/e2e/example.spec.ts` to check whether the header exists:
```
import { test, expect } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('/cart');
await expect(page.locator('nx-example-header')).toBeVisible()
});
```
Now we can run `npx nx e2e cart` and it should pass.
**2\. Add a separate E2E Project**
The second way is to create a separate E2E project folder and apply configuration there.
Create a folder e2e at the workspace root and a project.json file inside it:
![](/blog/images/2023-09-18/nF2bZhQb1CZ4Kc8btsxzRw.avif)
Add name in `e2e/project.json`:
```json
{
"name": "e2e"
}
```
Now apply the Playwright configuration to the e2e project:
```shell
npx nx generate @nx/playwright:configuration --project=e2e ---webServerCommand="npx nx serve cart" --webServerAddress="http://localhost:4200"
```
Now I created an e2e folder at the workspace root:
![](/blog/images/2023-09-18/nZXrAKzg4krYx6fouDefpw.avif)
_e2e folder_
Now we can run `npx nx e2e e2e` to run the Playwright e2e tests.
## Summary
In this blog, we have:
- Created a new Nx react repo with Playwright
- Written our own Playwright tests
- Used Nx to run Playwright tests
- Set up a Playwright configuration for an existing Nx app
Hopefully, this gives you good insight into how to get started with Playwright. The Playwright configuration in this example is pretty simple, to learn more about `@nx/playwright` plugin, check out the Nx documentation: [/nx-api/playwright](/nx-api/playwright).
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [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](/nx-cloud)
+21
View File
@@ -0,0 +1,21 @@
---
title: Nx Raises $16M Series A
slug: 'nx-raises-16m-series-a'
authors: [Jeff Cross]
tags: [nx]
---
Victor and I are excited to announce that Nx has raised another $16M in a Series A funding round with Nexus Venture Partners and a16z! See our announcement video for more, and be sure to check out the [live stream of Nx Conf 2023](https://youtube.com/live/IQ5YyEYZw68?feature=share) tomorrow to see what were up to!
{% youtube src="https://www.youtube.com/embed/KuyYhC4ClW8?si=qoZL6i6X1E7wjChD" /%}
---
## 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](/nx-cloud)
+494
View File
@@ -0,0 +1,494 @@
---
title: Nx Conf 2023 — Recap
slug: 'nx-conf-2023-recap'
authors: [Juri Strumpflohner]
cover_image: '/blog/images/2023-10-13/featured_img.webp'
tags: [nx, nx-conf]
---
The 3rd edition of [Nx Conf](/conf), this year live from New York City. If you missed the talks, no worries, weve got you covered. This article does a brief recap of all the presentations and has links to the individual recordings and slides.
{% youtube src="https://www.youtube.com/embed/P_W8MwX25a0?si=gpjul3hdqmOiBdev" /%}
## Keynote
**Speaker:** [Juri Strumpflohner](https://twitter.com/juristr) & [Victor Savkin](https://twitter.com/victorsavkin)
{% youtube src="https://www.youtube.com/watch?v=WSqivWlEDFw" /%}
Juri Strumpflohner (me 😅) opens the keynote. He focuses on the Nx ecosystem, how it is [much more than monorepos](/getting-started/why-nx) by helping you integrate your framework of choice (whether that is Angular, React, or Vue) with tooling such as ESLint, Playwright, Cypress, Webpack, ESBuild, Vite etc.
![](/blog/images/2023-10-13/bodyimg1.webp)
Such integration capabilities really help push the developer productivity, whether thats in single-project workspaces or monorepos.
Juri also dives deeper into efforts from the team to provide high quality educational content around Nx and its capabilities. The [Nx docs](/getting-started/intro) have been restructured to follow the [Diataxis](https://diataxis.fr/) framework, dividing content into into learning-, task-, understanding- and information-oriented sections.
![](/blog/images/2023-10-13/bodyimg2.webp)
This makes it easier to find keep the content organized and focused and makes it easier for the reader to choose between solution-oriented [recipes](/recipes) vs learning-oriented [tutorials](/getting-started/tutorials).
The Nx team not only produces written content, but also video content mainly on the [Nx YouTube Channel](https://www.youtube.com/@nxdevtools). Juri shows some of the growth stats, with the channel now having more than 14k subscribers and around 3.7k hours of watch time per month. The channel serves mostly short-form videos about new releases, highlighting new features as well as longer-form tutorial videos.
The Nx Community also got a special place in the keynote. Juri highlighted in particular the transition from the “Nrwl Community Slack” to the new “Nx Community” on Discord.
![](/blog/images/2023-10-13/bodyimg3.webp)
Discord is built for managing communities and will open up a series of features to come. Things like a built-in forum to ask questions, the ability to highlight Nx events (e.g. the Nx live stream) and having powerful automation and moderation tools. Since the launch a couple of weeks ago, already 1500+ members have signed up. If you didnt sign up yet, go to [https://go.nx.dev/community](https://go.nx.dev/community).
Juri also highlighted the [Nx Champions](/community) program that got launched this year which helps with efforts to grow the Nx community. The program features members that stood out in the Nx community by helping support others, producing content or speaking at conferences about Nx and related tech.
Finally there were also two **announcements**:
- the Nx team decided to move off Medium for a better publishing experience but mainly also to avoid the paywall, something that the team has no control over. The new blog is currently being built and will be hosted at [blog](/blog). This also allows to better resurface information by being able to integrate blog articles into the Nx docs search and make them also accessible to the Nx AI Assistant which was the 2nd announcement.
- the **Nx AI Assistant** is an experiment the team is running to use AI to improve discoverability on the Nx docs. The ChatGPT powered assistant allows to ask natural language questions and responds based on the Nx docs training data, also including links to the sources. Try it out at [ai-chat](/ai-chat) and use the feedback thumbs-up/down buttons to help improve it over time 🙏.
Also, Nx is open source: [https://github.com/nrwl/nx](https://github.com/nrwl/nx). Contribute! And while youre there, dont forget to give us a star 😃.
**Victor Savkin** began the second segment of the keynote discussing the hidden expenses that often plague large teams.
![](/blog/images/2023-10-13/bodyimg4.webp)
He emphasized that as an organization grows, so does the supporting work. This isnt limited to just communication and management. Every artifact, be it code, process, or otherwise, needs to be assimilated into the broader context. This supporting work becomes intricate and demanding. He pointed out that the remote work trend, while it started with a lot of momentum, struggles in larger corporations because it demands even more coordination and effort. In contrast, smaller entities often outshine their larger counterparts due to the reduced overhead of supporting work.
One of Victors main points was the potential of software developers. Given the right tools and environment, they can achieve remarkable feats. CI is one such tool.
![](/blog/images/2023-10-13/bodyimg5.webp)
The state of CI configuration, Victor explained, is essentially a meticulous blueprint of tasks for the CI tool. This blueprint defines everything from the number of machines to their precise roles. Historically, these processes were performed manually, with individuals running test cases and subsequently approving or rejecting them.
However, scaling CI is a challenge. In larger workspace, up to 50 agents is pretty common, all requiring careful coordination and configuration to ensure tasks run in the correct order.
![](/blog/images/2023-10-13/bodyimg6.webp)
This might be manageable in a static repository setup, but monorepos introduce an added layer of complexity. Here, static “CI recipes” just wont cut it. The result is either an overuse of computational resources, leading to waste of money, or a painfully slow CI.
Victor critiqued that most current CI setups are:
- Oriented towards machines
- Low-level in their configuration
- Maintenance-heavy
- Detached from developer intentions
- Challenging to implement with monorepos
The big question: how can we revolutionize CI? Victor then showcased a demo workspace and highlights where the complexity of setting up CI comes from:
![](/blog/images/2023-10-13/bodyimg7.webp)
Even running e2e tests on CI requires:
- Building the application to be tested to produce an artifact
- That usually requires first building all libraries the app depends on, in the correct order
- Once all libraries are built, the application itself can be build
- Finally e2e can be run on the application artifact
Notice, since we want to do this as fast as possible, we want to parallelize these operations across machines. This involves also taking care of transferring build artifacts between them.
This is where **Nx Cloud Workflows** shines. It enables developers to draft CI configurations at a far more abstract level. Instead of delving into the minutiae of tasks, developers specify **what** commands to execute, with the **how** being implicitly managed by Nx Cloud.
```yaml
env:
NODE_OPTIONS: '--max_old_space_size=4096'
setup:
- name: Git Checkout
uses: 'nx-cloud-steps/checkout'
- name: Npm Install
uses: 'nx-cloud-steps/npm-install'
steps:
- name: CI Checks
parallel-scripts: |
nx affected -t build e2e --parallel=1
nx affected -t test lint --parallel=3
```
This elevated abstraction is possible because Nx Cloud & Nx are intimately familiar with the workspace, understanding the interdependencies between projects and tasks.
![](/blog/images/2023-10-13/bodyimg8.webp)
Beyond simplifying CI configurations, Nx Cloud Workflows helps optimize computational resource use. Agents are instantiated dynamically based on the projects requirements.
![](/blog/images/2023-10-13/bodyimg9.webp)
Victor highlighted that most current CI setups:
- Consistently utilize a predetermined number of agents, irrespective of the actual needs of the PR
- Possess non-reusable agents since each is tailored to a specific task, like building or testing
- Struggle with granular retries
As a metaphor Victor mentions that **Nx Cloud Workflows is to CI what S3 is to file uploads.**
![](/blog/images/2023-10-13/bodyimg10.webp)
Sounds interesting? Watch the entire talk below:
{% youtube src="https://www.youtube.com/watch?v=WSqivWlEDFw" /%}
## Nx Cloud Workflows: Next-Gen CI with First-Class Monorepo Support
**Speaker:** Simon Critchley
[Slides](https://docs.google.com/presentation/d/18EHfZ4UUtnAlzl15Ul_GPsr5lxNFtEEFPuT1uvxIEAk/edit?usp=sharing)
{% youtube src="https://youtu.be/JG1FWfZFByM?si=pNQNCLsbn5U0uSFB" /%}
Simon Critchley (Senior Software Architect at Nx) dives into the more technical details of the newly announced **Nx Cloud Workflows** (which is in private beta as of this writing).
![](/blog/images/2023-10-13/bodyimg11.webp)
Apart from the distributed caching, Nx Cloud already offers [DTE (Distributed Task Execution)](/ci/features/distribute-task-execution), which is a mechanism to seamlessly distribute tasks across various machines to achieve a high degree of parallelism. Up until now it was on you to configure your existing CI in a way to provision machines (agents) to Nx Cloud DTE. This required some fine-tuning to understand the best level of parallelism given the underlying monorepo and tasks that need to be run. If you have too many machines, itll be wasteful, if you have to few your CI will be slower.
Nx Cloud Workflow is an advancement of the DTE mechanism, where machines can be automatically provisioned and scaled based on the tasks that need to be run. Essentially it is a replacement for your existing CI but way smarter because it is able to leverage the knowledge it has about the Nx workspace, historical data and can thus do a series of optimizations. Traditional CI systems are running low-level commands on machines. Nx Cloud Workflows is task oriented instead: you tell it to run builds, tests, e2e, linting on the affected projects of the Nx workspace and it figures out how to split them up into fine-grained tasks and then distributes them among dynamically provisioned agents.
From a developers perspective, Nx Cloud Workflows are written in Yaml (or alternatively in JSON which is handy if you need to generate them). The format is very similar to existing CI providers to make sure the knowledge you have easily transfers. If you want an example, were dog-fooding Nx Cloud Workflows on the Nx repo (note the config will change as the product progresses): [https://github.com/nrwl/nx/blob/master/.nx/workflows/agents.yaml](https://github.com/nrwl/nx/blob/master/.nx/workflows/agents.yaml)
Simon then dives way deeper into the underlying architecture. In particular, how scheduling in Kubernetes works, which is used at the infrastructure level for Nx Cloud Workflows.
![](/blog/images/2023-10-13/bodyimg12.webp)
Workflow scheduling is handled by Kubernetes, specifically through a “Workflow Controller” that interacts with the K8s API Server and triggers Kubernetes Pods. Each Pod contains a Workflow executor and sidecar containers. All containers in the Nx Cloud workflow share a workspace volume for collaborative access. This allows for interesting optimizations in terms of sharing `node_modules` and restoring cache results.
![](/blog/images/2023-10-13/bodyimg13.webp)
The Workflow executor, written in Go, is responsible for receiving and executing workflow steps, capturing output, buffering logs, and communicating with the Workflow Controller. It also exposes its own grpc API for distributed locking, file system cache operations, and setting output parameters for each step, ensuring efficient workflow execution.
Nx Cloud Workflow is in its early development phase. The Kubernetes scheduler supports Docker based executors (basically any Docker image can be used as build image).
![](/blog/images/2023-10-13/bodyimg14.webp)
Windows, macOS and Linux is currently in development which will use a Cloud VM scheduler on the cloud of your choice.
## United by Nxcellent DX
**Speaker:** [Michael Hladky](https://twitter.com/Michael_Hladky)
[Slides](https://docs.google.com/presentation/d/1F6_x3Jiu_3b9tZpxQnCrU60Eb1FhYR8E5jVnb1t7DjA/edit?usp=sharing)
{% youtube src="https://youtu.be/i0UdoImryJQ?si=a5lx6VnS__qhiyex" /%}
Michael talks about how to leverage Nx to migrate multiple repositories into a monorepo to streamline development and increase developer productivity. He goes through
- how a project gets started
- how to prep moving to a monorepo from a polyrepo situation
- how to do the move in parallel
- how to measure the progress
The project usually starts with an architectural audit. That involves a detailed analysis of the underlying codebase, also including an executive summary for non technical folks. Once the audit is done, the actual move is planned and prepared. A part of that is to define “Nx migration goals”, like
- Single Version Policy
- Improved Maintenance
- Shared Infrastructure
- Shared Architecture
- Efficient Task Runs
- Frictionless Code-Sharing
- Frequent Deployments
- Decouple Deployment
To prioritize which ones to address first, Michael uses the following metaphor:
![](/blog/images/2023-10-13/bodyimg15.webp)
The important part here is to understand why “apples get bad” in the first place. Is it the harvesting process?
Once the priorities are defined and roadmap laid out, the goal is to **move in parallel.**
As part of that move the following gets produced:
- Migration Guide
- Training Program
- Communication Strategy
- Impact Measurement
The migration guide defines where to start, what the company goals are, how the deliveries will be integrated into the existing process and how the interaction with the various teams will happen.
The training program is there to tackle the bottleneck of missing knowledge, right from the beginning. Each stage of the process will have a different training content and collect feedback.
Finally the impact measurement; Nx Cloud already has graphs to measure how much time got saved in CI due to the improvements made. Michael mentions they go further, also measuring communication and productivity.
An interesting part is also how they perform the repository synching (from polyrepo to monorepo). They leverage an Nx plugin that
- contains shared build logic
- has rules to run that produce actionable feedback about what is needed to sync/align the polyrepo repository s.t. it can be merged into the monorepo
- it also allows to track progress and produce according reporting of where the company is at
## Redefining Projects with Nx: A Dive into the New Inference API
**Speaker:** [Craigory Coppola](https://twitter.com/enderagent)
[Slides](https://craigory.dev/presentations/view/nx-conf-2023-inference/#1)
Demo Repo:
{% github-repository url="https://github.com/AgentEnder/inference-demo" /%}
{% youtube src="https://www.youtube.com/watch?v=bnjOu7iOrMg" /%}
Craigory did a deep dive into the new Nx inference API. This is particularly interesting if youre developing [Nx plugins](/extending-nx/intro/getting-started) or if you have leverage/build some more advanced automation for your Nx workspace.
What is project inference:
- how Nx reads your project configuration
- introduced between v13.3 and v14
- initially to support package-based monorepos which use package.json scripts rather than `project.json`. Generalizing the project config reading mechanism also allowed to define an API that community plugins can leverage and which allows to integrate even languages outside the JS ecosystem into Nx (e.g. where projects are just defined differently, such as .Net, Java, Python,..)
Inference API v1
- `projectFilePatterns` - identify files that represent the root of a project
- `registerProjectTargets` - takes a project file and converts to a list of targets that Nx knows how to run
Shortcomings have been
- strict 11 mapping between project files and projects
- the logic of finding proj files and targets had to be decoupled which introduced potential failure points
- no way to add dynamic metadata to a project
Project graph API v2
- `createNodes` - finds graph nodes based on files on disk
- `createDependencies` - finds edges to be added to the graph
Still 2 parts, but theres no overlap between these two and they have very specific purposes.
`createNodes` is a tuple composed of:
- `projectFilePattern`
- `CreateNodesFunction` It can return a map of projects and external nodes, so there's no more the shortcoming of a 1-1 as it was in v1 API. With this new setup multiple plugins might detect the same project. Nx merges the configuration that has been identified. Kinda what happens right now if you mix `package.json` and `project.json` targets in an Nx workspace.
Craigory demos the inference API by building a spell checking plugin for Nx.
`createDependencies` replaces `processProjectGraph`. It is more constrained but mainly because things like adding nodes should be done in a different function now (e.g. `createNodes`). This has also advantages for Nx itself, as it knows all nodes will have been created after the `createNodes` has terminated.
This API is still marked as experimental, next steps will be
- mark as stable
- remove v1 API after deprecation period
- plugin authors should start looking into the new API, provide feedback and think about migration scenarios
## Package-based to Integrated: One Small Step or One Giant Leap?
**Speaker:** [Isaac Mann](https://twitter.com/MannIsaac)
[Slides](https://drive.google.com/file/d/1V1ocFIjYkRrcNXWuvUK1T8dQEceDcjvw/view?pli=1)
Repo:
{% github-repository url="https://github.com/isaacplmann/space-station-tracker/tree/final" /%}
Watch on YouTube:
{% youtube src="https://www.youtube.com/watch?v=nY0_o7zWBLM" /%}
Isaac initiated his talk by drawing an analogy between software development and the moon landing. While Neil Armstrong is often singularly celebrated for setting foot on the moon, Isaac emphasized that the monumental achievement was the collective effort of countless individuals on the ground crew, from engineers to support staff.
> Isaac: Nx wants to be that indispensable ground support crew for developers, allowing them to push the boundaries of software development.
Currently, Nx offers support for two predominant monorepo styles: package-based and integrated.
### Package-based Monorepos:
- These are tailored for flexibility and innovation.
- Packages within this setup can have diverse configurations.
- Every package boasts its individual node_modules and dependencies.
- Crucially, each can be upgraded independently, offering a high degree of autonomy.
### Integrated Monorepos:
- These are structured to prioritize consistency and maintainability.
- Updates within this framework are automated, and the setup adheres to a single-version policy.
Isaac then drew parallels between the Apollo program and the package-based mindset. The Apollo missions were evolutionary in nature, constantly pushing the envelope and embracing innovation with each successive mission. However, this trailblazing approach wasnt without its perils, as evidenced by tragic accidents. This experimental approach was feasible because the core team, responsible for creating the setup, remained consistent throughout the projects duration.
In contrast, Isaac likened the International Space Station (ISS) to the integrated mindset. The ISS epitomizes the challenges of coordination, given its international collaboration involving numerous countries. Emphasizing longevity, the ISS necessitates that every new crew member be proficient in operating its intricate machinery.
Shifting gears, Isaac delved into a hands-on demonstration. He outlined the process of transitioning from a package-based monorepo to an integrated one, including demoing:
- Initializing Nx with `nx init`.
- Establishing new projects to facilitate type sharing across applications.
- Harnessing the power of the Nx graph visualization to navigate and understand the project structure.
- Employing the module boundary rule, ensuring constraints are maintained in the revamped structure.
- Devising a novel Nx generator, streamlining the process of setting up new libraries within the workspace.
- Finally, he showcased the seamless upgrade mechanism, ensuring the workspace is always aligned with the latest version.
## Nxt Level Publishing
**Speaker:** [James Henry](https://twitter.com/MrJamesHenry)
[Slides](https://main--idyllic-dieffenbachia-3699ec.netlify.app/1)
Watch on YouTube:
{% youtube src="https://www.youtube.com/watch?v=p5qW5-2nKqI" /%}
James Henry unveils the new versioning and publishing functionality that is now built into Nx itself.
Nx has always given you the building blocks to do integrate the versioning and publishing; you could easily use Lerna with Nx, or changesets, release-it as well as a series of Nx Community plugins
The nx core team decided to go into this problem space and provide an opinionated approach that is easy to use within existing Nx workspaces; something that works and scales; also something that works outside the JS ecosystem which Nx can also be used with
New command `nx release`
- `nx release version` to determine and apply version updates
- `nx release` changelog generate a CHANGELOG.md file and optional GitHub releases based on git commits
- `nx release` publish takes a newly versioned project and publishes them to a remote registry (e.g. NPM)
This new command is not tight to `package.json` files but is general purpose; clearly publishing JS/TS packages is the main use case right now in Nx
Important to note that all the existing plugins are still valid and will still be going forward.
James goes forward demoing how `nx release` works in a simple NPM package: [jump directly into the video](https://www.youtube.com/watch?si=xoIW0Q-mQWTGgrek&t=411&v=p5qW5-2nKqI&feature=youtu.be).
Nx release can be added to any npm package. All thats needed is the `nx` and `@nx/js` package and a `nx: {}` node in the `package.json`.
Nx release has a dry-run mode; `nx release version --dry-run`. This will output a diff of what version would be created and on which `package.json` files (if there are multiple).
The same mechanism also works for the `changelog` command, e.g. `nx release changelog --dry-run`. In addition to just dry-run, the `changelog` command also has an `--interactive` mode that allows to get the generated changelog in an interactive editor where you can adjust and add extra stuff.
James then moves on to show how the release process works in a monorepo scenario using pnpm workspaces, where there are multiple NPM packages that need to be published: [jump to the video](https://www.youtube.com/watch?si=BvFvRQjgtwOxu-Dv&t=777&v=p5qW5-2nKqI&feature=youtu.be).
The monorepo has a `pkg-a` and `pkg-b` where there's a relationship between them as follows: `pkg-a --> pkg-b`.
If the `version` command is used in such scenario, it will also be applied to the dependent packages (`pkg-b`) since Nx knows about the dependencies via the project graph.
A nice feature is also that the changelog will...
- automatically group first by type (e.g. features grouped together, fixes etc)
- within each type grouping it will be grouped by scope such as pkg-a etc which will be alphabetized
- if theres a fix on the entire repo thatll come first before the per-package changes
`nx release changelog --create-release=github` allows to also automatically push the changelog to a Github release.
When running `nx release publish`, Nx also takes into account the right order of how the packages should go on NPM. Like if there's a relationship `pkg-a --> pkg-b`, Nx automatically detects such dependency and will go and publish pkg-b first and then `pkg-a` which depends on it. That to make sure that even if there's a network error in between packages, you'd still not break anything.
Future roadmap:
- ability to customize how the release works by defining it in `nx.json`
- “release groups” will allow to group packages and define whether versions should be in sync or versioned independently; filter by projects, or even just publish a subset of projects of a workspace
- publishing also automatically takes into account the provenance data on NPM
## Lightning Talk: What if your stories were — already — your e2e tests?
**Speaker:** [Katerina Skroumpelou](https://twitter.com/psybercity)
[Slides](https://drive.google.com/file/d/1XY8tefqqcM4k4swNPhlSrJiKxurMGiup/view)
Repo
{% github-repository url="https://github.com/mandarini/storybook-play" /%}
[Live Demo](https://storybook-play.vercel.app/?path=/story/app--primary)
Watch on YouTube:
{% youtube src="https://www.youtube.com/watch?v=SWlvsDNXCsQ" /%}
Katerina starts by introducing the concept of UI testing for error detection, usability verification, regression prevention but also for validating the user journey and making sure the software is reliability.
Nx had support to use Storybook for doing component-level tests, both using a Cypress e2e setup as well as Cypress component tests. This is where Nx would fill in to launch Storybook to render a single component and then launch Cypress and run dedicated tests against that served component.
Meanwhile Storybook has introduced so-called [Interaction Tests](https://storybook.js.org/docs/writing-tests/interaction-testing) which allow you to do something similar.
You can read more on [our docs](https://storybook.js.org/docs/writing-tests/interaction-testing). Or check out our corresponding video on Youtube:
{% youtube src="https://www.youtube.com/watch?v=SaHoUx-TUs8" /%}
## Lightning Talk: Nx Cloud Demo
**Speaker:** [Johanna Pearce](https://twitter.com/jhannapearce)
Watch on YouTube:
{% youtube src="https://www.youtube.com/watch?v=xc6fJpwk4Lo" /%}
Johanna gives us a tour through the Nx Cloud UI. So theres not much to say other than [go watch the talk](https://www.youtube.com/watch?v=xc6fJpwk4Lo&feature=youtu.be) :)
## From DIY to DTE — An Enterprise Experience
**Speaker:** Adrian Baran
[Slides](https://docs.google.com/presentation/d/1LPgCuYoVEIJqqhk8TLq4RAcHrJ5phJuiHHEGA3y_aws/edit?pli=1#slide=id.g25ac4b0c8f6_0_72)
{% youtube src="https://www.youtube.com/watch?v=MsUN0wQHPAs" /%}
Adrian Baran, a Senior Software Engineer at Cisco, embarked on his talk by presenting the status quo of their monorepo which encompasses approximately 150 projects at the start of the experiment.
![](/blog/images/2023-10-13/bodyimg16.webp)
Their CI workflow is powered by CircleCI. For the purpose of clarity, Adrian zoomed in on the frequently executed tasks: `build`, `lint`, and `test`. To execute these tasks, they leverage the [Nx affected](/features/run-tasks#run-tasks-on-projects-affected-by-a-pr) command to avoid running all commands on all projects.
![](/blog/images/2023-10-13/bodyimg17.webp)
Despite that, on average CI runs on PRs still lingered around the 1-hour mark. The immediate remedy? Harnessing CircleCI to parallelize tasks across multiple machines, while continuing to utilize Nx affected. Adrian wrote about that journey in a blog post last year, titled [Nx Affected + CircleCI Parallelism = Faster CI/CD Pipelines](https://medium.com/@abaran30/nx-affected-circleci-parallelism-faster-ci-cd-pipelines-b4edc4caaaac).
They ended up with a loooot of parallelism:
![](/blog/images/2023-10-13/bodyimg18.webp)
The outcome was promising though — they witnessed a significant reduction, approximately 75%, in execution time, even in scenarios where all projects were influenced by a PR. Done, right?
However, as their monorepo burgeoned to encompass 400+ projects, the DIY solution began to show its limitations. The incessant parallelization implied the addition of more agents, leading to escalating costs. Furthermore, they observed considerable variability in task durations.
![](/blog/images/2023-10-13/bodyimg19.webp)
Their workaround was to manually allocate specific tasks to distinct agents. This method in addition to capping on a max number of agents helped keep costs under control, but regrettably, it also compromised performance due to the lowered parallelism.
This is when Cisco looked into running an [Nx Enterprise](/enterprise) pilot, specifically with the goal of adopting [DTE](/ci/features/distribute-task-execution). In the 2nd part of the talk, Adrian outlined their journey of setting up DTE, starting with the generation of the initial CI setup:
```shell
nx g @nx/workspace:ci-workflow --ci=circleci
```
They tuned the generated configuration, but failed to get it properly running, many of the issues leading to resource exhaustion. As a result, they went the route of going on a 11 mapping setup between DIY and DTE. That made sure the DTE setup was as close as possible and allowed for a gradual transition approach, which proved invaluable, allowing them to maintain stability whilst progressively migrating to DTE.
The comparative analysis of their DIY solution versus DTE revealed roughly equivalent performance metrics. However, the DTE framework shone in its simplicity, maintainability, and resource efficiency, achieving similar outcomes with a 75% reduction in resource utilization.
![](/blog/images/2023-10-13/bodyimg20.webp)
### Adrians Key Insights:
- DTE setup warrants a dual-pronged strategy: an immediate plan for initiation and a long-term vision for transition. Notably, Nx DTE supports incremental adoption.
- Patience is paramount during the tuning phase to determine the optimal number of agents.
- While results might vary, Adrian humorously assures that one can always bank on the Nx team for support. 😅
## Vanquishing Deployment Dragons with Nx wizardry
**Speaker:** [Miroslav Jonas](https://twitter.com/meeroslav)
[Slides](https://speakerdeck.com/meeroslav/vanquishing-deployment-dragons-with-nx-wizardry)
Watch on YouTube:
{% youtube src="https://www.youtube.com/watch?v=jGF8vo2ChfI" /%}
Theres not much to say here. Lean back and [immerse yourself into the world of dragons and wizards.](https://www.youtube.com/watch?v=jGF8vo2ChfI)
## Optimizing your OSS infrastructure with Nx Plugins
**Speaker:** [Brandon Roberts](https://twitter.com/brandontroberts)
[Slides](https://github.com/brandonroberts/nx-conf-2023/blob/main/nx-oss-infrastructure.pdf)
Watch on YouTube:
{% youtube src="https://www.youtube.com/watch?v=bNuXH25CTO0" /%}
Brandon discussed his work on the open-source tool [Analog](https://analogjs.org/) and how Nx Plugins are crucial to its development.
He introduced Analog, shedding light on its foundational ecosystem and the its core features.
![](/blog/images/2023-10-13/bodyimg21.webp)
Nx plays a crucial role in helping integrate and maintain these different tools:
![](/blog/images/2023-10-13/bodyimg22.webp)
How? Brandon dives straight into it by explaining how Nx plugins in particular can be useful, explaining:
- features of Nx plugins such as generators, executors, automated migrations, presets and how to use them just locally to automate your workspace
- how to create a new plugin
- the anatomy of a generator and how they can be useful in scaffolding new setups, but also integrating technology, like adding tRPC to your stack, etc.
- similarly Nx executors provide a thin abstraction layer over the actual commands, allowing the plugin developer to update the underlying tooling without necessarily disrupting the end user
- most importantly allowing to write automatic migrations he can leverage with Analog, like running `nx migrate @analogjs/platform@latest` to update a given workspace automatically to the latest version, across potentially breaking changes
Brandon highlighted a pivotal aspect for OSS package/framework authors: the power to not just assimilate into pre-existing Nx workspaces via custom Nx plugins but also to steer the entire workspace setup process. This is particularly beneficial when tailored setups specific to individual use cases are required. By leveraging an [Nx preset](/extending-nx/recipes/create-preset), one can achieve this tailored configuration. Brandon also touched upon the possibility of advancing further by constructing an [install package](/extending-nx/recipes/create-install-package) through Nx.
## Level Up Your Productivity with Nx Console
**Speaker:** [Jonathan Cammisuli](https://twitter.com/jcammisuli) & [Max Kless](https://twitter.com/MaxKless)
[Slides](https://github.com/Cammisuli/nx-conf-2023/tree/main/tools/presentation)
Watch on YouTube:
{% youtube src="https://www.youtube.com/watch?v=TTjVcWCdwVY" /%}
Jon and Max are the masterminds behind [Nx Console](/getting-started/editor-setup), the Nx IDE extension for Code and JetBrains.
They mention the release of the JetBrains IDE support earlier this year and give a big shoutout to [Issam](https://github.com/iguissouma) who was the original author of the Nx Console Webstorm community plugin and who helped a lot with the official Nx Console version for JetBrains IDE.
Jon and Max demo the new IntelliJ version of Nx console and how it properly integrates as well as how they wrote the new UI completely from the ground up [using Lit](/blog/nx-console-gets-lit).
Clearly they did not spare showing off the awesome new graph capabilities built into Nx Console that allow you to directly navigate to files.
![](/blog/images/2023-10-13/bodyimg23.webp)
## Thats a wrap
If you enjoyed these, [subscribe to our YouTube channel](https://www.youtube.com/@nxdevtools) where we keep releasing educational content and fun videos.
---
## 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](/nx-cloud)
+32 -31
View File
@@ -1,12 +1,11 @@
---
title: 'Nx 17 has Landed'
slug: 'nx-17-release'
authors: ['Juri Strumpflohner', 'Zack DeRose']
cover_image: '/blog/images/2023-10-20/featured_img.png'
tags: [nx, design]
tags: [nx, release]
---
{% youtube src="https://www.youtube.com/embed/1Z0iA9K1o8M?si=9XxIboXSZ5yxFpIt" /%}
Were excited to announce the release of Nx version 17!
This article will cover the main things you need to know to get the most out of Nx 17!
@@ -18,13 +17,21 @@ Heres a Table of Contents so you can skip straight to the updates you care ab
- [More Consistent Generator Paths](#more-consistent-generator-paths)
- [The NEW Nx AI Chatbot](#the-new-nx-ai-chatbot)
- [More Seamless Integration With Nx Cloud](#more-seamless-integration-with-nx-cloud)
- [`nx.json` Simplification](#simplification)
- [`nx.json` Simplification](#nxjson-simplification)
- [Nx Repo Begins Dog-Fooding Nx Workflows](#nx-repo-dogfooding-nx-workflows)
- [Task Graphing Improvements](#task-graphing-improvements)
- [`@nx/linter` Renames to `@nx/eslint`](#renamed-to)
- [New Experimental Feature: Nx Release](#new-experimental-feature-nx-release)
- [Experimental: Nx Project Inference API v2](#experimental-nx-project-inference-api-v2)
- [20k Github Stars!!](#20k-github-stars)
- [How to update Nx](#how-to-update-nx)
- [Wrapping up](#wrapping-up)
**Prefer a video?**
{% youtube src="https://www.youtube.com/embed/1Z0iA9K1o8M?si=9XxIboXSZ5yxFpIt" /%}
---
## Its a Vue-tiful Day for Nx!
@@ -37,7 +44,7 @@ The first place you might notice this new support is in the `create-nx-workspace
This option will create a new Nx workspace with a fresh Vue application, all set up and ready to develop! To add new Vue projects to your existing Nx workspaces, add our new @nx/vue package as a dev dependency to your workspace, e.g.:
```shell
> npm add -D @nx/vue
npm add -D @nx/vue
```
And youll have access to Nx generators so that you can generate Vue applications, libraries, components, and more in your workspace:
@@ -46,7 +53,7 @@ And youll have access to Nx generators so that you can generate Vue applicati
Were very excited for this support to land, and were eager to get it into our users hands and see what Nx can do to help Vue developers so we can continue to refine our support and make Vue with Nx an excellent developer experience.
If youre eager to learn more, make sure to check out our new [Vue standalone tutorial](https://nx.dev/getting-started/tutorials/vue-standalone-tutorial).
If youre eager to learn more, make sure to check out our new [Vue standalone tutorial](/getting-started/tutorials/vue-standalone-tutorial).
## Enhancements to Module Federation Support
@@ -69,7 +76,7 @@ The `@nx/react` and `@nx/angular` now include a `federate-module` generator. Thi
To run this generator, use the command:
```shell
> nx g federate-module <module name> --path=<path to module to be exposed> --remote=<name of remote exposing module>
> nx g federate-module <path to module to be exposed> --name=<module name> --remote=<name of remote exposing module>
```
This will add a new module to the `exposes` map in the specified `remote` application, such that it can be consumed by a `host` application.
@@ -121,27 +128,21 @@ When set to `derived`, the generator will try to determine where to create your
In addition, component generators now follow any given casing for component files. For example, lets say we have an integrated monorepo with a react application called “my-app” and want to add a “Home” component. With Nx 17, you can run the command:
```shell
> nx g component Home --directory=apps/my-app/src/app
> nx g component apps/my-app/src/app/Home
```
And a `Home.tsx` file will be added in the `apps/my-app/src/app` directory.
You can now also build your directory path right into the generator command. For example, the same “Home” component would be created via:
```shell
> nx g component apps/my-app/src/app/Home
```
Finally, generators will now factory in your current working directory, so you can also create this “Home” component via:
```shell
> cd apps/my-app/src/app
> nx g component Home
cd apps/my-app/src/app
nx g component Home
```
## The NEW Nx AI ChatBot
Weve added a new AI ChatBot to our docs site. You can access it now at [https://nx.dev/ai-chat](https://nx.dev/ai-chat).
Weve added a new AI ChatBot to our docs site. You can access it now at [/ai-chat](/ai-chat).
![](/blog/images/2023-10-20/bodyimg4.gif)
@@ -170,15 +171,15 @@ Weve also removed the need to specify `cacheableOperations` at the task-runne
}
```
If you use the `nx migrate` command, all updates will be handled for you using the `targetDefaults` in your `nx.json` file. [More in the docs.](https://nx.dev/features/cache-task-results)
If you use the `nx migrate` command, all updates will be handled for you using the `targetDefaults` in your `nx.json` file. [More in the docs.](/features/cache-task-results)
Weve been working hard at reducing and simplifying all the configuration required for your Nx workspaces. Checkout our latest guide on how to [Reduce Repetitive Configuration](https://nx.dev/recipes/running-tasks/reduce-repetitive-configuration) for more, and stay tuned as weve got new efforts underway to make this simplification even more appealing!
Weve been working hard at reducing and simplifying all the configuration required for your Nx workspaces. Checkout our latest guide on how to [Reduce Repetitive Configuration](/recipes/running-tasks/reduce-repetitive-configuration) for more, and stay tuned as weve got new efforts underway to make this simplification even more appealing!
## Nx Repo Dog-Fooding Nx Workflows
At Nx Conf in New York City, we unveiled the next big step for Nx: **Nx Workflows**.
If you missed it, Simon Critchley walks you through in his [Nx Conf](https://dev.to/nx/nx-conf-2023-recap-53ep) talk:
If you missed it, Simon Critchley walks you through in his [Nx Conf](/blog/nx-conf-2023-recap) talk:
{% youtube src="https://www.youtube.com/embed/JG1FWfZFByM?si=7_NzxJP8nA7RbFhl" /%}
@@ -201,7 +202,7 @@ There have been some difficulties in determining precisely which files were incl
You can open this graph using the command:
```shell
> nx graph
nx graph
```
And then selecting “Task” from the “Project”/”Task” graph dropdown in the top left. Clicking on a specific task now allows you to see a comprehensive list of all files that were factored in as inputs for this task:
@@ -226,25 +227,25 @@ In Nx 17, we removed any remaining traces of `tslint` from our linter package, s
As we solidify this command, we intend to bring robust support for various versioning and publishing strategies, as well as built-in support for publishing packages or modules to a variety of languages, registries, and platforms.
For more [checkout our API docs](https://nx.dev/nx-api/nx/documents/release), and be sure to catch James Henrys announcement of this new command at [Nx Conf](https://dev.to/nx/nx-conf-2023-recap-53ep):
For more [checkout our API docs](/nx-api/nx/documents/release), and be sure to catch James Henrys announcement of this new command at [Nx Conf](/blog/nx-conf-2023-recap):
{% youtube src="https://www.youtube.com/embed/p5qW5-2nKqI?si=FzpGMJwPVINc1hgL" /%}
## Experimental: Nx Project Inference API v2
At Nx, were OBSESSED with building a better, more robust experience for our developers. Towards this end, were now in [v2 of our Project Inference API](https://nx.dev/extending-nx/recipes/project-graph-plugins).
At Nx, were OBSESSED with building a better, more robust experience for our developers. Towards this end, were now in [v2 of our Project Inference API](/extending-nx/recipes/project-graph-plugins).
This API is a way of extending the Nx project graph, which can be particularly helpful for extending Nx to support other languages, allowing Nx to determine where to find and draw boundaries around projects in your workspace. A great example is our very own [Vue plugin](https://nx.dev/getting-started/tutorials/vue-standalone-tutorial).
This API is a way of extending the Nx project graph, which can be particularly helpful for extending Nx to support other languages, allowing Nx to determine where to find and draw boundaries around projects in your workspace. A great example is our very own [Vue plugin](/getting-started/tutorials/vue-standalone-tutorial).
Interestingly, v2 includes support for dynamic targets as well. This opens up exciting new doors to reducing configuration, and we hope to expand on this to better support our first-party plugins in the near future.
For most developers, the main thing you need to know is that plugins may now add additional targets that you wont see in your `project.json` file. To see your actual project configuration, you can now use the command:
```shell
> nx show project <project_name>
nx show project <project_name>
```
For plugin authors, check out the [v2 documentation](https://nx.dev/extending-nx/recipes/project-graph-plugins) to see how you can take advantage of the new API to deliver a better experience to your users.
For plugin authors, check out the [v2 documentation](/extending-nx/recipes/project-graph-plugins) to see how you can take advantage of the new API to deliver a better experience to your users.
## 20k Github Stars!!
@@ -254,16 +255,16 @@ Nx is SOOO CLOSE to 20,000 stars on github! If Nx has been helpful to you, [plea
## How to Update Nx
Nx is known to [help you automatically migrate](https://nx.dev/features/automate-updating-dependencies) to the new version (including potentially breaking changes). To update simply run:
Nx is known to [help you automatically migrate](/features/automate-updating-dependencies) to the new version (including potentially breaking changes). To update simply run:
```shell
> npx nx migrate latest
npx nx migrate latest
```
This will update your Nx workspace dependencies, configuration and code to the latest version. After updating your dependencies, run any necessary migrations:
```shell
> npx nx migrate --run-migrations
npx nx migrate --run-migrations
```
## Wrapping up
@@ -274,9 +275,9 @@ Thats all for now folks! Were just starting up a new iteration of developm
## Learn more
- [Nx Docs](https://nx.dev/getting-started/intro)
- [Nx Docs](/getting-started/intro)
- [X/Twitter](https://twitter.com/nxdevtools) -- [LinkedIn](https://www.linkedin.com/company/nrwl/)
- [Nx GitHub](https://github.com/nrwl/nx)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app/)
- [Speed up your CI](/nx-cloud)
+720
View File
@@ -0,0 +1,720 @@
---
title: State Management Nx React Native/Expo Apps with TanStack Query and Redux
slug: 'state-management-nx-react-native-expo-apps-with-tanstack-query-and-redux'
authors: [Emily Xiong]
cover_image: '/blog/images/2023-11-08/featured_img.webp'
tags: [nx, React Native]
---
There are currently countless numbers of state management libraries out there. This blog will show you how to use state management for React Native in Nx monorepo with [TanStack Query](https://tanstack.com/query/latest) (which happens to use [Nx on their repo](https://cloud.nx.app/orgs/6412ca9d1c251d000efa21ba/workspaces/6412c827e6da5d7b4a0b1fe3/overview)) and Redux.
This blog will show:
- How to set up these libraries and their dev tools
- How to build the sample page below in React Native / Expo with state management
- How to do unit testing
It will call an API and show a cat fact on the page, allowing users to like or dislike the data.
![](/blog/images/2023-11-08/bodyimg1.webp)
Github repo: [https://github.com/xiongemi/nx-expo-monorepo](https://github.com/xiongemi/nx-expo-monorepo)
---
## Before We Start
From [TanStack Query documentation](https://tanstack.com/query/latest/docs/framework/react/guides/does-this-replace-client-state), it says:
- [TanStack Query](https://tanstack.com/query/latest/docs/framework/react/overview) is a **server-state** library.
- [Redux](https://redux.js.org/) is a client-state library.
What is the difference between the server state and the client state?
In short:
- Calling an API, dealing with asynchronous data-> server state
- Everything else about UI, dealing with synchronous data -> client state
## Installation
To use **[TanStack Query / React Query](https://tanstack.com/query/latest)** for the server state, I need to install:
- Library: [@tanstack/react-query](https://tanstack.com/query/latest)
- Dev tools: [@tanstack/react-query-devtools](https://tanstack.com/query/latest/docs/framework/react/devtools)
I will use **Redux** for everything else.
- Library: [redux](https://github.com/reduxjs/redux), react-redux, @reduxjs/toolkit
- Dev tools: [@redux-devtools/extension](https://github.com/zalmoxisus/redux-devtools-extension)
- Logger: [redux-logger](https://github.com/LogRocket/redux-logger), [@types/redux-logger](https://www.npmjs.com/package/@types/redux-logger)
- Storage: [redux-persist](https://github.com/rt2zz/redux-persist), [@react-native-async-storage/async-storage](https://github.com/react-native-async-storage/async-storage)
To install all the above packages:
```shell
#npm
npm install @tanstack/react-query @tanstack/react-query-devtools redux react-redux @reduxjs/toolkit @redux-devtools/extension redux-logger @types/redux-logger redux-persist @react-native-async-storage/async-storage --save-dev
#yarn
yarn add @tanstack/react-query @tanstack/react-query-devtools redux react-redux @reduxjs/toolkit @redux-devtools/extension redux-logger @types/redux-logger redux-persist @react-native-async-storage/async-storage --dev
#pnpm
pnpm add @tanstack/react-query @tanstack/react-query-devtools redux react-redux @reduxjs/toolkit @redux-devtools/extension redux-logger @types/redux-logger redux-persist @react-native-async-storage/async-storage --save-dev
```
## Server State with React Query
### Setup Devtools
First, you need to add React Query / TanStack Query in the `App.tsx`:
```tsx
import React from 'react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { Platform } from 'react-native';
const App = () => {
const queryClient = new QueryClient();
return (
<QueryClientProvider client={queryClient}>
{Platform.OS === 'web' && <ReactQueryDevtools />}
...
</QueryClientProvider>
);
};
export default App;
```
Note: the [React Query Devtools](https://tanstack.com/query/latest/docs/framework/react/devtools) currently do not support react native, and it only works on the web, so there is a condition: `{ Platform.OS === web && <ReactQueryDevtools />}.`
For the react native apps, in order to use this tool, you need to use [react-native-web](https://necolas.github.io/react-native-web/) to interpolate your native app to the web app first.
If you open my Expo app on the web by running `nx start cats` and choose the options `Press w │ open web`, you should be able to use the dev tools and see the state of my react queries:
![](/blog/images/2023-11-08/bodyimg2.webp)
Or you can run `npx nx serve cats` to launch the app in a web browser and debug from there.
### Create a Query
What is a query?
> “A query is a declarative dependency on an asynchronous source of data that is tied to a unique key. A query can be used with any Promise-based method (including GET and POST methods) to fetch data from a server.” [(https://tanstack.com/query/v4/docs/react/guides/queries)](https://tanstack.com/query/v4/docs/react/guides/queries)
Now lets add our first query. In this example, it will be added under `lib/queries` folder. To create a query to fetch a new fact about cats, run the command:
```shell
# expo workspace
npx nx generate @nx/expo:lib libs/queries/use-cat-fact
# react-native workspace
npx nx generate @nx/react-native:lib libs/queries/use-cat-fact
```
Or use [Nx Console](/recipes/nx-console):
![](/blog/images/2023-11-08/bodyimg3.webp)
Now notice under libs folder, `use-cat-fact` folder got created under `libs/queries`:
![](/blog/images/2023-11-08/bodyimg4.webp)
If you use React Native CLI, just add a folder in your workspace root.
For this app, lets use this API: [https://catfact.ninja/](https://catfact.ninja/). At `libs/queries/use-cat-fact/src/lib/use-cat-fact.ts`, add code to fetch the data from this API:
```ts
import { useQuery } from '@tanstack/react-query';
export const fetchCatFact = async (): Promise<string> => {
const response = await fetch('https://catfact.ninja/fact');
const data = await response.json();
return data.fact;
};
export const useCatFact = () => {
return useQuery({
queryKey: ['cat-fact'],
queryFn: fetchCatFact,
enabled: false,
});
};
```
Essentially, you have created a custom hook that calls useQuery function from the TanStack Query library.
### Unit Testing
If you render this hook directly and run the unit test with the command `npx nx test queries-use-cat-fact`, this error will show up in the console:
```shell
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
```
To solve this, you need to wrap your component inside the renderHook function from `@testing-library/react-native` library:
**1\. Install Library to Mock Fetch**
Depending on which library you use to make HTTP requests. (e.g. fetch, axios), you need to install a library to mock the response.
- If you use `fetch` to fetch data, you need to install `jest*fetch-mock`.
- If you use `axios` to fetch data, you need to install `axio*-mock-adapter`.
For this example, since it uses `fetch`, you need to install `jest-fetch-mock`:
```shell
#npm
npm install jest-fetch-mock --save-dev
#yarn
yard add jest-fetch-mock --dev
```
You also need to mock `fetch` library in `libs/queries/use-cat-fact/test-setup.ts`:
```ts
import fetchMock from 'jest-fetch-mock';
fetchMock.enableMocks();
```
**2\. Create Mock Query Provider**
In order to test out `useQuery` hook, you need to wrap it inside a mock `QueryClientProvider`. Since this mock query provider is going to be used more than once, lets create a library for this wrapper:
```shell
# expo library
npx nx generate @nx/expo:library libs/queries/test-wrapper
# react native library
npx nx generate @nx/react-native:library libs/queries/test-wrapper
```
Then a component inside this library:
```shell
# expo library
npx nx generate @nx/expo:component libs/queries/test-wrapper/src/lib/test-wrapper/test-wrapper
# react native library
npx nx generate @nx/react-native:component libs/queries/test-wrapper/src/lib/test-wrapper/test-wrapper
```
Add the mock `QueryClientProvider` in `libs/queries/test-wrapper/src/lib/test-wrapper/test-wrapper.tsx`:
```tsx
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import React from 'react';
export interface TestWrapperProps {
children: React.ReactNode;
}
export function TestWrapper({ children }: TestWrapperProps) {
const queryClient = new QueryClient();
return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
);
}
export default TestWrapper;
```
**3\. Use Mock Responses in Unit Test**
Then this is what the unit test for my query would look like:
```tsx
import { TestWrapper } from '@nx-expo-monorepo/queries/test-wrapper';
import { renderHook, waitFor } from '@testing-library/react-native';
import { useCatFact } from './use-cat-fact';
import fetchMock from 'jest-fetch-mock';
describe('useCatFact', () => {
afterEach(() => {
jest.resetAllMocks();
});
it('status should be success', async () => {
// simulating a server response
fetchMock.mockResponseOnce(
JSON.stringify({
fact: 'random cat fact',
})
);
const { result } = renderHook(() => useCatFact(), {
wrapper: TestWrapper,
});
result.current.refetch(); // refetching the query
expect(result.current.isLoading).toBeTruthy();
await waitFor(() => expect(result.current.isLoading).toBe(false));
expect(result.current.isSuccess).toBe(true);
expect(result.current.data).toEqual('random cat fact');
});
it('status should be error', async () => {
fetchMock.mockRejectOnce();
const { result } = renderHook(() => useCatFact(), {
wrapper: TestWrapper,
});
result.current.refetch(); // refetching the query
expect(result.current.isLoading).toBeTruthy();
await waitFor(() => expect(result.current.isLoading).toBe(false));
expect(result.current.isError).toBe(true);
});
});
```
If you use `axios`, your unit test would look like this:
```tsx
// If you use axios, your unit test would look like this:
import { TestWrapper } from '@nx-expo-monorepo/queries/test-wrapper';
import { renderHook, waitFor } from '@testing-library/react-native';
import { useCatFact } from './use-cat-fact';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
// This sets the mock adapter on the default instance
const mockAxios = new MockAdapter(axios);
describe('useCatFact', () => {
afterEach(() => {
mockAxios.reset();
});
it('status should be success', async () => {
// simulating a server response
mockAxios.onGet().replyOnce(200, {
fact: 'random cat fact',
});
const { result } = renderHook(() => useCatFact(), {
wrapper: TestWrapper,
});
result.current.refetch(); // refetching the query
expect(result.current.isLoading).toBeTruthy();
await waitFor(() => expect(result.current.isLoading).toBe(false));
expect(result.current.isSuccess).toBe(true);
expect(result.current.data).toEqual('random cat fact');
});
it('status should be error', async () => {
mockAxios.onGet().replyOnce(500);
const { result } = renderHook(() => useCatFact(), {
wrapper: TestWrapper,
});
result.current.refetch(); // refetching the query
expect(result.current.isLoading).toBeTruthy();
await waitFor(() => expect(result.current.isLoading).toBe(false));
expect(result.current.isError).toBe(true);
});
});
```
Notice that this file imports `TestWrapper` from `@nx-expo-monorepo/queries/test-wrapper`, and it is added to `renderHook` function with `{ wrapper: TestWrapper }`.
Now you run the test command `nx test queries-use-cat-fact`, it should pass:
```shell
PASS queries-use-cat-fact libs/queries/use-cat-fact/src/lib/use-cat-fact.spec.ts (5.158 s)
useCatFact
✓ status should be success (44 ms)
✓ status should be error (96 ms)
```
### Integrate with Component
Currently `userQuery` returns the following properties:
- `isLoading` or `status === 'loading'` - The query has no data yet
- `isError` or `status === 'error'` - The query encountered an error
- `isSuccess` or `status === 'success'` - The query was successful and data is available
Now with components controlled by the server state, you can leverage the above properties and change your component to follow the below pattern:
```ts
export interface CarouselProps {
isError: boolean;
isLoading: boolean;
isSuccess: boolean;
}
export function Carousel({
isSuccess,
isError,
isLoading,
}: CarouselProps) {
return (
<>
{isSuccess && (
...
)}
{isLoading && (
...
)}
{isError && (
...
)}
</>
);
}
export default Carousel;
```
Then in the parent component, you can use the query created above:
```tsx
import { useCatFact } from '@nx-expo-monorepo/queries/use-cat-fact';
import { Carousel } from '@nx-expo-monorepo/ui';
import React from 'react';
export function Facts() {
const { data, isLoading, isSuccess, isError, refetch, isFetching } =
useCatFact();
return (
<Carousel
content={data}
isLoading={isLoading || isFetching}
isSuccess={isSuccess}
isError={isError}
onReload={refetch}
>
...
);
}
```
If you serve the app on the web and open the [React Query Devtools](https://tanstack.com/query/v4/docs/framework/react/devtools), you should be able to see the query I created `cat-fact` and data in the query.
![](/blog/images/2023-11-08/bodyimg5.webp)
---
## Redux
### Create a Library
First, you need to create a library for redux:
```shell
# expo library
npx nx generate @nx/expo:lib libs/states/cat
# react native library
npx nx generate @nx/react-native:lib libs/states/cat
```
This should create a folder under libs:
![](/blog/images/2023-11-08/bodyimg6.webp)
### Create a State
For this app, it is going to track when users click the like button, so you need to create a state called `likes`.
![](/blog/images/2023-11-08/bodyimg7.webp)
You can use the [Nx Console](/recipes/nx-console) to create a redux slice:
![](/blog/images/2023-11-08/bodyimg8.webp)
Or run this command:
```shell
npx nx generate @nx/react:redux libs/states/cat/src/lib/likes/likes
```
Then update the redux slice at `libs/states/cat/src/lib/likes/likes.slice.ts`:
```ts
import {
createEntityAdapter,
createSelector,
createSlice,
EntityState,
} from '@reduxjs/toolkit';
export const LIKES_FEATURE_KEY = 'likes';
export interface LikesEntity {
id: string;
content: string;
dateAdded: number;
}
export type LikesState = EntityState<LikesEntity>;
export const likesAdapter = createEntityAdapter<LikesEntity>();
export const initialLikesState: LikesState = likesAdapter.getInitialState();
export const likesSlice = createSlice({
name: LIKES_FEATURE_KEY,
initialState: initialLikesState,
reducers: {
like: likesAdapter.addOne,
remove: likesAdapter.removeOne,
clear: likesAdapter.removeAll,
},
});
/*
* Export reducer for store configuration.
*/
export const likesReducer = likesSlice.reducer;
export const likesActions = likesSlice.actions;
const { selectAll } = likesAdapter.getSelectors();
const getlikesState = <ROOT extends { likes: LikesState }>(
rootState: ROOT
): LikesState => rootState[LIKES_FEATURE_KEY];
const selectAllLikes = createSelector(getlikesState, selectAll);
export const likesSelectors = {
selectAllLikes,
};
```
Every time the “like” button gets clicked, you want to store the content of what users liked. So you need to create an entity to store this information.
```ts
export interface LikesEntity {
id: string;
content: string;
dateAdded: number;
}
```
This state has 3 actions:
- like: when users click like
- remove: when users cancel the like
- clear: when users clear all the likes
### Root Store
Then you have to add the root store and create a transform function to stringify the redux state:
```typescript {% fileName="persist-transform.ts" %}
import { EntityState } from '@reduxjs/toolkit';
import { createTransform } from 'redux-persist';
import { LIKES_FEATURE_KEY } from '../likes/likes.slice';
const transformEntityStateToPersist = createTransform(
// transform state on its way to being serialized and persisted.
(
entityState: EntityState<any>
): {
ids: string;
entities: any;
} => {
return {
...entityState,
ids: JSON.stringify(entityState.ids),
entities: JSON.stringify(entityState.entities),
};
},
// transform state being rehydrated
(entityState: { ids: string; entities: string }): EntityState<any> => {
return {
...entityState,
ids: JSON.parse(entityState.ids),
entities: JSON.parse(entityState.entities),
};
},
// define which reducers this transform gets called for.
{ whitelist: [LIKES_FEATURE_KEY] }
);
export { transformEntityStateToPersist };
```
```typescript {% fileName="root-state.initial.ts" %}
import { initialLikesState } from '../likes/likes.slice';
import { RootState } from './root-state.interface';
export const initialRootState: RootState = {
likes: initialLikesState,
};
```
```typescript {% fileName="root-state.interface.ts" %}
import { LikesState } from '../likes/likes.slice';
export interface RootState {
likes: LikesState;
}
```
```typescript {% fileName="root-reducer.ts" %}
import { combineReducers } from '@reduxjs/toolkit';
import { likesReducer } from '../likes/likes.slice';
import { RootState } from './root-state.interface';
export const createRootReducer = combineReducers<RootState>({
likes: likesReducer,
});
```
```typescript {% fileName="root.store.ts" %}
import { configureStore } from '@reduxjs/toolkit';
import logger from 'redux-logger';
import { persistStore, persistReducer, PersistConfig } from 'redux-persist';
import { initialRootState } from './root-state.initial';
import { RootState } from './root-state.interface';
import { createRootReducer } from './root.reducer';
declare const process: any;
export const createRootStore = (persistConfig: PersistConfig<RootState>) => {
const isDevelopment = process.env.NODE_ENV === 'development';
const rootReducer = createRootReducer;
const persistedReducer = persistReducer(persistConfig, rootReducer);
const store = configureStore({
reducer: persistedReducer,
middleware: (getDefaultMiddleware) => {
const defaultMiddleware = getDefaultMiddleware({
serializableCheck: false,
});
return isDevelopment
? defaultMiddleware.concat(logger)
: defaultMiddleware;
},
devTools: isDevelopment,
preloadedState: initialRootState,
});
const persistor = persistStore(store);
return { store, persistor };
};
```
### Connect Redux State with UI
Then in `apps/cats/src/app/App.tsx`, you have to:
- wrap the app inside the `StoreProvider` with the root store to connect with the Redux state.
- wrap the app inside `PersistGate` to persist the redux state in the storage
```tsx
import React from 'react';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { PersistGate } from 'redux-persist/integration/react';
import {
createRootStore,
transformEntityStateToPersist,
} from '@nx-expo-monorepo/states/cat';
import { Loading } from '@nx-expo-monorepo/ui';
import { Provider as StoreProvider } from 'react-redux';
const App = () => {
const persistConfig = {
key: 'root',
storage: AsyncStorage,
transforms: [transformEntityStateToPersist],
};
const { store, persistor } = createRootStore(persistConfig);
return (
<PersistGate loading={<Loading />} persistor={persistor}>
<StoreProvider store={store}>...</StoreProvider>
</PersistGate>
);
};
export default App;
```
In your component where the like button is located, you need to dispatch the like action. I created a file at `apps/cats/src/app/facts/facts.props.ts`:
```ts
import {
likesActions,
LikesEntity,
RootState,
} from '@nx-expo-monorepo/states/cat';
import { AnyAction, ThunkDispatch } from '@reduxjs/toolkit';
const mapDispatchToProps = (
dispatch: ThunkDispatch<RootState, void, AnyAction>
) => {
return {
like(item: LikesEntity) {
dispatch(likesActions.like(item));
},
};
};
type mapDispatchToPropsType = ReturnType<typeof mapDispatchToProps>;
type FactsProps = mapDispatchToPropsType;
export { mapDispatchToProps };
export type { FactsProps };
```
Now you have passed the `like` function to the props of the facts component. Now inside the facts component, you can call the like function from props to dispatch the like action.
### Debugging
To debug redux with Expo, I can simply open the Debugger Menu by entering “d” in the console or in the app, then choose the option “Open JS Debugger”.
![](/blog/images/2023-11-08/bodyimg9.webp)
Then you can view my redux logs in the JS Debugger console:
![](/blog/images/2023-11-08/bodyimg10.webp)
Or you can run `npx nx serve cats` to launch the app in web view. Then you can use Redux Devtools and debug the native app like a web app:
![](/blog/images/2023-11-08/bodyimg11.webp)
---
## Summary
Here is a simple app that uses TanStack Query and Redux for state management. These 2 tools are pretty powerful and they manage both server and client state for you, which is easy to scale, test, and debug.
Nx is a powerful monorepo tool. Together with Nx and these 2 state management tools, it will be very easy to scale up any app.
- TanStack Query site: [https://tanstack.com/query/latest](https://tanstack.com/query/latest)
- Official @nx/expo plugin: [/nx-api/expo](/nx-api/expo)
- Official @nx/react-native plugin: [/nx-api/react-native](/nx-api/react-native)
---
## 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](/nx-cloud)
+315
View File
@@ -0,0 +1,315 @@
---
title: Nx Docs AI Assistant
slug: 'nx-docs-ai-assistant'
authors: [Katerina Skroumpelou]
cover_image: '/blog/images/2023-11-21/featured_img.webp'
tags: [nx, docs, AI]
---
## Introduction
The [Nx Docs AI Assistant](/ai-chat) is a tool designed to provide users with answers straight from the Nx documentation. In this article I will explain how it is built, and how we ensure accuracy and relevance.
In the end of this document I have added a [“glossary”](#glossary) of terms that are used throughout this document.
## Why have an AI assistant for documentation?
First of all, lets answer this simple question: why do you need an AI assistant for a documentation site in the first place? Using an AI assistant for documentation search and retrieval can offer a number of benefits for both users and authors. For users, the challenges of navigating through a large volume and density of documentation are alleviated. Unlike static keyword matching, AI enables more personalized and contextual search, allowing for more complex or sophisticated queries beyond simple keywords. This creates a dynamic feedback loop where users can ask follow-up questions, mix and combine documents, and ultimately enjoy an enhanced user experience that goes beyond basic documentation retrieval.
For authors, a docs AI assistant provides valuable insights into user behavior. It can identify the questions users are frequently asking, pointing to areas where more documentation may be needed. Additionally, if the AI consistently provides unsatisfactory or incorrect responses to certain queries, it could highlight unclear or lacking portions of the documentation. This not only allows for targeted improvements but also makes more parts of the documentation easily accessible to users through intelligent linking. Overall, it can enrich user interaction and help with future content strategy.
## The Nx Docs AI Assistant Workflow
### Overview
In a nutshell, the Nx Docs AI Assistant works in the following way:
1. Split our docs into smaller chunks
2. Create an [embedding](#embeddings) for each chunk
3. Save all these embeddings in [Postgres using pgvector (Supabase!)](https://supabase.com/docs/guides/database/extensions/pgvector)
4. Get question from the user
5. Create embedding for users question
6. Perform a vector similarity search on your database — bring back all the chunks of your documentation that are similar to the users question
7. Use the [GPT chat completion](https://platform.openai.com/docs/guides/text-generation/chat-completions-api) function. Pass a prompt, the users question and the retrieved chunks from the docs. GPT will then try to extract the relevant facts from these chunks, in order to formulate a coherent answer.
This is based on the Web Q&A Tutorial from OpenAI [(https://platform.openai.com/docs/tutorials/web-qa-embeddings)](https://platform.openai.com/docs/tutorials/web-qa-embeddings) and Supabases Vector Search example [(https://supabase.com/docs/guides/ai/examples/nextjs-vector-search)](https://supabase.com/docs/guides/ai/examples/nextjs-vector-search).
Its important to note here that we are not “training the model on our docs”. The model is pretrained. We are just giving the model parts of our docs which are relevant to the users question, and the model creates a coherent answer to the question. Its basically like pasting in ChatGPT a docs page and asking it “how do I do that?”. Except in this case, were first searching our documentation and giving GPT only the relevant parts (more about how we do that later in this article), which it can “read” and extract information from.
## Step 1: Preprocessing our docs
Every few days, we run an [automated script that will generate embeddings](https://github.com/nrwl/nx/blob/76306f0bedc1297b64da6e58b4f7b9c39711cd82/.github/workflows/generate-embeddings.yml) (numeric/vector representations of words and phrases) for our documentation, and store these embeddings in Supabase. As mentioned above, this step has 3 parts:
### Split our docs into smaller chunks
Most of this code follows the example from [Supabases Clippy](https://github.com/supabase-community/nextjs-openai-doc-search). It breaks the markdown tree into chunks, it keeps the heading and it also creates a checksum, to keep track of changes.
Ref in the code: [https://github.com/nrwl/nx/blob/0197444df5ea906f38f06913b2bc366e04b0acc2/tools/documentation/create-embeddings/src/main.mts#L66](https://github.com/nrwl/nx/blob/0197444df5ea906f38f06913b2bc366e04b0acc2/tools/documentation/create-embeddings/src/main.mts#L66)
This part is copied from: [https://github.com/supabase-community/nextjs-openai-doc-search/blob/main/lib/generate-embeddings.ts](https://github.com/supabase-community/nextjs-openai-doc-search/blob/main/lib/generate-embeddings.ts)
```js
export function processMdxForSearch(content: string) {
// …
const mdTree = fromMarkdown(content, {});
const sectionTrees = splitTreeBy(mdTree, (node) => node.type === 'heading');
// …
const sections = sectionTrees.map((tree: any) => {
const [firstNode] = tree.children;
const heading =
firstNode.type === 'heading' ? toString(firstNode) : undefined;
return {
content: toMarkdown(tree),
heading,
slug,
};
});
return {
checksum,
sections,
};
}
```
### Create an embedding for each chunk
Using `openai.embeddings.create` function with the model “text-embedding-ada-002” we are creating an embedding for each chunk.
Ref in the code: [https://github.com/nrwl/nx/blob/76306f0bedc1297b64da6e58b4f7b9c39711cd82/tools/documentation/create-embeddings/src/main.mts#L314](https://github.com/nrwl/nx/blob/76306f0bedc1297b64da6e58b4f7b9c39711cd82/tools/documentation/create-embeddings/src/main.mts#L314)
```js
const embeddingResponse = await openai.embeddings.create({
model: 'text-embedding-ada-002',
input,
});
```
### Save all these embeddings in Postgres using pgvector, on Supabase.
Store this embedding in Supabase, in a database that has already been created, following the steps mentioned here:
[https://supabase.com/docs/guides/ai/examples/nextjs-vector-search?database-method=dashboard#prepare-the-database](https://supabase.com/docs/guides/ai/examples/nextjs-vector-search?database-method=dashboard#prepare-the-database)
Essentially, we are setting up two PostgreSQL tables on Supabase. Then, we are inserting the embeddings into these tables.
Ref in code: [https://github.com/nrwl/nx/blob/master/tools/documentation/create-embeddings/src/main.mts#L327](https://github.com/nrwl/nx/blob/master/tools/documentation/create-embeddings/src/main.mts#L327)
```js
const { data: pageSection } = await supabaseClient
.from('nods_page_section')
.insert({
page_id: page.id,
slug,
heading,
longer_heading,
content,
url_partial,
token_count,
embedding,
}); // …
```
## Step 2: User query analysis and search
When a user poses a question to the assistant, we calculate the embedding for the users question. The way we do that is, again, using openai.embeddings.create function with the model text-embedding-ada-002.
Ref in code: [https://github.com/nrwl/nx/blob/76306f0bedc1297b64da6e58b4f7b9c39711cd82/nx-dev/nx-dev/pages/api/query-ai-handler.ts#L58](https://github.com/nrwl/nx/blob/76306f0bedc1297b64da6e58b4f7b9c39711cd82/nx-dev/nx-dev/pages/api/query-ai-handler.ts#L58)
```js
const embeddingResponse: OpenAI.Embeddings.CreateEmbeddingResponse =
await openai.embeddings.create({
model: 'text-embedding-ada-002',
input: sanitizedQuery + getLastAssistantMessageContent(messages),
});
```
The assistant compares the query embedding with these documentation embeddings to identify relevant sections. This comparison is essentially measuring how close the querys vector is to the documentation vectors. The closer they are, the more related the content. The way this works is that it sends the users question embedding to Supabase, to a PostgreSQL function, which runs a vector comparison between the users question embedding and the stored embeddings in the table. The PostgreSQL function returns all the similar documentation chunks.
The function that is used uses the dot product between vectors to calculate similarity. For normalized vectors, the dot product is equivalent to cosine similarity. Specifically, when two vectors A and B are normalized (i.e., their magnitudes are each 1), the cosine similarity between them is the same as their dot product. The OpenAI embeddings are normalized to length 1, so cosine similarity and dot product will produce the same results.
Ref in code: [https://github.com/nrwl/nx/blob/76306f0bedc1297b64da6e58b4f7b9c39711cd82/nx-dev/nx-dev/pages/api/query-ai-handler.ts#L70](https://github.com/nrwl/nx/blob/76306f0bedc1297b64da6e58b4f7b9c39711cd82/nx-dev/nx-dev/pages/api/query-ai-handler.ts#L70)
```js
const { data: pageSections } = await supabaseClient.rpc('match_page_sections', {
embedding,
// …
});
```
## Step 3: Generating a Response
With the relevant sections (documentation chunks) identified and retrieved, GPT (the generative AI) steps in. Using the relevant sections as context and following a systematic approach, GPT crafts a response.
This approach the AI is instructed to use (in the **prompt**) is the following:
- Identify CLUES from the query and documentation.
- Deduce REASONING based solely on the provided Nx Documentation.
- EVALUATE its reasoning, ensuring alignment with Nx Documentation.
- Rely on previous messages for contextual continuity.
### Ensuring Quality
If theres no matching section in the documentation for a query, the script throws a “no_results” error. So, after the initial search in the docs (PostgreSQL function), if the search returns no results (no vectors found that are similar enough to the users question vector), the process stops, and our Assistant replies that it does not know the answer.
### The use of useChat function
Its necessary here to clarify that we use the useChat [(https://sdk.vercel.ai/docs/api-reference/use-chat)](https://sdk.vercel.ai/docs/api-reference/use-chat) function of the [Vercel AI SDK](https://sdk.vercel.ai/docs/introduction). This function, as mentioned in the docs, does the following:
> It enables the streaming of chat messages from your AI provider, manages the state for chat input, and updates the UI automatically as new messages are received.
It essentially takes care of the following things:
1. You dont have to worry about manually creating a “messages” array to store your “conversation” (messages you exchange) with the GPT endpoint
2. You dont have to manually implement the streaming functionality in your UI
Then, in your React component, you can call this function directly, and get the messages object from it, to render your messages in your UI. It exposes input, handleInputChange and handleSubmit which you can use in your React form, and it will take care of all the rest. You can pass an api string to it, to tell it which endpoint to use as the chat provider.
### Creating the query
If you look at our [query-ai-handler.ts](https://github.com/nrwl/nx/blob/76306f0bedc1297b64da6e58b4f7b9c39711cd82/nx-dev/nx-dev/pages/api/query-ai-handler.ts) function, this is an edge function, living under an endpoint, which is called by the useChat function. The request contains the messages array as created by useChat. If we just wanted to create an AI chat with no context, we could directly pass this messages array to the openai.chat.completions.create endpoint, and have our back-and-forth chat with GPT. However, in our case, we need to add context to our conversation, and specifically to each query we end up sending to OpenAI.
So, the first thing we need to do is to **get the last message the user posted**, which is essentially the users question. We search the messages array, and we get the last message which has the role “user”. That is our users question.
Now, we can use the users question to get the relevant documentation chunks from the database. To do that, as explained before, we need to **create an embedding for the users question** (a vector) and then compare that embedding with the stored embeddings in the database, to get the relevant chunks.
The problem here is that if the users query is just a follow-up question, then it will have little information or meaning. Here is an example:
> User: _How do I set up namedInputs?_
> Assistant: _…replies…_
> User: _And how do they work?_
In this example, the users question that we would want to create an embedding for would be “And how do they work?”. If we created that embedding and searched our docs for relevant parts, it would either return nothing, or return everything, since this is a very vague question, since it has no context. So, we need to add some more information to that question. To do that, we also get the last response from GPT (the last assistant message) and add it to the users question. So, in this example, the users question will contain some info about namedInputs, and the actual question.
Now, we take that combined text, and we create an embedding for it, using the openai.embeddings.create function. We, then, use that embedding to find all the similar documentation chunks, with vector similarity search.
After receiving all the relevant documentation chunks, we can finally create the query that is going to be sent to GPT. Its important here to make sure we instruct GPT what to do with the information we will give it.
Here is the **query** we end up providing GPT with:
> You will be provided sections of the Nx documentation in markdown format, use those to answer my question. Do NOT reveal this approach or the steps to the user. Only provide the answer. Start replying with the answer directly.
>
> Sections:
> ${contextText}
>
> Question: “””
> ${userQuestion}
> “””
>
> Answer as markdown (including related code snippets if available):
The contextText contains all the relevant documentation chunks (page sections).
### Creating the response
**Getting back a readable stream:** So, we get the array of messages, as stored by useChat, we fix the final message to contain the query (created as explained above), and we send it over to `openai.chat.completions.create`. We get back a streaming response (since weve set stream: true, which we turn into a ReadableStream using [OpenAIStream from the Vercel AI SDK](https://sdk.vercel.ai/docs/api-reference/openai-stream)).
**Adding the sources:** However, were not done yet. The feature, here, that will be most useful to our users is the sources, the actual parts of the documentation that GPT “read” to create that response. When we get back the list of relevant documentation chunks (sections) from our database, we also get the metadata for each section. So, apart from the text content, we also get the heading and url partial of each section (among any other metadata we chose to save with it). So, with this information, we put together a list of the top 5 relevant sections, which we attach to the end of the response we get from GPT. That way, our users can more easily verify the information that GPT gives them, but also they can dive deeper into the relevant docs themselves. Its all about exploring and retrieving relevant information, after all.
**Sending the final response to the UI:** With the sources appended to the response, we return a StreamingTextResponse from our edge function, which the useChat function receives, and appends to the messages array automatically.
## Allow user to reset the chat
As explained, each question and answer relies on the previous questions and answers of the current chat. If a user needs to ask something completely irrelevant or different, we are giving the user the ability to do so by providing a “Clear chat” button, which will reset the chat history, and start clean.
## Gathering feedback and evaluating the results
Its very important to gather feedback from the users and evaluate the results. Any AI assistant is going to give wrong answers, because it does not have the ability to critically evaluate the responses it creates. It relies on things it has read, but not in the way a human relies on them. It generates the next most probable word (see glossary for generative AI below). For that reason, its important to do the following things:
1. Inform users that they should always double-check the answers and do not rely 100% on the AI responses
2. Provide users with feedback buttons and/or a feedback form, where they can evaluate whether a response was good or bad. At Nx we do that, and we also associate each button click with the question the user asked, which will give us an idea around which questions the AI gets right or wrong.
3. Have a list of questions that you ask the AI assistant, and evaluate its responses internally. Use these questions as a standard for any changes made in the assistant.
## Wrapping up
In this guide, weve explored the intricacies of the Nx Docs AI Assistant, an innovative tool that enhances the experience of both users and authors of Nx documentation. From understanding the need for an AI assistant in navigating complex documentation to the detailed workflow of the Nx Docs AI Assistant, we have covered the journey from preprocessing documentation to generating coherent and context-aware responses.
Lets see at some key takeaways:
**Enhanced User Experience:** The AI assistant significantly improves user interaction with documentation by offering personalized, context-aware responses to queries. This not only makes information retrieval more efficient but also elevates the overall user experience.
**Insights for Authors:** By analyzing frequently asked questions and areas where the AI struggles, authors can pinpoint documentation gaps and areas for improvement, ensuring that the Nx documentation is as clear and comprehensive as possible.
**OpenAI API utilization:** The use of embeddings, vector similarity search, and GPTs generative AI capabilities demonstrate a sophisticated approach to AI-driven documentation assistance. This blend of technologies ensures that users receive accurate and relevant responses.
**Continuous Learning and Improvement:** The systems design includes mechanisms for gathering user feedback and evaluating AI responses, which are crucial for ongoing refinement and enhancement of the assistants capabilities.
**Transparency and User Trust:** By openly communicating the limitations of the AI and encouraging users to verify the information, the system fosters trust and promotes responsible use of AI technology.
**Accessibility and Efficiency:** The AI assistant makes Nx documentation more accessible and navigable, especially for complex or nuanced queries, thereby saving time and enhancing productivity and developer experience.
## Future steps
OpenAI released the Assistants API, which takes the burden of chunking the docs, creating embeddings, storing the docs in a vector database, and querying that database off the shoulders of the developers. This new API offers all these features out of the box, removing the need to create a customized solution, as the one explained above. Its still in beta, and it remains to be seen how its going to evolve, and if its going to overcome some burdens it poses at the moment. You can [read more about the new Assistants API in this blog post](https://pakotinia.medium.com/openais-assistants-api-a-hands-on-demo-110a861cf2d0), which contains a detailed demo on how to use it for documentation q&a.
## Glossary
### Core concepts
I find it useful to start by explaining what some terms — which are going to be used quite a lot throughout this blog post — mean.
### Embeddings
#### What they are
In the context of machine learning, embeddings are a type of representation for text data. Instead of treating words as mere strings of characters, embeddings transform them into **vectors** (lists of numbers) in a way that captures their meanings. In embeddings, vectors are like digital fingerprints for words or phrases, converting their essence into a series of numbers that can be easily analyzed and compared.
#### Why they matter
With embeddings, words or phrases with similar meanings end up having **vectors** that are close to each other, making it easier to compare and identify related content.
### Generative AI
#### What it is
Generative AI, the technology driving the Nx Docs AI Assistant, is a subset of AI thats trained, not just to classify input data, but to generate new content.
#### How it works
Generative AI operates like a sophisticated software compiler. Just as a compiler takes in high-level code and translates it into machine instructions, generative AI takes in textual prompts and processes them through layers of neural network operations, resulting in detailed and coherent text outputs. Its like providing a programmer with a high-level task description, and they write the necessary code to achieve it, except here the programmer is the AI, and the code is the generated text response.
#### What Does “Generation” Mean in AI Context?
In AI, especially with natural language processing models, “generation” refers to the process of producing sequences of data, in our case, text. Its about creating content that wasnt explicitly in the training data but follows the same patterns and structures.
#### How Does GPT Predict the Next Word?
For our Nx Docs AI assistant we use GPT. GPT, which stands for “Generative Pre-trained Transformer”, works using a predictive mechanism. At its core, its trained to predict the next word in a sentence. When you provide GPT with a prompt, it uses that as a starting point and keeps predicting the next word until it completes the response or reaches a set limit.
Its like reading a sentence and trying to guess the next word based on what youve read so far. GPT does this but by using a massive amount of textual data it has seen during training, enabling it to make highly informed predictions.
### Context and Prompting — their role in AI models
#### Context
In the context of AI, “context” refers to the surrounding information, data, or conditions that provide a framework or background for understanding and interpreting a specific input, ensuring that the AIs responses or actions are relevant, coherent, and meaningful in a given situation
#### Prompts
The prompt acts as an initial “seed” that guides the AIs output. While the AI is trained on vast amounts of text, it relies on the prompt for context. For example, a prompt like “tell me about cats” might result in a broad answer, but “summarize the history of domesticated cats” narrows the models focus.
By refining prompts, users can better direct the AIs response, ensuring the output matches their intent. In essence, the prompt is a tool to direct the AIs vast capabilities to a desired outcome.
### The GPT Chat Completion Roles
### System
The “System” role typically sets the “persona” or the “character” of the AI. It gives high-level instructions on how the model should behave during the conversation. We start the instructions with “You are a knowledgeable Nx representative.” We also instruct the model about the format of its answer: “Your answer should be in the form of a Markdown article”. You can read the full instructions on GitHub.
#### User
The “User” role is straightforward. This is the input from the end-user, which the AI responds to. The users query becomes the User role message. This role guides what the AI should be talking about in its response. Its a direct prompt to the AI to generate a specific answer. In our case, we take the users query, and we add it in a longer prompt, which specific steps the model must follow (as explained above). That way, the model focuses on the specific steps weve laid out, making it the immediate context for generating the answer. This is one more step towards more accurate answers based on our documentation only. Inside the prompt, which has the instructions, and the users query, we always add the context text as well, which are the relevant parts that are retrieved from the Nx Documentation.
#### Assistant
This role, in the context of OpenAIs chat models, is the response of the AI. Previous Assistant responses can be included in the chat history to provide context, especially if a conversation has back-and-forth elements. This helps the model generate coherent and contextually relevant responses in a multi-turn conversation.
---
## 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](/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](/nx-cloud)
+335
View File
@@ -0,0 +1,335 @@
---
title: Unit Testing Expo Apps With Jest
slug: 'unit-testing-expo-apps-with-jest'
authors: [Emily Xiong]
cover_image: '/blog/images/2023-11-22/featured_img.webp'
tags: [nx, tutorial]
---
In my latest [blog](/blog/step-by-step-guide-to-creating-an-expo-monorepo-with-nx), I successfully navigated through the steps of setting up an Expo Monorepo with [Nx](). The next challenge? Testing! This blog dives into:
- Crafting effective unit tests for Expo components utilizing Jest
- Addressing common issues encountered during unit testing
Repo:
{% github-repository url="https://github.com/xiongemi/nx-expo-monorepo" /%}
## Stacks
Heres my setup
- Testing framework: [jest](https://jestjs.io/)
- Testing library: [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/)
- Jest Preset: [jest-expo](https://www.npmjs.com/package/jest-expo)
## Writing and Running Unit Tests
When you use Nx, it not only configures and sets up Jest, but also creates a default unit test for every expo component that is being generated. Heres what that looks like:
```typescript
import { render } from '@testing-library/react-native';
import React from 'react';
import Loading from './loading';
describe('Loading', () => {
it('should render successfully', () => {
const { root } = render(<Loading />);
expect(root).toBeTruthy();
});
});
```
To run all unit tests for a given project, use:
```shell
npx nx test <project-name>
```
Heres the output of running this for my example app:
![terminal output](/blog/images/2023-11-22/bodyimg1.webp)
When it comes to writing tests, the [React Native Testing Library](https://callstack.github.io/react-native-testing-library/docs/api-queries) is a game-changer for writing cleaner unit tests in React Native applications. Its intuitive query API simplifies the process of selecting elements within your components, making it straightforward to write more maintainable and readable tests. You mark elements with a `testID`
```html
<Headline testID="title">{film.title}</Headline>
```
Then in the test file, you can use the function `getByTestId` to query `testID`:
```typescript
const { getByTestId } = render(<your component>);
expect(getByTestId('title')).toHaveTextContent(...);
```
You can find more options for querying elements on the official React Native Testing Library docs: [https://callstack.github.io/react-native-testing-library/docs/api-queries](https://callstack.github.io/react-native-testing-library/docs/api-queries).
## Troubleshooting Common Issues When Writing Tests
However, unit tests do not always pass. Here are some common errors I ran into and how to resolve them.
### Error: AsyncStorage is null.
I am using the library `@react-native-async-storage/async-storage`, and I got the below error when running unit testing:
```shell
[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
To fix this issue try these steps:
• Rebuild and restart the app.
• Run the packager with `--reset-cache` flag.
• If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app.
• If this happens while testing with Jest, check out docs how to integrate AsyncStorage with it: https://react-native-async-storage.github.io/async-storage/docs/advanced/jest
If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-async-storage/async-storage/issues
5 | import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
6 | import { Platform } from 'react-native';
> 7 | import AsyncStorage from '@react-native-async-storage/async-storage';
```
The issue is that `@react-native-async-storage/async-storage` library can only be used in `NativeModule`. Since unit testing with Jest only tests JS/TS file logic, I need to mock this library.
In the apps test-setup.ts file, add the below lines:
```typescript
jest.mock('@react-native-async-storage/async-storage', () =>
require('@react-native-async-storage/async-storage/jest/async-storage-mock')
);
```
## Error: Could not find “store”
I am using Redux for state management, and I got this error for my stateful components:
```
Could not find "store" in the context of "Connect(Bookmarks)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(Bookmarks) in connect options.
```
To fix this, the simple way is to mock a redux store. I need to install [redux-mock-store](https://github.com/reduxjs/redux-mock-store) and its typing:
{% tabs %}
{% tab label="npm" %}
```shell
npm install redux-mock-store @types/redux-mock-store --save-dev
```
{% /tab %}
{% tab label="yarn" %}
```shell
yarn add redux-mock-store @types/redux-mock-store --dev
```
{% /tab %}
{% /tabs %}
Then I can create a mock store using this library like the below code:
```typescript
import configureStore, { MockStoreEnhanced } from 'redux-mock-store';
const mockStore = configureStore<any>([]);
let store: MockStoreEnhanced<any>;
beforeEach(() => {
store = mockStore({});
store.dispatch = jest.fn();
});
```
For example, one of my stateful components unit test will become:
```typescript
import React from 'react';
import { render } from '@testing-library/react-native';
import { Provider } from 'react-redux';
import configureStore, { MockStoreEnhanced } from 'redux-mock-store';
import { RootState, initialRootState } from '@nx-expo-monorepo/states/cat';
import Bookmarks from './bookmarks';
describe('Bookmarks', () => {
const mockStore = configureStore<RootState>([]);
let store: MockStoreEnhanced<RootState>;
beforeEach(() => {
store = mockStore(initialRootState);
store.dispatch = jest.fn();
});
it('should render successfully', () => {
const { container } = render(
<Provider store={store}>
<Bookmarks />
</Provider>
);
expect(container).toBeTruthy();
});
});
```
The above code will apply the initial redux state to my components.
### Error: No QueryClient set
Because I use [TanStack Query](https://tanstack.com/query/latest) , when I run unit tests, I have this error:
```
No QueryClient set, use QueryClientProvider to set one
```
This error occurred because I used `useQuery` from `@tanstack/react-query` in my component; however, in this unit test, the context of this hook is not provided.
To solve this, I can just mock the `useQuery` function:
```typescript
import * as ReactQuery from '@tanstack/react-query';
jest.spyOn(ReactQuery, 'useQuery').mockImplementation(
jest.fn().mockReturnValue({
data: 'random cat fact',
isLoading: false,
isSuccess: true,
refetch: jest.fn(),
isFetching: false,
isError: false,
})
);
```
### Error: Couldnt find a navigation object
If you use `@react-navigation` library for navigation, and inside your component, there are hooks from this library like `useNavigation` and `useRoute`, you are likely to get this error:
```
Couldn't find a navigation object. Is your component inside NavigationContainer?
```
The fix this, I need to mock the `@react-nativgation/native` library. In the apps test-setup.ts file, I need to add:
```typescript
jest.mock('@react-navigation/native', () => {
return {
useNavigation: () => ({
navigate: jest.fn(),
dispatch: jest.fn(),
setOptions: jest.fn(),
}),
useRoute: () => ({
params: {
id: '123',
},
}),
};
});
```
### SyntaxError: Unexpected token export
I got this error when using a library with ECMAScript Module (ESM), such as [`udid`](https://github.com/uuidjs/uuid):
```
/Users/emilyxiong/Code/nx-expo-monorepo/node_modules/uuid/dist/esm-browser/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export { default as v1 } from './v1.js';
^^^^^^
SyntaxError: Unexpected token 'export'
5 | import { connect } from 'react-redux';
6 | import 'react-native-get-random-values';
> 7 | import { v4 as uuidv4 } from 'uuid';
```
Jest does not work with ESM out of the box. The simple solution is to map this library to the CommonJS version of this library.
In the apps `jest.config.ts`, there should be an option called `moduleNameMapper`. The library I used is called `uuid`, so I need to add the map `uuid: require.resolve(uuid)` under `moduleNameMapper`. So when the code encounters imports from `uuid` library, it will resolve the CommonJS version of it:
```typescript
module.exports = {
moduleNameMapper: {
uuid: require.resolve('uuid'),
},
};
```
Alternatively, I can also mock this library in the test files:
```typescript
import { v4 as uuidv4 } from 'uuid';
jest.mock('uuid', () => {
return {
v4: jest.fn(() => 1),
};
});
```
## Error: Jest encountered an unexpected token
I got this error when I was importing from a library such as [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons):
```
console.error
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
By default "node_modules" folder is ignored by transformers.
Here's what you can do:
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
• If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/configuration
For information about custom transformations, see:
https://jestjs.io/docs/code-transformation
```
To fix this, add this library name to `transformIgnorePatterns` in the app's jest.config.ts.
What is `transformIgnorePatterns`? The `transformIgnorePatterns` allows developers to specify which files shall be transformed by Babel. `transformIgnorePatterns` is an array of regexp pattern strings that should be matched against all source file paths before the transformation. If the file path matches any patterns, it will not be transformed by Babel.
By default, Jest will ignore all the files under node_modules and only transform the files under the projects src.
However, some libraries such as `react-native-paper` or `react-native-svg`, the library files are in `.ts` or `.tsx`. These files are not compiled to `js`. So I need to add these libraries' names to `transformIgnorePatterns`, so these libraries will be transformed by Babel along with my project. source file. The default generated `jest.config.js` already has:
```
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)',
]
```
If I have an error related to a library with an unexpected token, I need to check whether they are compiled or not.
- If this library source files are already transformed to `.js`, then its name should match regex, so it would be ignored, so it will NOT be transformed.
- If this library source files are NOT transformed to `.js` (e.g. still in `.ts` or `.tsx`), then its name should NOT match regex, so it will be transformed.
## Summary
Here are some common errors that I will probably run into while doing unit testing. The solution to most problems is to find a way to mock a library that is not relevant to my component logic.
With Nx, you do not need to explicitly install any testing library, so you can dive right in and focus on writing the tests rather than spending time on setup.
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Community Discord](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- 🚀 [Speed up your CI](/nx-cloud)
+7 -6
View File
@@ -1,11 +1,12 @@
---
title: Nx 17.2 Update
slug: 'nx-17-2-release'
authors: [Zack DeRose]
cover_image: '/blog/images/2023-12-20/featured_img.png'
tags: [nx, changelog, release]
---
Its been a bit since we launched [Nx 17](/blog/2023-10-20-nx-17-release)! In this article, well go over some of the new developments and improvements that have landed in Nx 17.2:
Its been a bit since we launched [Nx 17](/blog/nx-17-release)! In this article, well go over some of the new developments and improvements that have landed in Nx 17.2:
- [Nx Closes In On 4 Million Weekly NPM Downloads!!](#nx-closes-in-on-4-million-weekly-npm-downloads)
- [New Simplified Project Configuration On the Way](#new-simplified-project-configuration-on-the-way)
@@ -64,7 +65,7 @@ In addition to performance improvements, weve brought the concept of dynamic
You can generate your react module federation workspace now to use dyanmic federation via the `--dynamic` flag:
```shell
nx generate @nx/react:host acme --remotes=nx --dynamic
nx generate @nx/react:host apps/acme --remotes=nx --dynamic
```
Or you can use the utility itself by importing from `@nx/react/mf`:
@@ -109,7 +110,7 @@ nx release version patch --project=my-project
![](/blog/images/2023-12-20/bodyimg2.webp)
[Angular](https://angular.dev/) is in the middle of [a HUGE renaissance](https://blog.angular.io/introducing-angular-v17-4d7033312e4b), between their new logo, new docs site, and introduction of some awesome features like Signals.
[Angular](https://angular.dev/) is in the middle of [a HUGE renaissance](https://blog.angular.dev/introducing-angular-v17-4d7033312e4b), between their new logo, new docs site, and introduction of some awesome features like Signals.
Nx is here to support the transition! Nx has always been a great fit for Angular, and now supports Angular 17 as well as NgRx 17.
@@ -123,7 +124,7 @@ nx migrate --run-migrations
You can also use the `--interactive` flag if you want to migrate your workspace to the latest version of Nx while staying on your current version of Angular:
```shell
> nx migrate latest --interactive
nx migrate latest --interactive
✔ Do you want to update to TypeScript v5.2? (Y/n) · true
✔ Do you want to update the Angular version to v17? (Y/n) · false
@@ -209,6 +210,6 @@ Thats all for now folks! Were just starting up a new iteration of developm
- [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](/community)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app/)
- [Speed up your CI](/nx-cloud)
+43 -44
View File
@@ -1,5 +1,6 @@
---
title: Nx — Highlights of 2023
slug: 'nx-highlights-of-2023'
authors: [Juri Strumpflohner, Victor Savkin, Zack DeRose]
cover_image: /blog/images/2023-12-28/featured_img.png
tags: [nx, nx-cloud]
@@ -31,7 +32,7 @@ It is that time again: getting flooded by Year of Review blog posts. We did it l
## Top 10 Nx Highlights of 2023
We shipped a ton of features in 2023. You can find all our release blog posts and release-related info here: [https://nx.dev/changelog](https://nx.dev/changelog) or check out our [Dev.to collection](https://dev.to/nx).
We shipped a ton of features in 2023. You can find all our release blog posts and release-related info here: [/changelog](/changelog).
We've picked out 10 highlights for you.
@@ -39,13 +40,13 @@ We've picked out 10 highlights for you.
At Nx, weve heavily embraced Typescript from the beginning and weve been very happy with that decision. Nx also stands as the [fastest JS monorepo tool](https://github.com/vsavkin/large-monorepo) available, demonstrating that adopting TypeScript does not necessarily compromise speed. However, we dont stop here. To push the boundaries further, we started to rewrite the most performance critical and computationally intensive parts of the Nx core in Rust.
Our initial focus was on [rewriting the task hasher](https://dev.to/nx/nx-158-rust-hasher-nx-console-for-intellij-deno-node-and-storybook-27ng#rustifying-the-nx-hasher), previously reliant on Git with a Node fallback. This shift to Rust brings a noticeable performance boost, particularly in large repositories, while maintaining the same user experience.
Our initial focus was on [rewriting the task hasher](/blog/nx-15-8-rust-hasher-nx-console-for-intellij-deno-node-and-storybook), previously reliant on Git with a Node fallback. This shift to Rust brings a noticeable performance boost, particularly in large repositories, while maintaining the same user experience.
Following this, we revamped the TypeScript dependency resolution, observing an almost 5x speed increase with our Rust-based approach over the traditional TSC method.
{% tweet url="https://twitter.com/juristr/status/1726977598218199302" /%}
Such enhancements are especially crucial for the efficient [project graph calculation](https://nx.dev/features/explore-graph). As we continue to evolve Nx, Rust will play a key role in optimizing performance-critical components. This strategic use of Rust complements our ongoing commitment to TypeScript, ensuring Nx remains as extensible and powerful as ever.
Such enhancements are especially crucial for the efficient [project graph calculation](/features/explore-graph). As we continue to evolve Nx, Rust will play a key role in optimizing performance-critical components. This strategic use of Rust complements our ongoing commitment to TypeScript, ensuring Nx remains as extensible and powerful as ever.
### First Class Vite Support
@@ -55,7 +56,7 @@ Our collaboration with our friends in the Vite core team has been incredibly fru
![](/blog/images/2023-12-28/bodyimg1.webp)
We also built some powerful code generators that not only facilitate a seamless [transition from Webpack to Vite](https://nx.dev/nx-api/vite/generators/configuration#nxviteconfiguration) but also pave the way for an effortless [migration from a CRA-based setup](https://nx.dev/recipes/adopting-nx/adding-to-existing-project) to a modern Nx + Vite based workspace. To see this process in action, [check out this short video](https://www.youtube.com/watch?v=zvYb7XCLQzU).
We also built some powerful code generators that not only facilitate a seamless [transition from Webpack to Vite](/nx-api/vite/generators/configuration#nxviteconfiguration) but also pave the way for an effortless [migration from a CRA-based setup](/recipes/adopting-nx/adding-to-existing-project) to a modern Nx + Vite based workspace. To see this process in action, [check out this short video](https://www.youtube.com/watch?v=zvYb7XCLQzU).
[AnalogJS](https://analogjs.org/) — the fullstack Angular meta-framework which also heavily builds on top of Vite — is using the `@nx/vite` plugin to power its Angular and Nx based workspaces.
@@ -65,7 +66,7 @@ We also spoke at both editions of [ViteConf](https://viteconf.org/23/). If you
Open source libraries and frameworks share a common necessity: the need to develop multiple packages cohesively and efficiently while managing their versioning and publishing to NPM. Nx has emerged as a go-to choice for handling such open source monorepos (as well explore further in the next section of this blog post). Until recently, one area Nx did not address directly was versioning and release management. Traditionally, this gap has been filled with tools like [release-it](https://github.com/release-it/release-it), [changesets](https://github.com/changesets/changesets), or custom Node scripts, similar to our approach in the Nx repository.
However, many in our community have expressed a desire for a more native, integrated experience for versioning and publishing, akin to what Lerna offers. In response to this feedback, weve introduced [the “nx release” command](https://nx.dev/features/manage-releases), a solution designed to seamlessly integrate these processes into the Nx workflow.
However, many in our community have expressed a desire for a more native, integrated experience for versioning and publishing, akin to what Lerna offers. In response to this feedback, weve introduced [the “nx release” command](/features/manage-releases), a solution designed to seamlessly integrate these processes into the Nx workflow.
James Henry gave a deep dive talk of an early version of it at this years Nx Conf:
@@ -76,7 +77,7 @@ Since its introduction, the “nx release” feature has significantly evolved,
- Versioning packages offering support for both independent and “locked” versioning strategies.
- Releasing packages in the correct sequence, ensuring dependency integrity.
Beyond these core functionalities, the feature also includes a robust grouping mechanism, supports semantic versioning, and changelog generation. Additionally, it provides various release targets, such as GitHub and NPM. For those having special requirements, the [programmatic API](https://nx.dev/features/manage-releases#using-the-programmatic-api-for-nx-release) offers maximum flexibility.
Beyond these core functionalities, the feature also includes a robust grouping mechanism, supports semantic versioning, and changelog generation. Additionally, it provides various release targets, such as GitHub and NPM. For those having special requirements, the [programmatic API](/features/manage-releases#using-the-programmatic-api-for-nx-release) offers maximum flexibility.
### Improved Node Backend Development: Fastify and Docker
@@ -94,9 +95,9 @@ Nx Console has evolved from an experimental side project of the Nx team to a cor
![](/blog/images/2023-12-28/bodyimg2.webp)
This year we not only added a lot of new features to Nx Console, but also rewrote its [internals](https://blog.nrwl.io/nx-console-gets-lit-ca339743ff4f) which paved the way to expand Nx Console to other code editors: **JetBrains IDEs.**
This year we not only added a lot of new features to Nx Console, but also rewrote its [internals](/blog/nx-console-gets-lit) which paved the way to expand Nx Console to other code editors: **JetBrains IDEs.**
Yes, this means you can now use the latest Nx Console directly in your [Webstorm IDE](https://www.jetbrains.com/webstorm/). Read the [announcement blog post](https://blog.nrwl.io/expanding-nx-console-to-jetbrains-ides-8a5b80fff2d7) for all the details or go ahead and install Nx Console if you didnt already:
Yes, this means you can now use the latest Nx Console directly in your [Webstorm IDE](https://www.jetbrains.com/webstorm/). Read the [announcement blog post](/blog/expanding-nx-console-to-jetbrains-ides) for all the details or go ahead and install Nx Console if you didnt already:
- [Nx Console for VSCode](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)
- [Nx Console for IntelliJ](https://plugins.jetbrains.com/plugin/21060-nx-console)
@@ -115,7 +116,7 @@ Generally, Playwright fits in the Nx ecosystem as a tool that developers can use
```shell
$ npx create-nx-workspace@latest
> NX Let's create a new workspace [https://nx.dev/getting-started/intro]
> NX Let's create a new workspace [/getting-started/intro]
✔ Which stack do you want to use? · react
✔ What framework would you like to use? · none
✔ Integrated monorepo, or standalone project? · integrated
@@ -143,7 +144,7 @@ TypeScript has won. It has become the prevalent way of writing modern JavaScript
}
```
So in [v16.8](https://blog.nrwl.io/nx-16-8-release-e38e3bb503b5#7b41) we added the ability to automatically have these generated for you by defining the `additionalEntryPoints` and `generateExportsField` when using the `@nx/js` plugin.
So in [v16.8](/blog/nx-16-8-release) we added the ability to automatically have these generated for you by defining the `additionalEntryPoints` and `generateExportsField` when using the `@nx/js` plugin.
```
// packages/my-awesome-lib/project.json
@@ -192,7 +193,7 @@ Heres a video that walks you through:
{% youtube src="https://www.youtube.com/embed/Vy4d0-SF5cY?si=mHatqRPRqHAK0X9o" /%}
But we wouldnt be talking about Nx if we didnt also look into speeding up TypeScript compilation for large monorepos. We called it “[batch mode](https://nx.dev/showcase/benchmarks/tsc-batch-mode)”. When enabling batch mode, Nx leverages the underlying [project graph](https://nx.dev/features/explore-graph) to generate TypeScript project references behind the scenes for you, to fully leverage TS incremental building. The results are amazing. According to [our benchmarks](https://github.com/nrwl/large-ts-monorepo), batch mode has the potential to speed up Typescript compilation by up to 5x for large monorepos.
But we wouldnt be talking about Nx if we didnt also look into speeding up TypeScript compilation for large monorepos. We called it “[batch mode](/showcase/benchmarks/tsc-batch-mode)”. When enabling batch mode, Nx leverages the underlying [project graph](/features/explore-graph) to generate TypeScript project references behind the scenes for you, to fully leverage TS incremental building. The results are amazing. According to [our benchmarks](https://github.com/nrwl/large-ts-monorepo), batch mode has the potential to speed up Typescript compilation by up to 5x for large monorepos.
![](/blog/images/2023-12-28/bodyimg3.gif)
@@ -218,17 +219,17 @@ And youll then have access to Nx generators so you can create Vue application
![](/blog/images/2023-12-28/bodyimg6.gif)
Checkout out our [Vue standalone tutorial](https://nx.dev/getting-started/tutorials/vue-standalone-tutorial) for more, as well as our [Vue API docs](https://nx.dev/nx-api/vue), and stay tuned as Nx prepares to offer more Vue support (including support for [Nuxt](https://nuxt.com/), a full-stack framework built around Vue) in the near future!
Checkout out our [Vue standalone tutorial](/getting-started/tutorials/vue-standalone-tutorial) for more, as well as our [Vue API docs](/nx-api/vue), and stay tuned as Nx prepares to offer more Vue support (including support for [Nuxt](https://nuxt.com/), a full-stack framework built around Vue) in the near future!
### Extending Nx: Local Generators, Build your Own CLI, Verdaccio Support
Extensibility is at the heart of Nx, serving as the cornerstone of its flexibility. It enables the Nx core team to continually expand capabilities through dedicated plugins and simultaneously paves the way for a rich array of [community plugin contributions](https://nx.dev/plugin-registry). Furthermore, Nxs adaptable nature is particularly beneficial for large enterprises, as it allows for the creation of custom automation solutions, specifically tailored to meet their unique organizational needs.
Extensibility is at the heart of Nx, serving as the cornerstone of its flexibility. It enables the Nx core team to continually expand capabilities through dedicated plugins and simultaneously paves the way for a rich array of [community plugin contributions](/plugin-registry). Furthermore, Nxs adaptable nature is particularly beneficial for large enterprises, as it allows for the creation of custom automation solutions, specifically tailored to meet their unique organizational needs.
In 2023 we kept improving Nxs extensibility, unifying the Nx plugin development model and how you develop workspace-local automations. You can now scaffold a new plugin into your Nx workspace and run it right away which makes it an interesting approach to automate your monorepo.
{% youtube src="https://www.youtube.com/embed/myqfGDWC2go?si=q6_9JReS1nF8d3pZ" /%}
When creating automations with Nx you cannot just enhance existing Nx workspaces, but also develop a complete [Nx preset](https://nx.dev/extending-nx/recipes/create-preset) that controls the entire appearance of an Nx workspace. Basically your own, personalized `create-nx-workspace`. You can publish and then use your preset like:
When creating automations with Nx you cannot just enhance existing Nx workspaces, but also develop a complete [Nx preset](/extending-nx/recipes/create-preset) that controls the entire appearance of an Nx workspace. Basically your own, personalized `create-nx-workspace`. You can publish and then use your preset like:
```shell
npx create-nx-workspace myrepo --preset=@yourpkg/nx-preset
@@ -250,7 +251,7 @@ Simply put, Module Federation allows a Javascript application running in a brows
This is an exciting development as it allows a paradigm shift in how you can architect, build, and deploy Javascript applications! And this is especially exciting for monorepo fans, as Nx has best-in-class support for module federation that makes a Module Federation approach easy to adopt and simple to understand!
Currently, our `@nx/angular` and `@nx/react` plugins both have generators to [create a “host” application](https://nx.dev/recipes/module-federation/create-a-host) that will load and consume federated modules from [“remote” applications](https://nx.dev/recipes/module-federation/create-a-remote), which you can also generate using Nx. Then, by running a simple command with Nx, you can serve all applications required for your host application with the command:
Currently, our `@nx/angular` and `@nx/react` plugins both have generators to [create a “host” application](/recipes/module-federation/create-a-host) that will load and consume federated modules from [“remote” applications](/recipes/module-federation/create-a-remote), which you can also generate using Nx. Then, by running a simple command with Nx, you can serve all applications required for your host application with the command:
```shell
nx serve host-application --devRemotes=remote-application
@@ -258,9 +259,9 @@ nx serve host-application --devRemotes=remote-application
Where in the example above your host application is named “host-application” and a remote application that you want live updates on as youre developing is named “remote-application”.
Throughout 2023, weve continued to increase Nxs support and general dev experience around Module Federation, including [adding a generator to federate an existing module](https://nx.dev/recipes/module-federation/federate-a-module), improving the local developer experience by improving local webserver performance, and introducing the concept of [Dynamic Module Federation](https://nx.dev/recipes/angular/dynamic-module-federation-with-angular#advanced-angular-micro-frontends-with-dynamic-module-federation) which will allow you to dynamically specify the location of your remote applications via a “module-federation.manifest.json” file!
Throughout 2023, weve continued to increase Nxs support and general dev experience around Module Federation, including [adding a generator to federate an existing module](/recipes/module-federation/federate-a-module), improving the local developer experience by improving local webserver performance, and introducing the concept of [Dynamic Module Federation](/recipes/angular/dynamic-module-federation-with-angular#advanced-angular-micro-frontends-with-dynamic-module-federation) which will allow you to dynamically specify the location of your remote applications via a “module-federation.manifest.json” file!
At Nx, were excited about the Module Federation support we offer for our users, and think that it has many interesting applications when paired with Nxs CI capabilities, in particular allowing for [much shorter build times](https://nx.dev/concepts/module-federation/faster-builds-with-module-federation#faster-builds-with-module-federation) especially for larger Angular applications.
At Nx, were excited about the Module Federation support we offer for our users, and think that it has many interesting applications when paired with Nxs CI capabilities, in particular allowing for [much shorter build times](/concepts/module-federation/faster-builds-with-module-federation) especially for larger Angular applications.
## Many OSS repos adopt Nx
@@ -269,7 +270,7 @@ By simply installing the `nx` package (or initializing with `nx init` in any pro
- Advanced task scheduling, including task pipelines and parallel execution.
- Efficient caching mechanisms.
> If you want to learn more about such setup, make sure to check out our blog post on [how to adopt Nx on a npm/yarn/pnpm workspace](https://dev.to/nx/setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx-1eem) or the corresponding [video version](https://www.youtube.com/watch?si=0XH6Sp025xM3Rru5&v=ngdoUQBvAjo&feature=youtu.be).
> If you want to learn more about such setup, make sure to check out our blog post on [how to adopt Nx on a npm/yarn/pnpm workspace](/blog/setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx) or the corresponding [video version](https://www.youtube.com/watch?si=0XH6Sp025xM3Rru5&v=ngdoUQBvAjo&feature=youtu.be).
Numerous open-source packages are adopting Nx in this lightweight manner. It enables them to maintain their existing setup while notably enhancing the local developer experience (DX) in task execution and accelerating processes on CI.
@@ -281,11 +282,11 @@ I picked out some of the more well-known OSS repos that started using Nx this ye
[**RxJS**](https://github.com/ReactiveX/rxjs) — The library for reactive programming in JavaScript. It is widely popular, with over 40 million downloads/week on NPM. RxJS only recently adopted Nx, not only leveraging speed improvements via caching, but also leveraging Nxs latest `nx release` feature to publish packages to NPM.
[**AnalogJS**](https://analogjs.org/) — Analog is a full-stack Angular meta-framework that brings exciting features to Angular, like faster Vite setup, support for both server-side and static rendering, and easy file-based routing. Analog uses an Nx monorepo for its development and also uses [Nxs DevKit](https://nx.dev/extending-nx/intro/getting-started) to create tools that work great in both Nx and Angular CLI workspaces.
[**AnalogJS**](https://analogjs.org/) — Analog is a full-stack Angular meta-framework that brings exciting features to Angular, like faster Vite setup, support for both server-side and static rendering, and easy file-based routing. Analog uses an Nx monorepo for its development and also uses [Nxs DevKit](/extending-nx/intro/getting-started) to create tools that work great in both Nx and Angular CLI workspaces.
[**Qwikifier**](https://github.com/qwikifiers/qwik-nx) — The Qwikifiers community built a dedicated Nx plugin to combine the power of Qwik and Nx. Their repo is a great example of building Nx plugins and [using Nx to build your own CLI](https://nx.dev/extending-nx/recipes/create-install-package).
[**Qwikifier**](https://github.com/qwikifiers/qwik-nx) — The Qwikifiers community built a dedicated Nx plugin to combine the power of Qwik and Nx. Their repo is a great example of building Nx plugins and [using Nx to build your own CLI](/extending-nx/recipes/create-install-package).
[**Builder.io Mitosis**](https://github.com/BuilderIO/mitosis) — [BuilderIO](https://www.builder.io/) has an ambitious compiler project that allows you to write a component once and then compile it to different frameworks. Check out their [mind-blowing demo page](https://mitosis.builder.io/?outputTab=G4VwpkA%3D). They adopted Nx to [coordinate task dependencies](https://nx.dev/concepts/task-pipeline-configuration) and speed up their CI builds.
[**Builder.io Mitosis**](https://github.com/BuilderIO/mitosis) — [BuilderIO](https://www.builder.io/) has an ambitious compiler project that allows you to write a component once and then compile it to different frameworks. Check out their [mind-blowing demo page](https://mitosis.builder.io/?outputTab=G4VwpkA%3D). They adopted Nx to [coordinate task dependencies](/concepts/task-pipeline-configuration) and speed up their CI builds.
[**Ghost**](https://github.com/TryGhost/Ghost) — Are you into blogging? You might want to look at [Ghost](https://ghost.org/). They were using Lerna in the past and migrated to a fully Nx-powered workspace.
@@ -293,13 +294,13 @@ And these are just some of them that joined in 2023. If I missed some cool ones
## Nx Community
Nx has a huge community! Were lucky to have so many folks rooting for Nx, whether on socials, talking at conferences, writing blog posts or [creating awesome plugins](https://nx.dev/plugin-registry).
Nx has a huge community! Were lucky to have so many folks rooting for Nx, whether on socials, talking at conferences, writing blog posts or [creating awesome plugins](/plugin-registry).
**Nx Champions** — This year we finally launched which we had planned for a long time. Our [Nx Champions](https://nx.dev/community) program.
**Nx Champions** — This year we finally launched which we had planned for a long time. Our [Nx Champions](/community) program.
![](/blog/images/2023-12-28/bodyimg7.webp)
These are individuals who stood out for their contributions and passion for helping within the Nx community. We wanted to build a more connected relationship with these folks and have a channel to gather more direct feedback as well. Get to know [all of our champions](https://nx.dev/community).
These are individuals who stood out for their contributions and passion for helping within the Nx community. We wanted to build a more connected relationship with these folks and have a channel to gather more direct feedback as well. Get to know [all of our champions](/community).
**New Discord server** — Around September we also switched over from our previous Nx Slack community to a brand new [**Nx community Discord**](https://go.nx.dev/community), which is already 2,600 members and counting. Discord is popular among OSS communities and allows new folks to join easily. In addition, we now have a dedicated forum integrated, as well as a couple of useful automations. More coming next year!
@@ -309,16 +310,16 @@ Make sure [you join](https://go.nx.dev/community)!
Our [Youtube channel](https://www.youtube.com/@nxdevtools) has grown to over 15k subscribers and peaks of 65k views a month. We love to provide educational video content, so make sure to subscribe! It got a little silent towards the end of the year, but weve been working a lot behind the scenes. So stay tuned!
We also poured a lot of [effort into the docs](https://nx.dev/getting-started/intro). We restructured them following the [Diataxis](https://diataxis.fr/) to make pages less overwhelming and more structured based on their type of content. Youll find
We also poured a lot of [effort into the docs](/getting-started/intro). We restructured them following the [Diataxis](https://diataxis.fr/) to make pages less overwhelming and more structured based on their type of content. Youll find
- [**Concept docs**](https://nx.dev/concepts) — which explain some of the inner workings and mental model behind certain features. Like [how caching works](https://nx.dev/concepts/how-caching-works).
- [**Recipes**](https://nx.dev/recipes) — which are solution oriented. You already know how to cook, we provide the exact recipe for it.
- [**Tutorials**](https://nx.dev/getting-started/tutorials) — for when you just want to sit down and follow along, step by step to learn how to use Nx in a certain context.
- [**Reference**](https://nx.dev/reference) and [**API docs**](https://nx.dev/nx-api) — pure, raw and to the point.
- [**Concept docs**](/concepts) — which explain some of the inner workings and mental model behind certain features. Like [how caching works](/concepts/how-caching-works).
- [**Recipes**](/recipes) — which are solution oriented. You already know how to cook, we provide the exact recipe for it.
- [**Tutorials**](/getting-started/tutorials) — for when you just want to sit down and follow along, step by step to learn how to use Nx in a certain context.
- [**Reference**](/reference) and [**API docs**](/nx-api) — pure, raw and to the point.
We created a brand new [“Why Nx”](https://nx.dev/getting-started/why-nx) page explaining the overall architecture of Nx including a [brand new video](https://www.youtube.com/watch?v=-_4WMl-Fn0w) giving you a holistic overview of what Nx is capable of.
We created a brand new [“Why Nx”](/getting-started/why-nx) page explaining the overall architecture of Nx including a [brand new video](https://www.youtube.com/watch?v=-_4WMl-Fn0w) giving you a holistic overview of what Nx is capable of.
We also refreshed our [entry pages](https://nx.dev/getting-started/intro), including dedicated examples of using Nx with popular stacks:
We also refreshed our [entry pages](/getting-started/intro), including dedicated examples of using Nx with popular stacks:
![Examples include Express, Vue, Next, Nuxt, Rract Native, Rust, Go, Storybook, and more.](/blog/images/2023-12-28/bodyimg8.webp)
@@ -326,21 +327,19 @@ You can also browse them in the [nx-recipes](https://github.com/nrwl/nx-recipes)
{% tweet url="https://twitter.com/juristr/status/1736023402933318011" /%}
{% tweet url="https://twitter.com/juristr/status/1726977598218199302" /%}
And obviously, we jumped on the AI train as well. A couple of months ago, we added the [Nx Assistant](https://nx.dev/ai-chat). A ChatGPT-powered interface trained on our docs. [Katerina](https://twitter.com/psybercity) wrote about it [on our blog](https://blog.nrwl.io/nx-docs-ai-assistant-433d238e45d4). The AI chat allows to interactively ask questions about Nx and will give you relevant answers from our docs (including linking to the sources).
And obviously, we jumped on the AI train as well. A couple of months ago, we added the [Nx Assistant](/ai-chat). A ChatGPT-powered interface trained on our docs. [Katerina](https://twitter.com/psybercity) wrote about it [on our blog](/blog/nx-docs-ai-assistant). The AI chat allows to interactively ask questions about Nx and will give you relevant answers from our docs (including linking to the sources).
## New Tagline: Smart Monorepos — Fast CI
Nx stands out for its flexibility, accommodating for both monorepo and non-monorepo project structures. This approach allows users to begin with simpler project configurations, leveraging the benefits of Nxs robust tooling, and later, when the need arises, seamlessly [migrate to a monorepo](https://nx.dev/recipes/tips-n-tricks/standalone-to-integrated).
Nx stands out for its flexibility, accommodating for both monorepo and non-monorepo project structures. This approach allows users to begin with simpler project configurations, leveraging the benefits of Nxs robust tooling, and later, when the need arises, seamlessly [migrate to a monorepo](/recipes/tips-n-tricks/standalone-to-monorepo).
However, Nxs true strength becomes most apparent at scale, typically within a monorepo setup. We wanted to capture it in our new tagline: **Smart Monorepos — Fast CI**.
{% twitter url="https://twitter.com/juristr/status/1734558895547568634" /%}
{% tweet url="https://twitter.com/juristr/status/1734558895547568634" /%}
Setting up an efficient and maintainable CI process for monorepos can be a complex task, so weve also made it a focal point in our new tagline. Nx expands beyond the local development experience, helping you set up an efficient CI process. Were publicly launching [Nx Agents](https://nx.dev/ci/features/distribute-task-execution) to add seamless distribution to your CI pipeline, and more are coming in 2024.
Setting up an efficient and maintainable CI process for monorepos can be a complex task, so weve also made it a focal point in our new tagline. Nx expands beyond the local development experience, helping you set up an efficient CI process. Were publicly launching [Nx Agents](/ci/features/distribute-task-execution) to add seamless distribution to your CI pipeline, and more are coming in 2024.
As part of that, we also restructured our docs to have a section entirely dedicated to CI: [https://nx.dev/ci](https://nx.dev/ci/intro/ci-with-nx).
As part of that, we also restructured our docs to have a section entirely dedicated to CI: [/ci](/ci/intro/ci-with-nx).
## Nx Conf
@@ -348,7 +347,7 @@ We did it again! The second in-person Nx Conf was a resounding success, this tim
![](/blog/images/2023-12-28/bodyimg9.webp)
Theres not much to say. Check out some of the amazing talks. I did a [Nx Conf 2023 recap blog post](https://dev.to/nx/nx-conf-2023-recap-53ep).
Theres not much to say. Check out some of the amazing talks. I did a [Nx Conf 2023 recap blog post](/blog/nx-conf-2023-recap).
## Looking ahead — 2024
@@ -360,8 +359,8 @@ Legacy CI systems are a performance and productivity bottleneck if you use a pow
It has three components:
- [**Nx Cach**](https://nx.dev/ci/features/remote-cache): Built-in local and remote caching to speed up your tasks and save you time and money. Available now.
- [**Nx Agents**](https://nx.dev/ci/features/distribute-task-execution): A single line to enable distributed computation, across multiple machines. Fully managed agents, dynamically allocated based on PR size. Available early Feb.
- [**Nx Cach**](/ci/features/remote-cache): Built-in local and remote caching to speed up your tasks and save you time and money. Available now.
- [**Nx Agents**](/ci/features/distribute-task-execution): A single line to enable distributed computation, across multiple machines. Fully managed agents, dynamically allocated based on PR size. Available early Feb.
- **Nx Workflows**: Next generation, fully managed CI solution with distribution at its core, designed from the ground up for monorepos. _Available later in 2024._
Optimal parallelization and distribution, using the right numbers of agents for each PR, rerunning flaky tests, splitting and distributing large test suites, handling dependencies between tasks across machines — are just some of the things we can now handle automatically for you. Turn it on and enjoy the speed.
@@ -374,7 +373,7 @@ We took inspiration from VSCode. Any project you open in VSCode will work right
The whole team is excited about it as the new experience feels much more elegant.
As always, we try very hard not to break folks, so all your current workspaces will keep working, and we will [provide automatic migrations](https://nx.dev/features/automate-updating-dependencies) to bring you to this new way of using Nx.
As always, we try very hard not to break folks, so all your current workspaces will keep working, and we will [provide automatic migrations](/features/automate-updating-dependencies) to bring you to this new way of using Nx.
Exciting stuff! So keep an eye on our channels, and subscribe if you havent already ;)
@@ -382,10 +381,10 @@ Exciting stuff! So keep an eye on our channels, and subscribe if you havent a
## Learn more
- [Nx Docs](https://nx.dev/getting-started/intro)
- [Nx Docs](/getting-started/intro)
- [X/Twitter](https://twitter.com/nxdevtools)
- [LinkedIn](https://www.linkedin.com/company/nrwl/)
- [Nx GitHub](https://github.com/nrwl/nx)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app/)
- [Speed up your CI](/nx-cloud)
@@ -1,5 +1,6 @@
---
title: What if Nx Plugins Were More Like VSCode Extensions
slug: 'what-if-nx-plugins-were-more-like-vscode-extensions'
authors: [Juri Strumpflohner]
cover_image: '/blog/images/2024-02-05/featured_img.png'
tags: [nx, releases]
@@ -42,7 +43,7 @@ You can add Nx to an existing npm/yarn/pnpm monorepo quite straightforwardly. Yo
npx nx@latest init
```
Youll get an `nx` package installed and an `nx.json` allowing you to define [task dependencies](/recipes/running-tasks/defining-task-pipeline) and caching. With that, you're now able to run commands like `nx build <your project>` or nx `run-many -t build test` to run all `build` and `test` targets in your workspace in parallel. Nx will read and use your existing `package.json` scripts. I've written an in-depth [blog post about adopting Nx in such a scenario](https://dev.to/nx/setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx-1eem).
Youll get an `nx` package installed and an `nx.json` allowing you to define [task dependencies](/recipes/running-tasks/defining-task-pipeline) and caching. With that, you're now able to run commands like `nx build <your project>` or nx `run-many -t build test` to run all `build` and `test` targets in your workspace in parallel. Nx will read and use your existing `package.json` scripts. I've written an in-depth [blog post about adopting Nx in such a scenario](/blog/setup-a-monorepo-with-pnpm-workspaces-and-speed-it-up-with-nx).
This is the most lightweight setup you can get while still getting some improvements via Nx regarding faster task running and more intelligent parallelization. But, you need to deal with the remaining of the monorepo setup.
@@ -182,6 +183,6 @@ We just released Project Crystal, so this is just the beginning of it. While we
- [Nx Docs](/getting-started/intro)
- [Nx GitHub](https://github.com/nrwl/nx)
- [Nx Official Discord Server](/community)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app/)
- [Speed up your CI](/nx-cloud)
+13 -5
View File
@@ -1,5 +1,6 @@
---
title: Introducing @nx/nuxt Enhanced Nuxt.js Support in Nx
slug: 'introducing-nx-nuxt-enhanced-nuxt-js-support-in-nx'
cover_image: '/blog/images/2024-02-06/featured_img.png'
authors: ['Katerina Skroumpelou']
tags: [devtools, javascript, monorepos, nuxt]
@@ -133,7 +134,7 @@ This modular structure allows teams to work on different aspects of the applicat
For instance, if you want to create a new Vue UI library, you can use the following command:
```shell
nx generate @nx/vue:lib my-shared-ui
nx generate @nx/vue:lib libs/my-shared-ui
```
This command creates a my-shared-ui library within your workspace, which can then be used across your Nuxt app and potentially other applications within the same workspace.
@@ -177,13 +178,20 @@ and see the structure of your projects:
Whether you're starting a new Nuxt project or looking to enhance an existing one, Nx offers a compelling set of tools and features to streamline your development process. From modularization to caching, the integration of Nx into your Nuxt projects promises a more efficient, scalable, and enjoyable development experience. By embracing Nx's capabilities in your Nuxt development, you're not just optimizing your current workflow; you're future-proofing your development process. As your projects grow and evolve, Nx's modular architecture and powerful tooling will continue to provide value, making your development experience more enjoyable and productive.
---
## Nx Live With Nuxt Maintainer Daniel Roe
Dont miss Nx team members Zack and Katerina with Nuxts maintainer, Daniel Roe — live!
{% youtube src="https://www.youtube.com/watch?v=uHwUxFYX2DY" %}
## Learn more
Check out the [example repo](https://github.com/mandarini/my-nx-nuxt-workspace) used in this blog post or one of the links below to 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 Community Discord](/community)
- [Nx Community Discord](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app)
- [Speed up your CI](/nx-cloud)
Also, if you liked this, make sure to follow [Katerina](https://twitter.com/psybercity) and [Nx](https://twitter.com/nxdevtools) on Twitter for more!
+5 -4
View File
@@ -1,5 +1,6 @@
---
title: Fast, Effortless CI
slug: 'fast-effortless-ci'
authors: [Isaac Mann]
cover_image: '/blog/images/2024-02-07/featured_img.png'
tags: [nx, nx-cloud, release]
@@ -91,7 +92,7 @@ jobs:
The only reason to modify this file is if you need to change the number of agent machines or there is another type of task that needs to run in CI.
The `linux-medium-js` name in the CI configuration refers to a built-in launch template that Nx provides. If you can not find a template in [the default list](https://github.com/nrwl/nx-cloud-workflows/blob/main/launch-templates/linux.yaml) that meets your needs, you can provide your own. [With a single yaml file](/ci/features/distribute-task-execution#launch-templates), you can set up your agent environment in exactly the way you want with your own launch template.
The `linux-medium-js` name in the CI configuration refers to a built-in launch template that Nx provides. If you can not find a template in [the default list](https://github.com/nrwl/nx-cloud-workflows/blob/main/launch-templates/linux.yaml) that meets your needs, you can provide your own. [With a single yaml file](/ci/reference/launch-templates), you can set up your agent environment in exactly the way you want with your own launch template.
## Dynamically Allocate Agents
@@ -101,7 +102,7 @@ Nx understands that some CI pipelines need more resources than others. To accoun
## Automatically Split E2E Tasks by File
Typically, e2e tests are the tasks that take the longest in CI. In order to take advantage of parallelization and task distribution, these large tasks would need to be split into smaller tasks, but doing this manually would involve duplicating a lot of configuration code and making sure to keep that configuration synchronized. Nx 18s [Project Crystal](/blog/2024-02-05-nx-18-project-crystal) allows you to [automatically create separate Cypress and Playwright tasks](/ci/features/split-e2e-tasks) for each spec file in the e2e project. These individual tasks can all be triggered by running the `e2e-ci` task. What was once a tedious manual process can now be done for you automatically.
Typically, e2e tests are the tasks that take the longest in CI. In order to take advantage of parallelization and task distribution, these large tasks would need to be split into smaller tasks, but doing this manually would involve duplicating a lot of configuration code and making sure to keep that configuration synchronized. Nx 18s [Project Crystal](/blog/what-if-nx-plugins-were-more-like-vscode-extensions) allows you to [automatically create separate Cypress and Playwright tasks](/ci/features/split-e2e-tasks) for each spec file in the e2e project. These individual tasks can all be triggered by running the `e2e-ci` task. What was once a tedious manual process can now be done for you automatically.
![](/blog/images/2024-02-07/bodyimg3.webp)
@@ -121,6 +122,6 @@ If you have a task that cant be run on Nx Agents for some reason, you can eas
- [Nx Docs](/getting-started/intro)
- [Nx GitHub](https://github.com/nrwl/nx)
- [Nx Official Discord Server](/community)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app/)
- [Speed up your CI](/nx-cloud)
@@ -1,5 +1,6 @@
---
title: Versioning and Releasing Packages in a Monorepo
slug: 'versioning-and-releasing-packages-in-a-monorepo'
authors: [Juri Strumpflohner]
cover_image: '/blog/images/2024-02-09/featured_img.png'
tags: [nx, nx-cloud, releases, changelog]
@@ -48,11 +49,11 @@ pnpm dlx nx@latest init
(use `npx nx@latest init` in a NPM workspace)
This brings up a couple of questions including whether to install [Project Crystal plugins](/blog/2024-02-05-nx-18-project-crystal).
This brings up a couple of questions including whether to install [Project Crystal plugins](/blog/what-if-nx-plugins-were-more-like-vscode-extensions).
![](/blog/images/2024-02-09/bodyimg2.webp)
It gives you some additional benefits ([you can read more here](/blog/2024-02-05-nx-18-project-crystal)), but you dont have to as it is not required for Nx Release.
It gives you some additional benefits ([you can read more here](/blog/what-if-nx-plugins-were-more-like-vscode-extensions)), but you dont have to as it is not required for Nx Release.
## Installing the JavaScript/TypeScript versioning Package
@@ -187,7 +188,7 @@ It also generates a nice `CHANGELOG.md` for us:
- **buttons:** add new background shadow
### ❤️ Thank You
### ❤️ Thank You
- Juri
@@ -318,4 +319,4 @@ Here are some example repositories already leveraging Nx release:
- [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/)
- [Speed up your CI](/nx-cloud)
+9 -8
View File
@@ -1,5 +1,6 @@
---
title: Launch Nx Week Recap
slug: 'launch-nx-week-recap'
authors: [Zack DeRose]
cover_image: '/blog/images/2024-02-15/featured_img.png'
tags: [nx, nx-cloud, releases, changelog]
@@ -36,7 +37,7 @@ Juri announced launched Project Crystal with this video:
The short version is: Nx project crystal means Nx plugins make your codebases work more seemlessly with less config.
For the long version, checkout this blog post by Juri where he describes [how Nx plugins are now more like VsCode Extentions](/blog/2024-02-05-nx-18-project-crystal)!
For the long version, checkout this blog post by Juri where he describes [how Nx plugins are now more like VsCode Extentions](/blog/what-if-nx-plugins-were-more-like-vscode-extensions)!
And dont miss our two conference talks on this subject:
@@ -63,7 +64,7 @@ Zack explains Nuxt and how to use the new plugin in this video:
To add @nx/nuxt to your codebase, use the command:
```shell
> nx add @nx/nuxt
nx add @nx/nuxt
```
Huge thanks to [Katerina](https://twitter.com/psybercity) for her work on the plugin, and Nuxt maintainer, [Daniel Roe](https://twitter.com/danielcroe), for helping to guide the project!
@@ -80,9 +81,9 @@ Were very excited about Nx Agents because we think that in its current state,
{% youtube src="https://www.youtube.com/embed/_FSHQIwITic?si=jDpwTVXLYFXiHEm0" title="Nx Agents" /%}
Be sure to also checkout the [blog post from Isaac on Nx Agents](/blog/2024-02-07-fast-effortless-ci), including explanations of exclusive features like auto-detection and retrying for flaky tasks and automatically splitting lengthy end-to-end tests!
Be sure to also checkout the [blog post from Isaac on Nx Agents](/blog/fast-effortless-ci), including explanations of exclusive features like auto-detection and retrying for flaky tasks and automatically splitting lengthy end-to-end tests!
You can [signup for Nx Agents NOW](https://nx.app/products/agents#content), and find out [more of the details in our docs](/ci/features/distribute-task-execution)!
You can find out [more of the details in our docs](/ci/features/distribute-task-execution)!
Rares and Altan are on the team building Nx Cloud, and during the conference, they dove deeper into some of these topics:
@@ -116,11 +117,11 @@ Tusky will also be able to provide organizational-level insights to your codebas
Versioning and publishing packages is always a bit tricky. Mix in the added complexity of having multiple packages — sometimes with different versioning or publishing strategies — inside the same codebase, and things can get weird quick!
For a long time, Nx has been purposefully versioning and publishing agnostic, but given our time spent as [stewards of Lerna](https://blog.nrwl.io/lerna-is-dead-long-live-lerna-61259f97dbd9) (the OG Javascript monorepo tool), weve been able to take alot of that experience and finally feel confident creating our own versioning and publishing implementation.
For a long time, Nx has been purposefully versioning and publishing agnostic, but given our time spent as [stewards of Lerna](/blog/lerna-is-dead-long-live-lerna) (the OG Javascript monorepo tool), weve been able to take alot of that experience and finally feel confident creating our own versioning and publishing implementation.
Therefore, weve been working on a new command to the Nx CLI: [nx release](/recipes/nx-release/get-started-with-nx-release#get-started-with-nx-release). We launched this on Friday of our Launch Nx week!
Juri goes into [full details in this blog post](/blog/2024-02-09-versioning-and-releasing-packages), and James Henry — our Director of Engineering and the primary engineer responsible for both maintaining Lerna and creating Nx Release — expands further in his conference talk:
Juri goes into [full details in this blog post](/blog/versioning-and-releasing-packages-in-a-monorepo), and James Henry — our Director of Engineering and the primary engineer responsible for both maintaining Lerna and creating Nx Release — expands further in his conference talk:
### Conference Talk: Releasing Nx Release
@@ -142,6 +143,6 @@ Thats all for now folks! Were just starting up a new iteration of developm
- [Nx Docs](/getting-started/intro)
- [Nx GitHub](https://github.com/nrwl/nx)
- [Nx Official Discord Server](/community)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app/)
- [Speed up your CI](/nx-cloud)
+10 -9
View File
@@ -1,7 +1,8 @@
---
title: Monorepos - Why Speed Matters
authors: ['Katerina Skroumpelou']
tags: nx, nxdevtools, speed, ci
slug: 'monorepos-why-speed-matters'
authors: ['Katerina Skroumpelou', 'Jeff Cross']
tags: [nx, nxdevtools, speed, ci]
cover_image: '/blog/images/2024-03-20/featured_img.png'
---
@@ -31,7 +32,7 @@ But lets see all the extra things we did this past year to make everything fa
The Nx daemon has seen significant enhancements, notably through the use of Rust to calculate file hashes behind the scenes. This improvement not only speeds up the start-up times but also optimizes performance even without the daemon, especially on CI environments where the daemon isn't used. The benchmark results at [this repo](https://github.com/vsavkin/large-monorepo) showcase the remarkable speed improvements, making Nx competitive with native code solutions while maintaining the accessibility and flexibility of Node.js. Nx is still Node-first, so contributions are easier and only the most performance-critical parts of Nx are native code.
### **Task Hasher and archive file innovations**
### Task Hasher and archive file innovations
The introduction of a task hasher written in Rust, alongside the use of an archive file to store workspace file hashes (`.nx/cache`), has significantly reduced the need for repetitive file system accesses. This innovation means that running multiple Nx commands in CI is much faster, as file hashing becomes unnecessary after the initial run.
@@ -47,13 +48,13 @@ Nx Replay enables caching and reusing of task results. Its our well known Nx
With Nx Replay, you can see significant speed improvements in your CI pipelines for modified PRs. Whats also important is that if a task has been executed in CI, a developer running that same task locally can reuse the task result instead of actually running the task. So you will also see improvements locally.
### **Nx Agents**
### Nx Agents
![](/blog/images/2024-03-20/bodyimg2.avif)
[Nx Agents](/ci/features/distribute-task-execution) represent the pinnacle of task distribution optimization, ensuring that tasks are executed as efficiently as possible based on the specific requirements of each change. Some features that make up this effort are:
- [Easy integration with existing providers](/ci/features/distribute-task-execution#cicd-guides)
- [Easy integration with existing providers](/ci/recipes/set-up)
- Distribution is handled on the Nx Cloud infrastructure and all you need is a single line. Whats more, all results are played back to your original CI provider script which triggers the Nx Cloud distribution, so that you can make use of the resulting artifacts
- [Efficient task distribution](/ci/features/dynamic-agents)
- Save compute resources and reduce costs, minimizing idle time and compute waste
@@ -63,13 +64,13 @@ With Nx Replay, you can see significant speed improvements in your CI pipelines
You can read more about Nx Agents [here](https://nx.app/products/agents#content).
### **Atomizer**
### Atomizer
The [Atomizer](/ci/features/split-e2e-tasks) splits your Cypress or Playwright e2e tests by file. This significantly enhances granularity for caching, parallel execution, and flaky test identification. This granular approach ensures that individual test results can be cached and only the necessary tests rerun, greatly reducing CI pipeline times and facilitating more accurate flaky test detection.
{% youtube src="https://www.youtube.com/watch?v=0YxcxIR7QU0" /%}
### **Addressing flaky tests with test deflaking**
### Addressing flaky tests with test deflaking
Flaky tests can be a significant bottleneck in the CI process. Nx tackles this issue head-on by intelligently [re-running only the flaky tasks](/ci/features/flaky-tasks), rather than the entire pipeline. This approach not only saves time but also provides developers with more confidence in their CI pipeline's reliability.
@@ -99,6 +100,6 @@ Nx provides an unparalleled toolkit for developers and teams looking to optimize
- [X / Twitter](https://twitter.com/nxdevtools)
- [LinkedIn](https://www.linkedin.com/company/nrwl)
- [Nx GitHub](https://github.com/nrwl/nx)
- [Nx Community Discord](/community)
- [Nx Community Discord](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app)
- [Speed up your CI](/nx-cloud)
+23 -11
View File
@@ -1,8 +1,10 @@
---
title: Reliable CI. A new execution model fixing both flakiness and slowness
slug: 'reliable-ci-a-new-execution-model-fixing-both-flakiness-and-slowness'
authors: [Victor Savkin]
cover_image: '/blog/images/2024-03-21/featured_img.png'
tags: [nx, nx-cloud, releases]
pinned: true
---
The proverbial slow and flaky CI isnt the failure of the developers or even the testing tools. Its the failure of the CI execution model we relied on for the last 20 years.
@@ -59,13 +61,13 @@ Tasks can fail:
Lets see how varying a few parameters affects the probability of the CI execution failing.
| Number of VMS | Avg Tests per VM | Flaky Test Probability | Slow Test Probability | Broken CI Builds (Flaky) | Slow CI Builds |
| ------------- | ---------------- | ---------------------- | --------------------- | ------------------------ | -------------- |
| 5 | 10 | 0.1% | 0.3% | 5% | 15% |
| 10 | 10 | 0.1% | 0.3% | 10% | 26% |
| 50 | 10 | 0.1% | 0.3% | 39% | 78% |
| 5 | 10 | 0.5% | 1% | 23% | 41% |
| 10 | 10 | 0.5% | 1% | 40% | 65% |
| 50 | 10 | 0.5% | 1% | 92% | 99% |
| :-----------: | :--------------: | :--------------------: | :-------------------: | :----------------------: | :------------: |
| 5 | 10 | 0.1% | 0.3% | 5% | 15% |
| 10 | 10 | 0.1% | 0.3% | 10% | 26% |
| 50 | 10 | 0.1% | 0.3% | 39% | 78% |
| 5 | 10 | 0.5% | 1% | 23% | 41% |
| 10 | 10 | 0.5% | 1% | 40% | 65% |
| 50 | 10 | 0.5% | 1% | 92% | 99% |
**The result is much worse than most intuitively expect.** For instance, assuming that an **e2e test has 1 in 1000 chance (0.1%) of failing** for a flaky reason, when the number of e2e tests reaches 500, **the probability of the CI failing for a flaky reason reaches 39%**, and the vast majority of CI executions are slowed down. Note, this is an exceptionally stable test suite. The bottom part of the table is more representative of a typical e2e suite, and the CI becomes “broken” at a much smaller scale.
@@ -102,7 +104,7 @@ Nx Cloud introduces an entirely different model. Instead of the graph of VMs, th
By adding the following line…
```shell
npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js"
npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js"
```
... you are telling Nx Cloud to create five Nx Agents to execute all the tasks from all the commands that will follow.
@@ -169,8 +171,18 @@ The spirit of this post is similar to Alan Kay's quote, "A change of perspective
---
You can learn more about Nx Cloud on [nx.app](https://nx.app) and Nx open source on [nx.dev](https://nx.dev).
You can learn more about Nx Cloud on [our docs](/nx-cloud).
**Nx Cloud Pro includes a 2-month free trial** that is definitely worth trying out if you're curious what Cloud Pro can do for your CI. You can try out Nx Agents, e2e test splitting, deflaking and more. [Learn more about Nx Cloud Pro.](https://nx.app/campaigns/pro)
**Nx Cloud Pro includes a 2-month free trial** that is definitely worth trying out if you're curious what Cloud Pro can do for your CI. You can try out Nx Agents, e2e test splitting, deflaking and more. [Learn more about Nx Cloud Pro.](/pricing)
We also have a **Pro for Startups** plan which offers agents that are 3.5x cheaper than analogous VMs on CircleCI or Github Actions. [Learn more about Nx Pro for Startups.](https://nx.app/campaigns/pro-for-startups)
---
## 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 Community Discord](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](/nx-cloud)
+5 -4
View File
@@ -1,5 +1,6 @@
---
title: Manage Your Gradle Project using Nx
slug: 'manage-your-gradle-project-using-nx'
authors: ['Emily Xiong']
cover_image: '/blog/images/2024-04-19/featured_img.png'
tags: [nx, gradle, how-to]
@@ -11,7 +12,7 @@ We are very excited to announce our support for Gradle with our new plugin: `@nx
The Nx Gradle plugin registers Gradle projects in your Nx workspace. It allows Gradle tasks to be run through Nx. Nx effortlessly makes your [CI faster](/ci/intro/ci-with-nx).
> **Note:** this plugin is currently experimental.
> **Update:** Learn how to import your existing Gradle projects into Nx in [our recent blog post](/blog/nx-import).
This blog will show you:
@@ -25,7 +26,7 @@ This blog will show you:
Before we start, lets answer this question: what is Nx and why should we use it?
From [nx.dev](https://nx.dev): “Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.” It sounds good, what benefits does it bring?
From [nx.dev](): “Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.” It sounds good, what benefits does it bring?
Nx adds the following features to your workspace:
@@ -212,6 +213,6 @@ Here is how to set up Nx with the Gradle workspace. Hopefully, this gives you a
- [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](/community)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app/)
- [Speed up your CI](/nx-cloud)
+238
View File
@@ -0,0 +1,238 @@
---
title: Nx 19.0 Release!!
slug: 'nx-19-release'
authors: ['Zack DeRose']
cover_image: '/blog/images/2024-05-08/nx-19-thumbnail.png'
tags: [nx, release]
---
Hey folks!
It's been awhile since February, where in the midsts our big launch week, we launched Nx 18. Nx 18 introduced the biggest new enhancement to Nx to date: Project Crystal.
[![Project Crystal](/blog/images/2024-02-05/featured_img.png)](/blog/what-if-nx-plugins-were-more-like-vscode-extensions)
You can read more on project crystal [here](/blog/what-if-nx-plugins-were-more-like-vscode-extensions). The main thing to know though is that Project Crystal adjusts the idea of Nx plugins, so that the mere presence of the plugin in your Nx Workspace removes the need to maintain any configuration for most cases.
Nx 18 was a significant departure for us in several ways - maybe the most noteworthy was that we broke our years-long cadence of releasing a new major version every 6 months.
Nx 19 represents a return to form, matching the reliable 6-month schedule. Nx 19 is releasing now 6 months from when Nx 17 released, making Nx 18 a special case to match the impact that Project Crystal had on Nx as a whole.
Here's the rundown of the major things we'll cover in this update:
- [NEW PLUGIN: @nx/gradle](#new-plugin-nxgradle)
- [Nx Atomizer Enhancements](#nx-atomizer-enhancements)
- [Associated Technologies Added To Tasks](#associated-technologies-added-to-tasks)
- [Generators to Convert to Project Crystal](#generators-to-convert-to-project-crystal)
- [BREAKING CHANGE: Updating Bundled Environment Variables: `NX_` to `NX_PUBLIC_`](#breaking-change-updating-bundled-environment-variables-nx-to-nxpublic)
- [General Crystal Polishing](#general-crystal-polishing)
- [Nx Cloud Updates!](#nx-cloud-updates)
- [More Miscellaneous Updates!](#more-miscellaneous-updates)
- [New Conference: Monorepo World 2024](#new-conference-monorepo-world-2024)
- [Wrapping Up, And A Heartfelt Thank You](#wrapping-up-and-a-heartfelt-thank-you)
- [Learn More](#learn-more)
**Prefer a video?**
{% youtube
src="https://youtu.be/U6eO8-w9DR0"
title="Nx 19.0 Has Landed!!"
width="100%" /%}
---
## NEW PLUGIN: @nx/gradle
[![NEW PLUGIN: @nx/gradle](/blog/images/2024-04-19/featured_img.png)](/blog/manage-your-gradle-project-using-nx)
We've launched a new first-party plugin for Gradle!
Emily, the engineer that worked on this effort, posted an entire article where you can find the full details [here](/blog/manage-your-gradle-project-using-nx).
Thanks to the benefits of Project Crystal - which allows us to determine information to create Nx Tasks based on the way your Gradle projects are setup - by adding this plugin, it makes it easy to add Gradle into an existing workspace without needing any Nx-specific configuration.
In addition, you can now find [a new tutorial on using Nx with Gradle](/getting-started/tutorials/gradle-tutorial) which will expand on the [Spring framework](https://spring.io/)'s tutorial for multi-module projects and show you how Nx further enhances the developer experience of that workspace. This tutorial takes you all the way through setting up your CI pipeline with Nx Cloud, so be sure to check it out!
As an editorial note, this Gradle plugin is a big step for Nx, as it represents the first major step we're taking outside of the Javascript ecosystem. This has always been the goal: to robustly support monorepos and full-stack development, even across language and ecosystem barriers. We're using this Gradle plugin internally for our closed-sourced projects (in particular Nx Cloud) and in [Nx Console](https://github.com/nrwl/nx-console/blob/master/package.json#L74) and we're very proud of this plugin and all that it represents.
## Nx Atomizer Enhancements
The Nx Atomizer launched in Nx 18 with Project Crystal. Essentially, "Atomizer" is the name we use to describe how Nx will automatically shard your e2e tests in your CI pipelines via our first party plugins. You can find out more information in the video below:
{% youtube
src="https://youtu.be/0YxcxIR7QU0"
title="10x Faster e2e Tests!"
width="100%" /%}
While the Atomizer was great for reducing the time of end-to-end tests in CI pipelines, one unfortunate trade-off of the Atomizer was that rather than having a single task to represent your end-to-end validation tasks, you instead had a collection of tasks. This tended to clutter up tools when viewing your Nx Tasks. It also wasn't very clear which tasks belonged to which group!
We've addressed this in Nx 19 by introducing the concept of Task Grouping inside of our tooling.
Now, when running the command:
```shell
nx show project nx-dev-e2e --web
```
You'll see the following in the project view:
![Nx Show Project Web View](/blog/images/2024-05-08/grouping-web-view.webp)
Notice how all tasks are now appropriately grouped in the `E2E (CI)` group!
You can also find the same enhancements in Nx Cloud. Below is a view of all tasks in the [CI pipeline](https://staging.nx.app/runs/ctbAZfiLy3):
{% video-player src="/documentation/blog/media/2024-05-08/nx-cloud-atomizer-groupings.mp4" alt="Showing the Atomizer in Nx Cloud" link="https://staging.nx.app/runs/ctbAZfiLy3" /%}
Notice how all e2e groups are collapsed by default to give a concise view, while allowing you to expand to see how each individual task is progressing!
Project Crystal is gathering the information to group your tasks, so this is automatically inferred for you based on the actual contents of your workspace. You can see this information by running the command:
```shell
nx show project nx-dev-e2e --json | jq
```
![Show Project JSON view](/blog/images/2024-05-08/show-project-json.webp)
All Nx Plugins that support this concept of "Atomization" will do this automatically for you, and if you are writing a custom plugin for your own tool or special use-case, you can implect this inferrence to group your targets in Nx and Nx Cloud tooling as well. We'll be adding more documentation on how to implement this in your own plugins in the future.
## Associated Technologies Added To Tasks
We've added icons for associated technologies on tasks in the project detail web view:
![Technology icons in Project Detail View](/blog/images/2024-05-08/icon-in-project-detail-view.gif)
And in Nx Cloud:
![Technology icons in Nx Cloud](/blog/images/2024-05-08/nx-cloud-icons.gif)
This will help easily identify at-a-glance the technology your tasks are associated with. All this is supported out of the box by our plugins and you should see this as soon as updating to Nx 19.
To see how we support this new feature, checkout the json view of our project again:
```shell
nx show project e2e-angular --json | jq
```
![Highlighting target metadata](/blog/images/2024-05-08/highlight-target-metadata.webp)
## Generators to Convert to Project Crystal
As part of Nx 19, we've included generators to our Playwright, Cypress, and ESLint plugins to allow you to easily convert your projects to opt into Project Crystal features!
To convert your workspace, you can use the command:
```shell
nx generate convert-to-inferred
```
Before running this command you could expect your project detail view to look like this:
```shell
nx show project my-react-app-e2e --web
```
![Before Conversion](/blog/images/2024-05-08/before-conversion.webp)
And after running the generator, you can expect your project detail view to look like this:
![After Conversion](/blog/images/2024-05-08/after-conversion.webp)
Notice that in addition to reducing the configuration in your `project.json` file, this generator will also turn on the Nx Atomizer for your Cypress and Playwright projects, so Nx will allow sharding for your end-to-end tasks in CI based on the tests present in your workspace going forward. Note that Nx Agents are very highly highly encouraged as a way of taking advantage of this sharding capability.
As a note, if you cannot see `e2e-ci` tasks after converting your cypress projects, you can [take a closer look here](/nx-api/cypress/documents/overview#splitting-e2e-tasks-by-file) at how to configure them correctly.
## BREAKING CHANGE: Updating Bundled Environment Variables: `NX_` to `NX_PUBLIC_`
An important update for folks using environment variables in their builds!
Previously, when building your projects in an Nx workspace, our builds were setup to include any environment variables prefixed with `NX_` and include them in the built artifact so they would be accessible there. This is often used for setting things like urls for different versions of external services to hit - for example, sending requests to your local development server while developing, but pointing to the production service for your production build.
Going forward, these environment variables will need to be prefixed with `NX_PUBLIC_`. This is a security consideration - by requiring a more specific prefix we're making sure that no secrets end up in your production builds unintentionally!
Because of the nature of this change we will NOT be providing an automatic migration. So be sure to manually update any environment variables that you want bundled into your builds from `NX_` to `NX_PUBLIC_`.
## General Crystal Polishing
Along with the features above (many of which further build upon Nx Project Crystal), we've done quite a bit since Nx 18 to polish the features that we introduced with Project Crystal.
Since Nx 18 release, we also started using Project Crystal inside of the Nx repo itself (as well as in Nx Console and in our closed-source monorepo as well). This has allowed us to find many improvements we can make, as well as issues we can fix.
You can find a full list of fixes and features applied in this major release [here](https://github.com/nrwl/nx/releases/tag/19.0.0).
{% video-player src="/documentation/blog/media/2024-05-08/fixes.mp4" alt="A display listing the Github changelog" /%}
With Project Crystal landed now, we're also adjusting our priorities to place a higher importance on stability. You should see this reflected in Nx 19.
As a note, we had noticed an increase in the rate of Github issues since Nx 18 launched. Previously, we had not allocated enough time to handling these issues. To address this, our team is going to be doubling the amount of time focusing on maintainence.
In addition - we are adding more process to make the triage of these issues more efficient. Github issues will now be assigned directly to specific members of the Nx Core Team. The main intention of this change is to increase the efficiency of the time that we do spend on addressing issues.
## Nx Cloud Updates!
[![The Nx Cloud Dashboard](/blog/images/2024-05-08/nx-cloud-dashboard.webp)](/nx-cloud#deep-understanding)
We've got some cool stats to share from our users regarding the benefits of [Nx Cloud](/nx-cloud), our premium CI service. The three areas we've identified as the critical aspects of a CI provider are: speed, cost, and reliablity. In these areas we've seen:
- **speed**: Reported 30% - 70% faster CI
- **cost**: Reported 40% - 75% reduction in CI costs
- **reliability**: Nx Cloud's automatic detection and retrying of flaky tests makes the issue of flaky tests largely go away entirely. You can read more on [our thoughts on reliability here](/blog/reliable-ci-a-new-execution-model-fixing-both-flakiness-and-slowness).
In February, we launched two big enhancements to Nx Cloud: the [Atomizer](/ci/features/split-e2e-tasks) and [Nx Agents](https://nx.app/products/agents#content).
Since then, the Atomizer has received a nice UI update (as we had seen earlier):
{% video-player src="/documentation/blog/media/2024-05-08/nx-cloud-atomizer-groupings.mp4" alt="Showing the Atomizer in Nx Cloud" link="https://staging.nx.app/runs/ctbAZfiLy3" /%}
Since February, we also revamped our task distribution algorithms. This has resulted in a 5-20% (depending on the repo) increase in both speed and cost efficiency for our users.
If you are interested in trying Nx Cloud, go to [https://cloud.nx.app](https://cloud.nx.app).
## More Miscellaneous updates!
We've been updating our docs site. We've tweeked the search to make it more helpful, updated navigation, and as you can tell since you're reading it, we've moved our blog to [nx.dev/blog](/blog) as well.
We've also added a page for [Nx Enterprise](/enterprise):
[![Nx Enterprise Site](/blog/images/2024-05-08/nx-enterprise-site.webp)](/enterprise)
And! We've revamped our newsletter, written by our CTO, Victor Savkin. [Subscribe here](https://go.nx.dev/nx-newsletter) to start receiving it!
## NEW CONFERENCE: Monorepo World 2024
[![NEW CONFERENCE: Monorepo World 2024](/blog/images/2024-05-08/welcome-to-monorepo-world-2024.webp)](https://monorepo.world)
We've got a new conference coming up: [Monorepo World 2024](https://monorepo.world)!
This conference will cover all things dealing with monorepos, and we're excited to host it at the Computer History Museum in Mountain View, California this October 7th!
You can [reserve your tickets now](https://ti.to/nx-conf/monorepoworld2024)! In person tickets start at $300 a piece for Early Bird (open until May 31), and online attendance is free.
The [Call for Speakers](https://sessionize.com/monorepo-world) is open now, and will close on June 20, 2024.
We'll be excited to see y'all there!
## Wrapping Up, And A Heartfelt Thank You
That's it for now!
I did want to take a moment to give a heartfelt thank you to everyone out there. If you weren't aware, I had something of a [personal tragedy](https://twitter.com/zackderose/status/1759695615573864758) in February, not long after our big launch week.
[![My Sadie.](/blog/images/2024-05-08/sadie.webp)](https://twitter.com/zackderose/status/1759695615573864758)
For me, this blogpost represents the beginning of my return to Nx, and to the larger dev community.
To everyone out there - your kindness and care meant more to me than you could know. I intend to return that the positivity and care you invested in me in those dark days back as best I can. So here's looking forward to hard work, more releases, and better days to come.
With Many Thanks,
Zack
## 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](/nx-cloud)
@@ -0,0 +1,18 @@
---
title: 'Nx Enterprise Podcast Episode 1: Hicham El Hammouchi'
slug: 'hicham-el-hammouchi-podcast-1'
authors: ['Zack DeRose']
tags: [podcast]
cover_image: /blog/images/2024-06-18/ep-1-hicham.png
podcastYoutubeId: 8iiLB_2djZ8
podcastSpotifyId: 24yagCNpu9EGj0fCwSDQkj
podcastAmazonUrl: https://music.amazon.com/podcasts/a221fdad-36fd-4695-a5b4-038d7b99d284/episodes/899a2e4c-2e56-4dfa-a3e3-e69eb216f2b0/the-enterprise-software-podcast-by-nx-the-enterprise-software-podcast-by-nx-1-hicham-el-hamouchi
podcastAppleUrl: https://podcasters.spotify.com/pod/show/enterprise-software/episodes/The-Enterprise-Software-Podcast-By-Nx-1--Hicham-El-Hamouchi-e2l0302
podcastIHeartUrl: https://www.iheart.com/podcast/269-the-enterprise-software-po-186891508/episode/the-enterprise-software-podcast-by-nx-186891511/
---
In this episode, Zack DeRose from Nx chats with Hicham El Hammouchi, a veteran in enterprise software. Hicham dives into his background, sharing his career journey and the wealth of experience he's gathered along the way.
They tackle the tough challenges that companies face in software development. Hicham offers practical insights and real-life examples from his own career, making complex issues easier to understand. He also shares some tried-and-true strategies for overcoming these hurdles, emphasizing the importance of teamwork and effective project management.
As the chat continues, Zack and Hicham explore the latest tech trends and innovations that are shaking up the industry. Hicham's forward-thinking views provide a sneak peek into the future of enterprise software. They also discuss detailed case studies of successful projects, highlighting the importance of staying focused on customer needs and feedback.
@@ -0,0 +1,18 @@
---
title: 'Nx Enterprise Podcast Episode 2: Tine Kondo'
slug: 'tine-kondo-podcast-2'
authors: ['Zack DeRose']
tags: [podcast]
cover_image: /blog/images/2024-07-19/ep-2-tine.png
podcastYoutubeId: Nzf3BmymfEo
podcastSpotifyId: 0CCQaWCln7rvwkkVvsyxsk
podcastAmazonUrl: https://music.amazon.com/podcasts/a221fdad-36fd-4695-a5b4-038d7b99d284/episodes/53934cd9-c521-441e-8523-8b947ed207ca/the-enterprise-software-podcast-by-nx-the-enterprise-software-podcast-by-nx-2-tine-kondo
podcastAppleUrl: https://podcasts.apple.com/us/podcast/the-enterprise-software-podcast-by-nx-2-tine-kondo/id1752704996?i=1000662764990
podcastIHeartUrl: https://www.iheart.com/podcast/269-the-enterprise-software-po-186891508/episode/the-enterprise-software-podcast-by-nx-197335640/
---
In this episode, welcome Nx Champion and Nx Expert, Tine Kondo. Our discussion highlights how Nx is poised to make an impact in the Java space.
We touch on the difficulties larger organizations face when merging PRs in a timely manner, emphasizing how a monorepo alleviates the headache of coordinating multiple PRs across various repositories, and share firsthand experiences and frustrations with traditional multi-repo setups, underscoring the benefits of a unified approach.
In particular, Nx's new plugin: [@nx/gradle](/nx-api/gradle) is of interest, and Tine provides some valuable insight on the impact this plugin can make, as well as the importance for Maven support.
+54
View File
@@ -0,0 +1,54 @@
---
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]
youtubeUrl: https://youtu.be/g2m9cHp-O-Q?si=ax-SKCO0Xvy9vFIz
---
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](/ci/features/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:
![Explain with AI button](/blog/images/2024-07-29/explain-with-ai-button.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.**
Also make sure [to check out our docs](/ci/features/explain-with-ai) for more information.
## 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 %}
## 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](/nx-cloud)
+294
View File
@@ -0,0 +1,294 @@
---
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:
- [Video Summary](#video-summary)
- [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)
- [Learn more](#learn-more)
## 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](/reference/project-configuration#parallelism). 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](/nx-cloud)
@@ -0,0 +1,16 @@
---
title: 'Nx Enterprise Podcast Episode 3: Ahmed Elsakaan'
slug: 'ahmed-elsakaan-podcast-3'
authors: ['Zack DeRose']
tags: [podcast]
cover_image: /blog/images/2024-08-14/ep-3-ahmed.png
podcastYoutubeId: l_b6EOXqYRg
podcastSpotifyId: 4d4oE8B3y9BmECZ3P4uvDP
podcastAmazonUrl: https://music.amazon.com/podcasts/a221fdad-36fd-4695-a5b4-038d7b99d284/episodes/28209cf9-1b88-48b5-a798-7b24c843e9b1/the-enterprise-software-podcast-by-nx-the-enterprise-software-podcast-by-nx-3-ahmed-elsakaan
podcastAppleUrl: https://podcasts.apple.com/us/podcast/the-enterprise-software-podcast-by-nx-3-ahmed-elsakaan/id1752704996?i=1000665363260
podcastIHeartUrl: https://www.iheart.com/podcast/269-the-enterprise-software-po-186891508/episode/the-enterprise-software-podcast-by-nx-205664230/
---
In this episode we welcome Nx Champion and creator of [noodle](https://noodle.run) and [OrbitKit](https://orbitkit.dev/): Ahmed Elsakaan.
As a monorepo enthusiast, we explore Ahmed's thoughts on monorepos and how these tools can add value to developers - both in the space of setting up your monorepo (like Nx does) and in the space of creating reusable customizable modules (like OrbitKit is attempting).
@@ -0,0 +1,16 @@
---
title: 'Nx Enterprise Podcast Episode 4: Cvent Platform Architecture Panel'
slug: 'cvent-podcast-3'
authors: ['Zack DeRose']
tags: [podcast]
cover_image: /blog/images/2024-08-21/ep-4-cvent.png
podcastYoutubeId: _7uK1V_xu9k
podcastSpotifyId: 1zWuMFxcnGy90AN41gkodx
podcastAmazonUrl: https://music.amazon.com/podcasts/a221fdad-36fd-4695-a5b4-038d7b99d284/episodes/7e19eb25-76f9-4d1e-89c0-c2fd1f585f9b/the-enterprise-software-podcast-by-nx-the-enterprise-software-podcast-by-nx-4-cvent-platform-architect-panel
podcastAppleUrl: https://podcasts.apple.com/us/podcast/the-enterprise-software-podcast-by-nx-4-cvent/id1752704996?i=1000666133320
podcastIHeartUrl: https://www.iheart.com/podcast/269-the-enterprise-software-po-186891508/episode/the-enterprise-software-podcast-by-nx-207751657/
---
In this edition of the Nx Enterprise Podcast, Zack sits down with a panel of Platform Architects from the event platform company, [Cvent](https://www.cvent.com/).
The panel, featuring Youssef Taghlabi, Kevin O'Brien, Josh Lartz, and Ladi Kobiti, dives into their approach to platform engineering—focusing on how they empower teams across their organization and the critical role Nx plays in achieving those goals.
@@ -0,0 +1,47 @@
---
title: New Table Log View on CI with Nx Cloud
slug: improved-ci-log-with-nx-cloud
authors: ['Juri Strumpflohner']
tags: [nx-cloud, release]
cover_image: /blog/images/2024-08/nx-cloud-table-log-output-thumb.jpg
youtubeUrl: https://youtu.be/aacrw0H0m4Q
---
Whenever we talk about Nx Cloud, speed is often a major focus—and for good reason. However, Nx Cloud isn't just about speed. Similar to Nx itself, it's about making work within monorepos more pleasant and efficient. A key part of that is continuously **optimizing developer ergonomics**.
Structuring your log output is one example. In a polyrepo setup, this isn't a big deal since you typically run tasks for a single project. However, in a monorepo setup, you might be running hundreds of tasks in parallel across multiple projects. **Quickly finding a failed task in this context can be challenging.**
## New Table Log View
Today, we released an update that improves how logs are displayed on your CI provider when using Nx Cloud. Instead of streaming all logs directly into your CI provider's pipeline, **we now render a structured table view**. This table shows all tasks, their status (success or failure), timing, and whether they had a cache hit or miss.
![New Table Log View](/blog/images/2024-08/circle-table-log-view.avif)
At the end of the log output, you'll also see aggregated stats about executed tasks, cache hits, and a link to the Nx Cloud dashboard with full details of the run.
![Nx Cloud Dashboard](/blog/images/2024-08/nx-cloud-dashboard-log-view.avif)
## Revert to the Old Behavior
If you prefer the previous log view in your CI, you can opt-out of the new table view. Simply go to your Nx Cloud workspace settings and enable the "Display live terminal outputs in CI pipeline log" option.
![](/blog/images/2024-08/nxcloud-display-live-terminal-output.avif)
## Not Using Nx Cloud Yet?
If you're not on Nx Cloud yet, you can **connect your Nx workspace** by running:
```shell
npx nx connect
```
This command will guide you through the setup. We recently introduced a [new Hobby plan](/pricing), which lets you experiment with all the Nx Cloud features for free. This is a great way to see if it's a good fit for your team.
## Learn More
- [Nx on CI](/ci/intro/ci-with-nx)
- [Task Distribution with Nx Agents](/ci/features/distribute-task-execution)
- [Automated e2e Test Splitting](/ci/features/split-e2e-tasks)
- [X/Twitter](https://twitter.com/nxdevtools) -- [LinkedIn](https://www.linkedin.com/company/nrwl/)
- [Nx Official Discord Server](https://go.nx.dev/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -0,0 +1,10 @@
---
title: How to Fast-Track Your PRs with Trunk.io | Nx Live
slug: nx-live-trunk-io
authors: ['Zack DeRose']
tags: [livestream]
cover_image: /blog/images/2024-08-29/nx-live-trunk.png
youtubeUrl: https://youtube.com/live/E8Gh-Vkxok0
---
In this episode of Nx Live, Zack sits down with David from [Trunk.io](https://trunk.io) to explore hands-on examples of how to fast-track your PRs using Nx and Trunk Merge Queues. They also discuss the latest [first-class support for Nx](https://docs.trunk.io/merge-queue/parallel-queues/nx) recently added to Trunk, demonstrating how these tools can streamline your development workflow.
@@ -0,0 +1,39 @@
---
title: Announcing your Monorepo World Speakers
slug: announcing-your-monorepo-world-speakers
authors: ['Mike Hartington']
tags: [monorepo-world]
cover_image: /blog/images/2024-08-30/mw-blog-post.avif
---
[Monorepo World](https://monorepo.world) is our two-track conference bringing together experts in developer tooling and of course, monorepos. Were thrilled to share some of this year's speakers, including folks from Zephyr Cloud, Atlassian, GitHub, and HeroDevs. Without further ado, lets meet your first round of speakers!
### Hacking Bundlers in Nx
[Lois Zhao](https://x.com/zmzlois), Zephyr Cloud
Want to know how builders work and how they can impact your projects? Lets look at various bundlers and see how they affect the build time and output while also potentially saving organizations millions of dollars.
### What's In Your Dependency Graph
[Josh VanAllen](https://x.com/JVAsays), HeroDevs
Ever ask yourself “why is this build taking so long?” Youre not alone. With monorepos, managing your workspaces dependency graph can make the difference between spending countless hours waiting to see if your simple changes fixes your apps. Learn how to find the hidden bottlenecks in your dependency graphs and make them efficient!
### How To Use Git - The Right Way - For Monorepos
[Scott Arbeit](https://x.com/ScottArbeit), GitHub
We all use git in our day to day, and its great! Until you have to clone a large repository, like potentially a monorepo. Thankfully, there are some tips and tricks you can use to work with large repositories and git that can greatly improve your user experience.
### Atlassian Frontend's Journey To The Monorepo
Manoraj K & Sourav Shaw, Atlassian
Adopting a monorepo for an organization can be a transformative experience. Learn from the folks at Atlassian to hear how they migrated to a monorepo and what strategies they employ to merge multiple repositories into one unified structure.
## Get Your Tickets Today
We hope youre excited to see these amazing sessions! Well have more to share soon about what other speakers you can expect to see at Monorepo world! Dont forget to register and get your ticket before prices go up September 6th 😱!
[Get your tickets today!](https://bit.ly/3YZcb5r)

Some files were not shown because too many files have changed in this diff Show More