|
2 | 2 |
|
3 | 3 | All notable changes to this project will be documented in this file. |
4 | 4 |
|
| 5 | +## [0.3.1] - 2025-12-09 |
| 6 | + |
| 7 | +### Changed |
| 8 | + |
| 9 | +- **Build Process Simplification**: Removed wrapper script complexity in favor of direct SWC compilation |
| 10 | +- **Postbuild Script**: Replaced `insert-shebang.sh` with lightweight `add-shebang.js` Node script |
| 11 | +- **CJS Package Generation**: Now generated inline in build script instead of via wrapper |
| 12 | +- **README**: Updated "How It Works" section to reflect simplified build architecture |
| 13 | + |
| 14 | +### Technical Details |
| 15 | + |
| 16 | +**Build Process (Simplified):** |
| 17 | + |
| 18 | +1. Prebuild: format:fix → lint → typecheck → clean |
| 19 | +2. Compile: SWC compiles source to both `build/esm/src/` and `build/cjs/src/` |
| 20 | +3. Path Resolution: `tsc-alias` transforms `@/` imports to relative paths |
| 21 | +4. Executables: `add-shebang.js` adds shebangs and sets executable permissions |
| 22 | +5. CJS Marker: `package.json` with `"type":"commonjs"` created in `build/cjs/` |
| 23 | + |
| 24 | +**Entry Points:** |
| 25 | + |
| 26 | +- ESM: `build/esm/src/cli.js` (executable) |
| 27 | +- CJS: `build/cjs/src/cli.js` (executable) |
| 28 | + |
5 | 29 | ## [0.3.0] - 2025-12-09 |
6 | 30 |
|
7 | 31 | ### Added |
8 | 32 |
|
9 | | -- **Dual Build System**: Project now compiles to both ESM (`build/esm/`) and CommonJS (`build/cjs/`) formats with proper module format markers |
10 | | -- **Path Aliases**: TypeScript path aliases (`@/*`) now work throughout the codebase and are resolved to relative paths in compiled output |
11 | | -- **Build Validation**: Code quality checks (format, lint, typecheck) run automatically in the prebuild step before compilation |
| 33 | +- **Dual Build System**: Project compiles to both ESM (`build/esm/`) and CommonJS (`build/cjs/`) with proper module format markers |
| 34 | +- **Path Aliases**: TypeScript path aliases (`@/*`) work throughout codebase and resolve to relative paths in output |
| 35 | +- **Build Validation**: Code quality checks (format, lint, typecheck) run automatically in prebuild step |
12 | 36 | - **Source Maps**: Both ESM and CJS builds include source maps for debugging |
13 | | -- **Dynamic Executables**: Shebangs dynamically wrapped for both module formats via `insert-shebang.sh` |
14 | 37 | - **ESM dirname Utility**: New `getDirname()` utility for ES module-compatible directory resolution |
15 | | -- **Comprehensive Tests**: |
16 | | - - 5 unit tests for CLI and command logic |
17 | | - - 2 unit tests for dirname utility |
18 | | - - 9 integration tests for build outputs (ESM and CJS execution) |
19 | | - - 9 integration tests for module format verification and structure |
20 | | - - Total: 25+ tests with 100% code coverage |
21 | | -- **Integration Test Suite**: Dedicated `tests/integration/` directory with build output and module format validation |
22 | | -- **JSDoc Comments**: Added documentation to all functions for better IDE support and clarity |
23 | | -- **Improved README**: Comprehensive documentation with features list, usage examples, and technical architecture explanation |
| 38 | +- **Comprehensive Tests**: 27 total tests (9 unit + 18 integration) with 100% code coverage |
| 39 | +- **Integration Test Suite**: Dedicated `tests/integration/` with build output and module format validation |
| 40 | +- **JSDoc Comments**: All functions documented for IDE support and clarity |
| 41 | +- **Improved README**: Comprehensive documentation with features, usage, and architecture explanation |
24 | 42 |
|
25 | 43 | ### Changed |
26 | 44 |
|
27 | | -- **Tooling Migration**: Replaced ESLint + Prettier with Biome for unified linting and formatting |
28 | | -- **Node Version Requirement**: Updated from Node 16+ to Node 20+ for stable ESM support |
29 | | -- **Build Scripts**: Restructured build pipeline with separate configurations for ESM and CJS |
30 | | -- **CLI Implementation**: Enhanced with better error handling, version management, and command validation |
31 | | -- **Testing Framework**: Updated from Vite's test to dedicated Vitest with coverage integration |
32 | | -- **Project Structure**: Reorganized to include utilities folder and proper test file placement |
| 45 | +- **Tooling Migration**: Replaced ESLint + Prettier with Biome for unified linting/formatting |
| 46 | +- **Node Version**: Updated from 16+ to 20+ for stable ESM support without flags |
| 47 | +- **Build Scripts**: Restructured with separate SWC configurations for ESM and CJS |
| 48 | +- **CLI Implementation**: Enhanced with better error handling and version management |
| 49 | +- **Testing Framework**: Upgraded from Vite test to dedicated Vitest with coverage |
| 50 | +- **Project Structure**: Added utilities folder and proper test file organization |
33 | 51 |
|
34 | 52 | ### Removed |
35 | 53 |
|
36 | 54 | - ESLint configuration and plugins |
37 | 55 | - Prettier configuration |
38 | 56 | - Old single build configuration (`.swcrc`) |
39 | | -- Version check code that couldn't be reached in ESM environment |
| 57 | +- Unreachable Node version check code |
40 | 58 |
|
41 | 59 | ### Fixed |
42 | 60 |
|
43 | | -- Test file exclusion from production builds (prevents `.test.js` in output) |
| 61 | +- Test file exclusion from production builds |
44 | 62 | - Path alias transformation for both module formats |
45 | 63 | - Vitest configuration to prevent test discovery in build directory |
46 | | -- CJS module format declaration via `build/cjs/package.json` |
47 | | - |
48 | | -### Technical Details |
49 | | - |
50 | | -**Build Process:** |
51 | | - |
52 | | -1. `npm run build` triggers prebuild (format:fix → lint → typecheck) |
53 | | -2. Parallel compilation: `.swcrc-esm` and `.swcrc-cjs` compile source |
54 | | -3. Post-compile: `tsc-alias` transforms `@/` imports to relative paths |
55 | | -4. Postbuild: `insert-shebang.sh` creates executable wrappers for both formats |
56 | | - |
57 | | -**Module Format Support:** |
58 | | - |
59 | | -- ESM: Uses `import()`/`export`, targets modern Node.js |
60 | | -- CJS: Uses `require()`/`exports`, includes `type: "commonjs"` marker for compatibility |
| 64 | +- CJS module format declaration |
61 | 65 |
|
62 | | -**Dependencies Updated:** |
| 66 | +### Dependencies Updated |
63 | 67 |
|
64 | 68 | - TypeScript: 4.9.5 → 5.9.3 |
65 | 69 | - SWC: 1.3.35 → 1.15.3 |
66 | 70 | - Commander: 10.0.0 → 14.0.2 |
67 | 71 | - Vitest: 0.28.5 → 4.0.15 |
68 | | -- Biome: Added as replacement for ESLint + Prettier |
69 | | -- tsc-alias: Added for path alias transformation |
70 | | -- @vitest/coverage-v8: Added for coverage reporting |
| 72 | +- Biome: 2.3.8 (new) |
| 73 | +- tsc-alias: 1.8.16 (new) |
| 74 | +- @vitest/coverage-v8: 4.0.15 (new) |
71 | 75 |
|
72 | 76 | ### Breaking Changes |
73 | 77 |
|
74 | 78 | - Requires Node.js 20+ (was 16+) |
75 | | -- Single build output replaced with dual ESM/CJS structure |
76 | | -- Package exports field now specifies import/require conditions |
| 79 | +- Dual ESM/CJS structure replaces single build output |
| 80 | +- Package exports field specifies import/require conditions |
77 | 81 | - CLI now uses Biome instead of ESLint/Prettier |
0 commit comments