weapp-tailwindcss 4.9.6 → 4.9.8-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-6HOJUSTX.mjs → chunk-2HORYQCB.mjs} +1 -1
- package/dist/{chunk-56QWZ2UM.js → chunk-35WZBSR2.js} +5 -5
- package/dist/{chunk-SPH6SCTM.mjs → chunk-47TVJCQM.mjs} +1 -1
- package/dist/{chunk-XD5AWWTB.mjs → chunk-5VEPZUTO.mjs} +4 -4
- package/dist/{chunk-W7ETGQW7.mjs → chunk-B76ICULV.mjs} +1 -1
- package/dist/{chunk-VPHA77FH.js → chunk-DOX3RXJ2.js} +2 -2
- package/dist/{chunk-HWF5U4CI.mjs → chunk-EGOFMIDI.mjs} +1 -1
- package/dist/{chunk-PUUBR36U.mjs → chunk-FY4CU2TB.mjs} +8 -6
- package/dist/{chunk-Y6F6NBA7.js → chunk-HAM3JEU2.js} +1 -1
- package/dist/{chunk-R3IC273Z.mjs → chunk-IPXH3S3C.mjs} +2 -2
- package/dist/{chunk-3J6TSML5.js → chunk-KBLYUEKE.js} +31 -31
- package/dist/{chunk-VI5WDH6L.js → chunk-KTUGHGKO.js} +7 -7
- package/dist/{chunk-COWTRJLM.js → chunk-KUFBWA2F.js} +15 -13
- package/dist/{chunk-GHWN5Y7Z.mjs → chunk-LACRPTD6.mjs} +2 -2
- package/dist/{chunk-FYYBY3VK.js → chunk-LBZCKOMT.js} +1 -1
- package/dist/{chunk-4RUFPPI6.js → chunk-PO3CCFU7.js} +4 -4
- package/dist/{chunk-FQUFI6M7.js → chunk-WRVALWQL.js} +23 -23
- package/dist/{chunk-F345SX2I.js → chunk-WVE6IP6G.js} +5 -5
- package/dist/cli.js +40 -40
- package/dist/cli.mjs +3 -3
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +11 -11
- 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.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +3 -3
- package/dist/defaults.mjs +2 -2
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +7 -7
- package/dist/gulp.mjs +5 -5
- package/dist/{index-D4tYbWC6.d.ts → index-vGuAfNvT.d.mts} +12 -3
- package/dist/{index-D4tYbWC6.d.mts → index-vGuAfNvT.d.ts} +12 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -11
- 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.d.mts +2 -1
- package/dist/presets.d.ts +2 -1
- package/dist/presets.js +6 -5
- package/dist/presets.mjs +2 -1
- package/dist/reset.js +1 -1
- package/dist/reset.mjs +1 -1
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +8 -8
- package/dist/vite.mjs +5 -5
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +9 -9
- package/dist/webpack.mjs +6 -6
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +34 -34
- package/dist/webpack4.mjs +5 -5
- package/package.json +5 -5
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkDOX3RXJ2js = require('./chunk-DOX3RXJ2.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkWVE6IP6Gjs = require('./chunk-WVE6IP6G.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -23,7 +23,7 @@ var _chunkF345SX2Ijs = require('./chunk-F345SX2I.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkKUFBWA2Fjs = require('./chunk-KUFBWA2F.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -54,7 +54,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
54
54
|
const start = prop.value.loc.start.offset + 1;
|
|
55
55
|
const end = prop.value.loc.end.offset - 1;
|
|
56
56
|
if (start < end) {
|
|
57
|
-
ms.update(start, end,
|
|
57
|
+
ms.update(start, end, _chunkKUFBWA2Fjs.replaceWxml.call(void 0, prop.value.content));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -66,7 +66,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
66
66
|
if (start >= end) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
const generated =
|
|
69
|
+
const generated = _chunkKUFBWA2Fjs.generateCode.call(void 0, prop.exp.content, {
|
|
70
70
|
jsHandler,
|
|
71
71
|
runtimeSet,
|
|
72
72
|
wrapExpression: true
|
|
@@ -95,7 +95,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
98
|
-
const matchCustomAttribute =
|
|
98
|
+
const matchCustomAttribute = _chunkKUFBWA2Fjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
99
99
|
const ms = new (0, _magicstring2.default)(code);
|
|
100
100
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
101
101
|
if (errors.length === 0) {
|
|
@@ -359,7 +359,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
359
359
|
runtimeSet,
|
|
360
360
|
applyLinkedResults: applyLinkedResults2
|
|
361
361
|
} = options;
|
|
362
|
-
const absoluteFile =
|
|
362
|
+
const absoluteFile = _chunkDOX3RXJ2js.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
363
363
|
const rawSource = originalSource.source.toString();
|
|
364
364
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
365
365
|
cache,
|
|
@@ -428,7 +428,7 @@ function isJavaScriptEntry(entry) {
|
|
|
428
428
|
function createBundleModuleGraphOptions(outputDir, entries) {
|
|
429
429
|
return {
|
|
430
430
|
resolve(specifier, importer) {
|
|
431
|
-
return
|
|
431
|
+
return _chunkDOX3RXJ2js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => entries.has(candidate));
|
|
432
432
|
},
|
|
433
433
|
load(id) {
|
|
434
434
|
const entry = entries.get(id);
|
|
@@ -498,7 +498,7 @@ function createGenerateBundleHook(context) {
|
|
|
498
498
|
for (const [fileName, output] of entries) {
|
|
499
499
|
const entry = { fileName, output };
|
|
500
500
|
if (isJavaScriptEntry(entry)) {
|
|
501
|
-
const absolute =
|
|
501
|
+
const absolute = _chunkDOX3RXJ2js.toAbsoluteOutputPath.call(void 0, fileName, outDir);
|
|
502
502
|
jsEntries.set(absolute, entry);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
@@ -565,7 +565,7 @@ function createGenerateBundleHook(context) {
|
|
|
565
565
|
if (Array.isArray(groupedEntries.js)) {
|
|
566
566
|
for (const [file, originalSource] of groupedEntries.js) {
|
|
567
567
|
if (originalSource.type === "chunk") {
|
|
568
|
-
const absoluteFile =
|
|
568
|
+
const absoluteFile = _chunkDOX3RXJ2js.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
569
569
|
const initialRawSource = originalSource.code;
|
|
570
570
|
jsTaskFactories.push(async () => {
|
|
571
571
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
@@ -646,7 +646,7 @@ function createGenerateBundleHook(context) {
|
|
|
646
646
|
);
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
|
|
649
|
+
_chunkDOX3RXJ2js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
650
650
|
await Promise.all(tasks);
|
|
651
651
|
for (const apply of pendingLinkedUpdates) {
|
|
652
652
|
apply();
|
|
@@ -677,12 +677,12 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
677
677
|
const { appType, weappTailwindcssDirPosix: weappTailwindcssDirPosix2 } = options;
|
|
678
678
|
return [
|
|
679
679
|
{
|
|
680
|
-
name: `${
|
|
680
|
+
name: `${_chunkKUFBWA2Fjs.vitePluginName}:rewrite-css-imports`,
|
|
681
681
|
enforce: "pre",
|
|
682
682
|
resolveId: {
|
|
683
683
|
order: "pre",
|
|
684
684
|
handler(id, importer) {
|
|
685
|
-
const replacement =
|
|
685
|
+
const replacement = _chunkDOX3RXJ2js.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix2, {
|
|
686
686
|
join: joinPosixPath,
|
|
687
687
|
appType
|
|
688
688
|
});
|
|
@@ -701,7 +701,7 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
701
701
|
if (!isCSSRequest(id)) {
|
|
702
702
|
return null;
|
|
703
703
|
}
|
|
704
|
-
const rewritten =
|
|
704
|
+
const rewritten = _chunkDOX3RXJ2js.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix2, {
|
|
705
705
|
join: joinPosixPath,
|
|
706
706
|
appType
|
|
707
707
|
});
|
|
@@ -719,12 +719,12 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
// src/bundlers/vite/index.ts
|
|
722
|
-
var debug =
|
|
723
|
-
var weappTailwindcssPackageDir =
|
|
722
|
+
var debug = _chunkKUFBWA2Fjs.createDebug.call(void 0, );
|
|
723
|
+
var weappTailwindcssPackageDir = _chunkDOX3RXJ2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
724
724
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
725
725
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
726
726
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
727
|
-
const opts =
|
|
727
|
+
const opts = _chunkKUFBWA2Fjs.getCompilerContext.call(void 0, options);
|
|
728
728
|
const {
|
|
729
729
|
disabled,
|
|
730
730
|
customAttributes,
|
|
@@ -738,7 +738,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
738
738
|
uniAppX,
|
|
739
739
|
disabledDefaultTemplateHandler
|
|
740
740
|
} = opts;
|
|
741
|
-
const disabledOptions =
|
|
741
|
+
const disabledOptions = _chunkDOX3RXJ2js.resolveDisabledOptions.call(void 0, disabled);
|
|
742
742
|
const tailwindcssMajorVersion = _nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0));
|
|
743
743
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
|
|
744
744
|
const rewritePlugins = createRewriteCssImportsPlugins({
|
|
@@ -749,8 +749,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
749
749
|
if (disabledOptions.plugin) {
|
|
750
750
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
751
751
|
}
|
|
752
|
-
const customAttributesEntities =
|
|
753
|
-
const patchRecorderState =
|
|
752
|
+
const customAttributesEntities = _chunkKUFBWA2Fjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
753
|
+
const patchRecorderState = _chunkWVE6IP6Gjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
754
754
|
source: "runtime",
|
|
755
755
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
756
756
|
});
|
|
@@ -764,7 +764,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
764
764
|
let runtimeSetPromise;
|
|
765
765
|
let resolvedConfig;
|
|
766
766
|
async function refreshRuntimeState(force) {
|
|
767
|
-
const refreshed = await
|
|
767
|
+
const refreshed = await _chunkKUFBWA2Fjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
768
768
|
if (refreshed) {
|
|
769
769
|
runtimeSet = void 0;
|
|
770
770
|
runtimeSetPromise = void 0;
|
|
@@ -777,7 +777,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
777
777
|
return runtimeSet;
|
|
778
778
|
}
|
|
779
779
|
if (force || !runtimeSetPromise) {
|
|
780
|
-
const task2 =
|
|
780
|
+
const task2 = _chunkKUFBWA2Fjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
781
781
|
force: force || !runtimeSet,
|
|
782
782
|
skipRefresh: force
|
|
783
783
|
});
|
|
@@ -812,7 +812,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
812
812
|
const plugins = [
|
|
813
813
|
...rewritePlugins,
|
|
814
814
|
{
|
|
815
|
-
name: `${
|
|
815
|
+
name: `${_chunkKUFBWA2Fjs.vitePluginName}:post`,
|
|
816
816
|
enforce: "post",
|
|
817
817
|
configResolved(config) {
|
|
818
818
|
resolvedConfig = config;
|
|
@@ -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 _chunkKUFBWA2Fjs = require('./chunk-KUFBWA2F.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkPO3CCFU7js = require('./chunk-PO3CCFU7.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkKUFBWA2Fjs.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
|
+
_chunkPO3CCFU7js.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 ? _chunkKUFBWA2Fjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
package/dist/cli.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkKUFBWA2Fjs = require('./chunk-KUFBWA2F.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('./chunk-
|
|
10
|
+
var _chunkPO3CCFU7js = require('./chunk-PO3CCFU7.js');
|
|
11
|
+
require('./chunk-LBZCKOMT.js');
|
|
12
12
|
require('./chunk-DYLQ6UOI.js');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-HAM3JEU2.js');
|
|
14
14
|
|
|
15
15
|
// src/cli.ts
|
|
16
16
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -134,7 +134,7 @@ function resolvePatchDefaultCwd(currentCwd = _process2.default.cwd()) {
|
|
|
134
134
|
if (explicitCwd) {
|
|
135
135
|
return explicitCwd;
|
|
136
136
|
}
|
|
137
|
-
const workspaceRoot =
|
|
137
|
+
const workspaceRoot = _chunkPO3CCFU7js.findWorkspaceRoot.call(void 0, baseDir);
|
|
138
138
|
const initCwd = normalizeCandidatePath(baseDir, _process2.default.env.INIT_CWD);
|
|
139
139
|
const localPrefix = normalizeCandidatePath(baseDir, _process2.default.env.npm_config_local_prefix);
|
|
140
140
|
const candidates = [
|
|
@@ -156,12 +156,12 @@ async function ensureDir(dir) {
|
|
|
156
156
|
}
|
|
157
157
|
function handleCliError(error) {
|
|
158
158
|
if (error instanceof Error) {
|
|
159
|
-
|
|
159
|
+
_chunkPO3CCFU7js.logger.error(error.message);
|
|
160
160
|
if (error.stack && _process2.default.env.WEAPP_TW_DEBUG === "1") {
|
|
161
|
-
|
|
161
|
+
_chunkPO3CCFU7js.logger.error(error.stack);
|
|
162
162
|
}
|
|
163
163
|
} else {
|
|
164
|
-
|
|
164
|
+
_chunkPO3CCFU7js.logger.error(String(error));
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
function commandAction(handler) {
|
|
@@ -192,27 +192,27 @@ function logPatchStatusReport(report) {
|
|
|
192
192
|
(entry) => entry.status === "skipped" || entry.status === "unsupported"
|
|
193
193
|
);
|
|
194
194
|
const packageLabel = `${_nullishCoalesce(report.package.name, () => ( "tailwindcss"))}@${_nullishCoalesce(report.package.version, () => ( "unknown"))}`;
|
|
195
|
-
|
|
195
|
+
_chunkPO3CCFU7js.logger.info(`Patch status for ${packageLabel} (v${report.majorVersion})`);
|
|
196
196
|
if (applied.length) {
|
|
197
|
-
|
|
197
|
+
_chunkPO3CCFU7js.logger.success("Applied:");
|
|
198
198
|
applied.forEach((entry) => {
|
|
199
|
-
|
|
199
|
+
_chunkPO3CCFU7js.logger.success(` - ${entry.name}${formatStatusFilesHint(entry.files)}`);
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
if (pending.length) {
|
|
203
|
-
|
|
203
|
+
_chunkPO3CCFU7js.logger.warn("Needs attention:");
|
|
204
204
|
pending.forEach((entry) => {
|
|
205
205
|
const details = entry.reason ? ` - ${entry.reason}` : "";
|
|
206
|
-
|
|
206
|
+
_chunkPO3CCFU7js.logger.warn(` - ${entry.name}${formatStatusFilesHint(entry.files)}${details}`);
|
|
207
207
|
});
|
|
208
208
|
} else {
|
|
209
|
-
|
|
209
|
+
_chunkPO3CCFU7js.logger.success("All applicable patches are applied.");
|
|
210
210
|
}
|
|
211
211
|
if (skipped.length) {
|
|
212
|
-
|
|
212
|
+
_chunkPO3CCFU7js.logger.info("Skipped:");
|
|
213
213
|
skipped.forEach((entry) => {
|
|
214
214
|
const details = entry.reason ? ` - ${entry.reason}` : "";
|
|
215
|
-
|
|
215
|
+
_chunkPO3CCFU7js.logger.info(` - ${entry.name}${details}`);
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
}
|
|
@@ -377,7 +377,7 @@ function summarizeWorkspaceResults(results) {
|
|
|
377
377
|
const patched = results.filter((result) => result.status === "patched").length;
|
|
378
378
|
const skipped = results.filter((result) => result.status === "skipped").length;
|
|
379
379
|
const failed = results.filter((result) => result.status === "failed").length;
|
|
380
|
-
|
|
380
|
+
_chunkPO3CCFU7js.logger.info("[workspace] \u6C47\u603B\uFF1A\u5DF2\u8865\u4E01 %d\uFF0C\u8DF3\u8FC7 %d\uFF0C\u5931\u8D25 %d", patched, skipped, failed);
|
|
381
381
|
}
|
|
382
382
|
|
|
383
383
|
// src/cli/workspace/patch-package.ts
|
|
@@ -393,7 +393,7 @@ async function patchWorkspacePackage(workspaceRoot, dir, pkgName, options) {
|
|
|
393
393
|
const displayName = formatDisplayName(workspaceRoot, dir, pkgName);
|
|
394
394
|
const tailwindInfo = getTailwindcssPackageInfo({ paths: [dir] });
|
|
395
395
|
if (!_optionalChain([tailwindInfo, 'optionalAccess', _11 => _11.rootPath])) {
|
|
396
|
-
|
|
396
|
+
_chunkPO3CCFU7js.logger.info("[workspace] \u8DF3\u8FC7 %s\uFF08tailwindcss \u672A\u5B89\u88C5\uFF09\u3002", displayName);
|
|
397
397
|
return {
|
|
398
398
|
dir,
|
|
399
399
|
name: pkgName,
|
|
@@ -404,23 +404,23 @@ async function patchWorkspacePackage(workspaceRoot, dir, pkgName, options) {
|
|
|
404
404
|
try {
|
|
405
405
|
const patcher = createWorkspacePatcher(dir);
|
|
406
406
|
if (options.clearCache) {
|
|
407
|
-
await
|
|
407
|
+
await _chunkKUFBWA2Fjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
408
408
|
}
|
|
409
|
-
const recorder =
|
|
409
|
+
const recorder = _chunkKUFBWA2Fjs.createPatchTargetRecorder.call(void 0, dir, patcher, {
|
|
410
410
|
source: "cli",
|
|
411
411
|
cwd: dir,
|
|
412
412
|
recordTarget: options.recordTarget !== false,
|
|
413
413
|
alwaysRecord: true
|
|
414
414
|
});
|
|
415
415
|
if (_optionalChain([recorder, 'optionalAccess', _12 => _12.message])) {
|
|
416
|
-
|
|
416
|
+
_chunkPO3CCFU7js.logger.info("[workspace] %s %s", displayName, recorder.message);
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
_chunkKUFBWA2Fjs.logTailwindcssTarget.call(void 0, "cli", patcher, dir);
|
|
419
419
|
await patcher.patch();
|
|
420
420
|
if (_optionalChain([recorder, 'optionalAccess', _13 => _13.onPatched])) {
|
|
421
421
|
await recorder.onPatched();
|
|
422
422
|
}
|
|
423
|
-
|
|
423
|
+
_chunkPO3CCFU7js.logger.success("[workspace] \u5DF2\u8865\u4E01 %s", displayName);
|
|
424
424
|
return {
|
|
425
425
|
dir,
|
|
426
426
|
name: pkgName,
|
|
@@ -431,7 +431,7 @@ async function patchWorkspacePackage(workspaceRoot, dir, pkgName, options) {
|
|
|
431
431
|
const reason = error instanceof Error ? error.message : String(error);
|
|
432
432
|
const suggestion = `\u8BF7\u5728 ${dir} \u8FD0\u884C "weapp-tw patch --cwd ${dir}".`;
|
|
433
433
|
const message = `${reason}\uFF0C${suggestion}`;
|
|
434
|
-
|
|
434
|
+
_chunkPO3CCFU7js.logger.error("[workspace] \u8865\u4E01\u5931\u8D25 %s\uFF1A%s", displayName, message);
|
|
435
435
|
return {
|
|
436
436
|
dir,
|
|
437
437
|
name: pkgName,
|
|
@@ -444,10 +444,10 @@ async function patchWorkspacePackage(workspaceRoot, dir, pkgName, options) {
|
|
|
444
444
|
// src/cli/workspace.ts
|
|
445
445
|
async function patchWorkspace(options) {
|
|
446
446
|
const cwd = _nullishCoalesce(options.cwd, () => ( _process2.default.cwd()));
|
|
447
|
-
const workspaceRoot = _nullishCoalesce(
|
|
447
|
+
const workspaceRoot = _nullishCoalesce(_chunkPO3CCFU7js.findWorkspaceRoot.call(void 0, cwd), () => ( cwd));
|
|
448
448
|
const packageDirs = await resolveWorkspacePackageDirs(workspaceRoot);
|
|
449
449
|
if (packageDirs.length === 0) {
|
|
450
|
-
|
|
450
|
+
_chunkPO3CCFU7js.logger.warn("\u672A\u5728 %s \u68C0\u6D4B\u5230 workspace \u5305\uFF0C\u5DF2\u8DF3\u8FC7\u6279\u91CF patch\u3002", workspaceRoot);
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
453
|
const results = [];
|
|
@@ -462,12 +462,12 @@ async function patchWorkspace(options) {
|
|
|
462
462
|
// src/cli/mount-options.ts
|
|
463
463
|
function handleCliError2(error) {
|
|
464
464
|
if (error instanceof Error) {
|
|
465
|
-
|
|
465
|
+
_chunkPO3CCFU7js.logger.error(error.message);
|
|
466
466
|
if (error.stack && _process2.default.env.WEAPP_TW_DEBUG === "1") {
|
|
467
|
-
|
|
467
|
+
_chunkPO3CCFU7js.logger.error(error.stack);
|
|
468
468
|
}
|
|
469
469
|
} else {
|
|
470
|
-
|
|
470
|
+
_chunkPO3CCFU7js.logger.error(String(error));
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
function withCommandErrorHandling(handler) {
|
|
@@ -546,26 +546,26 @@ var mountOptions = {
|
|
|
546
546
|
}
|
|
547
547
|
const patcher = await createPatcherWithDefaultExtendLengthUnits(ctx);
|
|
548
548
|
if (shouldClearCache) {
|
|
549
|
-
await
|
|
549
|
+
await _chunkKUFBWA2Fjs.clearTailwindcssPatcherCache.call(void 0, patcher, { removeDirectory: true });
|
|
550
550
|
}
|
|
551
|
-
const recorder =
|
|
551
|
+
const recorder = _chunkKUFBWA2Fjs.createPatchTargetRecorder.call(void 0, ctx.cwd, patcher, {
|
|
552
552
|
source: "cli",
|
|
553
553
|
cwd: ctx.cwd,
|
|
554
554
|
recordTarget: shouldRecordTarget,
|
|
555
555
|
alwaysRecord: true
|
|
556
556
|
});
|
|
557
557
|
if (_optionalChain([recorder, 'optionalAccess', _15 => _15.message])) {
|
|
558
|
-
|
|
558
|
+
_chunkPO3CCFU7js.logger.info(recorder.message);
|
|
559
559
|
}
|
|
560
|
-
|
|
560
|
+
_chunkKUFBWA2Fjs.logTailwindcssTarget.call(void 0, "cli", patcher, ctx.cwd);
|
|
561
561
|
await patcher.patch();
|
|
562
562
|
if (_optionalChain([recorder, 'optionalAccess', _16 => _16.onPatched])) {
|
|
563
563
|
const recordPath = await recorder.onPatched();
|
|
564
564
|
if (recordPath) {
|
|
565
|
-
|
|
565
|
+
_chunkPO3CCFU7js.logger.info(`\u8BB0\u5F55 weapp-tw patch \u76EE\u6807 -> ${formatOutputPath(recordPath, ctx.cwd)}`);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
|
|
568
|
+
_chunkPO3CCFU7js.logger.success("Tailwind CSS \u8FD0\u884C\u65F6\u8865\u4E01\u5DF2\u5B8C\u6210\u3002");
|
|
569
569
|
}),
|
|
570
570
|
extract: withCommandErrorHandling(async (_ctx, next) => next()),
|
|
571
571
|
tokens: withCommandErrorHandling(async (_ctx, next) => next()),
|
|
@@ -574,7 +574,7 @@ var mountOptions = {
|
|
|
574
574
|
const patcher = await createPatcherWithDefaultExtendLengthUnits(ctx);
|
|
575
575
|
const report = await patcher.getPatchStatus();
|
|
576
576
|
if (ctx.args.json) {
|
|
577
|
-
|
|
577
|
+
_chunkPO3CCFU7js.logger.log(JSON.stringify(report, null, 2));
|
|
578
578
|
return report;
|
|
579
579
|
}
|
|
580
580
|
logPatchStatusReport(report);
|
|
@@ -705,9 +705,9 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
705
705
|
|
|
706
706
|
// src/cli.ts
|
|
707
707
|
_process2.default.title = "node (weapp-tailwindcss)";
|
|
708
|
-
if (_semver2.default.lt(_process2.default.versions.node,
|
|
709
|
-
|
|
710
|
-
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${
|
|
708
|
+
if (_semver2.default.lt(_process2.default.versions.node, _chunkKUFBWA2Fjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
709
|
+
_chunkPO3CCFU7js.logger.warn(
|
|
710
|
+
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkKUFBWA2Fjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
|
|
711
711
|
);
|
|
712
712
|
}
|
|
713
713
|
var cli = _tailwindcsspatch.createTailwindcssPatchCli.call(void 0, {
|
|
@@ -732,7 +732,7 @@ cli.command("vscode-entry", "Generate a VS Code helper CSS for Tailwind IntelliS
|
|
|
732
732
|
sources,
|
|
733
733
|
force
|
|
734
734
|
});
|
|
735
|
-
|
|
735
|
+
_chunkPO3CCFU7js.logger.success(
|
|
736
736
|
`VS Code helper generated -> ${formatOutputPath(result.outputPath, resolvedCwd)}`
|
|
737
737
|
);
|
|
738
738
|
})
|
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-FY4CU2TB.mjs";
|
|
7
7
|
import {
|
|
8
8
|
findWorkspaceRoot,
|
|
9
9
|
logger
|
|
10
10
|
} from "./chunk-7D27E7TU.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-EGOFMIDI.mjs";
|
|
12
12
|
import "./chunk-OOHJLO5M.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-47TVJCQM.mjs";
|
|
14
14
|
|
|
15
15
|
// src/cli.ts
|
|
16
16
|
import process7 from "process";
|
package/dist/core.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITemplateHandlerOptions, CreateJsHandlerOptions, JsHandlerResult } from './types.mjs';
|
|
2
2
|
import * as postcss from 'postcss';
|
|
3
|
-
import { U as UserDefinedOptions } from './index-
|
|
3
|
+
import { U as UserDefinedOptions } from './index-vGuAfNvT.mjs';
|
|
4
4
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
5
5
|
import '@babel/parser';
|
|
6
6
|
import 'magic-string';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITemplateHandlerOptions, CreateJsHandlerOptions, JsHandlerResult } from './types.js';
|
|
2
2
|
import * as postcss from 'postcss';
|
|
3
|
-
import { U as UserDefinedOptions } from './index-
|
|
3
|
+
import { U as UserDefinedOptions } from './index-vGuAfNvT.js';
|
|
4
4
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
5
5
|
import '@babel/parser';
|
|
6
6
|
import 'magic-string';
|
package/dist/core.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkWVE6IP6Gjs = require('./chunk-WVE6IP6G.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
8
|
+
var _chunkKUFBWA2Fjs = require('./chunk-KUFBWA2F.js');
|
|
9
|
+
require('./chunk-PO3CCFU7.js');
|
|
10
|
+
require('./chunk-LBZCKOMT.js');
|
|
11
11
|
require('./chunk-DYLQ6UOI.js');
|
|
12
|
-
require('./chunk-
|
|
12
|
+
require('./chunk-HAM3JEU2.js');
|
|
13
13
|
|
|
14
14
|
// src/core.ts
|
|
15
15
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
16
16
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
17
17
|
function createContext(options = {}) {
|
|
18
|
-
const opts =
|
|
18
|
+
const opts = _chunkKUFBWA2Fjs.getCompilerContext.call(void 0, options);
|
|
19
19
|
const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
20
|
-
const patchRecorderState =
|
|
20
|
+
const patchRecorderState = _chunkWVE6IP6Gjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
21
21
|
source: "runtime",
|
|
22
22
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
23
23
|
});
|
|
@@ -29,7 +29,7 @@ function createContext(options = {}) {
|
|
|
29
29
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
30
30
|
};
|
|
31
31
|
async function refreshRuntimeState(force) {
|
|
32
|
-
await
|
|
32
|
+
await _chunkKUFBWA2Fjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
33
33
|
}
|
|
34
34
|
async function transformWxss(rawCss, options2) {
|
|
35
35
|
await runtimeState.patchPromise;
|
|
@@ -38,7 +38,7 @@ function createContext(options = {}) {
|
|
|
38
38
|
}));
|
|
39
39
|
await refreshRuntimeState(true);
|
|
40
40
|
await runtimeState.patchPromise;
|
|
41
|
-
runtimeSet = await
|
|
41
|
+
runtimeSet = await _chunkKUFBWA2Fjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
42
42
|
return result;
|
|
43
43
|
}
|
|
44
44
|
async function transformJs(rawJs, options2 = {}) {
|
|
@@ -48,7 +48,7 @@ function createContext(options = {}) {
|
|
|
48
48
|
} else {
|
|
49
49
|
await refreshRuntimeState(true);
|
|
50
50
|
await runtimeState.patchPromise;
|
|
51
|
-
runtimeSet = await
|
|
51
|
+
runtimeSet = await _chunkKUFBWA2Fjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
52
52
|
}
|
|
53
53
|
return await jsHandler(rawJs, runtimeSet, options2);
|
|
54
54
|
}
|
|
@@ -57,7 +57,7 @@ function createContext(options = {}) {
|
|
|
57
57
|
if (!_optionalChain([options2, 'optionalAccess', _2 => _2.runtimeSet]) && runtimeSet.size === 0) {
|
|
58
58
|
await refreshRuntimeState(true);
|
|
59
59
|
await runtimeState.patchPromise;
|
|
60
|
-
runtimeSet = await
|
|
60
|
+
runtimeSet = await _chunkKUFBWA2Fjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
61
61
|
}
|
|
62
62
|
return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
|
|
63
63
|
runtimeSet
|
package/dist/core.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setupPatchRecorder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B76ICULV.mjs";
|
|
4
4
|
import {
|
|
5
5
|
collectRuntimeClassSet,
|
|
6
6
|
getCompilerContext,
|
|
7
7
|
refreshTailwindRuntimeState
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FY4CU2TB.mjs";
|
|
9
9
|
import "./chunk-7D27E7TU.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-EGOFMIDI.mjs";
|
|
11
11
|
import "./chunk-OOHJLO5M.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-47TVJCQM.mjs";
|
|
13
13
|
|
|
14
14
|
// src/core.ts
|
|
15
15
|
import process from "process";
|
package/dist/css-macro.js
CHANGED
|
@@ -5,7 +5,7 @@ var _chunkNS3NEDWDjs = require('./chunk-NS3NEDWD.js');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-HAM3JEU2.js');
|
|
9
9
|
|
|
10
10
|
// src/css-macro/index.ts
|
|
11
11
|
var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);
|
package/dist/css-macro.mjs
CHANGED
package/dist/defaults.d.mts
CHANGED
package/dist/defaults.d.ts
CHANGED
package/dist/defaults.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLBZCKOMTjs = require('./chunk-LBZCKOMT.js');
|
|
4
4
|
require('./chunk-DYLQ6UOI.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-HAM3JEU2.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.getDefaultOptions =
|
|
8
|
+
exports.getDefaultOptions = _chunkLBZCKOMTjs.getDefaultOptions;
|
package/dist/defaults.mjs
CHANGED
package/dist/gulp.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITemplateHandlerOptions, CreateJsHandlerOptions } from './types.mjs';
|
|
2
2
|
import stream from 'node:stream';
|
|
3
|
-
import { U as UserDefinedOptions } from './index-
|
|
3
|
+
import { U as UserDefinedOptions } from './index-vGuAfNvT.mjs';
|
|
4
4
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
5
5
|
import '@babel/parser';
|
|
6
6
|
import 'magic-string';
|