tailwindcss-patch 2.0.5-alpha.0 → 2.0.5-alpha.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/package.json +1 -17
- package/dist/chunk-W6X43COS.mjs +0 -637
- package/dist/cli.d.mts +0 -2
- package/dist/cli.mjs +0 -33
- package/dist/index.d.mts +0 -149
- package/dist/index.mjs +0 -64
package/package.json
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss-patch",
|
|
3
|
-
"version": "2.0.5-alpha.
|
|
3
|
+
"version": "2.0.5-alpha.2",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
|
-
"exports": {
|
|
6
|
-
".": {
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"import": "./dist/index.mjs",
|
|
9
|
-
"require": "./dist/index.js"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"typesVersions": {
|
|
13
|
-
"*": {
|
|
14
|
-
"*": [
|
|
15
|
-
"./dist/*",
|
|
16
|
-
"./dist/index.d.ts"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
5
|
"main": "./dist/index.js",
|
|
21
|
-
"module": "./dist/index.mjs",
|
|
22
6
|
"types": "./dist/index.d.ts",
|
|
23
7
|
"bin": {
|
|
24
8
|
"tw-patch": "bin/tw-patch.js",
|
package/dist/chunk-W6X43COS.mjs
DELETED
|
@@ -1,637 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
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
|
-
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
25
|
-
|
|
26
|
-
// ../../node_modules/.pnpm/tsup@7.2.0_ts-node@10.9.1_typescript@5.1.6/node_modules/tsup/assets/esm_shims.js
|
|
27
|
-
import { fileURLToPath } from "url";
|
|
28
|
-
var getFilename = () => fileURLToPath(import.meta.url);
|
|
29
|
-
var __filename = /* @__PURE__ */ getFilename();
|
|
30
|
-
|
|
31
|
-
// src/utils.ts
|
|
32
|
-
import fss from "node:fs";
|
|
33
|
-
import fs from "node:fs/promises";
|
|
34
|
-
import pkg from "resolve";
|
|
35
|
-
var { sync } = pkg;
|
|
36
|
-
function ensureFileContent(filepaths) {
|
|
37
|
-
if (typeof filepaths === "string") {
|
|
38
|
-
filepaths = [filepaths];
|
|
39
|
-
}
|
|
40
|
-
let content;
|
|
41
|
-
for (const filepath of filepaths) {
|
|
42
|
-
if (fss.existsSync(filepath)) {
|
|
43
|
-
content = fss.readFileSync(filepath, {
|
|
44
|
-
encoding: "utf8"
|
|
45
|
-
});
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return content;
|
|
50
|
-
}
|
|
51
|
-
function requireResolve(id, opts) {
|
|
52
|
-
return sync(id, opts);
|
|
53
|
-
}
|
|
54
|
-
async function ensureDir(p) {
|
|
55
|
-
try {
|
|
56
|
-
await fs.access(p);
|
|
57
|
-
} catch {
|
|
58
|
-
await fs.mkdir(p, {
|
|
59
|
-
recursive: true
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// src/core/exposeContext.ts
|
|
65
|
-
import path from "node:path";
|
|
66
|
-
import fs2 from "node:fs";
|
|
67
|
-
function getTailwindcssEntry(basedir = process.cwd()) {
|
|
68
|
-
return requireResolve("tailwindcss");
|
|
69
|
-
}
|
|
70
|
-
function getContexts(basedir) {
|
|
71
|
-
const twPath = getTailwindcssEntry(basedir);
|
|
72
|
-
const distPath = path.dirname(twPath);
|
|
73
|
-
let injectFilePath = path.join(distPath, "plugin.js");
|
|
74
|
-
if (!fs2.existsSync(injectFilePath)) {
|
|
75
|
-
injectFilePath = path.join(distPath, "index.js");
|
|
76
|
-
}
|
|
77
|
-
const mo = __require(injectFilePath);
|
|
78
|
-
if (mo.contextRef) {
|
|
79
|
-
return mo.contextRef.value;
|
|
80
|
-
}
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
function getClassCaches(basedir) {
|
|
84
|
-
const contexts = getContexts(basedir);
|
|
85
|
-
return contexts.map((x) => x.classCache);
|
|
86
|
-
}
|
|
87
|
-
function getClassCacheSet(basedir, options) {
|
|
88
|
-
const classCaches = getClassCaches(basedir);
|
|
89
|
-
const classSet = /* @__PURE__ */ new Set();
|
|
90
|
-
for (const classCacheMap of classCaches) {
|
|
91
|
-
const keys = classCacheMap.keys();
|
|
92
|
-
for (const key of keys) {
|
|
93
|
-
const v = key.toString();
|
|
94
|
-
if (options?.removeUniversalSelector && v === "*") {
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
classSet.add(v);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return classSet;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// src/core/cache.ts
|
|
104
|
-
import fs3 from "node:fs";
|
|
105
|
-
import path2 from "node:path";
|
|
106
|
-
|
|
107
|
-
// src/constants.ts
|
|
108
|
-
var pkgName = "tailwindcss-patch";
|
|
109
|
-
|
|
110
|
-
// src/logger.ts
|
|
111
|
-
function log(message, ...optionalParams) {
|
|
112
|
-
return console.log(`[${pkgName}]:` + message, ...optionalParams);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// src/core/cache.ts
|
|
116
|
-
function getCacheOptions(options) {
|
|
117
|
-
let cache;
|
|
118
|
-
switch (typeof options) {
|
|
119
|
-
case "undefined": {
|
|
120
|
-
cache = {
|
|
121
|
-
enable: false
|
|
122
|
-
};
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
case "boolean": {
|
|
126
|
-
cache = {
|
|
127
|
-
enable: options
|
|
128
|
-
};
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
case "object": {
|
|
132
|
-
cache = { ...options, enable: true };
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return cache;
|
|
137
|
-
}
|
|
138
|
-
var CacheManager = class {
|
|
139
|
-
options;
|
|
140
|
-
constructor(options = {}) {
|
|
141
|
-
this.options = this.getOptions(options);
|
|
142
|
-
}
|
|
143
|
-
mkdir(cacheDirectory) {
|
|
144
|
-
const exists = fs3.existsSync(cacheDirectory);
|
|
145
|
-
if (!exists) {
|
|
146
|
-
fs3.mkdirSync(cacheDirectory, {
|
|
147
|
-
recursive: true
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
return cacheDirectory;
|
|
151
|
-
}
|
|
152
|
-
getOptions(options = {}) {
|
|
153
|
-
const cwd = options.cwd ?? process.cwd();
|
|
154
|
-
const dir = options.dir ?? path2.resolve(cwd, "node_modules/.cache", pkgName);
|
|
155
|
-
const file = options.file ?? "index.json";
|
|
156
|
-
const filename = path2.resolve(dir, file);
|
|
157
|
-
return {
|
|
158
|
-
cwd,
|
|
159
|
-
dir,
|
|
160
|
-
file,
|
|
161
|
-
filename,
|
|
162
|
-
strategy: "merge"
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
write(data) {
|
|
166
|
-
try {
|
|
167
|
-
const { dir, filename } = this.options;
|
|
168
|
-
this.mkdir(dir);
|
|
169
|
-
fs3.writeFileSync(filename, JSON.stringify([...data], void 0, 2), "utf8");
|
|
170
|
-
return filename;
|
|
171
|
-
} catch {
|
|
172
|
-
log("write cache file fail!");
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
read() {
|
|
176
|
-
const { filename } = this.options;
|
|
177
|
-
try {
|
|
178
|
-
if (fs3.existsSync(filename)) {
|
|
179
|
-
const data = fs3.readFileSync(filename, "utf8");
|
|
180
|
-
return new Set(JSON.parse(data));
|
|
181
|
-
}
|
|
182
|
-
} catch {
|
|
183
|
-
log("parse cache content fail! path:" + filename);
|
|
184
|
-
try {
|
|
185
|
-
fs3.unlinkSync(filename);
|
|
186
|
-
} catch {
|
|
187
|
-
log("delete cache file fail! path:" + filename);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
// src/core/inspector.ts
|
|
194
|
-
import * as t from "@babel/types";
|
|
195
|
-
|
|
196
|
-
// src/babel/index.ts
|
|
197
|
-
import { default as default2 } from "@babel/generator";
|
|
198
|
-
import { default as default3 } from "@babel/traverse";
|
|
199
|
-
import { parse } from "@babel/parser";
|
|
200
|
-
|
|
201
|
-
// src/core/inspector.ts
|
|
202
|
-
function inspectProcessTailwindFeaturesReturnContext(content) {
|
|
203
|
-
const ast = parse(content);
|
|
204
|
-
let hasPatched = false;
|
|
205
|
-
default3(ast, {
|
|
206
|
-
FunctionDeclaration(p) {
|
|
207
|
-
const n = p.node;
|
|
208
|
-
if (n.id?.name === "processTailwindFeatures" && n.body.body.length === 1 && t.isReturnStatement(n.body.body[0])) {
|
|
209
|
-
const rts = n.body.body[0];
|
|
210
|
-
if (t.isFunctionExpression(rts.argument)) {
|
|
211
|
-
const body = rts.argument.body.body;
|
|
212
|
-
const lastStatement = body.at(-1);
|
|
213
|
-
hasPatched = t.isReturnStatement(lastStatement) && t.isIdentifier(lastStatement.argument) && lastStatement.argument.name === "context";
|
|
214
|
-
if (!hasPatched) {
|
|
215
|
-
const rts2 = t.returnStatement(t.identifier("context"));
|
|
216
|
-
body.push(rts2);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
return {
|
|
223
|
-
code: hasPatched ? content : default2(ast).code,
|
|
224
|
-
hasPatched
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
function inspectPostcssPlugin(content) {
|
|
228
|
-
const ast = parse(content);
|
|
229
|
-
const exportKey = "contextRef";
|
|
230
|
-
const variableName = "contextRef";
|
|
231
|
-
const valueKey = "value";
|
|
232
|
-
let hasPatched = false;
|
|
233
|
-
default3(ast, {
|
|
234
|
-
Program(p) {
|
|
235
|
-
const n = p.node;
|
|
236
|
-
const idx = n.body.findIndex((x) => {
|
|
237
|
-
return t.isExpressionStatement(x) && t.isAssignmentExpression(x.expression) && t.isMemberExpression(x.expression.left) && t.isFunctionExpression(x.expression.right) && x.expression.right.id?.name === "tailwindcss";
|
|
238
|
-
});
|
|
239
|
-
if (idx > -1) {
|
|
240
|
-
const prevStatement = n.body[idx - 1];
|
|
241
|
-
const lastStatement = n.body.at(-1);
|
|
242
|
-
const hasPatchedCondition0 = prevStatement && t.isVariableDeclaration(prevStatement) && prevStatement.declarations.length === 1 && t.isIdentifier(prevStatement.declarations[0].id) && prevStatement.declarations[0].id.name === variableName;
|
|
243
|
-
const hasPatchedCondition1 = t.isExpressionStatement(lastStatement) && t.isAssignmentExpression(lastStatement.expression) && t.isIdentifier(lastStatement.expression.right) && lastStatement.expression.right.name === variableName;
|
|
244
|
-
hasPatched = hasPatchedCondition0 || hasPatchedCondition1;
|
|
245
|
-
if (!hasPatched) {
|
|
246
|
-
const statement = t.variableDeclaration("const", [
|
|
247
|
-
t.variableDeclarator(t.identifier(variableName), t.objectExpression([t.objectProperty(t.identifier(valueKey), t.arrayExpression())]))
|
|
248
|
-
]);
|
|
249
|
-
n.body.splice(idx, 0, statement);
|
|
250
|
-
n.body.push(
|
|
251
|
-
t.expressionStatement(
|
|
252
|
-
t.assignmentExpression(
|
|
253
|
-
"=",
|
|
254
|
-
t.memberExpression(t.memberExpression(t.identifier("module"), t.identifier("exports")), t.identifier(exportKey)),
|
|
255
|
-
t.identifier(variableName)
|
|
256
|
-
)
|
|
257
|
-
)
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
FunctionExpression(p) {
|
|
263
|
-
if (hasPatched) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
const n = p.node;
|
|
267
|
-
if (n.id?.name === "tailwindcss" && n.body.body.length === 1 && t.isReturnStatement(n.body.body[0])) {
|
|
268
|
-
const returnStatement2 = n.body.body[0];
|
|
269
|
-
if (t.isObjectExpression(returnStatement2.argument) && returnStatement2.argument.properties.length === 2) {
|
|
270
|
-
const properties = returnStatement2.argument.properties;
|
|
271
|
-
if (t.isObjectProperty(properties[0]) && t.isObjectProperty(properties[1])) {
|
|
272
|
-
const keyMatched = t.isIdentifier(properties[0].key) && properties[0].key.name === "postcssPlugin";
|
|
273
|
-
const pluginsMatched = t.isIdentifier(properties[1].key) && properties[1].key.name === "plugins";
|
|
274
|
-
if (pluginsMatched && keyMatched && t.isCallExpression(properties[1].value) && t.isMemberExpression(properties[1].value.callee) && t.isArrayExpression(properties[1].value.callee.object)) {
|
|
275
|
-
const pluginsCode = properties[1].value.callee.object.elements;
|
|
276
|
-
if (pluginsCode[1] && t.isFunctionExpression(pluginsCode[1])) {
|
|
277
|
-
const targetBlockStatement = pluginsCode[1].body;
|
|
278
|
-
const lastStatement = targetBlockStatement.body.at(-1);
|
|
279
|
-
if (t.isExpressionStatement(lastStatement)) {
|
|
280
|
-
const newExpressionStatement = t.expressionStatement(
|
|
281
|
-
t.callExpression(
|
|
282
|
-
t.memberExpression(
|
|
283
|
-
t.memberExpression(t.identifier(variableName), t.identifier("value")),
|
|
284
|
-
t.identifier("push")
|
|
285
|
-
),
|
|
286
|
-
[lastStatement.expression]
|
|
287
|
-
)
|
|
288
|
-
);
|
|
289
|
-
targetBlockStatement.body[targetBlockStatement.body.length - 1] = newExpressionStatement;
|
|
290
|
-
}
|
|
291
|
-
const ifIdx = targetBlockStatement.body.findIndex((x) => t.isIfStatement(x));
|
|
292
|
-
if (ifIdx > -1) {
|
|
293
|
-
const ifRoot = targetBlockStatement.body[ifIdx];
|
|
294
|
-
if (t.isBlockStatement(ifRoot.consequent) && ifRoot.consequent.body[1] && t.isForOfStatement(ifRoot.consequent.body[1])) {
|
|
295
|
-
const forOf = ifRoot.consequent.body[1];
|
|
296
|
-
if (t.isBlockStatement(forOf.body) && forOf.body.body.length === 1 && t.isIfStatement(forOf.body.body[0])) {
|
|
297
|
-
const if2 = forOf.body.body[0];
|
|
298
|
-
if (t.isBlockStatement(if2.consequent) && if2.consequent.body.length === 1 && t.isExpressionStatement(if2.consequent.body[0])) {
|
|
299
|
-
const target = if2.consequent.body[0];
|
|
300
|
-
const newExpressionStatement = t.expressionStatement(
|
|
301
|
-
t.callExpression(t.memberExpression(t.memberExpression(t.identifier(variableName), t.identifier("value")), t.identifier("push")), [target.expression])
|
|
302
|
-
);
|
|
303
|
-
if2.consequent.body[0] = newExpressionStatement;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
targetBlockStatement.body.unshift(
|
|
309
|
-
// contentRef.value = []
|
|
310
|
-
// t.expressionStatement(t.assignmentExpression('=', t.memberExpression(t.identifier(variableName), t.identifier(valueKey)), t.arrayExpression()))
|
|
311
|
-
// contentRef.value.length = 0
|
|
312
|
-
t.expressionStatement(
|
|
313
|
-
t.assignmentExpression(
|
|
314
|
-
"=",
|
|
315
|
-
t.memberExpression(t.memberExpression(t.identifier(variableName), t.identifier(valueKey)), t.identifier("length")),
|
|
316
|
-
t.numericLiteral(0)
|
|
317
|
-
)
|
|
318
|
-
)
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
// BlockStatement(p) {
|
|
327
|
-
// const n = p.node
|
|
328
|
-
// if (start && p.parent.type === 'FunctionExpression' && !p.parent.id) {
|
|
329
|
-
// n.body.unshift(t.expressionStatement(t.assignmentExpression('=', t.memberExpression(t.identifier(variableName), t.identifier(valueKey)), t.arrayExpression())))
|
|
330
|
-
// }
|
|
331
|
-
// }
|
|
332
|
-
});
|
|
333
|
-
return {
|
|
334
|
-
code: hasPatched ? content : default2(ast).code,
|
|
335
|
-
hasPatched
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// src/core/runtime-patcher.ts
|
|
340
|
-
import path3 from "node:path";
|
|
341
|
-
import fs4 from "node:fs";
|
|
342
|
-
import { gte } from "semver";
|
|
343
|
-
|
|
344
|
-
// ../../node_modules/.pnpm/defu@6.1.2/node_modules/defu/dist/defu.mjs
|
|
345
|
-
function isObject(value) {
|
|
346
|
-
return value !== null && typeof value === "object";
|
|
347
|
-
}
|
|
348
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
349
|
-
if (!isObject(defaults)) {
|
|
350
|
-
return _defu(baseObject, {}, namespace, merger);
|
|
351
|
-
}
|
|
352
|
-
const object = Object.assign({}, defaults);
|
|
353
|
-
for (const key in baseObject) {
|
|
354
|
-
if (key === "__proto__" || key === "constructor") {
|
|
355
|
-
continue;
|
|
356
|
-
}
|
|
357
|
-
const value = baseObject[key];
|
|
358
|
-
if (value === null || value === void 0) {
|
|
359
|
-
continue;
|
|
360
|
-
}
|
|
361
|
-
if (merger && merger(object, key, value, namespace)) {
|
|
362
|
-
continue;
|
|
363
|
-
}
|
|
364
|
-
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
365
|
-
object[key] = [...value, ...object[key]];
|
|
366
|
-
} else if (isObject(value) && isObject(object[key])) {
|
|
367
|
-
object[key] = _defu(
|
|
368
|
-
value,
|
|
369
|
-
object[key],
|
|
370
|
-
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
371
|
-
merger
|
|
372
|
-
);
|
|
373
|
-
} else {
|
|
374
|
-
object[key] = value;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
return object;
|
|
378
|
-
}
|
|
379
|
-
function createDefu(merger) {
|
|
380
|
-
return (...arguments_) => (
|
|
381
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
382
|
-
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
var defu = createDefu();
|
|
386
|
-
var defuFn = createDefu((object, key, currentValue) => {
|
|
387
|
-
if (typeof object[key] !== "undefined" && typeof currentValue === "function") {
|
|
388
|
-
object[key] = currentValue(object[key]);
|
|
389
|
-
return true;
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
393
|
-
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
394
|
-
object[key] = currentValue(object[key]);
|
|
395
|
-
return true;
|
|
396
|
-
}
|
|
397
|
-
});
|
|
398
|
-
|
|
399
|
-
// src/defaults.ts
|
|
400
|
-
function getDefaultPatchOptions() {
|
|
401
|
-
return {
|
|
402
|
-
overwrite: true
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
// src/core/runtime-patcher.ts
|
|
407
|
-
function getInstalledPkgJsonPath(options = {}) {
|
|
408
|
-
try {
|
|
409
|
-
const tmpJsonPath = requireResolve(`tailwindcss/package.json`, {
|
|
410
|
-
paths: options.paths
|
|
411
|
-
});
|
|
412
|
-
return tmpJsonPath;
|
|
413
|
-
} catch (error) {
|
|
414
|
-
if (error.code === "MODULE_NOT_FOUND") {
|
|
415
|
-
console.warn("Can't find npm pkg: `tailwindcss`, Please ensure it has been installed!");
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
function getPatchOptions(options = {}) {
|
|
420
|
-
return defu(
|
|
421
|
-
options,
|
|
422
|
-
{
|
|
423
|
-
basedir: process.cwd()
|
|
424
|
-
},
|
|
425
|
-
getDefaultPatchOptions()
|
|
426
|
-
);
|
|
427
|
-
}
|
|
428
|
-
function createPatch(opt) {
|
|
429
|
-
return () => {
|
|
430
|
-
try {
|
|
431
|
-
const pkgJsonPath = getInstalledPkgJsonPath(opt);
|
|
432
|
-
return internalPatch(pkgJsonPath, opt);
|
|
433
|
-
} catch (error) {
|
|
434
|
-
console.warn(`patch tailwindcss failed:` + error.message);
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
function monkeyPatchForExposingContext(twDir, opt) {
|
|
439
|
-
const processTailwindFeaturesFilePath = path3.resolve(twDir, "lib/processTailwindFeatures.js");
|
|
440
|
-
const processTailwindFeaturesContent = ensureFileContent(processTailwindFeaturesFilePath);
|
|
441
|
-
const result = {};
|
|
442
|
-
if (processTailwindFeaturesContent) {
|
|
443
|
-
const { code, hasPatched } = inspectProcessTailwindFeaturesReturnContext(processTailwindFeaturesContent);
|
|
444
|
-
if (!hasPatched && opt.overwrite) {
|
|
445
|
-
fs4.writeFileSync(processTailwindFeaturesFilePath, code, {
|
|
446
|
-
encoding: "utf8"
|
|
447
|
-
});
|
|
448
|
-
console.log("patch tailwindcss processTailwindFeatures for return content successfully!");
|
|
449
|
-
}
|
|
450
|
-
result.processTailwindFeatures = code;
|
|
451
|
-
}
|
|
452
|
-
const pluginFilePath = path3.resolve(twDir, "lib/plugin.js");
|
|
453
|
-
const indexFilePath = path3.resolve(twDir, "lib/index.js");
|
|
454
|
-
const pluginContent = ensureFileContent([pluginFilePath, indexFilePath]);
|
|
455
|
-
if (pluginContent) {
|
|
456
|
-
const { code, hasPatched } = inspectPostcssPlugin(pluginContent);
|
|
457
|
-
if (!hasPatched && opt.overwrite) {
|
|
458
|
-
fs4.writeFileSync(pluginFilePath, code, {
|
|
459
|
-
encoding: "utf8"
|
|
460
|
-
});
|
|
461
|
-
console.log("patch tailwindcss for expose runtime content successfully!");
|
|
462
|
-
}
|
|
463
|
-
result.plugin = code;
|
|
464
|
-
}
|
|
465
|
-
opt.custom && typeof opt.custom === "function" && opt.custom(twDir, result);
|
|
466
|
-
return result;
|
|
467
|
-
}
|
|
468
|
-
function internalPatch(pkgJsonPath, options) {
|
|
469
|
-
if (pkgJsonPath) {
|
|
470
|
-
const pkgJson = __require(pkgJsonPath);
|
|
471
|
-
const twDir = path3.dirname(pkgJsonPath);
|
|
472
|
-
if (gte(pkgJson.version, "3.0.0")) {
|
|
473
|
-
options.version = pkgJson.version;
|
|
474
|
-
const result = monkeyPatchForExposingContext(twDir, options);
|
|
475
|
-
return result;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
// src/core/tw-patcher.ts
|
|
481
|
-
import fs5 from "node:fs/promises";
|
|
482
|
-
import { dirname } from "node:path";
|
|
483
|
-
|
|
484
|
-
// src/core/postcss.ts
|
|
485
|
-
import path4 from "node:path";
|
|
486
|
-
import postcss from "postcss";
|
|
487
|
-
import { lilconfig } from "lilconfig";
|
|
488
|
-
import createJiti from "jiti";
|
|
489
|
-
var jiti = createJiti(__filename);
|
|
490
|
-
async function processTailwindcss(options) {
|
|
491
|
-
options.cwd = options.cwd ?? process.cwd();
|
|
492
|
-
let config = options.config;
|
|
493
|
-
if (!(typeof options.config === "string" && path4.isAbsolute(options.config))) {
|
|
494
|
-
const moduleName = "tailwind";
|
|
495
|
-
const result = await lilconfig("tailwindcss", {
|
|
496
|
-
searchPlaces: [`${moduleName}.config.js`, `${moduleName}.config.cjs`],
|
|
497
|
-
loaders: {
|
|
498
|
-
// 默认支持 js 和 cjs 2种格式
|
|
499
|
-
".js": jiti,
|
|
500
|
-
".cjs": jiti,
|
|
501
|
-
".ts": jiti,
|
|
502
|
-
".mjs": jiti
|
|
503
|
-
}
|
|
504
|
-
}).search(options.cwd);
|
|
505
|
-
if (!result) {
|
|
506
|
-
throw new Error(`No TailwindCSS Config found in: ${options.cwd}`);
|
|
507
|
-
}
|
|
508
|
-
config = result.filepath;
|
|
509
|
-
}
|
|
510
|
-
return await postcss([
|
|
511
|
-
__require("tailwindcss")({
|
|
512
|
-
config
|
|
513
|
-
})
|
|
514
|
-
]).process("@tailwind base;@tailwind components;@tailwind utilities;", {
|
|
515
|
-
from: void 0
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
// src/core/tw-patcher.ts
|
|
520
|
-
var TailwindcssPatcher = class {
|
|
521
|
-
rawOptions;
|
|
522
|
-
cacheOptions;
|
|
523
|
-
patchOptions;
|
|
524
|
-
patch;
|
|
525
|
-
cacheManager;
|
|
526
|
-
constructor(options = {}) {
|
|
527
|
-
this.rawOptions = options;
|
|
528
|
-
this.cacheOptions = getCacheOptions(options.cache);
|
|
529
|
-
this.patchOptions = getPatchOptions(options.patch);
|
|
530
|
-
this.patch = createPatch(this.patchOptions);
|
|
531
|
-
this.cacheManager = new CacheManager(this.cacheOptions);
|
|
532
|
-
}
|
|
533
|
-
getPkgEntry(basedir) {
|
|
534
|
-
return getTailwindcssEntry(basedir);
|
|
535
|
-
}
|
|
536
|
-
setCache(set) {
|
|
537
|
-
if (this.cacheOptions.enable) {
|
|
538
|
-
return this.cacheManager.write(set);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
getCache() {
|
|
542
|
-
return this.cacheManager.read();
|
|
543
|
-
}
|
|
544
|
-
/**
|
|
545
|
-
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
|
|
546
|
-
* 详见 taro weapp-tailwindcss 独立分包
|
|
547
|
-
* @param basedir
|
|
548
|
-
* @returns
|
|
549
|
-
*/
|
|
550
|
-
getClassSet(options) {
|
|
551
|
-
const { basedir, cacheStrategy = this.cacheOptions.strategy ?? "merge", removeUniversalSelector = true } = options ?? {};
|
|
552
|
-
const set = getClassCacheSet(basedir, {
|
|
553
|
-
removeUniversalSelector
|
|
554
|
-
});
|
|
555
|
-
if (cacheStrategy === "overwrite") {
|
|
556
|
-
set.size > 0 && this.setCache(set);
|
|
557
|
-
} else if (cacheStrategy === "merge") {
|
|
558
|
-
const cacheSet = this.getCache();
|
|
559
|
-
if (cacheSet) {
|
|
560
|
-
for (const x of cacheSet) {
|
|
561
|
-
set.add(x);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
this.setCache(set);
|
|
565
|
-
}
|
|
566
|
-
return set;
|
|
567
|
-
}
|
|
568
|
-
getContexts(basedir) {
|
|
569
|
-
return getContexts(basedir);
|
|
570
|
-
}
|
|
571
|
-
async extract(options) {
|
|
572
|
-
const { output, tailwindcss } = options ?? {};
|
|
573
|
-
if (output && tailwindcss) {
|
|
574
|
-
const { removeUniversalSelector, filename, loose } = output;
|
|
575
|
-
await processTailwindcss(tailwindcss);
|
|
576
|
-
const set = this.getClassSet({
|
|
577
|
-
removeUniversalSelector
|
|
578
|
-
});
|
|
579
|
-
if (filename) {
|
|
580
|
-
await ensureDir(dirname(filename));
|
|
581
|
-
const classList = [...set];
|
|
582
|
-
await fs5.writeFile(filename, JSON.stringify(classList, null, loose ? 2 : void 0), "utf8");
|
|
583
|
-
return filename;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
// src/core/index.ts
|
|
590
|
-
var core_exports = {};
|
|
591
|
-
__export(core_exports, {
|
|
592
|
-
CacheManager: () => CacheManager,
|
|
593
|
-
TailwindcssPatcher: () => TailwindcssPatcher,
|
|
594
|
-
createPatch: () => createPatch,
|
|
595
|
-
getCacheOptions: () => getCacheOptions,
|
|
596
|
-
getClassCacheSet: () => getClassCacheSet,
|
|
597
|
-
getClassCaches: () => getClassCaches,
|
|
598
|
-
getContexts: () => getContexts,
|
|
599
|
-
getInstalledPkgJsonPath: () => getInstalledPkgJsonPath,
|
|
600
|
-
getPatchOptions: () => getPatchOptions,
|
|
601
|
-
getTailwindcssEntry: () => getTailwindcssEntry,
|
|
602
|
-
inspectPostcssPlugin: () => inspectPostcssPlugin,
|
|
603
|
-
inspectProcessTailwindFeaturesReturnContext: () => inspectProcessTailwindFeaturesReturnContext,
|
|
604
|
-
internalPatch: () => internalPatch,
|
|
605
|
-
monkeyPatchForExposingContext: () => monkeyPatchForExposingContext
|
|
606
|
-
});
|
|
607
|
-
|
|
608
|
-
// src/core/config.ts
|
|
609
|
-
var config_exports = {};
|
|
610
|
-
__reExport(config_exports, config_star);
|
|
611
|
-
import * as config_star from "@tailwindcss-mangle/config";
|
|
612
|
-
|
|
613
|
-
// src/core/index.ts
|
|
614
|
-
__reExport(core_exports, config_exports);
|
|
615
|
-
|
|
616
|
-
export {
|
|
617
|
-
__export,
|
|
618
|
-
__reExport,
|
|
619
|
-
ensureFileContent,
|
|
620
|
-
requireResolve,
|
|
621
|
-
ensureDir,
|
|
622
|
-
getTailwindcssEntry,
|
|
623
|
-
getContexts,
|
|
624
|
-
getClassCaches,
|
|
625
|
-
getClassCacheSet,
|
|
626
|
-
getCacheOptions,
|
|
627
|
-
CacheManager,
|
|
628
|
-
inspectProcessTailwindFeaturesReturnContext,
|
|
629
|
-
inspectPostcssPlugin,
|
|
630
|
-
getInstalledPkgJsonPath,
|
|
631
|
-
getPatchOptions,
|
|
632
|
-
createPatch,
|
|
633
|
-
monkeyPatchForExposingContext,
|
|
634
|
-
internalPatch,
|
|
635
|
-
TailwindcssPatcher,
|
|
636
|
-
core_exports
|
|
637
|
-
};
|
package/dist/cli.d.mts
DELETED
package/dist/cli.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TailwindcssPatcher,
|
|
3
|
-
core_exports,
|
|
4
|
-
createPatch,
|
|
5
|
-
getPatchOptions
|
|
6
|
-
} from "./chunk-W6X43COS.mjs";
|
|
7
|
-
|
|
8
|
-
// src/cli.ts
|
|
9
|
-
import cac from "cac";
|
|
10
|
-
function init() {
|
|
11
|
-
const cwd = process.cwd();
|
|
12
|
-
return (0, core_exports.initConfig)(cwd);
|
|
13
|
-
}
|
|
14
|
-
var cli = cac();
|
|
15
|
-
cli.command("install", "patch install").action(() => {
|
|
16
|
-
const opt = getPatchOptions();
|
|
17
|
-
const patch = createPatch(opt);
|
|
18
|
-
patch();
|
|
19
|
-
});
|
|
20
|
-
cli.command("init").action(async () => {
|
|
21
|
-
await init();
|
|
22
|
-
console.log(`\u2728 ${core_exports.configName}.config.ts initialized!`);
|
|
23
|
-
});
|
|
24
|
-
cli.command("extract").action(async () => {
|
|
25
|
-
const { config } = await (0, core_exports.getConfig)();
|
|
26
|
-
if (config) {
|
|
27
|
-
const twPatcher = new TailwindcssPatcher();
|
|
28
|
-
const p = await twPatcher.extract(config.patch);
|
|
29
|
-
console.log("\u2728 tailwindcss-patch extract success! file path:\n" + p);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
cli.help();
|
|
33
|
-
cli.parse();
|
package/dist/index.d.mts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { Rule, Node } from 'postcss';
|
|
2
|
-
import { Config } from 'tailwindcss';
|
|
3
|
-
import { UserConfig } from '@tailwindcss-mangle/config';
|
|
4
|
-
export * from '@tailwindcss-mangle/config';
|
|
5
|
-
import { SyncOpts } from 'resolve';
|
|
6
|
-
|
|
7
|
-
type CacheStrategy = 'merge' | 'overwrite';
|
|
8
|
-
interface CacheOptions {
|
|
9
|
-
dir?: string;
|
|
10
|
-
cwd?: string;
|
|
11
|
-
file?: string;
|
|
12
|
-
strategy?: CacheStrategy;
|
|
13
|
-
}
|
|
14
|
-
type InternalCacheOptions = CacheOptions & {
|
|
15
|
-
enable?: boolean;
|
|
16
|
-
};
|
|
17
|
-
interface PatchOptions {
|
|
18
|
-
overwrite?: boolean;
|
|
19
|
-
paths?: string[];
|
|
20
|
-
basedir?: string;
|
|
21
|
-
custom?: (dir: string, ctx: Record<string, any>) => void;
|
|
22
|
-
}
|
|
23
|
-
interface InternalPatchOptions {
|
|
24
|
-
overwrite: boolean;
|
|
25
|
-
paths?: string[];
|
|
26
|
-
basedir?: string;
|
|
27
|
-
custom?: (dir: string, ctx: Record<string, any>) => void;
|
|
28
|
-
version?: string;
|
|
29
|
-
}
|
|
30
|
-
interface TailwindcssPatcherOptions {
|
|
31
|
-
cache?: CacheOptions | boolean;
|
|
32
|
-
patch?: PatchOptions;
|
|
33
|
-
}
|
|
34
|
-
type TailwindcssClassCache = Map<string, ({
|
|
35
|
-
layer: string;
|
|
36
|
-
options: Record<string, any>;
|
|
37
|
-
sort: Record<string, any>;
|
|
38
|
-
} | Rule)[]>;
|
|
39
|
-
type TailwindcssRuntimeContext = {
|
|
40
|
-
applyClassCache: Map<any, any>;
|
|
41
|
-
candidateRuleCache: Map<string | string, Set<[
|
|
42
|
-
{
|
|
43
|
-
arbitrary: any;
|
|
44
|
-
index: any;
|
|
45
|
-
layer: string;
|
|
46
|
-
options: any[];
|
|
47
|
-
parallelIndex: any;
|
|
48
|
-
parentLayer: string;
|
|
49
|
-
variants: any;
|
|
50
|
-
},
|
|
51
|
-
Node
|
|
52
|
-
]>>;
|
|
53
|
-
candidateRuleMap: Map<string | string, [object, Node][]>;
|
|
54
|
-
changedContent: any[];
|
|
55
|
-
classCache: TailwindcssClassCache;
|
|
56
|
-
disposables: any[];
|
|
57
|
-
getClassList: Function;
|
|
58
|
-
getClassOrder: Function;
|
|
59
|
-
getVariants: Function;
|
|
60
|
-
markInvalidUtilityCandidate: Function;
|
|
61
|
-
markInvalidUtilityNode: Function;
|
|
62
|
-
notClassCache: Set<string>;
|
|
63
|
-
offsets: {
|
|
64
|
-
layerPositions: object;
|
|
65
|
-
offsets: object;
|
|
66
|
-
reservedVariantBits: any;
|
|
67
|
-
variantOffsets: Map<string, any>;
|
|
68
|
-
};
|
|
69
|
-
postCssNodeCache: Map<object, [Node]>;
|
|
70
|
-
ruleCache: Set<[object, Node]>;
|
|
71
|
-
stylesheetCache: Record<string, Set<any>>;
|
|
72
|
-
tailwindConfig: Config;
|
|
73
|
-
userConfigPath: string | null;
|
|
74
|
-
variantMap: Map<string, [[object, Function]]>;
|
|
75
|
-
variantOptions: Map<string, object>;
|
|
76
|
-
};
|
|
77
|
-
type DeepRequired<T> = {
|
|
78
|
-
[K in keyof T]: Required<DeepRequired<T[K]>>;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
declare function getCacheOptions(options?: CacheOptions | boolean): InternalCacheOptions;
|
|
82
|
-
declare class CacheManager {
|
|
83
|
-
options: Required<CacheOptions> & {
|
|
84
|
-
filename: string;
|
|
85
|
-
};
|
|
86
|
-
constructor(options?: CacheOptions);
|
|
87
|
-
mkdir(cacheDirectory: string): string;
|
|
88
|
-
getOptions(options?: CacheOptions): Required<CacheOptions> & {
|
|
89
|
-
filename: string;
|
|
90
|
-
};
|
|
91
|
-
write(data: Set<string>): string | undefined;
|
|
92
|
-
read(): Set<string> | undefined;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
declare class TailwindcssPatcher {
|
|
96
|
-
rawOptions: TailwindcssPatcherOptions;
|
|
97
|
-
cacheOptions: InternalCacheOptions;
|
|
98
|
-
patchOptions: InternalPatchOptions;
|
|
99
|
-
patch: () => void;
|
|
100
|
-
cacheManager: CacheManager;
|
|
101
|
-
constructor(options?: TailwindcssPatcherOptions);
|
|
102
|
-
getPkgEntry(basedir?: string): string;
|
|
103
|
-
setCache(set: Set<string>): string | undefined;
|
|
104
|
-
getCache(): Set<string> | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
|
|
107
|
-
* 详见 taro weapp-tailwindcss 独立分包
|
|
108
|
-
* @param basedir
|
|
109
|
-
* @returns
|
|
110
|
-
*/
|
|
111
|
-
getClassSet(options?: {
|
|
112
|
-
basedir?: string;
|
|
113
|
-
cacheStrategy?: CacheStrategy;
|
|
114
|
-
removeUniversalSelector?: boolean;
|
|
115
|
-
}): Set<string>;
|
|
116
|
-
getContexts(basedir?: string): TailwindcssRuntimeContext[];
|
|
117
|
-
extract(options: UserConfig['patch']): Promise<string | undefined>;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
declare function getTailwindcssEntry(basedir?: string): string;
|
|
121
|
-
declare function getContexts(basedir?: string): TailwindcssRuntimeContext[];
|
|
122
|
-
declare function getClassCaches(basedir?: string): TailwindcssClassCache[];
|
|
123
|
-
declare function getClassCacheSet(basedir?: string, options?: {
|
|
124
|
-
removeUniversalSelector?: boolean;
|
|
125
|
-
}): Set<string>;
|
|
126
|
-
|
|
127
|
-
declare function inspectProcessTailwindFeaturesReturnContext(content: string): {
|
|
128
|
-
code: string;
|
|
129
|
-
hasPatched: boolean;
|
|
130
|
-
};
|
|
131
|
-
declare function inspectPostcssPlugin(content: string): {
|
|
132
|
-
code: string;
|
|
133
|
-
hasPatched: boolean;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
declare function getInstalledPkgJsonPath(options?: PatchOptions): string | undefined;
|
|
137
|
-
declare function getPatchOptions(options?: PatchOptions): InternalPatchOptions;
|
|
138
|
-
declare function createPatch(opt: InternalPatchOptions): () => any;
|
|
139
|
-
declare function monkeyPatchForExposingContext(twDir: string, opt: InternalPatchOptions): {
|
|
140
|
-
processTailwindFeatures?: string | undefined;
|
|
141
|
-
plugin?: string | undefined;
|
|
142
|
-
} & Record<string, any>;
|
|
143
|
-
declare function internalPatch(pkgJsonPath: string | undefined, options: InternalPatchOptions): any | undefined;
|
|
144
|
-
|
|
145
|
-
declare function ensureFileContent(filepaths: string | string[]): string | undefined;
|
|
146
|
-
declare function requireResolve(id: string, opts?: SyncOpts): string;
|
|
147
|
-
declare function ensureDir(p: string): Promise<void>;
|
|
148
|
-
|
|
149
|
-
export { CacheManager, CacheOptions, CacheStrategy, DeepRequired, InternalCacheOptions, InternalPatchOptions, PatchOptions, TailwindcssClassCache, TailwindcssPatcher, TailwindcssPatcherOptions, TailwindcssRuntimeContext, createPatch, ensureDir, ensureFileContent, getCacheOptions, getClassCacheSet, getClassCaches, getContexts, getInstalledPkgJsonPath, getPatchOptions, getTailwindcssEntry, inspectPostcssPlugin, inspectProcessTailwindFeaturesReturnContext, internalPatch, monkeyPatchForExposingContext, requireResolve };
|
package/dist/index.mjs
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CacheManager,
|
|
3
|
-
TailwindcssPatcher,
|
|
4
|
-
__export,
|
|
5
|
-
__reExport,
|
|
6
|
-
core_exports,
|
|
7
|
-
createPatch,
|
|
8
|
-
ensureDir,
|
|
9
|
-
ensureFileContent,
|
|
10
|
-
getCacheOptions,
|
|
11
|
-
getClassCacheSet,
|
|
12
|
-
getClassCaches,
|
|
13
|
-
getContexts,
|
|
14
|
-
getInstalledPkgJsonPath,
|
|
15
|
-
getPatchOptions,
|
|
16
|
-
getTailwindcssEntry,
|
|
17
|
-
inspectPostcssPlugin,
|
|
18
|
-
inspectProcessTailwindFeaturesReturnContext,
|
|
19
|
-
internalPatch,
|
|
20
|
-
monkeyPatchForExposingContext,
|
|
21
|
-
requireResolve
|
|
22
|
-
} from "./chunk-W6X43COS.mjs";
|
|
23
|
-
|
|
24
|
-
// src/index.ts
|
|
25
|
-
var src_exports = {};
|
|
26
|
-
__export(src_exports, {
|
|
27
|
-
CacheManager: () => CacheManager,
|
|
28
|
-
TailwindcssPatcher: () => TailwindcssPatcher,
|
|
29
|
-
createPatch: () => createPatch,
|
|
30
|
-
ensureDir: () => ensureDir,
|
|
31
|
-
ensureFileContent: () => ensureFileContent,
|
|
32
|
-
getCacheOptions: () => getCacheOptions,
|
|
33
|
-
getClassCacheSet: () => getClassCacheSet,
|
|
34
|
-
getClassCaches: () => getClassCaches,
|
|
35
|
-
getContexts: () => getContexts,
|
|
36
|
-
getInstalledPkgJsonPath: () => getInstalledPkgJsonPath,
|
|
37
|
-
getPatchOptions: () => getPatchOptions,
|
|
38
|
-
getTailwindcssEntry: () => getTailwindcssEntry,
|
|
39
|
-
inspectPostcssPlugin: () => inspectPostcssPlugin,
|
|
40
|
-
inspectProcessTailwindFeaturesReturnContext: () => inspectProcessTailwindFeaturesReturnContext,
|
|
41
|
-
internalPatch: () => internalPatch,
|
|
42
|
-
monkeyPatchForExposingContext: () => monkeyPatchForExposingContext,
|
|
43
|
-
requireResolve: () => requireResolve
|
|
44
|
-
});
|
|
45
|
-
__reExport(src_exports, core_exports);
|
|
46
|
-
export {
|
|
47
|
-
CacheManager,
|
|
48
|
-
TailwindcssPatcher,
|
|
49
|
-
createPatch,
|
|
50
|
-
ensureDir,
|
|
51
|
-
ensureFileContent,
|
|
52
|
-
getCacheOptions,
|
|
53
|
-
getClassCacheSet,
|
|
54
|
-
getClassCaches,
|
|
55
|
-
getContexts,
|
|
56
|
-
getInstalledPkgJsonPath,
|
|
57
|
-
getPatchOptions,
|
|
58
|
-
getTailwindcssEntry,
|
|
59
|
-
inspectPostcssPlugin,
|
|
60
|
-
inspectProcessTailwindFeaturesReturnContext,
|
|
61
|
-
internalPatch,
|
|
62
|
-
monkeyPatchForExposingContext,
|
|
63
|
-
requireResolve
|
|
64
|
-
};
|