weapp-tailwindcss 4.11.0-alpha.4 → 4.11.0-alpha.6
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-GCZ7ZE7V.js → chunk-4BHL5BDO.js} +31 -31
- package/dist/{chunk-N3RT3VZH.js → chunk-DO6MQ3YF.js} +364 -74
- package/dist/{chunk-JKK5KZCN.js → chunk-KWG7VWW5.js} +3 -3
- package/dist/{chunk-TDHY27WS.mjs → chunk-LYANBRNN.mjs} +1 -1
- package/dist/{chunk-3V52XTPJ.mjs → chunk-OMARW5NC.mjs} +50 -0
- package/dist/{chunk-FI75TLOQ.js → chunk-QK6VNNNL.js} +51 -1
- package/dist/{chunk-NYZTRTBM.mjs → chunk-RQLIVYJZ.mjs} +331 -41
- package/dist/{chunk-ZPGT5C7G.mjs → chunk-TSRWDW6S.mjs} +1 -1
- package/dist/{chunk-JOT24YET.mjs → chunk-VMKFA54Q.mjs} +10 -4
- package/dist/{chunk-VHUV7ZDB.js → chunk-VO5STL3U.js} +6 -6
- package/dist/{chunk-VO2ZPNCW.js → chunk-WPH7LL5V.js} +23 -17
- package/dist/{chunk-6R2OVCLW.mjs → chunk-ZMQZ667Q.mjs} +3 -3
- package/dist/cli.js +2 -1
- package/dist/cli.mjs +2 -1
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +7 -7
- package/dist/core.mjs +2 -2
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- package/dist/{index-BMwzhITq.d.mts → index-D8E0GGqB.d.mts} +28 -2
- package/dist/{index-BMwzhITq.d.ts → index-D8E0GGqB.d.ts} +28 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/presets.d.mts +36 -1
- package/dist/presets.d.ts +36 -1
- package/dist/presets.js +14 -5
- package/dist/presets.mjs +12 -3
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +3 -3
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +5 -5
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +26 -26
- package/dist/webpack4.mjs +3 -3
- package/package.json +2 -1
|
@@ -5,9 +5,10 @@ import {
|
|
|
5
5
|
getRuntimeClassSetCacheEntry,
|
|
6
6
|
getRuntimeClassSetSignature,
|
|
7
7
|
invalidateRuntimeClassSet,
|
|
8
|
+
isUniAppXEnabled,
|
|
8
9
|
logger,
|
|
9
10
|
warnMissingCssEntries
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OMARW5NC.mjs";
|
|
11
12
|
import {
|
|
12
13
|
getDefaultOptions
|
|
13
14
|
} from "./chunk-23K4XDKF.mjs";
|
|
@@ -422,7 +423,7 @@ import { logger as logger2 } from "@weapp-tailwindcss/logger";
|
|
|
422
423
|
// package.json
|
|
423
424
|
var package_default = {
|
|
424
425
|
name: "weapp-tailwindcss",
|
|
425
|
-
version: "4.11.0-alpha.
|
|
426
|
+
version: "4.11.0-alpha.6",
|
|
426
427
|
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!",
|
|
427
428
|
author: "ice breaker <1324318532@qq.com>",
|
|
428
429
|
license: "MIT",
|
|
@@ -626,6 +627,7 @@ var package_default = {
|
|
|
626
627
|
"@weapp-tailwindcss/postcss": "workspace:*",
|
|
627
628
|
"@weapp-tailwindcss/shared": "workspace:*",
|
|
628
629
|
cac: "6.7.14",
|
|
630
|
+
"comment-json": "^4.6.2",
|
|
629
631
|
debug: "~4.4.3",
|
|
630
632
|
"fast-glob": "^3.3.3",
|
|
631
633
|
htmlparser2: "10.1.0",
|
|
@@ -3603,6 +3605,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
3603
3605
|
disabledDefaultTemplateHandler,
|
|
3604
3606
|
replaceRuntimePackages
|
|
3605
3607
|
} = ctx;
|
|
3608
|
+
const uniAppXEnabled = isUniAppXEnabled(uniAppX);
|
|
3606
3609
|
const moduleSpecifierReplacements = resolveRuntimePackageReplacements(replaceRuntimePackages);
|
|
3607
3610
|
const styleHandler = createStyleHandler({
|
|
3608
3611
|
cssPreflight,
|
|
@@ -3616,7 +3619,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
3616
3619
|
cssRemoveProperty,
|
|
3617
3620
|
cssRemoveHoverPseudoClass,
|
|
3618
3621
|
cssPresetEnv,
|
|
3619
|
-
uniAppX,
|
|
3622
|
+
uniAppX: uniAppXEnabled,
|
|
3620
3623
|
cssCalc: cssCalcOptions,
|
|
3621
3624
|
px2rpx,
|
|
3622
3625
|
unitsToPx
|
|
@@ -3632,7 +3635,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
3632
3635
|
babelParserOptions,
|
|
3633
3636
|
ignoreCallExpressionIdentifiers,
|
|
3634
3637
|
ignoreTaggedTemplateExpressionIdentifiers,
|
|
3635
|
-
uniAppX,
|
|
3638
|
+
uniAppX: uniAppXEnabled,
|
|
3636
3639
|
moduleSpecifierReplacements
|
|
3637
3640
|
});
|
|
3638
3641
|
const templateHandler = createTemplateHandler({
|
|
@@ -3788,6 +3791,9 @@ export {
|
|
|
3788
3791
|
traverse,
|
|
3789
3792
|
babelParse,
|
|
3790
3793
|
replaceWxml,
|
|
3794
|
+
isClassContextLiteralPath,
|
|
3795
|
+
JsTokenUpdater,
|
|
3796
|
+
analyzeSource,
|
|
3791
3797
|
createAttributeMatcher,
|
|
3792
3798
|
generateCode,
|
|
3793
3799
|
getCompilerContext,
|
|
@@ -7,7 +7,7 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkWPH7LL5Vjs = require('./chunk-WPH7LL5V.js');
|
|
11
11
|
|
|
12
12
|
// src/bundlers/gulp/index.ts
|
|
13
13
|
var _buffer = require('buffer');
|
|
@@ -15,12 +15,12 @@ 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 = _chunkWPH7LL5Vjs.createDebug.call(void 0, );
|
|
19
19
|
var Transform = _stream2.default.Transform;
|
|
20
20
|
function createPlugins(options = {}) {
|
|
21
|
-
const opts =
|
|
21
|
+
const opts = _chunkWPH7LL5Vjs.getCompilerContext.call(void 0, options);
|
|
22
22
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
23
|
-
const patchRecorderState =
|
|
23
|
+
const patchRecorderState = _chunkWPH7LL5Vjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
24
24
|
source: "runtime",
|
|
25
25
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
26
26
|
});
|
|
@@ -38,13 +38,13 @@ function createPlugins(options = {}) {
|
|
|
38
38
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
39
39
|
let runtimeSetInitialized = false;
|
|
40
40
|
async function refreshRuntimeState(force) {
|
|
41
|
-
await
|
|
41
|
+
await _chunkWPH7LL5Vjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
42
42
|
}
|
|
43
43
|
async function refreshRuntimeSet(force = false) {
|
|
44
44
|
if (!force && runtimeSetInitialized) {
|
|
45
45
|
return runtimeSet;
|
|
46
46
|
}
|
|
47
|
-
runtimeSet = await
|
|
47
|
+
runtimeSet = await _chunkWPH7LL5Vjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
48
48
|
forceRefresh: force,
|
|
49
49
|
forceCollect: force,
|
|
50
50
|
clearCache: force,
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
var _chunkQK6VNNNLjs = require('./chunk-QK6VNNNL.js');
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
var _chunkLL3QUKJIjs = require('./chunk-LL3QUKJI.js');
|
|
@@ -38,7 +39,7 @@ var debug = createDebug("[tailwindcss:runtime] ");
|
|
|
38
39
|
var refreshTailwindcssPatcherSymbol = /* @__PURE__ */ Symbol.for("weapp-tailwindcss.refreshTailwindcssPatcher");
|
|
39
40
|
function createTailwindPatchPromise(twPatcher, onPatched) {
|
|
40
41
|
return Promise.resolve(twPatcher.patch()).then(async () => {
|
|
41
|
-
|
|
42
|
+
_chunkQK6VNNNLjs.invalidateRuntimeClassSet.call(void 0, twPatcher);
|
|
42
43
|
if (onPatched) {
|
|
43
44
|
try {
|
|
44
45
|
await onPatched();
|
|
@@ -93,7 +94,7 @@ async function ensureRuntimeClassSet(state, options = {}) {
|
|
|
93
94
|
}
|
|
94
95
|
await state.patchPromise;
|
|
95
96
|
const entry = getRuntimeClassSetStateEntry(state);
|
|
96
|
-
const signature =
|
|
97
|
+
const signature = _chunkQK6VNNNLjs.getRuntimeClassSetSignature.call(void 0, state.twPatcher);
|
|
97
98
|
const signatureChanged = entry.signature !== signature;
|
|
98
99
|
const shouldForceCollect = forceCollect || forceRefresh || signatureChanged;
|
|
99
100
|
if (!shouldForceCollect) {
|
|
@@ -128,7 +129,7 @@ async function ensureRuntimeClassSet(state, options = {}) {
|
|
|
128
129
|
try {
|
|
129
130
|
const runtimeSet = await task;
|
|
130
131
|
entry.value = runtimeSet;
|
|
131
|
-
entry.signature =
|
|
132
|
+
entry.signature = _chunkQK6VNNNLjs.getRuntimeClassSetSignature.call(void 0, state.twPatcher);
|
|
132
133
|
return runtimeSet;
|
|
133
134
|
} finally {
|
|
134
135
|
if (entry.promise === task) {
|
|
@@ -185,8 +186,8 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
|
-
const entry =
|
|
189
|
-
const signature =
|
|
189
|
+
const entry = _chunkQK6VNNNLjs.getRuntimeClassSetCacheEntry.call(void 0, activePatcher);
|
|
190
|
+
const signature = _chunkQK6VNNNLjs.getRuntimeClassSetSignature.call(void 0, activePatcher);
|
|
190
191
|
if (!options.force) {
|
|
191
192
|
if (entry.value && entry.signature === signature) {
|
|
192
193
|
return entry.value;
|
|
@@ -385,7 +386,7 @@ function formatRelativeToBase(targetPath, baseDir) {
|
|
|
385
386
|
}
|
|
386
387
|
function resolveRecordLocation(baseDir) {
|
|
387
388
|
const normalizedBase = _path2.default.normalize(baseDir);
|
|
388
|
-
const packageRoot = _nullishCoalesce(
|
|
389
|
+
const packageRoot = _nullishCoalesce(_chunkQK6VNNNLjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
|
|
389
390
|
const packageJsonPath = _path2.default.join(packageRoot, "package.json");
|
|
390
391
|
const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
|
|
391
392
|
const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
|
|
@@ -422,7 +423,7 @@ function getRecordFileCandidates(baseDir) {
|
|
|
422
423
|
// package.json
|
|
423
424
|
var package_default = {
|
|
424
425
|
name: "weapp-tailwindcss",
|
|
425
|
-
version: "4.11.0-alpha.
|
|
426
|
+
version: "4.11.0-alpha.6",
|
|
426
427
|
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!",
|
|
427
428
|
author: "ice breaker <1324318532@qq.com>",
|
|
428
429
|
license: "MIT",
|
|
@@ -626,6 +627,7 @@ var package_default = {
|
|
|
626
627
|
"@weapp-tailwindcss/postcss": "workspace:*",
|
|
627
628
|
"@weapp-tailwindcss/shared": "workspace:*",
|
|
628
629
|
cac: "6.7.14",
|
|
630
|
+
"comment-json": "^4.6.2",
|
|
629
631
|
debug: "~4.4.3",
|
|
630
632
|
"fast-glob": "^3.3.3",
|
|
631
633
|
htmlparser2: "10.1.0",
|
|
@@ -3603,6 +3605,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
3603
3605
|
disabledDefaultTemplateHandler,
|
|
3604
3606
|
replaceRuntimePackages
|
|
3605
3607
|
} = ctx;
|
|
3608
|
+
const uniAppXEnabled = _chunkQK6VNNNLjs.isUniAppXEnabled.call(void 0, uniAppX);
|
|
3606
3609
|
const moduleSpecifierReplacements = resolveRuntimePackageReplacements(replaceRuntimePackages);
|
|
3607
3610
|
const styleHandler = _postcss.createStyleHandler.call(void 0, {
|
|
3608
3611
|
cssPreflight,
|
|
@@ -3616,7 +3619,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
3616
3619
|
cssRemoveProperty,
|
|
3617
3620
|
cssRemoveHoverPseudoClass,
|
|
3618
3621
|
cssPresetEnv,
|
|
3619
|
-
uniAppX,
|
|
3622
|
+
uniAppX: uniAppXEnabled,
|
|
3620
3623
|
cssCalc: cssCalcOptions,
|
|
3621
3624
|
px2rpx,
|
|
3622
3625
|
unitsToPx
|
|
@@ -3632,7 +3635,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
3632
3635
|
babelParserOptions,
|
|
3633
3636
|
ignoreCallExpressionIdentifiers,
|
|
3634
3637
|
ignoreTaggedTemplateExpressionIdentifiers,
|
|
3635
|
-
uniAppX,
|
|
3638
|
+
uniAppX: uniAppXEnabled,
|
|
3636
3639
|
moduleSpecifierReplacements
|
|
3637
3640
|
});
|
|
3638
3641
|
const templateHandler = createTemplateHandler({
|
|
@@ -3715,15 +3718,15 @@ function createInternalCompilerContext(opts) {
|
|
|
3715
3718
|
);
|
|
3716
3719
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
3717
3720
|
applyLoggerLevel(ctx.logLevel);
|
|
3718
|
-
const twPatcher =
|
|
3721
|
+
const twPatcher = _chunkQK6VNNNLjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
3719
3722
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
3720
3723
|
if (_optionalChain([twPatcher, 'access', _119 => _119.packageInfo, 'optionalAccess', _120 => _120.version])) {
|
|
3721
3724
|
_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)))}`);
|
|
3722
3725
|
} else {
|
|
3723
3726
|
_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`);
|
|
3724
3727
|
}
|
|
3725
|
-
|
|
3726
|
-
const cssCalcOptions =
|
|
3728
|
+
_chunkQK6VNNNLjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
3729
|
+
const cssCalcOptions = _chunkQK6VNNNLjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
|
|
3727
3730
|
ctx.cssCalc = cssCalcOptions;
|
|
3728
3731
|
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
3729
3732
|
const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
|
|
@@ -3742,8 +3745,8 @@ function createInternalCompilerContext(opts) {
|
|
|
3742
3745
|
if (_optionalChain([options, 'optionalAccess', _121 => _121.clearCache]) !== false) {
|
|
3743
3746
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
3744
3747
|
}
|
|
3745
|
-
|
|
3746
|
-
const nextPatcher =
|
|
3748
|
+
_chunkQK6VNNNLjs.invalidateRuntimeClassSet.call(void 0, previousPatcher);
|
|
3749
|
+
const nextPatcher = _chunkQK6VNNNLjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
3747
3750
|
Object.assign(previousPatcher, nextPatcher);
|
|
3748
3751
|
ctx.twPatcher = previousPatcher;
|
|
3749
3752
|
return previousPatcher;
|
|
@@ -3764,7 +3767,7 @@ function setupPatchRecorder(patcher, baseDir, options) {
|
|
|
3764
3767
|
const recorder = createPatchTargetRecorder(baseDir, patcher, options);
|
|
3765
3768
|
if (_optionalChain([recorder, 'optionalAccess', _122 => _122.message]) && _optionalChain([options, 'optionalAccess', _123 => _123.logMessage]) !== false) {
|
|
3766
3769
|
const prefix = _optionalChain([options, 'optionalAccess', _124 => _124.messagePrefix]) ? `${options.messagePrefix} ` : "";
|
|
3767
|
-
|
|
3770
|
+
_chunkQK6VNNNLjs.logger.info("%s%s", prefix, recorder.message);
|
|
3768
3771
|
}
|
|
3769
3772
|
const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _125 => _125.onPatched]) ? async () => {
|
|
3770
3773
|
await recorder.onPatched();
|
|
@@ -3792,4 +3795,7 @@ function setupPatchRecorder(patcher, baseDir, options) {
|
|
|
3792
3795
|
|
|
3793
3796
|
|
|
3794
3797
|
|
|
3795
|
-
|
|
3798
|
+
|
|
3799
|
+
|
|
3800
|
+
|
|
3801
|
+
exports.createDebug = createDebug; exports.refreshTailwindRuntimeState = refreshTailwindRuntimeState; exports.ensureRuntimeClassSet = ensureRuntimeClassSet; exports.collectRuntimeClassSet = collectRuntimeClassSet; exports.pluginName = pluginName; exports.vitePluginName = vitePluginName; exports.toCustomAttributesEntities = toCustomAttributesEntities; exports.traverse = traverse; exports.babelParse = babelParse; exports.replaceWxml = replaceWxml; exports.isClassContextLiteralPath = isClassContextLiteralPath; exports.JsTokenUpdater = JsTokenUpdater; exports.analyzeSource = analyzeSource; exports.createAttributeMatcher = createAttributeMatcher; exports.generateCode = generateCode; exports.getCompilerContext = getCompilerContext; exports.setupPatchRecorder = setupPatchRecorder;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
isMpx,
|
|
12
12
|
patchMpxLoaderResolve,
|
|
13
13
|
setupMpxTailwindcssRedirect
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TSRWDW6S.mjs";
|
|
15
15
|
import {
|
|
16
16
|
pushConcurrentTaskFactories,
|
|
17
17
|
resolveDisabledOptions,
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
getCompilerContext,
|
|
29
29
|
pluginName,
|
|
30
30
|
setupPatchRecorder
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-VMKFA54Q.mjs";
|
|
32
32
|
import {
|
|
33
33
|
getRuntimeClassSetSignature,
|
|
34
34
|
resolveTailwindcssOptions
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-OMARW5NC.mjs";
|
|
36
36
|
import {
|
|
37
37
|
getGroupedEntries
|
|
38
38
|
} from "./chunk-OOHJLO5M.mjs";
|
package/dist/cli.js
CHANGED
|
@@ -179,7 +179,7 @@ var import_logger = require("@weapp-tailwindcss/logger");
|
|
|
179
179
|
// package.json
|
|
180
180
|
var package_default = {
|
|
181
181
|
name: "weapp-tailwindcss",
|
|
182
|
-
version: "4.11.0-alpha.
|
|
182
|
+
version: "4.11.0-alpha.6",
|
|
183
183
|
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!",
|
|
184
184
|
author: "ice breaker <1324318532@qq.com>",
|
|
185
185
|
license: "MIT",
|
|
@@ -383,6 +383,7 @@ var package_default = {
|
|
|
383
383
|
"@weapp-tailwindcss/postcss": "workspace:*",
|
|
384
384
|
"@weapp-tailwindcss/shared": "workspace:*",
|
|
385
385
|
cac: "6.7.14",
|
|
386
|
+
"comment-json": "^4.6.2",
|
|
386
387
|
debug: "~4.4.3",
|
|
387
388
|
"fast-glob": "^3.3.3",
|
|
388
389
|
htmlparser2: "10.1.0",
|
package/dist/cli.mjs
CHANGED
|
@@ -155,7 +155,7 @@ import { logger } from "@weapp-tailwindcss/logger";
|
|
|
155
155
|
// package.json
|
|
156
156
|
var package_default = {
|
|
157
157
|
name: "weapp-tailwindcss",
|
|
158
|
-
version: "4.11.0-alpha.
|
|
158
|
+
version: "4.11.0-alpha.6",
|
|
159
159
|
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!",
|
|
160
160
|
author: "ice breaker <1324318532@qq.com>",
|
|
161
161
|
license: "MIT",
|
|
@@ -359,6 +359,7 @@ var package_default = {
|
|
|
359
359
|
"@weapp-tailwindcss/postcss": "workspace:*",
|
|
360
360
|
"@weapp-tailwindcss/shared": "workspace:*",
|
|
361
361
|
cac: "6.7.14",
|
|
362
|
+
"comment-json": "^4.6.2",
|
|
362
363
|
debug: "~4.4.3",
|
|
363
364
|
"fast-glob": "^3.3.3",
|
|
364
365
|
htmlparser2: "10.1.0",
|
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 {
|
|
3
|
+
import { e as UserDefinedOptions } from './index-D8E0GGqB.mjs';
|
|
4
4
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
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 {
|
|
3
|
+
import { e as UserDefinedOptions } from './index-D8E0GGqB.js';
|
|
4
4
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
5
5
|
import '@babel/parser';
|
|
6
6
|
import 'magic-string';
|
package/dist/core.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkWPH7LL5Vjs = require('./chunk-WPH7LL5V.js');
|
|
6
|
+
require('./chunk-QK6VNNNL.js');
|
|
7
7
|
require('./chunk-LL3QUKJI.js');
|
|
8
8
|
require('./chunk-DYLQ6UOI.js');
|
|
9
9
|
require('./chunk-CRDOWYG4.js');
|
|
@@ -24,9 +24,9 @@ function resolveTransformWxssOptions(options) {
|
|
|
24
24
|
return _shared.defuOverrideArray.call(void 0, options, DEFAULT_MAIN_CHUNK_STYLE_OPTIONS);
|
|
25
25
|
}
|
|
26
26
|
function createContext(options = {}) {
|
|
27
|
-
const opts =
|
|
27
|
+
const opts = _chunkWPH7LL5Vjs.getCompilerContext.call(void 0, options);
|
|
28
28
|
const { templateHandler, styleHandler, jsHandler, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
29
|
-
const patchRecorderState =
|
|
29
|
+
const patchRecorderState = _chunkWPH7LL5Vjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
30
30
|
source: "runtime",
|
|
31
31
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
32
32
|
});
|
|
@@ -143,7 +143,7 @@ function createContext(options = {}) {
|
|
|
143
143
|
async function transformWxss(rawCss, options2) {
|
|
144
144
|
await runtimeState.patchPromise;
|
|
145
145
|
const result = await styleHandler(rawCss, resolveTransformWxssOptions(options2));
|
|
146
|
-
runtimeSet = await
|
|
146
|
+
runtimeSet = await _chunkWPH7LL5Vjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
147
147
|
forceRefresh: true,
|
|
148
148
|
forceCollect: true
|
|
149
149
|
});
|
|
@@ -154,7 +154,7 @@ function createContext(options = {}) {
|
|
|
154
154
|
if (_optionalChain([options2, 'optionalAccess', _ => _.runtimeSet])) {
|
|
155
155
|
runtimeSet = options2.runtimeSet;
|
|
156
156
|
} else if (runtimeSet.size === 0) {
|
|
157
|
-
runtimeSet = await
|
|
157
|
+
runtimeSet = await _chunkWPH7LL5Vjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
158
158
|
forceCollect: true
|
|
159
159
|
});
|
|
160
160
|
}
|
|
@@ -163,7 +163,7 @@ function createContext(options = {}) {
|
|
|
163
163
|
async function transformWxml(rawWxml, options2) {
|
|
164
164
|
await runtimeState.patchPromise;
|
|
165
165
|
if (!_optionalChain([options2, 'optionalAccess', _2 => _2.runtimeSet]) && runtimeSet.size === 0) {
|
|
166
|
-
runtimeSet = await
|
|
166
|
+
runtimeSet = await _chunkWPH7LL5Vjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
167
167
|
forceCollect: true
|
|
168
168
|
});
|
|
169
169
|
}
|
package/dist/core.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
ensureRuntimeClassSet,
|
|
3
3
|
getCompilerContext,
|
|
4
4
|
setupPatchRecorder
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-VMKFA54Q.mjs";
|
|
6
|
+
import "./chunk-OMARW5NC.mjs";
|
|
7
7
|
import "./chunk-23K4XDKF.mjs";
|
|
8
8
|
import "./chunk-OOHJLO5M.mjs";
|
|
9
9
|
import "./chunk-EFBQ4SQR.mjs";
|
package/dist/defaults.d.mts
CHANGED
package/dist/defaults.d.ts
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 {
|
|
3
|
+
import { e as UserDefinedOptions } from './index-D8E0GGqB.mjs';
|
|
4
4
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
5
5
|
import '@babel/parser';
|
|
6
6
|
import 'magic-string';
|
package/dist/gulp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITemplateHandlerOptions, CreateJsHandlerOptions } from './types.js';
|
|
2
2
|
import stream from 'node:stream';
|
|
3
|
-
import {
|
|
3
|
+
import { e as UserDefinedOptions } from './index-D8E0GGqB.js';
|
|
4
4
|
import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
5
5
|
import '@babel/parser';
|
|
6
6
|
import 'magic-string';
|
package/dist/gulp.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkVO5STL3Ujs = require('./chunk-VO5STL3U.js');
|
|
4
4
|
require('./chunk-OF6MFURR.js');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-WPH7LL5V.js');
|
|
6
|
+
require('./chunk-QK6VNNNL.js');
|
|
7
7
|
require('./chunk-LL3QUKJI.js');
|
|
8
8
|
require('./chunk-DYLQ6UOI.js');
|
|
9
9
|
require('./chunk-CRDOWYG4.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createPlugins =
|
|
13
|
+
exports.createPlugins = _chunkVO5STL3Ujs.createPlugins; exports.weappTailwindcss = _chunkVO5STL3Ujs.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LYANBRNN.mjs";
|
|
4
4
|
import "./chunk-76S2EME4.mjs";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-VMKFA54Q.mjs";
|
|
6
|
+
import "./chunk-OMARW5NC.mjs";
|
|
7
7
|
import "./chunk-23K4XDKF.mjs";
|
|
8
8
|
import "./chunk-OOHJLO5M.mjs";
|
|
9
9
|
import "./chunk-EFBQ4SQR.mjs";
|
|
@@ -269,6 +269,32 @@ interface UserDefinedOptionsGeneralPart {
|
|
|
269
269
|
logLevel?: 'info' | 'warn' | 'error' | 'silent';
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
interface UniAppXComponentLocalStylesOptions {
|
|
273
|
+
/**
|
|
274
|
+
* 是否开启组件级局部 Tailwind 样式注入。
|
|
275
|
+
*
|
|
276
|
+
* @default true
|
|
277
|
+
*/
|
|
278
|
+
enabled?: boolean;
|
|
279
|
+
/**
|
|
280
|
+
* 是否仅在 `manifest.json` 的 `styleIsolationVersion=2` 时启用。
|
|
281
|
+
*
|
|
282
|
+
* @default true
|
|
283
|
+
*/
|
|
284
|
+
onlyWhenStyleIsolationVersion2?: boolean;
|
|
285
|
+
}
|
|
286
|
+
interface UniAppXOptions {
|
|
287
|
+
/**
|
|
288
|
+
* 是否启用 uni-app x 适配链路。
|
|
289
|
+
*
|
|
290
|
+
* @default true
|
|
291
|
+
*/
|
|
292
|
+
enabled?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* 配置 issue 822 所需的组件级局部样式能力。
|
|
295
|
+
*/
|
|
296
|
+
componentLocalStyles?: boolean | UniAppXComponentLocalStylesOptions;
|
|
297
|
+
}
|
|
272
298
|
interface UserDefinedOptionsImportantPart {
|
|
273
299
|
/**
|
|
274
300
|
* 是否禁用此插件。
|
|
@@ -519,7 +545,7 @@ interface UserDefinedOptionsImportantPart {
|
|
|
519
545
|
* @group 0.重要配置
|
|
520
546
|
* @ignore
|
|
521
547
|
*/
|
|
522
|
-
uniAppX?: boolean;
|
|
548
|
+
uniAppX?: boolean | UniAppXOptions;
|
|
523
549
|
}
|
|
524
550
|
|
|
525
551
|
interface UserDefinedOptionsLifecyclePart {
|
|
@@ -615,4 +641,4 @@ interface UserDefinedOptionsMatcherPart {
|
|
|
615
641
|
interface UserDefinedOptions extends UserDefinedOptionsGeneralPart, UserDefinedOptionsImportantPart, UserDefinedOptionsLifecyclePart, UserDefinedOptionsMatcherPart {
|
|
616
642
|
}
|
|
617
643
|
|
|
618
|
-
export type { AppType as A, DisabledOptions as D, IArbitraryValues as I,
|
|
644
|
+
export type { AppType as A, DisabledOptions as D, IArbitraryValues as I, UniAppXComponentLocalStylesOptions as U, ICustomAttributes as a, ICustomAttributesEntities as b, ItemOrItemArray as c, UniAppXOptions as d, UserDefinedOptions as e, ICreateCacheReturnType as f };
|
|
@@ -269,6 +269,32 @@ interface UserDefinedOptionsGeneralPart {
|
|
|
269
269
|
logLevel?: 'info' | 'warn' | 'error' | 'silent';
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
interface UniAppXComponentLocalStylesOptions {
|
|
273
|
+
/**
|
|
274
|
+
* 是否开启组件级局部 Tailwind 样式注入。
|
|
275
|
+
*
|
|
276
|
+
* @default true
|
|
277
|
+
*/
|
|
278
|
+
enabled?: boolean;
|
|
279
|
+
/**
|
|
280
|
+
* 是否仅在 `manifest.json` 的 `styleIsolationVersion=2` 时启用。
|
|
281
|
+
*
|
|
282
|
+
* @default true
|
|
283
|
+
*/
|
|
284
|
+
onlyWhenStyleIsolationVersion2?: boolean;
|
|
285
|
+
}
|
|
286
|
+
interface UniAppXOptions {
|
|
287
|
+
/**
|
|
288
|
+
* 是否启用 uni-app x 适配链路。
|
|
289
|
+
*
|
|
290
|
+
* @default true
|
|
291
|
+
*/
|
|
292
|
+
enabled?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* 配置 issue 822 所需的组件级局部样式能力。
|
|
295
|
+
*/
|
|
296
|
+
componentLocalStyles?: boolean | UniAppXComponentLocalStylesOptions;
|
|
297
|
+
}
|
|
272
298
|
interface UserDefinedOptionsImportantPart {
|
|
273
299
|
/**
|
|
274
300
|
* 是否禁用此插件。
|
|
@@ -519,7 +545,7 @@ interface UserDefinedOptionsImportantPart {
|
|
|
519
545
|
* @group 0.重要配置
|
|
520
546
|
* @ignore
|
|
521
547
|
*/
|
|
522
|
-
uniAppX?: boolean;
|
|
548
|
+
uniAppX?: boolean | UniAppXOptions;
|
|
523
549
|
}
|
|
524
550
|
|
|
525
551
|
interface UserDefinedOptionsLifecyclePart {
|
|
@@ -615,4 +641,4 @@ interface UserDefinedOptionsMatcherPart {
|
|
|
615
641
|
interface UserDefinedOptions extends UserDefinedOptionsGeneralPart, UserDefinedOptionsImportantPart, UserDefinedOptionsLifecyclePart, UserDefinedOptionsMatcherPart {
|
|
616
642
|
}
|
|
617
643
|
|
|
618
|
-
export type { AppType as A, DisabledOptions as D, IArbitraryValues as I,
|
|
644
|
+
export type { AppType as A, DisabledOptions as D, IArbitraryValues as I, UniAppXComponentLocalStylesOptions as U, ICustomAttributes as a, ICustomAttributesEntities as b, ItemOrItemArray as c, UniAppXOptions as d, UserDefinedOptions as e, ICreateCacheReturnType as f };
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ export { createPlugins } from './gulp.mjs';
|
|
|
2
2
|
export { CreateJsHandlerOptions, IBaseWebpackPlugin, ICommonReplaceOptions, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike } from './types.mjs';
|
|
3
3
|
export { UnifiedViteWeappTailwindcssPlugin } from './vite.mjs';
|
|
4
4
|
export { UnifiedWebpackPluginV5, weappTailwindcssPackageDir } from './webpack.mjs';
|
|
5
|
-
export { A as AppType, D as DisabledOptions, I as IArbitraryValues, a as ICustomAttributes, b as ICustomAttributesEntities, c as ItemOrItemArray, U as UserDefinedOptions } from './index-
|
|
5
|
+
export { A as AppType, D as DisabledOptions, I as IArbitraryValues, a as ICustomAttributes, b as ICustomAttributesEntities, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions, e as UserDefinedOptions } from './index-D8E0GGqB.mjs';
|
|
6
6
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
7
7
|
import 'node:stream';
|
|
8
8
|
import '@babel/parser';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { createPlugins } from './gulp.js';
|
|
|
2
2
|
export { CreateJsHandlerOptions, IBaseWebpackPlugin, ICommonReplaceOptions, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike } from './types.js';
|
|
3
3
|
export { UnifiedViteWeappTailwindcssPlugin } from './vite.js';
|
|
4
4
|
export { UnifiedWebpackPluginV5, weappTailwindcssPackageDir } from './webpack.js';
|
|
5
|
-
export { A as AppType, D as DisabledOptions, I as IArbitraryValues, a as ICustomAttributes, b as ICustomAttributesEntities, c as ItemOrItemArray, U as UserDefinedOptions } from './index-
|
|
5
|
+
export { A as AppType, D as DisabledOptions, I as IArbitraryValues, a as ICustomAttributes, b as ICustomAttributesEntities, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions, e as UserDefinedOptions } from './index-D8E0GGqB.js';
|
|
6
6
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
7
7
|
import 'node:stream';
|
|
8
8
|
import '@babel/parser';
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunk4BHL5BDOjs = require('./chunk-4BHL5BDO.js');
|
|
5
|
+
require('./chunk-KWG7VWW5.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkVO5STL3Ujs = require('./chunk-VO5STL3U.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkDO6MQ3YFjs = require('./chunk-DO6MQ3YF.js');
|
|
12
12
|
require('./chunk-7LKMJZD2.js');
|
|
13
13
|
require('./chunk-OF6MFURR.js');
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-WPH7LL5V.js');
|
|
15
|
+
require('./chunk-QK6VNNNL.js');
|
|
16
16
|
require('./chunk-LL3QUKJI.js');
|
|
17
17
|
require('./chunk-DYLQ6UOI.js');
|
|
18
18
|
require('./chunk-CRDOWYG4.js');
|
|
@@ -21,4 +21,4 @@ require('./chunk-CRDOWYG4.js');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
24
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkDO6MQ3YFjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunk4BHL5BDOjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkVO5STL3Ujs.createPlugins; exports.weappTailwindcssPackageDir = _chunk4BHL5BDOjs.weappTailwindcssPackageDir;
|
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ZMQZ667Q.mjs";
|
|
5
|
+
import "./chunk-TSRWDW6S.mjs";
|
|
6
6
|
import {
|
|
7
7
|
createPlugins
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LYANBRNN.mjs";
|
|
9
9
|
import {
|
|
10
10
|
UnifiedViteWeappTailwindcssPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RQLIVYJZ.mjs";
|
|
12
12
|
import "./chunk-F2CKKG6Q.mjs";
|
|
13
13
|
import "./chunk-76S2EME4.mjs";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-VMKFA54Q.mjs";
|
|
15
|
+
import "./chunk-OMARW5NC.mjs";
|
|
16
16
|
import "./chunk-23K4XDKF.mjs";
|
|
17
17
|
import "./chunk-OOHJLO5M.mjs";
|
|
18
18
|
import "./chunk-EFBQ4SQR.mjs";
|