@nx/rspack 23.0.0-beta.24 → 23.0.0-beta.25

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.
package/migrations.json CHANGED
@@ -1,19 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "update-20-2-0-update-with-module-federation-import": {
4
- "cli": "nx",
5
- "version": "20.2.0-beta.3",
6
- "description": "Update the withModuleFederation import use @nx/module-federation/rspack.",
7
- "factory": "./dist/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package",
8
- "documentation": "./dist/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.md"
9
- },
10
- "ensure-nx-module-federation-package": {
11
- "cli": "nx",
12
- "version": "20.3.0-beta.2",
13
- "description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.",
14
- "factory": "./dist/src/migrations/update-20-3-0/ensure-nx-module-federation-package",
15
- "documentation": "./dist/src/migrations/update-20-3-0/ensure-nx-module-federation-package.md"
16
- },
17
3
  "remove-deprecated-rspack-options": {
18
4
  "cli": "nx",
19
5
  "version": "22.0.0-beta.1",
@@ -35,32 +21,6 @@
35
21
  }
36
22
  },
37
23
  "packageJsonUpdates": {
38
- "20.2.0": {
39
- "version": "20.2.0-beta.7",
40
- "packages": {
41
- "@rspack/core": {
42
- "version": "^1.1.5",
43
- "alwaysAddToPackageJson": false
44
- },
45
- "@rspack/dev-server": {
46
- "version": "^1.0.9",
47
- "alwaysAddToPackageJson": false
48
- }
49
- }
50
- },
51
- "20.5.0": {
52
- "version": "20.5.0-beta.4",
53
- "packages": {
54
- "sass-loader": {
55
- "version": "^16.0.4",
56
- "alwaysAddToPackageJson": false
57
- },
58
- "@rspack/core": {
59
- "version": "^1.2.2",
60
- "alwaysAddToPackageJson": false
61
- }
62
- }
63
- },
64
24
  "21.0.1": {
65
25
  "version": "21.0.1-beta.0",
66
26
  "packages": {
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@nx/rspack",
3
3
  "description": "The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.",
4
- "version": "23.0.0-beta.24",
4
+ "version": "23.0.0-beta.25",
5
5
  "type": "commonjs",
6
6
  "files": [
7
7
  "dist",
8
8
  "!dist/tsconfig.tsbuildinfo",
9
- "!dist/spec",
10
9
  "migrations.json",
11
10
  "executors.json",
12
11
  "generators.json"
@@ -151,16 +150,16 @@
151
150
  "style-loader": "^3.3.0",
152
151
  "ts-checker-rspack-plugin": "^1.1.1",
153
152
  "tslib": "^2.3.0",
154
- "webpack": "^5.101.3",
153
+ "webpack": "5.105.2",
155
154
  "webpack-node-externals": "^3.0.0",
156
- "@nx/devkit": "23.0.0-beta.24",
157
- "@nx/web": "23.0.0-beta.24",
158
- "@nx/module-federation": "23.0.0-beta.24",
159
- "@nx/js": "23.0.0-beta.24"
155
+ "@nx/devkit": "23.0.0-beta.25",
156
+ "@nx/js": "23.0.0-beta.25",
157
+ "@nx/web": "23.0.0-beta.25",
158
+ "@nx/module-federation": "23.0.0-beta.25"
160
159
  },
161
160
  "devDependencies": {
162
- "nx": "23.0.0-beta.24",
163
- "@nx/nest": "23.0.0-beta.24"
161
+ "nx": "23.0.0-beta.25",
162
+ "@nx/nest": "23.0.0-beta.25"
164
163
  },
165
164
  "peerDependencies": {
166
165
  "@rspack/cli": "^1.0.0",
@@ -183,7 +182,8 @@
183
182
  }
184
183
  },
185
184
  "nx-migrations": {
186
- "migrations": "./migrations.json"
185
+ "migrations": "./migrations.json",
186
+ "supportsOptionalUpdates": true
187
187
  },
188
188
  "publishConfig": {
189
189
  "access": "public"
@@ -1,2 +0,0 @@
1
- import { type Tree } from '@nx/devkit';
2
- export default function migrateWithMfImport(tree: Tree): Promise<void>;
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = migrateWithMfImport;
4
- const internal_1 = require("@nx/devkit/internal");
5
- const devkit_1 = require("@nx/devkit");
6
- const tsquery_1 = require("@phenomnomnominal/tsquery");
7
- const versions_1 = require("../../utils/versions");
8
- const NX_RSPACK_MODULE_FEDERATION_IMPORT_SELECTOR = 'ImportDeclaration > StringLiteral[value=@nx/rspack/module-federation], VariableStatement CallExpression:has(Identifier[name=require]) > StringLiteral[value=@nx/rspack/module-federation]';
9
- const NEW_IMPORT_PATH = `'@nx/module-federation/rspack'`;
10
- async function migrateWithMfImport(tree) {
11
- const projects = new Set();
12
- (0, internal_1.forEachExecutorOptions)(tree, '@nx/rspack:module-federation-dev-server', (options, project, target) => {
13
- const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, project);
14
- projects.add(projectConfig.root);
15
- });
16
- for (const projectRoot of projects) {
17
- (0, devkit_1.visitNotIgnoredFiles)(tree, projectRoot, (filePath) => {
18
- if (!filePath.endsWith('.ts') && !filePath.endsWith('.js')) {
19
- return;
20
- }
21
- let contents = tree.read(filePath, 'utf-8');
22
- if (!contents.includes('@nx/rspack/module-federation')) {
23
- return;
24
- }
25
- const sourceFile = (0, tsquery_1.ast)(contents);
26
- const importNodes = (0, tsquery_1.query)(sourceFile, NX_RSPACK_MODULE_FEDERATION_IMPORT_SELECTOR);
27
- if (importNodes.length === 0) {
28
- return;
29
- }
30
- const importPathNode = importNodes[0];
31
- contents = `${contents.slice(0, importPathNode.getStart())}${NEW_IMPORT_PATH}${contents.slice(importPathNode.getEnd())}`;
32
- tree.write(filePath, contents);
33
- });
34
- }
35
- if (projects.size !== 0) {
36
- (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
37
- '@nx/module-federation': versions_1.nxVersion,
38
- });
39
- }
40
- await (0, devkit_1.formatFiles)(tree);
41
- }
@@ -1,25 +0,0 @@
1
- #### Migrate withModuleFederation Import to New Package
2
-
3
- Update the withModuleFederation import to use @nx/module-federation/rspack.
4
-
5
- #### Sample Code Changes
6
-
7
- Update import paths for `withModuleFederation` and `withModuleFederationForSSR`.
8
-
9
- ##### Before
10
-
11
- ```ts title="apps/shell/rspack.config.ts"
12
- import {
13
- withModuleFederation,
14
- withModuleFederationForSSR,
15
- } from '@nx/rspack/module-federation';
16
- ```
17
-
18
- ##### After
19
-
20
- ```ts title="apps/shell/rspack.config.ts"
21
- import {
22
- withModuleFederation,
23
- withModuleFederationForSSR,
24
- } from '@nx/module-federation/rspack';
25
- ```
@@ -1,2 +0,0 @@
1
- import { type Tree } from '@nx/devkit';
2
- export default function ensureMfPackage(tree: Tree): Promise<void>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = ensureMfPackage;
4
- const internal_1 = require("@nx/devkit/internal");
5
- const devkit_1 = require("@nx/devkit");
6
- const versions_1 = require("../../utils/versions");
7
- async function ensureMfPackage(tree) {
8
- const projects = new Set();
9
- (0, internal_1.forEachExecutorOptions)(tree, '@nx/rspack:module-federation-dev-server', (options, project, target) => {
10
- const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, project);
11
- projects.add(projectConfig.root);
12
- });
13
- if (projects.size !== 0) {
14
- (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
15
- '@nx/module-federation': versions_1.nxVersion,
16
- });
17
- }
18
- }
@@ -1,23 +0,0 @@
1
- #### Ensure the @nx/module-federation Package is Installed
2
-
3
- If workspace includes Module Federation projects, ensure the new `@nx/module-federation` package is installed.
4
-
5
- #### Sample Code Changes
6
-
7
- ##### Before
8
-
9
- ```json title="package.json"
10
- {
11
- "dependencies": {}
12
- }
13
- ```
14
-
15
- ##### After
16
-
17
- ```json title="package.json"
18
- {
19
- "dependencies": {
20
- "@nx/module-federation": "20.3.0"
21
- }
22
- }
23
- ```