Skip to content

Commit aa6b70e

Browse files
feat(toolkit): consolidate packages into @ocpp-debugkit/toolkit with subpath exports (#55)
* feat(toolkit): consolidate packages into @ocpp-debugkit/toolkit with subpath exports - Create packages/toolkit/ with single @ocpp-debugkit/toolkit package - Move core, scenarios, reporter, CLI code into src/ internal modules - Add src/replay/ and src/react/ stub modules - Configure subpath exports: /core, /scenarios, /reporter, /replay, /react, /cli, /fixtures - Configure ESM build with TypeScript declarations, tree-shaking (sideEffects: false) - CLI binary ocpp-debugkit via package.json#bin - Update web app to consume @ocpp-debugkit/toolkit - Delete old package directories (core, scenarios, reporter, cli) - All 196 existing tests pass from new locations - Update AGENTS.md and CURRENT_STATE.md - Add changeset (minor bump) Closes #54 * chore: remove changeset from consolidation PR - will add at release time The changeset with a minor bump would trigger auto-publish of @ocpp-debugkit/toolkit when PR #55 merges via the release workflow. We don't want to publish until all v0.2.0 work is complete. The changeset will be added as part of the release issue (#33).
1 parent b698528 commit aa6b70e

68 files changed

Lines changed: 606 additions & 737 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ build/
66
coverage/
77
pnpm-lock.yaml
88
*.md
9+
apps/web/next-env.d.ts

AGENTS.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ infrastructure developers.
2121
```
2222
ocpp-debugkit/
2323
├── packages/
24-
│ ├── core/ # Data model, parser, normalizer, timeline, failure detection
25-
│ ├── scenarios/ # Predefined trace scenarios for testing
26-
│ ├── reporter/ # Report generators (Markdown, HTML)
27-
│ ├── cli/ # Command-line interface
28-
│ ├── replay/ # Replay engine (v0.2+)
29-
│ └── react/ # Reusable React components (v0.2+)
24+
│ └── toolkit/ # Single npm package @ocpp-debugkit/toolkit
25+
│ └── src/
26+
│ ├── core/ # Data model, parser, normalizer, timeline, failure detection
27+
│ ├── scenarios/ # Predefined trace scenarios for testing
28+
│ ├── reporter/ # Report generators (Markdown, HTML)
29+
│ ├── replay/ # Replay engine
30+
│ ├── react/ # Reusable React components
31+
│ └── cli/ # Command-line interface (bin: ocpp-debugkit)
3032
├── apps/
3133
│ └── web/ # Single Next.js app (landing, inspector, docs, blog)
3234
├── turbo.json # Turborepo task pipeline
@@ -52,16 +54,20 @@ pnpm changeset # Add a changeset for release
5254
## Package Dependency Graph
5355

5456
```
55-
core ← everything depends on this
56-
/ | \
57-
scenarios | reporter | replay
58-
\ | / |
59-
cli |
60-
| |
61-
apps/web (single Next.js app)
57+
@ocpp-debugkit/toolkit (single package, subpath exports)
58+
src/
59+
core ← internal modules depend on this
60+
scenarios ← depends on core (internal)
61+
reporter ← depends on core (internal)
62+
replay ← depends on core (internal)
63+
react ← depends on core, scenarios, reporter, replay (internal)
64+
cli ← depends on core, scenarios, reporter (internal; Node-only)
65+
66+
apps/web (single Next.js app)
67+
imports: @ocpp-debugkit/toolkit/core, /scenarios, /reporter, /react, /replay
6268
```
6369

64-
**Build order:** core → scenarios/reporter/replay → cli → app
70+
**Build order:** toolkit (all internal modules in one tsc pass) → app
6571

6672
## Testing Conventions
6773

CURRENT_STATE.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
55
## Current Version
66

7-
`0.1.0`Inspector MVP (released)
7+
`0.2.0`Packaging Consolidation + Scenario Evaluator & Replay (in progress)
88

99
## Active Milestone
1010

11-
**v0.1.0 — Inspector MVP (complete)**
11+
**v0.2.0 — Packaging Consolidation + Scenario Evaluator & Replay (in progress)**
1212

13-
All v0.1.0 issues complete. Packages published to npm. Web app deployed.
13+
Phase 0: Packaging consolidation — creating `@ocpp-debugkit/toolkit` single package with subpath exports.
1414

1515
## What's Done
1616

@@ -156,11 +156,23 @@ All v0.1.0 issues complete. Packages published to npm. Web app deployed.
156156
-`/docs` index with navigation sidebar
157157
-`/docs/quickstart`, `/docs/glossary`, `/docs/architecture`, `/docs/trace-format`, `/docs/cli`, `/docs/scenarios`
158158

159+
### Packaging Consolidation (v0.2.0 Phase 0 — in progress)
160+
161+
- 🔄 `packages/toolkit/` — single `@ocpp-debugkit/toolkit` package created
162+
- 🔄 Core, scenarios, reporter, CLI code moved into `src/core/`, `src/scenarios/`, `src/reporter/`, `src/cli/`
163+
- 🔄 `src/replay/` and `src/react/` stub modules added
164+
- 🔄 Subpath exports configured (`/core`, `/scenarios`, `/reporter`, `/replay`, `/react`, `/cli`, `/fixtures`)
165+
- 🔄 CLI binary `ocpp-debugkit` via `package.json#bin`
166+
- 🔄 Old package directories removed
167+
- 🔄 Web app updated to consume `@ocpp-debugkit/toolkit`
168+
- 🔄 All 196 existing tests pass from new locations
169+
- 🔄 Build, lint, typecheck, format all green
170+
159171
## What's Next
160172

161-
1. **v0.2.0**Scenario evaluator & replay (expanded failure rules, replay
162-
engine, `@ocpp-debugkit/react`, CLI external scenario files, HTML report
163-
format, app replay UI)
173+
1. **v0.2.0 remaining**External fixture test, migration docs, release workflow
174+
simplification, expanded failure detection (7 new rules), 10 scenarios, replay
175+
engine, React components, HTML reports, app replay UI
164176
2. **v0.3.0** — Integrations & OSS credibility (trace diffing, CI mode,
165177
anonymize, integration examples)
166178
3. **v1.0.0** — API stabilization, 20+ scenarios, docs overhaul, contributor
@@ -174,10 +186,9 @@ All v0.1.0 issues complete. Packages published to npm. Web app deployed.
174186

175187
| Package | Status | Version |
176188
|---------|--------|---------|
177-
| `@ocpp-debugkit/core` | published | 0.1.1 |
178-
| `@ocpp-debugkit/scenarios` | published | 0.1.1 |
179-
| `@ocpp-debugkit/reporter` | published | 0.1.1 |
180-
| `@ocpp-debugkit/cli` | published | 0.1.1 |
181-
| `@ocpp-debugkit/replay` | not started ||
182-
| `@ocpp-debugkit/react` | not started ||
189+
| `@ocpp-debugkit/toolkit` | in progress | 0.2.0 |
190+
| `@ocpp-debugkit/core` | published (deprecated after v0.2.0) | 0.1.1 |
191+
| `@ocpp-debugkit/scenarios` | published (deprecated after v0.2.0) | 0.1.1 |
192+
| `@ocpp-debugkit/reporter` | published (deprecated after v0.2.0) | 0.1.1 |
193+
| `@ocpp-debugkit/cli` | published (deprecated after v0.2.0) | 0.1.1 |
183194
| `apps/web` | deployed ||

apps/web/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
"test:e2e": "playwright test"
1313
},
1414
"dependencies": {
15-
"@ocpp-debugkit/core": "workspace:*",
16-
"@ocpp-debugkit/reporter": "workspace:*",
17-
"@ocpp-debugkit/scenarios": "workspace:*",
15+
"@ocpp-debugkit/toolkit": "workspace:*",
1816
"next": "16.2.10",
1917
"react": "19.2.4",
2018
"react-dom": "19.2.4"

apps/web/src/app/docs/cli/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function CliReferencePage() {
99

1010
<h2>Installation</h2>
1111
<pre>
12-
<code>{`npm install -g @ocpp-debugkit/cli`}</code>
12+
<code>{`npm install -g @ocpp-debugkit/toolkit`}</code>
1313
</pre>
1414

1515
<h2>inspect</h2>

apps/web/src/app/docs/quickstart/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function QuickStartPage() {
55

66
<h2>Install the CLI</h2>
77
<pre>
8-
<code>{`npm install -g @ocpp-debugkit/cli`}</code>
8+
<code>{`npm install -g @ocpp-debugkit/toolkit`}</code>
99
</pre>
1010

1111
<h2>Inspect a trace</h2>
@@ -40,7 +40,7 @@ ocpp-debugkit scenario run failed-auth`}</code>
4040
<h2>Use the core library</h2>
4141
<p>For programmatic use in your own TypeScript/JavaScript project:</p>
4242
<pre>
43-
<code>{`import { parseTrace, buildSessionTimeline, detectFailures } from '@ocpp-debugkit/core';
43+
<code>{`import { parseTrace, buildSessionTimeline, detectFailures } from '@ocpp-debugkit/toolkit/core';
4444
4545
const result = parseTrace(traceString);
4646
const sessions = buildSessionTimeline(result.events);

apps/web/src/app/inspector/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import {
1414
type Scenario,
1515
ParseError,
1616
MAX_INPUT_SIZE_BYTES,
17-
} from '@ocpp-debugkit/core';
18-
import { generateMarkdownReport } from '@ocpp-debugkit/reporter';
19-
import { scenarios } from '@ocpp-debugkit/scenarios';
17+
} from '@ocpp-debugkit/toolkit/core';
18+
import { generateMarkdownReport } from '@ocpp-debugkit/toolkit/reporter';
19+
import { scenarios } from '@ocpp-debugkit/toolkit/scenarios';
2020

2121
// ---------------------------------------------------------------------------
2222
// Types

apps/web/src/app/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ export default function HomePage() {
7373
Architecture
7474
</h2>
7575
<p className="mx-auto mt-4 max-w-2xl text-center text-neutral-600 dark:text-neutral-400">
76-
A modular monorepo with independent packages. Use only what you need.
76+
A single package with modular subpath exports. Use only what you need.
7777
</p>
7878
<div className="mt-8 grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
79-
<PackageCard name="@ocpp-debugkit/core" desc="Parser, normalizer, timeline, detection" />
80-
<PackageCard name="@ocpp-debugkit/scenarios" desc="5 predefined test scenarios" />
81-
<PackageCard name="@ocpp-debugkit/reporter" desc="Markdown report generator" />
82-
<PackageCard name="@ocpp-debugkit/cli" desc="Command-line interface" />
79+
<PackageCard name="/core" desc="Parser, normalizer, timeline, detection" />
80+
<PackageCard name="/scenarios" desc="Predefined test scenarios" />
81+
<PackageCard name="/reporter" desc="Markdown + HTML report generator" />
82+
<PackageCard name="/replay" desc="Replay engine" />
8383
</div>
8484
</section>
8585

@@ -91,7 +91,7 @@ export default function HomePage() {
9191
<div className="mt-8 rounded-lg bg-neutral-900 p-6 dark:bg-neutral-900">
9292
<pre className="overflow-x-auto text-sm text-neutral-100">
9393
<code>{`# Install the CLI
94-
npm install -g @ocpp-debugkit/cli
94+
npm install -g @ocpp-debugkit/toolkit
9595
9696
# Inspect a trace
9797
ocpp-debugkit inspect trace.json

packages/cli/CHANGELOG.md

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

packages/cli/README.md

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

0 commit comments

Comments
 (0)