Skip to content

Commit 1bbc6c0

Browse files
authored
Merge pull request #97 from aspiers/gen-schemas
auto-generate lexicon schema Markdown tables
2 parents be1ab12 + ceddab9 commit 1bbc6c0

File tree

13 files changed

+744
-1356
lines changed

13 files changed

+744
-1356
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hypercerts-org/lexicon": minor
3+
---
4+
5+
Move schema documentation tables from README.md to auto-generated SCHEMAS.md to reduce git merge conflicts. The SCHEMAS.md file is now auto-generated from lexicon definitions and included in the distributed package.

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Custom merge driver for auto-generated files
2+
# When SCHEMAS.md has conflicts, regenerate it and use the result
3+
SCHEMAS.md merge=schemas

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist/
44
generated/
55
pnpm-lock.yaml
66
/tmp/
7+
lexicons.md

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ and type declaration files in `dist/`.
5858

5959
## Development Commands
6060

61+
**⚠️ IMPORTANT FOR AI AGENTS**: Always run scripts through npm scripts (e.g., `npm run gen-schemas-md`) rather than executing Node.js files directly (e.g., `node scripts/generate-schemas.js`). This ensures proper environment setup and consistency with the project's workflow.
62+
6163
### Code Generation
6264

6365
```bash
@@ -70,6 +72,9 @@ npm run gen-index
7072
# Build distributable bundles
7173
npm run build
7274

75+
# Generate SCHEMAS.md from lexicon definitions
76+
npm run gen-schemas-md
77+
7378
# Generate markdown documentation from lexicons
7479
npm run gen-md
7580

@@ -205,6 +210,7 @@ lexicons/ # Source of truth (committed)
205210
scripts/ # Build scripts (committed)
206211
create-shims.sh # Generate type shims for external lexicons
207212
generate-exports.js # Auto-generate generated/exports.ts
213+
generate-schemas.js # Auto-generate SCHEMAS.md from lexicons
208214
209215
generated/ # Auto-generated (gitignored)
210216
index.ts # Generated client (not exposed)

README.md

Lines changed: 6 additions & 317 deletions
Large diffs are not rendered by default.

SCHEMAS.md

Lines changed: 295 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)