docs(core): remove outdated documents (#15254)
This commit is contained in:
parent
7aac67c783
commit
814aee56d2
@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "change-storybook-targets",
|
||||
"factory": "./src/generators/change-storybook-targets/change-storybook-targets",
|
||||
"schema": {
|
||||
"$schema": "http://json-schema.org/schema",
|
||||
"$id": "NxAngularChangeStorybookTargetsGenerator",
|
||||
"title": "Change Storybook targets",
|
||||
"description": "Change the Storybook target executors.",
|
||||
"type": "object",
|
||||
"cli": "nx",
|
||||
"properties": {
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files.",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"x-priority": "internal"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"examplesFile": "This generator will change the `storybook` and `build-storybook` targets in all your Angular projects that are configured to use Storybook. The new target configuration will use the native Storybook builders (`@storybook/angular:build-storybook` and `@storybook/angular:start-storybook`) instead of the Nx Storybook builders (`@nrwl/storybook:build-storybook` and `@nrwl/storybook:storybook`).\n\nThis generator is usually invoked through a migrator, when you are using `nx migrate` to upgrade your workspace to Nx `14.1.8` or later.\n\nIf you are on Nx `14.1.8` or later and you did not use `nx migrate`, you can run this generator manually by running the following command:\n\n```bash\nnx g @nrwl/angular:change-storybook-targets\n```\n\nYou can read more about how this generator works, and why we are changing the Storybook targets, in the [Angular Storybook targets documentation page](/packages/storybook/documents/angular-storybook-targets).\n",
|
||||
"presets": []
|
||||
},
|
||||
"description": "Change storybook targets for Angular projects to use @storybook/angular executors",
|
||||
"implementation": "/packages/angular/src/generators/change-storybook-targets/change-storybook-targets.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/packages/angular/src/generators/change-storybook-targets/schema.json",
|
||||
"type": "generator"
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
# Migrating to Cypress V10
|
||||
|
||||
Cypress v10 introduce new features, like component testing, along with some breaking changes.
|
||||
|
||||
Before continuing, make sure you have all your changes committed and have a clean working tree.
|
||||
|
||||
You can migrate an E2E project to v10 by running the following command:
|
||||
|
||||
```shell
|
||||
nx g @nrwl/cypress:migrate-to-cypress-10
|
||||
```
|
||||
|
||||
In general, these are the steps taken to migrate your project:
|
||||
|
||||
1. Migrates your existing `cypress.json` configuration to a new `cypress.config.ts` configuration file.
|
||||
- The `pluginsFile` option has been replaced for `setupNodeEvents`. We will import the file and add it to
|
||||
the `setupNodeEvents` config option. Double-check your plugins are working correctly.
|
||||
2. Rename all test files from `.spec.ts` to `.cy.ts`
|
||||
3. Rename the `support/index.ts` to `support/e2e.ts` and update any associated imports
|
||||
4. Rename the `integrations` folder to the `e2e` folder
|
||||
|
||||
{% callout type="caution" title="Root cypress.json" %}
|
||||
Keeping a root `cypress.json` file, will cause issues with [Cypress trying to load the project](https://github.com/nrwl/nx/issues/11512).
|
||||
Instead, you can create a [root ts file and import it into each project's cypress config file](https://github.com/nrwl/nx/issues/11512#issuecomment-1213420638) to share values across projects.
|
||||
{% /callout %}
|
||||
|
||||
We take the best effort to make this migration seamless, but there can be edge cases we didn't anticipate. So feel free to [open an issue](https://github.com/nrwl/nx/issues/new?assignees=&labels=type%3A+bug&template=1-bug.md) if you come across any problems.
|
||||
|
||||
You can also consult the [official Cypress migration guide](https://docs.cypress.io/guides/references/migration-guide#Migrating-to-Cypress-version-10-0) if you get stuck and want to manually migrate your projects.
|
||||
@ -1,26 +0,0 @@
|
||||
{
|
||||
"name": "migrate-to-cypress-10",
|
||||
"factory": "./src/generators/migrate-to-cypress-ten/migrate-to-cypress-ten#migrateCypressProject",
|
||||
"schema": {
|
||||
"$schema": "http://json-schema.org/schema",
|
||||
"$id": "NxCypressMigrateToTen",
|
||||
"cli": "nx",
|
||||
"title": "Migrate e2e project to Cypress 10",
|
||||
"description": "Migrate Cypress e2e project from v8/v9 to Cypress v10.",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nrwl/cypress:migrate-to-cypress-10",
|
||||
"description": "Migrate existing cypress projects to Cypress v10"
|
||||
}
|
||||
],
|
||||
"properties": {},
|
||||
"presets": []
|
||||
},
|
||||
"description": "Migrate existing Cypress e2e projects to Cypress v10",
|
||||
"hidden": true,
|
||||
"implementation": "/packages/cypress/src/generators/migrate-to-cypress-ten/migrate-to-cypress-ten#migrateCypressProject.ts",
|
||||
"aliases": [],
|
||||
"path": "/packages/cypress/src/generators/migrate-to-cypress-ten/schema.json",
|
||||
"type": "generator"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "change-storybook-targets",
|
||||
"factory": "./src/generators/change-storybook-targets/change-storybook-targets",
|
||||
"schema": {
|
||||
"$schema": "http://json-schema.org/schema",
|
||||
"cli": "nx",
|
||||
"$id": "change-storybook-targets",
|
||||
"title": "Change Storybook targets",
|
||||
"description": "Change the Storybook target executors of Angular projects to use the native Storybook for Angular executor schema.",
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": [],
|
||||
"examplesFile": "---\ntitle: Change Storybook targets generator examples\ndescription: This page contains examples for the @nrwl/storybook:change-storybook-targets generator, targeted to Angular projects set up with Storybook.\n---\n\nThis generator will change the `storybook` and `build-storybook` targets in all your Angular projects that are configured to use Storybook. The new target configuration will use the native Storybook builders (`@storybook/angular:build-storybook` and `@storybook/angular:start-storybook`) instead of the Nx Storybook builders (`@nrwl/storybook:build-storybook` and `@nrwl/storybook:storybook`).\n\nThis generator is usually invoked through a migrator, when you are using `nx migrate` to upgrade your workspace to Nx `14.1.8` or later.\n\nIf you are on Nx `14.1.8` or later and you did not use `nx migrate`, you can run this generator manually by running the following command:\n\n```bash\nnx g @nrwl/storybook:change-storybook-targets\n```\n\nYou can read more about how this generator works, and why we are changing the Storybook targets, in the [Angular Storybook targets documentation page](/packages/storybook/documents/angular-storybook-targets).\n",
|
||||
"presets": []
|
||||
},
|
||||
"description": "Change storybook targets for Angular projects to use @storybook/angular executors",
|
||||
"hidden": false,
|
||||
"implementation": "/packages/storybook/src/generators/change-storybook-targets/change-storybook-targets.ts",
|
||||
"aliases": [],
|
||||
"path": "/packages/storybook/src/generators/change-storybook-targets/schema.json",
|
||||
"type": "generator"
|
||||
}
|
||||
@ -1,113 +0,0 @@
|
||||
# Customize your Webpack Config
|
||||
|
||||
{% callout type="note" title="Webpack Config Setup" %}
|
||||
This guide helps you customize your webpack config - add extra functionality and support for other frameworks or features. To see how you can set up a basic webpack config for Nx, read the [Nx Webpack configuration guide](/packages/webpack/documents/webpack-config-setup).
|
||||
{% /callout %}
|
||||
|
||||
For most apps, the default configuration of webpack is sufficient, but sometimes you need to tweak a setting in your webpack config. This guide explains how to make a small change without taking on the maintenance burden of the entire webpack config.
|
||||
|
||||
## React projects
|
||||
|
||||
React projects use the `@nrwl/react` package to build their apps. This package provides a `withReact` plugin that adds the necessary configuration for React to work with webpack. You can use this plugin to add the necessary configuration to your webpack config.
|
||||
|
||||
```js {% fileName="apps/my-app/webpack.config.js" %}
|
||||
const { composePlugins, withNx } = require('@nrwl/webpack');
|
||||
const { withReact } = require('@nrwl/react');
|
||||
|
||||
// Nx plugins for webpack.
|
||||
module.exports = composePlugins(
|
||||
withNx(),
|
||||
withReact(),
|
||||
(config, { options, context }) => {
|
||||
// Update the webpack config as needed here.
|
||||
// e.g. config.plugins.push(new MyPlugin())
|
||||
return config;
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
## Add a Loader
|
||||
|
||||
To add the `css-loader` to your config, install it and add the rule.
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="yarn" %}
|
||||
|
||||
```shell
|
||||
yarn add -D css-loader
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="npm" %}
|
||||
|
||||
```shell
|
||||
npm install -D css-loader
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
|
||||
```js {% fileName="apps/my-app/webpack.config.js" %}
|
||||
const { composePlugins, withNx } = require('@nrwl/webpack');
|
||||
const { merge } = require('webpack-merge');
|
||||
|
||||
module.exports = composePlugins(withNx(), (config, { options, context }) => {
|
||||
return merge(config, {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ['style-loader', 'css-loader'],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
## Module Federation
|
||||
|
||||
If you use the [Module Federation](/recipes/module-federation/faster-builds) support from `@nrwl/angular` or `@nrwl/react` then
|
||||
you can customize your webpack configuration as follows.
|
||||
|
||||
```js {% fileName="apps/my-app/webpack.config.js" %}
|
||||
const { composePlugins, withNx } = require('@nrwl/webpack');
|
||||
const { merge } = require('webpack-merge');
|
||||
const withModuleFederation = require('@nrwl/react/module-federation');
|
||||
// or `const withModuleFederation = require('@nrwl/angular/module-federation');`
|
||||
|
||||
module.exports = composePlugins(withNx(), (config, { options, context }) => {
|
||||
const federatedModules = await withModuleFederation({
|
||||
// your options here
|
||||
});
|
||||
|
||||
return merge(federatedModules(config, context), {
|
||||
// overwrite values here
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
Reference the [webpack documentation](https://webpack.js.org/configuration/) for details on the structure of the webpack
|
||||
config object.
|
||||
|
||||
## Next.js Applications
|
||||
|
||||
Next.js supports webpack customization in the `next.config.js` file.
|
||||
|
||||
```js {% fileName="next.config.js" %}
|
||||
const { withNx } = require('@nrwl/next/plugins/with-nx');
|
||||
|
||||
const nextConfig = {
|
||||
webpack: (
|
||||
config,
|
||||
{ buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }
|
||||
) => {
|
||||
// Important: return the modified config
|
||||
return config;
|
||||
},
|
||||
};
|
||||
|
||||
return withNx(nextConfig);
|
||||
```
|
||||
|
||||
Read the [official documentation](https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config) for more details.
|
||||
@ -1,42 +0,0 @@
|
||||
{
|
||||
"name": "convert-to-nx-project",
|
||||
"factory": "./src/generators/convert-to-nx-project/convert-to-nx-project#convertToNxProjectGenerator",
|
||||
"schema": {
|
||||
"$schema": "http://json-schema.org/schema",
|
||||
"$id": "SchematicsConvertToNxProject",
|
||||
"title": "Create a custom target to run any command",
|
||||
"description": "Create a custom target to run any command.",
|
||||
"type": "object",
|
||||
"cli": "nx",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nrwl/workspace:convert-to-nx-project --project my-feature-lib",
|
||||
"description": "Convert the `my-feature-lib` project to use `project.json` file instead of `workspace.json`"
|
||||
},
|
||||
{
|
||||
"command": "nx g @nrwl/workspace:convert-to-nx-project --all",
|
||||
"description": "Convert all projects in `workspace.json` to separate `project.json` files"
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"project": { "description": "Project name", "type": "string" },
|
||||
"all": {
|
||||
"description": "Should every project be converted?",
|
||||
"type": "boolean"
|
||||
},
|
||||
"skipFormat": {
|
||||
"description": "Skip formatting files",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"x-priority": "internal"
|
||||
}
|
||||
},
|
||||
"presets": []
|
||||
},
|
||||
"description": "Moves a project's configuration outside of `workspace.json`.",
|
||||
"implementation": "/packages/workspace/src/generators/convert-to-nx-project/convert-to-nx-project#convertToNxProjectGenerator.ts",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/packages/workspace/src/generators/convert-to-nx-project/schema.json",
|
||||
"type": "generator"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user