weapp-tailwindcss 4.8.3 → 4.8.4
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/{chunk-UCA2DMVN.js → chunk-47NJZTIW.js} +5 -5
- package/dist/{chunk-W5Z3I3S2.js → chunk-5P342MNS.js} +21 -21
- package/dist/{chunk-26ZRX6OH.js → chunk-6EATUPTN.js} +19 -19
- package/dist/{chunk-PLV4QGF4.js → chunk-AXEKXGG7.js} +3 -3
- package/dist/{chunk-E3GZQTOH.mjs → chunk-IHJU6M6B.mjs} +1 -1
- package/dist/chunk-JMYADIPN.mjs +10 -0
- package/dist/{chunk-H34KPZQW.js → chunk-K234IGOT.js} +2 -2
- package/dist/{chunk-N2ZUYGKA.js → chunk-MG4O3AGN.js} +6 -6
- package/dist/chunk-WGLBMNPG.js +7 -0
- package/dist/{chunk-2ZEOKKVA.js → chunk-ZXU4EYKV.js} +4 -4
- package/dist/cli.js +73 -311
- package/dist/cli.mjs +69 -306
- package/dist/core.js +9 -9
- package/dist/core.mjs +1 -1
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +1 -1
- package/dist/index.js +9 -9
- package/dist/index.mjs +2 -2
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.js +3 -3
- package/dist/presets.mjs +1 -1
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +6 -6
- package/dist/vite.mjs +1 -1
- package/dist/webpack.js +7 -7
- package/dist/webpack.mjs +2 -2
- package/dist/webpack4.js +21 -21
- package/dist/webpack4.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-QGH4JZRW.mjs +0 -18
- package/dist/chunk-UJIUFWXE.js +0 -15
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict"; function
|
|
1
|
+
"use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
var _chunkOXASK55Qjs = require('./chunk-OXASK55Q.js');
|
|
4
4
|
|
|
@@ -6,126 +6,20 @@ var _chunkOXASK55Qjs = require('./chunk-OXASK55Q.js');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
require('./chunk-2ZEOKKVA.js');
|
|
9
|
+
var _chunkAXEKXGG7js = require('./chunk-AXEKXGG7.js');
|
|
10
|
+
require('./chunk-ZXU4EYKV.js');
|
|
12
11
|
require('./chunk-ZSTF2AEN.js');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var _chunkUJIUFWXEjs = require('./chunk-UJIUFWXE.js');
|
|
12
|
+
require('./chunk-UW3WHSZ5.js');
|
|
13
|
+
require('./chunk-WGLBMNPG.js');
|
|
20
14
|
|
|
21
15
|
// src/cli.ts
|
|
22
|
-
var _promises = require('fs/promises');
|
|
23
|
-
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
24
16
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
25
|
-
var _cac = require('cac'); var _cac2 = _interopRequireDefault(_cac);
|
|
26
17
|
var _semver = require('semver'); var _semver2 = _interopRequireDefault(_semver);
|
|
27
18
|
var _tailwindcsspatch = require('tailwindcss-patch');
|
|
28
19
|
|
|
29
|
-
// src/cli/config.ts
|
|
30
|
-
var _module = require('module');
|
|
31
|
-
var MODULE_ID = "@tailwindcss-mangle/config";
|
|
32
|
-
var cachedRequire;
|
|
33
|
-
function getNodeRequire() {
|
|
34
|
-
if (cachedRequire) {
|
|
35
|
-
return cachedRequire;
|
|
36
|
-
}
|
|
37
|
-
if (typeof _chunkUJIUFWXEjs.__require === "function") {
|
|
38
|
-
cachedRequire = _chunkUJIUFWXEjs.__require;
|
|
39
|
-
return cachedRequire;
|
|
40
|
-
}
|
|
41
|
-
try {
|
|
42
|
-
cachedRequire = _module.createRequire.call(void 0, _chunkUJIUFWXEjs.importMetaUrl);
|
|
43
|
-
} catch (e) {
|
|
44
|
-
cachedRequire = void 0;
|
|
45
|
-
}
|
|
46
|
-
return cachedRequire;
|
|
47
|
-
}
|
|
48
|
-
async function tryDynamicImport(moduleId) {
|
|
49
|
-
try {
|
|
50
|
-
return await Promise.resolve().then(() => _interopRequireWildcard(require(moduleId)));
|
|
51
|
-
} catch (e2) {
|
|
52
|
-
return void 0;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function tryRequire(moduleId) {
|
|
56
|
-
const nodeRequire = getNodeRequire();
|
|
57
|
-
if (!nodeRequire) {
|
|
58
|
-
return void 0;
|
|
59
|
-
}
|
|
60
|
-
try {
|
|
61
|
-
return nodeRequire(moduleId);
|
|
62
|
-
} catch (e3) {
|
|
63
|
-
return void 0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function isValidModule(mod) {
|
|
67
|
-
return Boolean(mod) && typeof mod.initConfig === "function" && typeof mod.CONFIG_NAME === "string";
|
|
68
|
-
}
|
|
69
|
-
async function loadTailwindcssMangleConfig() {
|
|
70
|
-
const mod = await _asyncNullishCoalesce(await tryDynamicImport(MODULE_ID), async () => ( tryRequire(MODULE_ID)));
|
|
71
|
-
return isValidModule(mod) ? mod : void 0;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
20
|
// src/cli/context.ts
|
|
21
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
75
22
|
|
|
76
|
-
|
|
77
|
-
function mergeTailwindcssPatcherOptions(overrides, current) {
|
|
78
|
-
if (!current) {
|
|
79
|
-
return overrides;
|
|
80
|
-
}
|
|
81
|
-
return _chunkUW3WHSZ5js.defuOverrideArray.call(void 0, overrides, current);
|
|
82
|
-
}
|
|
83
|
-
function resolveEntry(entry, cwd) {
|
|
84
|
-
if (_path2.default.isAbsolute(entry)) {
|
|
85
|
-
return _path2.default.normalize(entry);
|
|
86
|
-
}
|
|
87
|
-
const base = _nullishCoalesce(cwd, () => ( _process2.default.cwd()));
|
|
88
|
-
return _path2.default.normalize(_path2.default.resolve(base, entry));
|
|
89
|
-
}
|
|
90
|
-
function buildTailwindcssPatcherOptions(overrides) {
|
|
91
|
-
if (!overrides) {
|
|
92
|
-
return void 0;
|
|
93
|
-
}
|
|
94
|
-
const filtered = {};
|
|
95
|
-
if (overrides.cwd) {
|
|
96
|
-
filtered.cwd = overrides.cwd;
|
|
97
|
-
}
|
|
98
|
-
if (overrides.output) {
|
|
99
|
-
const output = {};
|
|
100
|
-
if (overrides.output.file) {
|
|
101
|
-
output.file = overrides.output.file;
|
|
102
|
-
}
|
|
103
|
-
if (overrides.output.format) {
|
|
104
|
-
output.format = overrides.output.format;
|
|
105
|
-
}
|
|
106
|
-
if (Object.keys(output).length > 0) {
|
|
107
|
-
filtered.output = output;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return Object.keys(filtered).length > 0 ? filtered : void 0;
|
|
111
|
-
}
|
|
112
|
-
function createCliContext(overrides, resolvedCwd) {
|
|
113
|
-
const userOptions = {
|
|
114
|
-
..._nullishCoalesce(overrides, () => ( {}))
|
|
115
|
-
};
|
|
116
|
-
if (resolvedCwd) {
|
|
117
|
-
if (!userOptions.tailwindcssBasedir) {
|
|
118
|
-
userOptions.tailwindcssBasedir = resolvedCwd;
|
|
119
|
-
}
|
|
120
|
-
const cwdOptions = { cwd: resolvedCwd };
|
|
121
|
-
const current = userOptions.tailwindcssPatcherOptions;
|
|
122
|
-
userOptions.tailwindcssPatcherOptions = mergeTailwindcssPatcherOptions(
|
|
123
|
-
cwdOptions,
|
|
124
|
-
current
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
return _chunkPLV4QGF4js.getCompilerContext.call(void 0, userOptions);
|
|
128
|
-
}
|
|
129
23
|
function formatOutputPath(target, baseDir) {
|
|
130
24
|
const root = _nullishCoalesce(baseDir, () => ( _process2.default.cwd()));
|
|
131
25
|
const relative = _path2.default.relative(root, target);
|
|
@@ -139,7 +33,7 @@ function formatOutputPath(target, baseDir) {
|
|
|
139
33
|
}
|
|
140
34
|
|
|
141
35
|
// src/cli/helpers.ts
|
|
142
|
-
|
|
36
|
+
var _promises = require('fs/promises');
|
|
143
37
|
|
|
144
38
|
|
|
145
39
|
function readStringOption(flag, value) {
|
|
@@ -175,25 +69,6 @@ function readStringArrayOption(flag, value) {
|
|
|
175
69
|
const normalized = readStringOption(flag, value);
|
|
176
70
|
return normalized ? [normalized] : void 0;
|
|
177
71
|
}
|
|
178
|
-
function normalizeTokenFormat(format) {
|
|
179
|
-
switch (format) {
|
|
180
|
-
case "json":
|
|
181
|
-
case "lines":
|
|
182
|
-
case "grouped-json":
|
|
183
|
-
return format;
|
|
184
|
-
default:
|
|
185
|
-
return "json";
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function normalizeExtractFormat(format) {
|
|
189
|
-
if (!format) {
|
|
190
|
-
return void 0;
|
|
191
|
-
}
|
|
192
|
-
if (format === "json" || format === "lines") {
|
|
193
|
-
return format;
|
|
194
|
-
}
|
|
195
|
-
return void 0;
|
|
196
|
-
}
|
|
197
72
|
function toBoolean(value, fallback) {
|
|
198
73
|
if (typeof value === "boolean") {
|
|
199
74
|
return value;
|
|
@@ -242,71 +117,6 @@ function commandAction(handler) {
|
|
|
242
117
|
};
|
|
243
118
|
}
|
|
244
119
|
|
|
245
|
-
// src/cli/tokens.ts
|
|
246
|
-
|
|
247
|
-
async function collectTailwindTokens(patcher) {
|
|
248
|
-
const candidate = patcher;
|
|
249
|
-
if (candidate && typeof candidate.collectContentTokens === "function") {
|
|
250
|
-
return candidate.collectContentTokens();
|
|
251
|
-
}
|
|
252
|
-
throw new Error("The current Tailwind CSS patcher does not support token collection.");
|
|
253
|
-
}
|
|
254
|
-
function formatTokenLine(entry) {
|
|
255
|
-
return `${entry.relativeFile}:${entry.line}:${entry.column} ${entry.rawCandidate} (${entry.start}-${entry.end})`;
|
|
256
|
-
}
|
|
257
|
-
function formatGroupedPreview(map, limit = 3) {
|
|
258
|
-
const files = Object.keys(map);
|
|
259
|
-
if (files.length === 0) {
|
|
260
|
-
return { preview: "", moreFiles: 0 };
|
|
261
|
-
}
|
|
262
|
-
const lines = files.slice(0, limit).map((file) => {
|
|
263
|
-
const tokens = map[file];
|
|
264
|
-
const samples = tokens.slice(0, 3).map((token) => token.rawCandidate).join(", ");
|
|
265
|
-
const suffix = tokens.length > 3 ? ", ..." : "";
|
|
266
|
-
return `${file}: ${tokens.length} tokens (${samples}${suffix})`;
|
|
267
|
-
});
|
|
268
|
-
const moreFiles = files.length > limit ? files.length - limit : 0;
|
|
269
|
-
return {
|
|
270
|
-
preview: lines.join("\n"),
|
|
271
|
-
moreFiles
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
function logTokenPreview(report, format, groupKey) {
|
|
275
|
-
if (format === "lines") {
|
|
276
|
-
const preview = report.entries.slice(0, 5).map(formatTokenLine);
|
|
277
|
-
if (preview.length > 0) {
|
|
278
|
-
_chunkOXASK55Qjs.logger.log("");
|
|
279
|
-
for (const line of preview) {
|
|
280
|
-
_chunkOXASK55Qjs.logger.info(line);
|
|
281
|
-
}
|
|
282
|
-
if (report.entries.length > 5) {
|
|
283
|
-
_chunkOXASK55Qjs.logger.info(`...and ${report.entries.length - 5} more.`);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
if (format === "grouped-json") {
|
|
289
|
-
const grouped = _tailwindcsspatch.groupTokensByFile.call(void 0, report, {
|
|
290
|
-
key: groupKey,
|
|
291
|
-
stripAbsolutePaths: groupKey !== "absolute"
|
|
292
|
-
});
|
|
293
|
-
const { preview, moreFiles } = formatGroupedPreview(grouped);
|
|
294
|
-
if (preview) {
|
|
295
|
-
_chunkOXASK55Qjs.logger.log("");
|
|
296
|
-
_chunkOXASK55Qjs.logger.info(preview);
|
|
297
|
-
if (moreFiles > 0) {
|
|
298
|
-
_chunkOXASK55Qjs.logger.info(`...and ${moreFiles} more files.`);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
const previewEntries = report.entries.slice(0, 3);
|
|
304
|
-
if (previewEntries.length > 0) {
|
|
305
|
-
_chunkOXASK55Qjs.logger.log("");
|
|
306
|
-
_chunkOXASK55Qjs.logger.info(JSON.stringify(previewEntries, null, 2));
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
120
|
// src/cli/vscode-entry.ts
|
|
311
121
|
var _fs = require('fs');
|
|
312
122
|
|
|
@@ -428,126 +238,78 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
428
238
|
}
|
|
429
239
|
|
|
430
240
|
// src/cli.ts
|
|
431
|
-
|
|
432
|
-
if (
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
var cli = _cac2.default.call(void 0, "weapp-tailwindcss");
|
|
438
|
-
cli.command("patch", "Apply Tailwind CSS runtime patches").alias("install").option("--cwd <dir>", "Working directory").option("--record-target", 'Write tailwindcss target metadata (node_modules/.cache/weapp-tailwindcss/tailwindcss-target.json). Pass "--record-target false" to skip.').option("--clear-cache", "Clear tailwindcss-patch cache before patch (opt-in)").action(
|
|
439
|
-
commandAction(async (options) => {
|
|
440
|
-
const resolvedCwd = resolveCliCwd(options.cwd);
|
|
441
|
-
const ctx = createCliContext(void 0, resolvedCwd);
|
|
442
|
-
const shouldClearCache = toBoolean(options.clearCache, false);
|
|
443
|
-
if (shouldClearCache) {
|
|
444
|
-
await _chunkPLV4QGF4js.clearTailwindcssPatcherCache.call(void 0, ctx.twPatcher, { removeDirectory: true });
|
|
445
|
-
}
|
|
446
|
-
_chunkPLV4QGF4js.logTailwindcssTarget.call(void 0, "cli", ctx.twPatcher, ctx.tailwindcssBasedir);
|
|
447
|
-
await ctx.twPatcher.patch();
|
|
448
|
-
const shouldRecordTarget = toBoolean(options.recordTarget, true);
|
|
449
|
-
if (shouldRecordTarget) {
|
|
450
|
-
const recordPath = await _chunkPLV4QGF4js.saveCliPatchTargetRecord.call(void 0, ctx.tailwindcssBasedir, ctx.twPatcher);
|
|
451
|
-
if (recordPath) {
|
|
452
|
-
_chunkOXASK55Qjs.logger.info(`\u8BB0\u5F55 weapp-tw patch \u76EE\u6807 -> ${formatOutputPath(recordPath, resolvedCwd)}`);
|
|
453
|
-
}
|
|
241
|
+
function handleCliError2(error) {
|
|
242
|
+
if (error instanceof Error) {
|
|
243
|
+
_chunkOXASK55Qjs.logger.error(error.message);
|
|
244
|
+
if (error.stack && _process2.default.env.WEAPP_TW_DEBUG === "1") {
|
|
245
|
+
_chunkOXASK55Qjs.logger.error(error.stack);
|
|
454
246
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
247
|
+
} else {
|
|
248
|
+
_chunkOXASK55Qjs.logger.error(String(error));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function withCommandErrorHandling(handler) {
|
|
252
|
+
return (async (ctx, next) => {
|
|
253
|
+
try {
|
|
254
|
+
return await handler(ctx, next);
|
|
255
|
+
} catch (error) {
|
|
256
|
+
handleCliError2(error);
|
|
257
|
+
_process2.default.exitCode = 1;
|
|
258
|
+
return void 0;
|
|
467
259
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
var mountOptions = {
|
|
263
|
+
commandOptions: {
|
|
264
|
+
install: {
|
|
265
|
+
name: "patch",
|
|
266
|
+
aliases: ["install"],
|
|
267
|
+
optionDefs: [
|
|
268
|
+
{
|
|
269
|
+
flags: "--record-target",
|
|
270
|
+
description: 'Write tailwindcss target metadata (node_modules/.cache/weapp-tailwindcss/tailwindcss-target.json). Pass "--record-target false" to skip.',
|
|
271
|
+
config: { default: true }
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
flags: "--clear-cache",
|
|
275
|
+
description: "Clear tailwindcss-patch cache before patch (opt-in)"
|
|
474
276
|
}
|
|
475
|
-
|
|
476
|
-
);
|
|
477
|
-
if (outputOverrides) {
|
|
478
|
-
overrides.tailwindcssPatcherOptions = outputOverrides;
|
|
277
|
+
]
|
|
479
278
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
})
|
|
490
|
-
);
|
|
491
|
-
cli.command("tokens", "Extract Tailwind tokens with location metadata").option("--cwd <dir>", "Working directory").option("--output <file>", "Override output file path").option("--format <format>", "Output format (json|lines|grouped-json)").option("--group-key <key>", "Grouping key for grouped-json output (relative|absolute)").option("--no-write", "Skip writing to disk").action(
|
|
492
|
-
commandAction(async (options) => {
|
|
493
|
-
const resolvedCwd = resolveCliCwd(options.cwd);
|
|
494
|
-
const outputPath = readStringOption("output", options.output);
|
|
495
|
-
const formatInput = readStringOption("format", options.format);
|
|
496
|
-
const groupKeyInput = readStringOption("group-key", options.groupKey);
|
|
497
|
-
const format = normalizeTokenFormat(_nullishCoalesce(formatInput, () => ( "json")));
|
|
498
|
-
const groupKey = groupKeyInput === "absolute" ? "absolute" : "relative";
|
|
499
|
-
const write = toBoolean(options.write, true);
|
|
500
|
-
const ctx = createCliContext(void 0, resolvedCwd);
|
|
501
|
-
const report = await collectTailwindTokens(ctx.twPatcher);
|
|
502
|
-
const baseDir = _nullishCoalesce(resolvedCwd, () => ( _process2.default.cwd()));
|
|
503
|
-
if (write) {
|
|
504
|
-
const targetRelative = _nullishCoalesce(outputPath, () => ( ".tw-patch/tw-token-report.json"));
|
|
505
|
-
const target = _path2.default.resolve(baseDir, targetRelative);
|
|
506
|
-
await ensureDir(_path2.default.dirname(target));
|
|
507
|
-
if (format === "json") {
|
|
508
|
-
await _promises.writeFile.call(void 0, target, `${JSON.stringify(report, null, 2)}
|
|
509
|
-
`, "utf8");
|
|
510
|
-
} else if (format === "grouped-json") {
|
|
511
|
-
const grouped = _tailwindcsspatch.groupTokensByFile.call(void 0, report, {
|
|
512
|
-
key: groupKey,
|
|
513
|
-
stripAbsolutePaths: groupKey !== "absolute"
|
|
514
|
-
});
|
|
515
|
-
await _promises.writeFile.call(void 0, target, `${JSON.stringify(grouped, null, 2)}
|
|
516
|
-
`, "utf8");
|
|
517
|
-
} else {
|
|
518
|
-
const lines = report.entries.map(formatTokenLine);
|
|
519
|
-
await _promises.writeFile.call(void 0, target, `${lines.join("\n")}
|
|
520
|
-
`, "utf8");
|
|
279
|
+
},
|
|
280
|
+
commandHandlers: {
|
|
281
|
+
install: withCommandErrorHandling(async (ctx) => {
|
|
282
|
+
const shouldClearCache = toBoolean(ctx.args.clearCache, false);
|
|
283
|
+
const shouldRecordTarget = toBoolean(ctx.args.recordTarget, true);
|
|
284
|
+
const patcher = await ctx.createPatcher();
|
|
285
|
+
if (shouldClearCache) {
|
|
286
|
+
await _chunkAXEKXGG7js.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
521
287
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
)
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
if (report.skippedFiles.length > 0) {
|
|
530
|
-
_chunkOXASK55Qjs.logger.warn("Skipped files:");
|
|
531
|
-
for (const skipped of report.skippedFiles) {
|
|
532
|
-
_chunkOXASK55Qjs.logger.warn(` - ${skipped.file} (${skipped.reason})`);
|
|
288
|
+
_chunkAXEKXGG7js.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
|
|
289
|
+
await patcher.patch();
|
|
290
|
+
if (shouldRecordTarget) {
|
|
291
|
+
const recordPath = await _chunkAXEKXGG7js.saveCliPatchTargetRecord.call(void 0, ctx.cwd, patcher);
|
|
292
|
+
if (recordPath) {
|
|
293
|
+
_chunkOXASK55Qjs.logger.info(`\u8BB0\u5F55 weapp-tw patch \u76EE\u6807 -> ${formatOutputPath(recordPath, ctx.cwd)}`);
|
|
294
|
+
}
|
|
533
295
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
)
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
);
|
|
296
|
+
_chunkOXASK55Qjs.logger.success("Tailwind CSS \u8FD0\u884C\u65F6\u8865\u4E01\u5DF2\u5B8C\u6210\u3002");
|
|
297
|
+
}),
|
|
298
|
+
extract: withCommandErrorHandling(async (_ctx, next) => next()),
|
|
299
|
+
tokens: withCommandErrorHandling(async (_ctx, next) => next()),
|
|
300
|
+
init: withCommandErrorHandling(async (_ctx, next) => next())
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
_process2.default.title = "node (weapp-tailwindcss)";
|
|
304
|
+
if (_semver2.default.lt(_process2.default.versions.node, _chunkAXEKXGG7js.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
305
|
+
_chunkOXASK55Qjs.logger.warn(
|
|
306
|
+
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkAXEKXGG7js.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
var cli = _tailwindcsspatch.createTailwindcssPatchCli.call(void 0, {
|
|
310
|
+
name: "weapp-tailwindcss",
|
|
311
|
+
mountOptions
|
|
312
|
+
});
|
|
551
313
|
cli.command("vscode-entry", "Generate a VS Code helper CSS for Tailwind IntelliSense").option("--cwd <dir>", "Working directory").option("--css <file>", "Path to the CSS file that imports weapp-tailwindcss (required)").option("--output <file>", `Helper output path. Defaults to ${DEFAULT_VSCODE_ENTRY_OUTPUT}`).option("--source <pattern>", "Additional @source glob (can be repeated)").option("--force", "Overwrite the helper file when it already exists").action(
|
|
552
314
|
commandAction(async (options) => {
|
|
553
315
|
const resolvedCwd = resolveCliCwd(options.cwd);
|