You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename the project from law2md to lexbuild with the @lexbuild/ npm
namespace. Updates package names, bin entry, workspace deps, imports,
CLI program name, UI labels, GENERATOR constant, test assertions,
fixture snapshots, all documentation, changelogs, .gitignore comments,
and changeset config. Regenerated pnpm-lock.yaml.
No functional changes.
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
# law2md Workspace Instructions
1
+
# lexbuild Workspace Instructions
2
2
3
3
## Scope
4
4
5
5
These instructions apply to all work in this repository. Keep changes minimal, targeted, and consistent with existing package boundaries. See `CLAUDE.md` for the full USLM schema reference, design decisions, and common pitfalls.
6
6
7
7
## Project Overview
8
8
9
-
`law2md` converts U.S. legislative XML (USLM schema) into structured Markdown for AI/RAG ingestion. It is a monorepo built with Turborepo, pnpm workspaces, TypeScript, and Node.js.
9
+
`lexbuild` converts U.S. legislative XML (USLM schema) into structured Markdown for AI/RAG ingestion. It is a monorepo built with Turborepo, pnpm workspaces, TypeScript, and Node.js.
Respect boundaries: keep generic parsing/rendering logic in `core`, USC-specific behavior in `usc`, and CLI orchestration in `cli`. Internal packages use `workspace:*` protocol for dependencies.
@@ -105,11 +105,11 @@ and this project adheres to [Conventional Commits](https://www.conventionalcommi
105
105
#### CI/CD
106
106
107
107
-**GitHub Actions CI** (`.github/workflows/ci.yml`): lint, typecheck, and test on push to main and pull requests. Node 20/22 matrix, pnpm store caching, concurrency groups. ([`b8f45a7`](../../commit/b8f45a7))
108
-
-**npm publish workflow** (`.github/workflows/publish.yml`): changeset-based publish via `changesets/action@v1`. Creates version PR when changesets pending, publishes `@law2md/core`, `@law2md/usc`, and `law2md` to npm when version PR merged. Requires `NPM_TOKEN` secret. ([`ef8d3b2`](../../commit/ef8d3b2))
108
+
-**npm publish workflow** (`.github/workflows/publish.yml`): changeset-based publish via `changesets/action@v1`. Creates version PR when changesets pending, publishes `@lexbuild/core`, `@lexbuild/usc`, and `lexbuild` to npm when version PR merged. Requires `NPM_TOKEN` secret. ([`ef8d3b2`](../../commit/ef8d3b2))
109
109
110
110
### Changed
111
111
112
-
-**README.md**: updated for public launch — CI badge, npm install instructions, `law2md` command in usage examples, Phase 4 status complete, test count 121→137, link to CONTRIBUTING.md ([`d33e1ff`](../../commit/d33e1ff))
112
+
-**README.md**: updated for public launch — CI badge, npm install instructions, `lexbuild` command in usage examples, Phase 4 status complete, test count 121→137, link to CONTRIBUTING.md ([`d33e1ff`](../../commit/d33e1ff))
113
113
114
114
---
115
115
@@ -120,7 +120,7 @@ and this project adheres to [Conventional Commits](https://www.conventionalcommi
120
120
#### OLRC Downloader
121
121
122
122
-**Downloader** (`packages/usc/src/downloader.ts`): `downloadTitles()` fetches USC XML zips from OLRC, extracts via `yauzl`, cleans up temp files. Hardcoded `CURRENT_RELEASE_POINT` with `--release-point` override for future automation. ([`69444bc`](../../commit/69444bc))
123
-
-**`law2md download` command** (`packages/cli/src/commands/download.ts`): `--title N` for individual titles, `--all` for all 54, `-o` for output directory. Reports per-title file sizes and elapsed time. ([`1743e7c`](../../commit/1743e7c))
123
+
-**`lexbuild download` command** (`packages/cli/src/commands/download.ts`): `--title N` for individual titles, `--all` for all 54, `-o` for output directory. Reports per-title file sizes and elapsed time. ([`1743e7c`](../../commit/1743e7c))
124
124
125
125
#### Dry-Run Mode
126
126
@@ -205,13 +205,13 @@ and this project adheres to [Conventional Commits](https://www.conventionalcommi
205
205
206
206
#### Scaffold
207
207
208
-
-**Monorepo scaffold** with pnpm workspaces, Turborepo pipeline (build/test/lint/typecheck/dev), and three packages: `@law2md/core`, `@law2md/usc`, `law2md` (CLI) ([`9f55906`](../../commit/9f55906))
208
+
-**Monorepo scaffold** with pnpm workspaces, Turborepo pipeline (build/test/lint/typecheck/dev), and three packages: `@lexbuild/core`, `@lexbuild/usc`, `lexbuild` (CLI) ([`9f55906`](../../commit/9f55906))
-**XML Parser** (`src/xml/parser.ts`): streaming SAX parser wrapping `saxes` with namespace normalization — USLM default namespace elements emit bare names (`section`), other namespaces emit prefixed names (`xhtml:table`, `dc:title`). Supports `parseString()` and `parseStream()`. ([`120a553`](../../commit/120a553))
217
217
-**Namespace constants** (`src/xml/namespace.ts`): `USLM_NS`, `XHTML_NS`, `DC_NS`, `DCTERMS_NS`, `XSI_NS`, plus element classification sets (`LEVEL_ELEMENTS`, `CONTENT_ELEMENTS`, `INLINE_ELEMENTS`, `NOTE_ELEMENTS`, etc.) ([`120a553`](../../commit/120a553))
@@ -220,13 +220,13 @@ and this project adheres to [Conventional Commits](https://www.conventionalcommi
220
220
-**Markdown Renderer** (`src/markdown/renderer.ts`): stateless AST-to-Markdown conversion with bold inline numbering for subsections (not headings), three cross-reference link modes (plaintext/canonical/relative), source credits after horizontal rule, notes with H2/H3 headings, and blockquote rendering for quoted content ([`9c7189d`](../../commit/9c7189d))
221
221
-**Frontmatter Generator** (`src/markdown/frontmatter.ts`): `FrontmatterData` to YAML serialization with controlled field ordering, `format_version` ("1.0.0"), and `generator` metadata ([`9c7189d`](../../commit/9c7189d))
222
222
223
-
#### USC (`@law2md/usc`)
223
+
#### USC (`@lexbuild/usc`)
224
224
225
225
-**USC Converter** (`src/converter.ts`): full pipeline orchestrator for a single USC XML file — ReadStream → SAX parser → AST builder (emit at section) → Markdown renderer + frontmatter → file writer. Outputs to `usc/title-NN/chapter-NN/section-N.md`. Supports source credit toggling. Uses collect-then-write pattern to avoid async issues during SAX streaming. ([`eb22560`](../../commit/eb22560))
226
226
227
-
#### CLI (`law2md`)
227
+
#### CLI (`lexbuild`)
228
228
229
-
-**`law2md convert` command** (`src/commands/convert.ts`): accepts input XML path, output directory, link style, and source credit toggle. Validates input, reports timing and section count, supports verbose mode. ([`2147c05`](../../commit/2147c05))
229
+
-**`lexbuild convert` command** (`src/commands/convert.ts`): accepts input XML path, output directory, link style, and source credit toggle. Validates input, reports timing and section count, supports verbose mode. ([`2147c05`](../../commit/2147c05))
230
230
231
231
#### Documentation
232
232
@@ -253,4 +253,4 @@ and this project adheres to [Conventional Commits](https://www.conventionalcommi
Copy file name to clipboardExpand all lines: CLAUDE.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
-
# CLAUDE.md — law2md
1
+
# CLAUDE.md — lexbuild
2
2
3
3
## Project Overview
4
4
5
-
`law2md` converts U.S. legislative XML (USLM schema) into structured Markdown for AI/RAG ingestion. It is a monorepo built with Turborepo, pnpm workspaces, TypeScript, and Node.js.
5
+
`lexbuild` converts U.S. legislative XML (USLM schema) into structured Markdown for AI/RAG ingestion. It is a monorepo built with Turborepo, pnpm workspaces, TypeScript, and Node.js.
> **Note**: The extension architecture is aspirational. No pluggable handler interfaces exist yet — element handling is built into the `ASTBuilder` class. See `docs/extending.md` for details.
314
314
315
315
1. Create a new package: `packages/cfr/` (or `packages/state-il/`, etc.)
316
-
2. Implement a converter function analogous to `convertTitle()` in `@law2md/usc`
316
+
2. Implement a converter function analogous to `convertTitle()` in `@lexbuild/usc`
317
317
3. Extend or adapt the `ASTBuilder` for source-specific elements
318
318
4. Add a new CLI command in `packages/cli`
319
-
5. Reuse `@law2md/core` for XML parsing, AST types, Markdown rendering, and frontmatter
319
+
5. Reuse `@lexbuild/core` for XML parsing, AST types, Markdown rendering, and frontmatter
320
320
6. Add source-specific download logic if applicable
321
321
7. Document the source's XML schema in the package README
@@ -37,9 +37,9 @@ pnpm turbo dev # Watch mode (rebuild on change)
37
37
To scope commands to a single package:
38
38
39
39
```bash
40
-
pnpm turbo build --filter=@law2md/core
41
-
pnpm turbo test --filter=@law2md/usc
42
-
pnpm turbo test --filter=law2md
40
+
pnpm turbo build --filter=@lexbuild/core
41
+
pnpm turbo test --filter=@lexbuild/usc
42
+
pnpm turbo test --filter=lexbuild
43
43
```
44
44
45
45
### Running the CLI Locally
@@ -65,9 +65,9 @@ Formatting is enforced by Prettier (double quotes, trailing commas, 100 char pri
65
65
66
66
```
67
67
packages/
68
-
core/ @law2md/core — XML parsing, AST, Markdown rendering, shared utilities
69
-
usc/ @law2md/usc — U.S. Code conversion logic and OLRC downloader
70
-
cli/ law2md — CLI entry point (the published npm package)
68
+
core/ @lexbuild/core — XML parsing, AST, Markdown rendering, shared utilities
69
+
usc/ @lexbuild/usc — U.S. Code conversion logic and OLRC downloader
70
+
cli/ lexbuild — CLI entry point (the published npm package)
71
71
```
72
72
73
73
The `core` package provides the general-purpose XML-to-Markdown pipeline. The `usc` package adds U.S. Code-specific handling. The `cli` package wires everything together as a command-line tool. Internal packages use `workspace:*` protocol for dependencies.
@@ -103,7 +103,7 @@ Tests are co-located with source files (`parser.ts` → `parser.test.ts`).
103
103
104
104
```bash
105
105
pnpm turbo test# Run all tests
106
-
pnpm turbo test --filter=@law2md/usc # Run one package
106
+
pnpm turbo test --filter=@lexbuild/usc # Run one package
107
107
```
108
108
109
109
Name test cases descriptively:
@@ -128,7 +128,7 @@ Review the diff in `fixtures/expected/` to confirm only intended changes, then c
128
128
129
129
-`fixtures/fragments/` — Small synthetic XML snippets for unit tests (committed)
130
130
-`fixtures/expected/` — Pinned expected output for snapshot tests (committed)
131
-
-`downloads/usc/xml/` — Full USC XML files (gitignored, download with `law2md download`)
131
+
-`downloads/usc/xml/` — Full USC XML files (gitignored, download with `lexbuild download`)
0 commit comments