12324 Commits

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