diff --git a/.storybook/main.ts b/.storybook/main.ts index 526f5d4..b5599f5 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,3 +1,4 @@ +/* eslint-disable n/no-unpublished-import */ import type { StorybookConfig } from '@storybook/react-vite'; const config: StorybookConfig = { diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 7e98b0f..3b91b69 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -1,3 +1,4 @@ +/* eslint-disable n/no-unpublished-import */ import type { Preview } from '@storybook/react'; import './tailwind.css'; diff --git a/anotherUiTwPlugin.ts b/anotherUiTwPlugin.ts deleted file mode 100644 index e69de29..0000000 diff --git a/package.json b/package.json index fbac7d2..ca2ae13 100644 --- a/package.json +++ b/package.json @@ -46,11 +46,13 @@ "rollup": "4.25.0", "tailwind-merge": "^2.5.4" }, - "perDependencies": { + "peerDependencies": { + "@types/react": "^18", + "@types/react-dom": "^18", "react": "^18", "react-dom": "^18", - "@types/react": "^18", - "@types/react-dom": "^18" + "tailwindcss": "3.4.14", + "tailwindcss-animate": "^1.0.7" }, "devDependencies": { "@chromatic-com/storybook": "3.2.2", @@ -91,6 +93,7 @@ "storybook": "8.4.2", "tailwindcss": "3.4.14", "tailwindcss-animate": "^1.0.7", + "tslib": "^2.8.1", "typescript": "5.6.2", "typescript-eslint": "8.11.0", "vite": "5.4.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b56c38..6b7b223 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -156,6 +156,9 @@ importers: tailwindcss-animate: specifier: ^1.0.7 version: 1.0.7(tailwindcss@3.4.14) + tslib: + specifier: ^2.8.1 + version: 2.8.1 typescript: specifier: 5.6.2 version: 5.6.2 diff --git a/rollup.config.mjs b/rollup.config.mjs index 823fdd4..f037007 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -10,19 +10,19 @@ import postcss from 'rollup-plugin-postcss'; */ export default { - input: ['./src/index.ts'], - external: ['react', 'react-dom'], + external: ['react', 'react-dom', 'react/jsx-runtime'], + input: ['./src/index.ts', './twPlugin/auTwPlugin.ts'], output: [{ dir: './dist/', format: 'esm', sourcemap: true }], plugins: [ del({ targets: 'dist/*' }), resolve(), commonjs(), + typescript({ tsconfig: './tsconfig.json' }), postcss({ minimize: true, extract: true, sourceMap: true, }), - typescript(), copy({ targets: [{ src: './package.json', dest: 'dist/' }], }), diff --git a/tailwind.config.js b/tailwind.config.js index 872daa6..8b4fb8b 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,13 +1,10 @@ +/* eslint-disable n/no-unpublished-import */ import twAnimate from 'tailwindcss-animate'; import { auTwPlugin } from './twPlugin'; /** @type {import('tailwindcss').Config} */ export default { - content: [ - './src/**/*.{html,js,ts,tsx,jsx}', - '.storybook/*.ts', - '.storybook/*.tsx', - ], + content: ['./src/**/*.{html,js,ts,tsx,jsx}', './.storybook/**/*.{js,ts,tsx}'], plugins: [auTwPlugin, twAnimate], }; diff --git a/tsconfig.json b/tsconfig.json index 72881ca..6884b25 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "./src/**/*.ts", "./src/**/*.tsx", ".src/*.jsx", - "./twPlugin.ts", + "./twPlugin/**/*.ts", "./tailwind.config.ts" ], "exclude": ["node_modules"], @@ -22,7 +22,6 @@ "useDefineForClassFields": true, "skipLibCheck": true, "moduleResolution": "Bundler", - "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", "noEmit": true,