Skip to content

Commit d8ed69a

Browse files
author
Jonathan D.A. Jewell
committed
chore: Add ReScript enforcement + conversion notice (RSR policy)
1 parent 52bc5ac commit d8ed69a

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

.claude/CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,14 @@
99
When asked to add npm packages, use Deno alternatives:
1010
- `npm install X` → Add to import_map.json or use npm: specifier
1111
- `npm run X``deno task X`
12+
13+
## Language Policy (RSR)
14+
15+
### ⚠️ CONVERSION IN PROGRESS: TS/JS → ReScript
16+
17+
- **REQUIRED**: ReScript for all NEW code
18+
- **FORBIDDEN**: New TypeScript/JavaScript files
19+
- **TODO**: Convert existing TS/JS to ReScript
20+
- **ALLOWED**: Generated .res.js files
21+
22+
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)