Skip to content

Commit 86b42d4

Browse files
committed
Rolldown WIP
1 parent 8936b8b commit 86b42d4

File tree

5 files changed

+264
-3
lines changed

5 files changed

+264
-3
lines changed

package-lock.json

Lines changed: 240 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/node-tests/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"copy-tests": "tsx scripts/copy-tests.mts",
1515
"gyp-to-cmake": "gyp-to-cmake ./tests",
1616
"build": "tsx scripts/build-tests.mts",
17+
"bundle": "rolldown -c rolldown.config.mts",
1718
"copy-and-build": "npm run copy-tests && npm run gyp-to-cmake && npm run build",
1819
"test": "npm run copy-and-build"
1920
},
@@ -22,6 +23,7 @@
2223
"cmake-rn": "*",
2324
"gyp-to-cmake": "*",
2425
"prebuildify": "^6.0.1",
25-
"read-pkg": "^9.0.1"
26+
"read-pkg": "^9.0.1",
27+
"rolldown": "1.0.0-beta.26"
2628
}
2729
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig } from "rolldown";
2+
3+
export default defineConfig([
4+
{
5+
input: "tests/js-native-api/2_function_arguments/test.js",
6+
output: {
7+
file: "bundle.js",
8+
},
9+
resolve: {
10+
alias: {
11+
"../../common": "yo.ts",
12+
},
13+
},
14+
},
15+
]);

packages/node-tests/scripts/build-tests.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ for (const projectDirectory of projectDirectories) {
88
console.log(
99
`Running "cmake-rn" in ${projectDirectory} to build for React Native`
1010
);
11-
execSync("cmake-rn --out-to-build", {
11+
execSync("cmake-rn", {
1212
cwd: projectDirectory,
1313
stdio: "inherit",
1414
});
15+
1516
console.log(`Running "cmake-js" in ${projectDirectory} to build for Node.js`);
1617
execSync("cmake-js", {
1718
cwd: projectDirectory,

packages/node-tests/scripts/copy-tests.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,7 @@ for (const src of ALLOW_LIST) {
6363
console.log("Copying from", srcPath, "to", destPath);
6464
fs.cpSync(srcPath, destPath, { recursive: true });
6565
}
66+
67+
if (!fs.existsSync(path.join(TESTS_DIR, "common.js"))) {
68+
// TODO: Perform a symlink of a common.js file from src/common.js
69+
}

0 commit comments

Comments
 (0)