@pandacss/node 0.0.0-dev-20231024143230 → 0.0.0-dev-20231025145522

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
@@ -188,14 +188,17 @@ declare class Builder {
188
188
  * The current panda context
189
189
  */
190
190
  context: PandaContext | undefined;
191
+ hasEmitted: boolean;
191
192
  configDependencies: Set<string>;
192
193
  writeFileCss: (file: string, css: string) => void;
193
194
  checkConfigDeps: (configPath: string, deps: Set<string>) => ConfigDepsResult;
194
195
  getConfigPath: () => string;
196
+ hasConfigChanged: boolean;
195
197
  setup: (options?: {
196
198
  configPath?: string;
197
199
  cwd?: string;
198
200
  }) => Promise<void>;
201
+ emit(): void;
199
202
  setupContext: (options: {
200
203
  configPath: string;
201
204
  depsModifiedMap: Map<string, number>;
package/dist/index.d.ts CHANGED
@@ -188,14 +188,17 @@ declare class Builder {
188
188
  * The current panda context
189
189
  */
190
190
  context: PandaContext | undefined;
191
+ hasEmitted: boolean;
191
192
  configDependencies: Set<string>;
192
193
  writeFileCss: (file: string, css: string) => void;
193
194
  checkConfigDeps: (configPath: string, deps: Set<string>) => ConfigDepsResult;
194
195
  getConfigPath: () => string;
196
+ hasConfigChanged: boolean;
195
197
  setup: (options?: {
196
198
  configPath?: string;
197
199
  cwd?: string;
198
200
  }) => Promise<void>;
201
+ emit(): void;
199
202
  setupContext: (options: {
200
203
  configPath: string;
201
204
  depsModifiedMap: Map<string, number>;
package/dist/index.js CHANGED
@@ -2598,12 +2598,12 @@ function parseDependency(fileOrGlob) {
2598
2598
  var configCache = /* @__PURE__ */ new Map();
2599
2599
  var contentFilesCache = /* @__PURE__ */ new WeakMap();
2600
2600
  var limit2 = pLimit(20);
2601
- var setupCount = 0;
2602
2601
  var Builder = class {
2603
2602
  /**
2604
2603
  * The current panda context
2605
2604
  */
2606
2605
  context;
2606
+ hasEmitted = false;
2607
2607
  configDependencies = /* @__PURE__ */ new Set();
2608
2608
  writeFileCss = (file, css) => {
2609
2609
  const oldCss = this.fileCssMap?.get(file) ?? "";
@@ -2630,9 +2630,6 @@ var Builder = class {
2630
2630
  for (const file of deps) {
2631
2631
  delete require.cache[file];
2632
2632
  }
2633
- if (setupCount > 0) {
2634
- import_logger5.logger.debug("builder", "\u2699\uFE0F Config changed, reloading");
2635
- }
2636
2633
  return { isModified: true, modifiedMap: newModified };
2637
2634
  };
2638
2635
  getConfigPath = () => {
@@ -2642,6 +2639,7 @@ var Builder = class {
2642
2639
  }
2643
2640
  return configPath;
2644
2641
  };
2642
+ hasConfigChanged = false;
2645
2643
  setup = async (options = {}) => {
2646
2644
  import_logger5.logger.debug("builder", "\u{1F6A7} Setup");
2647
2645
  const configPath = options.configPath ?? this.getConfigPath();
@@ -2652,12 +2650,14 @@ var Builder = class {
2652
2650
  const configDeps = /* @__PURE__ */ new Set([...foundDeps, ...(this.context?.dependencies ?? []).map((file) => (0, import_path2.resolve)(cwd, file))]);
2653
2651
  this.configDependencies = configDeps;
2654
2652
  const deps = this.checkConfigDeps(configPath, configDeps);
2653
+ this.hasConfigChanged = deps.isModified;
2655
2654
  if (deps.isModified) {
2656
2655
  await this.setupContext({
2657
2656
  configPath,
2658
2657
  depsModifiedMap: deps.modifiedMap
2659
2658
  });
2660
- const ctx = this.context;
2659
+ const ctx = this.getContextOrThrow();
2660
+ import_logger5.logger.debug("builder", "\u2699\uFE0F Config changed, reloading");
2661
2661
  await ctx.hooks.callHook("config:change", ctx.config);
2662
2662
  }
2663
2663
  const cache = configCache.get(configPath);
@@ -2670,14 +2670,16 @@ var Builder = class {
2670
2670
  depsModifiedMap: deps.modifiedMap
2671
2671
  });
2672
2672
  }
2673
- setupCount++;
2674
2673
  };
2674
+ emit() {
2675
+ if (this.hasEmitted && this.hasConfigChanged) {
2676
+ emitArtifacts(this.getContextOrThrow());
2677
+ }
2678
+ this.hasEmitted = true;
2679
+ }
2675
2680
  setupContext = async (options) => {
2676
2681
  const { configPath, depsModifiedMap } = options;
2677
2682
  this.context = await loadConfigAndCreateContext({ configPath });
2678
- if (setupCount > 0) {
2679
- emitArtifacts(this.context);
2680
- }
2681
2683
  configCache.set(configPath, {
2682
2684
  context: this.context,
2683
2685
  deps: new Set(this.context.dependencies ?? []),
package/dist/index.mjs CHANGED
@@ -2583,12 +2583,12 @@ function parseDependency(fileOrGlob) {
2583
2583
  var configCache = /* @__PURE__ */ new Map();
2584
2584
  var contentFilesCache = /* @__PURE__ */ new WeakMap();
2585
2585
  var limit2 = pLimit(20);
2586
- var setupCount = 0;
2587
2586
  var Builder = class {
2588
2587
  /**
2589
2588
  * The current panda context
2590
2589
  */
2591
2590
  context;
2591
+ hasEmitted = false;
2592
2592
  configDependencies = /* @__PURE__ */ new Set();
2593
2593
  writeFileCss = (file, css) => {
2594
2594
  const oldCss = this.fileCssMap?.get(file) ?? "";
@@ -2615,9 +2615,6 @@ var Builder = class {
2615
2615
  for (const file of deps) {
2616
2616
  delete __require.cache[file];
2617
2617
  }
2618
- if (setupCount > 0) {
2619
- logger5.debug("builder", "\u2699\uFE0F Config changed, reloading");
2620
- }
2621
2618
  return { isModified: true, modifiedMap: newModified };
2622
2619
  };
2623
2620
  getConfigPath = () => {
@@ -2627,6 +2624,7 @@ var Builder = class {
2627
2624
  }
2628
2625
  return configPath;
2629
2626
  };
2627
+ hasConfigChanged = false;
2630
2628
  setup = async (options = {}) => {
2631
2629
  logger5.debug("builder", "\u{1F6A7} Setup");
2632
2630
  const configPath = options.configPath ?? this.getConfigPath();
@@ -2637,12 +2635,14 @@ var Builder = class {
2637
2635
  const configDeps = /* @__PURE__ */ new Set([...foundDeps, ...(this.context?.dependencies ?? []).map((file) => resolve2(cwd, file))]);
2638
2636
  this.configDependencies = configDeps;
2639
2637
  const deps = this.checkConfigDeps(configPath, configDeps);
2638
+ this.hasConfigChanged = deps.isModified;
2640
2639
  if (deps.isModified) {
2641
2640
  await this.setupContext({
2642
2641
  configPath,
2643
2642
  depsModifiedMap: deps.modifiedMap
2644
2643
  });
2645
- const ctx = this.context;
2644
+ const ctx = this.getContextOrThrow();
2645
+ logger5.debug("builder", "\u2699\uFE0F Config changed, reloading");
2646
2646
  await ctx.hooks.callHook("config:change", ctx.config);
2647
2647
  }
2648
2648
  const cache = configCache.get(configPath);
@@ -2655,14 +2655,16 @@ var Builder = class {
2655
2655
  depsModifiedMap: deps.modifiedMap
2656
2656
  });
2657
2657
  }
2658
- setupCount++;
2659
2658
  };
2659
+ emit() {
2660
+ if (this.hasEmitted && this.hasConfigChanged) {
2661
+ emitArtifacts(this.getContextOrThrow());
2662
+ }
2663
+ this.hasEmitted = true;
2664
+ }
2660
2665
  setupContext = async (options) => {
2661
2666
  const { configPath, depsModifiedMap } = options;
2662
2667
  this.context = await loadConfigAndCreateContext({ configPath });
2663
- if (setupCount > 0) {
2664
- emitArtifacts(this.context);
2665
- }
2666
2668
  configCache.set(configPath, {
2667
2669
  context: this.context,
2668
2670
  deps: new Set(this.context.dependencies ?? []),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.0.0-dev-20231024143230",
3
+ "version": "0.0.0-dev-20231025145522",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,17 +34,17 @@
34
34
  "ts-morph": "19.0.0",
35
35
  "ts-pattern": "5.0.5",
36
36
  "tsconfck": "^2.1.2",
37
- "@pandacss/config": "0.0.0-dev-20231024143230",
38
- "@pandacss/core": "0.0.0-dev-20231024143230",
39
- "@pandacss/error": "0.0.0-dev-20231024143230",
40
- "@pandacss/extractor": "0.0.0-dev-20231024143230",
41
- "@pandacss/generator": "0.0.0-dev-20231024143230",
42
- "@pandacss/is-valid-prop": "0.0.0-dev-20231024143230",
43
- "@pandacss/logger": "0.0.0-dev-20231024143230",
44
- "@pandacss/parser": "0.0.0-dev-20231024143230",
45
- "@pandacss/shared": "0.0.0-dev-20231024143230",
46
- "@pandacss/token-dictionary": "0.0.0-dev-20231024143230",
47
- "@pandacss/types": "0.0.0-dev-20231024143230"
37
+ "@pandacss/config": "0.0.0-dev-20231025145522",
38
+ "@pandacss/core": "0.0.0-dev-20231025145522",
39
+ "@pandacss/error": "0.0.0-dev-20231025145522",
40
+ "@pandacss/extractor": "0.0.0-dev-20231025145522",
41
+ "@pandacss/generator": "0.0.0-dev-20231025145522",
42
+ "@pandacss/is-valid-prop": "0.0.0-dev-20231025145522",
43
+ "@pandacss/logger": "0.0.0-dev-20231025145522",
44
+ "@pandacss/parser": "0.0.0-dev-20231025145522",
45
+ "@pandacss/shared": "0.0.0-dev-20231025145522",
46
+ "@pandacss/token-dictionary": "0.0.0-dev-20231025145522",
47
+ "@pandacss/types": "0.0.0-dev-20231025145522"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/fs-extra": "11.0.3",
@@ -54,7 +54,7 @@
54
54
  "@types/pluralize": "0.0.30",
55
55
  "boxen": "^7.1.1",
56
56
  "p-limit": "^4.0.0",
57
- "@pandacss/fixture": "0.0.0-dev-20231024143230"
57
+ "@pandacss/fixture": "0.0.0-dev-20231025145522"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",