Files
webstudio/packages/css-data/package.json
Bogdan Chadkin 942b81b8ff refactor: upgrade colorjs.io to v0.6 and adopt functional API (#5617)
## Summary

Upgrades colorjs.io from v0.5.x to v0.6.x and adopts the new functional
API to fix TypeScript compatibility issues and reduce bundle size.

## Breaking Changes in v0.6

This release includes two major changes from colorjs.io that required
code updates:

1. `null` instead of `NaN` for "none" values — Coordinates now use
`number | null` instead of the custom `Number` instance that previously
used `"none"` strings. This eliminates runtime casting and improves
TypeScript DX.

2. Plain numbers instead of `Number` objects — Coordinates are now plain
number primitives rather than `Number` objects with parsing metadata,
improving performance and bundle size.

## Changes Made

- Upgraded colorjs.io to v0.6.x
- Adopted functional API (`/fn` entry point) for tree-shakeable imports
and reduced bundle size
- Updated coordinate handling to use `number | null` directly instead of
custom `Number` instances with `"none"` values
- Removed runtime casting previously required for TypeScript
compatibility
- Aligned with engramma and hdr-color-input — both already use the
functional style, enabling code deduplication

## Migration Notes

See [colorjs.io v0.6.0 release
notes](https://github.com/color-js/color.js/releases/tag/v0.6.0) for
full details on the breaking changes.
2026-02-16 12:26:56 +03:00

44 lines
1.3 KiB
JSON

{
"name": "@webstudio-is/css-data",
"version": "0.0.0",
"description": "CSS Data",
"author": "Webstudio <github@webstudio.is>",
"homepage": "https://webstudio.is",
"type": "module",
"scripts": {
"typecheck": "tsgo --noEmit",
"build:html.css": "tsx ./bin/html.css.ts && prettier --write ./src/__generated__/html.ts",
"build:mdn-data": "tsx ./bin/mdn-data.ts ./src/__generated__ && prettier --write \"./src/__generated__/\" \"../css-engine/src/__generated__/\"",
"build:descriptions": "tsx ./bin/property-value-descriptions.ts && prettier --write ./src/__generated__/property-value-descriptions.ts",
"test": "vitest run"
},
"bin": {
"css-to-ws": "./bin/css-to-ws.ts"
},
"devDependencies": {
"@webstudio-is/tsconfig": "workspace:*",
"html-tags": "^4.0.0",
"mdn-data": "2.23.0",
"vitest": "^3.1.2",
"zod": "^3.24.2"
},
"peerDependencies": {
"zod": "^3.19.1"
},
"exports": {
"webstudio": "./src/index.ts"
},
"license": "AGPL-3.0-or-later",
"private": true,
"sideEffects": false,
"dependencies": {
"@webstudio-is/css-engine": "workspace:*",
"change-case": "^5.4.4",
"colorjs.io": "^0.6.1",
"css-tree": "^3.1.0",
"openai": "^3.2.1",
"p-retry": "^6.2.1",
"warn-once": "^0.1.1"
}
}