@mekari/pixel3-postcss 0.0.1 → 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.js +27 -12
- package/dist/index.mjs +28 -13
- package/package.json +6 -17
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.
|
|
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.
|
|
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 =
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
154
|
+
builder.extract();
|
|
140
155
|
builder.registerDependency((dep) => {
|
|
141
156
|
result.messages.push({
|
|
142
157
|
...dep,
|
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mekari/pixel3-postcss",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "PostCSS integration for Pixel 3",
|
|
5
|
-
"main": "dist/index.js",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
6
|
"author": "Sastra Nababan",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsup index.ts --format=cjs,esm --shims --dts",
|
|
9
9
|
"build-fast": "tsup src/index.ts --format=cjs,esm --shims --no-dts",
|
|
10
|
-
"dev": "pnpm build-fast --watch"
|
|
11
|
-
"replace-config": "clean-package",
|
|
12
|
-
"restore-config": "clean-package restore"
|
|
10
|
+
"dev": "pnpm build-fast --watch"
|
|
13
11
|
},
|
|
14
12
|
"sideEffects": false,
|
|
15
13
|
"publishConfig": {
|
|
@@ -19,18 +17,9 @@
|
|
|
19
17
|
"dist"
|
|
20
18
|
],
|
|
21
19
|
"dependencies": {
|
|
22
|
-
"@pandacss/dev": "^0.
|
|
23
|
-
"@pandacss/node": "^0.
|
|
20
|
+
"@pandacss/dev": "^0.24.1",
|
|
21
|
+
"@pandacss/node": "^0.24.1",
|
|
24
22
|
"postcss": "^8.4.31",
|
|
25
23
|
"tmp": "^0.2.1"
|
|
26
|
-
},
|
|
27
|
-
"module": "dist/index.mjs",
|
|
28
|
-
"types": "dist/index.d.ts",
|
|
29
|
-
"exports": {
|
|
30
|
-
".": {
|
|
31
|
-
"types": "./dist/index.d.ts",
|
|
32
|
-
"require": "./dist/index.js",
|
|
33
|
-
"default": "./dist/index.mjs"
|
|
34
|
-
}
|
|
35
24
|
}
|
|
36
|
-
}
|
|
25
|
+
}
|