From ef25398f11217fede6a3302ea4928c6f5cfd4d0c Mon Sep 17 00:00:00 2001 From: JunichiSugiura Date: Wed, 7 Aug 2024 13:33:46 +0200 Subject: [PATCH] Expose tailwind preset as separated submodule for node --- examples/starknet-react-next/tailwind.config.js | 10 ---------- examples/starknet-react-next/tailwind.config.ts | 12 ++++++++++++ packages/ui-next/package.json | 4 ++++ packages/ui-next/src/index.ts | 1 - packages/ui-next/tailwind.config.ts | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) delete mode 100644 examples/starknet-react-next/tailwind.config.js create mode 100644 examples/starknet-react-next/tailwind.config.ts diff --git a/examples/starknet-react-next/tailwind.config.js b/examples/starknet-react-next/tailwind.config.js deleted file mode 100644 index 90d1e83fb..000000000 --- a/examples/starknet-react-next/tailwind.config.js +++ /dev/null @@ -1,10 +0,0 @@ -const { cartridgeTWPreset } = require("../../packages/ui-next/src/preset"); - -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: [ - "./src/**/*.{ts,tsx}", - "./node_modules/@cartridge/ui-next/**/*.{js,jsx}", - ], - presets: [cartridgeTWPreset], -}; diff --git a/examples/starknet-react-next/tailwind.config.ts b/examples/starknet-react-next/tailwind.config.ts new file mode 100644 index 000000000..ea7ab9cc6 --- /dev/null +++ b/examples/starknet-react-next/tailwind.config.ts @@ -0,0 +1,12 @@ +import { cartridgeTWPreset } from "@cartridge/ui-next/preset"; +import { Config } from "tailwindcss"; + +const config = { + content: [ + "./src/**/*.{ts,tsx}", + "./node_modules/@cartridge/ui-next/**/*.{js,jsx}", + ], + presets: [cartridgeTWPreset], +} satisfies Config; + +export default config; diff --git a/packages/ui-next/package.json b/packages/ui-next/package.json index 56567f58e..a0868118c 100644 --- a/packages/ui-next/package.json +++ b/packages/ui-next/package.json @@ -13,6 +13,10 @@ "import": "./dist/index.js", "types": "./dist/index.d.js" }, + "./preset": { + "require": "./dist/preset.js", + "types": "./dist/preset.d.js" + }, "./themes/default.css": "./dist/themes/default.css", "./themes/dark.css": "./dist/themes/dark.css", "./themes/fonts.css": "./dist/themes/fonts.css" diff --git a/packages/ui-next/src/index.ts b/packages/ui-next/src/index.ts index ab6fe6bcc..89e38c8b6 100644 --- a/packages/ui-next/src/index.ts +++ b/packages/ui-next/src/index.ts @@ -1,3 +1,2 @@ export * from "./components"; -export * from "./preset"; export * from "./utils"; diff --git a/packages/ui-next/tailwind.config.ts b/packages/ui-next/tailwind.config.ts index b7e3b8bc7..5f75eee73 100644 --- a/packages/ui-next/tailwind.config.ts +++ b/packages/ui-next/tailwind.config.ts @@ -1,5 +1,5 @@ import type { Config } from "tailwindcss"; -import { cartridgeTWPreset } from "./src"; +import { cartridgeTWPreset } from "./src/preset"; const config = { darkMode: "class",