@plasius/hexagons 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -20,6 +20,21 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
20
20
  - **Security**
21
21
  - (placeholder)
22
22
 
23
+ ## [1.0.8] - 2026-03-01
24
+
25
+ - **Added**
26
+ - (placeholder)
27
+
28
+ - **Changed**
29
+ - (placeholder)
30
+
31
+ - **Fixed**
32
+ - Enforced CommonJS runtime compatibility for dual-build output by generating and validating `dist-cjs/package.json` (`type: commonjs`) during build and package verification.
33
+ - (placeholder)
34
+
35
+ - **Security**
36
+ - (placeholder)
37
+
23
38
  ## [1.0.7] - 2026-03-01
24
39
 
25
40
  - **Added**
@@ -104,7 +119,7 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
104
119
 
105
120
  ---
106
121
 
107
- [Unreleased]: https://github.com/Plasius-LTD/hexagons/compare/v1.0.7...HEAD
122
+ [Unreleased]: https://github.com/Plasius-LTD/hexagons/compare/v1.0.8...HEAD
108
123
 
109
124
  ## [1.0.0] - 2026-02-11
110
125
 
@@ -124,3 +139,4 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
124
139
  [1.0.5]: https://github.com/Plasius-LTD/hexagons/releases/tag/v1.0.5
125
140
  [1.0.6]: https://github.com/Plasius-LTD/hexagons/releases/tag/v1.0.6
126
141
  [1.0.7]: https://github.com/Plasius-LTD/hexagons/releases/tag/v1.0.7
142
+ [1.0.8]: https://github.com/Plasius-LTD/hexagons/releases/tag/v1.0.8
package/README.md CHANGED
@@ -19,6 +19,12 @@ Primary demo surface name: **Generator**.
19
19
  npm install @plasius/hexagons
20
20
  ```
21
21
 
22
+ ## Module formats
23
+
24
+ This package publishes dual ESM and CJS artifacts.
25
+ When CJS output is emitted under `dist-cjs/*.js` with `type: module`, `dist-cjs/package.json` is generated with `{ "type": "commonjs" }` to ensure Node `require(...)` compatibility.
26
+
27
+
22
28
  ## Usage
23
29
 
24
30
  ```ts
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,22 @@
1
+ # ADR-0003: Dual ESM and CJS Runtime Compatibility
2
+
3
+ - Date: 2026-03-01
4
+ - Status: Accepted
5
+
6
+ ## Context
7
+
8
+ `@plasius/hexagons` publishes dual ESM and CJS entry points. This package currently emits CJS output under `dist-cjs/*.js` while the repository root uses `type: module`. Without an explicit CommonJS boundary for `dist-cjs`, Node can interpret those files as ESM and fail at runtime for `require(...)` consumers.
9
+
10
+ ## Decision
11
+
12
+ Keep dual output and enforce a runtime-compatible CJS boundary by:
13
+
14
+ - generating `dist-cjs/package.json` with `{ "type": "commonjs" }` as part of `build:cjs`;
15
+ - validating this metadata in `pack:check`;
16
+ - ensuring the packed artifact includes `dist-cjs/package.json`.
17
+
18
+ ## Consequences
19
+
20
+ - Node CommonJS consumers can reliably load `@plasius/hexagons` via `require(...)`.
21
+ - ESM consumers remain unchanged.
22
+ - CD publish checks fail fast if CJS runtime compatibility metadata is missing.
@@ -2,3 +2,4 @@
2
2
 
3
3
  - [ADR-0001: Standalone @plasius/hexagons Package Scope](./adr-0001-hexagons-package-scope.md)
4
4
  - [ADR-0002: Public Repository Governance Baseline](./adr-0002-public-repo-governance.md)
5
+ - [ADR-0003: Dual ESM and CJS Runtime Compatibility](./adr-0003-dual-esm-cjs-runtime-compatibility.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasius/hexagons",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "main": "./dist-cjs/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  "audit:npm": "npm audit --audit-level=high --omit=dev",
22
22
  "audit:test": "vitest run --coverage",
23
23
  "audit:all": "npm-run-all -l audit:ts audit:eslint audit:deps audit:npm audit:test",
24
- "build:cjs": "tsc -p tsconfig.json --module commonjs --moduleResolution node --outDir dist-cjs --tsBuildInfoFile dist-cjs/tsconfig.tsbuildinfo --listEmittedFiles && rsync -av --include '*/' --include '*.module.css' --exclude '*' src/ dist-cjs/ || true",
24
+ "build:cjs": "tsc -p tsconfig.json --module commonjs --moduleResolution node --outDir dist-cjs --tsBuildInfoFile dist-cjs/tsconfig.tsbuildinfo --listEmittedFiles && rsync -av --include '*/' --include '*.module.css' --exclude '*' src/ dist-cjs/ || true && node scripts/write-cjs-package-json.cjs",
25
25
  "lint": "eslint . --max-warnings=0",
26
26
  "prepare": "npm run build",
27
27
  "pack:check": "node scripts/verify-public-package.cjs",