weapp-tailwindcss 4.9.2-alpha.1 → 4.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-W3Z55EVM.mjs → chunk-2L6NDZIQ.mjs} +2 -2
- package/dist/{chunk-ORSWL3MI.js → chunk-2WPTDMN3.js} +2 -2
- package/dist/{chunk-FAUL26KB.mjs → chunk-5AKI6FQP.mjs} +4 -4
- package/dist/{chunk-Y4A76SWP.js → chunk-5O6237HX.js} +37 -29
- package/dist/{chunk-VZLUWOGQ.mjs → chunk-CBOVUIXD.mjs} +1 -1
- package/dist/{chunk-EOCBETCN.js → chunk-DNRNFN4I.js} +5 -5
- package/dist/{chunk-OU6P3233.mjs → chunk-DSD5JRCQ.mjs} +2 -2
- package/dist/{chunk-SM5V25IN.mjs → chunk-FFGR5V3H.mjs} +1 -1
- package/dist/{chunk-GKFJPK5V.mjs → chunk-G5OV7IOU.mjs} +2 -2
- package/dist/{chunk-O2XZFBRS.js → chunk-SNEMGP42.js} +29 -29
- package/dist/{chunk-IC2XBOKV.js → chunk-U7BH6QHE.js} +23 -23
- package/dist/{chunk-MB4BR57E.js → chunk-UAEME5HT.js} +1 -1
- package/dist/{chunk-HNNJH4ZX.js → chunk-VU2GIXVH.js} +7 -7
- package/dist/{chunk-2QR4UOHA.js → chunk-W3MTTQ5M.js} +5 -5
- package/dist/{chunk-IK5SFZ6A.mjs → chunk-WGBJY2H3.mjs} +2 -2
- package/dist/{chunk-D2ZOXBOU.js → chunk-XXJNXESJ.js} +7 -7
- package/dist/{chunk-3LRQLHOG.mjs → chunk-ZE7JKKFT.mjs} +15 -7
- package/dist/cli.js +39 -39
- package/dist/cli.mjs +3 -3
- package/dist/core.js +10 -10
- package/dist/core.mjs +4 -4
- 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 +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/index.js +10 -10
- package/dist/index.mjs +8 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.js +5 -5
- package/dist/presets.mjs +2 -2
- package/dist/reset.js +1 -1
- package/dist/reset.mjs +1 -1
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +5 -5
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +6 -6
- package/dist/webpack4.js +32 -32
- package/dist/webpack4.mjs +5 -5
- package/package.json +4 -4
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkW3MTTQ5Mjs = require('./chunk-W3MTTQ5M.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -23,7 +23,7 @@ var _chunk2QR4UOHAjs = require('./chunk-2QR4UOHA.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -56,7 +56,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
56
56
|
const start = prop.value.loc.start.offset + 1;
|
|
57
57
|
const end = prop.value.loc.end.offset - 1;
|
|
58
58
|
if (start < end) {
|
|
59
|
-
ms.update(start, end,
|
|
59
|
+
ms.update(start, end, _chunkXXJNXESJjs.replaceWxml.call(void 0, prop.value.content));
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -68,7 +68,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
68
68
|
if (start >= end) {
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const generated =
|
|
71
|
+
const generated = _chunkXXJNXESJjs.generateCode.call(void 0, prop.exp.content, {
|
|
72
72
|
jsHandler,
|
|
73
73
|
runtimeSet,
|
|
74
74
|
wrapExpression: true
|
|
@@ -97,7 +97,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
100
|
-
const matchCustomAttribute =
|
|
100
|
+
const matchCustomAttribute = _chunkXXJNXESJjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
101
101
|
const ms = new (0, _magicstring2.default)(code);
|
|
102
102
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
103
103
|
if (errors.length === 0) {
|
|
@@ -364,7 +364,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
364
364
|
runtimeSet,
|
|
365
365
|
applyLinkedResults: applyLinkedResults2
|
|
366
366
|
} = options;
|
|
367
|
-
const absoluteFile =
|
|
367
|
+
const absoluteFile = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
368
368
|
const rawSource = originalSource.source.toString();
|
|
369
369
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
370
370
|
cache,
|
|
@@ -399,8 +399,8 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
// src/bundlers/vite/index.ts
|
|
402
|
-
var debug =
|
|
403
|
-
var weappTailwindcssPackageDir =
|
|
402
|
+
var debug = _chunkXXJNXESJjs.createDebug.call(void 0, );
|
|
403
|
+
var weappTailwindcssPackageDir = _chunk2WPTDMN3js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
404
404
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
405
405
|
function joinPosixPath(base, subpath) {
|
|
406
406
|
if (base.endsWith("/")) {
|
|
@@ -444,7 +444,7 @@ function isJavaScriptEntry(entry) {
|
|
|
444
444
|
function createBundleModuleGraphOptions(outputDir, entries) {
|
|
445
445
|
return {
|
|
446
446
|
resolve(specifier, importer) {
|
|
447
|
-
return
|
|
447
|
+
return _chunk2WPTDMN3js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => entries.has(candidate));
|
|
448
448
|
},
|
|
449
449
|
load(id) {
|
|
450
450
|
const entry = entries.get(id);
|
|
@@ -482,7 +482,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
482
482
|
}
|
|
483
483
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
484
484
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
485
|
-
const opts =
|
|
485
|
+
const opts = _chunkXXJNXESJjs.getCompilerContext.call(void 0, options);
|
|
486
486
|
const {
|
|
487
487
|
disabled,
|
|
488
488
|
customAttributes,
|
|
@@ -501,17 +501,17 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
501
501
|
uniAppX,
|
|
502
502
|
disabledDefaultTemplateHandler
|
|
503
503
|
} = opts;
|
|
504
|
-
const disabledOptions =
|
|
504
|
+
const disabledOptions = _chunk2WPTDMN3js.resolveDisabledOptions.call(void 0, disabled);
|
|
505
505
|
const tailwindcssMajorVersion = _nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0));
|
|
506
506
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
|
|
507
507
|
const rewritePlugins = !shouldRewriteCssImports ? [] : [
|
|
508
508
|
{
|
|
509
|
-
name: `${
|
|
509
|
+
name: `${_chunkXXJNXESJjs.vitePluginName}:rewrite-css-imports`,
|
|
510
510
|
enforce: "pre",
|
|
511
511
|
resolveId: {
|
|
512
512
|
order: "pre",
|
|
513
513
|
handler(id, importer) {
|
|
514
|
-
const replacement =
|
|
514
|
+
const replacement = _chunk2WPTDMN3js.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix, {
|
|
515
515
|
join: joinPosixPath,
|
|
516
516
|
appType
|
|
517
517
|
});
|
|
@@ -530,7 +530,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
530
530
|
if (!isCSSRequest(id)) {
|
|
531
531
|
return null;
|
|
532
532
|
}
|
|
533
|
-
const rewritten =
|
|
533
|
+
const rewritten = _chunk2WPTDMN3js.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix, {
|
|
534
534
|
join: joinPosixPath,
|
|
535
535
|
appType
|
|
536
536
|
});
|
|
@@ -548,8 +548,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
548
548
|
if (disabledOptions.plugin) {
|
|
549
549
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
550
550
|
}
|
|
551
|
-
const customAttributesEntities =
|
|
552
|
-
const patchRecorderState =
|
|
551
|
+
const customAttributesEntities = _chunkXXJNXESJjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
552
|
+
const patchRecorderState = _chunkW3MTTQ5Mjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
553
553
|
source: "runtime",
|
|
554
554
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
555
555
|
});
|
|
@@ -563,7 +563,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
563
563
|
let runtimeSetPromise;
|
|
564
564
|
let resolvedConfig;
|
|
565
565
|
async function refreshRuntimeState(force) {
|
|
566
|
-
const refreshed = await
|
|
566
|
+
const refreshed = await _chunkXXJNXESJjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
567
567
|
if (refreshed) {
|
|
568
568
|
runtimeSet = void 0;
|
|
569
569
|
runtimeSetPromise = void 0;
|
|
@@ -576,7 +576,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
576
576
|
return runtimeSet;
|
|
577
577
|
}
|
|
578
578
|
if (force || !runtimeSetPromise) {
|
|
579
|
-
const task2 =
|
|
579
|
+
const task2 = _chunkXXJNXESJjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
580
580
|
force: force || !runtimeSet,
|
|
581
581
|
skipRefresh: force
|
|
582
582
|
});
|
|
@@ -611,7 +611,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
611
611
|
const plugins = [
|
|
612
612
|
...rewritePlugins,
|
|
613
613
|
{
|
|
614
|
-
name: `${
|
|
614
|
+
name: `${_chunkXXJNXESJjs.vitePluginName}:post`,
|
|
615
615
|
enforce: "post",
|
|
616
616
|
configResolved(config) {
|
|
617
617
|
resolvedConfig = config;
|
|
@@ -637,7 +637,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
637
637
|
for (const [fileName, output] of entries) {
|
|
638
638
|
const entry = { fileName, output };
|
|
639
639
|
if (isJavaScriptEntry(entry)) {
|
|
640
|
-
const absolute =
|
|
640
|
+
const absolute = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, fileName, outDir);
|
|
641
641
|
jsEntries.set(absolute, entry);
|
|
642
642
|
}
|
|
643
643
|
}
|
|
@@ -704,7 +704,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
704
704
|
if (Array.isArray(groupedEntries.js)) {
|
|
705
705
|
for (const [file, originalSource] of groupedEntries.js) {
|
|
706
706
|
if (originalSource.type === "chunk") {
|
|
707
|
-
const absoluteFile =
|
|
707
|
+
const absoluteFile = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
708
708
|
const initialRawSource = originalSource.code;
|
|
709
709
|
jsTaskFactories.push(async () => {
|
|
710
710
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
@@ -785,7 +785,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
785
785
|
);
|
|
786
786
|
}
|
|
787
787
|
}
|
|
788
|
-
|
|
788
|
+
_chunk2WPTDMN3js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
789
789
|
await Promise.all(tasks);
|
|
790
790
|
for (const apply of pendingLinkedUpdates) {
|
|
791
791
|
apply();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.4__@swc+core@1.15.7_@swc+h_4d5dc336679991eff78ae0f04625a6b1/node_modules/tsup/assets/cjs_shims.js
|
|
2
2
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
3
3
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
4
4
|
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkW3MTTQ5Mjs = require('./chunk-W3MTTQ5M.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
var _buffer = require('buffer');
|
|
@@ -17,12 +17,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
17
17
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
18
18
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
19
19
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
20
|
-
var debug =
|
|
20
|
+
var debug = _chunkXXJNXESJjs.createDebug.call(void 0, );
|
|
21
21
|
var Transform = _stream2.default.Transform;
|
|
22
22
|
function createPlugins(options = {}) {
|
|
23
|
-
const opts =
|
|
23
|
+
const opts = _chunkXXJNXESJjs.getCompilerContext.call(void 0, options);
|
|
24
24
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
25
|
-
const patchRecorderState =
|
|
25
|
+
const patchRecorderState = _chunkW3MTTQ5Mjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
26
26
|
source: "runtime",
|
|
27
27
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
28
28
|
});
|
|
@@ -36,7 +36,7 @@ function createPlugins(options = {}) {
|
|
|
36
36
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
37
37
|
let runtimeSetInitialized = false;
|
|
38
38
|
async function refreshRuntimeState(force) {
|
|
39
|
-
await
|
|
39
|
+
await _chunkXXJNXESJjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
40
40
|
}
|
|
41
41
|
async function refreshRuntimeSet(force = false) {
|
|
42
42
|
await refreshRuntimeState(force);
|
|
@@ -44,7 +44,7 @@ function createPlugins(options = {}) {
|
|
|
44
44
|
if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
|
|
45
45
|
return runtimeSet;
|
|
46
46
|
}
|
|
47
|
-
runtimeSet = await
|
|
47
|
+
runtimeSet = await _chunkXXJNXESJjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
48
48
|
runtimeSetInitialized = true;
|
|
49
49
|
return runtimeSet;
|
|
50
50
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk5O6237HXjs = require('./chunk-5O6237HX.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkXXJNXESJjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
|
|
12
12
|
if (_optionalChain([recorder, 'optionalAccess', _ => _.message]) && _optionalChain([options, 'optionalAccess', _2 => _2.logMessage]) !== false) {
|
|
13
13
|
const prefix = _optionalChain([options, 'optionalAccess', _3 => _3.messagePrefix]) ? `${options.messagePrefix} ` : "";
|
|
14
|
-
|
|
14
|
+
_chunk5O6237HXjs.logger.info("%s%s", prefix, recorder.message);
|
|
15
15
|
}
|
|
16
16
|
const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _4 => _4.onPatched]) ? async () => {
|
|
17
17
|
await recorder.onPatched();
|
|
18
18
|
} : void 0;
|
|
19
|
-
const patchPromise = patcher ?
|
|
19
|
+
const patchPromise = patcher ? _chunkXXJNXESJjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createTailwindcssPatcherFromContext,
|
|
4
4
|
findNearestPackageRoot,
|
|
5
5
|
warnMissingCssEntries
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZE7JKKFT.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getDefaultOptions
|
|
9
9
|
} from "./chunk-HWF5U4CI.mjs";
|
|
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
187
187
|
// package.json
|
|
188
188
|
var package_default = {
|
|
189
189
|
name: "weapp-tailwindcss",
|
|
190
|
-
version: "4.9.2
|
|
190
|
+
version: "4.9.2",
|
|
191
191
|
description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
|
|
192
192
|
author: "ice breaker <1324318532@qq.com>",
|
|
193
193
|
license: "MIT",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk5O6237HXjs = require('./chunk-5O6237HX.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkFYYBY3VKjs = require('./chunk-FYYBY3VK.js');
|
|
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
187
187
|
// package.json
|
|
188
188
|
var package_default = {
|
|
189
189
|
name: "weapp-tailwindcss",
|
|
190
|
-
version: "4.9.2
|
|
190
|
+
version: "4.9.2",
|
|
191
191
|
description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
|
|
192
192
|
author: "ice breaker <1324318532@qq.com>",
|
|
193
193
|
license: "MIT",
|
|
@@ -543,7 +543,7 @@ function formatRelativeToBase(targetPath, baseDir) {
|
|
|
543
543
|
}
|
|
544
544
|
function resolveRecordLocation(baseDir) {
|
|
545
545
|
const normalizedBase = _path2.default.normalize(baseDir);
|
|
546
|
-
const packageRoot = _nullishCoalesce(
|
|
546
|
+
const packageRoot = _nullishCoalesce(_chunk5O6237HXjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
|
|
547
547
|
const packageJsonPath = _path2.default.join(packageRoot, "package.json");
|
|
548
548
|
const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
|
|
549
549
|
const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
|
|
@@ -2771,15 +2771,15 @@ function createInternalCompilerContext(opts) {
|
|
|
2771
2771
|
);
|
|
2772
2772
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2773
2773
|
applyLoggerLevel(ctx.logLevel);
|
|
2774
|
-
const twPatcher =
|
|
2774
|
+
const twPatcher = _chunk5O6237HXjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2775
2775
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
2776
2776
|
if (_optionalChain([twPatcher, 'access', _95 => _95.packageInfo, 'optionalAccess', _96 => _96.version])) {
|
|
2777
2777
|
_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)))}`);
|
|
2778
2778
|
} else {
|
|
2779
2779
|
_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`);
|
|
2780
2780
|
}
|
|
2781
|
-
|
|
2782
|
-
const cssCalcOptions =
|
|
2781
|
+
_chunk5O6237HXjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
2782
|
+
const cssCalcOptions = _chunk5O6237HXjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
|
|
2783
2783
|
ctx.cssCalc = cssCalcOptions;
|
|
2784
2784
|
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
2785
2785
|
const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
|
|
@@ -2798,7 +2798,7 @@ function createInternalCompilerContext(opts) {
|
|
|
2798
2798
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
2799
2799
|
}
|
|
2800
2800
|
invalidateRuntimeClassSet(previousPatcher);
|
|
2801
|
-
const nextPatcher =
|
|
2801
|
+
const nextPatcher = _chunk5O6237HXjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2802
2802
|
Object.assign(previousPatcher, nextPatcher);
|
|
2803
2803
|
ctx.twPatcher = previousPatcher;
|
|
2804
2804
|
return previousPatcher;
|
|
@@ -637,6 +637,7 @@ function groupCssEntriesByBase(entries, options = {}) {
|
|
|
637
637
|
return groups;
|
|
638
638
|
}
|
|
639
639
|
function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries) {
|
|
640
|
+
const hasCssEntries = cssEntries.length > 0;
|
|
640
641
|
if (!options) {
|
|
641
642
|
return options;
|
|
642
643
|
}
|
|
@@ -651,13 +652,20 @@ function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries)
|
|
|
651
652
|
cwd: patchOptions.cwd ?? baseDir
|
|
652
653
|
};
|
|
653
654
|
if (patchOptions.tailwindcss) {
|
|
655
|
+
const nextV4 = {
|
|
656
|
+
...patchOptions.tailwindcss.v4 ?? {}
|
|
657
|
+
};
|
|
658
|
+
if (hasCssEntries) {
|
|
659
|
+
nextV4.cssEntries = cssEntries;
|
|
660
|
+
} else {
|
|
661
|
+
nextV4.cssEntries = nextV4.cssEntries ?? cssEntries;
|
|
662
|
+
if (nextV4.base === void 0) {
|
|
663
|
+
nextV4.base = baseDir;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
654
666
|
nextPatch.tailwindcss = {
|
|
655
667
|
...patchOptions.tailwindcss,
|
|
656
|
-
v4:
|
|
657
|
-
...patchOptions.tailwindcss.v4 ?? {},
|
|
658
|
-
base: baseDir,
|
|
659
|
-
cssEntries
|
|
660
|
-
}
|
|
668
|
+
v4: nextV4
|
|
661
669
|
};
|
|
662
670
|
}
|
|
663
671
|
return {
|
|
@@ -677,8 +685,8 @@ function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries)
|
|
|
677
685
|
...options.tailwind,
|
|
678
686
|
v4: {
|
|
679
687
|
...options.tailwind.v4 ?? {},
|
|
680
|
-
base: baseDir,
|
|
681
|
-
cssEntries
|
|
688
|
+
...hasCssEntries ? {} : { base: options.tailwind.v4?.base ?? baseDir },
|
|
689
|
+
cssEntries: hasCssEntries ? cssEntries : options.tailwind.v4?.cssEntries ?? cssEntries
|
|
682
690
|
}
|
|
683
691
|
}
|
|
684
692
|
};
|
package/dist/cli.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk5O6237HXjs = require('./chunk-5O6237HX.js');
|
|
11
11
|
require('./chunk-FYYBY3VK.js');
|
|
12
12
|
require('./chunk-DYLQ6UOI.js');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-UAEME5HT.js');
|
|
14
14
|
|
|
15
15
|
// src/cli.ts
|
|
16
16
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -125,7 +125,7 @@ function resolvePatchDefaultCwd(currentCwd = _process2.default.cwd()) {
|
|
|
125
125
|
if (explicitCwd) {
|
|
126
126
|
return explicitCwd;
|
|
127
127
|
}
|
|
128
|
-
const workspaceRoot =
|
|
128
|
+
const workspaceRoot = _chunk5O6237HXjs.findWorkspaceRoot.call(void 0, baseDir);
|
|
129
129
|
const initCwd = normalizeCandidatePath(baseDir, _process2.default.env.INIT_CWD);
|
|
130
130
|
const localPrefix = normalizeCandidatePath(baseDir, _process2.default.env.npm_config_local_prefix);
|
|
131
131
|
const candidates = [
|
|
@@ -145,12 +145,12 @@ async function ensureDir(dir) {
|
|
|
145
145
|
}
|
|
146
146
|
function handleCliError(error) {
|
|
147
147
|
if (error instanceof Error) {
|
|
148
|
-
|
|
148
|
+
_chunk5O6237HXjs.logger.error(error.message);
|
|
149
149
|
if (error.stack && _process2.default.env.WEAPP_TW_DEBUG === "1") {
|
|
150
|
-
|
|
150
|
+
_chunk5O6237HXjs.logger.error(error.stack);
|
|
151
151
|
}
|
|
152
152
|
} else {
|
|
153
|
-
|
|
153
|
+
_chunk5O6237HXjs.logger.error(String(error));
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
function commandAction(handler) {
|
|
@@ -309,10 +309,10 @@ function formatDisplayName(workspaceRoot, dir, name) {
|
|
|
309
309
|
}
|
|
310
310
|
async function patchWorkspace(options) {
|
|
311
311
|
const cwd = _nullishCoalesce(options.cwd, () => ( _process2.default.cwd()));
|
|
312
|
-
const workspaceRoot = _nullishCoalesce(
|
|
312
|
+
const workspaceRoot = _nullishCoalesce(_chunk5O6237HXjs.findWorkspaceRoot.call(void 0, cwd), () => ( cwd));
|
|
313
313
|
const packageDirs = await resolveWorkspacePackageDirs(workspaceRoot);
|
|
314
314
|
if (packageDirs.length === 0) {
|
|
315
|
-
|
|
315
|
+
_chunk5O6237HXjs.logger.warn("\u672A\u5728 %s \u68C0\u6D4B\u5230 workspace \u5305\uFF0C\u5DF2\u8DF3\u8FC7\u6279\u91CF patch\u3002", workspaceRoot);
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
const results = [];
|
|
@@ -328,24 +328,24 @@ async function patchWorkspace(options) {
|
|
|
328
328
|
status: "skipped",
|
|
329
329
|
message: "tailwindcss \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7\u3002"
|
|
330
330
|
});
|
|
331
|
-
|
|
331
|
+
_chunk5O6237HXjs.logger.info("[workspace] \u8DF3\u8FC7 %s\uFF08tailwindcss \u672A\u5B89\u88C5\uFF09\u3002", displayName);
|
|
332
332
|
continue;
|
|
333
333
|
}
|
|
334
334
|
try {
|
|
335
335
|
const patcher = createWorkspacePatcher(dir);
|
|
336
336
|
if (options.clearCache) {
|
|
337
|
-
await
|
|
337
|
+
await _chunkXXJNXESJjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
338
338
|
}
|
|
339
|
-
const recorder =
|
|
339
|
+
const recorder = _chunkXXJNXESJjs.createPatchTargetRecorder.call(void 0, dir, patcher, {
|
|
340
340
|
source: "cli",
|
|
341
341
|
cwd: dir,
|
|
342
342
|
recordTarget: options.recordTarget !== false,
|
|
343
343
|
alwaysRecord: true
|
|
344
344
|
});
|
|
345
345
|
if (_optionalChain([recorder, 'optionalAccess', _13 => _13.message])) {
|
|
346
|
-
|
|
346
|
+
_chunk5O6237HXjs.logger.info("[workspace] %s %s", displayName, recorder.message);
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
_chunkXXJNXESJjs.logTailwindcssTarget.call(void 0, "cli", patcher, dir);
|
|
349
349
|
await patcher.patch();
|
|
350
350
|
if (_optionalChain([recorder, 'optionalAccess', _14 => _14.onPatched])) {
|
|
351
351
|
await recorder.onPatched();
|
|
@@ -356,7 +356,7 @@ async function patchWorkspace(options) {
|
|
|
356
356
|
status: "patched",
|
|
357
357
|
message: "\u5DF2\u5B8C\u6210 patch\u3002"
|
|
358
358
|
});
|
|
359
|
-
|
|
359
|
+
_chunk5O6237HXjs.logger.success("[workspace] \u5DF2\u8865\u4E01 %s", displayName);
|
|
360
360
|
} catch (error) {
|
|
361
361
|
const reason = error instanceof Error ? error.message : String(error);
|
|
362
362
|
const suggestion = `\u8BF7\u5728 ${dir} \u8FD0\u884C "weapp-tw patch --cwd ${dir}".`;
|
|
@@ -367,24 +367,24 @@ async function patchWorkspace(options) {
|
|
|
367
367
|
status: "failed",
|
|
368
368
|
message
|
|
369
369
|
});
|
|
370
|
-
|
|
370
|
+
_chunk5O6237HXjs.logger.error("[workspace] \u8865\u4E01\u5931\u8D25 %s\uFF1A%s", displayName, message);
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
const patched = results.filter((result) => result.status === "patched").length;
|
|
374
374
|
const skipped = results.filter((result) => result.status === "skipped").length;
|
|
375
375
|
const failed = results.filter((result) => result.status === "failed").length;
|
|
376
|
-
|
|
376
|
+
_chunk5O6237HXjs.logger.info("[workspace] \u6C47\u603B\uFF1A\u5DF2\u8865\u4E01 %d\uFF0C\u8DF3\u8FC7 %d\uFF0C\u5931\u8D25 %d", patched, skipped, failed);
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
// src/cli/mount-options.ts
|
|
380
380
|
function handleCliError2(error) {
|
|
381
381
|
if (error instanceof Error) {
|
|
382
|
-
|
|
382
|
+
_chunk5O6237HXjs.logger.error(error.message);
|
|
383
383
|
if (error.stack && _process2.default.env.WEAPP_TW_DEBUG === "1") {
|
|
384
|
-
|
|
384
|
+
_chunk5O6237HXjs.logger.error(error.stack);
|
|
385
385
|
}
|
|
386
386
|
} else {
|
|
387
|
-
|
|
387
|
+
_chunk5O6237HXjs.logger.error(String(error));
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
function withCommandErrorHandling(handler) {
|
|
@@ -419,27 +419,27 @@ function logPatchStatusReport(report) {
|
|
|
419
419
|
(entry) => entry.status === "skipped" || entry.status === "unsupported"
|
|
420
420
|
);
|
|
421
421
|
const packageLabel = `${_nullishCoalesce(report.package.name, () => ( "tailwindcss"))}@${_nullishCoalesce(report.package.version, () => ( "unknown"))}`;
|
|
422
|
-
|
|
422
|
+
_chunk5O6237HXjs.logger.info(`Patch status for ${packageLabel} (v${report.majorVersion})`);
|
|
423
423
|
if (applied.length) {
|
|
424
|
-
|
|
424
|
+
_chunk5O6237HXjs.logger.success("Applied:");
|
|
425
425
|
applied.forEach((entry) => {
|
|
426
|
-
|
|
426
|
+
_chunk5O6237HXjs.logger.success(` - ${entry.name}${formatStatusFilesHint(entry.files)}`);
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
429
|
if (pending.length) {
|
|
430
|
-
|
|
430
|
+
_chunk5O6237HXjs.logger.warn("Needs attention:");
|
|
431
431
|
pending.forEach((entry) => {
|
|
432
432
|
const details = entry.reason ? ` - ${entry.reason}` : "";
|
|
433
|
-
|
|
433
|
+
_chunk5O6237HXjs.logger.warn(` - ${entry.name}${formatStatusFilesHint(entry.files)}${details}`);
|
|
434
434
|
});
|
|
435
435
|
} else {
|
|
436
|
-
|
|
436
|
+
_chunk5O6237HXjs.logger.success("All applicable patches are applied.");
|
|
437
437
|
}
|
|
438
438
|
if (skipped.length) {
|
|
439
|
-
|
|
439
|
+
_chunk5O6237HXjs.logger.info("Skipped:");
|
|
440
440
|
skipped.forEach((entry) => {
|
|
441
441
|
const details = entry.reason ? ` - ${entry.reason}` : "";
|
|
442
|
-
|
|
442
|
+
_chunk5O6237HXjs.logger.info(` - ${entry.name}${details}`);
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
445
|
}
|
|
@@ -500,26 +500,26 @@ var mountOptions = {
|
|
|
500
500
|
}
|
|
501
501
|
const patcher = await createPatcherWithDefaultExtendLengthUnits(ctx);
|
|
502
502
|
if (shouldClearCache) {
|
|
503
|
-
await
|
|
503
|
+
await _chunkXXJNXESJjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
504
504
|
}
|
|
505
|
-
const recorder =
|
|
505
|
+
const recorder = _chunkXXJNXESJjs.createPatchTargetRecorder.call(void 0, ctx.cwd, patcher, {
|
|
506
506
|
source: "cli",
|
|
507
507
|
cwd: ctx.cwd,
|
|
508
508
|
recordTarget: shouldRecordTarget,
|
|
509
509
|
alwaysRecord: true
|
|
510
510
|
});
|
|
511
511
|
if (_optionalChain([recorder, 'optionalAccess', _18 => _18.message])) {
|
|
512
|
-
|
|
512
|
+
_chunk5O6237HXjs.logger.info(recorder.message);
|
|
513
513
|
}
|
|
514
|
-
|
|
514
|
+
_chunkXXJNXESJjs.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
|
|
515
515
|
await patcher.patch();
|
|
516
516
|
if (_optionalChain([recorder, 'optionalAccess', _19 => _19.onPatched])) {
|
|
517
517
|
const recordPath = await recorder.onPatched();
|
|
518
518
|
if (recordPath) {
|
|
519
|
-
|
|
519
|
+
_chunk5O6237HXjs.logger.info(`\u8BB0\u5F55 weapp-tw patch \u76EE\u6807 -> ${formatOutputPath(recordPath, ctx.cwd)}`);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
|
|
522
|
+
_chunk5O6237HXjs.logger.success("Tailwind CSS \u8FD0\u884C\u65F6\u8865\u4E01\u5DF2\u5B8C\u6210\u3002");
|
|
523
523
|
}),
|
|
524
524
|
extract: withCommandErrorHandling(async (_ctx, next) => next()),
|
|
525
525
|
tokens: withCommandErrorHandling(async (_ctx, next) => next()),
|
|
@@ -528,7 +528,7 @@ var mountOptions = {
|
|
|
528
528
|
const patcher = await createPatcherWithDefaultExtendLengthUnits(ctx);
|
|
529
529
|
const report = await patcher.getPatchStatus();
|
|
530
530
|
if (ctx.args.json) {
|
|
531
|
-
|
|
531
|
+
_chunk5O6237HXjs.logger.log(JSON.stringify(report, null, 2));
|
|
532
532
|
return report;
|
|
533
533
|
}
|
|
534
534
|
logPatchStatusReport(report);
|
|
@@ -659,9 +659,9 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
659
659
|
|
|
660
660
|
// src/cli.ts
|
|
661
661
|
_process2.default.title = "node (weapp-tailwindcss)";
|
|
662
|
-
if (_semver2.default.lt(_process2.default.versions.node,
|
|
663
|
-
|
|
664
|
-
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${
|
|
662
|
+
if (_semver2.default.lt(_process2.default.versions.node, _chunkXXJNXESJjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
663
|
+
_chunk5O6237HXjs.logger.warn(
|
|
664
|
+
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkXXJNXESJjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
|
|
665
665
|
);
|
|
666
666
|
}
|
|
667
667
|
var cli = _tailwindcsspatch.createTailwindcssPatchCli.call(void 0, {
|
|
@@ -686,7 +686,7 @@ cli.command("vscode-entry", "Generate a VS Code helper CSS for Tailwind IntelliS
|
|
|
686
686
|
sources,
|
|
687
687
|
force
|
|
688
688
|
});
|
|
689
|
-
|
|
689
|
+
_chunk5O6237HXjs.logger.success(
|
|
690
690
|
`VS Code helper generated -> ${formatOutputPath(result.outputPath, resolvedCwd)}`
|
|
691
691
|
);
|
|
692
692
|
})
|
package/dist/cli.mjs
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
clearTailwindcssPatcherCache,
|
|
4
4
|
createPatchTargetRecorder,
|
|
5
5
|
logTailwindcssTarget
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WGBJY2H3.mjs";
|
|
7
7
|
import {
|
|
8
8
|
findWorkspaceRoot,
|
|
9
9
|
logger
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZE7JKKFT.mjs";
|
|
11
11
|
import "./chunk-HWF5U4CI.mjs";
|
|
12
12
|
import "./chunk-OOHJLO5M.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FFGR5V3H.mjs";
|
|
14
14
|
|
|
15
15
|
// src/cli.ts
|
|
16
16
|
import process5 from "process";
|