@nx/devkit 23.0.0-beta.17 → 23.0.0-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,6 +60,8 @@ exports.DEVKIT_INTERNAL_SYMBOLS = new Set([
60
60
  'capitalize',
61
61
  'classify',
62
62
  'dasherize',
63
+ 'emitPluginWorkerLog',
64
+ 'throwForUnsupportedVersion',
63
65
  ]);
64
66
  // Methods on `jest` and `vi` that take a module specifier as their first
65
67
  // argument. Calls like `jest.mock('@nx/devkit/src/...')` are rewritten so the
@@ -0,0 +1,43 @@
1
+ #### Update `@nx/devkit` deep imports
2
+
3
+ `@nx/devkit` now ships a strict `exports` map, so deep imports like `@nx/devkit/src/utils/...` and `@nx/devkit/src/generators/...` are no longer reachable through Node module resolution.
4
+
5
+ This migration scans every `.ts`, `.tsx`, `.cts`, and `.mts` file in your workspace and rewrites those deep imports to one of the supported entry points:
6
+
7
+ - Symbols that are part of the stable `@nx/devkit` public API are routed to `@nx/devkit`.
8
+ - Symbols that were previously only reachable through deep imports are routed to `@nx/devkit/internal`.
9
+
10
+ After rewriting, the migration **collapses duplicate imports** so a file never ends up with two `import ... from '@nx/devkit'` (or `@nx/devkit/internal`) lines — including merging into any matching import you already had.
11
+
12
+ #### Sample Code Changes
13
+
14
+ ##### Before
15
+
16
+ ```ts
17
+ import { Tree } from '@nx/devkit';
18
+ import { dasherize, names } from '@nx/devkit/src/utils/string-utils';
19
+ import { addPlugin } from '@nx/devkit/src/utils/add-plugin';
20
+ ```
21
+
22
+ ##### After
23
+
24
+ ```ts
25
+ import { Tree, names } from '@nx/devkit';
26
+ import { dasherize, addPlugin } from '@nx/devkit/internal';
27
+ ```
28
+
29
+ `names` was already in the public API, so it joins the existing `@nx/devkit` import. `dasherize` and `addPlugin` move to `@nx/devkit/internal`, and the two `/internal` imports are collapsed into one.
30
+
31
+ #### Fallback for non-named imports
32
+
33
+ For deep-import shapes that can't be split by symbol — default imports, namespace imports, side-effect imports, `require(...)` calls, dynamic `import(...)`, and `jest.mock(...)` / `vi.mock(...)`-style mock-helper calls — the migration rewrites the specifier to `@nx/devkit/internal` as a best guess, since most symbols that previously lived under `@nx/devkit/src/...` ended up there.
34
+
35
+ ```ts
36
+ // Before
37
+ const { dasherize } = require('@nx/devkit/src/utils/string-utils');
38
+
39
+ // After
40
+ const { dasherize } = require('@nx/devkit/internal');
41
+ ```
42
+
43
+ If the symbol you're after is part of the stable public API instead, the rewritten import will fail to resolve against `@nx/devkit/internal` — switch it to `@nx/devkit` by hand. The migration also leaves `typeof import('@nx/devkit/src/...')` type queries and any deep-import strings inside template literals or comments untouched, so you'll need to update those by hand.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/devkit",
3
- "version": "23.0.0-beta.17",
3
+ "version": "23.0.0-beta.18",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "jest": "30.3.0",
63
- "nx": "23.0.0-beta.17"
63
+ "nx": "23.0.0-beta.18"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "nx": ">= 22 <= 24 || ^23.0.0-0"