@pandacss/config 0.0.0-dev-20240205145159 → 0.0.0-dev-20240205145307

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.
@@ -2,6 +2,7 @@
2
2
  import { mergeAndConcat } from "merge-anything";
3
3
 
4
4
  // src/utils.ts
5
+ import { traverse } from "@pandacss/shared";
5
6
  var isObject = (v) => Object.prototype.toString.call(v) === "[object Object]";
6
7
  function mergeWith(target, ...sources) {
7
8
  const customizer = sources.pop();
@@ -31,6 +32,19 @@ function assign(target, ...sources) {
31
32
  }
32
33
  return target;
33
34
  }
35
+ var omit = (obj, paths) => {
36
+ const result = { ...obj };
37
+ traverse(obj, ({ path, parent, key }) => {
38
+ if (paths.includes(path)) {
39
+ delete parent[key];
40
+ }
41
+ });
42
+ return result;
43
+ };
44
+ var utils = {
45
+ omit,
46
+ traverse
47
+ };
34
48
 
35
49
  // src/merge-config.ts
36
50
  function getExtends(items) {
@@ -88,5 +102,6 @@ function mergeConfigs(configs) {
88
102
  }
89
103
 
90
104
  export {
105
+ utils,
91
106
  mergeConfigs
92
107
  };
package/dist/index.js CHANGED
@@ -376,6 +376,7 @@ function getConfigDependencies(filePath, tsOptions = { pathMappings: [] }, compi
376
376
  var import_merge_anything = require("merge-anything");
377
377
 
378
378
  // src/utils.ts
379
+ var import_shared4 = require("@pandacss/shared");
379
380
  var isObject = (v) => Object.prototype.toString.call(v) === "[object Object]";
380
381
  function mergeWith(target, ...sources) {
381
382
  const customizer = sources.pop();
@@ -405,6 +406,19 @@ function assign(target, ...sources) {
405
406
  }
406
407
  return target;
407
408
  }
409
+ var omit = (obj, paths) => {
410
+ const result = { ...obj };
411
+ (0, import_shared4.traverse)(obj, ({ path: path2, parent, key }) => {
412
+ if (paths.includes(path2)) {
413
+ delete parent[key];
414
+ }
415
+ });
416
+ return result;
417
+ };
418
+ var utils = {
419
+ omit,
420
+ traverse: import_shared4.traverse
421
+ };
408
422
 
409
423
  // src/merge-config.ts
410
424
  function getExtends(items) {
@@ -481,7 +495,7 @@ async function getResolvedConfig(config, cwd) {
481
495
  }
482
496
 
483
497
  // src/resolve-config.ts
484
- var import_shared7 = require("@pandacss/shared");
498
+ var import_shared8 = require("@pandacss/shared");
485
499
 
486
500
  // src/bundled-preset.ts
487
501
  var import_preset_base = require("@pandacss/preset-base");
@@ -499,7 +513,7 @@ var getBundledPreset = (preset) => {
499
513
 
500
514
  // src/validate-config.ts
501
515
  var import_logger2 = require("@pandacss/logger");
502
- var import_shared6 = require("@pandacss/shared");
516
+ var import_shared7 = require("@pandacss/shared");
503
517
 
504
518
  // src/validation/validate-artifact.ts
505
519
  var validateArtifactNames = (names, addError) => {
@@ -519,14 +533,14 @@ var validateArtifactNames = (names, addError) => {
519
533
  };
520
534
 
521
535
  // src/validation/validate-breakpoints.ts
522
- var import_shared4 = require("@pandacss/shared");
536
+ var import_shared5 = require("@pandacss/shared");
523
537
  var validateBreakpoints = (breakpoints, addError) => {
524
538
  if (!breakpoints)
525
539
  return;
526
540
  const units = /* @__PURE__ */ new Set();
527
541
  const values = Object.values(breakpoints);
528
542
  for (const value of values) {
529
- const unit = (0, import_shared4.getUnit)(value) ?? "px";
543
+ const unit = (0, import_shared5.getUnit)(value) ?? "px";
530
544
  units.add(unit);
531
545
  }
532
546
  if (units.size > 1) {
@@ -576,7 +590,7 @@ var validateRecipes = (options) => {
576
590
  };
577
591
 
578
592
  // src/validation/validate-tokens.ts
579
- var import_shared5 = require("@pandacss/shared");
593
+ var import_shared6 = require("@pandacss/shared");
580
594
 
581
595
  // src/validation/get-final-paths.ts
582
596
  var getFinalPaths = (paths) => {
@@ -628,7 +642,7 @@ var validateTokens = (options) => {
628
642
  return;
629
643
  const { tokenNames, semanticTokenNames, valueAtPath, refsByPath } = tokens2;
630
644
  if (theme.tokens) {
631
- (0, import_shared5.traverse)(theme.tokens, (node) => {
645
+ (0, import_shared6.traverse)(theme.tokens, (node) => {
632
646
  if (node.depth >= 1) {
633
647
  tokenNames.add(node.path);
634
648
  valueAtPath.set(node.path, node.value);
@@ -646,7 +660,7 @@ var validateTokens = (options) => {
646
660
  });
647
661
  }
648
662
  if (theme.semanticTokens) {
649
- (0, import_shared5.traverse)(theme.semanticTokens, (node) => {
663
+ (0, import_shared6.traverse)(theme.semanticTokens, (node) => {
650
664
  if (node.depth >= 1) {
651
665
  semanticTokenNames.add(node.path);
652
666
  valueAtPath.set(node.path, node.value);
@@ -680,7 +694,7 @@ var validateConfig = (config) => {
680
694
  if (config.validation === "warn") {
681
695
  warnings.add(`[${scope}]: ` + message);
682
696
  } else {
683
- throw new import_shared6.PandaError("CONFIG_ERROR", `[${scope}]: ` + message);
697
+ throw new import_shared7.PandaError("CONFIG_ERROR", `[${scope}]: ` + message);
684
698
  }
685
699
  };
686
700
  validateBreakpoints(config.theme?.breakpoints, addError);
@@ -734,13 +748,19 @@ async function resolveConfig(result, cwd) {
734
748
  ...result,
735
749
  config
736
750
  };
737
- await hooks["config:resolved"]?.({
738
- config: loadConfigResult.config,
739
- path: loadConfigResult.path,
740
- dependencies: loadConfigResult.dependencies
741
- });
742
- const serialized = (0, import_shared7.stringifyJson)(loadConfigResult.config);
743
- const deserialize = () => (0, import_shared7.parseJson)(serialized);
751
+ if (hooks["config:resolved"]) {
752
+ const result2 = await hooks["config:resolved"]({
753
+ config: loadConfigResult.config,
754
+ path: loadConfigResult.path,
755
+ dependencies: loadConfigResult.dependencies,
756
+ utils
757
+ });
758
+ if (result2) {
759
+ loadConfigResult.config = result2;
760
+ }
761
+ }
762
+ const serialized = (0, import_shared8.stringifyJson)(loadConfigResult.config);
763
+ const deserialize = () => (0, import_shared8.parseJson)(serialized);
744
764
  return { ...loadConfigResult, serialized, deserialize, hooks };
745
765
  }
746
766
 
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
- mergeConfigs
3
- } from "./chunk-PROY5XLZ.mjs";
2
+ mergeConfigs,
3
+ utils
4
+ } from "./chunk-XG56JT63.mjs";
4
5
  import {
5
6
  diffConfigs
6
7
  } from "./chunk-5YOGLJPA.mjs";
@@ -466,11 +467,17 @@ async function resolveConfig(result, cwd) {
466
467
  ...result,
467
468
  config
468
469
  };
469
- await hooks["config:resolved"]?.({
470
- config: loadConfigResult.config,
471
- path: loadConfigResult.path,
472
- dependencies: loadConfigResult.dependencies
473
- });
470
+ if (hooks["config:resolved"]) {
471
+ const result2 = await hooks["config:resolved"]({
472
+ config: loadConfigResult.config,
473
+ path: loadConfigResult.path,
474
+ dependencies: loadConfigResult.dependencies,
475
+ utils
476
+ });
477
+ if (result2) {
478
+ loadConfigResult.config = result2;
479
+ }
480
+ }
474
481
  const serialized = stringifyJson(loadConfigResult.config);
475
482
  const deserialize = () => parseJson(serialized);
476
483
  return { ...loadConfigResult, serialized, deserialize, hooks };
@@ -26,6 +26,7 @@ module.exports = __toCommonJS(merge_config_exports);
26
26
  var import_merge_anything = require("merge-anything");
27
27
 
28
28
  // src/utils.ts
29
+ var import_shared = require("@pandacss/shared");
29
30
  var isObject = (v) => Object.prototype.toString.call(v) === "[object Object]";
30
31
  function mergeWith(target, ...sources) {
31
32
  const customizer = sources.pop();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mergeConfigs
3
- } from "./chunk-PROY5XLZ.mjs";
3
+ } from "./chunk-XG56JT63.mjs";
4
4
  export {
5
5
  mergeConfigs
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/config",
3
- "version": "0.0.0-dev-20240205145159",
3
+ "version": "0.0.0-dev-20240205145307",
4
4
  "description": "Find and load panda config",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -64,11 +64,11 @@
64
64
  "merge-anything": "^5.1.7",
65
65
  "microdiff": "^1.3.2",
66
66
  "typescript": "^5.3.3",
67
- "@pandacss/logger": "0.0.0-dev-20240205145159",
68
- "@pandacss/preset-base": "0.0.0-dev-20240205145159",
69
- "@pandacss/preset-panda": "0.0.0-dev-20240205145159",
70
- "@pandacss/shared": "0.0.0-dev-20240205145159",
71
- "@pandacss/types": "0.0.0-dev-20240205145159"
67
+ "@pandacss/logger": "0.0.0-dev-20240205145307",
68
+ "@pandacss/preset-base": "0.0.0-dev-20240205145307",
69
+ "@pandacss/preset-panda": "0.0.0-dev-20240205145307",
70
+ "@pandacss/shared": "0.0.0-dev-20240205145307",
71
+ "@pandacss/types": "0.0.0-dev-20240205145307"
72
72
  },
73
73
  "devDependencies": {
74
74
  "pkg-types": "1.0.3"