@pandacss/node 0.17.4 → 0.18.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
@@ -170,7 +170,7 @@ declare function analyzeTokens(ctx: PandaContext, options?: Options): {
170
170
  }>;
171
171
  };
172
172
  };
173
- declare const writeAnalyzeJSON: (fileName: string, result: ReturnType<typeof analyzeTokens>, ctx: PandaContext) => Promise<void>;
173
+ declare const writeAnalyzeJSON: (filePath: string, result: ReturnType<typeof analyzeTokens>, ctx: PandaContext) => Promise<void>;
174
174
 
175
175
  interface ConfigDepsResult {
176
176
  modifiedMap: Map<string, number>;
@@ -217,6 +217,7 @@ declare function loadConfigAndCreateContext(options?: {
217
217
  declare function debugFiles(ctx: PandaContext, options: {
218
218
  outdir: string;
219
219
  dry: boolean;
220
+ onlyConfig?: boolean;
220
221
  }): Promise<void>;
221
222
 
222
223
  declare function execCommand(cmd: string, cwd: string): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -170,7 +170,7 @@ declare function analyzeTokens(ctx: PandaContext, options?: Options): {
170
170
  }>;
171
171
  };
172
172
  };
173
- declare const writeAnalyzeJSON: (fileName: string, result: ReturnType<typeof analyzeTokens>, ctx: PandaContext) => Promise<void>;
173
+ declare const writeAnalyzeJSON: (filePath: string, result: ReturnType<typeof analyzeTokens>, ctx: PandaContext) => Promise<void>;
174
174
 
175
175
  interface ConfigDepsResult {
176
176
  modifiedMap: Map<string, number>;
@@ -217,6 +217,7 @@ declare function loadConfigAndCreateContext(options?: {
217
217
  declare function debugFiles(ctx: PandaContext, options: {
218
218
  outdir: string;
219
219
  dry: boolean;
220
+ onlyConfig?: boolean;
220
221
  }): Promise<void>;
221
222
 
222
223
  declare function execCommand(cmd: string, cwd: string): Promise<void>;
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.31_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@7.1.0_typescript@5.2.2/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.31_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@7.1.0_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -756,12 +756,14 @@ var analyzeResultSerializer = (_key, value) => {
756
756
  }
757
757
  return value;
758
758
  };
759
- var writeAnalyzeJSON = (fileName, result, ctx) => {
759
+ var writeAnalyzeJSON = (filePath, result, ctx) => {
760
760
  result.details.byInstanceId.forEach((item) => {
761
761
  item.box = item.box.toJSON();
762
762
  });
763
+ const dirname2 = ctx.runtime.path.dirname(filePath);
764
+ ctx.runtime.fs.ensureDirSync(dirname2);
763
765
  return (0, import_promises.writeFile)(
764
- fileName,
766
+ filePath,
765
767
  JSON.stringify(
766
768
  Object.assign(result, {
767
769
  cwd: ctx.config.cwd,
@@ -2784,6 +2786,10 @@ async function debugFiles(ctx, options) {
2784
2786
  import_logger6.logger.info("cli", `Writing ${import_logger6.colors.bold(`${outdir}/config.json`)}`);
2785
2787
  await fs.writeFile(`${outdir}/config.json`, JSON.stringify(ctx.config, null, 2));
2786
2788
  }
2789
+ if (options.onlyConfig) {
2790
+ measureTotal();
2791
+ return;
2792
+ }
2787
2793
  const filesWithCss = [];
2788
2794
  await Promise.allSettled(
2789
2795
  files.map(async (file) => {
@@ -2929,6 +2935,7 @@ var import_look_it_up3 = require("look-it-up");
2929
2935
  var import_outdent2 = require("outdent");
2930
2936
  var import_path3 = require("path");
2931
2937
  var import_preferred_pm2 = __toESM(require("preferred-pm"));
2938
+ var import_prettier = __toESM(require("prettier"));
2932
2939
  async function setupConfig(cwd, opts = {}) {
2933
2940
  const { force, outExtension, jsxFramework, syntax } = opts;
2934
2941
  const configFile = findConfig();
@@ -2971,7 +2978,7 @@ jsxFramework: '${jsxFramework}',` : ""}
2971
2978
  syntax: '${syntax}'` : ""}
2972
2979
  })
2973
2980
  `;
2974
- await import_fs_extra3.default.writeFile((0, import_path3.join)(cwd, file), content);
2981
+ await import_fs_extra3.default.writeFile((0, import_path3.join)(cwd, file), import_prettier.default.format(content));
2975
2982
  import_logger9.logger.log(import_generator2.messages.thankYou());
2976
2983
  }
2977
2984
  }
@@ -3011,6 +3018,8 @@ async function shipFiles(ctx, outfile) {
3011
3018
  const minify = ctx.config.minify;
3012
3019
  import_logger10.logger.info("cli", `Writing ${minify ? "[min] " : " "}${import_logger10.colors.bold(outfile)}`);
3013
3020
  const output = JSON.stringify(extractResult.toJSON(), null, minify ? 0 : 2);
3021
+ const dirname2 = ctx.runtime.path.dirname(outfile);
3022
+ ctx.runtime.fs.ensureDirSync(dirname2);
3014
3023
  await (0, import_promises3.writeFile)(outfile, output);
3015
3024
  import_logger10.logger.info("cli", "Done!");
3016
3025
  }
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.31_typescript@5.2.2/node_modules/tsup/assets/esm_shims.js
37
+ // ../../node_modules/.pnpm/tsup@7.1.0_typescript@5.2.2/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.31_typescript@5.2.2/node_modules/tsup/assets/esm_shims.js"() {
39
+ "../../node_modules/.pnpm/tsup@7.1.0_typescript@5.2.2/node_modules/tsup/assets/esm_shims.js"() {
40
40
  "use strict";
41
41
  }
42
42
  });
@@ -732,12 +732,14 @@ var analyzeResultSerializer = (_key, value) => {
732
732
  }
733
733
  return value;
734
734
  };
735
- var writeAnalyzeJSON = (fileName, result, ctx) => {
735
+ var writeAnalyzeJSON = (filePath, result, ctx) => {
736
736
  result.details.byInstanceId.forEach((item) => {
737
737
  item.box = item.box.toJSON();
738
738
  });
739
+ const dirname2 = ctx.runtime.path.dirname(filePath);
740
+ ctx.runtime.fs.ensureDirSync(dirname2);
739
741
  return writeFile(
740
- fileName,
742
+ filePath,
741
743
  JSON.stringify(
742
744
  Object.assign(result, {
743
745
  cwd: ctx.config.cwd,
@@ -2760,6 +2762,10 @@ async function debugFiles(ctx, options) {
2760
2762
  logger6.info("cli", `Writing ${colors.bold(`${outdir}/config.json`)}`);
2761
2763
  await fs.writeFile(`${outdir}/config.json`, JSON.stringify(ctx.config, null, 2));
2762
2764
  }
2765
+ if (options.onlyConfig) {
2766
+ measureTotal();
2767
+ return;
2768
+ }
2763
2769
  const filesWithCss = [];
2764
2770
  await Promise.allSettled(
2765
2771
  files.map(async (file) => {
@@ -2905,6 +2911,7 @@ import { lookItUpSync as lookItUpSync3 } from "look-it-up";
2905
2911
  import { outdent as outdent2 } from "outdent";
2906
2912
  import { join as join2 } from "path";
2907
2913
  import getPackageManager2 from "preferred-pm";
2914
+ import prettier from "prettier";
2908
2915
  async function setupConfig(cwd, opts = {}) {
2909
2916
  const { force, outExtension, jsxFramework, syntax } = opts;
2910
2917
  const configFile = findConfig();
@@ -2947,7 +2954,7 @@ jsxFramework: '${jsxFramework}',` : ""}
2947
2954
  syntax: '${syntax}'` : ""}
2948
2955
  })
2949
2956
  `;
2950
- await fsExtra3.writeFile(join2(cwd, file), content);
2957
+ await fsExtra3.writeFile(join2(cwd, file), prettier.format(content));
2951
2958
  logger9.log(messages.thankYou());
2952
2959
  }
2953
2960
  }
@@ -2987,6 +2994,8 @@ async function shipFiles(ctx, outfile) {
2987
2994
  const minify = ctx.config.minify;
2988
2995
  logger10.info("cli", `Writing ${minify ? "[min] " : " "}${colors2.bold(outfile)}`);
2989
2996
  const output = JSON.stringify(extractResult.toJSON(), null, minify ? 0 : 2);
2997
+ const dirname2 = ctx.runtime.path.dirname(outfile);
2998
+ ctx.runtime.fs.ensureDirSync(dirname2);
2990
2999
  await writeFile3(outfile, output);
2991
3000
  logger10.info("cli", "Done!");
2992
3001
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.17.4",
3
+ "version": "0.18.0",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -43,20 +43,21 @@
43
43
  "pluralize": "8.0.0",
44
44
  "postcss": "^8.4.31",
45
45
  "preferred-pm": "^3.0.3",
46
+ "prettier": "^2.8.8",
46
47
  "ts-morph": "19.0.0",
47
48
  "ts-pattern": "5.0.5",
48
49
  "tsconfck": "^2.1.2",
49
- "@pandacss/config": "0.17.4",
50
- "@pandacss/core": "0.17.4",
51
- "@pandacss/error": "0.17.4",
52
- "@pandacss/extractor": "0.17.4",
53
- "@pandacss/generator": "0.17.4",
54
- "@pandacss/is-valid-prop": "0.17.4",
55
- "@pandacss/logger": "0.17.4",
56
- "@pandacss/parser": "0.17.4",
57
- "@pandacss/shared": "0.17.4",
58
- "@pandacss/token-dictionary": "0.17.4",
59
- "@pandacss/types": "0.17.4"
50
+ "@pandacss/config": "0.18.0",
51
+ "@pandacss/core": "0.18.0",
52
+ "@pandacss/error": "0.18.0",
53
+ "@pandacss/extractor": "0.18.0",
54
+ "@pandacss/generator": "0.18.0",
55
+ "@pandacss/is-valid-prop": "0.18.0",
56
+ "@pandacss/logger": "0.18.0",
57
+ "@pandacss/parser": "0.18.0",
58
+ "@pandacss/shared": "0.18.0",
59
+ "@pandacss/token-dictionary": "0.18.0",
60
+ "@pandacss/types": "0.18.0"
60
61
  },
61
62
  "devDependencies": {
62
63
  "@types/fs-extra": "11.0.3",
@@ -66,7 +67,7 @@
66
67
  "@types/pluralize": "0.0.30",
67
68
  "boxen": "^7.1.1",
68
69
  "p-limit": "^4.0.0",
69
- "@pandacss/fixture": "0.17.4"
70
+ "@pandacss/fixture": "0.18.0"
70
71
  },
71
72
  "scripts": {
72
73
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",