@pandacss/postcss 0.47.0 → 0.48.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
@@ -1,3 +1,4 @@
1
+ import { Builder } from '@pandacss/node';
1
2
  import { PluginCreator } from 'postcss';
2
3
 
3
4
  interface PluginOptions {
@@ -7,6 +8,7 @@ interface PluginOptions {
7
8
  allow?: RegExp[];
8
9
  }
9
10
  declare const loadConfig: () => any;
11
+ declare const builder: Builder;
10
12
  declare const pandacss: PluginCreator<PluginOptions>;
11
13
 
12
- export { type PluginOptions, pandacss as default, loadConfig, pandacss };
14
+ export { type PluginOptions, builder, pandacss as default, loadConfig, pandacss };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Builder } from '@pandacss/node';
1
2
  import { PluginCreator } from 'postcss';
2
3
 
3
4
  interface PluginOptions {
@@ -7,6 +8,7 @@ interface PluginOptions {
7
8
  allow?: RegExp[];
8
9
  }
9
10
  declare const loadConfig: () => any;
11
+ declare const builder: Builder;
10
12
  declare const pandacss: PluginCreator<PluginOptions>;
11
13
 
12
- export { type PluginOptions, pandacss as default, loadConfig, pandacss };
14
+ export { type PluginOptions, builder, pandacss as default, loadConfig, pandacss };
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
+ builder: () => builder,
33
34
  default: () => src_default,
34
35
  loadConfig: () => loadConfig,
35
36
  pandacss: () => pandacss
@@ -44,37 +45,43 @@ var interopDefault = (obj) => obj && obj.__esModule ? obj.default : obj;
44
45
  var loadConfig = () => interopDefault(customRequire("@pandacss/postcss"));
45
46
  var stream;
46
47
  var builder = new import_node.Builder();
48
+ var builderGuard;
47
49
  var pandacss = (options = {}) => {
48
50
  const { configPath, cwd, logfile, allow } = options;
49
51
  if (!stream && logfile) {
50
52
  stream = (0, import_node.setLogStream)({ cwd, logfile });
51
53
  }
54
+ const postcssProcess = async function(root, result) {
55
+ const fileName = result.opts.from;
56
+ const skip = shouldSkip(fileName, allow);
57
+ if (skip)
58
+ return;
59
+ await builder.setup({ configPath, cwd });
60
+ if (!builder.isValidRoot(root))
61
+ return;
62
+ await builder.emit();
63
+ builder.extract();
64
+ builder.registerDependency((dep) => {
65
+ result.messages.push({
66
+ ...dep,
67
+ plugin: PLUGIN_NAME,
68
+ parent: result.opts.from
69
+ });
70
+ });
71
+ builder.write(root);
72
+ root.walk((node) => {
73
+ if (!node.source) {
74
+ node.source = root.source;
75
+ }
76
+ });
77
+ };
52
78
  return {
53
79
  postcssPlugin: PLUGIN_NAME,
54
80
  plugins: [
55
- async function(root, result) {
56
- const fileName = result.opts.from;
57
- const skip = shouldSkip(fileName, allow);
58
- if (skip)
59
- return;
60
- await builder.setup({ configPath, cwd });
61
- if (!builder.isValidRoot(root))
62
- return;
63
- await builder.emit();
64
- builder.extract();
65
- builder.registerDependency((dep) => {
66
- result.messages.push({
67
- ...dep,
68
- plugin: PLUGIN_NAME,
69
- parent: result.opts.from
70
- });
71
- });
72
- builder.write(root);
73
- root.walk((node) => {
74
- if (!node.source) {
75
- node.source = root.source;
76
- }
77
- });
81
+ function(...args) {
82
+ builderGuard = Promise.resolve(builderGuard).catch(() => {
83
+ }).then(() => postcssProcess(...args));
84
+ return builderGuard;
78
85
  }
79
86
  ]
80
87
  };
@@ -97,6 +104,7 @@ var shouldSkip = (fileName, allow) => {
97
104
  };
98
105
  // Annotate the CommonJS export names for ESM import in node:
99
106
  0 && (module.exports = {
107
+ builder,
100
108
  loadConfig,
101
109
  pandacss
102
110
  });
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/tsup@8.0.2_@swc+core@1.7.6_@swc+helpers@0.4.36__postcss@8.4.47_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js
1
+ // ../../node_modules/.pnpm/tsup@8.0.2_@swc+core@1.9.2_postcss@8.4.49_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js
2
2
  import { fileURLToPath } from "url";
3
3
  import path from "path";
4
4
  var getFilename = () => fileURLToPath(import.meta.url);
@@ -15,37 +15,43 @@ var interopDefault = (obj) => obj && obj.__esModule ? obj.default : obj;
15
15
  var loadConfig = () => interopDefault(customRequire("@pandacss/postcss"));
16
16
  var stream;
17
17
  var builder = new Builder();
18
+ var builderGuard;
18
19
  var pandacss = (options = {}) => {
19
20
  const { configPath, cwd, logfile, allow } = options;
20
21
  if (!stream && logfile) {
21
22
  stream = setLogStream({ cwd, logfile });
22
23
  }
24
+ const postcssProcess = async function(root, result) {
25
+ const fileName = result.opts.from;
26
+ const skip = shouldSkip(fileName, allow);
27
+ if (skip)
28
+ return;
29
+ await builder.setup({ configPath, cwd });
30
+ if (!builder.isValidRoot(root))
31
+ return;
32
+ await builder.emit();
33
+ builder.extract();
34
+ builder.registerDependency((dep) => {
35
+ result.messages.push({
36
+ ...dep,
37
+ plugin: PLUGIN_NAME,
38
+ parent: result.opts.from
39
+ });
40
+ });
41
+ builder.write(root);
42
+ root.walk((node) => {
43
+ if (!node.source) {
44
+ node.source = root.source;
45
+ }
46
+ });
47
+ };
23
48
  return {
24
49
  postcssPlugin: PLUGIN_NAME,
25
50
  plugins: [
26
- async function(root, result) {
27
- const fileName = result.opts.from;
28
- const skip = shouldSkip(fileName, allow);
29
- if (skip)
30
- return;
31
- await builder.setup({ configPath, cwd });
32
- if (!builder.isValidRoot(root))
33
- return;
34
- await builder.emit();
35
- builder.extract();
36
- builder.registerDependency((dep) => {
37
- result.messages.push({
38
- ...dep,
39
- plugin: PLUGIN_NAME,
40
- parent: result.opts.from
41
- });
42
- });
43
- builder.write(root);
44
- root.walk((node) => {
45
- if (!node.source) {
46
- node.source = root.source;
47
- }
48
- });
51
+ function(...args) {
52
+ builderGuard = Promise.resolve(builderGuard).catch(() => {
53
+ }).then(() => postcssProcess(...args));
54
+ return builderGuard;
49
55
  }
50
56
  ]
51
57
  };
@@ -67,6 +73,7 @@ var shouldSkip = (fileName, allow) => {
67
73
  return nodeModulesRegex.test(fileName);
68
74
  };
69
75
  export {
76
+ builder,
70
77
  src_default as default,
71
78
  loadConfig,
72
79
  pandacss
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/postcss",
3
- "version": "0.47.0",
3
+ "version": "0.48.0",
4
4
  "description": "PostCSS integration for Panda CSS",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,11 +32,11 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "postcss": "8.4.47",
36
- "@pandacss/node": "0.47.0"
35
+ "postcss": "8.4.49",
36
+ "@pandacss/node": "0.48.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@pandacss/logger": "0.47.0"
39
+ "@pandacss/logger": "0.48.0"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",