Skip to content

Commit f53855d

Browse files
committed
feat(core): replace esbuild with rolldown for mutator bundling
1 parent ac14578 commit f53855d

13 files changed

Lines changed: 262 additions & 448 deletions

File tree

bun.lock

Lines changed: 92 additions & 414 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
"acorn": "^8.15.0",
2828
"compare-versions": "^6.1.1",
2929
"debug": "^4.4.3",
30-
"esbuild": "^0.28.0",
3130
"esutils": "2.0.3",
3231
"fs-extra": "^11.3.2",
3332
"jiti": "^2.6.1",
3433
"remeda": "^2.33.6",
34+
"rolldown": "^1.0.0",
3535
"tinyglobby": "^0.2.16",
3636
"typedoc": "^0.28.19"
3737
},
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@mutator-alias';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module '@mutator-alias' {
2+
export { default } from '../default-anonymous-function-2-args';
3+
}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-unused-vars */
22
// Regression fixture for https://github.com/orval-labs/orval/issues/3402:
3-
// a default export whose initializer is a CallExpression. esbuild lowers
4-
// `export default <expr>` into a variable declarator + named-export
5-
// specifier, so this exercises the same code path as the named-export
6-
// variant.
3+
// a default export whose initializer is a CallExpression. Bundled output can
4+
// lower `export default <expr>` into a variable declarator + named-export
5+
// specifier, so this exercises the same code path as the named-export variant.
76
const make = (cfg: object) => (req: object) => Promise.resolve(req);
87
export default make({});

packages/core/src/generators/__tests__/mutator-test-files/dynamic-import-tests/dynamic-import-named-export.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable @typescript-eslint/no-unused-vars */
22
// Mutator that performs a dynamic import in its body.
33
// Regression fixture for https://github.com/orval-labs/orval/issues/1634:
4-
// esbuild preserves dynamic `import()` in ESM output even when targeting es6,
5-
// so the bundled code parsed by acorn contains an `import()` expression.
4+
// Bundled ESM output can preserve dynamic `import()`, so the code parsed by
5+
// acorn contains an `import()` expression.
66
export const customInstance = async <T>(_config: {
77
url: string;
88
}): Promise<T> => {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare module 'external-package/subpath';
2+
declare module '@scope/pkg/runtime';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import 'external-package/subpath';
2+
3+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
4+
export default function customInstance(_config: unknown) {}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import '@scope/pkg/runtime';
2+
3+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
4+
export default function customInstance(_config: unknown) {}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import './styles.scss';
2+
3+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
4+
export default function customInstance(_config: unknown) {}

0 commit comments

Comments
 (0)