Skip to content

Commit c47fcab

Browse files
authored
chore: do not override rspack (#154)
1 parent ed5e8c6 commit c47fcab

File tree

10 files changed

+176
-94
lines changed

10 files changed

+176
-94
lines changed

.changeset/old-ducks-invent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rslib/core': patch
3+
---
4+
5+
release

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ Here are the steps to publish (we generally use CI for releases and avoid publis
138138

139139
The project is still in its early stages and under active development, so it possible dependents on Rsbuild or Rspack canary versions to test the latest features. The current versions are:
140140

141-
| Package | Link |
142-
| ------------ | ------------------------------------------------- |
143-
| @rspack/core | https://github.com/web-infra-dev/rspack/pull/7688 |
141+
| Package | Link |
142+
| ------------ | -------------------------------------------------------------------- |
143+
| @rspack/core | [1.0.0](https://github.com/web-infra-dev/rspack/releases/tag/v1.0.0) |

e2e/cases/alias/__snapshots__/index.test.ts.snap

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`source.alias 1`] = `
4-
"// CONCATENATED MODULE: ./src/a.ts
5-
const a = 'hello world';
6-
// CONCATENATED MODULE: ./src/index.ts
4+
"const a = 'hello world';
75
console.info(a);
86
"
97
`;
108

119
exports[`source.alias 2`] = `
12-
"\\"use strict\\";
10+
""use strict";
1311
var __webpack_exports__ = {};
14-
// CONCATENATED MODULE: ./src/a.ts
1512
const a = 'hello world';
16-
// CONCATENATED MODULE: ./src/index.ts
1713
console.info(a);
1814
var __webpack_export_target__ = exports;
1915
for(var i in __webpack_exports__)__webpack_export_target__[i] = __webpack_exports__[i];

e2e/cases/auto-extension/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ describe('should respect output.filename.js to override builtin logic', () => {
4040
const { entryFiles } = await buildAndGetResults(fixturePath);
4141
expect(extname(entryFiles.esm!)).toEqual('.mjs');
4242
expect(entryFiles.cjs).toMatchInlineSnapshot(
43-
`"<ROOT>/e2e/cases/auto-extension/type-commonjs/config-override/dist/cjs/index.19d057b3.js"`,
43+
`"<ROOT>/e2e/cases/auto-extension/type-commonjs/config-override/dist/cjs/index.d08e1bb3.js"`,
4444
);
4545
});
4646

4747
test('type is module', async () => {
4848
const fixturePath = join(__dirname, 'type-module', 'config-override');
4949
const { entryFiles } = await buildAndGetResults(fixturePath);
5050
expect(entryFiles.esm).toMatchInlineSnapshot(
51-
`"<ROOT>/e2e/cases/auto-extension/type-module/config-override/dist/esm/index.40528364.js"`,
51+
`"<ROOT>/e2e/cases/auto-extension/type-module/config-override/dist/esm/index.d2068839.js"`,
5252
);
5353
expect(extname(entryFiles.cjs!)).toEqual('.cjs');
5454
});

e2e/cases/extension-alias/__snapshots__/index.test.ts.snap

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
exports[`resolve.extensionAlias should work 1`] = `
44
"\\"use strict\\";
55
var __webpack_exports__ = {};
6-
// CONCATENATED MODULE: ./src/bar.js
76
const bar = 'bar';
8-
// CONCATENATED MODULE: ./src/foo.ts
97
const foo = 'foo';
8+
// Relative import paths need explicit file extensions in ECMAScript imports
109
// when '--moduleResolution' is 'node16' or 'nodenext'.
1110
console.log(foo + bar);
1211
var __webpack_export_target__ = exports;
@@ -18,10 +17,9 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
1817
`;
1918

2019
exports[`resolve.extensionAlias should work 2`] = `
21-
"// CONCATENATED MODULE: ./src/bar.js
22-
const bar = 'bar';
23-
// CONCATENATED MODULE: ./src/foo.ts
20+
"const bar = 'bar';
2421
const foo = 'foo';
22+
// Relative import paths need explicit file extensions in ECMAScript imports
2523
// when '--moduleResolution' is 'node16' or 'nodenext'.
2624
console.log(foo + bar);
2725
"

e2e/cases/minify/index.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ test('tree shaking is enabled by default, bar and baz should be shaken', async (
66
const fixturePath = join(__dirname, 'default');
77
const { entries } = await buildAndGetResults(fixturePath);
88
expect(entries.esm).toMatchInlineSnapshot(`
9-
"// CONCATENATED MODULE: ./src/index.ts
10-
const foo = ()=>{};
9+
"const foo = ()=>{};
1110
export { foo };
1211
"
1312
`);

e2e/cases/resolve/index.test.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ test('resolve data url', async () => {
88

99
expect(isSuccess).toBeTruthy();
1010
expect(entries.esm).toMatchInlineSnapshot(`
11-
"// CONCATENATED MODULE: data:text/javascript,export default 42
12-
const javascript_export_default_42 = 42;
13-
// CONCATENATED MODULE: ./index.ts
11+
"/* harmony default export */ const javascript_export_default_42 = 42;
1412
console.log('x:', javascript_export_default_42);
1513
"
1614
`);
@@ -32,11 +30,9 @@ test('resolve node protocol', async () => {
3230

3331
expect(isSuccess).toBeTruthy();
3432
expect(entries.esm).toMatchInlineSnapshot(`
35-
"import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from \\"node:path\\";
36-
// CONCATENATED MODULE: external \\"node:path\\"
33+
"import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from "node:path";
3734
var external_node_path_namespaceObject = __WEBPACK_EXTERNAL_MODULE_node_path__;
38-
// CONCATENATED MODULE: ./index.ts
39-
const { join } = external_node_path_namespaceObject[\\"default\\"];
35+
const { join } = external_node_path_namespaceObject["default"];
4036
export { join };
4137
"
4238
`);
@@ -68,9 +64,7 @@ test('resolve with js extensions', async () => {
6864

6965
expect(isSuccess).toBeTruthy();
7066
expect(entries.esm).toMatchInlineSnapshot(`
71-
"// CONCATENATED MODULE: ./example.mts
72-
const value = 1;
73-
// CONCATENATED MODULE: ./index.ts
67+
"const value = 1;
7468
console.log(value);
7569
"
7670
`);
@@ -83,9 +77,7 @@ test('resolve with main fields', async () => {
8377

8478
expect(isSuccess).toBeTruthy();
8579
expect(Object.values(results[0]!)[0]).toMatchInlineSnapshot(`
86-
"// CONCATENATED MODULE: ./node_modules/lib1/src/index.ts
87-
const value = 1;
88-
// CONCATENATED MODULE: ./entry1.ts
80+
"const value = 1;
8981
console.log(value);
9082
"
9183
`);
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`should downgrade class private method by default 1`] = `
4-
"// CONCATENATED MODULE: ../__fixtures__/src/foo.ts
5-
class Foo {
4+
"class Foo {
65
constructor(){
76
this.#bar();
87
}
@@ -13,29 +12,25 @@ export { Foo };
1312
`;
1413

1514
exports[`should downgrade class private method with output.syntax config 1`] = `
16-
"// CONCATENATED MODULE: ../../../../node_modules/<PNPM_INNER>/@swc/helpers/esm/_class_private_method_get.js
17-
function _class_private_method_get(receiver, privateSet, fn) {
15+
"function _class_private_method_get(receiver, privateSet, fn) {
1816
if (!privateSet.has(receiver)) throw new TypeError(\\"attempted to get private field on non-instance\\");
1917
return fn;
2018
}
21-
// CONCATENATED MODULE: ../../../../node_modules/<PNPM_INNER>/@swc/helpers/esm/_check_private_redeclaration.js
2219
function _check_private_redeclaration(obj, privateCollection) {
2320
if (privateCollection.has(obj)) throw new TypeError(\\"Cannot initialize the same private elements twice on an object\\");
2421
}
25-
// CONCATENATED MODULE: ../../../../node_modules/<PNPM_INNER>/@swc/helpers/esm/_class_private_method_init.js
2622
function _class_private_method_init(obj, privateSet) {
2723
_check_private_redeclaration(obj, privateSet);
2824
privateSet.add(obj);
2925
}
30-
// CONCATENATED MODULE: ../__fixtures__/src/foo.ts
3126
var _bar = new WeakSet();
3227
class Foo {
3328
constructor(){
3429
_class_private_method_init(this, _bar);
3530
_class_private_method_get(this, _bar, bar).call(this);
3631
}
3732
}
38-
function bar() {}
33+
function bar() {} /*#__PURE__*/
3934
export { Foo };
4035
"
4136
`;

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,5 @@
5656
"engines": {
5757
"node": ">=18.0.0",
5858
"pnpm": ">=9.0.0"
59-
},
60-
"pnpm": {
61-
"overrides": {
62-
"@rspack/core": "npm:@rspack/[email protected]"
63-
}
6459
}
6560
}

0 commit comments

Comments
 (0)