Skip to content

Commit 77e5cdc

Browse files
v1.4.0-alpha.1
1 parent 8252a1f commit 77e5cdc

File tree

4 files changed

+47
-32
lines changed

4 files changed

+47
-32
lines changed

package-lock.json

Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"name": "shadcn-theme-editor",
3-
"version": "1.3.3",
3+
"version": "1.4.0-alpha.1",
44
"description": "Shadcn Theme Editor",
5-
"main": "dist/index.js",
65
"module": "dist/index.mjs",
76
"types": "dist/index.d.ts",
87
"repository": {
@@ -37,8 +36,11 @@
3736
"author": "immi",
3837
"license": "MIT",
3938
"peerDependencies": {
40-
"next-themes": "^0.3.0",
41-
"react": "^18.3.1"
39+
"class-variance-authority": "*",
40+
"clsx": "*",
41+
"next-themes": "*",
42+
"react": "*",
43+
"react-dom": "*"
4244
},
4345
"devDependencies": {
4446
"@rollup/plugin-commonjs": "^26.0.1",
@@ -60,8 +62,6 @@
6062
},
6163
"dependencies": {
6264
"@radix-ui/react-slot": "^1.1.0",
63-
"class-variance-authority": "^0.7.0",
64-
"clsx": "^2.1.1",
6565
"colord": "^2.9.3",
6666
"emittor": "^0.1.0",
6767
"lodash.debounce": "^4.0.8",

rollup.config.js

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,34 @@ import typescript from "@rollup/plugin-typescript";
44
import dts from "rollup-plugin-dts";
55
import terser from "@rollup/plugin-terser";
66
import peerDepsExternal from "rollup-plugin-peer-deps-external";
7-
import banner2 from 'rollup-plugin-banner2'
7+
import banner2 from "rollup-plugin-banner2";
88
// import {} from "rollup";
99
// import { preserveDirectives } from "rollup-plugin-preserve-directives"
1010

11-
import tailwindcss from 'tailwindcss';
11+
import tailwindcss from "tailwindcss";
1212

1313
import postcss from "rollup-plugin-postcss";
14-
// document.createElement('style');
1514
const packageJson = require("./package.json");
1615
const tailwindConfig = require('./tailwind.config.js');
1716

17+
// document.createElement('style');
18+
// import packageJson from './package.json' assert { type: 'json' };
19+
// const tailwindConfig = (await import('./tailwind.config.js')).default;
20+
1821
export default [
1922
{
2023
input: "src/index.ts",
2124
output: [
22-
{
23-
file: packageJson.main,
24-
format: "cjs",
25-
sourcemap: true,
26-
},
25+
// {
26+
// file: packageJson.main,
27+
// format: "cjs",
28+
// sourcemap: true,
29+
// },
2730
{
2831
file: packageJson.module,
2932
format: "esm",
30-
sourcemap: true,
33+
// sourcemap: true,
3134
},
32-
3335
],
3436
plugins: [
3537
peerDepsExternal(),
@@ -39,16 +41,22 @@ export default [
3941
terser(),
4042
postcss({
4143
plugins: [tailwindcss(tailwindConfig)],
42-
extract: true
44+
extract: true,
4345
}),
44-
banner2(()=>`"use client";\nimport "./index.css";\n`), // or use: https://github.com/Ephem/rollup-plugin-preserve-directives
46+
banner2(() => `"use client";\nimport "./index.css";\n`), // or use: https://github.com/Ephem/rollup-plugin-preserve-directives
4547
// preserveDirectives(),
4648
],
47-
external: ["react", "react-dom", 'next-themes'],
49+
external: [
50+
"react",
51+
"react-dom",
52+
"next-themes",
53+
"clsx",
54+
"class-variance-authority",
55+
],
4856
},
4957
{
5058
input: "src/index.ts",
51-
output: [{ file: packageJson.types }],
59+
output: [{ file: "dist/index.d.ts" }],
5260
plugins: [dts.default()],
5361
external: [/\.css$/],
5462
},

update-css-file.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
file_path = "dist/index.css"
44
selector = "#shadcn-theme-editor"
55

6+
67
def leading_spaces(s):
7-
# Strip leading spaces and compare length with original length
8-
return len(s) - len(s.lstrip(' '))
8+
return len(s) - len(s.lstrip(" "))
99

1010
try:
1111
with open(file_path) as file:
@@ -16,12 +16,11 @@ def leading_spaces(s):
1616
if line.strip().startswith("."):
1717
line = f"{' '*leading_spaces(line)}{selector} {line.lstrip()}"
1818
new_lines.append(line)
19-
# print(new_lines)
20-
# exit()
2119

22-
with open(file_path, 'w') as file:
20+
with open(file_path, "w") as file:
2321
file.writelines(new_lines)
2422

2523
print("css file updated")
24+
2625
except Exception as e:
27-
print("!error: ", e)
26+
print("!error: ", e)

0 commit comments

Comments
 (0)