Skip to content

Commit a27ce81

Browse files
committed
refactor(docs): update documentation to reflect migration from LZZ to standard C++ files
1 parent 096e82d commit a27ce81

File tree

4 files changed

+11
-284
lines changed

4 files changed

+11
-284
lines changed

CLAUDE.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
1111
### Essential Commands
1212
- **Build**: `npm run build-release` (production build)
1313
- **Debug Build**: `npm run build-debug`
14-
- **Full Rebuild**: `npm run rebuild-release` (includes LZZ preprocessing)
1514
- **Test**: `npm test` (mocha with 5s timeout)
1615
- **Single Test**: `npx mocha test/[test-file].js`
1716
- **Benchmark**: `npm run benchmark`
18-
19-
### LZZ-Specific (Current Architecture)
20-
- **Generate C++**: `npm run lzz` (preprocesses .lzz files to .cpp/.hpp)
2117
- **Download SQLite**: `npm run download`
2218

2319
## Architecture
@@ -29,21 +25,18 @@ lib/ # JavaScript API layer
2925
├── database.js # Database class with native binding
3026
└── methods/ # Method implementations
3127
32-
src/ # C++ source (LZZ-based)
33-
├── better_sqlite3.lzz # Main file (generates .cpp/.hpp)
28+
src/ # C++ source
29+
├── better_sqlite3.cpp # Main implementation file
30+
├── better_sqlite3.hpp # Main header file
3431
├── objects/ # Core classes (Database, Statement, etc.)
3532
└── util/ # Utilities and type conversion
3633
```
3734

38-
### Critical LZZ Pattern
39-
- **Never edit `.cpp` or `.hpp` files directly** - they are generated
40-
- Edit `.lzz` files only, then run `npm run lzz`
41-
- Uses `#insert` directive (literal inclusion, not C++ #include)
42-
- Single compilation unit architecture
43-
- Order dependency matters in .lzz files
44-
45-
### LZZ Migration Status
46-
This codebase is currently migrating away from LZZ (see `lzz-migration.md`). The current branch `no-lzz-20250428` contains migration work. Be aware that the build process may change during this transition.
35+
### C++ Architecture
36+
- Standard C++ source files (.cpp/.hpp)
37+
- Modular header structure in `src/objects/` and `src/util/`
38+
- Single compilation unit architecture maintained
39+
- Uses standard C++ #include directives
4740

4841
## Native Addon Structure
4942

@@ -72,7 +65,7 @@ Tests are organized by functionality in `test/`:
7265

7366
## Development Workflow
7467

75-
1. **For C++ changes**: Edit `.lzz` files`npm run lzz``npm run build-release``npm test`
68+
1. **For C++ changes**: Edit `.cpp/.hpp` files → `npm run build-release``npm test`
7669
2. **For JavaScript changes**: Edit files in `lib/``npm test`
7770
3. **Performance testing**: Use `npm run benchmark` after changes
7871

docs/contribution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ If you've never written a native addon for Node.js before, you should start by r
5252

5353
#### C++
5454

55-
The C++ code in `better-sqlite3` is written using a tool called [`lzz`](https://github.com/WiseLibs/lzz), which alleviates the programmer from needing to write header files. If you plan on changing any C++ code, you'll need to edit `*.lzz` files and then re-compile them into `*.cpp` and `*.hpp` by running `npm run lzz` (while the `lzz` executable is in your PATH). You can learn how to download and install `lzz` [here](https://github.com/WiseLibs/lzz).
55+
The C++ code in `better-sqlite3` uses standard C++ source files (`.cpp`) and header files (`.hpp`). The codebase is organized into modular components under `src/objects/` (core classes like Database, Statement) and `src/util/` (utilities and type conversion). When making C++ changes, edit the appropriate `.cpp` and `.hpp` files directly, then build with `npm run build-release`.
5656

5757
#### Style guide
5858

lzz-migration.md

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

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@
3636
"install": "prebuild-install || node-gyp rebuild --release",
3737
"build-release": "node-gyp rebuild --release",
3838
"build-debug": "node-gyp rebuild --debug",
39-
"rebuild-release": "npm run lzz && npm run build-release",
40-
"rebuild-debug": "npm run lzz && npm run build-debug",
4139
"test": "mocha --exit --slow=75 --timeout=5000",
4240
"benchmark": "node benchmark",
4341
"download": "bash ./deps/download.sh",
44-
"fmt": "find src -name '*.cpp' -o -name '*.hpp' | grep -v withlines | xargs clang-format -i",
45-
"lzz": "lzz -hx hpp -sx cpp -k BETTER_SQLITE3 -d -hl -sl -e ./src/better_sqlite3.lzz"
42+
"fmt": "find src -name '*.cpp' -o -name '*.hpp' | grep -v withlines | xargs clang-format -i"
4643
},
4744
"license": "MIT",
4845
"keywords": [

0 commit comments

Comments
 (0)