Skip to content

Commit 9ac941d

Browse files
jaysooFrozenPandaz
authored andcommitted
fix(core): remove CRA migration logic from nx init (#34912)
## 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. CRA is essentially unused for years so there's no point to keep it around. ## 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. <img width="1279" height="448" alt="Screenshot 2026-03-18 at 2 34 56 PM" src="https://github.com/user-attachments/assets/17da3c6d-8aef-450f-baaa-6014e03cf41f" /> <img width="1280" height="432" alt="Screenshot 2026-03-18 at 2 35 01 PM" src="https://github.com/user-attachments/assets/e02ccda5-9faf-428f-878d-348e4cc44d74" /> <img width="1270" height="821" alt="Screenshot 2026-03-18 at 2 35 15 PM" src="https://github.com/user-attachments/assets/fdd99af5-db7e-422b-be42-a817c9dcefa2" /> ## Related Issue(s) Closes NXC-4107
1 parent 6d40e9b commit 9ac941d

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)