Skip to content

Commit 2a98ef9

Browse files
author
Jonathan D.A. Jewell
committed
chore: Add ReScript enforcement + conversion notice (RSR policy)
1 parent 9a55c0e commit 2a98ef9

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

.claude/CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,14 @@ This repo currently uses npm but needs to be converted to Deno.
2626
- **REQUIRED**: Deno for JavaScript/TypeScript
2727
- **FORBIDDEN**: npm, npx, node_modules (after conversion)
2828
- **FALLBACK**: Bun only if Deno is impossible
29+
30+
## Language Policy (RSR)
31+
32+
### ⚠️ CONVERSION IN PROGRESS: TS/JS → ReScript
33+
34+
- **REQUIRED**: ReScript for all NEW code
35+
- **FORBIDDEN**: New TypeScript/JavaScript files
36+
- **TODO**: Convert existing TS/JS to ReScript
37+
- **ALLOWED**: Generated .res.js files
38+
39+
See TS_CONVERSION_NEEDED.md for migration status.

.github/workflows/ts-blocker.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: TypeScript/JavaScript Blocker
2+
on: [push, pull_request]
3+
jobs:
4+
check:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: Block new TypeScript/JavaScript
9+
run: |
10+
NEW_TS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(ts|tsx)$' | grep -v '\.gen\.' || true)
11+
NEW_JS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(js|jsx)$' | grep -v '\.res\.js$' | grep -v '\.gen\.' | grep -v 'node_modules' || true)
12+
13+
if [ -n "$NEW_TS" ] || [ -n "$NEW_JS" ]; then
14+
echo "❌ New TS/JS files detected. Use ReScript instead."
15+
[ -n "$NEW_TS" ] && echo "$NEW_TS"
16+
[ -n "$NEW_JS" ] && echo "$NEW_JS"
17+
exit 1
18+
fi
19+
echo "✅ ReScript policy enforced"

TS_CONVERSION_NEEDED.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# TypeScript/JavaScript → ReScript Conversion (Partial)
2+
3+
This repo has some ReScript but still contains TS/JS that needs conversion.
4+
5+
## Remaining Work
6+
1. Find all `.ts`/`.tsx`/`.js`/`.jsx` files (excluding `.res.js`)
7+
2. Create ReScript equivalents
8+
3. Migrate logic and update imports
9+
4. Delete original TS/JS files
10+
11+
## Policy
12+
- No NEW TypeScript/JavaScript allowed
13+
- CI will block new TS/JS files
14+
- Existing TS/JS should be migrated over time

0 commit comments

Comments
 (0)