Skip to content

Commit

Permalink
fix(rspack): align @rspack/core versions (#29199)
Browse files Browse the repository at this point in the history
Align rspack versions amongst packages and update useLegacyNxPlugin
helper to match new API changes
  • Loading branch information
Coly010 authored Dec 4, 2024
1 parent 6c5916a commit 7157e7a
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 100 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-url": "^8.0.2",
"@rspack/core": "1.1.3",
"@rspack/core": "^1.1.5",
"@rspack/dev-server": "1.0.9",
"@rspack/plugin-minify": "^0.7.5",
"@rspack/plugin-react-refresh": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/module-federation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@nx/web": "file:../web",
"picocolors": "^1.1.0",
"webpack": "5.88.0",
"@rspack/core": "1.1.3",
"@rspack/core": "^1.1.5",
"@module-federation/enhanced": "0.7.6",
"@module-federation/node": "2.6.11",
"@module-federation/sdk": "0.7.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
}
},
"20.2.0": {
"version": "20.2.0-beta.3",
"version": "20.2.0-beta.7",
"packages": {
"@rspack/core": {
"version": "^1.1.2",
"version": "^1.1.5",
"alwaysAddToPackageJson": false
},
"@rspack/dev-server": {
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@nx/web": "file:../web",
"@nx/module-federation": "file:../module-federation",
"@phenomnomnominal/tsquery": "~5.0.1",
"@rspack/core": "^1.1.2",
"@rspack/core": "^1.1.5",
"@rspack/dev-server": "^1.0.9",
"@rspack/plugin-react-refresh": "^1.0.0",
"autoprefixer": "^10.4.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import {
} from '@nx/devkit';
import type { NxRspackExecutionContext } from '../../utils/config';
import type { NxAppRspackPluginOptions } from '../utils/models';
import type { Compiler, Configuration } from '@rspack/core';
import type {
Compiler,
Configuration,
RspackOptionsNormalized,
} from '@rspack/core';
import { normalizeOptions } from '../utils/plugins/normalize-options';
import { readNxJson } from 'nx/src/config/configuration';

Expand Down Expand Up @@ -37,9 +41,9 @@ import { readNxJson } from 'nx/src/config/configuration';
*/
export async function useLegacyNxPlugin(
fn: (
config: Configuration,
config: RspackOptionsNormalized,
ctx: NxRspackExecutionContext
) => Promise<Configuration>,
) => Promise<RspackOptionsNormalized>,
executorOptions: NxAppRspackPluginOptions
) {
if (global.NX_GRAPH_CREATION) {
Expand Down Expand Up @@ -75,7 +79,7 @@ export async function useLegacyNxPlugin(
apply(compiler: Compiler) {
compiler.hooks.beforeCompile.tapPromise('NxLegacyAsyncPlugin', () => {
return new Promise<void>((resolve) => {
fn(compiler.options as Configuration, ctx).then((updated) => {
fn(compiler.options, ctx).then((updated) => {
// Merge options back shallowly since it's a fully functional configuration.
// Most likely, the user modified the config in place, but this guarantees that updates are applied if users did something like:
// `return { ...config, plugins: [...config.plugins, new MyPlugin()] }`
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const nxVersion = require('../../package.json').version;
export const rspackCoreVersion = '1.1.2';
export const rspackCoreVersion = '^1.1.5';
export const rspackDevServerVersion = '1.0.9';

export const rspackPluginMinifyVersion = '^0.7.5';
Expand Down
180 changes: 90 additions & 90 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 7157e7a

Please sign in to comment.