Skip to content

Commit a3a788b

Browse files
authored
chore: reuse CHAIN_ID from Rsbuild (#5410)
1 parent e1199b8 commit a3a788b

File tree

11 files changed

+15
-244
lines changed

11 files changed

+15
-244
lines changed

.pnpmfile.cjs

+2-10
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ function readPackage(pkg, _context) {
1414

1515
// Some packages still depend on esbuild < 0.17, so we upgrade it manually.
1616
// ref: https://github.com/lukeed/tsm/issues/48
17-
if (
18-
pkg.name === 'tsm' ||
19-
pkg.name === 'vite' ||
20-
pkg.name === 'esbuild-loader'
21-
) {
17+
if (pkg.name === 'tsm' || pkg.name === 'vite') {
2218
pkg.dependencies.esbuild = '0.17.19';
2319
}
2420

@@ -38,17 +34,13 @@ function readPackage(pkg, _context) {
3834
}
3935
}
4036

41-
const outsideModernPkgList = ['@modern-js/mdx-rs-binding'];
42-
4337
if (
4438
(pkg.name?.startsWith('@rspress/') || pkg.name?.startsWith('rspress')) &&
4539
pkg.dependencies
4640
) {
4741
pkg.dependencies = Object.fromEntries(
4842
Object.entries(pkg.dependencies).map(([key, value]) =>
49-
key.startsWith('@modern-js/') && !outsideModernPkgList.includes(key)
50-
? [key, 'workspace:*']
51-
: [key, value],
43+
key.startsWith('@modern-js/') ? [key, 'workspace:*'] : [key, value],
5244
),
5345
);
5446
}

package.json

+1-20
Original file line numberDiff line numberDiff line change
@@ -100,38 +100,19 @@
100100
}
101101
},
102102
"allowedDeprecatedVersions": {
103-
"@babel/plugin-proposal-class-properties": "7.18.6",
104-
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
105103
"@babel/plugin-proposal-object-rest-spread": "7.12.1 || 7.20.7",
106-
"@babel/plugin-proposal-optional-chaining": "7.21.0",
107-
"@babel/plugin-proposal-private-methods": "7.18.6",
108104
"@babel/plugin-proposal-private-property-in-object": "7.21.0",
109105
"@financial-times/polyfill-useragent-normaliser": "1.10.2",
110-
"core-js": "2.6.11",
111106
"formidable": "1.2.6",
112-
"hast": "1.0.0",
113107
"sourcemap-codec": "1.4.8",
114-
"uuid-browser": "3.1.0",
115-
"stable": "0.1.8",
116108
"js-polyfills": "0.1.43",
117109
"picturefill": "3.0.3",
118-
"string-similarity": "4.0.4",
119110
"querystring": "0.2.0",
111+
"string-similarity": "4.0.4",
120112
"source-map-resolve": "0.6.0 || 0.5.3",
121113
"@formatjs/intl-utils": "3.8.4",
122114
"debug": "4.1.1",
123-
"sane": "4.1.0",
124-
"mkdirp": "0.3.5",
125-
"@npmcli/move-file": "1.1.2",
126115
"uuid": "3.4.0",
127-
"chokidar": "2.1.8",
128-
"consolidate": "0.15.1",
129-
"fsevents": "1.2.13",
130-
"source-map-url": "0.4.1",
131-
"urix": "0.1.0",
132-
"resolve-url": "0.2.1",
133-
"superagent": "6.1.0",
134-
"@types/sass": "1.45.0",
135116
"trim": "0.0.1"
136117
}
137118
}

packages/cli/plugin-bff/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"@swc/helpers": "0.5.3"
7171
},
7272
"devDependencies": {
73+
"@rsbuild/shared": "0.4.3",
7374
"@modern-js/runtime": "workspace:*",
7475
"@modern-js/core": "workspace:*",
7576
"@modern-js/bff-runtime": "workspace:*",

packages/cli/plugin-bff/tests/cli.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
ResolvedConfigContext,
99
} from '@modern-js/core';
1010
import Chain from '@modern-js/utils/webpack-chain';
11-
import { CHAIN_ID } from '@modern-js/utils';
11+
import { CHAIN_ID } from '@rsbuild/shared';
1212
import type { AppToolsHooks } from '@modern-js/app-tools';
1313
import plugin from '../src/cli';
1414
import './helper';

packages/runtime/plugin-garfish/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"react-dom": ">=17"
8787
},
8888
"devDependencies": {
89+
"@rsbuild/shared": "0.4.3",
8990
"@modern-js/app-tools": "workspace:*",
9091
"@modern-js/core": "workspace:*",
9192
"@modern-js/plugin-router-v5": "workspace:*",

packages/runtime/plugin-garfish/tests/cli.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import '@testing-library/jest-dom';
22
import { manager, CliPlugin } from '@modern-js/core';
33
import WebpackChain from '@modern-js/utils/webpack-chain';
4-
import { CHAIN_ID } from '@modern-js/utils';
4+
import { CHAIN_ID } from '@rsbuild/shared';
55
import type { AppUserConfig } from '@modern-js/app-tools';
66
import { garfishPlugin, externals } from '../src/cli';
77
import type { UseConfig } from '../src/cli';

packages/storybook/builder/src/docgen/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Options } from '@storybook/types';
2-
import { CHAIN_ID, logger } from '@modern-js/utils';
2+
import { logger } from '@modern-js/utils';
3+
import { CHAIN_ID } from '@rsbuild/shared';
34
import type { RspackConfig, WebpackChain } from '@rsbuild/shared';
45

56
export type DocgenOptions = {

packages/toolkit/utils/src/cli/constants/index.ts packages/toolkit/utils/src/cli/constants.ts

-2
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,3 @@ export const INTERNAL_SERVER_PLUGINS: InternalPlugins = {
174174
[SERVER_PLUGIN_SERVER]: '@modern-js/plugin-server/server',
175175
[SERVER_PLUGIN_POLYFILL]: '@modern-js/plugin-polyfill/server',
176176
};
177-
178-
export * from './chainId';

packages/toolkit/utils/src/cli/constants/chainId.ts

-201
This file was deleted.

pnpm-lock.yaml

+6-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/prebundle/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
"tsconfig-paths": "4.1.1",
9191
"upath": "2.0.1",
9292
"url-join": "4.0.1",
93-
"v8-compile-cache": "2.3.0",
9493
"webpack-chain": "npm:[email protected]"
9594
}
9695
}

0 commit comments

Comments
 (0)