@pandacss/node 0.5.1 → 0.7.0

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.d.mts CHANGED
@@ -189,6 +189,7 @@ declare class Builder {
189
189
  * The current panda context
190
190
  */
191
191
  context: PandaContext | undefined;
192
+ configDependencies: Set<string>;
192
193
  writeFileCss(file: string, css: string): void;
193
194
  checkConfigDeps(configPath: string, deps: Set<string>): ConfigDepsResult;
194
195
  getConfigPath(): string;
package/dist/index.d.ts CHANGED
@@ -189,6 +189,7 @@ declare class Builder {
189
189
  * The current panda context
190
190
  */
191
191
  context: PandaContext | undefined;
192
+ configDependencies: Set<string>;
192
193
  writeFileCss(file: string, css: string): void;
193
194
  checkConfigDeps(configPath: string, deps: Set<string>): ConfigDepsResult;
194
195
  getConfigPath(): string;
package/dist/index.js CHANGED
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.24_typescript@5.1.3/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.25_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js
37
37
  var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.24_typescript@5.1.3/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.25_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -1007,7 +1007,7 @@ var import_lil_fp2 = require("lil-fp");
1007
1007
  // src/cli-box.ts
1008
1008
  init_cjs_shims();
1009
1009
 
1010
- // ../../node_modules/.pnpm/boxen@7.1.0/node_modules/boxen/index.js
1010
+ // ../../node_modules/.pnpm/boxen@7.1.1/node_modules/boxen/index.js
1011
1011
  init_cjs_shims();
1012
1012
  var import_node_process2 = __toESM(require("process"), 1);
1013
1013
 
@@ -1583,7 +1583,7 @@ function widestLine(string) {
1583
1583
  return lineWidth;
1584
1584
  }
1585
1585
 
1586
- // ../../node_modules/.pnpm/boxen@7.1.0/node_modules/boxen/index.js
1586
+ // ../../node_modules/.pnpm/boxen@7.1.1/node_modules/boxen/index.js
1587
1587
  var import_cli_boxes = __toESM(require_cli_boxes(), 1);
1588
1588
 
1589
1589
  // ../../node_modules/.pnpm/camelcase@7.0.1/node_modules/camelcase/index.js
@@ -1669,7 +1669,7 @@ function camelCase(input, options) {
1669
1669
  return postProcess(input, toUpperCase);
1670
1670
  }
1671
1671
 
1672
- // ../../node_modules/.pnpm/boxen@7.1.0/node_modules/boxen/index.js
1672
+ // ../../node_modules/.pnpm/boxen@7.1.1/node_modules/boxen/index.js
1673
1673
  var import_ansi_align = __toESM(require_ansi_align(), 1);
1674
1674
 
1675
1675
  // ../../node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js
@@ -2013,11 +2013,11 @@ function wrapAnsi(string, columns, options) {
2013
2013
  return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
2014
2014
  }
2015
2015
 
2016
- // ../../node_modules/.pnpm/boxen@7.1.0/node_modules/boxen/index.js
2016
+ // ../../node_modules/.pnpm/boxen@7.1.1/node_modules/boxen/index.js
2017
2017
  var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
2018
2018
  var NEWLINE = "\n";
2019
2019
  var PAD = " ";
2020
- var BORDERS_WIDTH = 2;
2020
+ var NONE = "none";
2021
2021
  var terminalColumns = () => {
2022
2022
  const { env: env2, stdout, stderr } = import_node_process2.default;
2023
2023
  if (stdout?.columns) {
@@ -2043,6 +2043,7 @@ var getObject = (detail) => typeof detail === "number" ? {
2043
2043
  left: 0,
2044
2044
  ...detail
2045
2045
  };
2046
+ var getBorderWidth = (borderStyle) => borderStyle === NONE ? 0 : 2;
2046
2047
  var getBorderChars = (borderStyle) => {
2047
2048
  const sides = [
2048
2049
  "topLeft",
@@ -2055,7 +2056,7 @@ var getBorderChars = (borderStyle) => {
2055
2056
  "bottom"
2056
2057
  ];
2057
2058
  let characters;
2058
- if (borderStyle === "none") {
2059
+ if (borderStyle === NONE) {
2059
2060
  borderStyle = {};
2060
2061
  for (const side of sides) {
2061
2062
  borderStyle[side] = "";
@@ -2084,10 +2085,10 @@ var getBorderChars = (borderStyle) => {
2084
2085
  }
2085
2086
  return characters;
2086
2087
  };
2087
- var makeTitle = (text, horizontal, alignement) => {
2088
+ var makeTitle = (text, horizontal, alignment) => {
2088
2089
  let title = "";
2089
2090
  const textWidth = stringWidth(text);
2090
- switch (alignement) {
2091
+ switch (alignment) {
2091
2092
  case "left": {
2092
2093
  title = text + horizontal.slice(textWidth);
2093
2094
  break;
@@ -2190,17 +2191,28 @@ var boxContent = (content, contentWidth, options) => {
2190
2191
  const columns = terminalColumns();
2191
2192
  let marginLeft = PAD.repeat(options.margin.left);
2192
2193
  if (options.float === "center") {
2193
- const marginWidth = Math.max((columns - contentWidth - BORDERS_WIDTH) / 2, 0);
2194
+ const marginWidth = Math.max((columns - contentWidth - getBorderWidth(options.borderStyle)) / 2, 0);
2194
2195
  marginLeft = PAD.repeat(marginWidth);
2195
2196
  } else if (options.float === "right") {
2196
- const marginWidth = Math.max(columns - contentWidth - options.margin.right - BORDERS_WIDTH, 0);
2197
+ const marginWidth = Math.max(columns - contentWidth - options.margin.right - getBorderWidth(options.borderStyle), 0);
2197
2198
  marginLeft = PAD.repeat(marginWidth);
2198
2199
  }
2199
- const top = colorizeBorder(NEWLINE.repeat(options.margin.top) + marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight);
2200
- const bottom = colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight + NEWLINE.repeat(options.margin.bottom));
2200
+ let result = "";
2201
+ if (options.margin.top) {
2202
+ result += NEWLINE.repeat(options.margin.top);
2203
+ }
2204
+ if (options.borderStyle !== NONE || options.title) {
2205
+ result += colorizeBorder(marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight) + NEWLINE;
2206
+ }
2201
2207
  const lines = content.split(NEWLINE);
2202
- const middle = lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
2203
- return top + NEWLINE + middle + NEWLINE + bottom;
2208
+ result += lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
2209
+ if (options.borderStyle !== NONE) {
2210
+ result += NEWLINE + colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight);
2211
+ }
2212
+ if (options.margin.bottom) {
2213
+ result += NEWLINE.repeat(options.margin.bottom);
2214
+ }
2215
+ return result;
2204
2216
  };
2205
2217
  var sanitizeOptions = (options) => {
2206
2218
  if (options.fullscreen && import_node_process2.default?.stdout) {
@@ -2216,28 +2228,30 @@ var sanitizeOptions = (options) => {
2216
2228
  }
2217
2229
  }
2218
2230
  if (options.width) {
2219
- options.width = Math.max(1, options.width - BORDERS_WIDTH);
2231
+ options.width = Math.max(1, options.width - getBorderWidth(options.borderStyle));
2220
2232
  }
2221
2233
  if (options.height) {
2222
- options.height = Math.max(1, options.height - BORDERS_WIDTH);
2234
+ options.height = Math.max(1, options.height - getBorderWidth(options.borderStyle));
2223
2235
  }
2224
2236
  return options;
2225
2237
  };
2238
+ var formatTitle = (title, borderStyle) => borderStyle === NONE ? title : ` ${title} `;
2226
2239
  var determineDimensions = (text, options) => {
2227
2240
  options = sanitizeOptions(options);
2228
2241
  const widthOverride = options.width !== void 0;
2229
2242
  const columns = terminalColumns();
2230
- const maxWidth = columns - options.margin.left - options.margin.right - BORDERS_WIDTH;
2231
- const widest = widestLine(wrapAnsi(text, columns - BORDERS_WIDTH, { hard: true, trim: false })) + options.padding.left + options.padding.right;
2243
+ const borderWidth = getBorderWidth(options.borderStyle);
2244
+ const maxWidth = columns - options.margin.left - options.margin.right - borderWidth;
2245
+ const widest = widestLine(wrapAnsi(text, columns - borderWidth, { hard: true, trim: false })) + options.padding.left + options.padding.right;
2232
2246
  if (options.title && widthOverride) {
2233
2247
  options.title = options.title.slice(0, Math.max(0, options.width - 2));
2234
2248
  if (options.title) {
2235
- options.title = ` ${options.title} `;
2249
+ options.title = formatTitle(options.title, options.borderStyle);
2236
2250
  }
2237
2251
  } else if (options.title) {
2238
2252
  options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
2239
2253
  if (options.title) {
2240
- options.title = ` ${options.title} `;
2254
+ options.title = formatTitle(options.title, options.borderStyle);
2241
2255
  if (stringWidth(options.title) > widest) {
2242
2256
  options.width = stringWidth(options.title);
2243
2257
  }
@@ -2246,12 +2260,12 @@ var determineDimensions = (text, options) => {
2246
2260
  options.width = options.width ? options.width : widest;
2247
2261
  if (!widthOverride) {
2248
2262
  if (options.margin.left && options.margin.right && options.width > maxWidth) {
2249
- const spaceForMargins = columns - options.width - BORDERS_WIDTH;
2263
+ const spaceForMargins = columns - options.width - borderWidth;
2250
2264
  const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
2251
2265
  options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
2252
2266
  options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
2253
2267
  }
2254
- options.width = Math.min(options.width, columns - BORDERS_WIDTH - options.margin.left - options.margin.right);
2268
+ options.width = Math.min(options.width, columns - borderWidth - options.margin.left - options.margin.right);
2255
2269
  }
2256
2270
  if (options.width - (options.padding.left + options.padding.right) <= 0) {
2257
2271
  options.padding.left = 0;
@@ -2372,6 +2386,7 @@ async function extractCss(ctx) {
2372
2386
  return bundleChunks(ctx);
2373
2387
  }
2374
2388
  async function bundleCss(ctx, outfile) {
2389
+ await extractFiles(ctx);
2375
2390
  const files = ctx.chunks.getFiles();
2376
2391
  await (0, import_promises2.writeFile)(outfile, ctx.getCss({ files, resolve: true }));
2377
2392
  return { files, msg: ctx.messages.buildComplete(files.length) };
@@ -2425,11 +2440,13 @@ function parseDependency(fileOrGlob) {
2425
2440
  var configCache = /* @__PURE__ */ new Map();
2426
2441
  var contentFilesCache = /* @__PURE__ */ new WeakMap();
2427
2442
  var setupCount = 0;
2443
+ var layersName = ["reset", "base", "tokens", "recipes", "utilities"];
2428
2444
  var Builder = class {
2429
2445
  /**
2430
2446
  * The current panda context
2431
2447
  */
2432
2448
  context;
2449
+ configDependencies = /* @__PURE__ */ new Set();
2433
2450
  writeFileCss(file, css) {
2434
2451
  const oldCss = this.fileCssMap?.get(file) ?? "";
2435
2452
  const newCss = (0, import_core2.mergeCss)(oldCss, css);
@@ -2478,7 +2495,10 @@ var Builder = class {
2478
2495
  };
2479
2496
  }
2480
2497
  }
2481
- const { deps: configDeps } = (0, import_config2.getConfigDependencies)(configPath, tsOptions);
2498
+ const { deps: foundDeps } = (0, import_config2.getConfigDependencies)(configPath, tsOptions);
2499
+ const cwd = this.context?.config.cwd ?? (0, import_path2.dirname)(configPath);
2500
+ const configDeps = /* @__PURE__ */ new Set([...foundDeps, ...(this.context?.dependencies ?? []).map((file) => (0, import_path2.resolve)(cwd, file))]);
2501
+ this.configDependencies = configDeps;
2482
2502
  const deps = this.checkConfigDeps(configPath, configDeps);
2483
2503
  if (deps.isModified) {
2484
2504
  await this.setupContext({
@@ -2555,12 +2575,12 @@ var Builder = class {
2555
2575
  resolve: true
2556
2576
  });
2557
2577
  }
2558
- // ASSUMPTION: Layer structure is an exact match (no extra layers)
2559
2578
  isValidRoot(root) {
2560
- const params = "reset, base, tokens, recipes, utilities";
2561
2579
  let found = false;
2562
2580
  root.walkAtRules("layer", (rule) => {
2563
- if (rule.params === params) {
2581
+ const foundLayers = /* @__PURE__ */ new Set();
2582
+ rule.params.split(",").forEach((name) => foundLayers.add(name.trim()));
2583
+ if (foundLayers.size >= 5 && layersName.every((name) => foundLayers.has(name))) {
2564
2584
  found = true;
2565
2585
  }
2566
2586
  });
@@ -2587,6 +2607,9 @@ var Builder = class {
2587
2607
  for (const file of ctx.dependencies) {
2588
2608
  fn({ type: "dependency", file: (0, import_path2.resolve)(file) });
2589
2609
  }
2610
+ for (const file of this.configDependencies) {
2611
+ fn({ type: "dependency", file: (0, import_path2.resolve)(file) });
2612
+ }
2590
2613
  }
2591
2614
  };
2592
2615
 
package/dist/index.mjs CHANGED
@@ -34,9 +34,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  mod
35
35
  ));
36
36
 
37
- // ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.24_typescript@5.1.3/node_modules/tsup/assets/esm_shims.js
37
+ // ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.25_typescript@5.1.6/node_modules/tsup/assets/esm_shims.js
38
38
  var init_esm_shims = __esm({
39
- "../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.24_typescript@5.1.3/node_modules/tsup/assets/esm_shims.js"() {
39
+ "../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.25_typescript@5.1.6/node_modules/tsup/assets/esm_shims.js"() {
40
40
  "use strict";
41
41
  }
42
42
  });
@@ -762,7 +762,7 @@ import { ConfigNotFoundError } from "@pandacss/error";
762
762
  import { logger as logger4 } from "@pandacss/logger";
763
763
  import { existsSync as existsSync2 } from "fs";
764
764
  import { statSync } from "fs-extra";
765
- import { resolve as resolve2 } from "path";
765
+ import { dirname as dirname2, resolve as resolve2 } from "path";
766
766
 
767
767
  // src/config.ts
768
768
  init_esm_shims();
@@ -993,7 +993,7 @@ import { Obj as Obj2, pipe as pipe2, tap as tap2, tryCatch } from "lil-fp";
993
993
  // src/cli-box.ts
994
994
  init_esm_shims();
995
995
 
996
- // ../../node_modules/.pnpm/boxen@7.1.0/node_modules/boxen/index.js
996
+ // ../../node_modules/.pnpm/boxen@7.1.1/node_modules/boxen/index.js
997
997
  init_esm_shims();
998
998
  import process3 from "node:process";
999
999
 
@@ -1569,7 +1569,7 @@ function widestLine(string) {
1569
1569
  return lineWidth;
1570
1570
  }
1571
1571
 
1572
- // ../../node_modules/.pnpm/boxen@7.1.0/node_modules/boxen/index.js
1572
+ // ../../node_modules/.pnpm/boxen@7.1.1/node_modules/boxen/index.js
1573
1573
  var import_cli_boxes = __toESM(require_cli_boxes(), 1);
1574
1574
 
1575
1575
  // ../../node_modules/.pnpm/camelcase@7.0.1/node_modules/camelcase/index.js
@@ -1655,7 +1655,7 @@ function camelCase(input, options) {
1655
1655
  return postProcess(input, toUpperCase);
1656
1656
  }
1657
1657
 
1658
- // ../../node_modules/.pnpm/boxen@7.1.0/node_modules/boxen/index.js
1658
+ // ../../node_modules/.pnpm/boxen@7.1.1/node_modules/boxen/index.js
1659
1659
  var import_ansi_align = __toESM(require_ansi_align(), 1);
1660
1660
 
1661
1661
  // ../../node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js
@@ -1999,11 +1999,11 @@ function wrapAnsi(string, columns, options) {
1999
1999
  return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
2000
2000
  }
2001
2001
 
2002
- // ../../node_modules/.pnpm/boxen@7.1.0/node_modules/boxen/index.js
2002
+ // ../../node_modules/.pnpm/boxen@7.1.1/node_modules/boxen/index.js
2003
2003
  var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
2004
2004
  var NEWLINE = "\n";
2005
2005
  var PAD = " ";
2006
- var BORDERS_WIDTH = 2;
2006
+ var NONE = "none";
2007
2007
  var terminalColumns = () => {
2008
2008
  const { env: env2, stdout, stderr } = process3;
2009
2009
  if (stdout?.columns) {
@@ -2029,6 +2029,7 @@ var getObject = (detail) => typeof detail === "number" ? {
2029
2029
  left: 0,
2030
2030
  ...detail
2031
2031
  };
2032
+ var getBorderWidth = (borderStyle) => borderStyle === NONE ? 0 : 2;
2032
2033
  var getBorderChars = (borderStyle) => {
2033
2034
  const sides = [
2034
2035
  "topLeft",
@@ -2041,7 +2042,7 @@ var getBorderChars = (borderStyle) => {
2041
2042
  "bottom"
2042
2043
  ];
2043
2044
  let characters;
2044
- if (borderStyle === "none") {
2045
+ if (borderStyle === NONE) {
2045
2046
  borderStyle = {};
2046
2047
  for (const side of sides) {
2047
2048
  borderStyle[side] = "";
@@ -2070,10 +2071,10 @@ var getBorderChars = (borderStyle) => {
2070
2071
  }
2071
2072
  return characters;
2072
2073
  };
2073
- var makeTitle = (text, horizontal, alignement) => {
2074
+ var makeTitle = (text, horizontal, alignment) => {
2074
2075
  let title = "";
2075
2076
  const textWidth = stringWidth(text);
2076
- switch (alignement) {
2077
+ switch (alignment) {
2077
2078
  case "left": {
2078
2079
  title = text + horizontal.slice(textWidth);
2079
2080
  break;
@@ -2176,17 +2177,28 @@ var boxContent = (content, contentWidth, options) => {
2176
2177
  const columns = terminalColumns();
2177
2178
  let marginLeft = PAD.repeat(options.margin.left);
2178
2179
  if (options.float === "center") {
2179
- const marginWidth = Math.max((columns - contentWidth - BORDERS_WIDTH) / 2, 0);
2180
+ const marginWidth = Math.max((columns - contentWidth - getBorderWidth(options.borderStyle)) / 2, 0);
2180
2181
  marginLeft = PAD.repeat(marginWidth);
2181
2182
  } else if (options.float === "right") {
2182
- const marginWidth = Math.max(columns - contentWidth - options.margin.right - BORDERS_WIDTH, 0);
2183
+ const marginWidth = Math.max(columns - contentWidth - options.margin.right - getBorderWidth(options.borderStyle), 0);
2183
2184
  marginLeft = PAD.repeat(marginWidth);
2184
2185
  }
2185
- const top = colorizeBorder(NEWLINE.repeat(options.margin.top) + marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight);
2186
- const bottom = colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight + NEWLINE.repeat(options.margin.bottom));
2186
+ let result = "";
2187
+ if (options.margin.top) {
2188
+ result += NEWLINE.repeat(options.margin.top);
2189
+ }
2190
+ if (options.borderStyle !== NONE || options.title) {
2191
+ result += colorizeBorder(marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight) + NEWLINE;
2192
+ }
2187
2193
  const lines = content.split(NEWLINE);
2188
- const middle = lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
2189
- return top + NEWLINE + middle + NEWLINE + bottom;
2194
+ result += lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
2195
+ if (options.borderStyle !== NONE) {
2196
+ result += NEWLINE + colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight);
2197
+ }
2198
+ if (options.margin.bottom) {
2199
+ result += NEWLINE.repeat(options.margin.bottom);
2200
+ }
2201
+ return result;
2190
2202
  };
2191
2203
  var sanitizeOptions = (options) => {
2192
2204
  if (options.fullscreen && process3?.stdout) {
@@ -2202,28 +2214,30 @@ var sanitizeOptions = (options) => {
2202
2214
  }
2203
2215
  }
2204
2216
  if (options.width) {
2205
- options.width = Math.max(1, options.width - BORDERS_WIDTH);
2217
+ options.width = Math.max(1, options.width - getBorderWidth(options.borderStyle));
2206
2218
  }
2207
2219
  if (options.height) {
2208
- options.height = Math.max(1, options.height - BORDERS_WIDTH);
2220
+ options.height = Math.max(1, options.height - getBorderWidth(options.borderStyle));
2209
2221
  }
2210
2222
  return options;
2211
2223
  };
2224
+ var formatTitle = (title, borderStyle) => borderStyle === NONE ? title : ` ${title} `;
2212
2225
  var determineDimensions = (text, options) => {
2213
2226
  options = sanitizeOptions(options);
2214
2227
  const widthOverride = options.width !== void 0;
2215
2228
  const columns = terminalColumns();
2216
- const maxWidth = columns - options.margin.left - options.margin.right - BORDERS_WIDTH;
2217
- const widest = widestLine(wrapAnsi(text, columns - BORDERS_WIDTH, { hard: true, trim: false })) + options.padding.left + options.padding.right;
2229
+ const borderWidth = getBorderWidth(options.borderStyle);
2230
+ const maxWidth = columns - options.margin.left - options.margin.right - borderWidth;
2231
+ const widest = widestLine(wrapAnsi(text, columns - borderWidth, { hard: true, trim: false })) + options.padding.left + options.padding.right;
2218
2232
  if (options.title && widthOverride) {
2219
2233
  options.title = options.title.slice(0, Math.max(0, options.width - 2));
2220
2234
  if (options.title) {
2221
- options.title = ` ${options.title} `;
2235
+ options.title = formatTitle(options.title, options.borderStyle);
2222
2236
  }
2223
2237
  } else if (options.title) {
2224
2238
  options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
2225
2239
  if (options.title) {
2226
- options.title = ` ${options.title} `;
2240
+ options.title = formatTitle(options.title, options.borderStyle);
2227
2241
  if (stringWidth(options.title) > widest) {
2228
2242
  options.width = stringWidth(options.title);
2229
2243
  }
@@ -2232,12 +2246,12 @@ var determineDimensions = (text, options) => {
2232
2246
  options.width = options.width ? options.width : widest;
2233
2247
  if (!widthOverride) {
2234
2248
  if (options.margin.left && options.margin.right && options.width > maxWidth) {
2235
- const spaceForMargins = columns - options.width - BORDERS_WIDTH;
2249
+ const spaceForMargins = columns - options.width - borderWidth;
2236
2250
  const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
2237
2251
  options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
2238
2252
  options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
2239
2253
  }
2240
- options.width = Math.min(options.width, columns - BORDERS_WIDTH - options.margin.left - options.margin.right);
2254
+ options.width = Math.min(options.width, columns - borderWidth - options.margin.left - options.margin.right);
2241
2255
  }
2242
2256
  if (options.width - (options.padding.left + options.padding.right) <= 0) {
2243
2257
  options.padding.left = 0;
@@ -2358,6 +2372,7 @@ async function extractCss(ctx) {
2358
2372
  return bundleChunks(ctx);
2359
2373
  }
2360
2374
  async function bundleCss(ctx, outfile) {
2375
+ await extractFiles(ctx);
2361
2376
  const files = ctx.chunks.getFiles();
2362
2377
  await writeFile3(outfile, ctx.getCss({ files, resolve: true }));
2363
2378
  return { files, msg: ctx.messages.buildComplete(files.length) };
@@ -2411,11 +2426,13 @@ function parseDependency(fileOrGlob) {
2411
2426
  var configCache = /* @__PURE__ */ new Map();
2412
2427
  var contentFilesCache = /* @__PURE__ */ new WeakMap();
2413
2428
  var setupCount = 0;
2429
+ var layersName = ["reset", "base", "tokens", "recipes", "utilities"];
2414
2430
  var Builder = class {
2415
2431
  /**
2416
2432
  * The current panda context
2417
2433
  */
2418
2434
  context;
2435
+ configDependencies = /* @__PURE__ */ new Set();
2419
2436
  writeFileCss(file, css) {
2420
2437
  const oldCss = this.fileCssMap?.get(file) ?? "";
2421
2438
  const newCss = mergeCss2(oldCss, css);
@@ -2464,7 +2481,10 @@ var Builder = class {
2464
2481
  };
2465
2482
  }
2466
2483
  }
2467
- const { deps: configDeps } = getConfigDependencies(configPath, tsOptions);
2484
+ const { deps: foundDeps } = getConfigDependencies(configPath, tsOptions);
2485
+ const cwd = this.context?.config.cwd ?? dirname2(configPath);
2486
+ const configDeps = /* @__PURE__ */ new Set([...foundDeps, ...(this.context?.dependencies ?? []).map((file) => resolve2(cwd, file))]);
2487
+ this.configDependencies = configDeps;
2468
2488
  const deps = this.checkConfigDeps(configPath, configDeps);
2469
2489
  if (deps.isModified) {
2470
2490
  await this.setupContext({
@@ -2541,12 +2561,12 @@ var Builder = class {
2541
2561
  resolve: true
2542
2562
  });
2543
2563
  }
2544
- // ASSUMPTION: Layer structure is an exact match (no extra layers)
2545
2564
  isValidRoot(root) {
2546
- const params = "reset, base, tokens, recipes, utilities";
2547
2565
  let found = false;
2548
2566
  root.walkAtRules("layer", (rule) => {
2549
- if (rule.params === params) {
2567
+ const foundLayers = /* @__PURE__ */ new Set();
2568
+ rule.params.split(",").forEach((name) => foundLayers.add(name.trim()));
2569
+ if (foundLayers.size >= 5 && layersName.every((name) => foundLayers.has(name))) {
2550
2570
  found = true;
2551
2571
  }
2552
2572
  });
@@ -2573,6 +2593,9 @@ var Builder = class {
2573
2593
  for (const file of ctx.dependencies) {
2574
2594
  fn({ type: "dependency", file: resolve2(file) });
2575
2595
  }
2596
+ for (const file of this.configDependencies) {
2597
+ fn({ type: "dependency", file: resolve2(file) });
2598
+ }
2576
2599
  }
2577
2600
  };
2578
2601
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "chokidar": "^3.5.3",
18
- "fast-glob": "^3.2.12",
18
+ "fast-glob": "^3.3.0",
19
19
  "file-size": "^1.0.0",
20
20
  "filesize": "^10.0.7",
21
21
  "fs-extra": "11.1.1",
@@ -29,31 +29,31 @@
29
29
  "pathe": "^1.1.1",
30
30
  "pkg-types": "1.0.3",
31
31
  "pluralize": "8.0.0",
32
- "postcss": "8.4.24",
32
+ "postcss": "8.4.25",
33
33
  "preferred-pm": "^3.0.3",
34
34
  "ts-morph": "18.0.0",
35
- "ts-pattern": "4.3.0",
35
+ "ts-pattern": "5.0.1",
36
36
  "tsconfck": "^2.1.1",
37
- "@pandacss/config": "0.5.1",
38
- "@pandacss/core": "0.5.1",
39
- "@pandacss/error": "0.5.1",
40
- "@pandacss/extractor": "0.5.1",
41
- "@pandacss/generator": "0.5.1",
42
- "@pandacss/is-valid-prop": "0.5.1",
43
- "@pandacss/logger": "0.5.1",
44
- "@pandacss/parser": "0.5.1",
45
- "@pandacss/shared": "0.5.1",
46
- "@pandacss/token-dictionary": "0.5.1",
47
- "@pandacss/types": "0.5.1"
37
+ "@pandacss/config": "0.7.0",
38
+ "@pandacss/core": "0.7.0",
39
+ "@pandacss/error": "0.7.0",
40
+ "@pandacss/extractor": "0.7.0",
41
+ "@pandacss/generator": "0.7.0",
42
+ "@pandacss/is-valid-prop": "0.7.0",
43
+ "@pandacss/logger": "0.7.0",
44
+ "@pandacss/parser": "0.7.0",
45
+ "@pandacss/shared": "0.7.0",
46
+ "@pandacss/token-dictionary": "0.7.0",
47
+ "@pandacss/types": "0.7.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/fs-extra": "11.0.1",
51
51
  "@types/glob-parent": "^5.1.1",
52
52
  "@types/is-glob": "^4.0.2",
53
53
  "@types/lodash.merge": "4.6.7",
54
- "@types/pluralize": "0.0.29",
55
- "boxen": "^7.1.0",
56
- "@pandacss/fixture": "0.5.1"
54
+ "@types/pluralize": "0.0.30",
55
+ "boxen": "^7.1.1",
56
+ "@pandacss/fixture": "0.7.0"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",