This commit is contained in:
Alex 2024-07-27 02:55:54 -04:00
parent 53ac883c18
commit 2c51fceac3
4 changed files with 1032 additions and 639 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@aet/tailwind", "name": "@aet/tailwind",
"version": "0.0.1-beta.36", "version": "1.0.0",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "./scripts/index.ts", "build": "./scripts/index.ts",
@ -19,12 +19,12 @@
} }
}, },
"devDependencies": { "devDependencies": {
"@aet/eslint-rules": "^0.0.36", "@aet/eslint-rules": "^1.0.1-beta.6",
"@types/babel__core": "^7.20.5", "@types/babel__core": "^7.20.5",
"@types/bun": "^1.1.6", "@types/bun": "^1.1.6",
"@types/dedent": "^0.7.2", "@types/dedent": "^0.7.2",
"@types/lodash": "^4.17.6", "@types/lodash": "^4.17.7",
"@types/node": "^20.14.10", "@types/node": "^20.14.12",
"@types/postcss-safe-parser": "^5.0.4", "@types/postcss-safe-parser": "^5.0.4",
"@types/react": "^18.3.3", "@types/react": "^18.3.3",
"@types/stylis": "^4.2.6", "@types/stylis": "^4.2.6",
@ -33,31 +33,31 @@
"colord": "^2.9.3", "colord": "^2.9.3",
"css-what": "^6.1.0", "css-what": "^6.1.0",
"dedent": "^1.5.3", "dedent": "^1.5.3",
"esbuild-register": "^3.5.0", "esbuild-register": "^3.6.0",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"postcss-nested": "^6.0.1", "postcss-nested": "^6.2.0",
"prettier": "^3.3.2", "prettier": "^3.3.3",
"tailwindcss": "^3.4.4", "tailwindcss": "^3.4.7",
"tslib": "^2.6.3", "tslib": "^2.6.3",
"tsup": "^8.1.0", "tsup": "^8.2.3",
"typescript": "^5.5.3", "typescript": "^5.5.4",
"vite": "^5.3.3", "vite": "^5.3.5",
"vitest": "^1.6.0" "vitest": "^2.0.4"
}, },
"peerDependencies": { "peerDependencies": {
"tailwindcss": "^3.4.3" "tailwindcss": "^3.4.3"
}, },
"dependencies": { "dependencies": {
"@babel/core": "^7.24.7", "@babel/core": "^7.24.9",
"@emotion/hash": "^0.9.1", "@emotion/hash": "^0.9.2",
"esbuild": "^0.23.0", "esbuild": "^0.23.0",
"json5": "^2.2.3", "json5": "^2.2.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"postcss": "^8.4.39", "postcss": "^8.4.40",
"postcss-selector-parser": "^6.1.0", "postcss-selector-parser": "^6.1.1",
"stylis": "^4.3.2", "stylis": "^4.3.2",
"tiny-invariant": "^1.3.3", "tiny-invariant": "^1.3.3",
"type-fest": "^4.21.0" "type-fest": "^4.23.0"
}, },
"prettier": { "prettier": {
"arrowParens": "avoid", "arrowParens": "avoid",

1627
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
import { type FunctionComponent, forwardRef } from "react"; import { type FunctionComponent, forwardRef } from "react";
import cx from "clsx"; import cx from "clsx";
interface WithClassName<Props = object> extends FunctionComponent<Props> { export interface WithClassName<Props = object> extends FunctionComponent<Props> {
className: string; className: string;
} }

View File

@ -131,10 +131,10 @@ export function getTailwindPlugins(options: TailwindPluginOptions) {
const styles = styleMap.get(path)!; const styles = styleMap.get(path)!;
const compiled = await compile( const compiled = await compile(
styles styles
.map( .map(({ classNames, key }) => {
({ classNames, key }) => const tw = without(classNames, "group").join(" ");
`.${key} {\n @apply ${without(classNames, "group").join(" ")}\n}` return `.${key} {\n /* @apply ${tw} */\n @apply ${tw}\n}`;
) })
.join("\n") .join("\n")
); );
if (path.endsWith(".css")) { if (path.endsWith(".css")) {