@mekari/pixel3-postcss 0.0.1-alpha.0 → 0.0.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.cjs ADDED
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
+ var __esm = (fn, res) => function __init() {
10
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
+ };
12
+ var __export = (target, all) => {
13
+ for (var name in all)
14
+ __defProp(target, name, { get: all[name], enumerable: true });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // ../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.31_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js
35
+ var getImportMetaUrl, importMetaUrl;
36
+ var init_cjs_shims = __esm({
37
+ "../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.31_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "use strict";
39
+ getImportMetaUrl = /* @__PURE__ */ __name(() => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href, "getImportMetaUrl");
40
+ importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
41
+ }
42
+ });
43
+
44
+ // src/default-config.js
45
+ var default_config_exports = {};
46
+ __export(default_config_exports, {
47
+ defaultConfig: () => defaultConfig
48
+ });
49
+ var defaultConfig;
50
+ var init_default_config = __esm({
51
+ "src/default-config.js"() {
52
+ "use strict";
53
+ init_cjs_shims();
54
+ defaultConfig = {
55
+ preflight: true,
56
+ presets: ["@mekari/pixel3-theme"],
57
+ include: [
58
+ "./src/**/*.{js,jsx,ts,tsx,vue}",
59
+ "./node_modules/@mekari/pixel3/node_modules/@mekari/**/src/**/*.{ts,tsx,vue}"
60
+ ],
61
+ exclude: [],
62
+ layers: {
63
+ reset: "pixel_reset",
64
+ base: "pixel_base",
65
+ tokens: "pixel_tokens",
66
+ recipes: "pixel_recipes",
67
+ utilities: "pixel_utilities"
68
+ },
69
+ prefix: "mp",
70
+ jsxFramework: "vue"
71
+ };
72
+ }
73
+ });
74
+
75
+ // index.ts
76
+ init_cjs_shims();
77
+
78
+ // src/index.ts
79
+ init_cjs_shims();
80
+ var import_node = require("@pandacss/node");
81
+ var import_module = require("module");
82
+
83
+ // src/create-config.js
84
+ init_cjs_shims();
85
+ var fs = require("fs");
86
+ var { defaultConfig: defaultConfig2 } = (init_default_config(), __toCommonJS(default_config_exports));
87
+ function mergeConfig(obj1 = {}, obj2 = {}) {
88
+ const mergeKey = ["include"];
89
+ const tempObj = {};
90
+ mergeKey.map((item) => {
91
+ if (obj2.hasOwnProperty(item)) {
92
+ tempObj[item] = [...obj1[item], ...obj2[item]];
93
+ }
94
+ });
95
+ return { ...obj1, ...tempObj };
96
+ }
97
+ __name(mergeConfig, "mergeConfig");
98
+ var createConfigFile = /* @__PURE__ */ __name((filePath, options) => {
99
+ const configs = mergeConfig(defaultConfig2, options);
100
+ const data = "export default" + JSON.stringify(configs, null, 2);
101
+ try {
102
+ fs.writeFileSync(filePath, data, "utf-8");
103
+ } catch (error) {
104
+ console.error(error.message);
105
+ }
106
+ }, "createConfigFile");
107
+
108
+ // src/index.ts
109
+ var import_path = __toESM(require("path"), 1);
110
+ var require2 = (0, import_module.createRequire)(importMetaUrl);
111
+ var tmp = require2("tmp");
112
+ var PLUGIN_NAME = "pixel3-postcss";
113
+ var tmpobj = tmp.fileSync({ postfix: ".ts" });
114
+ var configPath = tmpobj.name;
115
+ tmp.setGracefulCleanup();
116
+ var pixelcss = /* @__PURE__ */ __name((options = {}) => {
117
+ const { cwd } = options;
118
+ createConfigFile(configPath, options);
119
+ console.log("Pixel Config (auto-generated) :", configPath);
120
+ const builder = new import_node.Builder();
121
+ const nodeModulesRegex = /node_modules/;
122
+ function isValidCss(file) {
123
+ const [filePath] = file.split("?");
124
+ return import_path.default.extname(filePath) === ".css";
125
+ }
126
+ __name(isValidCss, "isValidCss");
127
+ return {
128
+ postcssPlugin: PLUGIN_NAME,
129
+ plugins: [
130
+ async function(root, result) {
131
+ const fileName = result.opts.from;
132
+ const skip = fileName ? !isValidCss(fileName) || nodeModulesRegex.test(fileName) : true;
133
+ if (skip)
134
+ return;
135
+ await builder.setup({ configPath, cwd });
136
+ if (!builder.isValidRoot(root)) {
137
+ return;
138
+ }
139
+ await builder.emit();
140
+ await builder.extract();
141
+ builder.registerDependency((dep) => {
142
+ result.messages.push({
143
+ ...dep,
144
+ plugin: PLUGIN_NAME,
145
+ parent: result.opts.from
146
+ });
147
+ });
148
+ builder.write(root);
149
+ root.walk((node) => {
150
+ if (!node.source) {
151
+ node.source = root.source;
152
+ }
153
+ });
154
+ }
155
+ ]
156
+ };
157
+ }, "pixelcss");
158
+ pixelcss.postcss = true;
159
+ var src_default = pixelcss;
160
+
161
+ // index.ts
162
+ module.exports = src_default;
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js CHANGED
@@ -30,10 +30,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // ../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.31_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js
33
+ // ../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.32_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js
34
34
  var getImportMetaUrl, importMetaUrl;
35
35
  var init_cjs_shims = __esm({
36
- "../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.31_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js"() {
36
+ "../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.32_typescript@5.1.6/node_modules/tsup/assets/cjs_shims.js"() {
37
37
  "use strict";
38
38
  getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
39
39
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -66,7 +66,9 @@ var init_default_config = __esm({
66
66
  utilities: "pixel_utilities"
67
67
  },
68
68
  prefix: "mp",
69
- jsxFramework: "vue"
69
+ jsxFramework: "vue",
70
+ jsxFactory: "Pixel",
71
+ jsxStyleProps: "all"
70
72
  };
71
73
  }
72
74
  });
@@ -84,10 +86,14 @@ init_cjs_shims();
84
86
  var fs = require("fs");
85
87
  var { defaultConfig: defaultConfig2 } = (init_default_config(), __toCommonJS(default_config_exports));
86
88
  function mergeConfig(obj1, obj2) {
87
- const mergeKey = ["include"];
89
+ const mergeKey = ["include", "exclude"];
88
90
  const tempObj = {};
89
91
  mergeKey.map((item) => {
90
92
  if (obj2.hasOwnProperty(item)) {
93
+ if (item === "staticCss") {
94
+ tempObj[item] = obj2[item];
95
+ return;
96
+ }
91
97
  tempObj[item] = [...obj1[item], ...obj2[item]];
92
98
  }
93
99
  });
@@ -111,22 +117,31 @@ var PLUGIN_NAME = "pixel3-postcss";
111
117
  var tmpobj = tmp.fileSync({ postfix: ".ts" });
112
118
  var configPath = tmpobj.name;
113
119
  tmp.setGracefulCleanup();
120
+ var builder = new import_node.Builder();
121
+ var nodeModulesRegex = /node_modules/;
122
+ function isValidCss(file) {
123
+ const [filePath] = file.split("?");
124
+ return import_path.default.extname(filePath) === ".css";
125
+ }
126
+ var shouldSkip = (fileName) => {
127
+ if (!fileName)
128
+ return true;
129
+ if (!isValidCss(fileName))
130
+ return true;
131
+ if (fileName.includes("@pandacss/astro/base.css"))
132
+ return false;
133
+ return nodeModulesRegex.test(fileName);
134
+ };
114
135
  var pixelcss = (options = {}) => {
115
136
  const { cwd } = options;
116
137
  createConfigFile(configPath, options);
117
138
  console.log("Pixel Config (auto-generated) :", configPath);
118
- const builder = new import_node.Builder();
119
- const nodeModulesRegex = /node_modules/;
120
- function isValidCss(file) {
121
- const [filePath] = file.split("?");
122
- return import_path.default.extname(filePath) === ".css";
123
- }
124
139
  return {
125
140
  postcssPlugin: PLUGIN_NAME,
126
141
  plugins: [
127
142
  async function(root, result) {
128
143
  const fileName = result.opts.from;
129
- const skip = fileName ? !isValidCss(fileName) || nodeModulesRegex.test(fileName) : true;
144
+ const skip = shouldSkip(fileName);
130
145
  if (skip)
131
146
  return;
132
147
  await builder.setup({ configPath, cwd });
@@ -134,7 +149,7 @@ var pixelcss = (options = {}) => {
134
149
  return;
135
150
  }
136
151
  await builder.emit();
137
- await builder.extract();
152
+ builder.extract();
138
153
  builder.registerDependency((dep) => {
139
154
  result.messages.push({
140
155
  ...dep,
package/dist/index.mjs CHANGED
@@ -29,9 +29,9 @@ var __copyProps = (to, from, except, desc) => {
29
29
  };
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
 
32
- // ../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.31_typescript@5.1.6/node_modules/tsup/assets/esm_shims.js
32
+ // ../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.32_typescript@5.1.6/node_modules/tsup/assets/esm_shims.js
33
33
  var init_esm_shims = __esm({
34
- "../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.31_typescript@5.1.6/node_modules/tsup/assets/esm_shims.js"() {
34
+ "../../node_modules/.pnpm/tsup@7.2.0_postcss@8.4.32_typescript@5.1.6/node_modules/tsup/assets/esm_shims.js"() {
35
35
  "use strict";
36
36
  }
37
37
  });
@@ -62,17 +62,23 @@ var init_default_config = __esm({
62
62
  utilities: "pixel_utilities"
63
63
  },
64
64
  prefix: "mp",
65
- jsxFramework: "vue"
65
+ jsxFramework: "vue",
66
+ jsxFactory: "Pixel",
67
+ jsxStyleProps: "all"
66
68
  };
67
69
  }
68
70
  });
69
71
 
70
72
  // src/create-config.ts
71
73
  function mergeConfig(obj1, obj2) {
72
- const mergeKey = ["include"];
74
+ const mergeKey = ["include", "exclude"];
73
75
  const tempObj = {};
74
76
  mergeKey.map((item) => {
75
77
  if (obj2.hasOwnProperty(item)) {
78
+ if (item === "staticCss") {
79
+ tempObj[item] = obj2[item];
80
+ return;
81
+ }
76
82
  tempObj[item] = [...obj1[item], ...obj2[item]];
77
83
  }
78
84
  });
@@ -101,7 +107,11 @@ var init_create_config = __esm({
101
107
  import { Builder } from "@pandacss/node";
102
108
  import { createRequire } from "module";
103
109
  import path from "path";
104
- var require2, tmp, PLUGIN_NAME, tmpobj, configPath, pixelcss, src_default;
110
+ function isValidCss(file) {
111
+ const [filePath] = file.split("?");
112
+ return path.extname(filePath) === ".css";
113
+ }
114
+ var require2, tmp, PLUGIN_NAME, tmpobj, configPath, builder, nodeModulesRegex, shouldSkip, pixelcss, src_default;
105
115
  var init_src = __esm({
106
116
  "src/index.ts"() {
107
117
  "use strict";
@@ -113,22 +123,27 @@ var init_src = __esm({
113
123
  tmpobj = tmp.fileSync({ postfix: ".ts" });
114
124
  configPath = tmpobj.name;
115
125
  tmp.setGracefulCleanup();
126
+ builder = new Builder();
127
+ nodeModulesRegex = /node_modules/;
128
+ shouldSkip = (fileName) => {
129
+ if (!fileName)
130
+ return true;
131
+ if (!isValidCss(fileName))
132
+ return true;
133
+ if (fileName.includes("@pandacss/astro/base.css"))
134
+ return false;
135
+ return nodeModulesRegex.test(fileName);
136
+ };
116
137
  pixelcss = (options = {}) => {
117
138
  const { cwd } = options;
118
139
  createConfigFile(configPath, options);
119
140
  console.log("Pixel Config (auto-generated) :", configPath);
120
- const builder = new Builder();
121
- const nodeModulesRegex = /node_modules/;
122
- function isValidCss(file) {
123
- const [filePath] = file.split("?");
124
- return path.extname(filePath) === ".css";
125
- }
126
141
  return {
127
142
  postcssPlugin: PLUGIN_NAME,
128
143
  plugins: [
129
144
  async function(root, result) {
130
145
  const fileName = result.opts.from;
131
- const skip = fileName ? !isValidCss(fileName) || nodeModulesRegex.test(fileName) : true;
146
+ const skip = shouldSkip(fileName);
132
147
  if (skip)
133
148
  return;
134
149
  await builder.setup({ configPath, cwd });
@@ -136,7 +151,7 @@ var init_src = __esm({
136
151
  return;
137
152
  }
138
153
  await builder.emit();
139
- await builder.extract();
154
+ builder.extract();
140
155
  builder.registerDependency((dep) => {
141
156
  result.messages.push({
142
157
  ...dep,
package/package.json CHANGED
@@ -1,17 +1,13 @@
1
1
  {
2
2
  "name": "@mekari/pixel3-postcss",
3
- "version": "0.0.1-alpha.0",
3
+ "version": "0.0.2",
4
4
  "description": "PostCSS integration for Pixel 3",
5
- "main": "dist/index.js",
6
- "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
5
+ "main": "./dist/index.js",
8
6
  "author": "Sastra Nababan",
9
7
  "scripts": {
10
8
  "build": "tsup index.ts --format=cjs,esm --shims --dts",
11
9
  "build-fast": "tsup src/index.ts --format=cjs,esm --shims --no-dts",
12
- "dev": "pnpm build-fast --watch",
13
- "replace-config": "clean-package",
14
- "restore-config": "clean-package restore"
10
+ "dev": "pnpm build-fast --watch"
15
11
  },
16
12
  "sideEffects": false,
17
13
  "publishConfig": {
@@ -21,16 +17,9 @@
21
17
  "dist"
22
18
  ],
23
19
  "dependencies": {
24
- "@pandacss/dev": "^0.20.1",
25
- "@pandacss/node": "^0.20.1",
20
+ "@pandacss/dev": "^0.24.1",
21
+ "@pandacss/node": "^0.24.1",
26
22
  "postcss": "^8.4.31",
27
23
  "tmp": "^0.2.1"
28
- },
29
- "exports": {
30
- ".": {
31
- "types": "./dist/index.d.ts",
32
- "require": "./dist/index.js",
33
- "default": "./dist/index.mjs"
34
- }
35
24
  }
36
- }
25
+ }