weapp-tailwindcss 5.0.1 → 5.0.3
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/{bundle-state-CBF5YX1m.js → bundle-state-CW1X7QIy.js} +35 -3
- package/dist/{bundle-state-CQmxxx0R.mjs → bundle-state-s5HwfrmR.mjs} +24 -4
- package/dist/bundlers/shared/generated-css-marker.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/source-files.d.ts +11 -5
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +2 -0
- package/dist/bundlers/shared/generator-css.d.ts +1 -0
- package/dist/bundlers/vite/bundle-state.d.ts +5 -1
- package/dist/bundlers/vite/css-finalizer.d.ts +12 -3
- package/dist/bundlers/vite/generate-bundle.d.ts +22 -6
- package/dist/bundlers/vite/processed-css-assets.d.ts +10 -2
- package/dist/bundlers/vite/source-candidates.d.ts +2 -0
- package/dist/bundlers/webpack/loaders/watch-dependencies.d.ts +8 -0
- package/dist/cli.js +5 -4
- package/dist/cli.mjs +5 -4
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{generator-CvmsIQFI.js → generator-Bd1LntD3.js} +1 -1
- package/dist/{generator-DDtsUvkH.mjs → generator-DRHWC1t-.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +16 -10
- package/dist/gulp.mjs +14 -8
- package/dist/{incremental-runtime-class-set-DArodvWs.mjs → incremental-runtime-class-set-BcAFhVvu.mjs} +496 -619
- package/dist/{incremental-runtime-class-set-BffodqHh.js → incremental-runtime-class-set-BdCWIuPW.js} +541 -694
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/{postcss-BzNYQUOH.mjs → postcss-CJrmfXvi.mjs} +4 -4
- package/dist/{postcss-DE0TOtV9.js → postcss-DfnqZ4Bm.js} +4 -4
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-BzYPm-EG.js → precheck-8Ik4q0yI.js} +6 -6
- package/dist/{precheck-jZvTVXXG.mjs → precheck-h6TNzFbF.mjs} +6 -6
- package/dist/presets.js +2 -2
- package/dist/presets.mjs +2 -2
- package/dist/{source-candidates-BuTlMabx.mjs → source-candidates-D7b-Jzsx.mjs} +44 -11
- package/dist/{source-candidates-CxoIaS88.js → source-candidates-DQxvGPSw.js} +49 -10
- package/dist/tailwindcss/source-scan.d.ts +3 -1
- package/dist/{tailwindcss-CCZcu0lr.mjs → tailwindcss-D5RogwtV.mjs} +2 -2
- package/dist/{tailwindcss-DZckITp1.js → tailwindcss-jvoYizzX.js} +7 -1
- package/dist/{v3-engine-DGBhUnjn.mjs → v3-engine-BCUGX3gX.mjs} +637 -31
- package/dist/{v3-engine-M6Aqru5T.js → v3-engine-CmIF_gsq.js} +768 -30
- package/dist/{vite-DgRkWVPG.js → vite-DT-VUrl0.js} +539 -296
- package/dist/{vite-BBcQIJpD.mjs → vite-yCeZWm7n.mjs} +538 -295
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/{runtime-registry-DpcR3IHI.js → watch-dependencies-zwx4EhBn.js} +39 -0
- package/dist/weapp-tw-css-import-rewrite-loader.js +1933 -1621
- package/dist/weapp-tw-runtime-classset-loader.js +6 -6
- package/dist/{webpack-D-gb4ZvO.js → webpack-BFMJqCH9.js} +7 -7
- package/dist/{webpack-D43aMQzO.mjs → webpack-E0gT72EX.mjs} +7 -7
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-Bd1LntD3.js");
|
|
3
3
|
const require_gulp = require("./gulp.js");
|
|
4
|
-
const require_postcss = require("./postcss-
|
|
5
|
-
const require_vite = require("./vite-
|
|
6
|
-
const require_webpack = require("./webpack-
|
|
4
|
+
const require_postcss = require("./postcss-DfnqZ4Bm.js");
|
|
5
|
+
const require_vite = require("./vite-DT-VUrl0.js");
|
|
6
|
+
const require_webpack = require("./webpack-BFMJqCH9.js");
|
|
7
7
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
8
8
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
9
9
|
exports.createPlugins = require_gulp.createPlugins;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-DRHWC1t-.mjs";
|
|
2
2
|
import { WeappTailwindcss as createPlugins } from "./gulp.mjs";
|
|
3
|
-
import { t as weappTailwindcssPostcssPlugin } from "./postcss-
|
|
4
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
5
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
3
|
+
import { t as weappTailwindcssPostcssPlugin } from "./postcss-CJrmfXvi.mjs";
|
|
4
|
+
import { t as WeappTailwindcss } from "./vite-yCeZWm7n.mjs";
|
|
5
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-E0gT72EX.mjs";
|
|
6
6
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
7
7
|
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { $ as createSourceScanPattern, Q as collectCssInlineSourceCandidates, X as DEFAULT_SOURCE_SCAN_EXTENSIONS, et as expandTailwindSourceEntries, it as resolveCssSourceEntries, nt as normalizeLegacyContentEntries, rt as parseConfigParam, t as resolveTailwindV3Source, ut as readInstalledPackageMajorVersion, y as resolveTailwindV4Source$1 } from "./v3-engine-BCUGX3gX.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-DRHWC1t-.mjs";
|
|
3
3
|
import postcss from "postcss";
|
|
4
4
|
import { extractRawCandidatesWithPositions, extractValidCandidates } from "tailwindcss-patch";
|
|
5
5
|
import process from "node:process";
|
|
@@ -83,7 +83,7 @@ async function collectConfigContentFiles(root, base, options) {
|
|
|
83
83
|
const contentEntries = normalizeLegacyContentEntries((await loadConfig({
|
|
84
84
|
config: configPath,
|
|
85
85
|
cwd: path.dirname(configPath)
|
|
86
|
-
}))?.config.content, path.dirname(configPath));
|
|
86
|
+
}))?.config.content, options.version === 3 ? options.projectRoot ?? base : path.dirname(configPath), { relativeBase: path.dirname(configPath) });
|
|
87
87
|
files.push(...await expandTailwindSourceEntries(contentEntries));
|
|
88
88
|
}
|
|
89
89
|
return {
|
|
@@ -98,7 +98,7 @@ async function collectConfiguredContentEntries(root, base, options) {
|
|
|
98
98
|
return normalizeLegacyContentEntries((await loadConfig({
|
|
99
99
|
config: resolvedConfigPath,
|
|
100
100
|
cwd: path.dirname(resolvedConfigPath)
|
|
101
|
-
}))?.config.content, path.dirname(resolvedConfigPath));
|
|
101
|
+
}))?.config.content, options.version === 3 ? options.projectRoot ?? base : path.dirname(resolvedConfigPath), { relativeBase: path.dirname(resolvedConfigPath) });
|
|
102
102
|
}
|
|
103
103
|
async function collectRawCandidatesFromSourceEntries(sourceEntries) {
|
|
104
104
|
const candidates = /* @__PURE__ */ new Set();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CmIF_gsq.js");
|
|
3
|
+
const require_generator = require("./generator-Bd1LntD3.js");
|
|
4
4
|
let postcss = require("postcss");
|
|
5
5
|
postcss = require_chunk.__toESM(postcss);
|
|
6
6
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
@@ -87,7 +87,7 @@ async function collectConfigContentFiles(root, base, options) {
|
|
|
87
87
|
const contentEntries = require_v3_engine.normalizeLegacyContentEntries((await (0, tailwindcss_config.loadConfig)({
|
|
88
88
|
config: configPath,
|
|
89
89
|
cwd: node_path.default.dirname(configPath)
|
|
90
|
-
}))?.config.content, node_path.default.dirname(configPath));
|
|
90
|
+
}))?.config.content, options.version === 3 ? options.projectRoot ?? base : node_path.default.dirname(configPath), { relativeBase: node_path.default.dirname(configPath) });
|
|
91
91
|
files.push(...await require_v3_engine.expandTailwindSourceEntries(contentEntries));
|
|
92
92
|
}
|
|
93
93
|
return {
|
|
@@ -102,7 +102,7 @@ async function collectConfiguredContentEntries(root, base, options) {
|
|
|
102
102
|
return require_v3_engine.normalizeLegacyContentEntries((await (0, tailwindcss_config.loadConfig)({
|
|
103
103
|
config: resolvedConfigPath,
|
|
104
104
|
cwd: node_path.default.dirname(resolvedConfigPath)
|
|
105
|
-
}))?.config.content, node_path.default.dirname(resolvedConfigPath));
|
|
105
|
+
}))?.config.content, options.version === 3 ? options.projectRoot ?? base : node_path.default.dirname(resolvedConfigPath), { relativeBase: node_path.default.dirname(resolvedConfigPath) });
|
|
106
106
|
}
|
|
107
107
|
async function collectRawCandidatesFromSourceEntries(sourceEntries) {
|
|
108
108
|
const candidates = /* @__PURE__ */ new Set();
|
package/dist/postcss.js
CHANGED
|
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_postcss = require("./postcss-
|
|
5
|
+
const require_postcss = require("./postcss-DfnqZ4Bm.js");
|
|
6
6
|
exports.default = require_postcss.weappTailwindcssPostcssPlugin;
|
|
7
7
|
exports.weappTailwindcssPostcssPlugin = require_postcss.weappTailwindcssPostcssPlugin;
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as weappTailwindcssPostcssPlugin } from "./postcss-
|
|
1
|
+
import { t as weappTailwindcssPostcssPlugin } from "./postcss-CJrmfXvi.mjs";
|
|
2
2
|
export { weappTailwindcssPostcssPlugin as default, weappTailwindcssPostcssPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CmIF_gsq.js");
|
|
3
3
|
const require_defaults = require("./defaults-zKUH2mDe.js");
|
|
4
4
|
require("./utils-D7Ygohep.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-jvoYizzX.js");
|
|
6
6
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
7
7
|
let node_process = require("node:process");
|
|
8
8
|
node_process = require_chunk.__toESM(node_process);
|
|
@@ -1230,7 +1230,7 @@ function walkEvalExpression(path, options, updater, handler) {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
1232
|
//#endregion
|
|
1233
|
-
//#region \0@oxc-project+runtime@0.
|
|
1233
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/typeof.js
|
|
1234
1234
|
function _typeof(o) {
|
|
1235
1235
|
"@babel/helpers - typeof";
|
|
1236
1236
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -1241,7 +1241,7 @@ function _typeof(o) {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
var init_typeof = require_chunk.__esmMin((() => {}));
|
|
1243
1243
|
//#endregion
|
|
1244
|
-
//#region \0@oxc-project+runtime@0.
|
|
1244
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js
|
|
1245
1245
|
function toPrimitive(t, r) {
|
|
1246
1246
|
if ("object" != _typeof(t) || !t) return t;
|
|
1247
1247
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1256,7 +1256,7 @@ var init_toPrimitive = require_chunk.__esmMin((() => {
|
|
|
1256
1256
|
init_typeof();
|
|
1257
1257
|
}));
|
|
1258
1258
|
//#endregion
|
|
1259
|
-
//#region \0@oxc-project+runtime@0.
|
|
1259
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js
|
|
1260
1260
|
function toPropertyKey(t) {
|
|
1261
1261
|
var i = toPrimitive(t, "string");
|
|
1262
1262
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
@@ -1266,7 +1266,7 @@ var init_toPropertyKey = require_chunk.__esmMin((() => {
|
|
|
1266
1266
|
init_toPrimitive();
|
|
1267
1267
|
}));
|
|
1268
1268
|
//#endregion
|
|
1269
|
-
//#region \0@oxc-project+runtime@0.
|
|
1269
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js
|
|
1270
1270
|
function _defineProperty(e, r, t) {
|
|
1271
1271
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1272
1272
|
value: t,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as createTailwindV4Engine$1, c as getRuntimeClassSetCacheEntry, ct as createDebug, d as invalidateRuntimeClassSet, ht as omitUndefined, mt as resolveBooleanObjectOption, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-BCUGX3gX.mjs";
|
|
2
2
|
import { a as resolveDefaultCssPreflight, i as getDefaultOptions, o as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH, s as HARD_PARSE_CACHE_MAX_ENTRIES } from "./defaults-8xrgzxFY.mjs";
|
|
3
3
|
import { i as isMap, n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-D5RogwtV.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { splitCandidateTokens } from "tailwindcss-patch";
|
|
7
7
|
import process from "node:process";
|
|
@@ -1229,7 +1229,7 @@ function walkEvalExpression(path, options, updater, handler) {
|
|
|
1229
1229
|
}
|
|
1230
1230
|
}
|
|
1231
1231
|
//#endregion
|
|
1232
|
-
//#region \0@oxc-project+runtime@0.
|
|
1232
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/typeof.js
|
|
1233
1233
|
function _typeof(o) {
|
|
1234
1234
|
"@babel/helpers - typeof";
|
|
1235
1235
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -1240,7 +1240,7 @@ function _typeof(o) {
|
|
|
1240
1240
|
}
|
|
1241
1241
|
var init_typeof = __esmMin((() => {}));
|
|
1242
1242
|
//#endregion
|
|
1243
|
-
//#region \0@oxc-project+runtime@0.
|
|
1243
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js
|
|
1244
1244
|
function toPrimitive(t, r) {
|
|
1245
1245
|
if ("object" != _typeof(t) || !t) return t;
|
|
1246
1246
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1255,7 +1255,7 @@ var init_toPrimitive = __esmMin((() => {
|
|
|
1255
1255
|
init_typeof();
|
|
1256
1256
|
}));
|
|
1257
1257
|
//#endregion
|
|
1258
|
-
//#region \0@oxc-project+runtime@0.
|
|
1258
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js
|
|
1259
1259
|
function toPropertyKey(t) {
|
|
1260
1260
|
var i = toPrimitive(t, "string");
|
|
1261
1261
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
@@ -1265,7 +1265,7 @@ var init_toPropertyKey = __esmMin((() => {
|
|
|
1265
1265
|
init_toPrimitive();
|
|
1266
1266
|
}));
|
|
1267
1267
|
//#endregion
|
|
1268
|
-
//#region \0@oxc-project+runtime@0.
|
|
1268
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js
|
|
1269
1269
|
function _defineProperty(e, r, t) {
|
|
1270
1270
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1271
1271
|
value: t,
|
package/dist/presets.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-CmIF_gsq.js");
|
|
4
4
|
const require_utils = require("./utils-D7Ygohep.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-jvoYizzX.js");
|
|
6
6
|
require("./logger-TlKT3xmR.js");
|
|
7
7
|
let node_process = require("node:process");
|
|
8
8
|
node_process = require_chunk.__toESM(node_process);
|
package/dist/presets.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ht as omitUndefined } from "./v3-engine-BCUGX3gX.mjs";
|
|
2
2
|
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-D5RogwtV.mjs";
|
|
4
4
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import path from "node:path";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Z as FULL_SOURCE_SCAN_EXTENSION_RE, at as resolveSourceScanPath, st as toPosixPath, tt as isFileMatchedByTailwindSourceEntries } from "./v3-engine-BCUGX3gX.mjs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
import { extractSourceCandidates, resolveProjectSourceFiles } from "tailwindcss-patch";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { readFile } from "node:fs/promises";
|
|
@@ -48,6 +49,23 @@ const TAILWIND_V4_IGNORED_FILES = [
|
|
|
48
49
|
".env.*"
|
|
49
50
|
];
|
|
50
51
|
const sourceCandidateContentCache = /* @__PURE__ */ new Map();
|
|
52
|
+
const require = createRequire(import.meta.url);
|
|
53
|
+
const TAILWIND_V3_HTML_TOKEN_CANDIDATES = new Set([
|
|
54
|
+
"/block",
|
|
55
|
+
"/div",
|
|
56
|
+
"/span",
|
|
57
|
+
"/template",
|
|
58
|
+
"/text",
|
|
59
|
+
"/view",
|
|
60
|
+
"class",
|
|
61
|
+
"className",
|
|
62
|
+
"div",
|
|
63
|
+
"hover-class",
|
|
64
|
+
"span",
|
|
65
|
+
"template",
|
|
66
|
+
"text",
|
|
67
|
+
"view"
|
|
68
|
+
]);
|
|
51
69
|
function cleanUrl(id) {
|
|
52
70
|
return resolveSourceScanPath(id.replace(CLEAN_URL_RE, ""));
|
|
53
71
|
}
|
|
@@ -105,8 +123,23 @@ function resolveSourceCandidateExtension(id) {
|
|
|
105
123
|
const normalized = cleanUrl(id);
|
|
106
124
|
return /\.([^.\\/]+)$/.exec(normalized)?.[1] ?? "html";
|
|
107
125
|
}
|
|
108
|
-
function createSourceCandidateContentCacheKey(extension, source, bareArbitraryValues) {
|
|
109
|
-
return `${extension}\0${JSON.stringify(bareArbitraryValues ?? false)}\0${source}`;
|
|
126
|
+
function createSourceCandidateContentCacheKey(extension, source, bareArbitraryValues, extractor) {
|
|
127
|
+
return `${extension}\0${JSON.stringify(bareArbitraryValues ?? false)}\0${extractor ? "custom" : "default"}\0${source}`;
|
|
128
|
+
}
|
|
129
|
+
async function extractCandidates(source, extension, options) {
|
|
130
|
+
if (options.extractor) return new Set(await options.extractor(source, extension));
|
|
131
|
+
return new Set(await extractSourceCandidates(source, extension, { ...options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } }));
|
|
132
|
+
}
|
|
133
|
+
function createTailwindV3DefaultExtractor() {
|
|
134
|
+
try {
|
|
135
|
+
const defaultExtractorModule = require("tailwindcss/lib/lib/defaultExtractor");
|
|
136
|
+
const resolveConfigModule = require("tailwindcss/resolveConfig");
|
|
137
|
+
const resolveConfig = resolveConfigModule.default ?? resolveConfigModule;
|
|
138
|
+
const extractor = (defaultExtractorModule.defaultExtractor ?? defaultExtractorModule.default ?? defaultExtractorModule)({ tailwindConfig: resolveConfig({ content: [] }) });
|
|
139
|
+
return (source) => new Set(extractor(source).filter((candidate) => !TAILWIND_V3_HTML_TOKEN_CANDIDATES.has(candidate)));
|
|
140
|
+
} catch {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
110
143
|
}
|
|
111
144
|
function isSourceCandidateRequest(id) {
|
|
112
145
|
return FULL_SOURCE_SCAN_EXTENSION_RE.test(cleanUrl(id));
|
|
@@ -136,34 +169,34 @@ function createSourceCandidateCollector(options = {}) {
|
|
|
136
169
|
async function sync(id, source) {
|
|
137
170
|
const normalizedId = cleanUrl(id);
|
|
138
171
|
const extension = resolveSourceCandidateExtension(normalizedId);
|
|
139
|
-
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues);
|
|
172
|
+
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues, options.extractor);
|
|
140
173
|
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
141
174
|
if (cachedCandidates) {
|
|
142
175
|
replaceScanLayer(normalizedId, new Set(cachedCandidates));
|
|
143
176
|
return;
|
|
144
177
|
}
|
|
145
|
-
const nextCandidates =
|
|
178
|
+
const nextCandidates = await extractCandidates(source, extension, options);
|
|
146
179
|
sourceCandidateContentCache.set(contentCacheKey, [...nextCandidates]);
|
|
147
180
|
replaceScanLayer(normalizedId, nextCandidates);
|
|
148
181
|
}
|
|
149
182
|
async function syncCss(id, source) {
|
|
150
183
|
const normalizedId = cleanUrl(id);
|
|
151
|
-
const contentCacheKey = createSourceCandidateContentCacheKey("css", source, options.bareArbitraryValues);
|
|
184
|
+
const contentCacheKey = createSourceCandidateContentCacheKey("css", source, options.bareArbitraryValues, options.extractor);
|
|
152
185
|
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
153
186
|
if (cachedCandidates) {
|
|
154
187
|
replaceCssLayer(normalizedId, new Set(cachedCandidates));
|
|
155
188
|
return;
|
|
156
189
|
}
|
|
157
|
-
const nextCandidates =
|
|
190
|
+
const nextCandidates = await extractCandidates(source, "css", options);
|
|
158
191
|
sourceCandidateContentCache.set(contentCacheKey, [...nextCandidates]);
|
|
159
192
|
replaceCssLayer(normalizedId, nextCandidates);
|
|
160
193
|
}
|
|
161
194
|
async function merge(id, source) {
|
|
162
195
|
const normalizedId = cleanUrl(id);
|
|
163
196
|
const extension = resolveSourceCandidateExtension(normalizedId);
|
|
164
|
-
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues);
|
|
197
|
+
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues, options.extractor);
|
|
165
198
|
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
166
|
-
const extractedCandidates = cachedCandidates ? new Set(cachedCandidates) :
|
|
199
|
+
const extractedCandidates = cachedCandidates ? new Set(cachedCandidates) : await extractCandidates(source, extension, options);
|
|
167
200
|
if (!cachedCandidates) sourceCandidateContentCache.set(contentCacheKey, [...extractedCandidates]);
|
|
168
201
|
replaceTransformLayer(normalizedId, extractedCandidates);
|
|
169
202
|
}
|
|
@@ -187,7 +220,7 @@ function createSourceCandidateCollector(options = {}) {
|
|
|
187
220
|
...ignoredSources.length > 0 ? { ignoredSources } : {},
|
|
188
221
|
filter: isSourceCandidateRequest
|
|
189
222
|
});
|
|
190
|
-
await Promise.all(files.map((file) => syncFile(file)));
|
|
223
|
+
await Promise.all(files.map((file) => syncFile(resolveSourceScanPath(file))));
|
|
191
224
|
}
|
|
192
225
|
function replaceFinal(id, nextCandidates) {
|
|
193
226
|
const normalizedId = cleanUrl(id);
|
|
@@ -319,4 +352,4 @@ function createSourceCandidateCollector(options = {}) {
|
|
|
319
352
|
};
|
|
320
353
|
}
|
|
321
354
|
//#endregion
|
|
322
|
-
export {
|
|
355
|
+
export { createTailwindV3DefaultExtractor as n, isSourceCandidateRequest as r, createSourceCandidateCollector as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CmIF_gsq.js");
|
|
3
|
+
let node_module = require("node:module");
|
|
3
4
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
4
5
|
let node_path = require("node:path");
|
|
5
6
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -50,6 +51,23 @@ const TAILWIND_V4_IGNORED_FILES = [
|
|
|
50
51
|
".env.*"
|
|
51
52
|
];
|
|
52
53
|
const sourceCandidateContentCache = /* @__PURE__ */ new Map();
|
|
54
|
+
const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
55
|
+
const TAILWIND_V3_HTML_TOKEN_CANDIDATES = new Set([
|
|
56
|
+
"/block",
|
|
57
|
+
"/div",
|
|
58
|
+
"/span",
|
|
59
|
+
"/template",
|
|
60
|
+
"/text",
|
|
61
|
+
"/view",
|
|
62
|
+
"class",
|
|
63
|
+
"className",
|
|
64
|
+
"div",
|
|
65
|
+
"hover-class",
|
|
66
|
+
"span",
|
|
67
|
+
"template",
|
|
68
|
+
"text",
|
|
69
|
+
"view"
|
|
70
|
+
]);
|
|
53
71
|
function cleanUrl(id) {
|
|
54
72
|
return require_v3_engine.resolveSourceScanPath(id.replace(CLEAN_URL_RE, ""));
|
|
55
73
|
}
|
|
@@ -107,8 +125,23 @@ function resolveSourceCandidateExtension(id) {
|
|
|
107
125
|
const normalized = cleanUrl(id);
|
|
108
126
|
return /\.([^.\\/]+)$/.exec(normalized)?.[1] ?? "html";
|
|
109
127
|
}
|
|
110
|
-
function createSourceCandidateContentCacheKey(extension, source, bareArbitraryValues) {
|
|
111
|
-
return `${extension}\0${JSON.stringify(bareArbitraryValues ?? false)}\0${source}`;
|
|
128
|
+
function createSourceCandidateContentCacheKey(extension, source, bareArbitraryValues, extractor) {
|
|
129
|
+
return `${extension}\0${JSON.stringify(bareArbitraryValues ?? false)}\0${extractor ? "custom" : "default"}\0${source}`;
|
|
130
|
+
}
|
|
131
|
+
async function extractCandidates(source, extension, options) {
|
|
132
|
+
if (options.extractor) return new Set(await options.extractor(source, extension));
|
|
133
|
+
return new Set(await (0, tailwindcss_patch.extractSourceCandidates)(source, extension, { ...options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } }));
|
|
134
|
+
}
|
|
135
|
+
function createTailwindV3DefaultExtractor() {
|
|
136
|
+
try {
|
|
137
|
+
const defaultExtractorModule = require$1("tailwindcss/lib/lib/defaultExtractor");
|
|
138
|
+
const resolveConfigModule = require$1("tailwindcss/resolveConfig");
|
|
139
|
+
const resolveConfig = resolveConfigModule.default ?? resolveConfigModule;
|
|
140
|
+
const extractor = (defaultExtractorModule.defaultExtractor ?? defaultExtractorModule.default ?? defaultExtractorModule)({ tailwindConfig: resolveConfig({ content: [] }) });
|
|
141
|
+
return (source) => new Set(extractor(source).filter((candidate) => !TAILWIND_V3_HTML_TOKEN_CANDIDATES.has(candidate)));
|
|
142
|
+
} catch {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
112
145
|
}
|
|
113
146
|
function isSourceCandidateRequest(id) {
|
|
114
147
|
return require_v3_engine.FULL_SOURCE_SCAN_EXTENSION_RE.test(cleanUrl(id));
|
|
@@ -138,34 +171,34 @@ function createSourceCandidateCollector(options = {}) {
|
|
|
138
171
|
async function sync(id, source) {
|
|
139
172
|
const normalizedId = cleanUrl(id);
|
|
140
173
|
const extension = resolveSourceCandidateExtension(normalizedId);
|
|
141
|
-
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues);
|
|
174
|
+
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues, options.extractor);
|
|
142
175
|
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
143
176
|
if (cachedCandidates) {
|
|
144
177
|
replaceScanLayer(normalizedId, new Set(cachedCandidates));
|
|
145
178
|
return;
|
|
146
179
|
}
|
|
147
|
-
const nextCandidates =
|
|
180
|
+
const nextCandidates = await extractCandidates(source, extension, options);
|
|
148
181
|
sourceCandidateContentCache.set(contentCacheKey, [...nextCandidates]);
|
|
149
182
|
replaceScanLayer(normalizedId, nextCandidates);
|
|
150
183
|
}
|
|
151
184
|
async function syncCss(id, source) {
|
|
152
185
|
const normalizedId = cleanUrl(id);
|
|
153
|
-
const contentCacheKey = createSourceCandidateContentCacheKey("css", source, options.bareArbitraryValues);
|
|
186
|
+
const contentCacheKey = createSourceCandidateContentCacheKey("css", source, options.bareArbitraryValues, options.extractor);
|
|
154
187
|
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
155
188
|
if (cachedCandidates) {
|
|
156
189
|
replaceCssLayer(normalizedId, new Set(cachedCandidates));
|
|
157
190
|
return;
|
|
158
191
|
}
|
|
159
|
-
const nextCandidates =
|
|
192
|
+
const nextCandidates = await extractCandidates(source, "css", options);
|
|
160
193
|
sourceCandidateContentCache.set(contentCacheKey, [...nextCandidates]);
|
|
161
194
|
replaceCssLayer(normalizedId, nextCandidates);
|
|
162
195
|
}
|
|
163
196
|
async function merge(id, source) {
|
|
164
197
|
const normalizedId = cleanUrl(id);
|
|
165
198
|
const extension = resolveSourceCandidateExtension(normalizedId);
|
|
166
|
-
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues);
|
|
199
|
+
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues, options.extractor);
|
|
167
200
|
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
168
|
-
const extractedCandidates = cachedCandidates ? new Set(cachedCandidates) :
|
|
201
|
+
const extractedCandidates = cachedCandidates ? new Set(cachedCandidates) : await extractCandidates(source, extension, options);
|
|
169
202
|
if (!cachedCandidates) sourceCandidateContentCache.set(contentCacheKey, [...extractedCandidates]);
|
|
170
203
|
replaceTransformLayer(normalizedId, extractedCandidates);
|
|
171
204
|
}
|
|
@@ -189,7 +222,7 @@ function createSourceCandidateCollector(options = {}) {
|
|
|
189
222
|
...ignoredSources.length > 0 ? { ignoredSources } : {},
|
|
190
223
|
filter: isSourceCandidateRequest
|
|
191
224
|
});
|
|
192
|
-
await Promise.all(files.map((file) => syncFile(file)));
|
|
225
|
+
await Promise.all(files.map((file) => syncFile(require_v3_engine.resolveSourceScanPath(file))));
|
|
193
226
|
}
|
|
194
227
|
function replaceFinal(id, nextCandidates) {
|
|
195
228
|
const normalizedId = cleanUrl(id);
|
|
@@ -327,6 +360,12 @@ Object.defineProperty(exports, "createSourceCandidateCollector", {
|
|
|
327
360
|
return createSourceCandidateCollector;
|
|
328
361
|
}
|
|
329
362
|
});
|
|
363
|
+
Object.defineProperty(exports, "createTailwindV3DefaultExtractor", {
|
|
364
|
+
enumerable: true,
|
|
365
|
+
get: function() {
|
|
366
|
+
return createTailwindV3DefaultExtractor;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
330
369
|
Object.defineProperty(exports, "isSourceCandidateRequest", {
|
|
331
370
|
enumerable: true,
|
|
332
371
|
get: function() {
|
|
@@ -23,7 +23,9 @@ export declare function resolveTailwindV4CssSourceBase(source: Pick<TailwindV4Cs
|
|
|
23
23
|
export declare function parseConfigParam(params: string): string | undefined;
|
|
24
24
|
export declare function expandInlineSourceCandidatePattern(pattern: string): string[];
|
|
25
25
|
export declare function collectCssInlineSourceCandidates(root: Root): TailwindInlineSourceCandidates;
|
|
26
|
-
export declare function normalizeLegacyContentEntries(content: unknown, base: string
|
|
26
|
+
export declare function normalizeLegacyContentEntries(content: unknown, base: string, options?: {
|
|
27
|
+
relativeBase?: string | undefined;
|
|
28
|
+
}): TailwindSourceEntry[];
|
|
27
29
|
export declare function resolveTailwindSourceEntry(sourcePath: string, base: string, negated: boolean, defaultPattern?: string): Promise<TailwindSourceEntry>;
|
|
28
30
|
export declare function parseSourceFileParam(params: string): {
|
|
29
31
|
negated: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _t as findWorkspacePackageDir, f as runtimeSignaturePatchersSymbol, gt as findNearestPackageRoot, ht as omitUndefined, lt as createTailwindcssPatcher, pt as normalizeStringListOption, ut as readInstalledPackageMajorVersion, vt as findWorkspaceRoot } from "./v3-engine-BCUGX3gX.mjs";
|
|
2
2
|
import { n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -553,4 +553,4 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
553
553
|
return createPatcherForBase(resolvedTailwindcssBasedir, normalizedCssEntries ?? rawCssEntries, patcherOptions);
|
|
554
554
|
}
|
|
555
555
|
//#endregion
|
|
556
|
-
export {
|
|
556
|
+
export { normalizeCssEntries as a, hasConfiguredTailwindV4CssRoots as c, resolveUniAppXOptions as i, upsertTailwindV4CssSource as l, resolveTailwindcssBasedir as n, applyV4CssCalcDefaults as o, isUniAppXEnabled as r, warnMissingCssEntries as s, createTailwindcssPatcherFromContext as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CmIF_gsq.js");
|
|
3
3
|
require("./utils-D7Ygohep.js");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_module = require("node:module");
|
|
@@ -581,6 +581,12 @@ Object.defineProperty(exports, "isUniAppXEnabled", {
|
|
|
581
581
|
return isUniAppXEnabled;
|
|
582
582
|
}
|
|
583
583
|
});
|
|
584
|
+
Object.defineProperty(exports, "normalizeCssEntries", {
|
|
585
|
+
enumerable: true,
|
|
586
|
+
get: function() {
|
|
587
|
+
return normalizeCssEntries;
|
|
588
|
+
}
|
|
589
|
+
});
|
|
584
590
|
Object.defineProperty(exports, "resolveTailwindcssBasedir", {
|
|
585
591
|
enumerable: true,
|
|
586
592
|
get: function() {
|