diff --git a/package-lock.json b/package-lock.json index 18d439f..8b301c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,15 @@ { "name": "shadcn-theme-editor", - "version": "1.3.0-alpha.4", + "version": "1.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shadcn-theme-editor", - "version": "1.3.0-alpha.4", + "version": "1.3.3", "license": "MIT", "dependencies": { "@radix-ui/react-slot": "^1.1.0", - "class-variance-authority": "^0.7.0", - "clsx": "^2.1.1", "colord": "^2.9.3", "emittor": "^0.1.0", "lodash.debounce": "^4.0.8", @@ -36,8 +34,11 @@ "typescript": "^5.5.3" }, "peerDependencies": { - "next-themes": "^0.3.0", - "react": "^18.3.1" + "class-variance-authority": "*", + "clsx": "*", + "next-themes": "*", + "react": "*", + "react-dom": "*" } }, "node_modules/@alloc/quick-lru": { @@ -1507,6 +1508,8 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.0.tgz", "integrity": "sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==", + "license": "Apache-2.0", + "peer": true, "dependencies": { "clsx": "2.0.0" }, @@ -1518,6 +1521,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", + "peer": true, "engines": { "node": ">=6" } @@ -1583,6 +1587,8 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -3999,6 +4005,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.3.0.tgz", "integrity": "sha512-/QHIrsYpd6Kfk7xakK4svpDI5mmXP0gfvCoJdGpZQ2TOrQZmsW0QxjaiLn8wbIKjtm4BTSqLoix4lxYYOnLJ/w==", + "license": "MIT", "peer": true, "peerDependencies": { "react": "^16.8 || ^17 || ^18", @@ -5311,6 +5318,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", "peer": true, "dependencies": { "loose-envify": "^1.1.0", diff --git a/package.json b/package.json index 8f51910..b5a0968 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { "name": "shadcn-theme-editor", - "version": "1.3.3", + "version": "1.4.0-alpha.1", "description": "Shadcn Theme Editor", - "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", "repository": { @@ -37,8 +36,11 @@ "author": "immi", "license": "MIT", "peerDependencies": { - "next-themes": "^0.3.0", - "react": "^18.3.1" + "class-variance-authority": "*", + "clsx": "*", + "next-themes": "*", + "react": "*", + "react-dom": "*" }, "devDependencies": { "@rollup/plugin-commonjs": "^26.0.1", @@ -60,8 +62,6 @@ }, "dependencies": { "@radix-ui/react-slot": "^1.1.0", - "class-variance-authority": "^0.7.0", - "clsx": "^2.1.1", "colord": "^2.9.3", "emittor": "^0.1.0", "lodash.debounce": "^4.0.8", diff --git a/rollup.config.js b/rollup.config.js index bb28ada..07723fe 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,32 +4,34 @@ import typescript from "@rollup/plugin-typescript"; import dts from "rollup-plugin-dts"; import terser from "@rollup/plugin-terser"; import peerDepsExternal from "rollup-plugin-peer-deps-external"; -import banner2 from 'rollup-plugin-banner2' +import banner2 from "rollup-plugin-banner2"; // import {} from "rollup"; // import { preserveDirectives } from "rollup-plugin-preserve-directives" -import tailwindcss from 'tailwindcss'; +import tailwindcss from "tailwindcss"; import postcss from "rollup-plugin-postcss"; -// document.createElement('style'); const packageJson = require("./package.json"); const tailwindConfig = require('./tailwind.config.js'); +// document.createElement('style'); +// import packageJson from './package.json' assert { type: 'json' }; +// const tailwindConfig = (await import('./tailwind.config.js')).default; + export default [ { input: "src/index.ts", output: [ - { - file: packageJson.main, - format: "cjs", - sourcemap: true, - }, + // { + // file: packageJson.main, + // format: "cjs", + // sourcemap: true, + // }, { file: packageJson.module, format: "esm", - sourcemap: true, + // sourcemap: true, }, - ], plugins: [ peerDepsExternal(), @@ -39,16 +41,22 @@ export default [ terser(), postcss({ plugins: [tailwindcss(tailwindConfig)], - extract: true + extract: true, }), - banner2(()=>`"use client";\nimport "./index.css";\n`), // or use: https://github.com/Ephem/rollup-plugin-preserve-directives + banner2(() => `"use client";\nimport "./index.css";\n`), // or use: https://github.com/Ephem/rollup-plugin-preserve-directives // preserveDirectives(), ], - external: ["react", "react-dom", 'next-themes'], + external: [ + "react", + "react-dom", + "next-themes", + "clsx", + "class-variance-authority", + ], }, { input: "src/index.ts", - output: [{ file: packageJson.types }], + output: [{ file: "dist/index.d.ts" }], plugins: [dts.default()], external: [/\.css$/], }, diff --git a/update-css-file.py b/update-css-file.py index 5136416..4761c8a 100644 --- a/update-css-file.py +++ b/update-css-file.py @@ -3,9 +3,9 @@ file_path = "dist/index.css" selector = "#shadcn-theme-editor" + def leading_spaces(s): - # Strip leading spaces and compare length with original length - return len(s) - len(s.lstrip(' ')) + return len(s) - len(s.lstrip(" ")) try: with open(file_path) as file: @@ -16,12 +16,11 @@ def leading_spaces(s): if line.strip().startswith("."): line = f"{' '*leading_spaces(line)}{selector} {line.lstrip()}" new_lines.append(line) - # print(new_lines) - # exit() - with open(file_path, 'w') as file: + with open(file_path, "w") as file: file.writelines(new_lines) print("css file updated") + except Exception as e: - print("!error: ", e) \ No newline at end of file + print("!error: ", e)