Skip to content

Commit 8d5cbe0

Browse files
committed
feat(core): public API export + package config
- Add sideEffects: false for tree-shaking - Add files field to limit published content - Add keywords, repository, homepage, bugs fields for npm discoverability - Verify barrel export is complete Closes #22
1 parent f2cef5d commit 8d5cbe0

3 files changed

Lines changed: 47 additions & 4 deletions

File tree

‎.changeset/core-package-config.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@ocpp-debugkit/core': minor
3+
---
4+
5+
Finalize core package for npm publishing.
6+
7+
- Add `sideEffects: false` for tree-shaking
8+
- Add `files` field to limit published content
9+
- Add `keywords`, `repository`, `homepage`, `bugs` fields for npm discoverability
10+
- Verify barrel export is complete (types, schemas, parser, normalizer, timeline, detection, summarizer, validator, fixtures)

‎CURRENT_STATE.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,27 @@ report exported. CLI and web inspector.
6969
- ✅ `packages/core/src/types.ts` — updated with `Failure`, `Scenario`, `SessionSummary`, `ValidationResult` types
7070
- ✅ 78 unit tests (46 normalizer + 32 parser)
7171

72-
### Core Package — Timeline + Detection + Summarizer + Validator (in progress — this PR)
72+
### Core Package — Timeline + Detection + Summarizer + Validator (PR #34)
7373

7474
- ✅ `packages/core/src/timeline.ts` — `buildSessionTimeline()` correlating events by `transactionId` (ADR-0006)
7575
- ✅ `packages/core/src/detection.ts` — `detectFailures()` with 3 rules: `FAILED_AUTHORIZATION`, `CONNECTOR_FAULT`, `STATION_OFFLINE_DURING_SESSION`
7676
- ✅ `packages/core/src/summarizer.ts` — `summarizeSession()` / `summarizeSessions()` producing overview stats
7777
- ✅ `packages/core/src/validator.ts` — `validateMessage()` / `validateMessages()` checking OCPP 1.6 JSON structural compliance
7878
- ✅ 40 additional tests (10 timeline + 11 detection + 5 summarizer + 14 validator)
7979

80+
### Core Package — Public API Export + Package Config (in progress — this PR)
81+
82+
- ✅ Barrel export complete (types, schemas, parser, normalizer, timeline, detection, summarizer, validator, fixtures)
83+
- ✅ `sideEffects: false` for tree-shaking
84+
- ✅ `files` field limits published content to `dist/` + docs
85+
- ✅ `keywords`, `repository`, `homepage`, `bugs` fields for npm discoverability
86+
- ✅ Package is npm-publish-ready (`access: public`)
87+
8088
## What's Next
8189

8290
1. **Issue #20** → complete (PR #33): data model + parser + normalizer
83-
2. **Issue #21** (this PR) → complete: timeline + detection + summarizer + validator
84-
3. **Issue #22**: Core public API export + package config
91+
2. **Issue #21** → complete (PR #34): timeline + detection + summarizer + validator
92+
3. **Issue #22** (this PR) → complete: public API export + package config
8593
4. **Issue #23**: Scenarios package (format + 5 initial scenarios)
8694
5. **Issue #24**: Reporter package (Markdown report generator)
8795
6. **Issue #25**: CLI package (scaffold + inspect + report + scenario commands)
@@ -94,7 +102,7 @@ report exported. CLI and web inspector.
94102

95103
| Package | Status | Version |
96104
|---------|--------|---------|
97-
| `@ocpp-debugkit/core` | in progress (parser + timeline + detection + summarizer + validator) | 0.0.0 |
105+
| `@ocpp-debugkit/core` | in progress (package config finalized, ready for downstream) | 0.0.0 |
98106
| `@ocpp-debugkit/scenarios` | not started | — |
99107
| `@ocpp-debugkit/reporter` | not started | — |
100108
| `@ocpp-debugkit/cli` | not started | — |

‎packages/core/package.json‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Core data model, parser, normalizer, timeline, and failure detection for OCPP DebugKit.",
55
"license": "Apache-2.0",
66
"type": "module",
7+
"sideEffects": false,
78
"main": "./dist/index.js",
89
"module": "./dist/index.js",
910
"types": "./dist/index.d.ts",
@@ -17,6 +18,30 @@
1718
"import": "./dist/fixtures/index.js"
1819
}
1920
},
21+
"files": [
22+
"dist",
23+
"README.md",
24+
"NOTICE"
25+
],
26+
"keywords": [
27+
"ocpp",
28+
"ocpp1.6",
29+
"ev-charging",
30+
"charge-point",
31+
"csms",
32+
"debugging",
33+
"trace-parser",
34+
"failure-detection"
35+
],
36+
"repository": {
37+
"type": "git",
38+
"url": "https://github.com/ocpp-debugkit/ocpp-debugkit.git",
39+
"directory": "packages/core"
40+
},
41+
"homepage": "https://github.com/ocpp-debugkit/ocpp-debugkit/tree/main/packages/core",
42+
"bugs": {
43+
"url": "https://github.com/ocpp-debugkit/ocpp-debugkit/issues"
44+
},
2045
"scripts": {
2146
"build": "tsc -p tsconfig.json",
2247
"typecheck": "tsc --noEmit",

0 commit comments

Comments
 (0)