@plasius/hexagons 1.0.6 → 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
@@ -8,6 +8,35 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ - **Added**
12
+ - (placeholder)
13
+
14
+ - **Changed**
15
+ - (placeholder)
16
+
17
+ - **Fixed**
18
+ - (placeholder)
19
+
20
+ - **Security**
21
+ - (placeholder)
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
+
38
+ ## [1.0.7] - 2026-03-01
39
+
11
40
  - **Added**
12
41
  - (placeholder)
13
42
 
@@ -90,7 +119,7 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
90
119
 
91
120
  ---
92
121
 
93
- [Unreleased]: https://github.com/Plasius-LTD/hexagons/compare/v1.0.6...HEAD
122
+ [Unreleased]: https://github.com/Plasius-LTD/hexagons/compare/v1.0.8...HEAD
94
123
 
95
124
  ## [1.0.0] - 2026-02-11
96
125
 
@@ -109,3 +138,5 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
109
138
  [1.0.4]: https://github.com/Plasius-LTD/hexagons/releases/tag/v1.0.4
110
139
  [1.0.5]: https://github.com/Plasius-LTD/hexagons/releases/tag/v1.0.5
111
140
  [1.0.6]: https://github.com/Plasius-LTD/hexagons/releases/tag/v1.0.6
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.6",
3
+ "version": "1.0.8",
4
4
  "main": "./dist-cjs/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -10,18 +10,19 @@
10
10
  "build": "tsc --build --listEmittedFiles && rsync -av --include '*/' --include '*.module.css' --exclude '*' src/ dist/ || true && npm run build:cjs",
11
11
  "test": "vitest run",
12
12
  "test:watch": "vitest",
13
+ "typecheck": "tsc --noEmit",
13
14
  "test:coverage": "vitest run --coverage",
14
15
  "test:coverage:watch": "vitest --coverage",
15
16
  "clean": "rimraf dist-cjs dist tsconfig.tsbuildinfo",
16
17
  "reset:clean": "rm -rf node_modules package-lock.json && npm run clean",
17
18
  "audit:ts": "tsc --noEmit --pretty",
18
- "audit:eslint": "eslint \"{src,apps,packages}/**/*.{ts,tsx}\" --max-warnings=0 --ext .ts,.tsx",
19
+ "audit:eslint": "eslint . --max-warnings=0",
19
20
  "audit:deps": "npm ls --all --omit=optional --omit=peer > /dev/null 2>&1 || true",
20
- "audit:npm": "npm audit --audit-level=moderate || true",
21
+ "audit:npm": "npm audit --audit-level=high --omit=dev",
21
22
  "audit:test": "vitest run --coverage",
22
23
  "audit:all": "npm-run-all -l audit:ts audit:eslint audit:deps audit:npm audit:test",
23
- "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
- "lint": "eslint .",
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
+ "lint": "eslint . --max-warnings=0",
25
26
  "prepare": "npm run build",
26
27
  "pack:check": "node scripts/verify-public-package.cjs",
27
28
  "prepublishOnly": "npm run build && npm run pack:check"
@@ -38,6 +39,7 @@
38
39
  "react": "19.1.0"
39
40
  },
40
41
  "devDependencies": {
42
+ "@eslint/js": "^10.0.1",
41
43
  "@testing-library/react": "^16.3.0",
42
44
  "@types/react": "^19.1.8",
43
45
  "@types/uuid": "^10.0.0",
@@ -46,6 +48,7 @@
46
48
  "@vitest/coverage-v8": "^4.0.18",
47
49
  "ajv": "^6.12.6",
48
50
  "eslint": "^10.0.1",
51
+ "globals": "^17.3.0",
49
52
  "npm-run-all": "^1.1.3",
50
53
  "react": "19.1.0",
51
54
  "react-dom": "19.1.0",