@mekari/pixel3-postcss 1.0.12-dev.0 → 1.0.13-dev.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.js +9 -27
- package/dist/index.mjs +9 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -85,16 +85,14 @@ function mergeConfig(obj1, obj2) {
|
|
|
85
85
|
});
|
|
86
86
|
return { ...obj1, ...tempObj };
|
|
87
87
|
}
|
|
88
|
-
var createConfigFile = (filePath, options
|
|
88
|
+
var createConfigFile = (filePath, options) => {
|
|
89
89
|
const _defaultConfig = { ...defaultConfig };
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
_defaultConfig.include = finalInclude;
|
|
97
|
-
}
|
|
90
|
+
const realPath = findRealModulePath("@mekari/pixel3");
|
|
91
|
+
if (realPath) {
|
|
92
|
+
const pixelDir = import_path.default.dirname(realPath);
|
|
93
|
+
const extend = `${pixelDir}/**/dist/**/*.{js,mjs}`;
|
|
94
|
+
const finalInclude = [..._defaultConfig.include || [], extend];
|
|
95
|
+
_defaultConfig.include = finalInclude;
|
|
98
96
|
}
|
|
99
97
|
const configs = mergeConfig(_defaultConfig, options);
|
|
100
98
|
const data = "export default" + JSON.stringify(configs, null, 2);
|
|
@@ -128,29 +126,13 @@ var shouldSkip = (fileName) => {
|
|
|
128
126
|
return true;
|
|
129
127
|
if (!isValidCss(fileName))
|
|
130
128
|
return true;
|
|
131
|
-
if (fileName.includes("@
|
|
129
|
+
if (fileName.includes("@mekari/pixel3-nuxt"))
|
|
132
130
|
return false;
|
|
133
131
|
return nodeModulesRegex.test(fileName);
|
|
134
132
|
};
|
|
135
|
-
function getPackageManager() {
|
|
136
|
-
const userAgent = process.env.npm_config_user_agent;
|
|
137
|
-
let result = "";
|
|
138
|
-
if (userAgent) {
|
|
139
|
-
if (userAgent.includes("pnpm")) {
|
|
140
|
-
result = "pnpm";
|
|
141
|
-
} else if (userAgent.includes("npm")) {
|
|
142
|
-
result = "npm";
|
|
143
|
-
} else {
|
|
144
|
-
result = "yarn";
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return result;
|
|
148
|
-
}
|
|
149
133
|
var pixelcss = (options = {}) => {
|
|
150
134
|
const { cwd } = options;
|
|
151
|
-
|
|
152
|
-
createConfigFile(configPath, options, packageManager);
|
|
153
|
-
console.log("Using package manager: ", packageManager);
|
|
135
|
+
createConfigFile(configPath, options);
|
|
154
136
|
console.log("Pixel Config (auto-generated) :", configPath);
|
|
155
137
|
return {
|
|
156
138
|
postcssPlugin: PLUGIN_NAME,
|
package/dist/index.mjs
CHANGED
|
@@ -79,16 +79,14 @@ var init_create_config = __esm({
|
|
|
79
79
|
"use strict";
|
|
80
80
|
init_esm_shims();
|
|
81
81
|
init_default_config();
|
|
82
|
-
createConfigFile = (filePath, options
|
|
82
|
+
createConfigFile = (filePath, options) => {
|
|
83
83
|
const _defaultConfig = { ...defaultConfig };
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
_defaultConfig.include = finalInclude;
|
|
91
|
-
}
|
|
84
|
+
const realPath = findRealModulePath("@mekari/pixel3");
|
|
85
|
+
if (realPath) {
|
|
86
|
+
const pixelDir = path.dirname(realPath);
|
|
87
|
+
const extend = `${pixelDir}/**/dist/**/*.{js,mjs}`;
|
|
88
|
+
const finalInclude = [..._defaultConfig.include || [], extend];
|
|
89
|
+
_defaultConfig.include = finalInclude;
|
|
92
90
|
}
|
|
93
91
|
const configs = mergeConfig(_defaultConfig, options);
|
|
94
92
|
const data = "export default" + JSON.stringify(configs, null, 2);
|
|
@@ -113,20 +111,6 @@ function isValidCss(file) {
|
|
|
113
111
|
const [filePath] = file.split("?");
|
|
114
112
|
return path2.extname(filePath) === ".css";
|
|
115
113
|
}
|
|
116
|
-
function getPackageManager() {
|
|
117
|
-
const userAgent = process.env.npm_config_user_agent;
|
|
118
|
-
let result = "";
|
|
119
|
-
if (userAgent) {
|
|
120
|
-
if (userAgent.includes("pnpm")) {
|
|
121
|
-
result = "pnpm";
|
|
122
|
-
} else if (userAgent.includes("npm")) {
|
|
123
|
-
result = "npm";
|
|
124
|
-
} else {
|
|
125
|
-
result = "yarn";
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return result;
|
|
129
|
-
}
|
|
130
114
|
var require2, tmp, PLUGIN_NAME, tmpobj, configPath, builder, nodeModulesRegex, shouldSkip, pixelcss, src_default;
|
|
131
115
|
var init_src = __esm({
|
|
132
116
|
"src/index.ts"() {
|
|
@@ -146,15 +130,13 @@ var init_src = __esm({
|
|
|
146
130
|
return true;
|
|
147
131
|
if (!isValidCss(fileName))
|
|
148
132
|
return true;
|
|
149
|
-
if (fileName.includes("@
|
|
133
|
+
if (fileName.includes("@mekari/pixel3-nuxt"))
|
|
150
134
|
return false;
|
|
151
135
|
return nodeModulesRegex.test(fileName);
|
|
152
136
|
};
|
|
153
137
|
pixelcss = (options = {}) => {
|
|
154
138
|
const { cwd } = options;
|
|
155
|
-
|
|
156
|
-
createConfigFile(configPath, options, packageManager);
|
|
157
|
-
console.log("Using package manager: ", packageManager);
|
|
139
|
+
createConfigFile(configPath, options);
|
|
158
140
|
console.log("Pixel Config (auto-generated) :", configPath);
|
|
159
141
|
return {
|
|
160
142
|
postcssPlugin: PLUGIN_NAME,
|