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.
199 lines
2.9 KiB
Markdown
199 lines
2.9 KiB
Markdown
---
|
|
title: 'create-nx-workspace - CLI command'
|
|
description: 'Create a new Nx workspace'
|
|
---
|
|
|
|
# create-nx-workspace
|
|
|
|
Create a new Nx workspace
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
create-nx-workspace [name] [options]
|
|
```
|
|
|
|
Install `create-nx-workspace` globally to invoke the command directly, or use `npx create-nx-workspace`, `yarn create nx-workspace`, or `pnpx create-nx-workspace`.
|
|
|
|
## Options
|
|
|
|
### allPrompts
|
|
|
|
Type: `boolean`
|
|
|
|
Default: `false`
|
|
|
|
Show all prompts
|
|
|
|
### appName
|
|
|
|
Type: `string`
|
|
|
|
The name of the app when using a monorepo with certain stacks
|
|
|
|
### bundler
|
|
|
|
Type: `string`
|
|
|
|
Bundler to be used to build the app
|
|
|
|
### commit.email
|
|
|
|
Type: `string`
|
|
|
|
E-mail of the committer
|
|
|
|
### commit.message
|
|
|
|
Type: `string`
|
|
|
|
Default: `Initial commit`
|
|
|
|
Commit message
|
|
|
|
### commit.name
|
|
|
|
Type: `string`
|
|
|
|
Name of the committer
|
|
|
|
### defaultBase
|
|
|
|
Type: `string`
|
|
|
|
Default: `main`
|
|
|
|
Default base to use for new projects
|
|
|
|
### docker
|
|
|
|
Type: `boolean`
|
|
|
|
Generate a Dockerfile for the Node API
|
|
|
|
### e2eTestRunner
|
|
|
|
Type: `string`
|
|
|
|
Choices: [playwright, cypress, none]
|
|
|
|
Test runner to use for end to end (E2E) tests.
|
|
|
|
### framework
|
|
|
|
Type: `string`
|
|
|
|
Framework option to be used with certain stacks
|
|
|
|
### help
|
|
|
|
Type: `boolean`
|
|
|
|
Show help
|
|
|
|
### interactive
|
|
|
|
Type: `boolean`
|
|
|
|
Default: `true`
|
|
|
|
Enable interactive mode with presets
|
|
|
|
### name
|
|
|
|
Type: `string`
|
|
|
|
Workspace name (e.g. org name)
|
|
|
|
### nextAppDir
|
|
|
|
Type: `boolean`
|
|
|
|
Enable the App Router for Next.js
|
|
|
|
### nextSrcDir
|
|
|
|
Type: `boolean`
|
|
|
|
Generate a 'src/' directory for Next.js
|
|
|
|
### nxCloud
|
|
|
|
Type: `string`
|
|
|
|
Choices: [yes, github, circleci, skip]
|
|
|
|
Do you want Nx Cloud to make your CI fast?
|
|
|
|
### packageManager
|
|
|
|
Type: `string`
|
|
|
|
Choices: [npm, pnpm, yarn]
|
|
|
|
Default: `npm`
|
|
|
|
Package manager to use
|
|
|
|
### prefix
|
|
|
|
Type: `string`
|
|
|
|
Prefix to use for Angular component and directive selectors.
|
|
|
|
### preset
|
|
|
|
Type: `string`
|
|
|
|
Customizes the initial content of your workspace. Default presets include: ["apps", "npm", "ts", "web-components", "angular-monorepo", "angular-standalone", "react-monorepo", "react-standalone", "vue-monorepo", "vue-standalone", "nuxt", "nuxt-standalone", "next", "nextjs-standalone", "remix-monorepo", "remix-standalone", "react-native", "expo", "nest", "express", "react", "vue", "angular", "node-standalone", "node-monorepo", "ts-standalone"]. To build your own see https://nx.dev/extending-nx/recipes/create-preset
|
|
|
|
### routing
|
|
|
|
Type: `boolean`
|
|
|
|
Default: `true`
|
|
|
|
Add a routing setup for an Angular app
|
|
|
|
### skipGit
|
|
|
|
Type: `boolean`
|
|
|
|
Default: `false`
|
|
|
|
Skip initializing a git repository
|
|
|
|
### ssr
|
|
|
|
Type: `boolean`
|
|
|
|
Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application
|
|
|
|
### standaloneApi
|
|
|
|
Type: `boolean`
|
|
|
|
Default: `true`
|
|
|
|
Use Standalone Components if generating an Angular app
|
|
|
|
### style
|
|
|
|
Type: `string`
|
|
|
|
Stylesheet type to be used with certain stacks
|
|
|
|
### version
|
|
|
|
Type: `boolean`
|
|
|
|
Show version number
|
|
|
|
### workspaceType
|
|
|
|
Type: `string`
|
|
|
|
Choices: [integrated, package-based, standalone]
|
|
|
|
The type of workspace to create
|