@pandacss/node 0.0.0-dev-20240122204655 → 0.0.0-dev-20240122224953

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
@@ -1,5 +1,5 @@
1
1
  import * as _pandacss_types from '@pandacss/types';
2
- import { LoadConfigResult, Artifact, Runtime, PandaHookable, ConfigResultWithHooks, WatchOptions, WatcherEventType, ParserResultInterface, ArtifactId, Config, CssArtifactType } from '@pandacss/types';
2
+ import { LoadConfigResult, Artifact, Runtime, PandaHooks, WatchOptions, WatcherEventType, ParserResultInterface, ArtifactId, Config, CssArtifactType } from '@pandacss/types';
3
3
  import { StyleEncoder, Stylesheet } from '@pandacss/core';
4
4
  import { Generator } from '@pandacss/generator';
5
5
  import * as _pandacss_parser from '@pandacss/parser';
@@ -25,7 +25,7 @@ declare class DiffEngine {
25
25
 
26
26
  interface OutputEngineOptions extends Generator {
27
27
  runtime: Runtime;
28
- hooks: PandaHookable;
28
+ hooks: Partial<PandaHooks>;
29
29
  }
30
30
  declare class OutputEngine {
31
31
  private paths;
@@ -42,7 +42,7 @@ declare class PandaContext extends Generator {
42
42
  project: Project;
43
43
  output: OutputEngine;
44
44
  diff: DiffEngine;
45
- constructor(conf: ConfigResultWithHooks);
45
+ constructor(conf: LoadConfigResult);
46
46
  getFiles: () => string[];
47
47
  parseFile: (filePath: string, styleEncoder?: StyleEncoder) => ParserResult | undefined;
48
48
  parseFiles: (styleEncoder?: StyleEncoder) => {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _pandacss_types from '@pandacss/types';
2
- import { LoadConfigResult, Artifact, Runtime, PandaHookable, ConfigResultWithHooks, WatchOptions, WatcherEventType, ParserResultInterface, ArtifactId, Config, CssArtifactType } from '@pandacss/types';
2
+ import { LoadConfigResult, Artifact, Runtime, PandaHooks, WatchOptions, WatcherEventType, ParserResultInterface, ArtifactId, Config, CssArtifactType } from '@pandacss/types';
3
3
  import { StyleEncoder, Stylesheet } from '@pandacss/core';
4
4
  import { Generator } from '@pandacss/generator';
5
5
  import * as _pandacss_parser from '@pandacss/parser';
@@ -25,7 +25,7 @@ declare class DiffEngine {
25
25
 
26
26
  interface OutputEngineOptions extends Generator {
27
27
  runtime: Runtime;
28
- hooks: PandaHookable;
28
+ hooks: Partial<PandaHooks>;
29
29
  }
30
30
  declare class OutputEngine {
31
31
  private paths;
@@ -42,7 +42,7 @@ declare class PandaContext extends Generator {
42
42
  project: Project;
43
43
  output: OutputEngine;
44
44
  diff: DiffEngine;
45
- constructor(conf: ConfigResultWithHooks);
45
+ constructor(conf: LoadConfigResult);
46
46
  getFiles: () => string[];
47
47
  parseFile: (filePath: string, styleEncoder?: StyleEncoder) => ParserResult | undefined;
48
48
  parseFiles: (styleEncoder?: StyleEncoder) => {
package/dist/index.js CHANGED
@@ -2225,7 +2225,7 @@ async function codegen(ctx, ids) {
2225
2225
  ctx.output.empty();
2226
2226
  const promises = ctx.getArtifacts(ids).map((artifact) => limit(() => ctx.output.write(artifact)));
2227
2227
  await Promise.allSettled(promises);
2228
- void ctx.hooks.callHook("generator:done");
2228
+ await ctx.hooks["codegen:done"]?.();
2229
2229
  return {
2230
2230
  box: createBox({
2231
2231
  content: ctx.messages.codegenComplete(),
@@ -2239,7 +2239,6 @@ async function codegen(ctx, ids) {
2239
2239
  init_cjs_shims();
2240
2240
  var import_config3 = require("@pandacss/config");
2241
2241
  var import_browserslist = __toESM(require("browserslist"));
2242
- var import_hookable = require("hookable");
2243
2242
 
2244
2243
  // src/create-context.ts
2245
2244
  init_cjs_shims();
@@ -2552,15 +2551,7 @@ async function loadConfigAndCreateContext(options = {}) {
2552
2551
  if (tsConfResult) {
2553
2552
  Object.assign(conf, tsConfResult);
2554
2553
  }
2555
- const hooks = (0, import_hookable.createHooks)();
2556
- if (conf.config.hooks) {
2557
- hooks.addHooks(conf.config.hooks);
2558
- }
2559
- await hooks.callHook("config:resolved", conf);
2560
- if (conf.config.logLevel === "debug") {
2561
- (0, import_hookable.createDebugger)(hooks, { tag: "panda" });
2562
- }
2563
- return new PandaContext({ ...conf, hooks });
2554
+ return new PandaContext(conf);
2564
2555
  }
2565
2556
 
2566
2557
  // src/parse-dependency.ts
@@ -2647,12 +2638,12 @@ var Builder = class {
2647
2638
  }
2648
2639
  const ctx = this.getContextOrThrow();
2649
2640
  this.affecteds = await ctx.diff.reloadConfigAndRefreshContext((conf) => {
2650
- this.context = new PandaContext({ ...conf, hooks: ctx.hooks });
2641
+ this.context = new PandaContext(conf);
2651
2642
  });
2652
2643
  import_logger6.logger.debug("builder", this.affecteds);
2653
2644
  if (this.affecteds.hasConfigChanged) {
2654
2645
  import_logger6.logger.debug("builder", "\u2699\uFE0F Config changed, reloading");
2655
- await ctx.hooks.callHook("config:change", ctx.config);
2646
+ await ctx.hooks["config:change"]?.({ config: ctx.config });
2656
2647
  return;
2657
2648
  }
2658
2649
  this.filesMeta = this.checkFilesChanged(ctx.getFiles());
@@ -2847,7 +2838,7 @@ async function debug(ctx, options) {
2847
2838
  if (!result || result.isEmpty() || encoder.isEmpty())
2848
2839
  return;
2849
2840
  const styles4 = ctx.decoder.clone().collect(encoder);
2850
- const css = ctx.getParserCss(styles4, file);
2841
+ const css = ctx.getParserCss(styles4);
2851
2842
  if (!css)
2852
2843
  return;
2853
2844
  if (options.dry) {
@@ -2901,14 +2892,14 @@ async function generate(config, configPath) {
2901
2892
  const configWatcher = fs2.watch({ include: ctx.conf.dependencies });
2902
2893
  configWatcher.on("change", async () => {
2903
2894
  const affecteds = await ctx.diff.reloadConfigAndRefreshContext((conf) => {
2904
- ctx = new PandaContext({ ...conf, hooks: ctx.hooks });
2895
+ ctx = new PandaContext(conf);
2905
2896
  });
2906
2897
  if (!affecteds.hasConfigChanged) {
2907
2898
  import_logger10.logger.debug("builder", "Config didnt change, skipping rebuild");
2908
2899
  return;
2909
2900
  }
2910
2901
  import_logger10.logger.info("config:change", "Config changed, restarting...");
2911
- await ctx.hooks.callHook("config:change", ctx.config);
2902
+ await ctx.hooks["config:change"]?.({ config: ctx.config });
2912
2903
  return build(ctx, Array.from(affecteds.artifacts));
2913
2904
  });
2914
2905
  const contentWatcher = fs2.watch(ctx.config);
package/dist/index.mjs CHANGED
@@ -2200,7 +2200,7 @@ async function codegen(ctx, ids) {
2200
2200
  ctx.output.empty();
2201
2201
  const promises = ctx.getArtifacts(ids).map((artifact) => limit(() => ctx.output.write(artifact)));
2202
2202
  await Promise.allSettled(promises);
2203
- void ctx.hooks.callHook("generator:done");
2203
+ await ctx.hooks["codegen:done"]?.();
2204
2204
  return {
2205
2205
  box: createBox({
2206
2206
  content: ctx.messages.codegenComplete(),
@@ -2214,7 +2214,6 @@ async function codegen(ctx, ids) {
2214
2214
  init_esm_shims();
2215
2215
  import { loadConfig as loadConfig2 } from "@pandacss/config";
2216
2216
  import browserslist from "browserslist";
2217
- import { createDebugger, createHooks } from "hookable";
2218
2217
 
2219
2218
  // src/create-context.ts
2220
2219
  init_esm_shims();
@@ -2527,15 +2526,7 @@ async function loadConfigAndCreateContext(options = {}) {
2527
2526
  if (tsConfResult) {
2528
2527
  Object.assign(conf, tsConfResult);
2529
2528
  }
2530
- const hooks = createHooks();
2531
- if (conf.config.hooks) {
2532
- hooks.addHooks(conf.config.hooks);
2533
- }
2534
- await hooks.callHook("config:resolved", conf);
2535
- if (conf.config.logLevel === "debug") {
2536
- createDebugger(hooks, { tag: "panda" });
2537
- }
2538
- return new PandaContext({ ...conf, hooks });
2529
+ return new PandaContext(conf);
2539
2530
  }
2540
2531
 
2541
2532
  // src/parse-dependency.ts
@@ -2622,12 +2613,12 @@ var Builder = class {
2622
2613
  }
2623
2614
  const ctx = this.getContextOrThrow();
2624
2615
  this.affecteds = await ctx.diff.reloadConfigAndRefreshContext((conf) => {
2625
- this.context = new PandaContext({ ...conf, hooks: ctx.hooks });
2616
+ this.context = new PandaContext(conf);
2626
2617
  });
2627
2618
  logger6.debug("builder", this.affecteds);
2628
2619
  if (this.affecteds.hasConfigChanged) {
2629
2620
  logger6.debug("builder", "\u2699\uFE0F Config changed, reloading");
2630
- await ctx.hooks.callHook("config:change", ctx.config);
2621
+ await ctx.hooks["config:change"]?.({ config: ctx.config });
2631
2622
  return;
2632
2623
  }
2633
2624
  this.filesMeta = this.checkFilesChanged(ctx.getFiles());
@@ -2822,7 +2813,7 @@ async function debug(ctx, options) {
2822
2813
  if (!result || result.isEmpty() || encoder.isEmpty())
2823
2814
  return;
2824
2815
  const styles4 = ctx.decoder.clone().collect(encoder);
2825
- const css = ctx.getParserCss(styles4, file);
2816
+ const css = ctx.getParserCss(styles4);
2826
2817
  if (!css)
2827
2818
  return;
2828
2819
  if (options.dry) {
@@ -2876,14 +2867,14 @@ async function generate(config, configPath) {
2876
2867
  const configWatcher = fs2.watch({ include: ctx.conf.dependencies });
2877
2868
  configWatcher.on("change", async () => {
2878
2869
  const affecteds = await ctx.diff.reloadConfigAndRefreshContext((conf) => {
2879
- ctx = new PandaContext({ ...conf, hooks: ctx.hooks });
2870
+ ctx = new PandaContext(conf);
2880
2871
  });
2881
2872
  if (!affecteds.hasConfigChanged) {
2882
2873
  logger10.debug("builder", "Config didnt change, skipping rebuild");
2883
2874
  return;
2884
2875
  }
2885
2876
  logger10.info("config:change", "Config changed, restarting...");
2886
- await ctx.hooks.callHook("config:change", ctx.config);
2877
+ await ctx.hooks["config:change"]?.({ config: ctx.config });
2887
2878
  return build(ctx, Array.from(affecteds.artifacts));
2888
2879
  });
2889
2880
  const contentWatcher = fs2.watch(ctx.config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/node",
3
- "version": "0.0.0-dev-20240122204655",
3
+ "version": "0.0.0-dev-20240122224953",
4
4
  "description": "The core css panda library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -39,7 +39,6 @@
39
39
  "filesize": "^10.0.8",
40
40
  "fs-extra": "11.1.1",
41
41
  "glob-parent": "^6.0.2",
42
- "hookable": "5.5.3",
43
42
  "is-glob": "^4.0.3",
44
43
  "lodash.merge": "4.6.2",
45
44
  "look-it-up": "2.1.0",
@@ -54,16 +53,16 @@
54
53
  "ts-pattern": "5.0.5",
55
54
  "tsconfck": "^2.1.2",
56
55
  "v8-profiler-next": "^1.10.0",
57
- "@pandacss/config": "0.0.0-dev-20240122204655",
58
- "@pandacss/core": "0.0.0-dev-20240122204655",
59
- "@pandacss/error": "0.0.0-dev-20240122204655",
60
- "@pandacss/extractor": "0.0.0-dev-20240122204655",
61
- "@pandacss/generator": "0.0.0-dev-20240122204655",
62
- "@pandacss/logger": "0.0.0-dev-20240122204655",
63
- "@pandacss/parser": "0.0.0-dev-20240122204655",
64
- "@pandacss/shared": "0.0.0-dev-20240122204655",
65
- "@pandacss/token-dictionary": "0.0.0-dev-20240122204655",
66
- "@pandacss/types": "0.0.0-dev-20240122204655"
56
+ "@pandacss/config": "0.0.0-dev-20240122224953",
57
+ "@pandacss/core": "0.0.0-dev-20240122224953",
58
+ "@pandacss/error": "0.0.0-dev-20240122224953",
59
+ "@pandacss/extractor": "0.0.0-dev-20240122224953",
60
+ "@pandacss/generator": "0.0.0-dev-20240122224953",
61
+ "@pandacss/logger": "0.0.0-dev-20240122224953",
62
+ "@pandacss/parser": "0.0.0-dev-20240122224953",
63
+ "@pandacss/shared": "0.0.0-dev-20240122224953",
64
+ "@pandacss/token-dictionary": "0.0.0-dev-20240122224953",
65
+ "@pandacss/types": "0.0.0-dev-20240122224953"
67
66
  },
68
67
  "devDependencies": {
69
68
  "@types/fs-extra": "11.0.4",