@pandacss/postcss 0.17.0 → 0.17.2

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.js CHANGED
@@ -25,18 +25,12 @@ __export(src_exports, {
25
25
  pandacss: () => pandacss
26
26
  });
27
27
  module.exports = __toCommonJS(src_exports);
28
-
29
- // ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.31_typescript@5.2.2/node_modules/tsup/assets/cjs_shims.js
30
- var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
31
- var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
32
-
33
- // src/index.ts
34
28
  var import_node = require("@pandacss/node");
35
29
  var import_module = require("module");
36
- var require2 = (0, import_module.createRequire)(importMetaUrl);
30
+ var customRequire = (0, import_module.createRequire)(__dirname);
37
31
  var PLUGIN_NAME = "pandacss";
38
32
  var interopDefault = (obj) => obj && obj.__esModule ? obj.default : obj;
39
- var loadConfig = () => interopDefault(require2("@pandacss/postcss"));
33
+ var loadConfig = () => interopDefault(customRequire("@pandacss/postcss"));
40
34
  var pandacss = (options = {}) => {
41
35
  const { configPath, cwd } = options;
42
36
  const builder = new import_node.Builder();
@@ -48,6 +42,7 @@ var pandacss = (options = {}) => {
48
42
  if (!builder.isValidRoot(root)) {
49
43
  return;
50
44
  }
45
+ builder.emit();
51
46
  await builder.extract();
52
47
  builder.registerDependency((dep) => {
53
48
  result.messages.push({
package/dist/index.mjs CHANGED
@@ -1,10 +1,17 @@
1
+ // ../../node_modules/.pnpm/tsup@7.1.0_postcss@8.4.31_typescript@5.2.2/node_modules/tsup/assets/esm_shims.js
2
+ import { fileURLToPath } from "url";
3
+ import path from "path";
4
+ var getFilename = () => fileURLToPath(import.meta.url);
5
+ var getDirname = () => path.dirname(getFilename());
6
+ var __dirname = /* @__PURE__ */ getDirname();
7
+
1
8
  // src/index.ts
2
9
  import { Builder } from "@pandacss/node";
3
10
  import { createRequire } from "module";
4
- var require2 = createRequire(import.meta.url);
11
+ var customRequire = createRequire(__dirname);
5
12
  var PLUGIN_NAME = "pandacss";
6
13
  var interopDefault = (obj) => obj && obj.__esModule ? obj.default : obj;
7
- var loadConfig = () => interopDefault(require2("@pandacss/postcss"));
14
+ var loadConfig = () => interopDefault(customRequire("@pandacss/postcss"));
8
15
  var pandacss = (options = {}) => {
9
16
  const { configPath, cwd } = options;
10
17
  const builder = new Builder();
@@ -16,6 +23,7 @@ var pandacss = (options = {}) => {
16
23
  if (!builder.isValidRoot(root)) {
17
24
  return;
18
25
  }
26
+ builder.emit();
19
27
  await builder.extract();
20
28
  builder.registerDependency((dep) => {
21
29
  result.messages.push({
package/entry.js ADDED
@@ -0,0 +1,28 @@
1
+ // check if we're running in dev mode
2
+ const fs = require('fs')
3
+ const path = require('path')
4
+ const srcPath = path.resolve(path.join(__dirname, './src'))
5
+ const isDevMode = fs.existsSync(srcPath)
6
+ // or want to "force" running the compiled version with PANDA_CLI_MODE=compiled
7
+ const wantsCompiled = process.env.PANDA_CLI === 'compiled'
8
+
9
+ let plugin = {}
10
+
11
+ if (wantsCompiled || !isDevMode) {
12
+ // this runs from the compiled javascript source
13
+ plugin = require(`./dist/index.js`)
14
+ } else {
15
+ const workspacePackagesDir = path.resolve(__dirname, '..')
16
+ const symlink = require('@pandacss/symlink')
17
+
18
+ const unregister = symlink({
19
+ workspacePackagesDir,
20
+ requireSource: () => {
21
+ plugin = require('./index')
22
+ },
23
+ })
24
+
25
+ unregister()
26
+ }
27
+
28
+ module.exports = plugin
package/package.json CHANGED
@@ -1,21 +1,34 @@
1
1
  {
2
2
  "name": "@pandacss/postcss",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "description": "PostCSS integration for Panda CSS",
5
- "main": "dist/index.js",
6
- "module": "dist/index.mjs",
5
+ "main": "entry.js",
7
6
  "types": "dist/index.d.ts",
8
7
  "author": "Segun Adebayo <joseshegs@gmail.com>",
8
+ "exports": {
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/index.d.ts",
12
+ "require": "./entry.js",
13
+ "import": {
14
+ "types": "./dist/index.d.mts",
15
+ "default": "./entry.js"
16
+ }
17
+ },
18
+ "./package.json": "./package.json"
19
+ },
9
20
  "sideEffects": false,
10
21
  "publishConfig": {
11
22
  "access": "public"
12
23
  },
13
24
  "files": [
14
- "dist"
25
+ "dist",
26
+ "entry.js"
15
27
  ],
16
28
  "dependencies": {
17
29
  "postcss": "^8.4.31",
18
- "@pandacss/node": "0.17.0"
30
+ "@pandacss/node": "0.17.2",
31
+ "@pandacss/symlink": "0.17.2"
19
32
  },
20
33
  "scripts": {
21
34
  "build": "tsup src/index.ts --format=cjs,esm --shims --dts",