From e995f14e41db49ae91d8858233f566b192341b33 Mon Sep 17 00:00:00 2001 From: galangel Date: Wed, 14 Jan 2026 00:02:16 +0200 Subject: [PATCH] Update package name and version; remove unused dependencies and configurations - Changed package name to `@galangel/react-tip-magic` and updated version to `1.0.3`. - Removed unused dependencies related to Playwright and Storybook addons. - Updated README to reflect the new package name in installation and import instructions. - Simplified Vitest configuration by removing project definitions and unnecessary setup files. - Cleaned up CI workflows by removing Playwright browser installation steps. Signed-off-by: galangel --- .github/workflows/ci.yml | 4 - .github/workflows/publish.yml | 10 +- .storybook/main.ts | 7 +- .storybook/preview.ts | 7 -- .storybook/vitest.setup.ts | 7 -- README.md | 16 +-- package-lock.json | 196 +++++----------------------------- package.json | 9 +- src/index.ts | 5 +- vitest.config.ts | 45 +------- vitest.shims.d.ts | 1 - 11 files changed, 44 insertions(+), 263 deletions(-) delete mode 100644 .storybook/vitest.setup.ts delete mode 100644 vitest.shims.d.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6137dfe..43606cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,9 +28,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Install Playwright browsers - run: npx playwright install --with-deps chromium - - name: Run TypeScript type check run: npm run typecheck @@ -106,4 +103,3 @@ jobs: name: storybook-static path: storybook-static/ retention-days: 7 - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fa03aac..efbf20f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,15 +27,15 @@ jobs: run: | # Get current version from package.json CURRENT_VERSION=$(node -p "require('./package.json').version") - + # Get previous version from parent commit git checkout HEAD~1 -- package.json 2>/dev/null || true PREVIOUS_VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "0.0.0") git checkout HEAD -- package.json - + echo "Current version: $CURRENT_VERSION" echo "Previous version: $PREVIOUS_VERSION" - + if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then echo "Version changed from $PREVIOUS_VERSION to $CURRENT_VERSION" echo "changed=true" >> $GITHUB_OUTPUT @@ -69,9 +69,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Install Playwright browsers - run: npx playwright install --with-deps chromium - - name: Run tests run: npm run test @@ -93,4 +90,3 @@ jobs: prerelease: ${{ contains(needs.check-version.outputs.new_version, '-') }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.storybook/main.ts b/.storybook/main.ts index eaf298a..2f0d86b 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -2,12 +2,7 @@ import type { StorybookConfig } from '@storybook/react-vite'; const config: StorybookConfig = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], - addons: [ - '@storybook/addon-docs', - '@storybook/addon-a11y', - '@storybook/addon-vitest', - '@chromatic-com/storybook', - ], + addons: ['@storybook/addon-docs'], framework: '@storybook/react-vite', docs: {}, typescript: { diff --git a/.storybook/preview.ts b/.storybook/preview.ts index ec83344..596ed98 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -18,9 +18,6 @@ const preview: Preview = { ], }, layout: 'centered', - a11y: { - test: 'todo', - }, options: { // Sort stories with Welcome first storySort: { @@ -35,10 +32,6 @@ const preview: Preview = { ], }, }, - // Disable version update notifications - chromatic: { - disableSnapshot: false, - }, }, tags: ['autodocs'], }; diff --git a/.storybook/vitest.setup.ts b/.storybook/vitest.setup.ts deleted file mode 100644 index ea170b0..0000000 --- a/.storybook/vitest.setup.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as a11yAddonAnnotations from '@storybook/addon-a11y/preview'; -import { setProjectAnnotations } from '@storybook/react-vite'; -import * as projectAnnotations from './preview'; - -// This is an important step to apply the right configuration when testing your stories. -// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations -setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]); diff --git a/README.md b/README.md index 90d6780..a44d55c 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ A sophisticated, elegant, and performant tooltip library for React with an intelligent floating helper system. -![npm version](https://img.shields.io/npm/v/react-tip-magic) -![bundle size](https://img.shields.io/bundlephobia/minzip/react-tip-magic) -![license](https://img.shields.io/npm/l/react-tip-magic) +![npm version](https://img.shields.io/npm/v/@galangel/react-tip-magic) +![bundle size](https://img.shields.io/bundlephobia/minzip/@galangel/react-tip-magic) +![license](https://img.shields.io/npm/l/@galangel/react-tip-magic) ## Features @@ -21,14 +21,14 @@ A sophisticated, elegant, and performant tooltip library for React with an intel ### Installation ```bash -npm install react-tip-magic +npm install @galangel/react-tip-magic ``` ### Basic Setup ```tsx -import { TipMagicProvider } from 'react-tip-magic'; -import 'react-tip-magic/styles.css'; +import { TipMagicProvider } from '@galangel/react-tip-magic'; +import '@galangel/react-tip-magic/styles.css'; function App() { return ( @@ -106,7 +106,7 @@ The Helper is an optional floating element that provides contextual information ### Onboarding Flow Example ```tsx -import { useTipMagic } from 'react-tip-magic'; +import { useTipMagic } from '@galangel/react-tip-magic'; function OnboardingFlow() { const { helper } = useTipMagic(); @@ -163,7 +163,7 @@ helper.show({ Use the `useTipMagic` hook for full programmatic control: ```tsx -import { useTipMagic } from 'react-tip-magic'; +import { useTipMagic } from '@galangel/react-tip-magic'; function MyComponent() { const { tooltip, helper, config } = useTipMagic(); diff --git a/package-lock.json b/package-lock.json index c8c145d..419c849 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,30 +1,25 @@ { - "name": "react-tip-magic", - "version": "1.0.0", + "name": "@galangel/react-tip-magic", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "react-tip-magic", - "version": "1.0.0", + "name": "@galangel/react-tip-magic", + "version": "1.0.2", "license": "Apache-2.0", "dependencies": { - "@floating-ui/react": "^0.27.16", - "react": ">=18.0.0" + "@floating-ui/react": "^0.27.16" }, "devDependencies": { - "@chromatic-com/storybook": "^4.1.3", "@eslint/js": "^9.28.0", - "@storybook/addon-a11y": "^10.1.11", "@storybook/addon-docs": "^10.1.11", - "@storybook/addon-vitest": "^10.1.11", "@storybook/react-vite": "^10.1.11", "@testing-library/dom": "^10.4.1", "@testing-library/react": "^16.3.1", "@types/node": "^25.0.6", "@types/react": "^19.1.8", "@types/react-dom": "^19.1.6", - "@vitest/browser-playwright": "^4.0.16", "@vitest/coverage-v8": "^4.0.16", "eslint": "^9.39.2", "eslint-config-prettier": "^10.1.5", @@ -36,7 +31,6 @@ "husky": "^9.1.7", "jsdom": "^27.4.0", "lint-staged": "^16.1.0", - "playwright": "^1.57.0", "prettier": "^3.5.3", "storybook": "^10.1.11", "typescript": "^5.9.3", @@ -388,27 +382,6 @@ "node": ">=18" } }, - "node_modules/@chromatic-com/storybook": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@chromatic-com/storybook/-/storybook-4.1.3.tgz", - "integrity": "sha512-hc0HO9GAV9pxqDE6fTVOV5KeLpTiCfV8Jrpk5ogKLiIgeq2C+NPjpt74YnrZTjiK8E19fYcMP+2WY9ZtX7zHmw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@neoconfetti/react": "^1.0.0", - "chromatic": "^13.3.3", - "filesize": "^10.0.12", - "jsonfile": "^6.1.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=20.0.0", - "yarn": ">=1.22.18" - }, - "peerDependencies": { - "storybook": "^0.0.0-0 || ^9.0.0 || ^9.1.0-0 || ^9.2.0-0 || ^10.0.0-0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0" - } - }, "node_modules/@csstools/color-helpers": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", @@ -1451,13 +1424,6 @@ "react": ">=16" } }, - "node_modules/@neoconfetti/react": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@neoconfetti/react/-/react-1.0.0.tgz", - "integrity": "sha512-klcSooChXXOzIm+SE5IISIAn3bYzYfPjbX7D7HoqZL84oAfgREeSg5vSIaSFH+DaGzzvImTyWe1OyrJ67vik4A==", - "dev": true, - "license": "MIT" - }, "node_modules/@pkgr/core": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", @@ -1476,7 +1442,9 @@ "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/@rollup/pluginutils": { "version": "5.3.0", @@ -1865,24 +1833,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@storybook/addon-a11y": { - "version": "10.1.11", - "resolved": "https://registry.npmjs.org/@storybook/addon-a11y/-/addon-a11y-10.1.11.tgz", - "integrity": "sha512-3sr6HmcDgW1+TQAV9QtWBE3HlGyfFXVZY3RECTNLNH6fRC+rYQCItisvQIVxQpyftLSQ8EAMN9JQzs495MjWNg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@storybook/global": "^5.0.0", - "axe-core": "^4.2.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/storybook" - }, - "peerDependencies": { - "storybook": "^10.1.11" - } - }, "node_modules/@storybook/addon-docs": { "version": "10.1.11", "resolved": "https://registry.npmjs.org/@storybook/addon-docs/-/addon-docs-10.1.11.tgz", @@ -1906,42 +1856,6 @@ "storybook": "^10.1.11" } }, - "node_modules/@storybook/addon-vitest": { - "version": "10.1.11", - "resolved": "https://registry.npmjs.org/@storybook/addon-vitest/-/addon-vitest-10.1.11.tgz", - "integrity": "sha512-YbZzeKO3v+Xr97/malT4DZIATkVZT5EHNYx3xzEfPVuk19dDETAVYXO+tzcqCQHsgdKQHkmd56vv8nN3J3/kvw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@storybook/global": "^5.0.0", - "@storybook/icons": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/storybook" - }, - "peerDependencies": { - "@vitest/browser": "^3.0.0 || ^4.0.0", - "@vitest/browser-playwright": "^4.0.0", - "@vitest/runner": "^3.0.0 || ^4.0.0", - "storybook": "^10.1.11", - "vitest": "^3.0.0 || ^4.0.0" - }, - "peerDependenciesMeta": { - "@vitest/browser": { - "optional": true - }, - "@vitest/browser-playwright": { - "optional": true - }, - "@vitest/runner": { - "optional": true - }, - "vitest": { - "optional": true - } - } - }, "node_modules/@storybook/builder-vite": { "version": "10.1.11", "resolved": "https://registry.npmjs.org/@storybook/builder-vite/-/builder-vite-10.1.11.tgz", @@ -2633,6 +2547,8 @@ "integrity": "sha512-t4toy8X/YTnjYEPoY0pbDBg3EvDPg1elCDrfc+VupPHwoN/5/FNQ8Z+xBYIaEnOE2vVEyKwqYBzZ9h9rJtZVcg==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@vitest/mocker": "4.0.16", "@vitest/utils": "4.0.16", @@ -2656,6 +2572,8 @@ "integrity": "sha512-I2Fy/ANdphi1yI46d15o0M1M4M0UJrUiVKkH5oKeRZZCdPg0fw/cfTKZzv9Ge9eobtJYp4BGblMzXdXH0vcl5g==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@vitest/browser": "4.0.16", "@vitest/mocker": "4.0.16", @@ -3129,16 +3047,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/axe-core": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.11.1.tgz", - "integrity": "sha512-BASOg+YwO2C+346x3LZOeoovTIoTrRqEsqMa6fmfAV0P+U9mFr9NsyOEpiYvFjbc64NMrSswhV50WdXzdb/Z5A==", - "dev": true, - "license": "MPL-2.0", - "engines": { - "node": ">=4" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -3374,30 +3282,6 @@ "node": ">= 16" } }, - "node_modules/chromatic": { - "version": "13.3.5", - "resolved": "https://registry.npmjs.org/chromatic/-/chromatic-13.3.5.tgz", - "integrity": "sha512-MzPhxpl838qJUo0A55osCF2ifwPbjcIPeElr1d4SHcjnHoIcg7l1syJDrAYK/a+PcCBrOGi06jPNpQAln5hWgw==", - "dev": true, - "license": "MIT", - "bin": { - "chroma": "dist/bin.js", - "chromatic": "dist/bin.js", - "chromatic-cli": "dist/bin.js" - }, - "peerDependencies": { - "@chromatic-com/cypress": "^0.*.* || ^1.0.0", - "@chromatic-com/playwright": "^0.*.* || ^1.0.0" - }, - "peerDependenciesMeta": { - "@chromatic-com/cypress": { - "optional": true - }, - "@chromatic-com/playwright": { - "optional": true - } - } - }, "node_modules/cli-cursor": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", @@ -4452,16 +4336,6 @@ "node": ">=16.0.0" } }, - "node_modules/filesize": { - "version": "10.1.6", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-10.1.6.tgz", - "integrity": "sha512-sJslQKU2uM33qH5nqewAwVB2QgR6w1aMNsYUp3aN5rMRyXEwJGmZvaWzeJFNTOXWlHQyBFCWrdj3fV/fsTOX8w==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">= 10.4.0" - } - }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -4788,14 +4662,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC", - "optional": true - }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -5691,19 +5557,6 @@ "node": ">=6" } }, - "node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -6014,6 +5867,8 @@ "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=10" } @@ -6426,6 +6281,8 @@ "integrity": "sha512-1wrVzJ2STrpmONHKBy228LM1b84msXDUoAzVEl0R8Mz4Ce6EPr+IVtxm8+yvrqLYMHswREkjYFaMxnyGnaY3Ng==", "dev": true, "license": "ISC", + "optional": true, + "peer": true, "dependencies": { "pngjs": "^7.0.0" }, @@ -6439,6 +6296,8 @@ "integrity": "sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==", "dev": true, "license": "Apache-2.0", + "optional": true, + "peer": true, "dependencies": { "playwright-core": "1.57.0" }, @@ -6458,6 +6317,8 @@ "integrity": "sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==", "dev": true, "license": "Apache-2.0", + "optional": true, + "peer": true, "bin": { "playwright-core": "cli.js" }, @@ -6476,6 +6337,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -6486,6 +6348,8 @@ "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=14.19.0" } @@ -7175,6 +7039,8 @@ "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "@polka/url": "^1.0.0-next.24", "mrmime": "^2.0.0", @@ -7788,6 +7654,8 @@ "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=6" } @@ -8018,16 +7886,6 @@ "dev": true, "license": "MIT" }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/unplugin": { "version": "2.3.11", "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-2.3.11.tgz", diff --git a/package.json b/package.json index 8937a7c..d56567a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@galangel/react-tip-magic", - "version": "1.0.2", + "version": "1.0.3", "description": "A sophisticated, elegant, and performant tooltip library for React with an intelligent floating helper system.", "type": "module", "main": "./dist/index.cjs", @@ -30,8 +30,6 @@ "build": "vite build && tsc -p tsconfig.build.json", "build:storybook": "storybook build", "test": "vitest run", - "test:unit": "vitest run --project unit", - "test:storybook": "vitest run --project storybook", "test:watch": "vitest", "test:ui": "vitest --ui", "test:coverage": "vitest run --coverage", @@ -65,18 +63,14 @@ "@floating-ui/react": "^0.27.16" }, "devDependencies": { - "@chromatic-com/storybook": "^4.1.3", "@eslint/js": "^9.28.0", - "@storybook/addon-a11y": "^10.1.11", "@storybook/addon-docs": "^10.1.11", - "@storybook/addon-vitest": "^10.1.11", "@storybook/react-vite": "^10.1.11", "@testing-library/dom": "^10.4.1", "@testing-library/react": "^16.3.1", "@types/node": "^25.0.6", "@types/react": "^19.1.8", "@types/react-dom": "^19.1.6", - "@vitest/browser-playwright": "^4.0.16", "@vitest/coverage-v8": "^4.0.16", "eslint": "^9.39.2", "eslint-config-prettier": "^10.1.5", @@ -88,7 +82,6 @@ "husky": "^9.1.7", "jsdom": "^27.4.0", "lint-staged": "^16.1.0", - "playwright": "^1.57.0", "prettier": "^3.5.3", "storybook": "^10.1.11", "typescript": "^5.9.3", diff --git a/src/index.ts b/src/index.ts index 6016af6..b4d304a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,8 +21,8 @@ export type { CurrentTourStep, FlowState, FlowStep, - HelperAPI, HelperAction, + HelperAPI, HelperInternalState, HelperPosition, HelperShowOptions, @@ -53,6 +53,3 @@ export { getTipProps } from './utils/getTipProps'; export type { TipPropsOptions, TipPropsResult } from './utils/getTipProps'; export { generateTooltipId, parseContent, parseDataAttributes } from './utils/parseDataAttributes'; export type { ParsedContent } from './utils/parseDataAttributes'; - -// Version -export const VERSION = '1.0.2'; diff --git a/vitest.config.ts b/vitest.config.ts index 865efd7..fa28c74 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,48 +1,9 @@ -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; - import { defineConfig } from 'vitest/config'; -import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'; - -import { playwright } from '@vitest/browser-playwright'; - -const dirname = - typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); - -// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon export default defineConfig({ test: { - projects: [ - // Unit tests for utility functions and components - { - extends: true, - test: { - name: 'unit', - include: ['src/**/*.test.ts', 'src/**/*.test.tsx'], - exclude: ['src/**/*.stories.tsx'], - environment: 'jsdom', - }, - }, - // Storybook integration tests - { - extends: true, - plugins: [ - // The plugin will run tests for the stories defined in your Storybook config - // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest - storybookTest({ configDir: path.join(dirname, '.storybook') }), - ], - test: { - name: 'storybook', - browser: { - enabled: true, - headless: true, - provider: playwright({}), - instances: [{ browser: 'chromium' }], - }, - setupFiles: ['.storybook/vitest.setup.ts'], - }, - }, - ], + include: ['src/**/*.test.ts', 'src/**/*.test.tsx'], + exclude: ['src/**/*.stories.tsx'], + environment: 'jsdom', }, }); diff --git a/vitest.shims.d.ts b/vitest.shims.d.ts deleted file mode 100644 index 7782f28..0000000 --- a/vitest.shims.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// \ No newline at end of file