87 Commits

Author SHA1 Message Date
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
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
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
Craigory Coppola
6f223005b8
fix(misc): ensure plugins are not creating workspace context while creating nodes (#26253) 2024-05-31 18:54:56 -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
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
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
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
James Henry
8cfc0a0c08
fix(linter): support eslint v9 (#24632) 2024-05-22 19:27:06 +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
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
Denis Bendrikov
1ef6f27aba
fix(linter): log transpilation errors of workspace rules (#21503) 2024-05-11 14:55:08 +04: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
Jack Hsu
2e621f324c
feat(misc): v19 cleanup for Nx plugins (#23104)
This PR removes deprecated code that's been slated for removal in Nx 19
- mentioned as `TODO(v19)` comments.

## Breaking Changes

- **CNW:** `create-nx-workspace` no longer support `--preset=empty` and
`--preset=core`, use `--preset=apps` and `--preset=npm` respectively.
Deprecated in Nx 15.9.
- **Next.js:** `NX_` environment variables are no longer bundled into
Next.js apps, use `NEXT_PUBLIC` instead. Deprecated in Nx 16.8.
- **Webpack, Storybook, Esbuild:** `NX_` environment variables are no
longer bundled into browser bundles, use `NX_PUBLIC` instead. This
removes the possibility of intentional bundling of `NX_` variables.
Deprecated in Nx 18.
- **Cypress:** `cypressComponentConfiguration` generator removed from
`@nx/cypress`, use `configurationGenerator`instead. Deprecated in Nx
16.8.
- **Cypress:** `cypressProjectGenerator` generator removed from
`@nx/cypress`, use `configurationGenerator` instead. Deprecated in Nx
15.9.
- **Expo:** `withNxWebpack` removed from `@nx/expo`, use [metro
bundler](https://docs.expo.dev/guides/customizing-metro/)
(https://docs.expo.dev/guides/customizing-metro/) in app.json instead.
There is a migration to handle this in Nx 19. Deprecated in Nx 15.8.

## Deferred to v20

- **JS:** `classProperties.loose` option removed from `@nx/js/babel`
preset, use `loose` instead. Deprecated in Nx 17.0.
- **ESLint:** Low priority task to "deviations from
@typescript-eslint/recommended" for our lint rules. @JamesHenry will
look at this later before Nx 20, but it is unimportant.
- **React:** component testing does not work with Project Crystal, and
we need the executor + built-in webpack configs to run CT. Will do a
follow-up on this after Nx 19 release. Related issue:
https://github.com/nrwl/nx/issues/21546
- **Next.js:** `withStylus` removal from `@nx/next`, use SASS instead.
It hasn't worked, but we kept the file to throw an error when used.
Deprecated in Nx 17.0.
- **Next.js**: `@nx/next:component` and `@nx/next:page` generators to
not derive the `components` and `app`/`pages` directory. Use `nx g
@nx/next:component apps/myapp/components/button` instead. Deprecated in
Nx 17.0.
- **Webpack:** `isolatedConfig` option removal from
`@nx/webpack:webpack` executor. There is a migration to handle this in
Nx 19. Deprecated in in Nx 17.2.
- **Angular:** `executeWebpackDevServerBuilder` removal from
`@nx/angular/executors`, use `executeDevServerBuilder` instead.
Deprecated in Nx 17.0.
2024-05-02 13:37:12 -04:00
Jack Hsu
bc43243498
chore(repo): add eslint and jest plugins to use inferred targets (#22946) 2024-04-23 21:52:13 -04:00
Leosvel Pérez Espinosa
8baddb5f08
feat(angular): support angular 17.3.0 (#22202) 2024-03-19 14:58:23 -04:00
Leosvel Pérez Espinosa
4850bdb6aa fix(nx-plugin): support root tsconfig.json in nx-plugin-checks eslint rule 2024-03-11 16:43:02 +01:00
Victor Login
91944484fe
fix(linter): add v7 of typescript-eslint to peerDeps (#21853)
Co-authored-by: “JamesHenry” <james@henry.sc>
2024-03-06 14:05:37 +00:00
Miroslav Jonaš
ce933132d0
cleanup(linter): refactor code for dynamic/static imports check (#20897) 2024-02-25 20:59:51 +04:00
Leosvel Pérez Espinosa
26ce6f6f64
fix(linter): fix eslint-plugin migration target version (#21966) 2024-02-23 16:19:07 +04:00
Miroslav Jonaš
f79aabba46
fix(linter): adjust terminal run check for crystal (#21638) 2024-02-06 15:32:54 +01:00
Miroslav Jonaš
a0ae902e4e
fix(linter): prevent dep-checks leaking when used outside nx (#21404) 2024-02-02 14:22:52 +01:00
Jack Hsu
f6d2dccd62
feat(linter): add option for @nx/dependency-checks to update workspace dependencies using local file paths (#20157)
Co-authored-by: Miroslav Jonaš <missing.manual@gmail.com>
2024-02-02 14:51:49 +02:00
Lukas
857a07d87d
fix(misc): use caret for semver version (#18140) 2024-01-31 19:48:38 +02:00
James Henry
c286a6e799
fix(linter): restore rules to match previous @typescript-eslint/recommended (#21424) 2024-01-30 20:56:56 +04:00
Miloš Lajtman
bb3cf3a862
fix(linter): remove extend of @angular-eslint/recommended--extra config (#18465) 2024-01-30 00:18:09 +01:00
Miroslav Jonaš
4700df62be
fix(linter): update eslint plugins for @typescript-eslint v6 naming (#21221)
Co-authored-by: Steven Rathbauer <gh.rathpc@gmail.com>
Co-authored-by: James Henry <james@henry.sc>
2024-01-19 14:16:18 +04:00
Miroslav Jonaš
cbcd2ecddc
fix(linter): fix import of chalk for reporting (#21201) 2024-01-18 15:23:25 +01:00
Miroslav Jonaš
c452a1f7c5
fix(linter): add links to docs to rules (#21199) 2024-01-18 14:47:10 +01:00
Miroslav Jonaš
3981c90fe8
fix(linter): ensure angular entry point checks are correct (#20859) 2023-12-20 18:16:58 +01:00
Miroslav Jonaš
d8beed9874
fix(linter): fix workspace-rule naming with flat config (#20782) 2023-12-15 16:00:50 +01:00
Leosvel Pérez Espinosa
593ea3d90d
feat(linter): update @typescript-eslint/* package versions (#20602) 2023-12-13 16:49:27 +01:00
Benjamin Cabanes
db77ddef8a
chore(repo): update packages readme banner (#20695) 2023-12-11 11:32:42 -05:00
Benjamin Cabanes
5a305d41de
feat(nx-dev): add homepage updates (#20592)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2023-12-08 14:40:42 -05:00
Miroslav Jonaš
7e5c4598a3
fix(linter): do not allow relative import of non-project files (#20563) 2023-12-05 16:33:14 +01:00
Miroslav Jonaš
98883bba7a
fix(linter): fix missing dependencies fixer reducer (#20410) 2023-11-25 23:45:46 +01:00
Craigory Coppola
30d94f76ee
cleanup(core): remove async flag from signature of buildProjectsConfigurationsFromProjectPathsAndPlugins (#20228) 2023-11-17 15:31:03 -05:00
Miroslav Jonaš
630e750c06
cleanup(linter): remove unused imports (#20053) 2023-11-08 16:15:41 +04:00
JounQin
b2868657a6
fix(linter): catch lstatSync issues on ast utils (#19749) 2023-11-06 09:38:04 +01:00
Jason Jean
32ff9c80b1
fix(linter): fix update to using module node16 (#20004) 2023-11-02 14:52:44 -04:00
Miroslav Jonaš
79c9233553
feat(linter): update typescript-eslint to v6 (#19548)
Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2023-11-02 10:09:40 +01:00
Miroslav Jonaš
752518ad5f
fix(linter): remove consistent-type-assertions rule from config (#19549) 2023-10-13 14:27:45 +02:00
Rik Smale
89ab1c934b
feat(linter): update eslint-config-prettier to v9 (#19232) 2023-10-12 16:02:59 +02:00
Miroslav Jonaš
e49ce56977
fix(linter): fix validateDependenciesSectionExistance fixer (#19512) 2023-10-09 23:04:53 +02:00
Craigory Coppola
6946f65059
fix(misc): pass full path to tsconfig when registering transpiler (#19451) 2023-10-06 14:40:15 -04:00
Craigory Coppola
6c37113fc4
fix(linter): add schema for nx plugin checks rule (#19447) 2023-10-04 13:59:13 -04:00
Miroslav Jonaš
bf7e663168
feat(linter): add app import exception for remotes (#19301) 2023-09-28 00:25:11 +00:00
Miroslav Jonaš
e650ccff68
fix(linter): fix rule typings (#19294) 2023-09-27 15:06:15 -04:00
Jason Jean
5cc87bfdc2
fix(misc): properly add extra dependencies to packages (#19334) 2023-09-26 00:09:29 -04:00
Craigory Coppola
f213976281
feat(core): include non-project files on fileMap and filesToProcess (#19217) 2023-09-19 21:46:01 -04:00