color-contrast-finder 1.0.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Chad.K
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,111 @@
1
+ # Color Contrast Finder
2
+
3
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
4
+
5
+ The **Color Contrast Finder** is a library that automatically selects text colors that contrast with a given color. The library supports a variety of color formats (HEX, RGB, RGBA) and allows for user-defined thresholds and default color settings.
6
+
7
+ <br>
8
+
9
+ ## Features
10
+
11
+ - Support for HEX, RGB, and RGBA color formats
12
+ - Color contrast calculation taking into account transparency (Alpha)
13
+ - Support for user-defined brightness thresholds
14
+ - Customizable for high and low brightness colors
15
+ - Easy to use and flexible settings
16
+
17
+ <br>
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ # with npm
23
+ $ npm i color-contrast-finder
24
+
25
+ # with Yarn
26
+ $ yarn add color-contrast-finder
27
+
28
+ # with pnpm
29
+ $ pnpm add color-contrast-finder
30
+ ```
31
+
32
+ <br>
33
+
34
+ ## Usage
35
+
36
+ ```javascript
37
+ // module
38
+ import { findContrastColor } from 'color-contrast-finder';
39
+
40
+ /**
41
+ * `options.color` types:
42
+ * - `#f00` // rgba(255, 0, 0, 1) (Short hex code with no alpha channel)
43
+ * - `#f00f` // rgba(255, 0, 0, 1) (Short hex code with alpha channel)
44
+ * - `#ffffff` // rgba(255, 255, 255, 1) (Full hex code with no alpha channel)
45
+ * - `#ffffffff` // rgba(255, 255, 255, 1) (Full hex code with alpha channel)
46
+ * - `rgb(255, 255, 255)` // rgba(255, 255, 255, 1) (RGB color with no alpha channel)
47
+ * - `rgba(255, 255, 255, 0.3)` // rgba(255, 255, 255, 0.3) (RGBA color with alpha channel)
48
+ */
49
+ const options = {
50
+ color: '#3498db', // input color (in HEX, RGB, RGBA format)
51
+ threshold: 0.5, // brightness threshold (default: 0.5)
52
+ highColor: 'black', // text color to use when high brightness (default: #000000)
53
+ lowColor: 'white' // text color to use when low brightness (default: #FFFFFF)
54
+ };
55
+
56
+ const contrastColor = findContrastColor(options);
57
+ console.log(contrastColor); // 'black' or 'white'
58
+ ```
59
+
60
+ ```javascript
61
+ // umd
62
+
63
+ /**
64
+ * html code
65
+ * <script type="text/javascript" src="{path}/color-contrast-finder.umd.cjs"></script>
66
+ */
67
+
68
+ const contrastColor = window['color-contrast-finder'].findContrastColor(options);
69
+ console.log(contrastColor); // 'black' or 'white'
70
+ ```
71
+
72
+ <br>
73
+
74
+ ![alt text](https://github.com/user-attachments/assets/2752c37e-aea0-43b5-b8e8-ccfb9ad3f064)
75
+
76
+ <br>
77
+
78
+
79
+ ## License
80
+
81
+ [MIT](LICENSE).
82
+
83
+ <br>
84
+
85
+ ## TODO
86
+
87
+ - [x] Function findContrastColor
88
+ - [x] Library build
89
+ - [x] Changesets setup
90
+ - [x] CI (lint)
91
+ - [x] CD (npm publish)
92
+ - [x] NPM publish
93
+
94
+ <br>
95
+
96
+ ## How to use publish
97
+
98
+ ```bash
99
+ # 1. pnpm changeset
100
+ $ pnpm cs
101
+
102
+ # 2. Input next version
103
+
104
+ # 3. New file created in the .changeset folder
105
+
106
+ # 4. Commit & push new files
107
+
108
+ # 5. Automatically generate, merge, and publish PRs with CD jobs running.
109
+ ```
110
+
111
+ <br>
@@ -0,0 +1,208 @@
1
+ const i = {
2
+ WHITE: "#FFFFFF",
3
+ BLACK: "#000000"
4
+ }, b = 1, c = {
5
+ aliceblue: "#f0f8ff",
6
+ antiquewhite: "#faebd7",
7
+ aqua: "#00ffff",
8
+ aquamarine: "#7fffd4",
9
+ azure: "#f0ffff",
10
+ beige: "#f5f5dc",
11
+ bisque: "#ffe4c4",
12
+ black: "#000000",
13
+ blanchedalmond: "#ffebcd",
14
+ blue: "#0000ff",
15
+ blueviolet: "#8a2be2",
16
+ brown: "#a52a2a",
17
+ burlywood: "#deb887",
18
+ cadetblue: "#5f9ea0",
19
+ chartreuse: "#7fff00",
20
+ chocolate: "#d2691e",
21
+ coral: "#ff7f50",
22
+ cornflowerblue: "#6495ed",
23
+ cornsilk: "#fff8dc",
24
+ crimson: "#dc143c",
25
+ cyan: "#00ffff",
26
+ darkblue: "#00008b",
27
+ darkcyan: "#008b8b",
28
+ darkgoldenrod: "#b8860b",
29
+ darkgray: "#a9a9a9",
30
+ darkgreen: "#006400",
31
+ darkgrey: "#a9a9a9",
32
+ darkkhaki: "#bdb76b",
33
+ darkmagenta: "#8b008b",
34
+ darkolivegreen: "#556b2f",
35
+ darkorange: "#ff8c00",
36
+ darkorchid: "#9932cc",
37
+ darkred: "#8b0000",
38
+ darksalmon: "#e9967a",
39
+ darkseagreen: "#8fbc8f",
40
+ darkslateblue: "#483d8b",
41
+ darkslategray: "#2f4f4f",
42
+ darkslategrey: "#2f4f4f",
43
+ darkturquoise: "#00ced1",
44
+ darkviolet: "#9400d3",
45
+ deeppink: "#ff1493",
46
+ deepskyblue: "#00bfff",
47
+ dimgray: "#696969",
48
+ dimgrey: "#696969",
49
+ dodgerblue: "#1e90ff",
50
+ firebrick: "#b22222",
51
+ floralwhite: "#fffaf0",
52
+ forestgreen: "#228b22",
53
+ fuchsia: "#ff00ff",
54
+ gainsboro: "#dcdcdc",
55
+ ghostwhite: "#f8f8ff",
56
+ gold: "#ffd700",
57
+ goldenrod: "#daa520",
58
+ gray: "#808080",
59
+ green: "#008000",
60
+ greenyellow: "#adff2f",
61
+ grey: "#808080",
62
+ honeydew: "#f0fff0",
63
+ hotpink: "#ff69b4",
64
+ indianred: "#cd5c5c",
65
+ indigo: "#4b0082",
66
+ ivory: "#fffff0",
67
+ khaki: "#f0e68c",
68
+ lavender: "#e6e6fa",
69
+ lavenderblush: "#fff0f5",
70
+ lawngreen: "#7cfc00",
71
+ lemonchiffon: "#fffacd",
72
+ lightblue: "#add8e6",
73
+ lightcoral: "#f08080",
74
+ lightcyan: "#e0ffff",
75
+ lightgoldenrodyellow: "#fafad2",
76
+ lightgray: "#d3d3d3",
77
+ lightgreen: "#90ee90",
78
+ lightgrey: "#d3d3d3",
79
+ lightpink: "#ffb6c1",
80
+ lightsalmon: "#ffa07a",
81
+ lightseagreen: "#20b2aa",
82
+ lightskyblue: "#87cefa",
83
+ lightslategray: "#778899",
84
+ lightslategrey: "#778899",
85
+ lightsteelblue: "#b0c4de",
86
+ lightyellow: "#ffffe0",
87
+ lime: "#00ff00",
88
+ limegreen: "#32cd32",
89
+ linen: "#faf0e6",
90
+ magenta: "#ff00ff",
91
+ maroon: "#800000",
92
+ mediumaquamarine: "#66cdaa",
93
+ mediumblue: "#0000cd",
94
+ mediumorchid: "#ba55d3",
95
+ mediumpurple: "#9370db",
96
+ mediumseagreen: "#3cb371",
97
+ mediumslateblue: "#7b68ee",
98
+ mediumspringgreen: "#00fa9a",
99
+ mediumturquoise: "#48d1cc",
100
+ mediumvioletred: "#c71585",
101
+ midnightblue: "#191970",
102
+ mintcream: "#f5fffa",
103
+ mistyrose: "#ffe4e1",
104
+ moccasin: "#ffe4b5",
105
+ navajowhite: "#ffdead",
106
+ navy: "#000080",
107
+ oldlace: "#fdf5e6",
108
+ olive: "#808000",
109
+ olivedrab: "#6b8e23",
110
+ orange: "#ffa500",
111
+ orangered: "#ff4500",
112
+ orchid: "#da70d6",
113
+ palegoldenrod: "#eee8aa",
114
+ palegreen: "#98fb98",
115
+ paleturquoise: "#afeeee",
116
+ palevioletred: "#db7093",
117
+ papayawhip: "#ffefd5",
118
+ peachpuff: "#ffdab9",
119
+ peru: "#cd853f",
120
+ pink: "#ffc0cb",
121
+ plum: "#dda0dd",
122
+ powderblue: "#b0e0e6",
123
+ purple: "#800080",
124
+ red: "#ff0000",
125
+ rosybrown: "#bc8f8f",
126
+ royalblue: "#4169e1",
127
+ saddlebrown: "#8b4513",
128
+ salmon: "#fa8072",
129
+ sandybrown: "#f4a460",
130
+ seagreen: "#2e8b57",
131
+ seashell: "#fff5ee",
132
+ sienna: "#a0522d",
133
+ silver: "#c0c0c0",
134
+ skyblue: "#87ceeb",
135
+ slateblue: "#6a5acd",
136
+ slategray: "#708090",
137
+ slategrey: "#708090",
138
+ snow: "#fffafa",
139
+ springgreen: "#00ff7f",
140
+ steelblue: "#4682b4",
141
+ tan: "#d2b48c",
142
+ teal: "#008080",
143
+ thistle: "#d8bfd8",
144
+ tomato: "#ff6347",
145
+ turquoise: "#40e0d0",
146
+ violet: "#ee82ee",
147
+ wheat: "#f5deb3",
148
+ white: "#ffffff",
149
+ whitesmoke: "#f5f5f5",
150
+ yellow: "#ffff00",
151
+ yellowgreen: "#9acd32"
152
+ };
153
+ function m(a) {
154
+ if (!/^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/.test(a))
155
+ throw new Error("Invalid HEX color code");
156
+ const f = a.replace(/^#/, ""), r = f.length === 3 ? f.split("").map((o) => o + o).join("") : f, n = parseInt(r, 16);
157
+ return {
158
+ r: n >> 16 & 255,
159
+ g: n >> 8 & 255,
160
+ b: n & 255,
161
+ a: b
162
+ };
163
+ }
164
+ function h(a) {
165
+ const f = /rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)/.exec(a);
166
+ if (!f)
167
+ throw new Error("Invalid RGB color code");
168
+ const [, r, n, o, d] = f;
169
+ return {
170
+ r: parseInt(r, 10),
171
+ g: parseInt(n, 10),
172
+ b: parseInt(o, 10),
173
+ a: d ? parseFloat(d) : b
174
+ };
175
+ }
176
+ function k(a) {
177
+ let e = a.trim().toLowerCase();
178
+ if (e in c && (e = c[e]), e.startsWith("#"))
179
+ return m(e);
180
+ if (e.startsWith("rgb")) {
181
+ const f = h(e);
182
+ if (f)
183
+ return f;
184
+ throw new Error("Invalid RGB color format");
185
+ }
186
+ throw new Error("Invalid color format");
187
+ }
188
+ function s({ r: a, g: e, b: f }) {
189
+ const r = (t) => {
190
+ const l = t / 255;
191
+ return l <= 0.03928 ? l / 12.92 : Math.pow((l + 0.055) / 1.055, 2.4);
192
+ }, n = r(a), o = r(e), d = r(f);
193
+ return n * 0.2126 + o * 0.7152 + d * 0.0722;
194
+ }
195
+ function w(a, e) {
196
+ const f = s({ r: 255, g: 255, b: 255 });
197
+ return a < 1 ? a * e + (1 - a) * f : e;
198
+ }
199
+ function p(a, e, f, r) {
200
+ return a >= e ? f : r;
201
+ }
202
+ function y(a) {
203
+ const { color: e, threshold: f = 0.5, highColor: r = i.BLACK, lowColor: n = i.WHITE } = a, { r: o, g: d, b: t, a: l } = k(e), g = s({ r: o, g: d, b: t }), u = w(l, g);
204
+ return p(u, f, r, n);
205
+ }
206
+ export {
207
+ y as findContrastColor
208
+ };
@@ -0,0 +1 @@
1
+ (function(d,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(d=typeof globalThis<"u"?globalThis:d||self,t(d["color-contrast-finder"]={}))})(this,function(d){"use strict";const t={WHITE:"#FFFFFF",BLACK:"#000000"},s=1,b={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function g(a){if(!/^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/.test(a))throw new Error("Invalid HEX color code");const f=a.replace(/^#/,""),r=f.length===3?f.split("").map(o=>o+o).join(""):f,n=parseInt(r,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:s}}function m(a){const f=/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)/.exec(a);if(!f)throw new Error("Invalid RGB color code");const[,r,n,o,l]=f;return{r:parseInt(r,10),g:parseInt(n,10),b:parseInt(o,10),a:l?parseFloat(l):s}}function h(a){let e=a.trim().toLowerCase();if(e in b&&(e=b[e]),e.startsWith("#"))return g(e);if(e.startsWith("rgb")){const f=m(e);if(f)return f;throw new Error("Invalid RGB color format")}throw new Error("Invalid color format")}function u({r:a,g:e,b:f}){const r=c=>{const i=c/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)},n=r(a),o=r(e),l=r(f);return n*.2126+o*.7152+l*.0722}function p(a,e){const f=u({r:255,g:255,b:255});return a<1?a*e+(1-a)*f:e}function y(a,e,f,r){return a>=e?f:r}function k(a){const{color:e,threshold:f=.5,highColor:r=t.BLACK,lowColor:n=t.WHITE}=a,{r:o,g:l,b:c,a:i}=h(e),w=u({r:o,g:l,b:c}),v=p(i,w);return y(v,f,r,n)}d.findContrastColor=k,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1 @@
1
+ export * from './main'
package/dist/main.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { ColorContrastOptions, RGBAColor } from './types';
2
+ /**
3
+ * Finds the best contrast color for text based on the provided options.
4
+ * @param {ColorContrastOptions} options - Configuration for contrast color selection
5
+ * @returns {string} Best contrast color for the text
6
+ */
7
+ export declare function findContrastColor(options: ColorContrastOptions): string;
8
+ export type { ColorContrastOptions, RGBAColor };
@@ -0,0 +1,16 @@
1
+ import { CSS_COLORS } from './constants';
2
+ export type RGBAColor = {
3
+ r: number;
4
+ g: number;
5
+ b: number;
6
+ a: number;
7
+ };
8
+ type CSSColorKey = keyof typeof CSS_COLORS;
9
+ export type InputColor = CSSColorKey | string;
10
+ export type ColorContrastOptions = {
11
+ color: InputColor;
12
+ threshold?: number;
13
+ highColor?: string;
14
+ lowColor?: string;
15
+ };
16
+ export {};
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "color-contrast-finder",
3
+ "description": "The Color Contrast Finder is a library that automatically selects text colors that contrast with a given color.",
4
+ "version": "1.0.0",
5
+ "author": "Chad.K <kangqod@naver.com>",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/kangqod/color-contrast-finder.git"
9
+ },
10
+ "license": "MIT",
11
+ "bugs": {
12
+ "url": "https://github.com/kangqod/color-contrast-finder.git/issues"
13
+ },
14
+ "homepage": "https://github.com/kangqod/color-contrast-finder.git#readme",
15
+ "engines": {
16
+ "node": ">=20.14.0",
17
+ "pnpm": ">=9.4.0"
18
+ },
19
+ "type": "module",
20
+ "files": [
21
+ "dist",
22
+ "index.d.ts"
23
+ ],
24
+ "keywords": [
25
+ "typescript",
26
+ "color-contrast",
27
+ "color-contrast-finder",
28
+ "color-utils"
29
+ ],
30
+ "main": "./dist/color-contrast-finder.js",
31
+ "module": "./dist/color-contrast-finder.umd.cjs",
32
+ "types": "./dist/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/color-contrast-finder.js",
37
+ "require": "./dist/color-contrast-finder.umd.cjs"
38
+ }
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "dependencies": {
44
+ "@changesets/cli": "^2.27.7"
45
+ },
46
+ "devDependencies": {
47
+ "@eslint/js": "^9.8.0",
48
+ "eslint": "9.x",
49
+ "eslint-config-airbnb-typescript": "^18.0.0",
50
+ "eslint-config-prettier": "^9.1.0",
51
+ "eslint-plugin-prettier": "^5.2.1",
52
+ "globals": "^15.9.0",
53
+ "prettier": "^3.3.3",
54
+ "typescript": "^5.4.5",
55
+ "typescript-eslint": "^8.0.1",
56
+ "vite": "^5.2.10",
57
+ "vite-plugin-dts": "^4.0.1",
58
+ "vitest": "^2.0.5"
59
+ },
60
+ "scripts": {
61
+ "dev": "vite",
62
+ "build": "tsc && vite build",
63
+ "lint": "eslint ./lib ./src --cache",
64
+ "test": "vitest",
65
+ "typecheck": "tsc --noEmit",
66
+ "format:check": "prettier --check ./lib ./src --cache",
67
+ "format:write": "prettier --write ./lib ./src --cache",
68
+ "coverage": "vitest run --coverage",
69
+ "cs": "changeset",
70
+ "cs-v": "changeset version",
71
+ "cs-t": "changeset tag",
72
+ "release": "changeset publish"
73
+ }
74
+ }