weapp-tailwindcss 5.0.0-next.3 → 5.0.0-next.5
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/README.md +4 -5
- package/bin/weapp-tailwindcss.js +1 -21
- package/dist/bundlers/shared/generator-css.d.ts +5 -2
- package/dist/bundlers/vite/generate-bundle.d.ts +1 -0
- package/dist/bundlers/vite/index.d.ts +1 -1
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +0 -1
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +1 -1
- package/dist/cli/context.d.ts +0 -3
- package/dist/cli/mount-options.d.ts +2 -0
- package/dist/cli.js +8 -2
- package/dist/cli.mjs +8 -2
- package/dist/constants.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.d.ts +1 -0
- package/dist/defaults.js +5 -7
- package/dist/defaults.mjs +5 -7
- package/dist/generator/index.d.ts +1 -1
- package/dist/generator/options.d.ts +3 -4
- package/dist/{generator-mmhXzZnv.js → generator-9UEp8OoQ.js} +259 -21
- package/dist/{generator-Y-Ikv4Fu.mjs → generator-Dpp-5s8z.mjs} +260 -22
- package/dist/{generator-css-CRLrHW4F.js → generator-css-CGueCYbX.js} +173 -32
- package/dist/{generator-css-Bwy_Uz89.mjs → generator-css-MyjZhF0z.mjs} +173 -32
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/gulp.js +15 -11
- package/dist/gulp.mjs +15 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/js/index.d.ts +1 -0
- package/dist/js/literal-transform.d.ts +2 -0
- package/dist/{logger-BoVx1Dbt.mjs → logger-1gx9UllH.mjs} +21 -51
- package/dist/{logger-BZ45DZJT.js → logger-D9clu_3f.js} +21 -51
- package/dist/patcher-options-DnqazL9E.js +34 -0
- package/dist/patcher-options-GuOwX0-k.mjs +17 -0
- package/dist/postcss.d.ts +2 -2
- package/dist/postcss.js +37 -28
- package/dist/postcss.mjs +37 -28
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/{recorder-XdFvVASS.mjs → recorder-BIW3Kuke.mjs} +5 -12
- package/dist/{recorder-GdTJ3QqX.js → recorder-D4BKt75Q.js} +5 -12
- package/dist/reset.d.ts +1 -0
- package/dist/{css-imports-BbrbluP9.js → run-tasks-Cq5A5nVD.js} +6 -55
- package/dist/{css-imports-CSdPq_Sc.mjs → run-tasks-DUVrDJGl.mjs} +5 -42
- package/dist/tailwindcss/miniprogram.d.ts +5 -1
- package/dist/tailwindcss/patcher-options.d.ts +3 -51
- package/dist/tailwindcss/patcher.d.ts +1 -2
- package/dist/tailwindcss/v4/patcher-options.d.ts +1 -23
- package/dist/tailwindcss/v4/patcher.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/types.d.ts +1 -1
- package/dist/tailwindcss/version.d.ts +4 -0
- package/dist/typedoc.export.d.ts +0 -2
- package/dist/types/index.d.ts +1 -3
- package/dist/types/shared.d.ts +3 -0
- package/dist/types/user-defined-options/general.d.ts +0 -2
- package/dist/types/user-defined-options/important.d.ts +3 -3
- package/dist/utils/disabled.d.ts +2 -3
- package/dist/version-CWBxRFPB.js +56 -0
- package/dist/version-WNz3MwRv.mjs +49 -0
- package/dist/{vite-DgRh_GXn.js → vite-BkMGwDeH.js} +106 -39
- package/dist/{vite-BDywuCjn.mjs → vite-fDM-UQpR.mjs} +89 -22
- package/dist/vite.d.ts +1 -2
- package/dist/vite.js +3 -4
- package/dist/vite.mjs +2 -2
- package/dist/weapp-tw-css-import-rewrite-loader.js +1 -1
- package/dist/{webpack-CAJR4hhP.js → webpack-CICGEKT9.js} +225 -43
- package/dist/{webpack-CiHqVZTg.mjs → webpack-D2Wdk28V.mjs} +214 -27
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +21 -30
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +0 -14
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +0 -15
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -9
- package/dist/experimental/index.d.ts +0 -2
- package/dist/experimental/oxc/ast-utils.d.ts +0 -30
- package/dist/experimental/oxc/index.d.ts +0 -2
- package/dist/experimental/oxc/module-specifiers.d.ts +0 -2
- package/dist/experimental/shared/cache.d.ts +0 -3
- package/dist/experimental/shared/transform.d.ts +0 -3
- package/dist/experimental/shared.d.ts +0 -8
- package/dist/experimental/swc/ast-utils.d.ts +0 -30
- package/dist/experimental/swc/index.d.ts +0 -2
- package/dist/experimental/swc/module-specifiers.d.ts +0 -2
- package/dist/loader-anchors-1MumTAtA.mjs +0 -205
- package/dist/loader-anchors-TrFvT6g1.js +0 -273
- package/dist/patcher-options-6gJN2EXy.js +0 -115
- package/dist/patcher-options-DQfR5xxT.mjs +0 -92
- package/dist/types/disabled-options.d.ts +0 -4
- package/dist/webpack4.d.ts +0 -4
- package/dist/webpack4.js +0 -387
- package/dist/webpack4.mjs +0 -379
- package/scripts/postinstall.mjs +0 -59
package/dist/postcss.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as resolveTailwindV4Source$1, i as normalizeWeappTailwindcssGeneratorOptions, p as resolveTailwindV3Source, t as createWeappTailwindcssGenerator } from "./generator-
|
|
2
|
-
import {
|
|
1
|
+
import { a as resolveTailwindV4Source$1, i as normalizeWeappTailwindcssGeneratorOptions, p as resolveTailwindV3Source, t as createWeappTailwindcssGenerator } from "./generator-Dpp-5s8z.mjs";
|
|
2
|
+
import { t as readInstalledPackageMajorVersion } from "./version-WNz3MwRv.mjs";
|
|
3
3
|
import postcss from "postcss";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
@@ -9,7 +9,7 @@ import { readFile, stat } from "node:fs/promises";
|
|
|
9
9
|
import fg from "fast-glob";
|
|
10
10
|
//#region src/postcss.ts
|
|
11
11
|
const PLUGIN_NAME = "weapp-tailwindcss";
|
|
12
|
-
const
|
|
12
|
+
const POSTCSS_SOURCE_PATTERN = `**/*.{${[
|
|
13
13
|
"html",
|
|
14
14
|
"wxml",
|
|
15
15
|
"axml",
|
|
@@ -26,10 +26,11 @@ const POSTCSS_SOURCE_EXTENSIONS = [
|
|
|
26
26
|
"jsx",
|
|
27
27
|
"ts",
|
|
28
28
|
"tsx"
|
|
29
|
-
]
|
|
29
|
+
].join(",")}}`;
|
|
30
30
|
function resolveInputFile(result) {
|
|
31
31
|
const from = result.opts.from;
|
|
32
|
-
|
|
32
|
+
if (typeof from !== "string" || from.length === 0) return;
|
|
33
|
+
return path.isAbsolute(from) ? from : path.resolve(process.cwd(), from);
|
|
33
34
|
}
|
|
34
35
|
function resolvePostcssBase(result, options) {
|
|
35
36
|
if (options.base) return options.base;
|
|
@@ -42,9 +43,13 @@ function resolvePostcssProjectRoot(result, options) {
|
|
|
42
43
|
return inputFile ? path.dirname(inputFile) : process.cwd();
|
|
43
44
|
}
|
|
44
45
|
function replaceRootCss(root, css, result) {
|
|
45
|
-
const nextRoot = postcss.parse(css, { from: resolveInputFile(result) });
|
|
46
46
|
root.removeAll();
|
|
47
|
-
|
|
47
|
+
try {
|
|
48
|
+
const nextRoot = postcss.parse(css, { from: resolveInputFile(result) });
|
|
49
|
+
root.append(nextRoot.nodes);
|
|
50
|
+
} catch {
|
|
51
|
+
root.raws = { after: css };
|
|
52
|
+
}
|
|
48
53
|
}
|
|
49
54
|
function addDependencyMessages(result, generated) {
|
|
50
55
|
for (const file of generated.dependencies) result.messages.push({
|
|
@@ -81,22 +86,15 @@ function hasTailwindV4CssSyntax(root) {
|
|
|
81
86
|
});
|
|
82
87
|
return hasV4Syntax;
|
|
83
88
|
}
|
|
84
|
-
function readPackageMajorVersion(packageName, base) {
|
|
85
|
-
try {
|
|
86
|
-
const pkg = createRequire(`${base}/package.json`)(`${packageName}/package.json`);
|
|
87
|
-
const major = Number(pkg.version?.split(".")[0]);
|
|
88
|
-
return major === 3 || major === 4 ? major : void 0;
|
|
89
|
-
} catch {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
89
|
function resolvePostcssTailwindVersion(root, result, options) {
|
|
94
|
-
if (options.version) return options.version;
|
|
95
|
-
if (hasTailwindV4CssSyntax(root)) return 4;
|
|
96
90
|
const packageName = options.packageName ?? "tailwindcss";
|
|
91
|
+
const installedVersion = readInstalledPackageMajorVersion(packageName, resolvePostcssProjectRoot(result, options));
|
|
92
|
+
if (installedVersion) return installedVersion;
|
|
93
|
+
if (options.version) return options.version;
|
|
97
94
|
if (packageName === "@tailwindcss/postcss" || packageName.includes("tailwindcss4")) return 4;
|
|
98
95
|
if (packageName.includes("tailwindcss3")) return 3;
|
|
99
|
-
|
|
96
|
+
if (hasTailwindV4CssSyntax(root)) return 4;
|
|
97
|
+
return 4;
|
|
100
98
|
}
|
|
101
99
|
function getSourceExtension(file) {
|
|
102
100
|
return path.extname(file).slice(1) || void 0;
|
|
@@ -110,7 +108,7 @@ async function pathExistsAsDirectory(file) {
|
|
|
110
108
|
}
|
|
111
109
|
async function expandLocalSourceFiles(sourcePath, base) {
|
|
112
110
|
const absoluteSource = path.isAbsolute(sourcePath) ? sourcePath : path.resolve(base, sourcePath);
|
|
113
|
-
if (await pathExistsAsDirectory(absoluteSource)) return fg(
|
|
111
|
+
if (await pathExistsAsDirectory(absoluteSource)) return fg(POSTCSS_SOURCE_PATTERN, {
|
|
114
112
|
absolute: true,
|
|
115
113
|
cwd: absoluteSource,
|
|
116
114
|
onlyFiles: true
|
|
@@ -126,7 +124,7 @@ async function resolveTailwindSourceEntry(sourcePath, base, negated) {
|
|
|
126
124
|
if (await pathExistsAsDirectory(absoluteSource)) return {
|
|
127
125
|
base: absoluteSource,
|
|
128
126
|
negated,
|
|
129
|
-
pattern:
|
|
127
|
+
pattern: POSTCSS_SOURCE_PATTERN
|
|
130
128
|
};
|
|
131
129
|
if (path.isAbsolute(sourcePath)) return {
|
|
132
130
|
base: path.dirname(absoluteSource),
|
|
@@ -169,13 +167,14 @@ async function collectConfigContentFiles(root, base) {
|
|
|
169
167
|
};
|
|
170
168
|
}
|
|
171
169
|
async function collectAutoTailwindCandidates(root, result, options) {
|
|
170
|
+
if (options.scanSources === false) return /* @__PURE__ */ new Set();
|
|
172
171
|
const base = resolvePostcssBase(result, options);
|
|
173
172
|
const projectRoot = resolvePostcssProjectRoot(result, options);
|
|
174
173
|
const sourceEntryTasks = [];
|
|
175
174
|
if (!root.toString().includes("source(none)")) sourceEntryTasks.push(Promise.resolve({
|
|
176
175
|
base,
|
|
177
176
|
negated: false,
|
|
178
|
-
pattern:
|
|
177
|
+
pattern: POSTCSS_SOURCE_PATTERN
|
|
179
178
|
}));
|
|
180
179
|
root.walkAtRules("source", (rule) => {
|
|
181
180
|
const parsed = parseSourceFileParam(rule.params);
|
|
@@ -217,17 +216,27 @@ function addSourceDependencyMessages(result, files) {
|
|
|
217
216
|
file
|
|
218
217
|
});
|
|
219
218
|
}
|
|
219
|
+
function quoteCssString(value) {
|
|
220
|
+
return value.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
|
|
221
|
+
}
|
|
222
|
+
function toCssPath(value) {
|
|
223
|
+
return value.replaceAll("\\", "/");
|
|
224
|
+
}
|
|
225
|
+
function prependConfigDirective(css, config) {
|
|
226
|
+
if (!config || /@config\s+/.test(css)) return css;
|
|
227
|
+
return `@config "${quoteCssString(toCssPath(config))}";\n${css}`;
|
|
228
|
+
}
|
|
220
229
|
const weappTailwindcssPostcssPlugin = (options = {}) => {
|
|
221
230
|
return {
|
|
222
231
|
postcssPlugin: PLUGIN_NAME,
|
|
223
232
|
async Once(root, { result }) {
|
|
224
|
-
const { candidates, generator: userGeneratorOptions, sources, styleOptions,
|
|
233
|
+
const { candidates, generator: userGeneratorOptions, scanSources, sources, styleOptions, ...sourceOptions } = options;
|
|
225
234
|
const generatorOptions = normalizeWeappTailwindcssGeneratorOptions(userGeneratorOptions);
|
|
226
|
-
if (generatorOptions.mode === "off") return;
|
|
227
235
|
const tailwindVersion = resolvePostcssTailwindVersion(root, result, options);
|
|
228
236
|
const [collectedSources, autoCandidates] = await Promise.all([collectPostcssLocalSources(root, result, options), collectAutoTailwindCandidates(root, result, options)]);
|
|
237
|
+
const generatorConfig = generatorOptions.config ?? options.config;
|
|
229
238
|
const generator = createWeappTailwindcssGenerator(tailwindVersion === 3 ? await resolveTailwindV3Source({
|
|
230
|
-
config:
|
|
239
|
+
config: generatorConfig,
|
|
231
240
|
css: sourceOptions.css ?? root.toString(),
|
|
232
241
|
base: resolvePostcssBase(result, options),
|
|
233
242
|
cwd: resolvePostcssProjectRoot(result, options),
|
|
@@ -236,20 +245,20 @@ const weappTailwindcssPostcssPlugin = (options = {}) => {
|
|
|
236
245
|
postcssPlugin: options.postcssPlugin
|
|
237
246
|
}) : await resolveTailwindV4Source$1({
|
|
238
247
|
...sourceOptions,
|
|
239
|
-
css: sourceOptions.css ?? root.toString(),
|
|
248
|
+
css: prependConfigDirective(sourceOptions.css ?? root.toString(), generatorConfig),
|
|
240
249
|
base: resolvePostcssBase(result, options),
|
|
241
250
|
projectRoot: resolvePostcssProjectRoot(result, options)
|
|
242
251
|
}));
|
|
243
252
|
const generateOptions = {
|
|
244
253
|
candidates: new Set([...autoCandidates, ...candidates ?? []]),
|
|
245
|
-
scanSources: false,
|
|
254
|
+
scanSources: scanSources ?? false,
|
|
246
255
|
sources: [...collectedSources.sources, ...sources ?? []],
|
|
247
256
|
styleOptions: {
|
|
248
257
|
...generatorOptions.styleOptions,
|
|
249
258
|
...styleOptions
|
|
250
259
|
},
|
|
251
260
|
tailwindcssV3Compatibility: generatorOptions.tailwindcssV3Compatibility,
|
|
252
|
-
target:
|
|
261
|
+
target: generatorOptions.target
|
|
253
262
|
};
|
|
254
263
|
const generated = await generator.generate(generateOptions);
|
|
255
264
|
replaceRootCss(root, generated.css, result);
|
package/dist/presets.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
3
3
|
const require_utils = require("./utils-DmC9_In3.js");
|
|
4
|
-
const require_logger = require("./logger-
|
|
4
|
+
const require_logger = require("./logger-D9clu_3f.js");
|
|
5
5
|
let node_process = require("node:process");
|
|
6
6
|
node_process = require_chunk.__toESM(node_process);
|
|
7
7
|
let local_pkg = require("local-pkg");
|
package/dist/presets.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-7DUGTFED.mjs";
|
|
2
|
-
import { a as resolveUniAppXOptions, r as resolveTailwindcssBasedir, t as logger } from "./logger-
|
|
2
|
+
import { a as resolveUniAppXOptions, r as resolveTailwindcssBasedir, t as logger } from "./logger-1gx9UllH.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { getPackageInfoSync } from "local-pkg";
|
|
5
5
|
//#region src/presets/shared.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as isMap, n as defuOverrideArray } from "./utils-7DUGTFED.mjs";
|
|
2
2
|
import { getDefaultOptions } from "./defaults.mjs";
|
|
3
|
-
import { a as resolveUniAppXOptions, c as warnMissingCssEntries, d as getRuntimeClassSetSignature, f as invalidateRuntimeClassSet, i as isUniAppXEnabled, l as findNearestPackageRoot, n as createTailwindcssPatcherFromContext, s as applyV4CssCalcDefaults, t as logger$1, u as getRuntimeClassSetCacheEntry } from "./logger-
|
|
3
|
+
import { a as resolveUniAppXOptions, c as warnMissingCssEntries, d as getRuntimeClassSetSignature, f as invalidateRuntimeClassSet, i as isUniAppXEnabled, l as findNearestPackageRoot, n as createTailwindcssPatcherFromContext, s as applyV4CssCalcDefaults, t as logger$1, u as getRuntimeClassSetCacheEntry } from "./logger-1gx9UllH.mjs";
|
|
4
4
|
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process from "node:process";
|
|
@@ -364,10 +364,10 @@ function getRecordFileCandidates(baseDir) {
|
|
|
364
364
|
}
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region package.json
|
|
367
|
-
var version = "5.0.0-next.
|
|
367
|
+
var version = "5.0.0-next.5";
|
|
368
368
|
//#endregion
|
|
369
369
|
//#region src/constants.ts
|
|
370
|
-
const pluginName = "weapp-tailwindcss
|
|
370
|
+
const pluginName = "weapp-tailwindcss";
|
|
371
371
|
const vitePluginName = "weapp-tailwindcss:adaptor";
|
|
372
372
|
const WEAPP_TW_VERSION = version;
|
|
373
373
|
const DEFAULT_RUNTIME_PACKAGE_REPLACEMENTS = {
|
|
@@ -2104,7 +2104,6 @@ function getOptionsFingerprint(options) {
|
|
|
2104
2104
|
options.uniAppX ? "1" : "0",
|
|
2105
2105
|
options.wrapExpression ? "1" : "0",
|
|
2106
2106
|
String(options.tailwindcssMajorVersion ?? ""),
|
|
2107
|
-
String(options.staleClassNameFallback ?? ""),
|
|
2108
2107
|
String(options.jsArbitraryValueFallback ?? ""),
|
|
2109
2108
|
JSON.stringify(options.arbitraryValues ?? null),
|
|
2110
2109
|
JSON.stringify(options.ignoreCallExpressionIdentifiers ?? null),
|
|
@@ -2128,7 +2127,6 @@ function shouldCacheJsResult(rawSource, options) {
|
|
|
2128
2127
|
function createJsHandler(options) {
|
|
2129
2128
|
const defaults = {
|
|
2130
2129
|
escapeMap: options.escapeMap,
|
|
2131
|
-
staleClassNameFallback: options.staleClassNameFallback,
|
|
2132
2130
|
jsArbitraryValueFallback: options.jsArbitraryValueFallback,
|
|
2133
2131
|
tailwindcssMajorVersion: options.tailwindcssMajorVersion,
|
|
2134
2132
|
arbitraryValues: options.arbitraryValues,
|
|
@@ -2290,11 +2288,7 @@ function generateCode(match, options = {}) {
|
|
|
2290
2288
|
const initial = jsHandler(match, runtimeSet, wrapExpression ? WRAP_EXPRESSION_HANDLER_OPTIONS : void 0);
|
|
2291
2289
|
if (!initial.error || wrapExpression) return initial.code;
|
|
2292
2290
|
return jsHandler(match, runtimeSet, WRAP_EXPRESSION_HANDLER_OPTIONS).code;
|
|
2293
|
-
} else
|
|
2294
|
-
/**
|
|
2295
|
-
* @deprecated
|
|
2296
|
-
*/
|
|
2297
|
-
return rewriteLegacyExpression(match, options);
|
|
2291
|
+
} else return rewriteLegacyExpression(match, options);
|
|
2298
2292
|
} catch {
|
|
2299
2293
|
return match;
|
|
2300
2294
|
}
|
|
@@ -2588,7 +2582,7 @@ function resolveRuntimePackageReplacements(option) {
|
|
|
2588
2582
|
return Object.keys(normalized).length > 0 ? normalized : void 0;
|
|
2589
2583
|
}
|
|
2590
2584
|
function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions, tailwindcssMajorVersion) {
|
|
2591
|
-
const { cssPreflight, cssPreflightRange, escapeMap, cssChildCombinatorReplaceValue, injectAdditionalCssVarScope, cssSelectorReplacement, rem2rpx, postcssOptions, cssRemoveProperty, cssRemoveHoverPseudoClass, cssPresetEnv, autoprefixer, uniAppX, px2rpx, unitsToPx, arbitraryValues, jsPreserveClass,
|
|
2585
|
+
const { cssPreflight, cssPreflightRange, escapeMap, cssChildCombinatorReplaceValue, injectAdditionalCssVarScope, cssSelectorReplacement, rem2rpx, postcssOptions, cssRemoveProperty, cssRemoveHoverPseudoClass, cssPresetEnv, autoprefixer, uniAppX, px2rpx, unitsToPx, arbitraryValues, jsPreserveClass, jsArbitraryValueFallback, babelParserOptions, ignoreCallExpressionIdentifiers, ignoreTaggedTemplateExpressionIdentifiers, inlineWxs, disabledDefaultTemplateHandler, replaceRuntimePackages } = ctx;
|
|
2592
2586
|
const uniAppXEnabled = isUniAppXEnabled(uniAppX);
|
|
2593
2587
|
const resolvedUniAppXOptions = resolveUniAppXOptions(uniAppX);
|
|
2594
2588
|
const moduleSpecifierReplacements = resolveRuntimePackageReplacements(replaceRuntimePackages);
|
|
@@ -2616,7 +2610,6 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
2616
2610
|
escapeMap,
|
|
2617
2611
|
arbitraryValues,
|
|
2618
2612
|
jsPreserveClass,
|
|
2619
|
-
staleClassNameFallback,
|
|
2620
2613
|
jsArbitraryValueFallback: jsArbitraryValueFallback ?? "auto",
|
|
2621
2614
|
tailwindcssMajorVersion,
|
|
2622
2615
|
generateMap: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
2
|
require("./utils-DmC9_In3.js");
|
|
3
3
|
const require_defaults = require("./defaults.js");
|
|
4
|
-
const require_logger = require("./logger-
|
|
4
|
+
const require_logger = require("./logger-D9clu_3f.js");
|
|
5
5
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
6
6
|
let node_path = require("node:path");
|
|
7
7
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -372,10 +372,10 @@ function getRecordFileCandidates(baseDir) {
|
|
|
372
372
|
}
|
|
373
373
|
//#endregion
|
|
374
374
|
//#region package.json
|
|
375
|
-
var version = "5.0.0-next.
|
|
375
|
+
var version = "5.0.0-next.5";
|
|
376
376
|
//#endregion
|
|
377
377
|
//#region src/constants.ts
|
|
378
|
-
const pluginName = "weapp-tailwindcss
|
|
378
|
+
const pluginName = "weapp-tailwindcss";
|
|
379
379
|
const vitePluginName = "weapp-tailwindcss:adaptor";
|
|
380
380
|
const WEAPP_TW_VERSION = version;
|
|
381
381
|
const DEFAULT_RUNTIME_PACKAGE_REPLACEMENTS = {
|
|
@@ -2112,7 +2112,6 @@ function getOptionsFingerprint(options) {
|
|
|
2112
2112
|
options.uniAppX ? "1" : "0",
|
|
2113
2113
|
options.wrapExpression ? "1" : "0",
|
|
2114
2114
|
String(options.tailwindcssMajorVersion ?? ""),
|
|
2115
|
-
String(options.staleClassNameFallback ?? ""),
|
|
2116
2115
|
String(options.jsArbitraryValueFallback ?? ""),
|
|
2117
2116
|
JSON.stringify(options.arbitraryValues ?? null),
|
|
2118
2117
|
JSON.stringify(options.ignoreCallExpressionIdentifiers ?? null),
|
|
@@ -2136,7 +2135,6 @@ function shouldCacheJsResult(rawSource, options) {
|
|
|
2136
2135
|
function createJsHandler(options) {
|
|
2137
2136
|
const defaults = {
|
|
2138
2137
|
escapeMap: options.escapeMap,
|
|
2139
|
-
staleClassNameFallback: options.staleClassNameFallback,
|
|
2140
2138
|
jsArbitraryValueFallback: options.jsArbitraryValueFallback,
|
|
2141
2139
|
tailwindcssMajorVersion: options.tailwindcssMajorVersion,
|
|
2142
2140
|
arbitraryValues: options.arbitraryValues,
|
|
@@ -2298,11 +2296,7 @@ function generateCode(match, options = {}) {
|
|
|
2298
2296
|
const initial = jsHandler(match, runtimeSet, wrapExpression ? WRAP_EXPRESSION_HANDLER_OPTIONS : void 0);
|
|
2299
2297
|
if (!initial.error || wrapExpression) return initial.code;
|
|
2300
2298
|
return jsHandler(match, runtimeSet, WRAP_EXPRESSION_HANDLER_OPTIONS).code;
|
|
2301
|
-
} else
|
|
2302
|
-
/**
|
|
2303
|
-
* @deprecated
|
|
2304
|
-
*/
|
|
2305
|
-
return rewriteLegacyExpression(match, options);
|
|
2299
|
+
} else return rewriteLegacyExpression(match, options);
|
|
2306
2300
|
} catch {
|
|
2307
2301
|
return match;
|
|
2308
2302
|
}
|
|
@@ -2596,7 +2590,7 @@ function resolveRuntimePackageReplacements(option) {
|
|
|
2596
2590
|
return Object.keys(normalized).length > 0 ? normalized : void 0;
|
|
2597
2591
|
}
|
|
2598
2592
|
function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions, tailwindcssMajorVersion) {
|
|
2599
|
-
const { cssPreflight, cssPreflightRange, escapeMap, cssChildCombinatorReplaceValue, injectAdditionalCssVarScope, cssSelectorReplacement, rem2rpx, postcssOptions, cssRemoveProperty, cssRemoveHoverPseudoClass, cssPresetEnv, autoprefixer, uniAppX, px2rpx, unitsToPx, arbitraryValues, jsPreserveClass,
|
|
2593
|
+
const { cssPreflight, cssPreflightRange, escapeMap, cssChildCombinatorReplaceValue, injectAdditionalCssVarScope, cssSelectorReplacement, rem2rpx, postcssOptions, cssRemoveProperty, cssRemoveHoverPseudoClass, cssPresetEnv, autoprefixer, uniAppX, px2rpx, unitsToPx, arbitraryValues, jsPreserveClass, jsArbitraryValueFallback, babelParserOptions, ignoreCallExpressionIdentifiers, ignoreTaggedTemplateExpressionIdentifiers, inlineWxs, disabledDefaultTemplateHandler, replaceRuntimePackages } = ctx;
|
|
2600
2594
|
const uniAppXEnabled = require_logger.isUniAppXEnabled(uniAppX);
|
|
2601
2595
|
const resolvedUniAppXOptions = require_logger.resolveUniAppXOptions(uniAppX);
|
|
2602
2596
|
const moduleSpecifierReplacements = resolveRuntimePackageReplacements(replaceRuntimePackages);
|
|
@@ -2624,7 +2618,6 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
2624
2618
|
escapeMap,
|
|
2625
2619
|
arbitraryValues,
|
|
2626
2620
|
jsPreserveClass,
|
|
2627
|
-
staleClassNameFallback,
|
|
2628
2621
|
jsArbitraryValueFallback: jsArbitraryValueFallback ?? "auto",
|
|
2629
2622
|
tailwindcssMajorVersion,
|
|
2630
2623
|
generateMap: true,
|
package/dist/reset.d.ts
CHANGED
|
@@ -47,19 +47,10 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
|
|
|
47
47
|
}
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region src/utils/disabled.ts
|
|
50
|
-
function
|
|
51
|
-
if (disabled === true) return {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
if (disabled === false || disabled == null) return {
|
|
56
|
-
plugin: false,
|
|
57
|
-
rewriteCssImports: false
|
|
58
|
-
};
|
|
59
|
-
return {
|
|
60
|
-
plugin: disabled.plugin ?? false,
|
|
61
|
-
rewriteCssImports: disabled.rewriteCssImports ?? false
|
|
62
|
-
};
|
|
50
|
+
function resolvePluginDisabledState(disabled) {
|
|
51
|
+
if (disabled === true) return { plugin: true };
|
|
52
|
+
if (disabled === false || disabled == null) return { plugin: false };
|
|
53
|
+
return { plugin: disabled.plugin ?? false };
|
|
63
54
|
}
|
|
64
55
|
//#endregion
|
|
65
56
|
//#region src/utils/resolve-package.ts
|
|
@@ -99,34 +90,6 @@ function pushConcurrentTaskFactories(queue, factories, limit) {
|
|
|
99
90
|
queue.push(runWithConcurrency(factories, limit).then(() => void 0));
|
|
100
91
|
}
|
|
101
92
|
//#endregion
|
|
102
|
-
//#region src/bundlers/shared/css-imports.ts
|
|
103
|
-
const tailwindcssImportRE = /^tailwindcss(?:\/.*)?$/;
|
|
104
|
-
const tailwindcssCssImportStatementRE = /(@import\s+(?:url\(\s*)?)(["'])(tailwindcss(?:\/[^"']*)?\$?)(\2\s*\)?)/gi;
|
|
105
|
-
function normalizeTailwindcssSpecifier(specifier) {
|
|
106
|
-
if (specifier === "tailwindcss$") return "tailwindcss";
|
|
107
|
-
return specifier;
|
|
108
|
-
}
|
|
109
|
-
function getTailwindcssSubpath(specifier) {
|
|
110
|
-
if (specifier === "tailwindcss") return "index.css";
|
|
111
|
-
return specifier.slice(12);
|
|
112
|
-
}
|
|
113
|
-
function resolveTailwindcssImport(specifier, pkgDir, options) {
|
|
114
|
-
const normalized = normalizeTailwindcssSpecifier(specifier);
|
|
115
|
-
if (!tailwindcssImportRE.test(normalized)) return null;
|
|
116
|
-
if (normalized === "tailwindcss") return options?.rootImport ?? "weapp-tailwindcss/index.css";
|
|
117
|
-
return (options?.join ?? node_path.default.join)(pkgDir, getTailwindcssSubpath(normalized));
|
|
118
|
-
}
|
|
119
|
-
function rewriteTailwindcssImportsInCode(code, pkgDir, options) {
|
|
120
|
-
let hasReplacements = false;
|
|
121
|
-
const rewritten = code.replace(tailwindcssCssImportStatementRE, (full, prefix, quote, specifier, suffix) => {
|
|
122
|
-
const replacement = resolveTailwindcssImport(specifier, pkgDir, options);
|
|
123
|
-
if (!replacement) return full;
|
|
124
|
-
hasReplacements = true;
|
|
125
|
-
return `${prefix}${quote}${replacement}${suffix}`;
|
|
126
|
-
});
|
|
127
|
-
return hasReplacements ? rewritten : void 0;
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
93
|
Object.defineProperty(exports, "normalizeOutputPathKey", {
|
|
131
94
|
enumerable: true,
|
|
132
95
|
get: function() {
|
|
@@ -139,12 +102,6 @@ Object.defineProperty(exports, "pushConcurrentTaskFactories", {
|
|
|
139
102
|
return pushConcurrentTaskFactories;
|
|
140
103
|
}
|
|
141
104
|
});
|
|
142
|
-
Object.defineProperty(exports, "resolveDisabledOptions", {
|
|
143
|
-
enumerable: true,
|
|
144
|
-
get: function() {
|
|
145
|
-
return resolveDisabledOptions;
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
105
|
Object.defineProperty(exports, "resolveOutputSpecifier", {
|
|
149
106
|
enumerable: true,
|
|
150
107
|
get: function() {
|
|
@@ -157,16 +114,10 @@ Object.defineProperty(exports, "resolvePackageDir", {
|
|
|
157
114
|
return resolvePackageDir;
|
|
158
115
|
}
|
|
159
116
|
});
|
|
160
|
-
Object.defineProperty(exports, "
|
|
161
|
-
enumerable: true,
|
|
162
|
-
get: function() {
|
|
163
|
-
return resolveTailwindcssImport;
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
Object.defineProperty(exports, "rewriteTailwindcssImportsInCode", {
|
|
117
|
+
Object.defineProperty(exports, "resolvePluginDisabledState", {
|
|
167
118
|
enumerable: true,
|
|
168
119
|
get: function() {
|
|
169
|
-
return
|
|
120
|
+
return resolvePluginDisabledState;
|
|
170
121
|
}
|
|
171
122
|
});
|
|
172
123
|
Object.defineProperty(exports, "toAbsoluteOutputPath", {
|
|
@@ -45,19 +45,10 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
|
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/utils/disabled.ts
|
|
48
|
-
function
|
|
49
|
-
if (disabled === true) return {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
if (disabled === false || disabled == null) return {
|
|
54
|
-
plugin: false,
|
|
55
|
-
rewriteCssImports: false
|
|
56
|
-
};
|
|
57
|
-
return {
|
|
58
|
-
plugin: disabled.plugin ?? false,
|
|
59
|
-
rewriteCssImports: disabled.rewriteCssImports ?? false
|
|
60
|
-
};
|
|
48
|
+
function resolvePluginDisabledState(disabled) {
|
|
49
|
+
if (disabled === true) return { plugin: true };
|
|
50
|
+
if (disabled === false || disabled == null) return { plugin: false };
|
|
51
|
+
return { plugin: disabled.plugin ?? false };
|
|
61
52
|
}
|
|
62
53
|
//#endregion
|
|
63
54
|
//#region src/utils/resolve-package.ts
|
|
@@ -97,32 +88,4 @@ function pushConcurrentTaskFactories(queue, factories, limit) {
|
|
|
97
88
|
queue.push(runWithConcurrency(factories, limit).then(() => void 0));
|
|
98
89
|
}
|
|
99
90
|
//#endregion
|
|
100
|
-
|
|
101
|
-
const tailwindcssImportRE = /^tailwindcss(?:\/.*)?$/;
|
|
102
|
-
const tailwindcssCssImportStatementRE = /(@import\s+(?:url\(\s*)?)(["'])(tailwindcss(?:\/[^"']*)?\$?)(\2\s*\)?)/gi;
|
|
103
|
-
function normalizeTailwindcssSpecifier(specifier) {
|
|
104
|
-
if (specifier === "tailwindcss$") return "tailwindcss";
|
|
105
|
-
return specifier;
|
|
106
|
-
}
|
|
107
|
-
function getTailwindcssSubpath(specifier) {
|
|
108
|
-
if (specifier === "tailwindcss") return "index.css";
|
|
109
|
-
return specifier.slice(12);
|
|
110
|
-
}
|
|
111
|
-
function resolveTailwindcssImport(specifier, pkgDir, options) {
|
|
112
|
-
const normalized = normalizeTailwindcssSpecifier(specifier);
|
|
113
|
-
if (!tailwindcssImportRE.test(normalized)) return null;
|
|
114
|
-
if (normalized === "tailwindcss") return options?.rootImport ?? "weapp-tailwindcss/index.css";
|
|
115
|
-
return (options?.join ?? path.join)(pkgDir, getTailwindcssSubpath(normalized));
|
|
116
|
-
}
|
|
117
|
-
function rewriteTailwindcssImportsInCode(code, pkgDir, options) {
|
|
118
|
-
let hasReplacements = false;
|
|
119
|
-
const rewritten = code.replace(tailwindcssCssImportStatementRE, (full, prefix, quote, specifier, suffix) => {
|
|
120
|
-
const replacement = resolveTailwindcssImport(specifier, pkgDir, options);
|
|
121
|
-
if (!replacement) return full;
|
|
122
|
-
hasReplacements = true;
|
|
123
|
-
return `${prefix}${quote}${replacement}${suffix}`;
|
|
124
|
-
});
|
|
125
|
-
return hasReplacements ? rewritten : void 0;
|
|
126
|
-
}
|
|
127
|
-
//#endregion
|
|
128
|
-
export { resolveDisabledOptions as a, toAbsoluteOutputPath as c, resolvePackageDir as i, rewriteTailwindcssImportsInCode as n, normalizeOutputPathKey as o, pushConcurrentTaskFactories as r, resolveOutputSpecifier as s, resolveTailwindcssImport as t };
|
|
91
|
+
export { resolveOutputSpecifier as a, normalizeOutputPathKey as i, resolvePackageDir as n, toAbsoluteOutputPath as o, resolvePluginDisabledState as r, pushConcurrentTaskFactories as t };
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
interface PruneMiniProgramGeneratedCssOptions {
|
|
2
|
+
preservePreflight?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function pruneMiniProgramGeneratedCss(css: string, options?: PruneMiniProgramGeneratedCssOptions): string;
|
|
5
|
+
export {};
|
|
@@ -1,56 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ILengthUnitsPatchOptions, NormalizedTailwindCssPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
1
|
+
import type { ILengthUnitsPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
3
2
|
type TailwindUserOptions = NonNullable<TailwindCssPatchOptions['tailwindcss']>;
|
|
4
|
-
type ResolvedTailwindUserOptions = TailwindUserOptions | NormalizedTailwindCssPatchOptions['tailwind'];
|
|
5
3
|
type TailwindApplyOptions = NonNullable<TailwindCssPatchOptions['apply']>;
|
|
6
|
-
type TailwindExtractOptions = NonNullable<TailwindCssPatchOptions['extract']>;
|
|
7
4
|
type TailwindExtendLengthUnitsOption = TailwindApplyOptions['extendLengthUnits'];
|
|
8
|
-
export
|
|
9
|
-
cache?: boolean | {
|
|
10
|
-
enabled?: boolean;
|
|
11
|
-
cwd?: string;
|
|
12
|
-
dir?: string;
|
|
13
|
-
file?: string;
|
|
14
|
-
strategy?: 'merge' | 'overwrite';
|
|
15
|
-
};
|
|
16
|
-
patch?: {
|
|
17
|
-
overwrite?: boolean;
|
|
18
|
-
basedir?: string;
|
|
19
|
-
cwd?: string;
|
|
20
|
-
filter?: (className: string) => boolean;
|
|
21
|
-
resolve?: PackageResolvingOptions;
|
|
22
|
-
tailwindcss?: TailwindUserOptions;
|
|
23
|
-
applyPatches?: {
|
|
24
|
-
exportContext?: boolean;
|
|
25
|
-
extendLengthUnits?: boolean | ILengthUnitsPatchOptions;
|
|
26
|
-
};
|
|
27
|
-
output?: {
|
|
28
|
-
filename?: string;
|
|
29
|
-
loose?: boolean;
|
|
30
|
-
removeUniversalSelector?: boolean;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export interface LegacyTailwindcssOutputOptions {
|
|
35
|
-
enabled?: boolean;
|
|
36
|
-
file?: string;
|
|
37
|
-
format?: TailwindExtractOptions['format'];
|
|
38
|
-
pretty?: TailwindExtractOptions['pretty'];
|
|
39
|
-
removeUniversalSelector?: boolean;
|
|
40
|
-
}
|
|
41
|
-
export interface LegacyTailwindcssFeatureOptions {
|
|
42
|
-
exposeContext?: TailwindApplyOptions['exposeContext'];
|
|
43
|
-
extendLengthUnits?: boolean | ILengthUnitsPatchOptions | TailwindExtendLengthUnitsOption;
|
|
44
|
-
}
|
|
45
|
-
export type CompatTailwindCssPatchOptions = TailwindCssPatchOptions & {
|
|
46
|
-
cwd?: string;
|
|
47
|
-
overwrite?: boolean;
|
|
48
|
-
features?: LegacyTailwindcssFeatureOptions;
|
|
49
|
-
output?: LegacyTailwindcssOutputOptions;
|
|
50
|
-
tailwind?: ResolvedTailwindUserOptions;
|
|
51
|
-
};
|
|
52
|
-
export declare function resolveTailwindcssOptions(options?: CompatTailwindCssPatchOptions | LegacyTailwindcssPatcherOptions): ResolvedTailwindUserOptions | undefined;
|
|
5
|
+
export declare function resolveTailwindcssOptions(options?: TailwindCssPatchOptions): TailwindUserOptions | undefined;
|
|
53
6
|
export declare function normalizeExtendLengthUnits(value: boolean | ILengthUnitsPatchOptions | undefined): TailwindExtendLengthUnitsOption | undefined;
|
|
54
|
-
export declare function normalizeTailwindcssPatcherOptions(options?:
|
|
55
|
-
export declare function toModernTailwindcssPatchOptions(options?: CompatTailwindCssPatchOptions): TailwindCssPatchOptions | undefined;
|
|
7
|
+
export declare function normalizeTailwindcssPatcherOptions(options?: TailwindCssPatchOptions): TailwindCssPatchOptions | undefined;
|
|
56
8
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ILengthUnitsPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
2
|
-
import type { LegacyTailwindcssPatcherOptions } from './patcher-options';
|
|
3
2
|
import type { TailwindcssPatcherLike } from '../types';
|
|
4
3
|
type TailwindUserOptions = NonNullable<TailwindCssPatchOptions['tailwindcss']>;
|
|
5
4
|
export interface CreateTailwindcssPatcherOptions {
|
|
@@ -7,7 +6,7 @@ export interface CreateTailwindcssPatcherOptions {
|
|
|
7
6
|
cacheDir?: string;
|
|
8
7
|
supportCustomLengthUnitsPatch?: boolean | ILengthUnitsPatchOptions;
|
|
9
8
|
tailwindcss?: TailwindUserOptions;
|
|
10
|
-
tailwindcssPatcherOptions?: TailwindCssPatchOptions
|
|
9
|
+
tailwindcssPatcherOptions?: TailwindCssPatchOptions;
|
|
11
10
|
}
|
|
12
11
|
export declare function createTailwindcssPatcher(options?: CreateTailwindcssPatcherOptions): TailwindcssPatcherLike;
|
|
13
12
|
export {};
|
|
@@ -1,24 +1,2 @@
|
|
|
1
1
|
import type { TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
2
|
-
|
|
3
|
-
export interface LegacyTailwindcssPatcherOptionsLike {
|
|
4
|
-
patch?: {
|
|
5
|
-
basedir?: string;
|
|
6
|
-
cwd?: string;
|
|
7
|
-
tailwindcss?: TailwindUserOptions & {
|
|
8
|
-
v4?: {
|
|
9
|
-
base?: string;
|
|
10
|
-
cssEntries?: string[];
|
|
11
|
-
sources?: Array<{
|
|
12
|
-
base?: string;
|
|
13
|
-
pattern: string;
|
|
14
|
-
negated?: boolean;
|
|
15
|
-
}>;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
[key: string]: unknown;
|
|
19
|
-
};
|
|
20
|
-
[key: string]: unknown;
|
|
21
|
-
}
|
|
22
|
-
type TailwindcssPatcherOptionsForBase = TailwindCssPatchOptions | LegacyTailwindcssPatcherOptionsLike | undefined;
|
|
23
|
-
export declare function overrideTailwindcssPatcherOptionsForBase(options: TailwindcssPatcherOptionsForBase, baseDir: string, cssEntries: string[]): TailwindcssPatcherOptionsForBase;
|
|
24
|
-
export {};
|
|
2
|
+
export declare function overrideTailwindcssPatcherOptionsForBase(options: TailwindCssPatchOptions | undefined, baseDir: string, cssEntries: string[]): TailwindCssPatchOptions | undefined;
|
|
@@ -9,6 +9,7 @@ export interface TailwindcssPatcherFactoryOptions {
|
|
|
9
9
|
tailwindcssPatcherOptions?: CreateTailwindcssPatcherOptions['tailwindcssPatcherOptions'];
|
|
10
10
|
supportCustomLengthUnitsPatch: InternalUserDefinedOptions['supportCustomLengthUnitsPatch'];
|
|
11
11
|
appType: InternalUserDefinedOptions['appType'];
|
|
12
|
+
bareArbitraryValues?: InternalUserDefinedOptions['arbitraryValues']['bareArbitraryValues'];
|
|
12
13
|
}
|
|
13
14
|
export declare function createPatcherForBase(baseDir: string, cssEntries: string[] | undefined, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike;
|
|
14
15
|
export declare function tryCreateMultiTailwindcssPatcher(groups: Map<string, string[]>, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike | undefined;
|
|
@@ -5,7 +5,7 @@ export interface TailwindV4GenerateOptions extends PatchTailwindV4GenerateOption
|
|
|
5
5
|
target?: TailwindV4GenerateTarget;
|
|
6
6
|
styleOptions?: Partial<IStyleHandlerOptions>;
|
|
7
7
|
tailwindcssV3Compatibility?: boolean;
|
|
8
|
-
scanSources?:
|
|
8
|
+
scanSources?: PatchTailwindV4GenerateOptions['scanSources'];
|
|
9
9
|
}
|
|
10
10
|
export interface TailwindV4GenerateResult extends Omit<PatchTailwindV4GenerateResult, 'css'> {
|
|
11
11
|
css: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type SupportedTailwindcssMajorVersion = 3 | 4;
|
|
2
|
+
export declare const DEFAULT_TAILWINDCSS_GENERATOR_MAJOR_VERSION: SupportedTailwindcssMajorVersion;
|
|
3
|
+
export declare function normalizeSupportedTailwindcssMajorVersion(version: number | undefined): SupportedTailwindcssMajorVersion | undefined;
|
|
4
|
+
export declare function readInstalledPackageMajorVersion(packageName: string, base: string): SupportedTailwindcssMajorVersion | undefined;
|
package/dist/typedoc.export.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export type { WeappTailwindcssGenerateOptions, WeappTailwindcssGenerateResult, WeappTailwindcssGenerator, WeappTailwindcssGeneratorTarget, WeappTailwindcssPostcssPluginOptions, } from './index';
|
|
2
|
-
export type { DisabledOptions } from './types/disabled-options';
|
|
3
2
|
export type { UserDefinedOptions } from './types/user-defined-options';
|
|
4
3
|
export type { ApplyOptions, CacheOptions, ExtractOptions, TailwindCssOptions, TailwindCssPatchOptions, TailwindV2Options, TailwindV3Options, TailwindV4Options, } from 'tailwindcss-patch';
|
|
5
|
-
export type TailwindcssPatchOptions = import('tailwindcss-patch').TailwindCssPatchOptions;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,11 +5,10 @@ import type { Document, Result as PostcssResult, Root } from 'postcss';
|
|
|
5
5
|
import type { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
6
6
|
import type { ICreateCacheReturnType } from '../cache';
|
|
7
7
|
import type { ItemOrItemArray } from './base';
|
|
8
|
-
import type { DisabledOptions } from './disabled-options';
|
|
9
8
|
import type { AppType, IArbitraryValues, ICustomAttributesEntities } from './shared';
|
|
10
9
|
import type { UniAppXComponentLocalStylesOptions, UniAppXOptions as UniAppXUserDefinedOptions, UserDefinedOptions } from './user-defined-options';
|
|
11
10
|
type AsyncableMethod<T> = T extends (...args: infer A) => infer R ? (...args: A) => Promise<Awaited<R>> | Awaited<R> : never;
|
|
12
|
-
export type {
|
|
11
|
+
export type { UniAppXComponentLocalStylesOptions, UniAppXUserDefinedOptions, UserDefinedOptions, };
|
|
13
12
|
export type { CssPreflightOptions, IStyleHandlerOptions, ItemOrItemArray };
|
|
14
13
|
export type { AppType, IArbitraryValues, ICustomAttributes, ICustomAttributesEntities } from './shared';
|
|
15
14
|
export interface LinkedJsModuleResult {
|
|
@@ -37,7 +36,6 @@ export interface RefreshTailwindcssPatcherOptions {
|
|
|
37
36
|
export interface IJsHandlerOptions {
|
|
38
37
|
escapeMap?: Record<string, string>;
|
|
39
38
|
classNameSet?: Set<string>;
|
|
40
|
-
staleClassNameFallback?: boolean;
|
|
41
39
|
jsArbitraryValueFallback?: boolean | 'auto';
|
|
42
40
|
tailwindcssMajorVersion?: number;
|
|
43
41
|
arbitraryValues?: IArbitraryValues;
|
package/dist/types/shared.d.ts
CHANGED
|
@@ -4,4 +4,7 @@ export type ICustomAttributes = Record<string, ItemOrItemArray<string | RegExp>>
|
|
|
4
4
|
export type ICustomAttributesEntities = [string | RegExp, ItemOrItemArray<string | RegExp>][];
|
|
5
5
|
export interface IArbitraryValues {
|
|
6
6
|
allowDoubleQuotes?: boolean;
|
|
7
|
+
bareArbitraryValues?: boolean | {
|
|
8
|
+
units?: string[];
|
|
9
|
+
};
|
|
7
10
|
}
|