Skip to content

Commit dfed1e1

Browse files
chore(packages): remove affine-ts; close #66 won't-do (#95)
TypeScript is not a first-class consumer in the AffineScript ecosystem. Per the estate's no-new-TypeScript policy, hand-maintaining (or auto- generating) a dedicated TS package surfaces TS where it shouldn't be. Changes: - Delete packages/affine-ts/ entirely (4 files: README.adoc, deno.json, mod.js, types.d.ts). - Update .claude/CLAUDE.md TypeScript Exemptions table — drop the affine-ts row (now 7 active exemptions, down from 8). Add closed- exemption note documenting the removal. - Update packages/affine-js/README.adoc — replace the "companion affine-ts" pointer with a sentence saying TS is not a first-class consumer; TS callers should use affine-js directly with their own typings. The remaining packages/affine-js/types.d.ts exemption is preserved as the single interop surface for JS callers (most of whom happen to use TS tooling). That exemption stands or falls separately. Closes #66 — won't-do. Issue #66 proposed auto-generating .d.ts files for affine-js AND affine-ts. With affine-ts removed, the scope of #66 shrinks to "just affine-js", and that's a separate, smaller decision that should be its own issue if pursued. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c392e49 commit dfed1e1

6 files changed

Lines changed: 7 additions & 365 deletions

File tree

.claude/CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,20 @@ Both are FOSS with independent governance (no Big Tech).
7070

7171
### TypeScript Exemptions (Approved)
7272

73-
The "no new TypeScript" rule has eight 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:
73+
The "no new TypeScript" rule has seven 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:
7474

7575
| Path | Files | Rationale | Unblock condition |
7676
|---|---|---|---|
7777
| `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. |
7978
| `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). |
8079

8180
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.
8281

8382
**Closed exemptions:**
8483
- `editors/vscode/src/extension.ts` — closed 2026-05-03 by issue #35 Phase 3 (Node-target codegen + Vscode bindings landed). Source of truth is now `editors/vscode/src/extension.affine`, compiled to `out/extension.cjs`. Re-introducing the .ts file is blocked by `tools/check-no-extension-ts.sh` (wired into `just check` and `.github/workflows/ci.yml`).
84+
- `packages/affine-ts/` — removed 2026-05-11 (issue #66 closed won't-do). TypeScript is not a first-class consumer; TS callers should use `@hyperpolymath/affine-js` directly and supply their own typings.
8585

86-
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.
86+
The 5 external references to `affinescript-deno-test/` (CI workflow, status docs, history docs) and the references to `packages/affine-js/` (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.
8787

8888
### Package Management
8989

packages/affine-js/README.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ All JS ↔ WASM value exchanges use the `AffineValue` tagged-union type:
137137
package without any additional steps — the type definitions are automatically
138138
picked up by `tsc` and editors.
139139

140-
For TypeScript projects, the companion `@hyperpolymath/affine-ts` package
141-
provides enhanced declarations with stricter generics.
140+
TypeScript is not a first-class consumer in the AffineScript ecosystem. There
141+
is no `@hyperpolymath/affine-ts` package; TS callers should consume
142+
`@hyperpolymath/affine-js` directly via the shipped `.d.ts` and supply any
143+
project-specific typings themselves.
142144

143145
== Return type hints
144146

packages/affine-ts/README.adoc

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

packages/affine-ts/deno.json

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

packages/affine-ts/mod.js

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

0 commit comments

Comments
 (0)