@pandacss/node 0.27.1 → 0.27.3

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.
Files changed (3) hide show
  1. package/dist/index.js +62 -46
  2. package/dist/index.mjs +41 -25
  3. package/package.json +11 -12
package/dist/index.js CHANGED
@@ -786,12 +786,12 @@ async function buildInfo(ctx, outfile) {
786
786
 
787
787
  // src/builder.ts
788
788
  init_cjs_shims();
789
- var import_config3 = require("@pandacss/config");
789
+ var import_config4 = require("@pandacss/config");
790
790
  var import_core = require("@pandacss/core");
791
791
  var import_error = require("@pandacss/error");
792
792
  var import_logger6 = require("@pandacss/logger");
793
793
  var import_fs = require("fs");
794
- var import_pathe3 = require("pathe");
794
+ var import_path3 = require("path");
795
795
 
796
796
  // src/codegen.ts
797
797
  init_cjs_shims();
@@ -2236,10 +2236,9 @@ async function codegen(ctx, ids) {
2236
2236
 
2237
2237
  // src/config.ts
2238
2238
  init_cjs_shims();
2239
- var import_config2 = require("@pandacss/config");
2240
- var import_hookable = require("hookable");
2241
- var import_tsconfck = require("tsconfck");
2239
+ var import_config3 = require("@pandacss/config");
2242
2240
  var import_browserslist = __toESM(require("browserslist"));
2241
+ var import_hookable = require("hookable");
2243
2242
 
2244
2243
  // src/create-context.ts
2245
2244
  init_cjs_shims();
@@ -2263,6 +2262,8 @@ var DiffEngine = class {
2263
2262
  */
2264
2263
  async reloadConfigAndRefreshContext(fn) {
2265
2264
  const conf = await (0, import_config.loadConfig)({ cwd: this.ctx.config.cwd, file: this.ctx.conf.path });
2265
+ const { tsconfig, tsconfigFile, tsOptions } = this.ctx.conf;
2266
+ Object.assign(conf, { tsconfig, tsconfigFile, tsOptions });
2266
2267
  return this.refresh(conf, fn);
2267
2268
  }
2268
2269
  /**
@@ -2286,7 +2287,7 @@ var import_logger3 = require("@pandacss/logger");
2286
2287
  var import_chokidar = __toESM(require("chokidar"));
2287
2288
  var import_fast_glob = __toESM(require("fast-glob"));
2288
2289
  var import_fs_extra = __toESM(require("fs-extra"));
2289
- var import_pathe = require("pathe");
2290
+ var import_path = require("path");
2290
2291
  var nodeRuntime = {
2291
2292
  cwd() {
2292
2293
  return process.cwd();
@@ -2295,15 +2296,15 @@ var nodeRuntime = {
2295
2296
  return process.env[name];
2296
2297
  },
2297
2298
  path: {
2298
- join: import_pathe.join,
2299
- relative: import_pathe.relative,
2300
- dirname: import_pathe.dirname,
2301
- extname: import_pathe.extname,
2302
- isAbsolute: import_pathe.isAbsolute,
2303
- sep: import_pathe.sep,
2304
- resolve: import_pathe.resolve,
2299
+ join: import_path.join,
2300
+ relative: import_path.relative,
2301
+ dirname: import_path.dirname,
2302
+ extname: import_path.extname,
2303
+ isAbsolute: import_path.isAbsolute,
2304
+ sep: import_path.sep,
2305
+ resolve: import_path.resolve,
2305
2306
  abs(cwd, str) {
2306
- return (0, import_pathe.isAbsolute)(str) ? str : (0, import_pathe.join)(cwd, str);
2307
+ return (0, import_path.isAbsolute)(str) ? str : (0, import_path.join)(cwd, str);
2307
2308
  }
2308
2309
  },
2309
2310
  fs: {
@@ -2504,11 +2505,39 @@ var PandaContext = class extends import_generator2.Generator {
2504
2505
  };
2505
2506
  };
2506
2507
 
2508
+ // src/load-tsconfig.ts
2509
+ init_cjs_shims();
2510
+ var import_config2 = require("@pandacss/config");
2511
+ var import_tsconfck = require("tsconfck");
2512
+ async function loadTsConfig(conf, cwd) {
2513
+ const tsconfigResult = await (0, import_tsconfck.parse)(conf.path, {
2514
+ root: cwd,
2515
+ //@ts-ignore
2516
+ resolveWithEmptyIfConfigNotFound: true
2517
+ });
2518
+ if (!tsconfigResult)
2519
+ return;
2520
+ const { tsconfig, tsconfigFile } = tsconfigResult;
2521
+ const { compilerOptions } = tsconfig;
2522
+ const result = {
2523
+ tsconfig,
2524
+ tsconfigFile
2525
+ };
2526
+ if (compilerOptions?.paths) {
2527
+ const baseUrl = compilerOptions.baseUrl;
2528
+ result.tsOptions = {
2529
+ baseUrl,
2530
+ pathMappings: (0, import_config2.convertTsPathsToRegexes)(compilerOptions.paths, baseUrl ?? cwd)
2531
+ };
2532
+ }
2533
+ return result;
2534
+ }
2535
+
2507
2536
  // src/config.ts
2508
2537
  async function loadConfigAndCreateContext(options = {}) {
2509
2538
  const { config, configPath } = options;
2510
2539
  const cwd = options.cwd ?? options?.config?.cwd ?? process.cwd();
2511
- const conf = await (0, import_config2.loadConfig)({ cwd, file: configPath });
2540
+ const conf = await (0, import_config3.loadConfig)({ cwd, file: configPath });
2512
2541
  if (config) {
2513
2542
  Object.assign(conf.config, config);
2514
2543
  }
@@ -2518,22 +2547,9 @@ async function loadConfigAndCreateContext(options = {}) {
2518
2547
  if (conf.config.lightningcss && !conf.config.browserslist) {
2519
2548
  conf.config.browserslist ||= import_browserslist.default.findConfig(cwd)?.defaults;
2520
2549
  }
2521
- const tsconfigResult = await (0, import_tsconfck.parse)(conf.path, {
2522
- root: cwd,
2523
- // @ts-ignore
2524
- resolveWithEmptyIfConfigNotFound: true
2525
- });
2526
- if (tsconfigResult) {
2527
- conf.tsconfig = tsconfigResult.tsconfig;
2528
- conf.tsconfigFile = tsconfigResult.tsconfigFile;
2529
- const options2 = tsconfigResult.tsconfig?.compilerOptions;
2530
- if (options2?.paths) {
2531
- const baseUrl = options2.baseUrl;
2532
- conf.tsOptions = {
2533
- baseUrl,
2534
- pathMappings: (0, import_config2.convertTsPathsToRegexes)(options2.paths, baseUrl ?? cwd)
2535
- };
2536
- }
2550
+ const tsConfResult = await loadTsConfig(conf, cwd);
2551
+ if (tsConfResult) {
2552
+ Object.assign(conf, tsConfResult);
2537
2553
  }
2538
2554
  const hooks = (0, import_hookable.createHooks)();
2539
2555
  if (conf.config.hooks) {
@@ -2549,7 +2565,7 @@ async function loadConfigAndCreateContext(options = {}) {
2549
2565
  // src/parse-dependency.ts
2550
2566
  init_cjs_shims();
2551
2567
  var import_is_glob = __toESM(require("is-glob"));
2552
- var import_pathe2 = require("pathe");
2568
+ var import_path2 = require("path");
2553
2569
 
2554
2570
  // src/parse-glob.ts
2555
2571
  init_cjs_shims();
@@ -2580,12 +2596,12 @@ function parseDependency(fileOrGlob) {
2580
2596
  let message = null;
2581
2597
  if ((0, import_is_glob.default)(fileOrGlob)) {
2582
2598
  const { base, glob: glob2 } = parseGlob(fileOrGlob);
2583
- message = { type: "dir-dependency", dir: (0, import_pathe2.normalize)((0, import_pathe2.resolve)(base)), glob: glob2 };
2599
+ message = { type: "dir-dependency", dir: (0, import_path2.normalize)((0, import_path2.resolve)(base)), glob: glob2 };
2584
2600
  } else {
2585
- message = { type: "dependency", file: (0, import_pathe2.normalize)((0, import_pathe2.resolve)(fileOrGlob)) };
2601
+ message = { type: "dependency", file: (0, import_path2.normalize)((0, import_path2.resolve)(fileOrGlob)) };
2586
2602
  }
2587
2603
  if (message.type === "dir-dependency" && process.env.ROLLUP_WATCH === "true") {
2588
- message = { type: "dependency", file: (0, import_pathe2.normalize)((0, import_pathe2.resolve)(message.dir)) };
2604
+ message = { type: "dependency", file: (0, import_path2.normalize)((0, import_path2.resolve)(message.dir)) };
2589
2605
  }
2590
2606
  return message;
2591
2607
  }
@@ -2602,7 +2618,7 @@ var Builder = class {
2602
2618
  affecteds;
2603
2619
  configDependencies = /* @__PURE__ */ new Set();
2604
2620
  getConfigPath = (cwd) => {
2605
- const configPath = (0, import_config3.findConfig)({ cwd });
2621
+ const configPath = (0, import_config4.findConfig)({ cwd });
2606
2622
  if (!configPath) {
2607
2623
  throw new import_error.ConfigNotFoundError();
2608
2624
  }
@@ -2611,11 +2627,11 @@ var Builder = class {
2611
2627
  setConfigDependencies(options) {
2612
2628
  const tsOptions = this.context?.conf.tsOptions ?? { baseUrl: void 0, pathMappings: [] };
2613
2629
  const compilerOptions = this.context?.conf.tsconfig?.compilerOptions ?? {};
2614
- const { deps: foundDeps } = (0, import_config3.getConfigDependencies)(options.configPath, tsOptions, compilerOptions);
2630
+ const { deps: foundDeps } = (0, import_config4.getConfigDependencies)(options.configPath, tsOptions, compilerOptions);
2615
2631
  const cwd = options?.cwd ?? this.context?.config.cwd ?? process.cwd();
2616
2632
  const configDeps = /* @__PURE__ */ new Set([
2617
2633
  ...foundDeps,
2618
- ...(this.context?.conf.dependencies ?? []).map((file) => (0, import_pathe3.resolve)(cwd, file))
2634
+ ...(this.context?.conf.dependencies ?? []).map((file) => (0, import_path3.resolve)(cwd, file))
2619
2635
  ]);
2620
2636
  this.configDependencies = configDeps;
2621
2637
  import_logger6.logger.debug("builder", "Config dependencies");
@@ -2732,7 +2748,7 @@ var Builder = class {
2732
2748
  fn(dependency);
2733
2749
  }
2734
2750
  for (const file of this.configDependencies) {
2735
- fn({ type: "dependency", file: (0, import_pathe3.normalize)((0, import_pathe3.resolve)(file)) });
2751
+ fn({ type: "dependency", file: (0, import_path3.normalize)((0, import_path3.resolve)(file)) });
2736
2752
  }
2737
2753
  };
2738
2754
  };
@@ -2774,7 +2790,7 @@ var cssgen = async (ctx, options) => {
2774
2790
  // src/debug.ts
2775
2791
  init_cjs_shims();
2776
2792
  var import_logger8 = require("@pandacss/logger");
2777
- var import_pathe4 = require("pathe");
2793
+ var import_path4 = require("path");
2778
2794
  async function debug(ctx, options) {
2779
2795
  const files = ctx.getFiles();
2780
2796
  const measureTotal = import_logger8.logger.time.debug(`Done parsing ${files.length} files`);
@@ -2809,7 +2825,7 @@ async function debug(ctx, options) {
2809
2825
  }
2810
2826
  if (outdir) {
2811
2827
  filesWithCss.push(file);
2812
- const parsedPath = (0, import_pathe4.parse)(file);
2828
+ const parsedPath = (0, import_path4.parse)(file);
2813
2829
  const relative2 = path.relative(ctx.config.cwd, parsedPath.dir);
2814
2830
  const astJsonPath = `${relative2}/${parsedPath.name}.ast.json`.replaceAll(path.sep, "__");
2815
2831
  const cssPath = `${relative2}/${parsedPath.name}.css`.replaceAll(path.sep, "__");
@@ -2923,18 +2939,18 @@ function setupGitIgnore(ctx) {
2923
2939
 
2924
2940
  // src/setup-config.ts
2925
2941
  init_cjs_shims();
2926
- var import_config6 = require("@pandacss/config");
2942
+ var import_config7 = require("@pandacss/config");
2927
2943
  var import_core2 = require("@pandacss/core");
2928
2944
  var import_logger10 = require("@pandacss/logger");
2929
2945
  var import_fs_extra2 = __toESM(require("fs-extra"));
2930
2946
  var import_look_it_up2 = require("look-it-up");
2931
2947
  var import_outdent2 = require("outdent");
2932
- var import_pathe5 = require("pathe");
2948
+ var import_path5 = require("path");
2933
2949
  var import_preferred_pm = __toESM(require("preferred-pm"));
2934
2950
  var import_prettier = __toESM(require("prettier"));
2935
2951
  async function setupConfig(cwd, opts = {}) {
2936
2952
  const { force, outExtension, jsxFramework, syntax } = opts;
2937
- const configFile = (0, import_config6.findConfig)({ cwd });
2953
+ const configFile = (0, import_config7.findConfig)({ cwd });
2938
2954
  const pmResult = await (0, import_preferred_pm.default)(cwd);
2939
2955
  const pm = pmResult?.name ?? "npm";
2940
2956
  const cmd = pm === "npm" ? "npm run" : pm;
@@ -2974,7 +2990,7 @@ jsxFramework: '${jsxFramework}',` : ""}
2974
2990
  syntax: '${syntax}'` : ""}
2975
2991
  })
2976
2992
  `;
2977
- await import_fs_extra2.default.writeFile((0, import_pathe5.join)(cwd, file), import_prettier.default.format(content));
2993
+ await import_fs_extra2.default.writeFile((0, import_path5.join)(cwd, file), import_prettier.default.format(content, { parser: "babel" }));
2978
2994
  import_logger10.logger.log(import_core2.messages.thankYou());
2979
2995
  }
2980
2996
  }
@@ -2987,7 +3003,7 @@ module.exports = {
2987
3003
  },
2988
3004
  }
2989
3005
  `;
2990
- await import_fs_extra2.default.writeFile((0, import_pathe5.join)(cwd, "postcss.config.cjs"), content);
3006
+ await import_fs_extra2.default.writeFile((0, import_path5.join)(cwd, "postcss.config.cjs"), content);
2991
3007
  }
2992
3008
  // Annotate the CommonJS export names for ESM import in node:
2993
3009
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -767,7 +767,7 @@ import { optimizeCss } from "@pandacss/core";
767
767
  import { ConfigNotFoundError } from "@pandacss/error";
768
768
  import { logger as logger6 } from "@pandacss/logger";
769
769
  import { existsSync, statSync } from "fs";
770
- import { normalize as normalize2, resolve as resolve3 } from "pathe";
770
+ import { normalize as normalize2, resolve as resolve3 } from "path";
771
771
 
772
772
  // src/codegen.ts
773
773
  init_esm_shims();
@@ -2212,10 +2212,9 @@ async function codegen(ctx, ids) {
2212
2212
 
2213
2213
  // src/config.ts
2214
2214
  init_esm_shims();
2215
- import { convertTsPathsToRegexes, loadConfig as loadConfig2 } from "@pandacss/config";
2216
- import { createDebugger, createHooks } from "hookable";
2217
- import { parse } from "tsconfck";
2215
+ import { loadConfig as loadConfig2 } from "@pandacss/config";
2218
2216
  import browserslist from "browserslist";
2217
+ import { createDebugger, createHooks } from "hookable";
2219
2218
 
2220
2219
  // src/create-context.ts
2221
2220
  init_esm_shims();
@@ -2239,6 +2238,8 @@ var DiffEngine = class {
2239
2238
  */
2240
2239
  async reloadConfigAndRefreshContext(fn) {
2241
2240
  const conf = await loadConfig({ cwd: this.ctx.config.cwd, file: this.ctx.conf.path });
2241
+ const { tsconfig, tsconfigFile, tsOptions } = this.ctx.conf;
2242
+ Object.assign(conf, { tsconfig, tsconfigFile, tsOptions });
2242
2243
  return this.refresh(conf, fn);
2243
2244
  }
2244
2245
  /**
@@ -2262,7 +2263,7 @@ import { logger as logger3 } from "@pandacss/logger";
2262
2263
  import chokidar from "chokidar";
2263
2264
  import glob from "fast-glob";
2264
2265
  import fsExtra from "fs-extra";
2265
- import { dirname, extname, isAbsolute, join, relative, sep, resolve } from "pathe";
2266
+ import { dirname, extname, isAbsolute, join, relative, resolve, sep } from "path";
2266
2267
  var nodeRuntime = {
2267
2268
  cwd() {
2268
2269
  return process.cwd();
@@ -2480,6 +2481,34 @@ var PandaContext = class extends Generator2 {
2480
2481
  };
2481
2482
  };
2482
2483
 
2484
+ // src/load-tsconfig.ts
2485
+ init_esm_shims();
2486
+ import { convertTsPathsToRegexes } from "@pandacss/config";
2487
+ import { parse } from "tsconfck";
2488
+ async function loadTsConfig(conf, cwd) {
2489
+ const tsconfigResult = await parse(conf.path, {
2490
+ root: cwd,
2491
+ //@ts-ignore
2492
+ resolveWithEmptyIfConfigNotFound: true
2493
+ });
2494
+ if (!tsconfigResult)
2495
+ return;
2496
+ const { tsconfig, tsconfigFile } = tsconfigResult;
2497
+ const { compilerOptions } = tsconfig;
2498
+ const result = {
2499
+ tsconfig,
2500
+ tsconfigFile
2501
+ };
2502
+ if (compilerOptions?.paths) {
2503
+ const baseUrl = compilerOptions.baseUrl;
2504
+ result.tsOptions = {
2505
+ baseUrl,
2506
+ pathMappings: convertTsPathsToRegexes(compilerOptions.paths, baseUrl ?? cwd)
2507
+ };
2508
+ }
2509
+ return result;
2510
+ }
2511
+
2483
2512
  // src/config.ts
2484
2513
  async function loadConfigAndCreateContext(options = {}) {
2485
2514
  const { config, configPath } = options;
@@ -2494,22 +2523,9 @@ async function loadConfigAndCreateContext(options = {}) {
2494
2523
  if (conf.config.lightningcss && !conf.config.browserslist) {
2495
2524
  conf.config.browserslist ||= browserslist.findConfig(cwd)?.defaults;
2496
2525
  }
2497
- const tsconfigResult = await parse(conf.path, {
2498
- root: cwd,
2499
- // @ts-ignore
2500
- resolveWithEmptyIfConfigNotFound: true
2501
- });
2502
- if (tsconfigResult) {
2503
- conf.tsconfig = tsconfigResult.tsconfig;
2504
- conf.tsconfigFile = tsconfigResult.tsconfigFile;
2505
- const options2 = tsconfigResult.tsconfig?.compilerOptions;
2506
- if (options2?.paths) {
2507
- const baseUrl = options2.baseUrl;
2508
- conf.tsOptions = {
2509
- baseUrl,
2510
- pathMappings: convertTsPathsToRegexes(options2.paths, baseUrl ?? cwd)
2511
- };
2512
- }
2526
+ const tsConfResult = await loadTsConfig(conf, cwd);
2527
+ if (tsConfResult) {
2528
+ Object.assign(conf, tsConfResult);
2513
2529
  }
2514
2530
  const hooks = createHooks();
2515
2531
  if (conf.config.hooks) {
@@ -2525,7 +2541,7 @@ async function loadConfigAndCreateContext(options = {}) {
2525
2541
  // src/parse-dependency.ts
2526
2542
  init_esm_shims();
2527
2543
  import isGlob from "is-glob";
2528
- import { resolve as resolve2, normalize } from "pathe";
2544
+ import { normalize, resolve as resolve2 } from "path";
2529
2545
 
2530
2546
  // src/parse-glob.ts
2531
2547
  init_esm_shims();
@@ -2750,7 +2766,7 @@ var cssgen = async (ctx, options) => {
2750
2766
  // src/debug.ts
2751
2767
  init_esm_shims();
2752
2768
  import { colors as colors2, logger as logger8 } from "@pandacss/logger";
2753
- import { parse as parse2 } from "pathe";
2769
+ import { parse as parse2 } from "path";
2754
2770
  async function debug(ctx, options) {
2755
2771
  const files = ctx.getFiles();
2756
2772
  const measureTotal = logger8.time.debug(`Done parsing ${files.length} files`);
@@ -2905,7 +2921,7 @@ import { logger as logger10, quote } from "@pandacss/logger";
2905
2921
  import fsExtra2 from "fs-extra";
2906
2922
  import { lookItUpSync as lookItUpSync2 } from "look-it-up";
2907
2923
  import { outdent as outdent2 } from "outdent";
2908
- import { join as join2 } from "pathe";
2924
+ import { join as join2 } from "path";
2909
2925
  import getPackageManager from "preferred-pm";
2910
2926
  import prettier from "prettier";
2911
2927
  async function setupConfig(cwd, opts = {}) {
@@ -2950,7 +2966,7 @@ jsxFramework: '${jsxFramework}',` : ""}
2950
2966
  syntax: '${syntax}'` : ""}
2951
2967
  })
2952
2968
  `;
2953
- await fsExtra2.writeFile(join2(cwd, file), prettier.format(content));
2969
+ await fsExtra2.writeFile(join2(cwd, file), prettier.format(content, { parser: "babel" }));
2954
2970
  logger10.log(messages.thankYou());
2955
2971
  }
2956
2972
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.27.1",
3
+ "version": "0.27.3",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -44,7 +44,6 @@
44
44
  "lodash.merge": "4.6.2",
45
45
  "look-it-up": "2.1.0",
46
46
  "outdent": " ^0.8.0",
47
- "pathe": "^1.1.1",
48
47
  "perfect-debounce": "^1.0.0",
49
48
  "pkg-types": "1.0.3",
50
49
  "pluralize": "8.0.0",
@@ -54,16 +53,16 @@
54
53
  "ts-morph": "19.0.0",
55
54
  "ts-pattern": "5.0.5",
56
55
  "tsconfck": "^2.1.2",
57
- "@pandacss/config": "0.27.1",
58
- "@pandacss/core": "0.27.1",
59
- "@pandacss/error": "0.27.1",
60
- "@pandacss/extractor": "0.27.1",
61
- "@pandacss/generator": "0.27.1",
62
- "@pandacss/logger": "0.27.1",
63
- "@pandacss/parser": "0.27.1",
64
- "@pandacss/shared": "0.27.1",
65
- "@pandacss/token-dictionary": "0.27.1",
66
- "@pandacss/types": "0.27.1"
56
+ "@pandacss/config": "0.27.3",
57
+ "@pandacss/core": "0.27.3",
58
+ "@pandacss/error": "0.27.3",
59
+ "@pandacss/extractor": "0.27.3",
60
+ "@pandacss/generator": "0.27.3",
61
+ "@pandacss/logger": "0.27.3",
62
+ "@pandacss/parser": "0.27.3",
63
+ "@pandacss/shared": "0.27.3",
64
+ "@pandacss/token-dictionary": "0.27.3",
65
+ "@pandacss/types": "0.27.3"
67
66
  },
68
67
  "devDependencies": {
69
68
  "@types/fs-extra": "11.0.4",