- 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
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.
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 #
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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/

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
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` -->
## 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
…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 #
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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>
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 #
## 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.
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>
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/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 is using Nx `19.0.0-beta.8`
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This repo is using Nx `19.0.0-beta.11`
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
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.