Skip to content

Rename Project to Font across the codebase - #64

Merged
aurpelai merged 3 commits into
mainfrom
refactor/rename-project-to-font
Jun 21, 2026
Merged

aurpelai merged 3 commits into
mainfrom
refactor/rename-project-to-font

Conversation

@aurpelai

Copy link
Copy Markdown
Owner

Summary

  • Renames the top-level domain entity from "Project" to "Font" to match how users and the product copy already talk about what they're authoring. Touches the directory layout (core/project → core/font; the existing core/font rasterisation module moves to core/rasterize), types, functions, the Zustand slice, and all call sites.
  • Rebuilds the IndexedDB glyphs store in a v4→v5 dance because the compound primary key changed from [projectId+codePoint] to [fontId+codePoint] and Dexie cannot rename a primary key in place. See ADR-0002.
  • Bumps the PortableFont JSON wire format to version: 2. Existing v1 bundles fail to import with a clear error. See ADR-0001.
  • Adds CONTEXT.md as the project's glossary, with Font canonical and Source Font preserved as the distinct concept for the uploaded TTF/OTF.

Test plan

  • pnpm exec tsc --noEmit clean
  • pnpm test — 105/105 passing
  • pnpm build clean
  • pnpm lint clean
  • Manual: "Create font" flow works on a fresh IndexedDB
  • Manual (reviewer with prior data): confirm the v3→v5 Dexie migration restores existing fonts and glyphs. Not exercised against a real prior database before merge.

🤖 Generated with Claude Code

aurpelai and others added 3 commits June 21, 2026 22:55
Renames the top-level domain entity from "Project" to "Font" to match how
users and the product copy already describe what they're authoring. Touches
the directory layout (core/project → core/font; the existing core/font
rasterisation module moves to core/rasterize), types (Project → Font),
functions (createProject → createFont and siblings), the Zustand slice, and
all call sites.

The Glyph foreign key projectId → fontId required rebuilding the IndexedDB
`glyphs` store because Dexie cannot rename a primary key in place. The
glyphs store's compound key changes from [projectId+codePoint] to
[fontId+codePoint] via a v4→v5 dance: v4 stashes records into a temporary
store and drops the original glyphs store; v5 recreates glyphs with the
new key and restores the records. Dexie processes both versions
sequentially even when a user jumps from v3 straight to v5.

The PortableFont JSON wire format is also bumped to version 2 with the
field renamed from `project` to `font` (and `projectId` → `fontId` per
glyph). Existing v1 bundles will fail to import with a clear "Unsupported
font version: 1" error.

Adds CONTEXT.md as the project's glossary, with Font as the canonical term
and Source Font preserved as the distinct concept for the uploaded
TTF/OTF.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…e rebuild

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Source Font: clarify FontFile is a persistence detail, not part of the
domain language. Cell: the editor renders layer-by-layer, not at a single
per-glyph offset. Portable Font: drop the v1/v2 wire-format note — that
belongs to ADR-0001, not the glossary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aurpelai
aurpelai merged commit 6561a8f into main Jun 21, 2026
1 check passed
@aurpelai
aurpelai deleted the refactor/rename-project-to-font branch June 21, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant