color-map 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "color-map",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Generate WCAG-checked color palettes, scales and design tokens with the color-map CLI",
5
5
  "author": {
6
6
  "name": "Homa Wong (unional)"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "color-map",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Generate WCAG-checked color palettes, scales and design tokens with the color-map CLI",
5
5
  "author": {
6
6
  "name": "Homa Wong (unional)"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "color-map",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Generate WCAG-checked color palettes, scales and design tokens with the color-map CLI",
5
5
  "author": {
6
6
  "name": "Homa Wong (unional)"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # color-map
2
2
 
3
+ ## 2.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 764413e: `llms.txt` now maps the library as well as the commands: each entry point with its exports, the conventions that hold across them, and the `schema` command, which it had left out. The docs site serves the same file at `/color-map/llms.txt`.
8
+
3
9
  ## 2.3.0
4
10
 
5
11
  ### Minor Changes
@@ -6411,4 +6411,4 @@ function createApp(options) {
6411
6411
  for (const c of commands) app = app.command(c);
6412
6412
  return app.command(schemaCommand(commands));
6413
6413
  }
6414
- export { createApp as n, schemaOf as r, commands as t };
6414
+ export { schemaOf as i, createApp as n, schemaCommand as r, commands as t };
package/bin/color-map.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as createApp } from "./cli-CNBftDBE.js";
2
+ import { n as createApp } from "./cli-CELmx3Y9.js";
3
3
  import { readFileSync } from "node:fs";
4
4
  // src/cli/bin.ts
5
5
  const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
package/bin/index.js CHANGED
@@ -1 +1 @@
1
- export { t as commands, n as createApp, r as schemaOf } from "./cli-CNBftDBE.js";
1
+ export { t as commands, n as createApp, r as schemaCommand, i as schemaOf } from "./cli-CELmx3Y9.js";
package/llms.txt CHANGED
@@ -1,8 +1,16 @@
1
1
  # color-map
2
2
 
3
- > The `color-map` command: convert, mix, contrast-check, scale and export CSS colors, and build a semantic palette whose text pairs all pass WCAG 2, from one brand color.
3
+ > Parse, convert, mix and serialize every CSS color, check WCAG 2 contrast, and build scales, semantic palettes and design tokens from one brand color. One package holds a TypeScript library, the `color-map` command and an agent skill.
4
4
 
5
- This file is generated by `scripts/generate-llms-txt.mjs` from the command table. Do not edit it.
5
+ This file is generated by `scripts/generate-llms-txt.mjs` from the package exports and the command table. Do not edit it.
6
+
7
+ Conventions that hold for the library:
8
+
9
+ - No runtime dependencies, and `"sideEffects": false`, so a bundler keeps only what you import.
10
+ - `color-map` re-exports `color-map/color`, `color-map/palette`, `color-map/scale` and `color-map/tokens`. Without a bundler it loads every module, so import from a subpath to load less.
11
+ - `Color` is `{ colorSpace, components, alpha? }`. A color as plain JSON. Component ranges follow CSS: `srgb` is 0 to 1, `hsl` and `hwb` take hue in degrees and the rest in 0 to 100, `lab` and `lch` take L in 0 to 100, `oklab` and `oklch` take L in 0 to 1. A missing `alpha` is 1. `Component` is `number | null`. A component value. `null` stands for the CSS keyword `none`.
12
+ - `deltaEOk`, `equals`, `contrast`, `findContrast`, `meets`, `onColor`, `inGamut`, `toGamut`, `mix` and `toHex` each have a narrow form named `create` plus the name. It takes the spaces your colors are in and returns the helper over just those, so a bundle does not carry all 15 spaces. `createConverter` does the same for `convert`.
13
+ - `contrast`, `findContrast`, `meets`, `onColor` and `mix` also take a CSS color string; the other helpers above take a `Color`, so run strings through `parse` first. Every narrow form takes `Color` objects only.
6
14
 
7
15
  Conventions that hold for every command:
8
16
 
@@ -13,6 +21,15 @@ Conventions that hold for every command:
13
21
  - A failure exits 1 or 2 with `error`, `code` and `help` fields on stdout. Nothing prompts; unknown options fail.
14
22
  - Run it with `npx color-map <command>`, or install the `color-map` agent skill from this package.
15
23
 
24
+ ## Library
25
+
26
+ - [color-map](https://cyberuni.github.io/color-map/library/): re-exports `color-map/color`, `color-map/palette`, `color-map/scale` and `color-map/tokens`. It also exports `Alpha`, `ColorMap`, `createColors`, `createColorsFromMap`, `RGB`, `RGBA`, `rgbaString`, `rgbHex`, deprecated: import them from `color-map/legacy`.
27
+ - [color-map/color](https://cyberuni.github.io/color-map/library/#color-mapcolor): `a98Rgb`, `contrast`, `convert`, `convertComponents`, `createContrast`, `createConverter`, `createDeltaEOk`, `createEquals`, `createFindContrast`, `createInGamut`, `createMeets`, `createMix`, `createOnColor`, `createToGamut`, `createToHex`, `deltaEOk`, `displayP3`, `displayP3Linear`, `equals`, `findContrast`, `fromArgb`, `hsl`, `hwb`, `inGamut`, `lab`, `lch`, `meets`, `mix`, `oklab`, `oklch`, `onColor`, `parse`, `parseExpr`, `prophotoRgb`, `rec2020`, `resolve`, `spaces`, `srgb`, `srgbLinear`, `toArgb`, `toCss`, `toGamut`, `toHex`, `wcag2`, `xyzD50`, `xyzD65`. Types: `Color`, `ColorExpr`, `ColorSpaceId`, `Component`, `ContrastAlgorithm`, `ContrastFn`, `ContrastOption`, `FindContrastOptions`, `FoundContrast`, `GamutId`, `HueMethod`, `MixOptions`, `OnColorOptions`, `ResolveContext`, `Space`, `ToCssOptions`, `ToGamutOptions`, `Vec3`.
28
+ - [color-map/legacy](https://cyberuni.github.io/color-map/library/#color-maplegacy): `createColors`, `createColorsFromMap`, `rgbaString`, `rgbHex`. Types: `Alpha`, `ColorMap`, `RGB`, `RGBA`.
29
+ - [color-map/palette](https://cyberuni.github.io/color-map/library/#color-mappalette): `darkVariant`, `harmonize`, `harmony`, `inverse`, `semanticPalette`, `validate`. Types: `DarkStrategy`, `DarkVariantOptions`, `HarmonizeOptions`, `HarmonyOptions`, `HarmonyScheme`, `HarmonySpace`, `PaletteIssue`, `PaletteLike`, `RolePair`, `SemanticPalette`, `SemanticPaletteOptions`, `SemanticRole`, `ValidateOptions`, `ValidateResult`.
30
+ - [color-map/scale](https://cyberuni.github.io/color-map/library/#color-mapscale): `createContrastScale`, `createGradient`, `createScale`, `lstar`, `MATERIAL_TONES`, `scaleFromBrand`, `tonalPalette`, `toneColor`. Types: `BrandScaleOptions`, `ContrastScaleOptions`, `ContrastStep`, `GradientOptions`, `GradientStop`, `ScaleOptions`, `ScalePreset`, `TonalPaletteOptions`.
31
+ - [color-map/tokens](https://cyberuni.github.io/color-map/library/#color-maptokens): `toCssVariables`, `toDtcg`, `toDtcgValue`, `toTailwindTheme`. Types: `CssVariablesOptions`, `DtcgColorValue`, `DtcgGroup`, `DtcgOptions`, `DtcgToken`, `TailwindThemeOptions`, `TokenTree`.
32
+
16
33
  ## Commands
17
34
 
18
35
  - [convert](https://unpkg.com/color-map/schemas/convert.schema.json): Convert a CSS color to another color space. Usage: `color-map convert <color>` with --to, --gamut, --full.
@@ -23,7 +40,9 @@ Conventions that hold for every command:
23
40
  - [palette](https://unpkg.com/color-map/schemas/palette.schema.json): A semantic palette from one brand color: primary, status colors, surface and outline, each with a text color and its WCAG 2 ratio. Usage: `color-map palette <brand>` with --mode, --target, --gamut, --full.
24
41
  - [harmony](https://unpkg.com/color-map/schemas/harmony.schema.json): The colors of a harmony scheme: the color rotated around the hue wheel. Usage: `color-map harmony <color>` with --scheme, --space, --gamut.
25
42
  - [export](https://unpkg.com/color-map/schemas/export.schema.json): Write a palette, a scale or your own tokens as DTCG JSON, CSS variables or a Tailwind v4 theme. Usage: `color-map export [color]` with --to, --source, --mode, --tokens, --space, --prefix, --selector, --namespace, --inline, --precision, --hex.
43
+ - [schema](https://cyberuni.github.io/color-map/cli/#machine-readable-help): Print the JSON Schema of a command's arguments and options. Usage: `color-map schema [command]` with no options.
26
44
 
27
45
  ## Optional
28
46
 
29
47
  - [Source and README](https://github.com/cyberuni/color-map): the color-map library and CLI.
48
+ - [Generator](https://github.com/cyberuni/color-map/blob/main/packages/color-map/scripts/generate-llms-txt.mjs): run it with `--gaps` to list the 0 exports that have no doc comment.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "color-map",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Color map generator and color toolkit: a library, a CLI and an agent skill",
5
5
  "homepage": "https://github.com/cyberuni/color-map",
6
6
  "bugs": {
@@ -89,6 +89,7 @@
89
89
  "npm-run-all2": "^9.0.3",
90
90
  "rimraf": "^6.1.3",
91
91
  "size-limit": "^14.3.0",
92
+ "ts-6.0": "npm:typescript@6.0.3",
92
93
  "tsdown": "^0.23.0",
93
94
  "typescript": "^7.0.2",
94
95
  "vitest": "^5.0.0"
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "color-map",
4
- "version": "2.3.0",
4
+ "version": "2.3.1",
5
5
  "description": "Generate WCAG-checked color palettes, scales and design tokens with the color-map CLI",
6
6
  "author": {
7
7
  "name": "Homa Wong (unional)"
package/src/cli/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { commands, createApp } from './cli.js'
2
+ export { schemaCommand } from './schema-command.js'
2
3
  export { type SchemaSource, schemaOf } from './schemas.js'