Files
Jason Jean 4bb6115625 chore(repo)!: migrate remaining packages to local dist build (#35900)
## Current Behavior

The remaining 14 publishable packages still build to the shared
workspace output `dist/packages/<name>` and use `commonjs`/`node` module
resolution. This is the last set of packages on the old layout — `nx`,
`devkit`, `js`, `web`, `node`, `webpack`, etc. were already migrated.

## Expected Behavior

Each of the remaining packages now builds to its own local
`packages/<name>/dist` directory with `nodenext` module resolution and
an `exports` map using the custom `@nx/nx-source` condition (so
in-workspace consumers resolve to source, while published/runtime
consumers resolve to built `./dist`). This matches the already-migrated
packages.

Packages migrated (one commit each):

- **Tier 0:** `@nx/react`, `@nx/esbuild`, `@nx/express`, `@nx/vue`,
`@nx/plugin`, `create-nx-workspace`, `@nx/angular`
- **Tier 1:** `@nx/react-native`, `@nx/next`, `@nx/remix`, `@nx/detox`,
`@nx/expo`, `@nx/nuxt`, `create-nx-plugin`

Notes:

- Kept the `./src/*` wildcard exports (the `@nx/nest` pattern) so no
consumer imports needed editing; the optional `./internal` lockdown is
deferred to a follow-up.
- Converted `ensurePackage` + `await import('@nx/...')` pairs to typed
`require()` (ESM dynamic import ignores `Module._initPaths` under
`nodenext`) and replaced `require('../../package.json')` self-references
with the dynamic `require(join('@nx/<name>', 'package.json'))` form.
- `@nx/angular` keeps its dual build: `tsc` (`build-base`) + ng-packagr
(`build-ng`); `ng-package.json` `dest`, both tsconfig `outDir`s, and the
publish `packageRoot` were relocated to `packages/angular/dist`.
- `create-nx-workspace`/`create-nx-plugin` were missing from the
migration board; tracked as NXC-4515 / NXC-4516.

Validation: `nx run-many -t build,lint` is green across all 14 packages
(including angular's real ng-packagr build and
`@nx/nx-plugin-checks`/`@nx/dependency-checks`). **Still needs CI
validation:** full e2e and the `nx release`/publish path (notably
angular's ng-packagr `packageRoot`).

## Breaking Changes

This is a breaking change because only `/internal` can be imported on packages now rather than importing from `src`. There is a migration to take care of this when necessary though.

## Related Issue(s)

Linear: NXC-3580, NXC-3582, NXC-3583, NXC-3584, NXC-3585, NXC-3587,
NXC-3589, NXC-3590, NXC-3596, NXC-3597, NXC-3600, NXC-3601, NXC-4515,
NXC-4516

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-06-08 17:38:20 -04:00

116 lines
5.0 KiB
JSON

{
"name": "Nx React",
"version": "0.1",
"extends": ["@nx/workspace"],
"generators": {
"init": {
"factory": "./dist/src/generators/init/init#reactInitGenerator",
"schema": "./dist/src/generators/init/schema.json",
"description": "Initialize the `@nx/react` plugin.",
"aliases": ["ng-add"],
"hidden": true
},
"application": {
"factory": "./dist/src/generators/application/application#applicationGeneratorInternal",
"schema": "./dist/src/generators/application/schema.json",
"aliases": ["app"],
"x-type": "application",
"description": "Create a React application."
},
"library": {
"factory": "./dist/src/generators/library/library#libraryGeneratorInternal",
"schema": "./dist/src/generators/library/schema.json",
"aliases": ["lib"],
"x-type": "library",
"description": "Create a React library."
},
"component": {
"factory": "./dist/src/generators/component/component",
"schema": "./dist/src/generators/component/schema.json",
"description": "Create a React component.",
"aliases": ["c"]
},
"redux": {
"factory": "./dist/src/generators/redux/redux",
"schema": "./dist/src/generators/redux/schema.json",
"description": "Create a Redux slice for a project.",
"aliases": ["slice"]
},
"storybook-configuration": {
"factory": "./dist/src/generators/storybook-configuration/configuration#storybookConfigurationGeneratorInternal",
"schema": "./dist/src/generators/storybook-configuration/schema.json",
"description": "Set up storybook for a React app or library.",
"hidden": false
},
"component-story": {
"factory": "./dist/src/generators/component-story/component-story#componentStoryGenerator",
"schema": "./dist/src/generators/component-story/schema.json",
"description": "Generate storybook story for a React component",
"hidden": false
},
"stories": {
"factory": "./dist/src/generators/stories/stories#storiesGenerator",
"schema": "./dist/src/generators/stories/schema.json",
"description": "Create stories/specs for all components declared in an app or library.",
"hidden": false
},
"hook": {
"factory": "./dist/src/generators/hook/hook",
"schema": "./dist/src/generators/hook/schema.json",
"description": "Create a hook.",
"aliases": ["c"]
},
"host": {
"factory": "./dist/src/generators/host/host",
"schema": "./dist/src/generators/host/schema.json",
"x-type": "application",
"description": "Generate a host react application",
"x-deprecated": "Use `@nx/react:consumer` instead (dynamic federation, no static-serve orchestration). Removed in Nx v24."
},
"remote": {
"factory": "./dist/src/generators/remote/remote",
"schema": "./dist/src/generators/remote/schema.json",
"x-type": "application",
"description": "Generate a remote react application",
"x-deprecated": "Use `@nx/react:provider` instead. Removed in Nx v24."
},
"consumer": {
"factory": "./dist/src/generators/consumer/consumer",
"schema": "./dist/src/generators/consumer/schema.json",
"x-type": "application",
"description": "Create a React Module Federation consumer that loads federated components dynamically via an inline PROVIDERS list in src/mf.ts. Supports Vite (default), Rsbuild, and Rspack."
},
"provider": {
"factory": "./dist/src/generators/provider/provider",
"schema": "./dist/src/generators/provider/schema.json",
"x-type": "application",
"description": "Create a React Module Federation provider that exposes a federated component. Supports Vite (default), Rsbuild, and Rspack."
},
"cypress-component-configuration": {
"factory": "./dist/src/generators/cypress-component-configuration/cypress-component-configuration#cypressComponentConfigGenerator",
"schema": "./dist/src/generators/cypress-component-configuration/schema.json",
"description": "Setup Cypress component testing for a React project",
"hidden": false
},
"component-test": {
"factory": "./dist/src/generators/component-test/component-test#componentTestGenerator",
"schema": "./dist/src/generators/component-test/schema.json",
"description": "Generate a Cypress component test for a React component",
"hidden": false
},
"setup-ssr": {
"factory": "./dist/src/generators/setup-ssr/setup-ssr#setupSsrGenerator",
"schema": "./dist/src/generators/setup-ssr/schema.json",
"description": "Set up SSR configuration for a project.",
"hidden": false
},
"federate-module": {
"factory": "./dist/src/generators/federate-module/federate-module#federateModuleGenerator",
"schema": "./dist/src/generators/federate-module/schema.json",
"description": "Federate a module.",
"hidden": false,
"x-deprecated": "The new `@nx/react:provider` generator exposes modules directly. Removed in Nx v24."
}
}
}