Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e90cb2f

Browse files
authoredJun 19, 2025··
Merge branch 'master' into jsx-ast-children-loc
2 parents 3fc4841 + 333b20c commit e90cb2f

File tree

99 files changed

+1799
-413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1799
-413
lines changed
 

‎.github/workflows/ci.yml

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ env:
2121

2222
jobs:
2323
build-compiler:
24+
outputs:
25+
api-docs-artifact-id: ${{ steps.upload-api-docs.outputs.artifact-id }}
2426
strategy:
2527
fail-fast: false
2628
matrix:
@@ -36,6 +38,7 @@ jobs:
3638
upload_binaries: true
3739
# Build the playground compiler and run the benchmarks on the fastest runner
3840
build_playground: true
41+
generate_api_docs: true
3942
benchmarks: true
4043
node-target: linux-arm64
4144
rust-target: aarch64-unknown-linux-musl
@@ -137,7 +140,7 @@ jobs:
137140
run: |
138141
cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch
139142
mkdir -p rewatch/target/release
140-
cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release
143+
cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release
141144
./scripts/copyExes.js --rewatch
142145
shell: bash
143146

@@ -321,13 +324,11 @@ jobs:
321324
if: steps.ninja-build-cache.outputs.cache-hit != 'true'
322325
run: node scripts/copyExes.js --ninja
323326

324-
- name: "Syntax: Run roundtrip tests"
325-
if: ${{ runner.os != 'Windows' }}
326-
run: opam exec -- make test-syntax-roundtrip
327-
328-
- name: "Syntax: Run tests (Windows)"
329-
if: ${{ runner.os == 'Windows' }}
330-
run: opam exec -- make test-syntax
327+
- name: "Syntax: Run tests"
328+
env:
329+
ROUNDTRIP_TEST: ${{ runner.os == 'Windows' && '0' || '1' }}
330+
run: ./scripts/test_syntax.sh
331+
shell: bash
331332

332333
- name: Build runtime/stdlib with rewatch
333334
if: ${{ runner.os != 'Windows' }}
@@ -360,7 +361,8 @@ jobs:
360361
run: make -C tests/gentype_tests/typescript-react-example clean test
361362

362363
- name: Run rewatch tests
363-
run: make test-rewatch
364+
run: ./rewatch/tests/suite-ci.sh
365+
shell: bash
364366

365367
- name: Run syntax benchmarks
366368
if: matrix.benchmarks
@@ -439,6 +441,18 @@ jobs:
439441
name: lib-ocaml
440442
path: lib/ocaml
441443

444+
- name: Generate API Docs
445+
if: ${{ matrix.generate_api_docs }}
446+
run: yarn apidocs:generate
447+
448+
- name: "Upload artifacts: scripts/res/apiDocs"
449+
id: upload-api-docs
450+
if: ${{ matrix.generate_api_docs }}
451+
uses: actions/upload-artifact@v4
452+
with:
453+
name: api
454+
path: scripts/res/apiDocs/
455+
442456
pkg-pr-new:
443457
needs:
444458
- build-compiler
@@ -466,6 +480,49 @@ jobs:
466480
run: |
467481
yarn dlx pkg-pr-new publish "." "./packages/@rescript/*"
468482
483+
api-docs:
484+
needs:
485+
- build-compiler
486+
runs-on: ubuntu-24.04-arm
487+
steps:
488+
- name: Checkout rescript-lang.org
489+
uses: actions/checkout@v4
490+
with:
491+
repository: rescript-lang/rescript-lang.org
492+
ssh-key: ${{ secrets.RESCRIPT_LANG_ORG_DEPLOY_KEY }}
493+
494+
- name: Download artifacts
495+
uses: actions/download-artifact@v4
496+
with:
497+
artifact-ids: ${{ needs.build-compiler.outputs.api-docs-artifact-id }}
498+
path: data
499+
500+
- name: Check if repo is clean
501+
id: diffcheck
502+
run: |
503+
git status
504+
if [ -z "$(git status --porcelain)" ]; then
505+
echo "clean=true" >> $GITHUB_OUTPUT
506+
else
507+
echo "clean=false" >> $GITHUB_OUTPUT
508+
fi
509+
510+
- name: Build website
511+
if: steps.diffcheck.outputs.clean == 'false'
512+
run: |
513+
npm ci
514+
npx rescript
515+
npm run build
516+
517+
- name: Commit and push
518+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
519+
run: |
520+
git config --global user.name "github-actions[bot]"
521+
git config --global user.email "github-actions@rescript-lang.org"
522+
git add data/api
523+
git commit -m "Update API docs for ${{ github.ref_name }}"
524+
git push
525+
469526
test-integration:
470527
needs:
471528
- pkg-pr-new
@@ -488,7 +545,8 @@ jobs:
488545
- name: Use Node.js
489546
uses: actions/setup-node@v4
490547
with:
491-
node-version-file: .nvmrc
548+
# Run integration tests with the oldest supported node version.
549+
node-version: 20
492550

493551
- name: Make test directory
494552
id: tmp-dir
@@ -524,8 +582,8 @@ jobs:
524582
working-directory: rewatch/testrepo
525583

526584
- name: Run rewatch integration tests
527-
# Currently failing on Windows and intermittently on macOS
528-
run: make test-rewatch-integration
585+
run: ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch
586+
shell: bash
529587

530588
publish:
531589
needs:

‎.mcp.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"mcpServers": {
3+
"ocamllsp": {
4+
"type": "stdio",
5+
"command": "mcp-language-server",
6+
"args": [
7+
"--workspace",
8+
"/Users/shulhi/Dev/rescript/rescript-compiler",
9+
"--lsp",
10+
"ocamllsp"
11+
],
12+
"env": {}
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)
Please sign in to comment.