Skip to content

Commit 108a573

Browse files
committed
fix(core): remove CRA migration logic from nx init
## Current Behavior `nx init` has a special code path for Create React App (CRA) projects that installs Vite-related dependencies incompatible with `@nx/vite` when Vite 8 is resolved, causing failures for npm workspaces. ## Expected Behavior CRA projects are no longer special-cased in `nx init`. They flow through the normal npm repo path, which detects plugins like `@nx/vite` via the standard `detectPlugins()` mechanism. ## Related Issue(s) Fixes NXC-4107
1 parent 100d4f4 commit 108a573

24 files changed

+14
-805
lines changed

e2e/nx-init/src/files/cra/package.json.txt

Lines changed: 0 additions & 38 deletions
This file was deleted.

e2e/nx-init/src/files/cra/public/index.html.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

e2e/nx-init/src/files/cra/src/App.css.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

e2e/nx-init/src/files/cra/src/App.js.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

e2e/nx-init/src/files/cra/src/App.test.js.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

e2e/nx-init/src/files/cra/src/index.css.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

e2e/nx-init/src/files/cra/src/index.js.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

e2e/nx-init/src/files/cra/src/setupTests.js.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

e2e/nx-init/src/nx-init-react.test.ts

Lines changed: 0 additions & 147 deletions
This file was deleted.

packages/nx/src/command-line/init/command-object.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ async function withInitOptions(yargs: Argv) {
9090
'Initialize an Nx workspace setup in the .nx directory of the current repository.',
9191
default: false,
9292
})
93-
.option('force', {
94-
describe:
95-
'Force the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects.',
96-
type: 'boolean',
97-
default: false,
98-
})
9993
.option('aiAgents', {
10094
type: 'array',
10195
string: true,
@@ -127,13 +121,7 @@ async function withInitOptions(yargs: Argv) {
127121
.option('integrated', {
128122
type: 'boolean',
129123
description:
130-
'Migrate to an Nx integrated layout workspace. Only for Angular CLI workspaces and CRA projects.',
131-
default: false,
132-
})
133-
.option('addE2e', {
134-
describe:
135-
'Set up Cypress E2E tests in integrated workspaces. Only for CRA projects.',
136-
type: 'boolean',
124+
'Migrate to an Nx integrated layout workspace. Only for Angular CLI workspaces.',
137125
default: false,
138126
})
139127
.option('useDotNxInstallation', {
@@ -142,17 +130,6 @@ async function withInitOptions(yargs: Argv) {
142130
'Initialize an Nx workspace setup in the .nx directory of the current repository.',
143131
default: false,
144132
})
145-
.option('force', {
146-
describe:
147-
'Force the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects.',
148-
type: 'boolean',
149-
default: false,
150-
})
151-
.option('vite', {
152-
type: 'boolean',
153-
description: 'Use Vite as the bundler. Only for CRA projects.',
154-
default: true,
155-
})
156133
.option('cacheable', {
157134
type: 'string',
158135
description:

0 commit comments

Comments
 (0)