@pandacss/node 0.24.0 → 0.24.2

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
@@ -229,6 +229,7 @@ declare class Builder {
229
229
  extractFile: (ctx: PandaContext, file: string) => _pandacss_parser.ParserResult | undefined;
230
230
  extract: () => void;
231
231
  isValidRoot: (root: Root) => boolean;
232
+ private initialRoot;
232
233
  write: (root: Root) => void;
233
234
  registerDependency: (fn: (dep: Message) => void) => void;
234
235
  }
package/dist/index.d.ts CHANGED
@@ -229,6 +229,7 @@ declare class Builder {
229
229
  extractFile: (ctx: PandaContext, file: string) => _pandacss_parser.ParserResult | undefined;
230
230
  extract: () => void;
231
231
  isValidRoot: (root: Root) => boolean;
232
+ private initialRoot;
232
233
  write: (root: Root) => void;
233
234
  registerDependency: (fn: (dep: Message) => void) => void;
234
235
  }
package/dist/index.js CHANGED
@@ -773,24 +773,12 @@ var writeAnalyzeJSON = (filePath, result, ctx) => {
773
773
  // src/build-info.ts
774
774
  init_cjs_shims();
775
775
  var import_logger2 = require("@pandacss/logger");
776
-
777
- // package.json
778
- var version = "0.24.0";
779
-
780
- // src/build-info.ts
781
776
  async function buildInfo(ctx, outfile) {
782
777
  const { filesWithCss, files } = ctx.parseFiles();
783
778
  import_logger2.logger.info("cli", `Found ${import_logger2.colors.bold(`${filesWithCss.length}/${files.length}`)} files using Panda`);
784
779
  const minify = ctx.config.minify;
785
780
  import_logger2.logger.info("cli", `Writing ${minify ? "[min] " : " "}${import_logger2.colors.bold(outfile)}`);
786
- const output = JSON.stringify(
787
- {
788
- schemaVersion: version,
789
- styles: ctx.encoder.toJSON()
790
- },
791
- null,
792
- minify ? 0 : 2
793
- );
781
+ const output = JSON.stringify(ctx.encoder.toJSON(), null, minify ? 0 : 2);
794
782
  ctx.output.ensure(outfile, process.cwd());
795
783
  await ctx.runtime.fs.writeFile(outfile, output);
796
784
  import_logger2.logger.info("cli", "Done!");
@@ -1271,10 +1259,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
1271
1259
  return 3;
1272
1260
  }
1273
1261
  if ("TERM_PROGRAM" in env) {
1274
- const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1262
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1275
1263
  switch (env.TERM_PROGRAM) {
1276
1264
  case "iTerm.app": {
1277
- return version2 >= 3 ? 3 : 2;
1265
+ return version >= 3 ? 3 : 2;
1278
1266
  }
1279
1267
  case "Apple_Terminal": {
1280
1268
  return 2;
@@ -2703,18 +2691,20 @@ var Builder = class {
2703
2691
  });
2704
2692
  return valid;
2705
2693
  };
2694
+ initialRoot;
2706
2695
  write = (root) => {
2707
- const rootCssContent = root.toString();
2696
+ if (!this.initialRoot) {
2697
+ this.initialRoot = root.toString();
2698
+ }
2708
2699
  root.removeAll();
2709
2700
  const ctx = this.getContextOrThrow();
2710
2701
  const sheet = ctx.createSheet();
2711
- ctx.appendLayerParams(sheet);
2712
2702
  ctx.appendBaselineCss(sheet);
2713
2703
  ctx.appendParserCss(sheet);
2714
2704
  const css = ctx.getCss(sheet);
2715
2705
  root.append(
2716
2706
  (0, import_core.optimizeCss)(`
2717
- ${rootCssContent}
2707
+ ${this.initialRoot}
2718
2708
  ${css}
2719
2709
  `)
2720
2710
  );
package/dist/index.mjs CHANGED
@@ -749,24 +749,12 @@ var writeAnalyzeJSON = (filePath, result, ctx) => {
749
749
  // src/build-info.ts
750
750
  init_esm_shims();
751
751
  import { colors, logger as logger2 } from "@pandacss/logger";
752
-
753
- // package.json
754
- var version = "0.24.0";
755
-
756
- // src/build-info.ts
757
752
  async function buildInfo(ctx, outfile) {
758
753
  const { filesWithCss, files } = ctx.parseFiles();
759
754
  logger2.info("cli", `Found ${colors.bold(`${filesWithCss.length}/${files.length}`)} files using Panda`);
760
755
  const minify = ctx.config.minify;
761
756
  logger2.info("cli", `Writing ${minify ? "[min] " : " "}${colors.bold(outfile)}`);
762
- const output = JSON.stringify(
763
- {
764
- schemaVersion: version,
765
- styles: ctx.encoder.toJSON()
766
- },
767
- null,
768
- minify ? 0 : 2
769
- );
757
+ const output = JSON.stringify(ctx.encoder.toJSON(), null, minify ? 0 : 2);
770
758
  ctx.output.ensure(outfile, process.cwd());
771
759
  await ctx.runtime.fs.writeFile(outfile, output);
772
760
  logger2.info("cli", "Done!");
@@ -1247,10 +1235,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
1247
1235
  return 3;
1248
1236
  }
1249
1237
  if ("TERM_PROGRAM" in env) {
1250
- const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1238
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1251
1239
  switch (env.TERM_PROGRAM) {
1252
1240
  case "iTerm.app": {
1253
- return version2 >= 3 ? 3 : 2;
1241
+ return version >= 3 ? 3 : 2;
1254
1242
  }
1255
1243
  case "Apple_Terminal": {
1256
1244
  return 2;
@@ -2679,18 +2667,20 @@ var Builder = class {
2679
2667
  });
2680
2668
  return valid;
2681
2669
  };
2670
+ initialRoot;
2682
2671
  write = (root) => {
2683
- const rootCssContent = root.toString();
2672
+ if (!this.initialRoot) {
2673
+ this.initialRoot = root.toString();
2674
+ }
2684
2675
  root.removeAll();
2685
2676
  const ctx = this.getContextOrThrow();
2686
2677
  const sheet = ctx.createSheet();
2687
- ctx.appendLayerParams(sheet);
2688
2678
  ctx.appendBaselineCss(sheet);
2689
2679
  ctx.appendParserCss(sheet);
2690
2680
  const css = ctx.getCss(sheet);
2691
2681
  root.append(
2692
2682
  optimizeCss(`
2693
- ${rootCssContent}
2683
+ ${this.initialRoot}
2694
2684
  ${css}
2695
2685
  `)
2696
2686
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -53,16 +53,16 @@
53
53
  "ts-morph": "19.0.0",
54
54
  "ts-pattern": "5.0.5",
55
55
  "tsconfck": "^2.1.2",
56
- "@pandacss/config": "0.24.0",
57
- "@pandacss/core": "0.24.0",
58
- "@pandacss/error": "0.24.0",
59
- "@pandacss/extractor": "0.24.0",
60
- "@pandacss/generator": "0.24.0",
61
- "@pandacss/logger": "0.24.0",
62
- "@pandacss/parser": "0.24.0",
63
- "@pandacss/shared": "0.24.0",
64
- "@pandacss/token-dictionary": "0.24.0",
65
- "@pandacss/types": "0.24.0"
56
+ "@pandacss/config": "0.24.2",
57
+ "@pandacss/error": "0.24.2",
58
+ "@pandacss/generator": "0.24.2",
59
+ "@pandacss/extractor": "0.24.2",
60
+ "@pandacss/core": "0.24.2",
61
+ "@pandacss/logger": "0.24.2",
62
+ "@pandacss/parser": "0.24.2",
63
+ "@pandacss/shared": "0.24.2",
64
+ "@pandacss/token-dictionary": "0.24.2",
65
+ "@pandacss/types": "0.24.2"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/fs-extra": "11.0.4",