Skip to content

Commit 116ea5d

Browse files
hyperpolymathclaude
andcommitted
docs(policy): document the 9 approved TypeScript exemptions
The hyperpolymath language policy bans new TypeScript, but this repo has 9 .ts files that are legitimate carve-outs (2 .d.ts public API files, 1 VS Code extension entry pinned by manifest, 6 Deno test harness files). Document each with rationale and unblock condition so the exemption is visible and audit-friendly. Physical relocation into vendor/ was rejected because the cost (5 external refs to update) exceeded the visibility benefit (directories are already clearly named). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 133bb53 commit 116ea5d

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.claude/CLAUDE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ Both are FOSS with independent governance (no Big Tech).
6868
5. **Python only for SaltStack** - All other Python must be rewritten
6969
6. **No Kotlin/Swift for mobile** - Use Tauri 2.0+ or Dioxus
7070

71+
### TypeScript Exemptions (Approved)
72+
73+
The "no new TypeScript" rule has nine approved exemptions in this repo. These paths are *not* policy violations — they are documented carve-outs because the file format or downstream consumer requires TypeScript:
74+
75+
| Path | Files | Rationale | Unblock condition |
76+
|---|---|---|---|
77+
| `packages/affine-js/types.d.ts` | 1 | TypeScript declaration file — the public API contract by which JS callers consume AffineScript-compiled artefacts. `.d.ts` is TS by definition. | Generate from canonical compiler output (issue: see ROADMAP). |
78+
| `packages/affine-ts/types.d.ts` | 1 | Same, for TS callers. | Same as above. |
79+
| `editors/vscode/src/extension.ts` | 1 | VS Code extension entry point. Path pinned by `package.json`'s `main` field. | AffineScript issue #35 (Node-target codegen). |
80+
| `affinescript-deno-test/*.ts` | 6 | Deno-based test harness for AffineScript itself: `cli.ts`, `mod.ts`, `lib/{compile,discover,runner}.ts`, `example/smoke_driver.ts`. Deno test runner is TS-native. | AffineScript stdlib + Deno bindings (no scheduled issue). |
81+
82+
Adding to this list requires explicit user approval and an unblock condition. New TypeScript files outside this list are still banned per the policy table above.
83+
84+
The 5 external references to `affinescript-deno-test/` (CI workflow, status docs, history docs) and the 3 references to `packages/affine-{js,ts}/` (status docs, Deno config) are why physical relocation into a `vendor/` subtree was rejected — the relocation cost exceeded the visibility benefit when the directories are already named clearly.
85+
7186
### Package Management
7287

7388
- **Primary**: Guix (guix.scm)

0 commit comments

Comments
 (0)