Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fb9f730
add package exports/imports resolution
noise64 Jun 12, 2026
0edc3f9
add CJS named export analysis for ESM interop
noise64 Jun 12, 2026
ed04d77
share CJS loader for ESM CJS facades
noise64 Jun 15, 2026
370d3b3
improve module syntax detection
noise64 Jun 15, 2026
ccef273
harden module syntax scanners
noise64 Jun 15, 2026
530105b
resolve package reexports for CJS analysis
noise64 Jun 15, 2026
450242c
improve require esm error handlin
noise64 Jun 15, 2026
ba1961d
add installed app module interop coverage
noise64 Jun 16, 2026
50ef206
pattern key-based package export and import resolution, node app styl…
noise64 Jun 17, 2026
381fbb1
installed app compatibility tests with runtime harness and reporting …
noise64 Jun 17, 2026
e23a948
Handle conditional fallback for `--no-experimental-require-module` an…
noise64 Jun 17, 2026
395278d
cleanups
noise64 Jun 18, 2026
502758d
add CJS named export lexer parity coverag
noise64 Jun 18, 2026
688c061
add support for CJS lexer parity tests for EXPORTS_ASSIGN patterns an…
noise64 Jun 18, 2026
aad7026
promote punycode node compat tes
noise64 Jun 18, 2026
ef253aa
implement module findPackageJSON
noise64 Jun 18, 2026
3a2f86d
split findPackageJSON node compat test
noise64 Jun 19, 2026
28f19bb
circular symlink handling
noise64 Jun 22, 2026
0846a26
improve CJS module loading compatibility
noise64 Jun 22, 2026
2d7687c
cover nested CJS dependency cache shape
noise64 Jun 22, 2026
ab6d05d
cover CJS module children graph behavior
noise64 Jun 22, 2026
4cc37dc
tighten ambiguous JS module fallback
noise64 Jun 23, 2026
a00912d
update golden files: add new module declarations and export tests
noise64 Jun 23, 2026
8a7e9f9
stricter node baseline version check
noise64 Jun 23, 2026
d7c2bab
Add flaky test support and improve handling of `__wasm_rquickjs_node_…
noise64 Jun 24, 2026
6eff7dc
improve module entry identity parity
noise64 Jun 24, 2026
4b2873e
enforce JSON import attributes
noise64 Jun 24, 2026
dd4d0aa
improve ESM builtin namespace parity
noise64 Jun 24, 2026
3f44c15
support file URLs in fs promises
noise64 Jun 24, 2026
de24379
Validate DNS lookupService arguments
noise64 Jun 25, 2026
0df1736
Decode encoded ESM relative paths
noise64 Jun 25, 2026
8acae52
Validate invalid ESM package specifiers
noise64 Jun 25, 2026
9c7bb5f
Support syncBuiltinESMExports live bindings
noise64 Jun 25, 2026
496af17
Fix ESM resolver errors and promote two tests
noise64 Jun 25, 2026
84939db
Promote passing CJS ESM interop tests
noise64 Jun 25, 2026
61f675d
Export createRequire from node compat common shim
noise64 Jun 25, 2026
a9997e0
Promote cyclic dynamic import ESM test
noise64 Jun 25, 2026
e031eeb
Harden CJS object literal export analysis
noise64 Jun 25, 2026
fb25699
Support require esm module exports interop
noise64 Jun 25, 2026
619f3ca
Emit Node CJS named import diagnostics
noise64 Jun 25, 2026
2298647
Validate vm compileFunction offsets
noise64 Jun 25, 2026
8dfad71
Promote passing ESM package type tests
noise64 Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,22 @@ jobs:
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6, 7, 8]
group: [1, 2, 3, 4, 5, 6, 7, 8, 9]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup
- name: Enable Golem wasmtime fork
run: bash .github/scripts/enable-wasmtime-fork.sh
- name: Runtime tests (group ${{ matrix.group }}/8)
- uses: actions/setup-node@v4
if: matrix.group == 9
with:
node-version: "22.14.0"
- name: Runtime tests (group ${{ matrix.group }}/9)
run: cargo test --test runtime $CI_WASMTIME_FORK_FEATURES -- --report-time --format ctrf --logfile target/ctrf.json ':tag:group${{ matrix.group }}'
env:
NODE_MODULES_APP_STRICT_NODE_BASELINE: "1"
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
if: always()
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.14.0
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,19 @@ The `tests/node_compat/` directory contains vendored Node.js test files used to

Load the `fixing-node-compat-test` skill for the full workflow when making a test pass.

## Node Modules App Tests

The `tests/node_modules_apps/` directory contains CI-enforced runtime tests for unbundled npm apps installed with real `node_modules` and attached to the component filesystem as `/app`. This suite is separate from `tests/libraries/`, which documents Rollup-bundled package compatibility.

Important rules:

- `tests/node_modules_apps/config.jsonc` is the source of truth for node modules app tests. Runtime tests in `tests/runtime/node_modules_apps.rs` are generated from it.
- Add app fixtures under `tests/node_modules_apps/apps/<app>/` with a `package.json`, `run-node.mjs`, and `test-*` files exporting `run()`.
- Node modules app tests run `npm install --install-links --ignore-scripts --no-audit --no-fund`, verify the raw test with host Node.js, then run it through wasm-rquickjs from `/app`.
- Keep this suite focused on real `node_modules` module loading, CJS/ESM interop, package maps, filesystem-backed package behavior, and high-value smoke tests. Do not use it for native `.node`, WASM artifact loading, subprocess-heavy, or live-network scenarios.
- CI runs node modules app tests as runtime `group9`; regular runtime tests use `group1` through `group8`.
- Before running node modules app runtime tests after skeleton changes, run `./cleanup-skeleton.sh`, then use `cargo test --test runtime --features use-golem-wasmtime -- ':tag:group9'` for the CI-like group, `cargo test --test runtime --features use-golem-wasmtime -- node_modules_app --nocapture` for the full node modules app suite, or a narrower node modules app filter.

### ⚠️ Keeping `node_compat` and `node_compat_report` in sync

The `tests/node_compat.rs` test harness and the `tests/node_compat_report.rs` report generator are **two separate runners** with independent Host types, linker setups, and WASI context configurations. **Whenever you change the WASI context, linker setup, or Host configuration in `tests/common/mod.rs` (used by `node_compat`), you MUST apply the same change to `tests/node_compat_report.rs`** — otherwise the two runners will produce different results.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ Compatibility stubs — no V8 inspector in WASM.
<details>
<summary><strong><code>node:module</code></strong></summary>

- `require`, `createRequire`, `builtinModules`, `isBuiltin`, `runMain`, `_nodeModulePaths`
- `require`, `require.resolve`, `createRequire`, `builtinModules`, `isBuiltin`, `runMain`, `_nodeModulePaths`
- Package resolution supports `package.json` `main`, `exports` root/subpath maps, wildcard `exports` patterns, `imports` maps, and wildcard `imports` patterns. CJS resolution recognizes `golem`, `node`, `require`, `module-sync`, and `default` conditions; ESM resolution recognizes `golem`, `node`, `import`, `module-sync`, and `default`. Package `imports` can target relative files, external packages, and `node:` builtins.

</details>

Expand Down
Loading