@pandacss/node 0.24.2 → 0.25.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
@@ -207,16 +207,15 @@ declare class Builder {
207
207
  private hasEmitted;
208
208
  private filesMeta;
209
209
  private affecteds;
210
+ private configDependencies;
210
211
  getConfigPath: (cwd?: string) => string;
212
+ setConfigDependencies(options: SetupContextOptions): void;
211
213
  setup: (options?: {
212
214
  configPath?: string;
213
215
  cwd?: string;
214
216
  }) => Promise<PandaContext | undefined>;
215
217
  emit(): Promise<void>;
216
- setupContext: (options: {
217
- configPath: string;
218
- cwd?: string;
219
- }) => Promise<PandaContext>;
218
+ setupContext: (options: SetupContextOptions) => Promise<PandaContext>;
220
219
  getContextOrThrow: () => PandaContext;
221
220
  getFileMeta: (file: string) => {
222
221
  mtime: number;
@@ -237,6 +236,10 @@ interface FileMeta {
237
236
  mtime: number;
238
237
  isUnchanged: boolean;
239
238
  }
239
+ interface SetupContextOptions {
240
+ configPath: string;
241
+ cwd?: string;
242
+ }
240
243
 
241
244
  declare function codegen(ctx: PandaContext, ids?: ArtifactId[]): Promise<{
242
245
  box: string;
package/dist/index.d.ts CHANGED
@@ -207,16 +207,15 @@ declare class Builder {
207
207
  private hasEmitted;
208
208
  private filesMeta;
209
209
  private affecteds;
210
+ private configDependencies;
210
211
  getConfigPath: (cwd?: string) => string;
212
+ setConfigDependencies(options: SetupContextOptions): void;
211
213
  setup: (options?: {
212
214
  configPath?: string;
213
215
  cwd?: string;
214
216
  }) => Promise<PandaContext | undefined>;
215
217
  emit(): Promise<void>;
216
- setupContext: (options: {
217
- configPath: string;
218
- cwd?: string;
219
- }) => Promise<PandaContext>;
218
+ setupContext: (options: SetupContextOptions) => Promise<PandaContext>;
220
219
  getContextOrThrow: () => PandaContext;
221
220
  getFileMeta: (file: string) => {
222
221
  mtime: number;
@@ -237,6 +236,10 @@ interface FileMeta {
237
236
  mtime: number;
238
237
  isUnchanged: boolean;
239
238
  }
239
+ interface SetupContextOptions {
240
+ configPath: string;
241
+ cwd?: string;
242
+ }
240
243
 
241
244
  declare function codegen(ctx: PandaContext, ids?: ArtifactId[]): Promise<{
242
245
  box: string;
package/dist/index.js CHANGED
@@ -864,18 +864,18 @@ function pLimit(concurrency) {
864
864
  queue.dequeue()();
865
865
  }
866
866
  };
867
- const run = async (fn, resolve3, args) => {
867
+ const run = async (fn, resolve4, args) => {
868
868
  activeCount++;
869
869
  const result = (async () => fn(...args))();
870
- resolve3(result);
870
+ resolve4(result);
871
871
  try {
872
872
  await result;
873
873
  } catch {
874
874
  }
875
875
  next();
876
876
  };
877
- const enqueue = (fn, resolve3, args) => {
878
- queue.enqueue(run.bind(void 0, fn, resolve3, args));
877
+ const enqueue = (fn, resolve4, args) => {
878
+ queue.enqueue(run.bind(void 0, fn, resolve4, args));
879
879
  (async () => {
880
880
  await Promise.resolve();
881
881
  if (activeCount < concurrency && queue.size > 0) {
@@ -883,8 +883,8 @@ function pLimit(concurrency) {
883
883
  }
884
884
  })();
885
885
  };
886
- const generator = (fn, ...args) => new Promise((resolve3) => {
887
- enqueue(fn, resolve3, args);
886
+ const generator = (fn, ...args) => new Promise((resolve4) => {
887
+ enqueue(fn, resolve4, args);
888
888
  });
889
889
  Object.defineProperties(generator, {
890
890
  activeCount: {
@@ -2580,12 +2580,13 @@ function parseDependency(fileOrGlob) {
2580
2580
  message = { type: "dependency", file: (0, import_pathe2.resolve)(fileOrGlob) };
2581
2581
  }
2582
2582
  if (message.type === "dir-dependency" && process.env.ROLLUP_WATCH === "true") {
2583
- message = { type: "dependency", file: message.dir };
2583
+ message = { type: "dependency", file: (0, import_pathe2.resolve)(message.dir) };
2584
2584
  }
2585
2585
  return message;
2586
2586
  }
2587
2587
 
2588
2588
  // src/builder.ts
2589
+ var import_pathe3 = require("pathe");
2589
2590
  var fileModifiedMap = /* @__PURE__ */ new Map();
2590
2591
  var Builder = class {
2591
2592
  /**
@@ -2595,6 +2596,7 @@ var Builder = class {
2595
2596
  hasEmitted = false;
2596
2597
  filesMeta;
2597
2598
  affecteds;
2599
+ configDependencies = /* @__PURE__ */ new Set();
2598
2600
  getConfigPath = (cwd) => {
2599
2601
  const configPath = (0, import_config3.findConfig)({ cwd });
2600
2602
  if (!configPath) {
@@ -2602,9 +2604,23 @@ var Builder = class {
2602
2604
  }
2603
2605
  return configPath;
2604
2606
  };
2607
+ setConfigDependencies(options) {
2608
+ const tsOptions = this.context?.conf.tsOptions ?? { baseUrl: void 0, pathMappings: [] };
2609
+ const compilerOptions = this.context?.conf.tsconfig?.compilerOptions ?? {};
2610
+ const { deps: foundDeps } = (0, import_config3.getConfigDependencies)(options.configPath, tsOptions, compilerOptions);
2611
+ const cwd = options?.cwd ?? this.context?.config.cwd ?? process.cwd();
2612
+ const configDeps = /* @__PURE__ */ new Set([
2613
+ ...foundDeps,
2614
+ ...(this.context?.conf.dependencies ?? []).map((file) => (0, import_pathe3.resolve)(cwd, file))
2615
+ ]);
2616
+ this.configDependencies = configDeps;
2617
+ import_logger6.logger.debug("builder", "Config dependencies");
2618
+ import_logger6.logger.debug("builder", configDeps);
2619
+ }
2605
2620
  setup = async (options = {}) => {
2606
2621
  import_logger6.logger.debug("builder", "\u{1F6A7} Setup");
2607
2622
  const configPath = options.configPath ?? this.getConfigPath(options.cwd);
2623
+ this.setConfigDependencies({ configPath, cwd: options.cwd });
2608
2624
  if (!this.context) {
2609
2625
  return this.setupContext({ configPath, cwd: options.cwd });
2610
2626
  }
@@ -2717,7 +2733,7 @@ var Builder = class {
2717
2733
  fn(dependency);
2718
2734
  }
2719
2735
  }
2720
- for (const file of ctx.conf.dependencies) {
2736
+ for (const file of this.configDependencies) {
2721
2737
  fn({ type: "dependency", file: ctx.runtime.path.resolve(file) });
2722
2738
  }
2723
2739
  };
@@ -2765,7 +2781,7 @@ var cssgen = async (ctx, options) => {
2765
2781
  // src/debug.ts
2766
2782
  init_cjs_shims();
2767
2783
  var import_logger8 = require("@pandacss/logger");
2768
- var import_pathe3 = require("pathe");
2784
+ var import_pathe4 = require("pathe");
2769
2785
  async function debug(ctx, options) {
2770
2786
  const files = ctx.getFiles();
2771
2787
  const measureTotal = import_logger8.logger.time.debug(`Done parsing ${files.length} files`);
@@ -2800,7 +2816,7 @@ async function debug(ctx, options) {
2800
2816
  }
2801
2817
  if (outdir) {
2802
2818
  filesWithCss.push(file);
2803
- const parsedPath = (0, import_pathe3.parse)(file);
2819
+ const parsedPath = (0, import_pathe4.parse)(file);
2804
2820
  const relative2 = path.relative(ctx.config.cwd, parsedPath.dir);
2805
2821
  const astJsonPath = `${relative2}/${parsedPath.name}.ast.json`.replaceAll(path.sep, "__");
2806
2822
  const cssPath = `${relative2}/${parsedPath.name}.css`.replaceAll(path.sep, "__");
@@ -2919,7 +2935,7 @@ var import_logger10 = require("@pandacss/logger");
2919
2935
  var import_fs_extra2 = __toESM(require("fs-extra"));
2920
2936
  var import_look_it_up2 = require("look-it-up");
2921
2937
  var import_outdent2 = require("outdent");
2922
- var import_pathe4 = require("pathe");
2938
+ var import_pathe5 = require("pathe");
2923
2939
  var import_preferred_pm = __toESM(require("preferred-pm"));
2924
2940
  var import_prettier = __toESM(require("prettier"));
2925
2941
  async function setupConfig(cwd, opts = {}) {
@@ -2964,7 +2980,7 @@ jsxFramework: '${jsxFramework}',` : ""}
2964
2980
  syntax: '${syntax}'` : ""}
2965
2981
  })
2966
2982
  `;
2967
- await import_fs_extra2.default.writeFile((0, import_pathe4.join)(cwd, file), import_prettier.default.format(content));
2983
+ await import_fs_extra2.default.writeFile((0, import_pathe5.join)(cwd, file), import_prettier.default.format(content));
2968
2984
  import_logger10.logger.log(import_generator3.messages.thankYou());
2969
2985
  }
2970
2986
  }
@@ -2977,7 +2993,7 @@ module.exports = {
2977
2993
  },
2978
2994
  }
2979
2995
  `;
2980
- await import_fs_extra2.default.writeFile((0, import_pathe4.join)(cwd, "postcss.config.cjs"), content);
2996
+ await import_fs_extra2.default.writeFile((0, import_pathe5.join)(cwd, "postcss.config.cjs"), content);
2981
2997
  }
2982
2998
  // Annotate the CommonJS export names for ESM import in node:
2983
2999
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -762,7 +762,7 @@ async function buildInfo(ctx, outfile) {
762
762
 
763
763
  // src/builder.ts
764
764
  init_esm_shims();
765
- import { findConfig } from "@pandacss/config";
765
+ import { findConfig, getConfigDependencies } from "@pandacss/config";
766
766
  import { optimizeCss } from "@pandacss/core";
767
767
  import { ConfigNotFoundError } from "@pandacss/error";
768
768
  import { logger as logger6 } from "@pandacss/logger";
@@ -840,18 +840,18 @@ function pLimit(concurrency) {
840
840
  queue.dequeue()();
841
841
  }
842
842
  };
843
- const run = async (fn, resolve3, args) => {
843
+ const run = async (fn, resolve4, args) => {
844
844
  activeCount++;
845
845
  const result = (async () => fn(...args))();
846
- resolve3(result);
846
+ resolve4(result);
847
847
  try {
848
848
  await result;
849
849
  } catch {
850
850
  }
851
851
  next();
852
852
  };
853
- const enqueue = (fn, resolve3, args) => {
854
- queue.enqueue(run.bind(void 0, fn, resolve3, args));
853
+ const enqueue = (fn, resolve4, args) => {
854
+ queue.enqueue(run.bind(void 0, fn, resolve4, args));
855
855
  (async () => {
856
856
  await Promise.resolve();
857
857
  if (activeCount < concurrency && queue.size > 0) {
@@ -859,8 +859,8 @@ function pLimit(concurrency) {
859
859
  }
860
860
  })();
861
861
  };
862
- const generator = (fn, ...args) => new Promise((resolve3) => {
863
- enqueue(fn, resolve3, args);
862
+ const generator = (fn, ...args) => new Promise((resolve4) => {
863
+ enqueue(fn, resolve4, args);
864
864
  });
865
865
  Object.defineProperties(generator, {
866
866
  activeCount: {
@@ -2556,12 +2556,13 @@ function parseDependency(fileOrGlob) {
2556
2556
  message = { type: "dependency", file: resolve2(fileOrGlob) };
2557
2557
  }
2558
2558
  if (message.type === "dir-dependency" && process.env.ROLLUP_WATCH === "true") {
2559
- message = { type: "dependency", file: message.dir };
2559
+ message = { type: "dependency", file: resolve2(message.dir) };
2560
2560
  }
2561
2561
  return message;
2562
2562
  }
2563
2563
 
2564
2564
  // src/builder.ts
2565
+ import { resolve as resolve3 } from "pathe";
2565
2566
  var fileModifiedMap = /* @__PURE__ */ new Map();
2566
2567
  var Builder = class {
2567
2568
  /**
@@ -2571,6 +2572,7 @@ var Builder = class {
2571
2572
  hasEmitted = false;
2572
2573
  filesMeta;
2573
2574
  affecteds;
2575
+ configDependencies = /* @__PURE__ */ new Set();
2574
2576
  getConfigPath = (cwd) => {
2575
2577
  const configPath = findConfig({ cwd });
2576
2578
  if (!configPath) {
@@ -2578,9 +2580,23 @@ var Builder = class {
2578
2580
  }
2579
2581
  return configPath;
2580
2582
  };
2583
+ setConfigDependencies(options) {
2584
+ const tsOptions = this.context?.conf.tsOptions ?? { baseUrl: void 0, pathMappings: [] };
2585
+ const compilerOptions = this.context?.conf.tsconfig?.compilerOptions ?? {};
2586
+ const { deps: foundDeps } = getConfigDependencies(options.configPath, tsOptions, compilerOptions);
2587
+ const cwd = options?.cwd ?? this.context?.config.cwd ?? process.cwd();
2588
+ const configDeps = /* @__PURE__ */ new Set([
2589
+ ...foundDeps,
2590
+ ...(this.context?.conf.dependencies ?? []).map((file) => resolve3(cwd, file))
2591
+ ]);
2592
+ this.configDependencies = configDeps;
2593
+ logger6.debug("builder", "Config dependencies");
2594
+ logger6.debug("builder", configDeps);
2595
+ }
2581
2596
  setup = async (options = {}) => {
2582
2597
  logger6.debug("builder", "\u{1F6A7} Setup");
2583
2598
  const configPath = options.configPath ?? this.getConfigPath(options.cwd);
2599
+ this.setConfigDependencies({ configPath, cwd: options.cwd });
2584
2600
  if (!this.context) {
2585
2601
  return this.setupContext({ configPath, cwd: options.cwd });
2586
2602
  }
@@ -2693,7 +2709,7 @@ var Builder = class {
2693
2709
  fn(dependency);
2694
2710
  }
2695
2711
  }
2696
- for (const file of ctx.conf.dependencies) {
2712
+ for (const file of this.configDependencies) {
2697
2713
  fn({ type: "dependency", file: ctx.runtime.path.resolve(file) });
2698
2714
  }
2699
2715
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
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.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"
56
+ "@pandacss/config": "0.25.0",
57
+ "@pandacss/core": "0.25.0",
58
+ "@pandacss/error": "0.25.0",
59
+ "@pandacss/generator": "0.25.0",
60
+ "@pandacss/parser": "0.25.0",
61
+ "@pandacss/extractor": "0.25.0",
62
+ "@pandacss/shared": "0.25.0",
63
+ "@pandacss/logger": "0.25.0",
64
+ "@pandacss/types": "0.25.0",
65
+ "@pandacss/token-dictionary": "0.25.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/fs-extra": "11.0.4",