@mekari/pixel3-postcss 1.0.9-dev.1 → 1.0.9-dev.3

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
@@ -5,13 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __export = (target, all) => {
12
- for (var name in all)
13
- __defProp(target, name, { get: all[name], enumerable: true });
14
- };
15
8
  var __copyProps = (to, from, except, desc) => {
16
9
  if (from && typeof from === "object" || typeof from === "function") {
17
10
  for (let key of __getOwnPropNames(from))
@@ -28,65 +21,45 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
22
  mod
30
23
  ));
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
24
 
33
25
  // ../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.33_ts-node@10.9.2_@types+node@20.11.21_typescript@5.4.3__typescript@5.4.3/node_modules/tsup/assets/cjs_shims.js
34
- var getImportMetaUrl, importMetaUrl;
35
- var init_cjs_shims = __esm({
36
- "../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.33_ts-node@10.9.2_@types+node@20.11.21_typescript@5.4.3__typescript@5.4.3/node_modules/tsup/assets/cjs_shims.js"() {
37
- "use strict";
38
- getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
39
- importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
40
- }
41
- });
42
-
43
- // src/default-config.js
44
- var default_config_exports = {};
45
- __export(default_config_exports, {
46
- defaultConfig: () => defaultConfig
47
- });
48
- var defaultConfig;
49
- var init_default_config = __esm({
50
- "src/default-config.js"() {
51
- "use strict";
52
- init_cjs_shims();
53
- defaultConfig = {
54
- preflight: true,
55
- presets: ["@mekari/pixel3-theme"],
56
- include: ["./src/**/*.{js,jsx,ts,tsx,vue}"],
57
- exclude: [],
58
- layers: {
59
- reset: "pixel_reset",
60
- base: "pixel_base",
61
- tokens: "pixel_tokens",
62
- recipes: "pixel_recipes",
63
- utilities: "pixel_utilities"
64
- },
65
- prefix: "mp",
66
- jsxFramework: "vue",
67
- jsxFactory: "Pixel",
68
- jsxStyleProps: "all"
69
- };
70
- }
71
- });
72
-
73
- // index.ts
74
- init_cjs_shims();
26
+ var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
27
+ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
75
28
 
76
29
  // src/index.ts
77
- init_cjs_shims();
78
30
  var import_node = require("@pandacss/node");
79
31
  var import_module = require("module");
80
32
 
81
33
  // src/create-config.ts
82
- init_cjs_shims();
83
- var fs = require("fs");
84
- var path = require("path");
85
- var { defaultConfig: defaultConfig2 } = (init_default_config(), __toCommonJS(default_config_exports));
34
+ var import_fs = __toESM(require("fs"));
35
+ var import_path = __toESM(require("path"));
36
+
37
+ // src/default-config.ts
38
+ var import_dev = require("@pandacss/dev");
39
+ var defaultConfig = {
40
+ preflight: true,
41
+ presets: ["@mekari/pixel3-theme"],
42
+ include: ["./src/**/*.{js,jsx,ts,tsx,vue}", "./app/**/*.{js,jsx,ts,tsx,vue}"],
43
+ exclude: [],
44
+ layers: {
45
+ reset: "pixel_reset",
46
+ base: "pixel_base",
47
+ tokens: "pixel_tokens",
48
+ recipes: "pixel_recipes",
49
+ utilities: "pixel_utilities"
50
+ },
51
+ prefix: "mp",
52
+ jsxFramework: "vue",
53
+ jsxFactory: "Pixel",
54
+ jsxStyleProps: "all"
55
+ };
56
+
57
+ // src/create-config.ts
58
+ var import_dev2 = require("@pandacss/dev");
86
59
  function findRealModulePath(moduleName) {
87
60
  try {
88
- const symlinkPath = path.join("node_modules", moduleName);
89
- const realPath = fs.realpathSync(symlinkPath);
61
+ const symlinkPath = import_path.default.join("node_modules", moduleName);
62
+ const realPath = import_fs.default.realpathSync(symlinkPath);
90
63
  return realPath;
91
64
  } catch (error) {
92
65
  console.error("Error finding real module path:", error);
@@ -96,34 +69,37 @@ function findRealModulePath(moduleName) {
96
69
  function mergeConfig(obj1, obj2) {
97
70
  const mergeKey = ["include", "exclude"];
98
71
  const tempObj = {};
99
- const hasReplaceConfig = obj2.replaceConfig?.length > 0;
100
- mergeKey.map((item) => {
101
- if (obj2.hasOwnProperty(item)) {
102
- if (item === "staticCss") {
72
+ const hasReplaceConfig = obj2.replaceConfig && obj2.replaceConfig.length > 0;
73
+ mergeKey.forEach((item) => {
74
+ if (Object.prototype.hasOwnProperty.call(obj2, item)) {
75
+ if (hasReplaceConfig && obj2.replaceConfig?.includes(item)) {
103
76
  tempObj[item] = obj2[item];
104
77
  return;
105
78
  }
106
- if (hasReplaceConfig && obj2.replaceConfig.includes(item)) {
107
- tempObj[item] = obj2[item];
108
- return;
79
+ const obj1Value = obj1[item];
80
+ const obj2Value = obj2[item];
81
+ if (Array.isArray(obj1Value) && Array.isArray(obj2Value)) {
82
+ tempObj[item] = [...obj1Value, ...obj2Value];
109
83
  }
110
- tempObj[item] = [...obj1[item], ...obj2[item]];
111
84
  }
112
85
  });
113
86
  return { ...obj1, ...tempObj };
114
87
  }
115
88
  var createConfigFile = (filePath, options, packageManager) => {
116
- const _defaultConfig = { ...defaultConfig2 };
89
+ const _defaultConfig = { ...defaultConfig };
117
90
  if (packageManager) {
118
- const pixelDir = path.dirname(findRealModulePath("@mekari/pixel3"));
119
- const extend = `${pixelDir}/**/dist/**/*.{js,mjs}`;
120
- const finalInclude = [..._defaultConfig.include, extend];
121
- _defaultConfig.include = finalInclude;
91
+ const realPath = findRealModulePath("@mekari/pixel3");
92
+ if (realPath) {
93
+ const pixelDir = import_path.default.dirname(realPath);
94
+ const extend = `${pixelDir}/**/dist/**/*.{js,mjs}`;
95
+ const finalInclude = [..._defaultConfig.include || [], extend];
96
+ _defaultConfig.include = finalInclude;
97
+ }
122
98
  }
123
99
  const configs = mergeConfig(_defaultConfig, options);
124
100
  const data = "export default" + JSON.stringify(configs, null, 2);
125
101
  try {
126
- fs.writeFileSync(filePath, data, "utf-8");
102
+ import_fs.default.writeFileSync(filePath, data, "utf-8");
127
103
  } catch (error) {
128
104
  if (error instanceof Error) {
129
105
  console.error(error.message);
@@ -134,7 +110,7 @@ var createConfigFile = (filePath, options, packageManager) => {
134
110
  };
135
111
 
136
112
  // src/index.ts
137
- var import_path = __toESM(require("path"));
113
+ var import_path2 = __toESM(require("path"));
138
114
  var require2 = (0, import_module.createRequire)(importMetaUrl);
139
115
  var tmp = require2("tmp");
140
116
  var PLUGIN_NAME = "pixel3-postcss";
@@ -145,7 +121,7 @@ var builder = new import_node.Builder();
145
121
  var nodeModulesRegex = /node_modules/;
146
122
  function isValidCss(file) {
147
123
  const [filePath] = file.split("?");
148
- return import_path.default.extname(filePath) === ".css";
124
+ return import_path2.default.extname(filePath) === ".css";
149
125
  }
150
126
  var shouldSkip = (fileName) => {
151
127
  if (!fileName)
package/dist/index.mjs CHANGED
@@ -1,33 +1,10 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
1
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
6
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
7
- }) : x)(function(x) {
8
- if (typeof require !== "undefined")
9
- return require.apply(this, arguments);
10
- throw Error('Dynamic require of "' + x + '" is not supported');
11
- });
12
2
  var __esm = (fn, res) => function __init() {
13
3
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
4
  };
15
- var __commonJS = (cb, mod) => function __require2() {
5
+ var __commonJS = (cb, mod) => function __require() {
16
6
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
7
  };
18
- var __export = (target, all) => {
19
- for (var name in all)
20
- __defProp(target, name, { get: all[name], enumerable: true });
21
- };
22
- var __copyProps = (to, from, except, desc) => {
23
- if (from && typeof from === "object" || typeof from === "function") {
24
- for (let key of __getOwnPropNames(from))
25
- if (!__hasOwnProp.call(to, key) && key !== except)
26
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
- }
28
- return to;
29
- };
30
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
8
 
32
9
  // ../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.33_ts-node@10.9.2_@types+node@20.11.21_typescript@5.4.3__typescript@5.4.3/node_modules/tsup/assets/esm_shims.js
33
10
  var init_esm_shims = __esm({
@@ -36,20 +13,17 @@ var init_esm_shims = __esm({
36
13
  }
37
14
  });
38
15
 
39
- // src/default-config.js
40
- var default_config_exports = {};
41
- __export(default_config_exports, {
42
- defaultConfig: () => defaultConfig
43
- });
16
+ // src/default-config.ts
17
+ import "@pandacss/dev";
44
18
  var defaultConfig;
45
19
  var init_default_config = __esm({
46
- "src/default-config.js"() {
20
+ "src/default-config.ts"() {
47
21
  "use strict";
48
22
  init_esm_shims();
49
23
  defaultConfig = {
50
24
  preflight: true,
51
25
  presets: ["@mekari/pixel3-theme"],
52
- include: ["./src/**/*.{js,jsx,ts,tsx,vue}"],
26
+ include: ["./src/**/*.{js,jsx,ts,tsx,vue}", "./app/**/*.{js,jsx,ts,tsx,vue}"],
53
27
  exclude: [],
54
28
  layers: {
55
29
  reset: "pixel_reset",
@@ -67,6 +41,9 @@ var init_default_config = __esm({
67
41
  });
68
42
 
69
43
  // src/create-config.ts
44
+ import fs from "fs";
45
+ import path from "path";
46
+ import "@pandacss/dev";
70
47
  function findRealModulePath(moduleName) {
71
48
  try {
72
49
  const symlinkPath = path.join("node_modules", moduleName);
@@ -80,37 +57,38 @@ function findRealModulePath(moduleName) {
80
57
  function mergeConfig(obj1, obj2) {
81
58
  const mergeKey = ["include", "exclude"];
82
59
  const tempObj = {};
83
- const hasReplaceConfig = obj2.replaceConfig?.length > 0;
84
- mergeKey.map((item) => {
85
- if (obj2.hasOwnProperty(item)) {
86
- if (item === "staticCss") {
60
+ const hasReplaceConfig = obj2.replaceConfig && obj2.replaceConfig.length > 0;
61
+ mergeKey.forEach((item) => {
62
+ if (Object.prototype.hasOwnProperty.call(obj2, item)) {
63
+ if (hasReplaceConfig && obj2.replaceConfig?.includes(item)) {
87
64
  tempObj[item] = obj2[item];
88
65
  return;
89
66
  }
90
- if (hasReplaceConfig && obj2.replaceConfig.includes(item)) {
91
- tempObj[item] = obj2[item];
92
- return;
67
+ const obj1Value = obj1[item];
68
+ const obj2Value = obj2[item];
69
+ if (Array.isArray(obj1Value) && Array.isArray(obj2Value)) {
70
+ tempObj[item] = [...obj1Value, ...obj2Value];
93
71
  }
94
- tempObj[item] = [...obj1[item], ...obj2[item]];
95
72
  }
96
73
  });
97
74
  return { ...obj1, ...tempObj };
98
75
  }
99
- var fs, path, defaultConfig2, createConfigFile;
76
+ var createConfigFile;
100
77
  var init_create_config = __esm({
101
78
  "src/create-config.ts"() {
102
79
  "use strict";
103
80
  init_esm_shims();
104
- fs = __require("fs");
105
- path = __require("path");
106
- ({ defaultConfig: defaultConfig2 } = (init_default_config(), __toCommonJS(default_config_exports)));
81
+ init_default_config();
107
82
  createConfigFile = (filePath, options, packageManager) => {
108
- const _defaultConfig = { ...defaultConfig2 };
83
+ const _defaultConfig = { ...defaultConfig };
109
84
  if (packageManager) {
110
- const pixelDir = path.dirname(findRealModulePath("@mekari/pixel3"));
111
- const extend = `${pixelDir}/**/dist/**/*.{js,mjs}`;
112
- const finalInclude = [..._defaultConfig.include, extend];
113
- _defaultConfig.include = finalInclude;
85
+ const realPath = findRealModulePath("@mekari/pixel3");
86
+ if (realPath) {
87
+ const pixelDir = path.dirname(realPath);
88
+ const extend = `${pixelDir}/**/dist/**/*.{js,mjs}`;
89
+ const finalInclude = [..._defaultConfig.include || [], extend];
90
+ _defaultConfig.include = finalInclude;
91
+ }
114
92
  }
115
93
  const configs = mergeConfig(_defaultConfig, options);
116
94
  const data = "export default" + JSON.stringify(configs, null, 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mekari/pixel3-postcss",
3
- "version": "1.0.9-dev.1",
3
+ "version": "1.0.9-dev.3",
4
4
  "description": "PostCSS integration for Pixel 3",
5
5
  "main": "./dist/index.js",
6
6
  "author": "Sastra Nababan",