Skip to content

v2.0.0: Input validation, modern tooling, improved TypeScript support#2

Merged
k-vyn merged 1 commit into
masterfrom
Update-Typescript-Support
Dec 29, 2025
Merged

v2.0.0: Input validation, modern tooling, improved TypeScript support#2
k-vyn merged 1 commit into
masterfrom
Update-Typescript-Support

Conversation

@k-vyn

@k-vyn k-vyn commented Dec 29, 2025

Copy link
Copy Markdown
Owner

Summary

This release is a major update that adds input validation with helpful error messages, modernizes the development tooling, and improves TypeScript support.

Breaking Changes

  • Input validation: Invalid inputs now throw ColorAlgorithmError with specific error codes instead of producing undefined behavior
  • Node.js 18+: Now requires Node.js 18 or later
  • ESM-first: Package is now ESM-first with CommonJS compatibility via exports map

New Features

  • ColorAlgorithmError class with error codes for programmatic error handling
  • New exports: ColorAlgorithmError, ErrorCodes, and TypeScript types
  • JSDoc documentation on the generate() function

Developer Experience

  • Migrated from Jest to Vitest for faster testing
  • Added ESLint v9 with flat config
  • Added GitHub Actions CI workflow (Node 18, 20, 22)
  • Added CONTRIBUTING.md
  • Updated README with migration guide

Test Plan

  • npm test passes
  • npm run build succeeds
  • npm run lint passes

…upport

BREAKING CHANGES:
- Invalid inputs now throw ColorAlgorithmError instead of failing silently
- Requires Node.js 18+ (previously supported older versions)
- Package is now ESM-first with CommonJS compatibility

New Features:
- Input validation with helpful error messages and error codes
- New exports: ColorAlgorithmError, ErrorCodes, and TypeScript types
- JSDoc documentation for the generate() function

Developer Experience:
- Migrated from Jest to Vitest for faster testing
- Added ESLint v9 with flat config (eslint.config.mjs)
- Added GitHub Actions CI workflow (Node 18, 20, 22)
- Added CONTRIBUTING.md with development guidelines
- Updated README with migration guide and error handling docs

Dependencies:
- Updated chroma-js to v3.0.0
- Updated TypeScript to v5.5.4
- Updated Rollup and plugins to latest versions
- Added vitest v4, typescript-eslint v8

Build Improvements:
- Cleaner dist output (single bundle.d.ts, removed duplicate types/)
- Added tsconfig.build.json for build-specific settings
- Package now uses "type": "module" with proper exports map

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@k-vyn k-vyn merged commit 5283899 into master Dec 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant