Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/common-teeth-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@lingo.dev/compiler": patch
---

- Migrate metadata storage from JSON files to LMDB
- New storage locations: .lingo/metadata-dev/ and .lingo/metadata-build/
- Update compiler docs
- Remove proper-lockfile dependency
- New tests for MetadataManager
5 changes: 3 additions & 2 deletions packages/new-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,10 @@ The compiler is organized into several key modules:

#### `src/metadata/` - Translation metadata management

- **`manager.ts`** - CRUD operations for `.lingo/metadata.json`
- Thread-safe metadata file operations with file locking
- **`manager.ts`** - CRUD operations for LMDB metadata database
- Uses LMDB for high-performance key-value storage with built-in concurrency
- Manages translation entries with hash-based identifiers
- Stores metadata in `.lingo/metadata-dev/` (development) or `.lingo/metadata-build/` (production)

#### `src/translators/` - Translation provider abstraction

Expand Down
6 changes: 3 additions & 3 deletions packages/new-compiler/docs/TRANSLATION_ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata management, translation execution, and caching.

## Architectural Principles

1. **Metadata file structure** is only known by:
- Metadata Manager (reads/writes metadata.json)
1. **Metadata storage** is only known by:
- Metadata Manager (reads/writes LMDB database)
- Translation Service (orchestrator that coordinates everything)

2. **Translators are stateless** and work with abstract `TranslatableEntry` types
Expand Down Expand Up @@ -37,7 +37,7 @@ metadata management, translation execution, and caching.
┌──────────────────────────────────────────────────┐
│ MetadataManager │
│ - ONLY component that reads/writes metadata.json
│ - ONLY component that reads/writes LMDB database
│ - Provides metadata loading/saving │
│ - Returns TranslationEntry[] │
└────────────────┬─────────────────────────────────┘
Expand Down
3 changes: 1 addition & 2 deletions packages/new-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
"@types/babel__traverse": "7.28.0",
"@types/ini": "4.1.1",
"@types/node": "25.0.3",
"@types/proper-lockfile": "4.1.4",
"@types/react": "19.2.7",
"@types/react-dom": "19.2.3",
"@types/ws": "8.18.1",
Expand Down Expand Up @@ -178,7 +177,7 @@
"lodash": "4.17.21",
"node-machine-id": "1.1.12",
"posthog-node": "5.14.0",
"proper-lockfile": "4.1.2",
"lmdb": "3.2.6",
"ws": "8.18.3"
},
"peerDependencies": {
Expand Down
Loading