Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": "latest"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "22",
"version": "26",
"installYarnUsingApt": false
}
},
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
# Install dev dependencies from OPAM
opam install . --with-test --with-dev-setup -y

corepack enable
# The Node feature provides yarn: it enables corepack where Node still bundles
# it (Node 24 and older) and installs yarn with npm otherwise.
printf "\n" | yarn
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/setup-node@v7
with:
cache: yarn
node-version: 22
node-version-file: .nvmrc
# The scripts import semver. Package builds aren't needed for them.
- run: yarn install --immutable --mode=skip-build
- run: node --test scripts/changelog.test.js scripts/magicNumbers.test.js
Expand Down
34 changes: 32 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,19 @@ jobs:
fi
echo "path=$dir" >> "$GITHUB_OUTPUT"
cp -r tests/package_tests/installation_test/* "$dir"
# The compiled stdlib tests run against the installed runtime. Their
# Test.mjs imports @babel/code-frame, which tests/tests depends on.
cp -r tests/tests/src/stdlib "$dir/stdlib"
echo "code-frame=$(node -p 'require("./tests/tests/package.json").dependencies["@babel/code-frame"]')" >> "$GITHUB_OUTPUT"

- name: Install ReScript package
run: |
COMMIT_SHA="${{ needs.pkg-pr-new.outputs.commit_sha }}"
npm i --no-audit \
"https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA}" \
"https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@${COMMIT_SHA}" \
"https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@${COMMIT_SHA}"
"https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@${COMMIT_SHA}" \
"@babel/code-frame@${{ steps.tmp-dir.outputs.code-frame }}"
shell: bash
working-directory: ${{ steps.tmp-dir.outputs.path }}

Expand All @@ -618,6 +623,16 @@ jobs:
shell: bash
working-directory: ${{ steps.tmp-dir.outputs.path }}

# build-compiler runs the stdlib tests on the Node.js version in .nvmrc,
# this job on the oldest supported one, so tests of APIs missing there
# must stay out of Stdlib_TestSuite and Stdlib_TempTests.
- name: Run stdlib tests
run: |
node stdlib/Stdlib_TestSuite.mjs
node stdlib/Stdlib_TempTests.mjs
shell: bash
working-directory: ${{ steps.tmp-dir.outputs.path }}

test-installation-pnpm:
needs:
- pkg-pr-new
Expand Down Expand Up @@ -657,6 +672,10 @@ jobs:
fi
echo "path=$dir" >> "$GITHUB_OUTPUT"
cp -r tests/package_tests/installation_test/* "$dir"
# The compiled stdlib tests run against the installed runtime. Their
# Test.mjs imports @babel/code-frame, which tests/tests depends on.
cp -r tests/tests/src/stdlib "$dir/stdlib"
echo "code-frame=$(node -p 'require("./tests/tests/package.json").dependencies["@babel/code-frame"]')" >> "$GITHUB_OUTPUT"

- name: Install ReScript package
run: |
Expand All @@ -665,7 +684,8 @@ jobs:
pnpm --config.block-exotic-subdeps=false i \
"https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA}" \
"https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@${COMMIT_SHA}" \
"https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@${COMMIT_SHA}"
"https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@${COMMIT_SHA}" \
"@babel/code-frame@${{ steps.tmp-dir.outputs.code-frame }}"
shell: bash
working-directory: ${{ steps.tmp-dir.outputs.path }}

Expand All @@ -684,6 +704,16 @@ jobs:
shell: bash
working-directory: ${{ steps.tmp-dir.outputs.path }}

# build-compiler runs the stdlib tests on the Node.js version in .nvmrc,
# this job on the oldest supported one, so tests of APIs missing there
# must stay out of Stdlib_TestSuite and Stdlib_TempTests.
- name: Run stdlib tests
run: |
node stdlib/Stdlib_TestSuite.mjs
node stdlib/Stdlib_TempTests.mjs
shell: bash
working-directory: ${{ steps.tmp-dir.outputs.path }}

# The single CI check that the master ruleset requires. Matrix job names
# contain runner labels, so requiring this job instead keeps the ruleset
# unchanged when runners or jobs change. It runs even when a needed job fails
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
26
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ algorithm and representation invariants belong beside their implementation.

> Most of our contributors are working on Apple machines, so all our instructions are currently macOS / Linux centric. Contributions for Windows development welcome!

- [Node.js](https://nodejs.org/) v22.x or newer
- [Node.js](https://nodejs.org/) v26.x or newer (the version in `.nvmrc`)
- [Yarn CLI](https://yarnpkg.com/getting-started/install) (can be installed with `corepack`, Homebrew, etc)
- C compiler toolchain (usually installed with `xcode` on Mac)
- Rust toolchain (required to build rewatch; follow the instructions at https://www.rust-lang.org/tools/install and install the version listed as `rust-version` in `rewatch/Cargo.toml`)
Expand Down
1 change: 1 addition & 0 deletions changes/node-26-dev.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Develop and test with Node.js 26, and run the stdlib tests in the installation tests on Node.js 22, the oldest supported version.
4 changes: 4 additions & 0 deletions tests/tests/src/stdlib/Stdlib_TestSuite.res
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// The installation tests in .github/workflows/ci.yml also run this suite on
// the oldest supported Node.js version, 22. Tests of APIs that Node.js 22
// lacks belong in a separate entry point that only scripts/test.js runs.

include Stdlib_TestTests
include Stdlib_PromiseTest
include Stdlib_ErrorTests
Expand Down
Loading