From 711894fcdb23ba901f33809df0ad36666453f24a Mon Sep 17 00:00:00 2001 From: Tmk Date: Sun, 7 Sep 2025 23:51:50 +0800 Subject: [PATCH] feat: add testing setup with ci workflow --- .github/workflows/ci.yml | 40 ++ .gitignore | 1 + package.json | 4 +- pnpm-lock.yaml | 516 +++++++++++++++++-- src/charts.tsx | 4 +- stories/bar-mix-timeline-finance.stories.tsx | 3 +- stories/bar.stories.tsx | 24 +- stories/line.stories.tsx | 33 +- stories/pie.stories.tsx | 4 +- tests/basic.spec.tsx | 39 ++ tsdown.config.ts => tsdown.config.mts | 0 vitest.config.mts | 16 + 12 files changed, 625 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 tests/basic.spec.tsx rename tsdown.config.ts => tsdown.config.mts (100%) create mode 100644 vitest.config.mts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2ecb78e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + pull_request: + branches: [main] + types: [opened, synchronize] + +concurrency: + group: ci-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Test + timeout-minutes: 15 + strategy: + matrix: + os: [ubuntu-latest] + node-version: [22.x] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: pnpm + + - name: Install deps + run: | + pnpm i --frozen-lockfile + + - name: Lint + run: pnpm lint + + - name: Test + run: pnpm test diff --git a/.gitignore b/.gitignore index 896a12c..509c2cf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ node_modules .idea/ .pnpm-store/ +coverage/ dist/ storybook-static/ fanciers-echarts-react-*.tgz diff --git a/package.json b/package.json index 69d751d..335b83b 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ }, "scripts": { "dev": "storybook dev", + "test": "vitest", "prepack": "tsdown", "lint": "tsc --noEmit" }, @@ -46,7 +47,8 @@ "storybook-react-rsbuild": "^2.1.0", "swr": "^2.3.6", "tsdown": "^0.14.2", - "typescript": "^5.9.2" + "typescript": "^5.9.2", + "vitest": "^3.2.4" }, "peerDependencies": { "echarts": "^6.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b3258bf..d9b0574 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,10 +16,10 @@ importers: version: 1.4.0(@rsbuild/core@1.5.4) '@storybook/addon-docs': specifier: ^9.1.5 - version: 9.1.5(@types/react@19.1.12)(storybook@9.1.5(@testing-library/dom@10.4.1)) + version: 9.1.5(@types/react@19.1.12)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0))) '@storybook/react': specifier: ^9.1.5 - version: 9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1))(typescript@5.9.2) + version: 9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))(typescript@5.9.2) '@types/node': specifier: ^24.3.1 version: 24.3.1 @@ -40,10 +40,10 @@ importers: version: 19.1.1(react@19.1.1) storybook: specifier: ^9.1.5 - version: 9.1.5(@testing-library/dom@10.4.1) + version: 9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) storybook-react-rsbuild: specifier: ^2.1.0 - version: 2.1.0(@rsbuild/core@1.5.4)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1))(typescript@5.9.2)(webpack@5.101.1(esbuild@0.25.9)) + version: 2.1.0(@rsbuild/core@1.5.4)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(rollup@4.50.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))(typescript@5.9.2)(webpack@5.101.1(esbuild@0.25.9)) swr: specifier: ^2.3.6 version: 2.3.6(react@19.1.1) @@ -53,6 +53,9 @@ importers: typescript: specifier: ^5.9.2 version: 5.9.2 + vitest: + specifier: ^3.2.4 + version: 3.2.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0) packages: @@ -472,6 +475,111 @@ packages: rollup: optional: true + '@rollup/rollup-android-arm-eabi@4.50.1': + resolution: {integrity: sha512-HJXwzoZN4eYTdD8bVV22DN8gsPCAj3V20NHKOs8ezfXanGpmVPR7kalUHd+Y31IJp9stdB87VKPFbsGY3H/2ag==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.50.1': + resolution: {integrity: sha512-PZlsJVcjHfcH53mOImyt3bc97Ep3FJDXRpk9sMdGX0qgLmY0EIWxCag6EigerGhLVuL8lDVYNnSo8qnTElO4xw==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.50.1': + resolution: {integrity: sha512-xc6i2AuWh++oGi4ylOFPmzJOEeAa2lJeGUGb4MudOtgfyyjr4UPNK+eEWTPLvmPJIY/pgw6ssFIox23SyrkkJw==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.50.1': + resolution: {integrity: sha512-2ofU89lEpDYhdLAbRdeyz/kX3Y2lpYc6ShRnDjY35bZhd2ipuDMDi6ZTQ9NIag94K28nFMofdnKeHR7BT0CATw==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.50.1': + resolution: {integrity: sha512-wOsE6H2u6PxsHY/BeFHA4VGQN3KUJFZp7QJBmDYI983fgxq5Th8FDkVuERb2l9vDMs1D5XhOrhBrnqcEY6l8ZA==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.50.1': + resolution: {integrity: sha512-A/xeqaHTlKbQggxCqispFAcNjycpUEHP52mwMQZUNqDUJFFYtPHCXS1VAG29uMlDzIVr+i00tSFWFLivMcoIBQ==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.50.1': + resolution: {integrity: sha512-54v4okehwl5TaSIkpp97rAHGp7t3ghinRd/vyC1iXqXMfjYUTm7TfYmCzXDoHUPTTf36L8pr0E7YsD3CfB3ZDg==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.50.1': + resolution: {integrity: sha512-p/LaFyajPN/0PUHjv8TNyxLiA7RwmDoVY3flXHPSzqrGcIp/c2FjwPPP5++u87DGHtw+5kSH5bCJz0mvXngYxw==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.50.1': + resolution: {integrity: sha512-2AbMhFFkTo6Ptna1zO7kAXXDLi7H9fGTbVaIq2AAYO7yzcAsuTNWPHhb2aTA6GPiP+JXh85Y8CiS54iZoj4opw==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.50.1': + resolution: {integrity: sha512-Cgef+5aZwuvesQNw9eX7g19FfKX5/pQRIyhoXLCiBOrWopjo7ycfB292TX9MDcDijiuIJlx1IzJz3IoCPfqs9w==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-loongarch64-gnu@4.50.1': + resolution: {integrity: sha512-RPhTwWMzpYYrHrJAS7CmpdtHNKtt2Ueo+BlLBjfZEhYBhK00OsEqM08/7f+eohiF6poe0YRDDd8nAvwtE/Y62Q==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.50.1': + resolution: {integrity: sha512-eSGMVQw9iekut62O7eBdbiccRguuDgiPMsw++BVUg+1K7WjZXHOg/YOT9SWMzPZA+w98G+Fa1VqJgHZOHHnY0Q==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.50.1': + resolution: {integrity: sha512-S208ojx8a4ciIPrLgazF6AgdcNJzQE4+S9rsmOmDJkusvctii+ZvEuIC4v/xFqzbuP8yDjn73oBlNDgF6YGSXQ==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-riscv64-musl@4.50.1': + resolution: {integrity: sha512-3Ag8Ls1ggqkGUvSZWYcdgFwriy2lWo+0QlYgEFra/5JGtAd6C5Hw59oojx1DeqcA2Wds2ayRgvJ4qxVTzCHgzg==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.50.1': + resolution: {integrity: sha512-t9YrKfaxCYe7l7ldFERE1BRg/4TATxIg+YieHQ966jwvo7ddHJxPj9cNFWLAzhkVsbBvNA4qTbPVNsZKBO4NSg==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.50.1': + resolution: {integrity: sha512-MCgtFB2+SVNuQmmjHf+wfI4CMxy3Tk8XjA5Z//A0AKD7QXUYFMQcns91K6dEHBvZPCnhJSyDWLApk40Iq/H3tA==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.50.1': + resolution: {integrity: sha512-nEvqG+0jeRmqaUMuwzlfMKwcIVffy/9KGbAGyoa26iu6eSngAYQ512bMXuqqPrlTyfqdlB9FVINs93j534UJrg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-openharmony-arm64@4.50.1': + resolution: {integrity: sha512-RDsLm+phmT3MJd9SNxA9MNuEAO/J2fhW8GXk62G/B4G7sLVumNFbRwDL6v5NrESb48k+QMqdGbHgEtfU0LCpbA==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.50.1': + resolution: {integrity: sha512-hpZB/TImk2FlAFAIsoElM3tLzq57uxnGYwplg6WDyAxbYczSi8O2eQ+H2Lx74504rwKtZ3N2g4bCUkiamzS6TQ==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.50.1': + resolution: {integrity: sha512-SXjv8JlbzKM0fTJidX4eVsH+Wmnp0/WcD8gJxIZyR6Gay5Qcsmdbi9zVtnbkGPG8v2vMR1AD06lGWy5FLMcG7A==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.50.1': + resolution: {integrity: sha512-StxAO/8ts62KZVRAm4JZYq9+NqNsV7RvimNK+YM7ry//zebEH6meuugqW/P5OFUCjyQgui+9fUxT6d5NShvMvA==} + cpu: [x64] + os: [win32] + '@rsbuild/core@1.5.4': resolution: {integrity: sha512-iRzq4hEXawL4MVkPKhfGMJxS45XIfwkweAZXEHeaboq6vxbpg0dLRgkbaIuuFyF9hCwI0y3ant/xVXOqDghJNw==} engines: {node: '>=18.12.0'} @@ -707,6 +815,12 @@ packages: '@vitest/pretty-format@3.2.4': resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + '@vitest/spy@3.2.4': resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} @@ -1099,6 +1213,10 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} + expect-type@1.2.2: + resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==} + engines: {node: '>=12.0.0'} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -1303,6 +1421,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + jsesc@3.1.0: resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} @@ -1404,6 +1525,11 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} @@ -1497,6 +1623,10 @@ packages: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} + engines: {node: ^10 || ^12 || >=14} + pretty-format@27.5.1: resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -1603,6 +1733,11 @@ packages: resolution: {integrity: sha512-gJATyqcsJe0Cs8RMFO8XgFjfTc0lK1jcSvirDQDSIfsJE+vt53QH/Ob+OBSJsXb98YtZXHfP/bHpELpPwCprow==} hasBin: true + rollup@4.50.1: + resolution: {integrity: sha512-78E9voJHwnXQMiQdiqswVLZwJIzdBKJ1GdI5Zx6XwoFKUIk09/sSrr+05QFzvYb8q6Y9pPV45zzDuYa3907TZA==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + rsbuild-plugin-html-minifier-terser@1.1.2: resolution: {integrity: sha512-8RyDdz30TlwcHFMOL/2rEMlkffY8CVaxcj3jqZvNTlIZjr5rNLWPAN2h6dAe0Gp+dh94Sl192IACO/nwgtoOfQ==} peerDependencies: @@ -1657,10 +1792,17 @@ packages: resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} engines: {node: '>= 0.4'} + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + sirv@2.0.4: resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} engines: {node: '>= 10'} + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} @@ -1668,9 +1810,15 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + stackframe@1.3.4: resolution: {integrity: sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==} + std-env@3.9.0: + resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} + storybook-builder-rsbuild@2.1.0: resolution: {integrity: sha512-hTpvXMr8jNM32diOGeBSAnWMoJ36M02KFXAH5G4GSPvAnJ7RY2K6E+im1vX8UMcphw3p+W95IXf3yDLP6F++Gw==} peerDependencies: @@ -1721,6 +1869,9 @@ packages: resolution: {integrity: sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==} engines: {node: '>=12'} + strip-literal@3.0.0: + resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==} + supports-color@8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} @@ -1768,6 +1919,12 @@ packages: tiny-invariant@1.3.3: resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + tinyexec@1.0.1: resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} @@ -1775,6 +1932,10 @@ packages: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + tinyrainbow@2.0.0: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} @@ -1887,6 +2048,79 @@ packages: util@0.12.5: resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + + vite@7.1.4: + resolution: {integrity: sha512-X5QFK4SGynAeeIt+A7ZWnApdUyHYm+pzv/8/A57LqSGcI88U6R6ipOs3uCesdc6yl7nl+zNO0t8LmqAdXcQihw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + watchpack@2.4.4: resolution: {integrity: sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==} engines: {node: '>=10.13.0'} @@ -1912,6 +2146,11 @@ packages: resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} engines: {node: '>= 0.4'} + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -2290,11 +2529,76 @@ snapshots: '@rolldown/pluginutils@1.0.0-beta.35': {} - '@rollup/pluginutils@5.3.0': + '@rollup/pluginutils@5.3.0(rollup@4.50.1)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 + optionalDependencies: + rollup: 4.50.1 + + '@rollup/rollup-android-arm-eabi@4.50.1': + optional: true + + '@rollup/rollup-android-arm64@4.50.1': + optional: true + + '@rollup/rollup-darwin-arm64@4.50.1': + optional: true + + '@rollup/rollup-darwin-x64@4.50.1': + optional: true + + '@rollup/rollup-freebsd-arm64@4.50.1': + optional: true + + '@rollup/rollup-freebsd-x64@4.50.1': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.50.1': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.50.1': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.50.1': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.50.1': + optional: true + + '@rollup/rollup-linux-loongarch64-gnu@4.50.1': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.50.1': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.50.1': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.50.1': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.50.1': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.50.1': + optional: true + + '@rollup/rollup-linux-x64-musl@4.50.1': + optional: true + + '@rollup/rollup-openharmony-arm64@4.50.1': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.50.1': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.50.1': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.50.1': + optional: true '@rsbuild/core@1.5.4': dependencies: @@ -2385,27 +2689,27 @@ snapshots: html-entities: 2.6.0 react-refresh: 0.17.0 - '@storybook/addon-docs@9.1.5(@types/react@19.1.12)(storybook@9.1.5(@testing-library/dom@10.4.1))': + '@storybook/addon-docs@9.1.5(@types/react@19.1.12)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))': dependencies: '@mdx-js/react': 3.1.1(@types/react@19.1.12)(react@19.1.1) - '@storybook/csf-plugin': 9.1.5(storybook@9.1.5(@testing-library/dom@10.4.1)) + '@storybook/csf-plugin': 9.1.5(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0))) '@storybook/icons': 1.4.0(react-dom@19.1.1(react@19.1.1))(react@19.1.1) - '@storybook/react-dom-shim': 9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)) + '@storybook/react-dom-shim': 9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0))) react: 19.1.1 react-dom: 19.1.1(react@19.1.1) - storybook: 9.1.5(@testing-library/dom@10.4.1) + storybook: 9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) ts-dedent: 2.2.0 transitivePeerDependencies: - '@types/react' - '@storybook/core-webpack@9.1.5(storybook@9.1.5(@testing-library/dom@10.4.1))': + '@storybook/core-webpack@9.1.5(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))': dependencies: - storybook: 9.1.5(@testing-library/dom@10.4.1) + storybook: 9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) ts-dedent: 2.2.0 - '@storybook/csf-plugin@9.1.5(storybook@9.1.5(@testing-library/dom@10.4.1))': + '@storybook/csf-plugin@9.1.5(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))': dependencies: - storybook: 9.1.5(@testing-library/dom@10.4.1) + storybook: 9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) unplugin: 1.16.1 '@storybook/global@5.0.0': {} @@ -2429,19 +2733,19 @@ snapshots: transitivePeerDependencies: - supports-color - '@storybook/react-dom-shim@9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1))': + '@storybook/react-dom-shim@9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))': dependencies: react: 19.1.1 react-dom: 19.1.1(react@19.1.1) - storybook: 9.1.5(@testing-library/dom@10.4.1) + storybook: 9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) - '@storybook/react@9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1))(typescript@5.9.2)': + '@storybook/react@9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))(typescript@5.9.2)': dependencies: '@storybook/global': 5.0.0 - '@storybook/react-dom-shim': 9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)) + '@storybook/react-dom-shim': 9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0))) react: 19.1.1 react-dom: 19.1.1(react@19.1.1) - storybook: 9.1.5(@testing-library/dom@10.4.1) + storybook: 9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) optionalDependencies: typescript: 5.9.2 @@ -2549,16 +2853,30 @@ snapshots: chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4': + '@vitest/mocker@3.2.4(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.18 + optionalDependencies: + vite: 7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0) '@vitest/pretty-format@3.2.4': dependencies: tinyrainbow: 2.0.0 + '@vitest/runner@3.2.4': + dependencies: + '@vitest/utils': 3.2.4 + pathe: 2.0.3 + strip-literal: 3.0.0 + + '@vitest/snapshot@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + magic-string: 0.30.18 + pathe: 2.0.3 + '@vitest/spy@3.2.4': dependencies: tinyspy: 4.0.3 @@ -2961,6 +3279,8 @@ snapshots: events@3.3.0: {} + expect-type@1.2.2: {} + fast-deep-equal@3.1.3: {} fast-json-parse@1.0.3: {} @@ -3161,6 +3481,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + jsesc@3.1.0: {} json-buffer@3.0.1: {} @@ -3251,6 +3573,8 @@ snapshots: ms@2.1.3: {} + nanoid@3.3.11: {} + neo-async@2.6.2: {} no-case@3.0.4: @@ -3328,6 +3652,12 @@ snapshots: possible-typed-array-names@1.1.0: {} + postcss@8.5.6: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 + pretty-format@27.5.1: dependencies: ansi-regex: 5.0.1 @@ -3454,6 +3784,33 @@ snapshots: '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.35 '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.35 + rollup@4.50.1: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.50.1 + '@rollup/rollup-android-arm64': 4.50.1 + '@rollup/rollup-darwin-arm64': 4.50.1 + '@rollup/rollup-darwin-x64': 4.50.1 + '@rollup/rollup-freebsd-arm64': 4.50.1 + '@rollup/rollup-freebsd-x64': 4.50.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.50.1 + '@rollup/rollup-linux-arm-musleabihf': 4.50.1 + '@rollup/rollup-linux-arm64-gnu': 4.50.1 + '@rollup/rollup-linux-arm64-musl': 4.50.1 + '@rollup/rollup-linux-loongarch64-gnu': 4.50.1 + '@rollup/rollup-linux-ppc64-gnu': 4.50.1 + '@rollup/rollup-linux-riscv64-gnu': 4.50.1 + '@rollup/rollup-linux-riscv64-musl': 4.50.1 + '@rollup/rollup-linux-s390x-gnu': 4.50.1 + '@rollup/rollup-linux-x64-gnu': 4.50.1 + '@rollup/rollup-linux-x64-musl': 4.50.1 + '@rollup/rollup-openharmony-arm64': 4.50.1 + '@rollup/rollup-win32-arm64-msvc': 4.50.1 + '@rollup/rollup-win32-ia32-msvc': 4.50.1 + '@rollup/rollup-win32-x64-msvc': 4.50.1 + fsevents: 2.3.3 + rsbuild-plugin-html-minifier-terser@1.1.2(@rsbuild/core@1.5.4): dependencies: '@types/html-minifier-terser': 7.0.2 @@ -3523,12 +3880,16 @@ snapshots: side-channel-map: 1.0.1 side-channel-weakmap: 1.0.2 + siginfo@2.0.0: {} + sirv@2.0.4: dependencies: '@polka/url': 1.0.0-next.29 mrmime: 2.0.1 totalist: 3.0.1 + source-map-js@1.2.1: {} + source-map-support@0.5.21: dependencies: buffer-from: 1.1.2 @@ -3536,14 +3897,18 @@ snapshots: source-map@0.6.1: {} + stackback@0.0.2: {} + stackframe@1.3.4: {} - storybook-builder-rsbuild@2.1.0(@rsbuild/core@1.5.4)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1))(typescript@5.9.2): + std-env@3.9.0: {} + + storybook-builder-rsbuild@2.1.0(@rsbuild/core@1.5.4)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))(typescript@5.9.2): dependencies: '@rsbuild/core': 1.5.4 '@rsbuild/plugin-type-check': 1.2.4(@rsbuild/core@1.5.4)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(typescript@5.9.2) - '@storybook/addon-docs': 9.1.5(@types/react@19.1.12)(storybook@9.1.5(@testing-library/dom@10.4.1)) - '@storybook/core-webpack': 9.1.5(storybook@9.1.5(@testing-library/dom@10.4.1)) + '@storybook/addon-docs': 9.1.5(@types/react@19.1.12)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0))) + '@storybook/core-webpack': 9.1.5(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0))) browser-assert: 1.2.1 case-sensitive-paths-webpack-plugin: 2.4.0 cjs-module-lexer: 1.4.3 @@ -3555,7 +3920,7 @@ snapshots: process: 0.11.10 rsbuild-plugin-html-minifier-terser: 1.1.2(@rsbuild/core@1.5.4) sirv: 2.0.4 - storybook: 9.1.5(@testing-library/dom@10.4.1) + storybook: 9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) ts-dedent: 2.2.0 url: 0.11.4 util: 0.12.5 @@ -3568,11 +3933,11 @@ snapshots: - '@rspack/core' - '@types/react' - storybook-react-rsbuild@2.1.0(@rsbuild/core@1.5.4)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1))(typescript@5.9.2)(webpack@5.101.1(esbuild@0.25.9)): + storybook-react-rsbuild@2.1.0(@rsbuild/core@1.5.4)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(rollup@4.50.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))(typescript@5.9.2)(webpack@5.101.1(esbuild@0.25.9)): dependencies: - '@rollup/pluginutils': 5.3.0 + '@rollup/pluginutils': 5.3.0(rollup@4.50.1) '@rsbuild/core': 1.5.4 - '@storybook/react': 9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1))(typescript@5.9.2) + '@storybook/react': 9.1.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))(typescript@5.9.2) '@storybook/react-docgen-typescript-plugin': 1.0.1(typescript@5.9.2)(webpack@5.101.1(esbuild@0.25.9)) find-up: 5.0.0 magic-string: 0.30.18 @@ -3581,8 +3946,8 @@ snapshots: react-docgen-typescript: 2.4.0(typescript@5.9.2) react-dom: 19.1.1(react@19.1.1) resolve: 1.22.10 - storybook: 9.1.5(@testing-library/dom@10.4.1) - storybook-builder-rsbuild: 2.1.0(@rsbuild/core@1.5.4)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1))(typescript@5.9.2) + storybook: 9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) + storybook-builder-rsbuild: 2.1.0(@rsbuild/core@1.5.4)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)))(typescript@5.9.2) tsconfig-paths: 4.2.0 optionalDependencies: typescript: 5.9.2 @@ -3593,13 +3958,13 @@ snapshots: - supports-color - webpack - storybook@9.1.5(@testing-library/dom@10.4.1): + storybook@9.1.5(@testing-library/dom@10.4.1)(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)): dependencies: '@storybook/global': 5.0.0 '@testing-library/jest-dom': 6.8.0 '@testing-library/user-event': 14.6.1(@testing-library/dom@10.4.1) '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4 + '@vitest/mocker': 3.2.4(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) '@vitest/spy': 3.2.4 better-opn: 3.0.2 esbuild: 0.25.9 @@ -3625,6 +3990,10 @@ snapshots: dependencies: min-indent: 1.0.1 + strip-literal@3.0.0: + dependencies: + js-tokens: 9.0.1 + supports-color@8.1.1: dependencies: has-flag: 4.0.0 @@ -3663,6 +4032,10 @@ snapshots: tiny-invariant@1.3.3: {} + tinybench@2.9.0: {} + + tinyexec@0.3.2: {} + tinyexec@1.0.1: {} tinyglobby@0.2.15: @@ -3670,6 +4043,8 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 + tinypool@1.1.1: {} + tinyrainbow@2.0.0: {} tinyspy@4.0.3: {} @@ -3778,6 +4153,82 @@ snapshots: is-typed-array: 1.1.15 which-typed-array: 1.1.19 + vite-node@3.2.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0): + dependencies: + cac: 6.7.14 + debug: 4.4.1 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0): + dependencies: + esbuild: 0.25.9 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.50.1 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 24.3.1 + fsevents: 2.3.3 + jiti: 2.5.1 + terser: 5.44.0 + + vitest@3.2.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + debug: 4.4.1 + expect-type: 1.2.2 + magic-string: 0.30.18 + pathe: 2.0.3 + picomatch: 4.0.3 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.15 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 7.1.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0) + vite-node: 3.2.4(@types/node@24.3.1)(jiti@2.5.1)(terser@5.44.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 24.3.1 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + watchpack@2.4.4: dependencies: glob-to-regexp: 0.4.1 @@ -3829,6 +4280,11 @@ snapshots: gopd: 1.2.0 has-tostringtag: 1.0.2 + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + wrappy@1.0.2: {} ws@8.18.3: {} diff --git a/src/charts.tsx b/src/charts.tsx index 839b6f1..d27f739 100644 --- a/src/charts.tsx +++ b/src/charts.tsx @@ -6,6 +6,8 @@ import type { GraphSeriesOption, GridComponentOption, HeatmapSeriesOption, + LineSeriesOption, + PieSeriesOption, ScatterSeriesOption, } from 'echarts'; import { @@ -16,8 +18,6 @@ import { LineChart as EChartLineChart, PieChart as EChartPieChart, ScatterChart as EChartScatterChart, - type LineSeriesOption, - type PieSeriesOption, } from 'echarts/charts'; import { GridComponent } from 'echarts/components'; import type { ComponentOption } from 'echarts/types/src/util/types.js'; diff --git a/stories/bar-mix-timeline-finance.stories.tsx b/stories/bar-mix-timeline-finance.stories.tsx index f1af6a5..f7b8fe7 100644 --- a/stories/bar-mix-timeline-finance.stories.tsx +++ b/stories/bar-mix-timeline-finance.stories.tsx @@ -1,6 +1,6 @@ import { BarChart, Legend, PieChart, Timeline, Title, Tooltip } from '@fanciers/echarts-react'; import type { Meta, StoryObj } from '@storybook/react'; -import type { TimelineDataItemOption } from 'echarts/types/src/component/timeline/TimelineModel.js'; +import type { TimelineComponentOption } from 'echarts'; const meta = { title: 'Bar', @@ -117,6 +117,7 @@ dataMap.dataFinancial = dataFormatter({ export const MixTimelineFinance: Story = { name: 'Finance Indices 2002', render() { + type TimelineDataItemOption = NonNullable[number]; return ( ({}); + const [title, setTitle] = React.useState({}); const chartRef = React.useRef(null); React.useEffect(() => { @@ -1459,7 +1467,7 @@ export const BarDrilldown: Story = { }, ]; - const defaultXAxis: XAXisOption = { data: ['Animals', 'Fruits', 'Cars'] }; + const defaultXAxis: XAXisComponentOption = { data: ['Animals', 'Fruits', 'Cars'] }; const defaultSeries: BarSeriesOption = { type: 'bar', id: 'sales', @@ -1470,7 +1478,7 @@ export const BarDrilldown: Story = { ], universalTransition: { enabled: true, divideShape: 'clone' }, }; - const [xAxis, setXAxis] = React.useState(defaultXAxis); + const [xAxis, setXAxis] = React.useState(defaultXAxis); const [series, setSeries] = React.useState(defaultSeries); const [graphic, setGraphic] = React.useState([]); @@ -2719,9 +2727,9 @@ export const MatrixMiniBarGeo: Story = { ]; // prettier-ignore var _colorList = ['#ffd10a', '#0ca8df', '#b6d634', '#3fbe95', '#5070dd', '#ff994d', '#505372', '#fb628b', '#785db0']; - const grid: GridOption[] = []; - const xAxis: XAXisOption[] = []; - const yAxis: YAXisOption[] = []; + const grid: GridComponentOption[] = []; + const xAxis: XAXisComponentOption[] = []; + const yAxis: YAXisComponentOption[] = []; const series: BarSeriesOption[] = []; const matrix: MatrixComponentOption = { x: { diff --git a/stories/line.stories.tsx b/stories/line.stories.tsx index 5e56395..d0a0c9c 100644 --- a/stories/line.stories.tsx +++ b/stories/line.stories.tsx @@ -18,14 +18,17 @@ import { Tooltip, VisualMap, } from '@fanciers/echarts-react'; -import type { LineSeriesOption } from 'echarts/charts'; -import type { DatasetOption, GridOption, TitleOption, XAXisOption, YAXisOption } from 'echarts/types/dist/shared'; +import type { + DatasetComponentOption, + GridComponentOption, + LineSeriesOption, + MarkLineComponentOption, + TitleComponentOption, + XAXisComponentOption, + YAXisComponentOption, +} from 'echarts'; import React from 'react'; import useSWR from 'swr'; -import type { - MarkLine1DDataItemOption, - MarkLine2DDataItemOption, -} from 'echarts/types/src/component/marker/MarkLineModel.js'; import type { LineLabelOption } from 'echarts/types/src/util/types.js'; const meta = { @@ -1161,7 +1164,7 @@ export const LineRace: Story = { const { data } = useSWR('https://echarts.apache.org/examples/data/asset/data/life-expectancy-table.json'); const countries = ['Finland', 'France', 'Germany', 'Iceland', 'Norway', 'Poland', 'Russia', 'United Kingdom']; - const datasetWithFilters: DatasetOption[] = []; + const datasetWithFilters: DatasetComponentOption[] = []; const seriesList: LineSeriesOption[] = []; echarts.util.each(countries, function (country) { var datasetId = 'dataset_' + country; @@ -1217,7 +1220,7 @@ export const LineRace: Story = { export const LineMarkline: Story = { name: 'Line with Marklines', render() { - const markLine: (MarkLine1DDataItemOption | MarkLine2DDataItemOption)[] = []; + const markLine: NonNullable = []; const positions: NonNullable[] = [ 'start', 'middle', @@ -1531,11 +1534,11 @@ export const LineEasing: Story = { }; const N_POINT = 30; - const grids: GridOption[] = []; - const xAxes: XAXisOption[] = []; - const yAxes: YAXisOption[] = []; + const grids: GridComponentOption[] = []; + const xAxes: XAXisComponentOption[] = []; + const yAxes: YAXisComponentOption[] = []; const series: LineSeriesOption[] = []; - const titles: TitleOption[] = []; + const titles: TitleComponentOption[] = []; let count = 0; Object.keys(easingFuncs).forEach(function (easingName) { var easingFunc = easingFuncs[easingName as keyof typeof easingFuncs]; @@ -2422,9 +2425,9 @@ export const MatrixSparkline: Story = { return cellData; } - const grid: GridOption[] = []; - const xAxis: XAXisOption[] = []; - const yAxis: YAXisOption[] = []; + const grid: GridComponentOption[] = []; + const xAxis: XAXisComponentOption[] = []; + const yAxis: YAXisComponentOption[] = []; const series: LineSeriesOption[] = []; eachMatrixCell((xval, yval, xidx, yidx) => { diff --git a/stories/pie.stories.tsx b/stories/pie.stories.tsx index 22b4b91..1d07076 100644 --- a/stories/pie.stories.tsx +++ b/stories/pie.stories.tsx @@ -13,7 +13,7 @@ import { echarts, } from '@fanciers/echarts-react'; import type { Meta, StoryObj } from '@storybook/react'; -import type { PieSeriesOption } from 'echarts/charts'; +import type { PieSeriesOption } from 'echarts'; import React from 'react'; import useSWR from 'swr'; @@ -449,7 +449,7 @@ export const PieLabelLineAdjust: Story = { = T | T[]; + +describe('TypeScript Definitions', () => { + it('should accept basic props', () => { + expectTypeOf(LineChart).toBeFunction(); + expectTypeOf(LineChart<[]>) + .parameter(0) + .pick<'xAxis' | 'yAxis' | 'series'>() + .toEqualTypeOf<{ + xAxis?: Arrayable; + yAxis?: Arrayable; + series?: Arrayable; + }>(); + }); + + it('should support compose single chart', () => { + expectTypeOf(LineChart<[typeof BarChart]>) + .parameter(0) + .pick<'series'>() + .toEqualTypeOf<{ series?: Arrayable }>(); + }); + + it('should support compose multiple charts', () => { + expectTypeOf(LineChart<[typeof BarChart, typeof PieChart]>) + .parameter(0) + .pick<'series'>() + .toEqualTypeOf<{ series?: Arrayable }>(); + }); +}); diff --git a/tsdown.config.ts b/tsdown.config.mts similarity index 100% rename from tsdown.config.ts rename to tsdown.config.mts diff --git a/vitest.config.mts b/vitest.config.mts new file mode 100644 index 0000000..212e960 --- /dev/null +++ b/vitest.config.mts @@ -0,0 +1,16 @@ +import path from 'node:path'; +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + resolve: { + alias: { + '@fanciers/echarts-react': path.resolve(import.meta.dirname, './src/index.ts'), + }, + }, + test: { + dir: 'tests', + coverage: { + include: ['src/**/*'], + }, + }, +});