weapp-tailwindcss 4.7.8 → 4.7.10-alpha.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/{chunk-OQ5PKCFN.mjs → chunk-2WJGB2LE.mjs} +1 -1
- package/dist/{chunk-ZSTADQDZ.js → chunk-6MBTOUPD.js} +10 -10
- package/dist/{chunk-6J63FRIY.js → chunk-AEIEPXO3.js} +214 -40
- package/dist/{chunk-DMJK47DW.mjs → chunk-BTPDRSHI.mjs} +1 -1
- package/dist/{chunk-LJ5AQYTF.js → chunk-GRO26PCL.js} +6 -6
- package/dist/{chunk-G7MXWOBI.mjs → chunk-J7OY4W53.mjs} +182 -8
- package/dist/{chunk-HPUZNQ4G.js → chunk-KMCQEHJM.js} +17 -14
- package/dist/{chunk-GCF5VD66.js → chunk-LRD5B5J7.js} +11 -11
- package/dist/{chunk-6NAX73ZA.mjs → chunk-QB67X26Y.mjs} +2 -2
- package/dist/{chunk-UCPNYFTI.js → chunk-XGRBCPBI.js} +1 -1
- package/dist/{chunk-6HQQYIBT.mjs → chunk-YEFXGOXH.mjs} +1 -1
- package/dist/{chunk-SHMBWMDV.mjs → chunk-YW5YW5D4.mjs} +13 -10
- package/dist/cli.js +12 -12
- package/dist/cli.mjs +3 -3
- package/dist/core.js +9 -9
- package/dist/core.mjs +3 -3
- 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 +4 -4
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- 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 +2 -2
- package/dist/types.d.mts +25 -25
- package/dist/types.d.ts +25 -25
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +5 -5
- package/dist/vite.mjs +4 -4
- package/dist/webpack.js +5 -5
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +12 -12
- package/dist/webpack4.mjs +3 -3
- package/package.json +4 -4
|
@@ -16,7 +16,7 @@ var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkAEIEPXO3js = require('./chunk-AEIEPXO3.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
@@ -25,10 +25,10 @@ var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
|
25
25
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
26
26
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
27
27
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
28
|
-
var debug =
|
|
28
|
+
var debug = _chunkAEIEPXO3js.createDebug.call(void 0, );
|
|
29
29
|
var UnifiedWebpackPluginV5 = class {
|
|
30
30
|
constructor(options = {}) {
|
|
31
|
-
this.options =
|
|
31
|
+
this.options = _chunkAEIEPXO3js.getCompilerContext.call(void 0, options);
|
|
32
32
|
this.appType = this.options.appType;
|
|
33
33
|
}
|
|
34
34
|
apply(compiler) {
|
|
@@ -52,18 +52,18 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
52
52
|
}
|
|
53
53
|
const runtimeState = {
|
|
54
54
|
twPatcher: initialTwPatcher,
|
|
55
|
-
patchPromise:
|
|
55
|
+
patchPromise: _chunkAEIEPXO3js.createTailwindPatchPromise.call(void 0, initialTwPatcher),
|
|
56
56
|
refreshTailwindcssPatcher
|
|
57
57
|
};
|
|
58
58
|
const refreshRuntimeState = async (force) => {
|
|
59
|
-
await
|
|
59
|
+
await _chunkAEIEPXO3js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
60
60
|
};
|
|
61
61
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
62
62
|
const { ConcatSource } = sources;
|
|
63
63
|
async function getClassSetInLoader() {
|
|
64
64
|
await refreshRuntimeState(true);
|
|
65
65
|
await runtimeState.patchPromise;
|
|
66
|
-
await
|
|
66
|
+
await _chunkAEIEPXO3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
67
67
|
}
|
|
68
68
|
onLoad();
|
|
69
69
|
const loader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-loader.js")));
|
|
@@ -76,8 +76,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
76
76
|
ident: null,
|
|
77
77
|
type: null
|
|
78
78
|
};
|
|
79
|
-
compiler.hooks.compilation.tap(
|
|
80
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
79
|
+
compiler.hooks.compilation.tap(_chunkAEIEPXO3js.pluginName, (compilation) => {
|
|
80
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkAEIEPXO3js.pluginName, (_loaderContext, module) => {
|
|
81
81
|
if (isExisted) {
|
|
82
82
|
const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
|
|
83
83
|
if (idx > -1) {
|
|
@@ -87,7 +87,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
87
87
|
});
|
|
88
88
|
compilation.hooks.processAssets.tapPromise(
|
|
89
89
|
{
|
|
90
|
-
name:
|
|
90
|
+
name: _chunkAEIEPXO3js.pluginName,
|
|
91
91
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
92
92
|
},
|
|
93
93
|
async (assets) => {
|
|
@@ -156,7 +156,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
156
156
|
const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
|
|
157
157
|
await refreshRuntimeState(true);
|
|
158
158
|
await runtimeState.patchPromise;
|
|
159
|
-
const runtimeSet = await
|
|
159
|
+
const runtimeSet = await _chunkAEIEPXO3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
160
160
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
161
161
|
const tasks = [];
|
|
162
162
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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
|
-
var
|
|
3
|
+
var _chunkKMCQEHJMjs = require('./chunk-KMCQEHJM.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkSMYOFNHJjs = require('./chunk-SMYOFNHJ.js');
|
|
@@ -393,6 +393,177 @@ function initializeCache(cacheConfig) {
|
|
|
393
393
|
return cacheConfig;
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
+
// src/context/compiler-context-cache.ts
|
|
397
|
+
var _buffer = require('buffer');
|
|
398
|
+
|
|
399
|
+
var globalCacheHolder = globalThis;
|
|
400
|
+
var compilerContextCache = _nullishCoalesce(globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__, () => ( (globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ = /* @__PURE__ */ new Map())));
|
|
401
|
+
function compareNormalizedValues(a, b) {
|
|
402
|
+
const aStr = JSON.stringify(a);
|
|
403
|
+
const bStr = JSON.stringify(b);
|
|
404
|
+
return aStr.localeCompare(bStr);
|
|
405
|
+
}
|
|
406
|
+
function withCircularGuard(value, stack, factory) {
|
|
407
|
+
if (stack.has(value)) {
|
|
408
|
+
throw new TypeError("Cannot serialize circular structure in compiler context options");
|
|
409
|
+
}
|
|
410
|
+
stack.add(value);
|
|
411
|
+
try {
|
|
412
|
+
return factory();
|
|
413
|
+
} finally {
|
|
414
|
+
stack.delete(value);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function encodeTaggedValue(type, value) {
|
|
418
|
+
const record = { __type: type };
|
|
419
|
+
if (value !== void 0) {
|
|
420
|
+
record.value = value;
|
|
421
|
+
}
|
|
422
|
+
return record;
|
|
423
|
+
}
|
|
424
|
+
function normalizeOptionsValue(rawValue, stack = /* @__PURE__ */ new WeakSet()) {
|
|
425
|
+
if (rawValue === null) {
|
|
426
|
+
return null;
|
|
427
|
+
}
|
|
428
|
+
if (rawValue === void 0) {
|
|
429
|
+
return encodeTaggedValue("Undefined");
|
|
430
|
+
}
|
|
431
|
+
const type = typeof rawValue;
|
|
432
|
+
if (type === "string") {
|
|
433
|
+
return rawValue;
|
|
434
|
+
}
|
|
435
|
+
if (type === "boolean") {
|
|
436
|
+
return rawValue;
|
|
437
|
+
}
|
|
438
|
+
if (type === "number") {
|
|
439
|
+
const numericValue = rawValue;
|
|
440
|
+
if (Number.isNaN(numericValue)) {
|
|
441
|
+
return encodeTaggedValue("Number", "NaN");
|
|
442
|
+
}
|
|
443
|
+
if (!Number.isFinite(numericValue)) {
|
|
444
|
+
return encodeTaggedValue("Number", numericValue > 0 ? "Infinity" : "-Infinity");
|
|
445
|
+
}
|
|
446
|
+
if (Object.is(numericValue, -0)) {
|
|
447
|
+
return encodeTaggedValue("Number", "-0");
|
|
448
|
+
}
|
|
449
|
+
return numericValue;
|
|
450
|
+
}
|
|
451
|
+
if (type === "bigint") {
|
|
452
|
+
return encodeTaggedValue("BigInt", rawValue.toString());
|
|
453
|
+
}
|
|
454
|
+
if (type === "symbol") {
|
|
455
|
+
const symbolValue = rawValue;
|
|
456
|
+
return encodeTaggedValue("Symbol", _nullishCoalesce(symbolValue.description, () => ( String(symbolValue))));
|
|
457
|
+
}
|
|
458
|
+
if (type === "function") {
|
|
459
|
+
return encodeTaggedValue("Function", rawValue.toString());
|
|
460
|
+
}
|
|
461
|
+
if (Array.isArray(rawValue)) {
|
|
462
|
+
return withCircularGuard(rawValue, stack, () => rawValue.map((item) => normalizeOptionsValue(item, stack)));
|
|
463
|
+
}
|
|
464
|
+
if (rawValue instanceof Date) {
|
|
465
|
+
return encodeTaggedValue("Date", rawValue.toISOString());
|
|
466
|
+
}
|
|
467
|
+
if (rawValue instanceof RegExp) {
|
|
468
|
+
return {
|
|
469
|
+
__type: "RegExp",
|
|
470
|
+
source: rawValue.source,
|
|
471
|
+
flags: rawValue.flags
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
if (typeof _buffer.Buffer !== "undefined" && _buffer.Buffer.isBuffer(rawValue)) {
|
|
475
|
+
return encodeTaggedValue("Buffer", rawValue.toString("base64"));
|
|
476
|
+
}
|
|
477
|
+
if (ArrayBuffer.isView(rawValue)) {
|
|
478
|
+
const view = rawValue;
|
|
479
|
+
const buffer = _buffer.Buffer.from(view.buffer, view.byteOffset, view.byteLength);
|
|
480
|
+
return encodeTaggedValue(_nullishCoalesce(_optionalChain([view, 'access', _14 => _14.constructor, 'optionalAccess', _15 => _15.name]), () => ( "ArrayBufferView")), buffer.toString("base64"));
|
|
481
|
+
}
|
|
482
|
+
if (rawValue instanceof ArrayBuffer) {
|
|
483
|
+
return encodeTaggedValue("ArrayBuffer", _buffer.Buffer.from(rawValue).toString("base64"));
|
|
484
|
+
}
|
|
485
|
+
if (rawValue instanceof Set) {
|
|
486
|
+
return withCircularGuard(rawValue, stack, () => {
|
|
487
|
+
const normalizedEntries = Array.from(rawValue, (element) => normalizeOptionsValue(element, stack));
|
|
488
|
+
normalizedEntries.sort(compareNormalizedValues);
|
|
489
|
+
return {
|
|
490
|
+
__type: "Set",
|
|
491
|
+
value: normalizedEntries
|
|
492
|
+
};
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
if (rawValue instanceof Map) {
|
|
496
|
+
return withCircularGuard(rawValue, stack, () => {
|
|
497
|
+
const normalizedEntries = Array.from(rawValue.entries()).map(([key, entryValue]) => ({
|
|
498
|
+
key: normalizeOptionsValue(key, stack),
|
|
499
|
+
value: normalizeOptionsValue(entryValue, stack)
|
|
500
|
+
}));
|
|
501
|
+
normalizedEntries.sort((a, b) => compareNormalizedValues(a.key, b.key));
|
|
502
|
+
return {
|
|
503
|
+
__type: "Map",
|
|
504
|
+
value: normalizedEntries.map((entry) => [entry.key, entry.value])
|
|
505
|
+
};
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
if (typeof URL !== "undefined" && rawValue instanceof URL) {
|
|
509
|
+
return encodeTaggedValue("URL", rawValue.toString());
|
|
510
|
+
}
|
|
511
|
+
if (rawValue instanceof Error) {
|
|
512
|
+
const errorValue = rawValue;
|
|
513
|
+
return {
|
|
514
|
+
__type: "Error",
|
|
515
|
+
name: errorValue.name,
|
|
516
|
+
message: errorValue.message,
|
|
517
|
+
stack: _nullishCoalesce(errorValue.stack, () => ( ""))
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
if (rawValue instanceof Promise) {
|
|
521
|
+
return encodeTaggedValue("Promise");
|
|
522
|
+
}
|
|
523
|
+
if (rawValue instanceof WeakMap) {
|
|
524
|
+
return encodeTaggedValue("WeakMap");
|
|
525
|
+
}
|
|
526
|
+
if (rawValue instanceof WeakSet) {
|
|
527
|
+
return encodeTaggedValue("WeakSet");
|
|
528
|
+
}
|
|
529
|
+
if (rawValue && typeof rawValue === "object") {
|
|
530
|
+
return withCircularGuard(rawValue, stack, () => {
|
|
531
|
+
const result = {};
|
|
532
|
+
const entries = Object.entries(rawValue);
|
|
533
|
+
entries.sort(([a], [b]) => a.localeCompare(b));
|
|
534
|
+
for (const [key, entryValue] of entries) {
|
|
535
|
+
result[key] = normalizeOptionsValue(entryValue, stack);
|
|
536
|
+
}
|
|
537
|
+
return result;
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
return encodeTaggedValue(typeof rawValue, String(rawValue));
|
|
541
|
+
}
|
|
542
|
+
function createCompilerContextCacheKey(opts) {
|
|
543
|
+
try {
|
|
544
|
+
const normalized = normalizeOptionsValue(_nullishCoalesce(opts, () => ( {})));
|
|
545
|
+
const serialized = JSON.stringify(normalized);
|
|
546
|
+
return _node.md5.call(void 0, serialized);
|
|
547
|
+
} catch (error) {
|
|
548
|
+
_logger.logger.debug("skip compiler context cache: %O", error);
|
|
549
|
+
return void 0;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
function withCompilerContextCache(opts, factory) {
|
|
553
|
+
const cacheKey = createCompilerContextCacheKey(opts);
|
|
554
|
+
if (cacheKey) {
|
|
555
|
+
const cached = compilerContextCache.get(cacheKey);
|
|
556
|
+
if (cached) {
|
|
557
|
+
return cached;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
const ctx = factory();
|
|
561
|
+
if (cacheKey) {
|
|
562
|
+
compilerContextCache.set(cacheKey, ctx);
|
|
563
|
+
}
|
|
564
|
+
return ctx;
|
|
565
|
+
}
|
|
566
|
+
|
|
396
567
|
// src/context/custom-attributes.ts
|
|
397
568
|
function toCustomAttributesEntities(customAttributes) {
|
|
398
569
|
if (!customAttributes) {
|
|
@@ -463,10 +634,10 @@ function createNameMatcher(list, { exact = false } = {}) {
|
|
|
463
634
|
const fuzzyMatcher = exact ? void 0 : buildFuzzyMatcher(fuzzyStrings);
|
|
464
635
|
const hasRegex = regexList.length > 0;
|
|
465
636
|
return (value) => {
|
|
466
|
-
if (exact && _optionalChain([exactStrings, 'optionalAccess',
|
|
637
|
+
if (exact && _optionalChain([exactStrings, 'optionalAccess', _16 => _16.has, 'call', _17 => _17(value)])) {
|
|
467
638
|
return true;
|
|
468
639
|
}
|
|
469
|
-
if (_optionalChain([fuzzyMatcher, 'optionalCall',
|
|
640
|
+
if (_optionalChain([fuzzyMatcher, 'optionalCall', _18 => _18(value)])) {
|
|
470
641
|
return true;
|
|
471
642
|
}
|
|
472
643
|
if (!hasRegex) {
|
|
@@ -544,7 +715,7 @@ function handleEvalTemplateElement(path2, options, updater, handler) {
|
|
|
544
715
|
}
|
|
545
716
|
}
|
|
546
717
|
function walkEvalExpression(path2, options, updater, handler) {
|
|
547
|
-
const maybeTraverse = _optionalChain([path2, 'optionalAccess',
|
|
718
|
+
const maybeTraverse = _optionalChain([path2, 'optionalAccess', _19 => _19.traverse]);
|
|
548
719
|
if (typeof maybeTraverse === "function") {
|
|
549
720
|
try {
|
|
550
721
|
return maybeTraverse.call(path2, {
|
|
@@ -556,21 +727,21 @@ function walkEvalExpression(path2, options, updater, handler) {
|
|
|
556
727
|
}
|
|
557
728
|
});
|
|
558
729
|
} catch (error) {
|
|
559
|
-
const msg = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
730
|
+
const msg = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _20 => _20.message]), () => ( ""));
|
|
560
731
|
const scopeError = /pass a scope and parentPath|traversing a Program\/File/i.test(msg);
|
|
561
732
|
if (!scopeError) {
|
|
562
733
|
throw error;
|
|
563
734
|
}
|
|
564
735
|
}
|
|
565
736
|
}
|
|
566
|
-
const getArgs = _optionalChain([path2, 'optionalAccess',
|
|
737
|
+
const getArgs = _optionalChain([path2, 'optionalAccess', _21 => _21.get, 'optionalCall', _22 => _22("arguments")]);
|
|
567
738
|
if (Array.isArray(getArgs)) {
|
|
568
739
|
for (const arg of getArgs) {
|
|
569
|
-
if (_optionalChain([arg, 'optionalAccess',
|
|
740
|
+
if (_optionalChain([arg, 'optionalAccess', _23 => _23.isStringLiteral, 'optionalCall', _24 => _24()])) {
|
|
570
741
|
handleEvalStringLiteral(arg, options, updater, handler);
|
|
571
742
|
continue;
|
|
572
743
|
}
|
|
573
|
-
if (_optionalChain([arg, 'optionalAccess',
|
|
744
|
+
if (_optionalChain([arg, 'optionalAccess', _25 => _25.isTemplateLiteral, 'optionalCall', _26 => _26()])) {
|
|
574
745
|
for (const quasi of arg.get("quasis")) {
|
|
575
746
|
handleEvalTemplateElement(quasi, options, updater, handler);
|
|
576
747
|
}
|
|
@@ -578,16 +749,16 @@ function walkEvalExpression(path2, options, updater, handler) {
|
|
|
578
749
|
}
|
|
579
750
|
return;
|
|
580
751
|
}
|
|
581
|
-
const nodeArgs = _optionalChain([path2, 'optionalAccess',
|
|
752
|
+
const nodeArgs = _optionalChain([path2, 'optionalAccess', _27 => _27.node, 'optionalAccess', _28 => _28.arguments]);
|
|
582
753
|
if (Array.isArray(nodeArgs)) {
|
|
583
754
|
for (const n of nodeArgs) {
|
|
584
|
-
if (_optionalChain([n, 'optionalAccess',
|
|
755
|
+
if (_optionalChain([n, 'optionalAccess', _29 => _29.type]) === "StringLiteral") {
|
|
585
756
|
const stub = {
|
|
586
757
|
node: n,
|
|
587
758
|
isStringLiteral: () => true
|
|
588
759
|
};
|
|
589
760
|
handleEvalStringLiteral(stub, options, updater, handler);
|
|
590
|
-
} else if (_optionalChain([n, 'optionalAccess',
|
|
761
|
+
} else if (_optionalChain([n, 'optionalAccess', _30 => _30.type]) === "TemplateLiteral" && Array.isArray(n.quasis)) {
|
|
591
762
|
for (const q of n.quasis) {
|
|
592
763
|
const stub = {
|
|
593
764
|
node: q,
|
|
@@ -696,10 +867,10 @@ function shouldTransformClassName(candidate, {
|
|
|
696
867
|
if (!classNameSet.has(candidate)) {
|
|
697
868
|
return false;
|
|
698
869
|
}
|
|
699
|
-
return !_optionalChain([jsPreserveClass, 'optionalCall',
|
|
870
|
+
return !_optionalChain([jsPreserveClass, 'optionalCall', _31 => _31(candidate)]);
|
|
700
871
|
}
|
|
701
872
|
function extractLiteralValue(path2, { unescapeUnicode, arbitraryValues }) {
|
|
702
|
-
const allowDoubleQuotes = _optionalChain([arbitraryValues, 'optionalAccess',
|
|
873
|
+
const allowDoubleQuotes = _optionalChain([arbitraryValues, 'optionalAccess', _32 => _32.allowDoubleQuotes]);
|
|
703
874
|
let offset = 0;
|
|
704
875
|
let original;
|
|
705
876
|
if (path2.isStringLiteral()) {
|
|
@@ -899,7 +1070,7 @@ var JsModuleGraph = class {
|
|
|
899
1070
|
continue;
|
|
900
1071
|
}
|
|
901
1072
|
if (exportPath.isExportNamedDeclaration()) {
|
|
902
|
-
const source = _optionalChain([exportPath, 'access',
|
|
1073
|
+
const source = _optionalChain([exportPath, 'access', _33 => _33.node, 'access', _34 => _34.source, 'optionalAccess', _35 => _35.value]);
|
|
903
1074
|
if (typeof source === "string") {
|
|
904
1075
|
for (const spec of exportPath.get("specifiers")) {
|
|
905
1076
|
if (!spec.isExportSpecifier()) {
|
|
@@ -966,7 +1137,7 @@ var JsModuleGraph = class {
|
|
|
966
1137
|
continue;
|
|
967
1138
|
}
|
|
968
1139
|
if (exportPath.isExportAllDeclaration()) {
|
|
969
|
-
const source = _optionalChain([exportPath, 'access',
|
|
1140
|
+
const source = _optionalChain([exportPath, 'access', _36 => _36.node, 'access', _37 => _37.source, 'optionalAccess', _38 => _38.value]);
|
|
970
1141
|
if (typeof source === "string") {
|
|
971
1142
|
for (const exportName of names) {
|
|
972
1143
|
propagate.push({
|
|
@@ -1018,7 +1189,7 @@ var JsModuleGraph = class {
|
|
|
1018
1189
|
}
|
|
1019
1190
|
for (const exportPath of state.analysis.exportDeclarations) {
|
|
1020
1191
|
if (exportPath.isExportAllDeclaration() || exportPath.isExportNamedDeclaration()) {
|
|
1021
|
-
const source = _optionalChain([exportPath, 'access',
|
|
1192
|
+
const source = _optionalChain([exportPath, 'access', _39 => _39.node, 'access', _40 => _40.source, 'optionalAccess', _41 => _41.value]);
|
|
1022
1193
|
if (typeof source === "string" && !dependencySpecifiers.has(source)) {
|
|
1023
1194
|
dependencySpecifiers.set(source, []);
|
|
1024
1195
|
}
|
|
@@ -1137,14 +1308,14 @@ var NodePathWalker = class {
|
|
|
1137
1308
|
}
|
|
1138
1309
|
this.visited.add(arg);
|
|
1139
1310
|
if (arg.isIdentifier()) {
|
|
1140
|
-
const binding = _optionalChain([arg, 'optionalAccess',
|
|
1311
|
+
const binding = _optionalChain([arg, 'optionalAccess', _42 => _42.scope, 'optionalAccess', _43 => _43.getBinding, 'optionalCall', _44 => _44(arg.node.name)]);
|
|
1141
1312
|
if (binding) {
|
|
1142
1313
|
this.walkNode(binding.path);
|
|
1143
1314
|
}
|
|
1144
1315
|
} else if (arg.isMemberExpression()) {
|
|
1145
1316
|
const objectPath = arg.get("object");
|
|
1146
1317
|
if (objectPath.isIdentifier()) {
|
|
1147
|
-
const binding = _optionalChain([arg, 'optionalAccess',
|
|
1318
|
+
const binding = _optionalChain([arg, 'optionalAccess', _45 => _45.scope, 'optionalAccess', _46 => _46.getBinding, 'optionalCall', _47 => _47(objectPath.node.name)]);
|
|
1148
1319
|
if (binding) {
|
|
1149
1320
|
if (binding.path.isVariableDeclarator()) {
|
|
1150
1321
|
this.walkVariableDeclarator(binding.path);
|
|
@@ -1344,8 +1515,8 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1344
1515
|
}
|
|
1345
1516
|
const objectPath = path2.get("object");
|
|
1346
1517
|
if (objectPath.isIdentifier()) {
|
|
1347
|
-
const scope = _optionalChain([objectPath, 'optionalAccess',
|
|
1348
|
-
const binding = _optionalChain([scope, 'optionalAccess',
|
|
1518
|
+
const scope = _optionalChain([objectPath, 'optionalAccess', _48 => _48.scope]);
|
|
1519
|
+
const binding = _optionalChain([scope, 'optionalAccess', _49 => _49.getBinding, 'optionalCall', _50 => _50(objectPath.node.name)]);
|
|
1349
1520
|
if (binding) {
|
|
1350
1521
|
return resolvesToWeappTwIgnore(binding, seen);
|
|
1351
1522
|
}
|
|
@@ -1374,7 +1545,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1374
1545
|
const init = bindingPath.get("init");
|
|
1375
1546
|
if (init && init.node) {
|
|
1376
1547
|
if (init.isIdentifier()) {
|
|
1377
|
-
const target = _optionalChain([binding, 'optionalAccess',
|
|
1548
|
+
const target = _optionalChain([binding, 'optionalAccess', _51 => _51.scope, 'optionalAccess', _52 => _52.getBinding, 'optionalCall', _53 => _53(init.node.name)]);
|
|
1378
1549
|
if (target) {
|
|
1379
1550
|
result = resolvesToWeappTwIgnore(target, seen);
|
|
1380
1551
|
}
|
|
@@ -1390,7 +1561,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1390
1561
|
const getEffectiveTagPath = (tagPath) => {
|
|
1391
1562
|
let current = tagPath;
|
|
1392
1563
|
while (true) {
|
|
1393
|
-
if (_optionalChain([current, 'access',
|
|
1564
|
+
if (_optionalChain([current, 'access', _54 => _54.isParenthesizedExpression, 'optionalCall', _55 => _55()]) || current.node.type === "ParenthesizedExpression") {
|
|
1394
1565
|
current = current.get("expression");
|
|
1395
1566
|
continue;
|
|
1396
1567
|
}
|
|
@@ -1402,7 +1573,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1402
1573
|
current = current.get("expression");
|
|
1403
1574
|
continue;
|
|
1404
1575
|
}
|
|
1405
|
-
if (_optionalChain([current, 'access',
|
|
1576
|
+
if (_optionalChain([current, 'access', _56 => _56.isTypeCastExpression, 'optionalCall', _57 => _57()])) {
|
|
1406
1577
|
current = current.get("expression");
|
|
1407
1578
|
continue;
|
|
1408
1579
|
}
|
|
@@ -1414,7 +1585,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1414
1585
|
continue;
|
|
1415
1586
|
}
|
|
1416
1587
|
}
|
|
1417
|
-
if (_optionalChain([current, 'access',
|
|
1588
|
+
if (_optionalChain([current, 'access', _58 => _58.isCallExpression, 'optionalCall', _59 => _59()]) || current.node.type === "CallExpression") {
|
|
1418
1589
|
const callee = current.get("callee");
|
|
1419
1590
|
current = callee;
|
|
1420
1591
|
continue;
|
|
@@ -1424,7 +1595,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1424
1595
|
return current;
|
|
1425
1596
|
};
|
|
1426
1597
|
const evaluateTagPath = (tagPath) => {
|
|
1427
|
-
if (_optionalChain([tagPath, 'access',
|
|
1598
|
+
if (_optionalChain([tagPath, 'access', _60 => _60.isCallExpression, 'optionalCall', _61 => _61()]) || tagPath.node.type === "CallExpression") {
|
|
1428
1599
|
const calleePath = tagPath.get("callee");
|
|
1429
1600
|
return evaluateTagPath(calleePath);
|
|
1430
1601
|
}
|
|
@@ -1432,7 +1603,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1432
1603
|
if (matcher(tagPath.node.name)) {
|
|
1433
1604
|
return true;
|
|
1434
1605
|
}
|
|
1435
|
-
const binding = _optionalChain([tagPath, 'optionalAccess',
|
|
1606
|
+
const binding = _optionalChain([tagPath, 'optionalAccess', _62 => _62.scope, 'optionalAccess', _63 => _63.getBinding, 'optionalCall', _64 => _64(tagPath.node.name)]);
|
|
1436
1607
|
if (binding) {
|
|
1437
1608
|
return resolvesToWeappTwIgnore(binding, /* @__PURE__ */ new Set());
|
|
1438
1609
|
}
|
|
@@ -1555,11 +1726,11 @@ function analyzeSource(ast, options, handler) {
|
|
|
1555
1726
|
return;
|
|
1556
1727
|
}
|
|
1557
1728
|
const calleePath = p.get("callee");
|
|
1558
|
-
if (calleePath.isIdentifier({ name: "require" }) && !_optionalChain([p, 'optionalAccess',
|
|
1729
|
+
if (calleePath.isIdentifier({ name: "require" }) && !_optionalChain([p, 'optionalAccess', _65 => _65.scope, 'optionalAccess', _66 => _66.hasBinding, 'optionalCall', _67 => _67("require")])) {
|
|
1559
1730
|
const args = p.get("arguments");
|
|
1560
1731
|
if (Array.isArray(args) && args.length > 0) {
|
|
1561
1732
|
const first = args[0];
|
|
1562
|
-
if (_optionalChain([first, 'optionalAccess',
|
|
1733
|
+
if (_optionalChain([first, 'optionalAccess', _68 => _68.isStringLiteral, 'call', _69 => _69()])) {
|
|
1563
1734
|
requireCallPaths.push(first);
|
|
1564
1735
|
}
|
|
1565
1736
|
}
|
|
@@ -1958,7 +2129,7 @@ function generateCode(match, options = {}) {
|
|
|
1958
2129
|
if (t.isMemberExpression(path2.parent)) {
|
|
1959
2130
|
return;
|
|
1960
2131
|
}
|
|
1961
|
-
if (t.isBinaryExpression(path2.parent) && (t.isConditionalExpression(_optionalChain([path2, 'access',
|
|
2132
|
+
if (t.isBinaryExpression(path2.parent) && (t.isConditionalExpression(_optionalChain([path2, 'access', _70 => _70.parentPath, 'optionalAccess', _71 => _71.parent])) || t.isLogicalExpression(_optionalChain([path2, 'access', _72 => _72.parentPath, 'optionalAccess', _73 => _73.parent])))) {
|
|
1962
2133
|
return;
|
|
1963
2134
|
}
|
|
1964
2135
|
jsTokenUpdater.addToken(
|
|
@@ -2071,7 +2242,7 @@ async function customTemplateHandler(rawSource, options) {
|
|
|
2071
2242
|
}
|
|
2072
2243
|
const lowerName = name.toLowerCase();
|
|
2073
2244
|
const shouldHandleDefault = !disabledDefaultTemplateHandler && (lowerName === "class" || lowerName === "hover-class" || lowerName === "virtualhostclass");
|
|
2074
|
-
const shouldHandleCustom = _nullishCoalesce(_optionalChain([matchCustomAttribute, 'optionalCall',
|
|
2245
|
+
const shouldHandleCustom = _nullishCoalesce(_optionalChain([matchCustomAttribute, 'optionalCall', _74 => _74(tag, name)]), () => ( false));
|
|
2075
2246
|
if (!shouldHandleDefault && !shouldHandleCustom) {
|
|
2076
2247
|
return;
|
|
2077
2248
|
}
|
|
@@ -2266,20 +2437,20 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
2266
2437
|
if (!patcher) {
|
|
2267
2438
|
return;
|
|
2268
2439
|
}
|
|
2269
|
-
const cacheOptions = _optionalChain([patcher, 'access',
|
|
2440
|
+
const cacheOptions = _optionalChain([patcher, 'access', _75 => _75.options, 'optionalAccess', _76 => _76.cache]);
|
|
2270
2441
|
if (cacheOptions == null || typeof cacheOptions === "object" && cacheOptions.enabled === false) {
|
|
2271
2442
|
return;
|
|
2272
2443
|
}
|
|
2273
2444
|
const cachePaths = /* @__PURE__ */ new Map();
|
|
2274
2445
|
const normalizedCacheOptions = typeof cacheOptions === "object" ? cacheOptions : void 0;
|
|
2275
|
-
if (_optionalChain([normalizedCacheOptions, 'optionalAccess',
|
|
2446
|
+
if (_optionalChain([normalizedCacheOptions, 'optionalAccess', _77 => _77.path])) {
|
|
2276
2447
|
cachePaths.set(normalizedCacheOptions.path, false);
|
|
2277
2448
|
}
|
|
2278
|
-
const privateCachePath = _optionalChain([patcher, 'optionalAccess',
|
|
2449
|
+
const privateCachePath = _optionalChain([patcher, 'optionalAccess', _78 => _78.cacheStore, 'optionalAccess', _79 => _79.options, 'optionalAccess', _80 => _80.path]);
|
|
2279
2450
|
if (privateCachePath) {
|
|
2280
2451
|
cachePaths.set(privateCachePath, false);
|
|
2281
2452
|
}
|
|
2282
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2453
|
+
if (_optionalChain([options, 'optionalAccess', _81 => _81.removeDirectory]) && _optionalChain([normalizedCacheOptions, 'optionalAccess', _82 => _82.dir])) {
|
|
2283
2454
|
cachePaths.set(normalizedCacheOptions.dir, true);
|
|
2284
2455
|
}
|
|
2285
2456
|
if (!cachePaths.size) {
|
|
@@ -2290,14 +2461,14 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
2290
2461
|
await _promises.rm.call(void 0, cachePath, { force: true, recursive });
|
|
2291
2462
|
} catch (error) {
|
|
2292
2463
|
const err = error;
|
|
2293
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
2464
|
+
if (_optionalChain([err, 'optionalAccess', _83 => _83.code]) === "ENOENT") {
|
|
2294
2465
|
continue;
|
|
2295
2466
|
}
|
|
2296
2467
|
_logger.logger.debug("failed to clear tailwindcss patcher cache: %s %O", cachePath, err);
|
|
2297
2468
|
}
|
|
2298
2469
|
}
|
|
2299
2470
|
}
|
|
2300
|
-
function
|
|
2471
|
+
function createInternalCompilerContext(opts) {
|
|
2301
2472
|
const ctx = _chunkUW3WHSZ5js.defuOverrideArray.call(void 0,
|
|
2302
2473
|
opts,
|
|
2303
2474
|
_chunkSMYOFNHJjs.getDefaultOptions.call(void 0, ),
|
|
@@ -2305,9 +2476,9 @@ function getCompilerContext(opts) {
|
|
|
2305
2476
|
);
|
|
2306
2477
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2307
2478
|
applyLoggerLevel(ctx.logLevel);
|
|
2308
|
-
const twPatcher =
|
|
2479
|
+
const twPatcher = _chunkKMCQEHJMjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2309
2480
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
2310
|
-
if (_optionalChain([twPatcher, 'access',
|
|
2481
|
+
if (_optionalChain([twPatcher, 'access', _84 => _84.packageInfo, 'optionalAccess', _85 => _85.version])) {
|
|
2311
2482
|
_logger.logger.success(`\u5F53\u524D\u4F7F\u7528 ${_logger.pc.cyanBright("Tailwind CSS")} \u7248\u672C\u4E3A: ${_logger.pc.underline(_logger.pc.bold(_logger.pc.green(twPatcher.packageInfo.version)))}`);
|
|
2312
2483
|
} else {
|
|
2313
2484
|
_logger.logger.warn(`${_logger.pc.cyanBright("Tailwind CSS")} \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7\u7248\u672C\u68C0\u6D4B\u4E0E\u8865\u4E01\u5E94\u7528\u3002`);
|
|
@@ -2331,11 +2502,11 @@ function getCompilerContext(opts) {
|
|
|
2331
2502
|
ctx.twPatcher = twPatcher;
|
|
2332
2503
|
const refreshTailwindcssPatcher = async (options) => {
|
|
2333
2504
|
const previousPatcher = ctx.twPatcher;
|
|
2334
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2505
|
+
if (_optionalChain([options, 'optionalAccess', _86 => _86.clearCache]) !== false) {
|
|
2335
2506
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
2336
2507
|
}
|
|
2337
2508
|
invalidateRuntimeClassSet(previousPatcher);
|
|
2338
|
-
const nextPatcher =
|
|
2509
|
+
const nextPatcher = _chunkKMCQEHJMjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2339
2510
|
Object.assign(previousPatcher, nextPatcher);
|
|
2340
2511
|
ctx.twPatcher = previousPatcher;
|
|
2341
2512
|
return previousPatcher;
|
|
@@ -2347,6 +2518,9 @@ function getCompilerContext(opts) {
|
|
|
2347
2518
|
});
|
|
2348
2519
|
return ctx;
|
|
2349
2520
|
}
|
|
2521
|
+
function getCompilerContext(opts) {
|
|
2522
|
+
return withCompilerContextCache(opts, () => createInternalCompilerContext(opts));
|
|
2523
|
+
}
|
|
2350
2524
|
|
|
2351
2525
|
|
|
2352
2526
|
|
|
@@ -5,7 +5,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
5
5
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.1__@swc+core@1.15.
|
|
8
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.1__@swc+core@1.15.2_@swc+h_714fe42112a7ecb62f8dfb6a41f9e513/node_modules/tsup/assets/esm_shims.js
|
|
9
9
|
import path from "path";
|
|
10
10
|
import { fileURLToPath } from "url";
|
|
11
11
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -7,7 +7,7 @@ var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkAEIEPXO3js = require('./chunk-AEIEPXO3.js');
|
|
11
11
|
|
|
12
12
|
// src/bundlers/gulp/index.ts
|
|
13
13
|
var _buffer = require('buffer');
|
|
@@ -15,21 +15,21 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
15
15
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
16
16
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
17
17
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
18
|
-
var debug =
|
|
18
|
+
var debug = _chunkAEIEPXO3js.createDebug.call(void 0, );
|
|
19
19
|
var Transform = _stream2.default.Transform;
|
|
20
20
|
function createPlugins(options = {}) {
|
|
21
|
-
const opts =
|
|
21
|
+
const opts = _chunkAEIEPXO3js.getCompilerContext.call(void 0, options);
|
|
22
22
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
23
23
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
24
24
|
const runtimeState = {
|
|
25
25
|
twPatcher: initialTwPatcher,
|
|
26
|
-
patchPromise:
|
|
26
|
+
patchPromise: _chunkAEIEPXO3js.createTailwindPatchPromise.call(void 0, initialTwPatcher),
|
|
27
27
|
refreshTailwindcssPatcher
|
|
28
28
|
};
|
|
29
29
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
30
30
|
let runtimeSetInitialized = false;
|
|
31
31
|
async function refreshRuntimeState(force) {
|
|
32
|
-
await
|
|
32
|
+
await _chunkAEIEPXO3js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
33
33
|
}
|
|
34
34
|
async function refreshRuntimeSet(force = false) {
|
|
35
35
|
await refreshRuntimeState(force);
|
|
@@ -37,7 +37,7 @@ function createPlugins(options = {}) {
|
|
|
37
37
|
if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
|
|
38
38
|
return runtimeSet;
|
|
39
39
|
}
|
|
40
|
-
runtimeSet = await
|
|
40
|
+
runtimeSet = await _chunkAEIEPXO3js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
41
41
|
runtimeSetInitialized = true;
|
|
42
42
|
return runtimeSet;
|
|
43
43
|
}
|