Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0273917
ci: use Cloudflare worker github action
jderochervlk Dec 2, 2025
eff829f
give job a name
jderochervlk Dec 2, 2025
a0a6450
fix env
jderochervlk Dec 2, 2025
fa172b2
fix project name
jderochervlk Dec 2, 2025
e5237d3
functions
jderochervlk Dec 2, 2025
6178fcc
add workflow_dispath
jderochervlk Dec 2, 2025
a08ebde
stick with out dir for now
jderochervlk Dec 2, 2025
8c47d8a
try different action
jderochervlk Dec 2, 2025
f0186d3
fix name
jderochervlk Dec 2, 2025
e82442f
format
jderochervlk Dec 2, 2025
8f9734d
remove environment from inputs
jderochervlk Dec 2, 2025
4601f43
remove ()
jderochervlk Dec 2, 2025
05c041e
add pull_request
jderochervlk Dec 2, 2025
0f91f47
on changes
jderochervlk Dec 2, 2025
316f257
add wrangler
jderochervlk Dec 2, 2025
f23ea08
update readme
jderochervlk Dec 2, 2025
5fa03db
break out into different jobs
jderochervlk Dec 2, 2025
5679978
update commands
jderochervlk Dec 2, 2025
3592318
go back to official action
jderochervlk Dec 2, 2025
feec47e
add comment
jderochervlk Dec 2, 2025
4277ac3
fix permissions
jderochervlk Dec 2, 2025
03040e5
Merge branch 'master' of github.com:rescript-lang/rescript-lang.org i…
jderochervlk Feb 1, 2026
f81fffc
remove trailing comma
jderochervlk Feb 1, 2026
53ec327
add code block around errors
jderochervlk Feb 1, 2026
a3abc50
add back output
jderochervlk Feb 1, 2026
9921e36
wrap in console
jderochervlk Feb 1, 2026
b1bc4ad
add header
jderochervlk Feb 1, 2026
6829ce5
disable color output
jderochervlk Feb 1, 2026
a82b1fe
update wrangler
jderochervlk Feb 1, 2026
dd80644
remove err
jderochervlk Feb 1, 2026
a0ac5c7
run on all branches for PRs
jderochervlk Feb 1, 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
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy to Cloudflare Pages
on:
push:
branches:
- master
workflow_dispatch:
inputs:
environment:
description: "Choose an environment to deploy to: <preview|production>"
required: true
default: "preview"
pull_request:

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
permissions:
contents: read
deployments: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup yarn
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: "24"
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Deploy
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy out --project-name=rescript-lang-org
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: 4.61.1
continue-on-error: true
env:
FORCE_COLOR: 0
- name: Comment PR with deployment link
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
header: deploymemt
message: |
## Cloudflare deployment
Deployement ID: ${{ steps.deploy.outputs.pages-deployment-id }}
Deployment Environment: ${{ steps.deploy.outputs.pages-environment }}

${{ steps.deploy.outputs.command-output }}
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
node-version-file: ".node-version"
cache: yarn
- run: yarn
- run: yarn res:build --warn-error +3+8+11+12+26+27+31+32+33+34+35+39+44+45+110
- run: yarn build:res --warn-error +3+8+11+12+26+27+31+32+33+34+35+39+44+45+110
- run: yarn test
- run: yarn ci:format
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,11 @@ app/**/*.jsx
!.yarn/sdks
!.yarn/versions

# wrangler
.wrangler

# Scripts generated from rolldown to convert them from .jsx files to .mjs files
_scripts
_scripts

# Local env files
.env
30 changes: 1 addition & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,10 @@ This is the official documentation platform for the [ReScript](https://rescript-
# For first time clone / build (install dependencies)
yarn

# Initial build
yarn rescript

# Build the index data. Only needed for initial clone (or content H2 changes)
yarn update-index

# In a new tab
# Run ReScript, Vite, and Wrangler in development mode
yarn dev

open localhost:3000
```

In case you want to run ReScript in watchmode:

```sh
yarn rescript -w
```

## Build Index Data

We are parsing our content for specific index data (such as, all interesting
search terms we need for searching inside the `Belt` docs). You can create your
index by running following command:

```sh
yarn update-index
```

All the index data is stored in `index_data`, but will not be tracked by git.
Make sure to build the index after a fresh clone, otherwise Next might not
build specific pages (file `index_data/x.json` not found).

## Project Structure Overview

- `data`: Contains hand-curated data, such as sidebar ordering, blog data, etc
Expand Down
4 changes: 4 additions & 0 deletions functions/echo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export function onRequest(context) {
const url = new URL(context.request.url);
return new Response(url.searchParams.toString());
}
6 changes: 3 additions & 3 deletions markdown-pages/docs/manual/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bun create rescript-app
- Trigger a ReScript build:

```sh
npm run res:build
npm run build:res
```
- If you selected the "basic" template, simply run it with:

Expand Down Expand Up @@ -156,8 +156,8 @@ bun create rescript-app
- Add convenience `npm` scripts to `package.json`:
```json
"scripts": {
"res:build": "rescript",
"res:dev": "rescript -w"
"build:res": "rescript",
"dev:res": "rescript watch"
}
```

Expand Down
2 changes: 1 addition & 1 deletion markdown-pages/docs/manual/typescript-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ In case of the TypeScript project using `Bundler` module resolution, `allowImpor

Open any relevant `*.res` file and add `@genType` annotations to any bindings / values / functions to be used from JavaScript. If an annotated value uses a type, the type must be annotated too. See e.g. [Hooks.res](https://github.com/rescript-lang/rescript-compiler/blob/master/jscomp/gentype_tests/typescript-react-example/src/Hooks.res).

Save the file and rebuild the project via `npm run res:build` or similar. You should now see a `*.gen.tsx` file with the same name (e.g. `MyComponent.res` -> `MyComponent.gen.tsx`).
Save the file and rebuild the project via `npm run build:res` or similar. You should now see a `*.gen.tsx` file with the same name (e.g. `MyComponent.res` -> `MyComponent.gen.tsx`).

Any values exported from `MyComponent.res` can then be imported from TypeScript. For example:

Expand Down
35 changes: 20 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,25 @@
"packageManager": "yarn@4.12.0",
"type": "module",
"scripts": {
"dev": "react-router dev --host",
"res:watch": "rescript watch",
"res:clean": "rescript clean",
"res:build": "rescript build",
"build": "rescript build && yarn build-scripts && yarn update-index && react-router build",
"test": "node scripts/test-examples.mjs && node scripts/test-hrefs.mjs",
"update-index": "yarn generate-llms && node _scripts/generate_feed.mjs > public/blog/feed.xml",
"reanalyze": "rescript-tools reanalyze -all-cmt .",
"sync-bundles": "node scripts/sync-playground-bundles.mjs",
"generate-llms": "node _scripts/generate_llms.mjs",
"format": "prettier . --write --experimental-cli && rescript format",
"build:scripts": "yarn dlx tsdown@0.20.0 scripts/*.jsx -d _scripts --no-clean --ext .mjs",
"build:generate-llms": "node _scripts/generate_llms.mjs",
"build:res": "rescript build",
"build:sync-bundles": "node scripts/sync-playground-bundles.mjs",
"build:update-index": "yarn build:generate-llms && node _scripts/generate_feed.mjs > public/blog/feed.xml",
"build:vite": "react-router build",
"build": "yarn build:res && yarn build:scripts && yarn build:update-index && yarn build:vite",
"ci:format": "prettier . --check --experimental-cli",
"preview": "yarn build && static-server build/client",
"clean:res": "rescript clean",
"convert-images": "auto-convert-images",
"build-scripts": "yarn dlx tsdown@0.20.0 scripts/*.jsx -d _scripts --no-clean --ext .mjs"
"dev:res": "rescript watch",
"dev:vite": "react-router dev --host",
"dev:wrangler": "yarn wrangler pages dev build/client",
"dev": "yarn prepare && yarn dev:res & yarn dev:vite & yarn dev:wrangler",
"format": "prettier . --write --experimental-cli && rescript format",
"prepare": "yarn build:res && yarn build:scripts && yarn build:update-index",
"preview": "yarn build && static-server build/client",
"reanalyze": "rescript-tools reanalyze -all-cmt .",
"test": "node scripts/test-examples.mjs && node scripts/test-hrefs.mjs"
},
"dependencies": {
"@babel/generator": "^7.24.7",
Expand Down Expand Up @@ -93,6 +97,7 @@
"vite": "^7.0.6",
"vite-plugin-devtools-json": "^1.0.0",
"vite-plugin-env-compatible": "^2.0.1",
"vite-plugin-page-reload": "^0.2.2"
"vite-plugin-page-reload": "^0.2.2",
"wrangler": "^4.61.1"
}
}
}
Loading