@pandacss/node 0.27.2 → 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 +42 -26
  2. package/dist/index.mjs +36 -20
  3. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -786,7 +786,7 @@ 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");
@@ -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
  /**
@@ -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) {
@@ -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,7 +2627,7 @@ 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,
@@ -2923,7 +2939,7 @@ 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"));
@@ -2934,7 +2950,7 @@ 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_path5.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
  }
package/dist/index.mjs CHANGED
@@ -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
  /**
@@ -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) {
@@ -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.2",
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",
@@ -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.27.2",
57
- "@pandacss/core": "0.27.2",
58
- "@pandacss/error": "0.27.2",
59
- "@pandacss/extractor": "0.27.2",
60
- "@pandacss/generator": "0.27.2",
61
- "@pandacss/logger": "0.27.2",
62
- "@pandacss/parser": "0.27.2",
63
- "@pandacss/shared": "0.27.2",
64
- "@pandacss/token-dictionary": "0.27.2",
65
- "@pandacss/types": "0.27.2"
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"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/fs-extra": "11.0.4",