diff --git a/package.json b/package.json index fe2e487..edc666c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ ], "scripts": { "benchmark": "vitest bench --run", - "build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts", + "build": "tsup", "clean": "gts clean", "dev": "vitest", "fix": "gts fix", @@ -38,13 +38,14 @@ "@changesets/types": "^6.0.0", "@codspeed/vitest-plugin": "^2.3.1", "@typescript-eslint/eslint-plugin": "^6.18.1", - "@vitest/coverage-istanbul": "^1.1.3", + "@vitest/coverage-istanbul": "^1.2.0", "gts": "^5.2.0", - "prettier": "^3.1.1", + "prettier": "^3.2.0", "prettier-plugin-organize-imports": "^3.2.4", + "terser": "^5.26.0", "tsup": "^8.0.1", "typescript": "^5.3.3", - "vitest": "^1.1.3" + "vitest": "^1.2.0" }, "keywords": [ "color", @@ -61,5 +62,18 @@ }, "publishConfig": { "access": "public" + }, + "tsup": { + "entry": [ + "src/index.ts" + ], + "clean": true, + "sourcemap": true, + "dts": true, + "format": [ + "cjs", + "esm" + ], + "minify": true } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0dc3c1b..f2173a2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,22 +21,25 @@ devDependencies: version: 6.0.0 '@codspeed/vitest-plugin': specifier: ^2.3.1 - version: 2.3.1(vite@5.0.11)(vitest@1.1.3) + version: 2.3.1(vite@5.0.11)(vitest@1.2.0) '@typescript-eslint/eslint-plugin': specifier: ^6.18.1 version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@vitest/coverage-istanbul': - specifier: ^1.1.3 - version: 1.1.3(vitest@1.1.3) + specifier: ^1.2.0 + version: 1.2.0(vitest@1.2.0) gts: specifier: ^5.2.0 version: 5.2.0(typescript@5.3.3) prettier: - specifier: ^3.1.1 - version: 3.1.1 + specifier: ^3.2.0 + version: 3.2.0 prettier-plugin-organize-imports: specifier: ^3.2.4 - version: 3.2.4(prettier@3.1.1)(typescript@5.3.3) + version: 3.2.4(prettier@3.2.0)(typescript@5.3.3) + terser: + specifier: ^5.26.0 + version: 5.26.0 tsup: specifier: ^8.0.1 version: 8.0.1(typescript@5.3.3) @@ -44,8 +47,8 @@ devDependencies: specifier: ^5.3.3 version: 5.3.3 vitest: - specifier: ^1.1.3 - version: 1.1.3 + specifier: ^1.2.0 + version: 1.2.0(terser@5.26.0) packages: @@ -469,15 +472,15 @@ packages: node-gyp-build: 4.8.0 dev: true - /@codspeed/vitest-plugin@2.3.1(vite@5.0.11)(vitest@1.1.3): + /@codspeed/vitest-plugin@2.3.1(vite@5.0.11)(vitest@1.2.0): resolution: {integrity: sha512-/e4G2B/onX/hG/EjUU/NpDxnIryeTDamVRTBeWfgQDoex3g7GDzTwoQktaU5l/Asw3ZjEErQg+oQVToQ6jYZlA==} peerDependencies: vite: ^4.2.0 || ^5.0.0 vitest: '>=1.0.0-beta.4 || >=1' dependencies: '@codspeed/core': 2.3.1 - vite: 5.0.11 - vitest: 1.1.3 + vite: 5.0.11(terser@5.26.0) + vitest: 1.2.0(terser@5.26.0) dev: true /@esbuild/aix-ppc64@0.19.11: @@ -802,6 +805,13 @@ packages: engines: {node: '>=6.0.0'} dev: true + /@jridgewell/source-map@0.3.5: + resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==} + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.20 + dev: true + /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true @@ -1268,8 +1278,8 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitest/coverage-istanbul@1.1.3(vitest@1.1.3): - resolution: {integrity: sha512-pqx/RaLjJ7oxsbi0Vc/CjyXBXd86yQ0lKq1PPnk9BMNLqMTEWwfcTelcNrl41yK+IVRhHlFtwcjDva3VslbMMQ==} + /@vitest/coverage-istanbul@1.2.0(vitest@1.2.0): + resolution: {integrity: sha512-hNN/pUR5la6P/L78+YcRl05Lpf6APXlH9ujkmCxxjVWtVG6WuKuqUMhHgYQBYfiOORBwDZ1MBgSUGCMPh4kpmQ==} peerDependencies: vitest: ^1.0.0 dependencies: @@ -1282,43 +1292,43 @@ packages: magicast: 0.3.2 picocolors: 1.0.0 test-exclude: 6.0.0 - vitest: 1.1.3 + vitest: 1.2.0(terser@5.26.0) transitivePeerDependencies: - supports-color dev: true - /@vitest/expect@1.1.3: - resolution: {integrity: sha512-MnJqsKc1Ko04lksF9XoRJza0bGGwTtqfbyrsYv5on4rcEkdo+QgUdITenBQBUltKzdxW7K3rWh+nXRULwsdaVg==} + /@vitest/expect@1.2.0: + resolution: {integrity: sha512-H+2bHzhyvgp32o7Pgj2h9RTHN0pgYaoi26Oo3mE+dCi1PAqV31kIIVfTbqMO3Bvshd5mIrJLc73EwSRrbol9Lw==} dependencies: - '@vitest/spy': 1.1.3 - '@vitest/utils': 1.1.3 + '@vitest/spy': 1.2.0 + '@vitest/utils': 1.2.0 chai: 4.4.0 dev: true - /@vitest/runner@1.1.3: - resolution: {integrity: sha512-Va2XbWMnhSdDEh/OFxyUltgQuuDRxnarK1hW5QNN4URpQrqq6jtt8cfww/pQQ4i0LjoYxh/3bYWvDFlR9tU73g==} + /@vitest/runner@1.2.0: + resolution: {integrity: sha512-vaJkDoQaNUTroT70OhM0NPznP7H3WyRwt4LvGwCVYs/llLaqhoSLnlIhUClZpbF5RgAee29KRcNz0FEhYcgxqA==} dependencies: - '@vitest/utils': 1.1.3 + '@vitest/utils': 1.2.0 p-limit: 5.0.0 pathe: 1.1.2 dev: true - /@vitest/snapshot@1.1.3: - resolution: {integrity: sha512-U0r8pRXsLAdxSVAyGNcqOU2H3Z4Y2dAAGGelL50O0QRMdi1WWeYHdrH/QWpN1e8juWfVKsb8B+pyJwTC+4Gy9w==} + /@vitest/snapshot@1.2.0: + resolution: {integrity: sha512-P33EE7TrVgB3HDLllrjK/GG6WSnmUtWohbwcQqmm7TAk9AVHpdgf7M3F3qRHKm6vhr7x3eGIln7VH052Smo6Kw==} dependencies: magic-string: 0.30.5 pathe: 1.1.2 pretty-format: 29.7.0 dev: true - /@vitest/spy@1.1.3: - resolution: {integrity: sha512-Ec0qWyGS5LhATFQtldvChPTAHv08yHIOZfiNcjwRQbFPHpkih0md9KAbs7TfeIfL7OFKoe7B/6ukBTqByubXkQ==} + /@vitest/spy@1.2.0: + resolution: {integrity: sha512-MNxSAfxUaCeowqyyGwC293yZgk7cECZU9wGb8N1pYQ0yOn/SIr8t0l9XnGRdQZvNV/ZHBYu6GO/W3tj5K3VN1Q==} dependencies: tinyspy: 2.2.0 dev: true - /@vitest/utils@1.1.3: - resolution: {integrity: sha512-Dyt3UMcdElTll2H75vhxfpZu03uFpXRCHxWnzcrFjZxT1kTbq8ALUYIeBgGolo1gldVdI0YSlQRacsqxTwNqwg==} + /@vitest/utils@1.2.0: + resolution: {integrity: sha512-FyD5bpugsXlwVpTcGLDf3wSPYy8g541fQt14qtzo8mJ4LdEpDKZ9mQy2+qdJm2TZRpjY5JLXihXCgIxiRJgi5g==} dependencies: diff-sequences: 29.6.3 estree-walker: 3.0.3 @@ -1524,6 +1534,10 @@ packages: update-browserslist-db: 1.0.13(browserslist@4.22.2) dev: true + /buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true + /bundle-require@4.0.2(esbuild@0.19.11): resolution: {integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1685,6 +1699,10 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true + /commander@2.20.3: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + dev: true + /commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} @@ -3632,7 +3650,7 @@ packages: fast-diff: 1.3.0 dev: true - /prettier-plugin-organize-imports@3.2.4(prettier@3.1.1)(typescript@5.3.3): + /prettier-plugin-organize-imports@3.2.4(prettier@3.2.0)(typescript@5.3.3): resolution: {integrity: sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==} peerDependencies: '@volar/vue-language-plugin-pug': ^1.0.4 @@ -3645,7 +3663,7 @@ packages: '@volar/vue-typescript': optional: true dependencies: - prettier: 3.1.1 + prettier: 3.2.0 typescript: 5.3.3 dev: true @@ -3661,8 +3679,8 @@ packages: hasBin: true dev: true - /prettier@3.1.1: - resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==} + /prettier@3.2.0: + resolution: {integrity: sha512-/vBUecTGaPlRVwyZVROVC58bYIScqaoEJzZmzQXXrZOzqn0TwWz0EnOozOlFO/YAImRnb7XsKpTCd3m1SjS2Ww==} engines: {node: '>=14'} hasBin: true dev: true @@ -3981,6 +3999,13 @@ packages: engines: {node: '>=0.10.0'} dev: true + /source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} @@ -4176,6 +4201,17 @@ packages: engines: {node: '>=8'} dev: true + /terser@5.26.0: + resolution: {integrity: sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ==} + engines: {node: '>=10'} + hasBin: true + dependencies: + '@jridgewell/source-map': 0.3.5 + acorn: 8.11.3 + commander: 2.20.3 + source-map-support: 0.5.21 + dev: true + /test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} @@ -4471,8 +4507,8 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite-node@1.1.3: - resolution: {integrity: sha512-BLSO72YAkIUuNrOx+8uznYICJfTEbvBAmWClY3hpath5+h1mbPS5OMn42lrTxXuyCazVyZoDkSRnju78GiVCqA==} + /vite-node@1.2.0(terser@5.26.0): + resolution: {integrity: sha512-ETnQTHeAbbOxl7/pyBck9oAPZZZo+kYnFt1uQDD+hPReOc+wCjXw4r4jHriBRuVDB5isHmPXxrfc1yJnfBERqg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: @@ -4480,7 +4516,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.0.11 + vite: 5.0.11(terser@5.26.0) transitivePeerDependencies: - '@types/node' - less @@ -4492,7 +4528,7 @@ packages: - terser dev: true - /vite@5.0.11: + /vite@5.0.11(terser@5.26.0): resolution: {integrity: sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -4523,12 +4559,13 @@ packages: esbuild: 0.19.11 postcss: 8.4.33 rollup: 4.9.4 + terser: 5.26.0 optionalDependencies: fsevents: 2.3.3 dev: true - /vitest@1.1.3: - resolution: {integrity: sha512-2l8om1NOkiA90/Y207PsEvJLYygddsOyr81wLQ20Ra8IlLKbyQncWsGZjnbkyG2KwwuTXLQjEPOJuxGMG8qJBQ==} + /vitest@1.2.0(terser@5.26.0): + resolution: {integrity: sha512-Ixs5m7BjqvLHXcibkzKRQUvD/XLw0E3rvqaCMlrm/0LMsA0309ZqYvTlPzkhh81VlEyVZXFlwWnkhb6/UMtcaQ==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -4552,11 +4589,11 @@ packages: jsdom: optional: true dependencies: - '@vitest/expect': 1.1.3 - '@vitest/runner': 1.1.3 - '@vitest/snapshot': 1.1.3 - '@vitest/spy': 1.1.3 - '@vitest/utils': 1.1.3 + '@vitest/expect': 1.2.0 + '@vitest/runner': 1.2.0 + '@vitest/snapshot': 1.2.0 + '@vitest/spy': 1.2.0 + '@vitest/utils': 1.2.0 acorn-walk: 8.3.1 cac: 6.7.14 chai: 4.4.0 @@ -4570,8 +4607,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.8.1 - vite: 5.0.11 - vite-node: 1.1.3 + vite: 5.0.11(terser@5.26.0) + vite-node: 1.2.0(terser@5.26.0) why-is-node-running: 2.2.2 transitivePeerDependencies: - less