create-z3 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1974,13 +1974,28 @@ async function fetchOrReadCSS(source) {
1974
1974
  }
1975
1975
  function parseColorsFromCSS(css) {
1976
1976
  const colors = [];
1977
- const cssVarRegex = /--([\w-]+)\s*:\s*([^;]+);/g;
1978
- let match;
1979
- while ((match = cssVarRegex.exec(css)) !== null) {
1980
- const name = `--${match[1]}`;
1981
- const value = match[2].trim();
1982
- if (isColorValue(value)) {
1983
- colors.push({ name, value });
1977
+ const rootBlockRegex = /:root\s*\{([^}]+)\}/gs;
1978
+ const rootMatch = rootBlockRegex.exec(css);
1979
+ if (rootMatch) {
1980
+ const rootContent = rootMatch[1];
1981
+ const cssVarRegex = /--([\w-]+)\s*:\s*([^;]+);/g;
1982
+ let match;
1983
+ while ((match = cssVarRegex.exec(rootContent)) !== null) {
1984
+ const name = `--${match[1]}`;
1985
+ const value = match[2].trim();
1986
+ colors.push({ name, value, theme: "root" });
1987
+ }
1988
+ }
1989
+ const darkBlockRegex = /\.dark\s*\{([^}]+)\}/gs;
1990
+ const darkMatch = darkBlockRegex.exec(css);
1991
+ if (darkMatch) {
1992
+ const darkContent = darkMatch[1];
1993
+ const cssVarRegex = /--([\w-]+)\s*:\s*([^;]+);/g;
1994
+ let match;
1995
+ while ((match = cssVarRegex.exec(darkContent)) !== null) {
1996
+ const name = `--${match[1]}`;
1997
+ const value = match[2].trim();
1998
+ colors.push({ name, value, theme: "dark" });
1984
1999
  }
1985
2000
  }
1986
2001
  return colors;
@@ -2051,11 +2066,29 @@ function generateCSSOutput(colors, format) {
2051
2066
  if (colors.length === 0) {
2052
2067
  return "";
2053
2068
  }
2054
- const declarations = colors.map((color) => {
2055
- const value = format === "oklch" && color.oklch ? color.oklch : color.value;
2056
- return `${color.name}: ${value};`;
2057
- }).join("\n");
2058
- return declarations;
2069
+ const rootColors = colors.filter((c) => c.theme === "root");
2070
+ const darkColors = colors.filter((c) => c.theme === "dark");
2071
+ let output = "";
2072
+ if (rootColors.length > 0) {
2073
+ const rootDeclarations = rootColors.map((color) => {
2074
+ const value = format === "oklch" && color.oklch && isColorValue(color.value) ? color.oklch : color.value;
2075
+ return ` ${color.name}: ${value};`;
2076
+ }).join("\n");
2077
+ output += `:root {
2078
+ ${rootDeclarations}
2079
+ }`;
2080
+ }
2081
+ if (darkColors.length > 0) {
2082
+ if (output) output += "\n\n";
2083
+ const darkDeclarations = darkColors.map((color) => {
2084
+ const value = format === "oklch" && color.oklch && isColorValue(color.value) ? color.oklch : color.value;
2085
+ return ` ${color.name}: ${value};`;
2086
+ }).join("\n");
2087
+ output += `.dark {
2088
+ ${darkDeclarations}
2089
+ }`;
2090
+ }
2091
+ return output;
2059
2092
  }
2060
2093
 
2061
2094
  // src/installers/base.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-z3",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "type": "module",
5
5
  "description": "CLI for scaffolding Z3 Stack applications (TanStack/Next.js + Convex + Better Auth)",
6
6
  "bin": {
@@ -47,13 +47,7 @@
47
47
  --radius-4xl: calc(var(--radius) + 16px);
48
48
  }
49
49
 
50
- :root {
51
- /* {{TWEAKCN_THEME}} */
52
- }
53
-
54
- .dark {
55
- /* {{TWEAKCN_THEME}} */
56
- }
50
+ /* {{TWEAKCN_THEME}} */
57
51
 
58
52
  @layer base {
59
53
  * {
@@ -3,7 +3,5 @@
3
3
  @tailwind utilities;
4
4
 
5
5
  @layer base {
6
- :root {
7
- /* {{TWEAKCN_THEME}} */
8
- }
6
+ /* {{TWEAKCN_THEME}} */
9
7
  }