Skip to content

Convert to ESM: use .mjs everywhere - #30

Merged
boronine merged 4 commits into
hsluv:mainfrom
boronine-bot:esm
Jun 16, 2026
Merged

Convert to ESM: use .mjs everywhere#30
boronine merged 4 commits into
hsluv:mainfrom
boronine-bot:esm

Conversation

@boronine-bot

@boronine-bot boronine-bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rename test.jstest.mjs with ESM import syntax
  • Rename snapshot.cjssnapshot.mjs with ESM import syntax
  • Add "type": "module" to package.json
  • Update npm-publish.yml to use ESM-compatible JSON imports instead of require()
  • Vendor snapshot-rev4.json from hsluv/hsluv as test data source
  • Rewrite snapshot.mjs to read from vendored JSON and generate _snapshot.scss via Sass compilation across all 4096 reference colors (up from 16)
  • Add .prettierignore for the generated _snapshot.scss file
  • Fix Sass number unit detection for proper deg unit serialization

All 57,370 tests pass and lint is clean.

- Rename test.js → test.mjs with ESM import syntax
- Rename snapshot.cjs → snapshot.mjs with ESM import syntax
- Add "type": "module" to package.json
- Update npm-publish.yml require() calls for ESM compatibility
… colors

- Download and vendor snapshot-rev4.json from hsluv/hsluv main branch
- Rewrite snapshot.mjs to read colors from vendored JSON and compute
  SCSS snapshot values via Sass compilation
- Generate _snapshot.scss with all 4096 colors (up from 16)
- Add .prettierignore for generated snapshot file
- Fix SassNumber unit detection (deg) for proper SCSS output
@boronine
boronine merged commit 52743c8 into hsluv:main Jun 16, 2026
10 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.

2 participants