mirror of
https://github.com/acamarata/moon-cycle.git
synced 2026-06-30 18:54:29 +00:00
Port to TypeScript with dual CJS/ESM build via tsup. Fix off-by-one bug in both cycleMonth and cycleYear (images are 1-indexed; v1 returned 000.webp/0000.webp which don't exist). Add imageFolder and cdnUrl helpers for jsDelivr CDN integration. Export constants and types. Separate the ~438 MB image dataset from the npm package via the files field, making moon-cycle publishable to npm for the first time. Add CI workflow with Node 20/22/24 matrix, typecheck, and pack-check jobs. Add wiki-sync workflow and full .wiki/ documentation (Home, API Reference, Architecture, Migration Guide).
2.8 KiB
2.8 KiB
Changelog
All notable changes to this project will be documented in this file. Format follows Keep a Changelog.
[2.0.0] - 2025-02-25
Added
- TypeScript source (
src/) with full type definitions — dual CJS and ESM builds via tsup imageFolder(set, size, quality)helper to construct image directory namescdnUrl(filename, set, size, quality, ref?)helper to generate jsDelivr CDN URLs, enabling image serving without self-hosting the ~438 MB dataset- Exported constants:
SYNODIC_MONTH,MONTH_IMAGES,YEAR_IMAGES,MONTH_ANCHOR,YEAR_ANCHOR - Exported types:
ImageSet,ImageSize,ImageQuality - Dual ESM and CJS builds with
.mjs/.cjsextensions and matching.d.ts/.d.mtstype definitions - Proper
exportsmap inpackage.json(types-first conditional exports) test.mjsandtest-cjs.cjs— full assertion-based test suites covering bounds, anchor dates, edge cases, and all exported functions- GitHub Actions CI workflow: Node 20/22/24 test matrix, typecheck job, pack-check job
- GitHub Actions wiki-sync workflow: syncs
.wiki/to GitHub Wiki on push tomain .wiki/documentation: Home, API Reference, Architecture, Migration Guide.nvmrc,.editorconfig,.npmrc,pnpm-workspace.yaml
Changed
- Package is now npm-publishable:
filesfield restricts the npm package todist/, README, LICENSE, and CHANGELOG — images are excluded package.jsonfully updated: correct author name, accurate description,engines,sideEffects,publishConfig,repository.urlwithgit+https://prefix, expanded keywordsrepository.urlcorrected to usegit+https://prefix per npm convention
Fixed
- Off-by-one bug in both algorithms. The v1 implementation mapped dates to 0-indexed filenames (
000.webpto707.webpmonthly,0000.webpto8759.webpyearly). The image dataset is 1-indexed (001.webpto708.webp,0001.webpto8760.webp). Both functions now return the correct 1-indexed filename. This is a breaking change for anyone who was working around the bug or had a local image set starting at000.webp. - TypeScript definitions in
index.d.tswere incorrect — both functions were typed as returning{ result: string }instead ofstring. The new generated types are accurate.
Removed
index.js,cycleMonth.js,cycleYear.js— replaced bysrc/TypeScript source anddist/build outputindex.d.ts— replaced by generateddist/index.d.tsanddist/index.d.mtstest.js— replaced bytest.mjsandtest-cjs.cjs
[1.0.1] - 2023-11-14
- Minor repository metadata updates
[1.0.0] - 2023-11-14
- Initial release:
cycleMonthandcycleYearfunctions, 708 monthly and 8,760 yearly NASA moon phase images in WebP format