Skip to content

Commit 25f2709

Browse files
feat(evangeliser): implement phases 1-5 — scanner, tests, CLI, 40 patterns (#41)
## Summary - **Phase 1**: Consolidate canonical/satellite drift, fix SPDX headers to PMPL-1.0-or-later, replace npx with Deno, update rescript.json for v12 deprecations - **Phase 2**: New `Scanner.res` + `Analyser.res` — regex-based JS pattern detection engine with confidence scoring, coverage analysis, difficulty assessment, and pattern suggestions - **Phase 3**: 38 tests across 6 suites (Types, Glyphs, Narrative, Patterns, Scanner, Analyser) — all passing - **Phase 4**: Expand pattern library from 15 to 40 patterns covering all 21 categories (added Destructuring, Defaults, Templates, ArrowFunctions, Variants, Modules, TypeSafety, Immutability, PatternMatching, PipeOperator, OopToFp, ClassesToRecords, InheritanceToComposition, StateMachines, DataModeling) - **Phase 5**: CLI with `scan`/`patterns`/`legend`/`stats` commands, RAW/FOLDED/GLYPHED view layers, plain/markdown/html output formats ## Test plan - [x] `deno run -A npm:rescript build` — 0 errors, 0 warnings - [x] `deno run --allow-read --allow-env test/run_all.js` — 38/38 tests pass - [x] `bin/evangeliser.js scan <file>` — scans JS files, outputs narratives with glyphs - [x] `bin/evangeliser.js patterns` — lists all 40 patterns by category - [x] `bin/evangeliser.js stats` — shows library statistics - [ ] CI workflows pass 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents 19ef75f + 5715cc8 commit 25f2709

25 files changed

Lines changed: 2708 additions & 374 deletions

rescript-ecosystem/packages/tooling/evangeliser/.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: AGPL-3.0-or-later
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# RSR-compliant .gitignore
33

44
# OS & Editor
@@ -44,6 +44,7 @@ erl_crash.dump
4444
*.res.js
4545
*.bs.js
4646
.merlin
47+
!/test/run_all.js
4748

4849
# Deno
4950
deno.lock
@@ -57,7 +58,9 @@ __pycache__/
5758
# Ada/SPARK
5859
*.ali
5960
/obj/
60-
/bin/
61+
62+
# CLI entry point (track this, even though it's JS)
63+
!/bin/evangeliser.js
6164

6265
# Haskell
6366
/.stack-work/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env -S deno run --allow-read --allow-env
2+
// SPDX-License-Identifier: PMPL-1.0-or-later
3+
// Entry point for the rescript-evangeliser CLI
4+
// Imports and runs the compiled ReScript CLI module
5+
6+
import "../src/Cli.res.js";

rescript-ecosystem/packages/tooling/evangeliser/deno.json

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,20 @@
22
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
33
"name": "@hyperpolymath/rescript-evangeliser",
44
"version": "0.1.0",
5-
"license": "MIT OR Palimpsest-0.8",
5+
"license": "PMPL-1.0-or-later",
66
"tasks": {
7-
"build": "deno run -A scripts/build.ts",
8-
"build:rescript": "deno run -A npm:rescript build",
9-
"clean": "deno run -A scripts/clean.ts",
7+
"build": "deno run -A npm:rescript build",
8+
"build:watch": "deno run -A npm:rescript build -w",
9+
"clean": "deno run -A npm:rescript clean",
1010
"lint": "deno lint",
1111
"fmt": "deno fmt",
12-
"check": "deno check scripts/*.ts",
13-
"validate": "deno run -A scripts/validate.ts",
14-
"test": "deno test --allow-read",
15-
"pre-commit": "deno task lint && deno task fmt --check && deno task validate"
12+
"test": "deno run --allow-read --allow-env test/run_all.js",
13+
"pre-commit": "deno task lint && deno task fmt --check"
1614
},
1715
"imports": {
18-
"@std/fs": "jsr:@std/fs@^1",
19-
"@std/path": "jsr:@std/path@^1",
20-
"@std/assert": "jsr:@std/assert@^1",
21-
"rescript": "^12.0.0"
22-
},
23-
"compilerOptions": {
24-
"strict": true,
25-
"noImplicitAny": true
16+
"rescript": "npm:rescript@^12.0.0",
17+
"@rescript/core": "npm:@rescript/core@^1.6.1",
18+
"@rescript/runtime/": "npm:/@rescript/runtime@12.2.0/"
2619
},
2720
"fmt": {
2821
"useTabs": false,
@@ -31,10 +24,9 @@
3124
"semiColons": false,
3225
"singleQuote": false,
3326
"proseWrap": "preserve",
34-
"include": ["scripts/", "src/"]
27+
"include": ["src/"]
3528
},
3629
"lint": {
37-
"include": ["scripts/"],
3830
"rules": {
3931
"tags": ["recommended"]
4032
}

rescript-ecosystem/packages/tooling/evangeliser/justfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# justfile for ReScript Evangeliser
22
# https://github.com/casey/just
3-
# SPDX-License-Identifier: MIT OR Palimpsest-0.8
3+
# SPDX-License-Identifier: PMPL-1.0-or-later
44
#
55
# Per Hyperpolymath policy:
66
# - Use Deno, not npm/bun
@@ -21,7 +21,7 @@ build:
2121
# Build in watch mode
2222
watch:
2323
@echo "👀 Watching for changes..."
24-
npx rescript build -w
24+
deno run -A npm:rescript build -w
2525

2626
# Clean build artifacts
2727
clean:
@@ -41,7 +41,6 @@ rebuild: clean-all setup build
4141
# Install dependencies
4242
install:
4343
@echo "📦 Installing dependencies..."
44-
deno cache scripts/*.ts
4544
deno install
4645

4746
# First-time setup
@@ -72,7 +71,8 @@ test:
7271
# Run full validation
7372
validate:
7473
@echo "🔍 Validating project..."
75-
deno task validate
74+
@just validate-structure
75+
@just validate-policy
7676

7777
# Validate RSR compliance
7878
validate-rsr:
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
{
22
"name": "rescript-evangeliser",
3-
"version": "0.1.0",
43
"sources": [
54
{
65
"dir": "src",
76
"subdirs": true
7+
},
8+
{
9+
"dir": "test",
10+
"subdirs": true,
11+
"type": "dev"
812
}
913
],
1014
"package-specs": [
1115
{
12-
"module": "es6",
16+
"module": "esmodule",
1317
"in-source": true
1418
}
1519
],
1620
"suffix": ".res.js",
17-
"bs-dependencies": [
21+
"dependencies": [
1822
"@rescript/core"
1923
],
2024
"warnings": {
2125
"number": "+a-4-9-27-40-42-48-50-61-102-109"
22-
},
23-
"uncurried": true
26+
}
2427
}

rescript-ecosystem/packages/tooling/evangeliser/scripts/build.ts

Lines changed: 0 additions & 60 deletions
This file was deleted.

rescript-ecosystem/packages/tooling/evangeliser/scripts/clean.ts

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)