weapp-tailwindcss 4.9.2 → 4.9.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/{chunk-DNRNFN4I.js → chunk-3UOPODB3.js} +44 -44
- package/dist/{chunk-2L6NDZIQ.mjs → chunk-4HESZS5A.mjs} +2 -2
- package/dist/{chunk-5O6237HX.js → chunk-4RUFPPI6.js} +400 -377
- package/dist/{chunk-ZE7JKKFT.mjs → chunk-7D27E7TU.mjs} +438 -415
- package/dist/{chunk-W3MTTQ5M.js → chunk-A2BRI46M.js} +5 -5
- package/dist/{chunk-3SKEY32E.mjs → chunk-F2CKKG6Q.mjs} +67 -67
- package/dist/{chunk-VU2GIXVH.js → chunk-I3IRT5VH.js} +7 -7
- package/dist/chunk-IMOEZLDR.js +441 -0
- package/dist/{chunk-WGBJY2H3.mjs → chunk-IW3B6ZJD.mjs} +646 -565
- package/dist/{chunk-U7BH6QHE.js → chunk-KXZ4MP4L.js} +277 -236
- package/dist/chunk-PU5CC4ZI.mjs +444 -0
- package/dist/{chunk-FFGR5V3H.mjs → chunk-SPH6SCTM.mjs} +1 -1
- package/dist/{chunk-XXJNXESJ.js → chunk-VOD2WUH6.js} +635 -554
- package/dist/{chunk-2WPTDMN3.js → chunk-VPHA77FH.js} +61 -61
- package/dist/{chunk-CBOVUIXD.mjs → chunk-WH65CIYG.mjs} +41 -41
- package/dist/{chunk-UAEME5HT.js → chunk-Y6F6NBA7.js} +1 -1
- package/dist/{chunk-DSD5JRCQ.mjs → chunk-Z2D5NSG5.mjs} +265 -224
- package/dist/{chunk-G5OV7IOU.mjs → chunk-ZL22KEHH.mjs} +2 -2
- package/dist/cli.js +182 -136
- package/dist/cli.mjs +194 -148
- package/dist/core.js +10 -10
- package/dist/core.mjs +4 -4
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/index.js +10 -10
- package/dist/index.mjs +9 -9
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.js +5 -5
- package/dist/presets.mjs +2 -2
- package/dist/reset.d.mts +2 -1
- package/dist/reset.d.ts +2 -1
- package/dist/reset.js +25 -21
- package/dist/reset.mjs +25 -21
- package/dist/types.d.mts +503 -474
- package/dist/types.d.ts +503 -474
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +6 -6
- package/dist/weapp-tw-css-import-rewrite-loader.js +2 -4
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +7 -7
- package/dist/webpack4.js +351 -307
- package/dist/webpack4.mjs +341 -297
- package/package.json +10 -10
- package/dist/chunk-5AKI6FQP.mjs +0 -397
- package/dist/chunk-SNEMGP42.js +0 -394
|
@@ -3,95 +3,11 @@
|
|
|
3
3
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkY6F6NBA7js = require('./chunk-Y6F6NBA7.js');
|
|
7
7
|
|
|
8
8
|
// src/logger/index.ts
|
|
9
9
|
var _logger = require('@weapp-tailwindcss/logger');
|
|
10
10
|
|
|
11
|
-
// src/context/workspace.ts
|
|
12
|
-
var _fs = require('fs');
|
|
13
|
-
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
14
|
-
var IGNORED_WORKSPACE_DIRS = /* @__PURE__ */ new Set([
|
|
15
|
-
"node_modules",
|
|
16
|
-
".git",
|
|
17
|
-
".hg",
|
|
18
|
-
".svn",
|
|
19
|
-
".turbo",
|
|
20
|
-
".output",
|
|
21
|
-
".next",
|
|
22
|
-
"dist",
|
|
23
|
-
"build"
|
|
24
|
-
]);
|
|
25
|
-
function findWorkspaceRoot(startDir) {
|
|
26
|
-
if (!startDir) {
|
|
27
|
-
return void 0;
|
|
28
|
-
}
|
|
29
|
-
let current = _path2.default.resolve(startDir);
|
|
30
|
-
while (true) {
|
|
31
|
-
const workspaceFile = _path2.default.join(current, "pnpm-workspace.yaml");
|
|
32
|
-
if (_fs.existsSync.call(void 0, workspaceFile)) {
|
|
33
|
-
return current;
|
|
34
|
-
}
|
|
35
|
-
const parent = _path2.default.dirname(current);
|
|
36
|
-
if (parent === current) {
|
|
37
|
-
return void 0;
|
|
38
|
-
}
|
|
39
|
-
current = parent;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function findNearestPackageRoot(startDir) {
|
|
43
|
-
if (!startDir) {
|
|
44
|
-
return void 0;
|
|
45
|
-
}
|
|
46
|
-
let current = _path2.default.resolve(startDir);
|
|
47
|
-
while (true) {
|
|
48
|
-
const pkgPath = _path2.default.join(current, "package.json");
|
|
49
|
-
if (_fs.existsSync.call(void 0, pkgPath)) {
|
|
50
|
-
return current;
|
|
51
|
-
}
|
|
52
|
-
const parent = _path2.default.dirname(current);
|
|
53
|
-
if (parent === current) {
|
|
54
|
-
return void 0;
|
|
55
|
-
}
|
|
56
|
-
current = parent;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function findWorkspacePackageDir(rootDir, packageName) {
|
|
60
|
-
const visited = /* @__PURE__ */ new Set();
|
|
61
|
-
const queue = [_path2.default.resolve(rootDir)];
|
|
62
|
-
while (queue.length > 0) {
|
|
63
|
-
const current = queue.shift();
|
|
64
|
-
const normalized = _path2.default.normalize(current);
|
|
65
|
-
if (visited.has(normalized)) {
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
visited.add(normalized);
|
|
69
|
-
try {
|
|
70
|
-
const pkgPath = _path2.default.join(normalized, "package.json");
|
|
71
|
-
if (_fs.existsSync.call(void 0, pkgPath)) {
|
|
72
|
-
const pkg = JSON.parse(_fs.readFileSync.call(void 0, pkgPath, "utf8"));
|
|
73
|
-
if (_optionalChain([pkg, 'optionalAccess', _ => _.name]) === packageName) {
|
|
74
|
-
return normalized;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
} catch (e) {
|
|
78
|
-
}
|
|
79
|
-
let entries;
|
|
80
|
-
try {
|
|
81
|
-
entries = _fs.readdirSync.call(void 0, normalized, { withFileTypes: true });
|
|
82
|
-
} catch (e2) {
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
for (const entry of entries) {
|
|
86
|
-
if (!entry.isDirectory() || IGNORED_WORKSPACE_DIRS.has(entry.name) || _optionalChain([entry, 'access', _2 => _2.isSymbolicLink, 'optionalCall', _3 => _3()])) {
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
queue.push(_path2.default.join(normalized, entry.name));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return void 0;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
11
|
// src/tailwindcss/v4/config.ts
|
|
96
12
|
|
|
97
13
|
var DEFAULT_CSS_CALC_CUSTOM_PROPERTIES = [];
|
|
@@ -161,15 +77,15 @@ function hasConfiguredCssEntries(ctx) {
|
|
|
161
77
|
if (normalizeCssEntriesConfig(ctx.cssEntries)) {
|
|
162
78
|
return true;
|
|
163
79
|
}
|
|
164
|
-
if (normalizeCssEntriesConfig(_optionalChain([ctx, 'access',
|
|
80
|
+
if (normalizeCssEntriesConfig(_optionalChain([ctx, 'access', _ => _.tailwindcss, 'optionalAccess', _2 => _2.v4, 'optionalAccess', _3 => _3.cssEntries]))) {
|
|
165
81
|
return true;
|
|
166
82
|
}
|
|
167
83
|
const patcherOptions = ctx.tailwindcssPatcherOptions;
|
|
168
84
|
if (patcherOptions) {
|
|
169
|
-
if (normalizeCssEntriesConfig(_optionalChain([patcherOptions, 'access',
|
|
85
|
+
if (normalizeCssEntriesConfig(_optionalChain([patcherOptions, 'access', _4 => _4.tailwind, 'optionalAccess', _5 => _5.v4, 'optionalAccess', _6 => _6.cssEntries]))) {
|
|
170
86
|
return true;
|
|
171
87
|
}
|
|
172
|
-
if (normalizeCssEntriesConfig(_optionalChain([patcherOptions, 'access',
|
|
88
|
+
if (normalizeCssEntriesConfig(_optionalChain([patcherOptions, 'access', _7 => _7.patch, 'optionalAccess', _8 => _8.tailwindcss, 'optionalAccess', _9 => _9.v4, 'optionalAccess', _10 => _10.cssEntries]))) {
|
|
173
89
|
return true;
|
|
174
90
|
}
|
|
175
91
|
}
|
|
@@ -180,7 +96,7 @@ function warnMissingCssEntries(ctx, patcher) {
|
|
|
180
96
|
if (hasWarnedMissingCssEntries) {
|
|
181
97
|
return;
|
|
182
98
|
}
|
|
183
|
-
if (_optionalChain([patcher, 'optionalAccess',
|
|
99
|
+
if (_optionalChain([patcher, 'optionalAccess', _11 => _11.majorVersion]) !== 4) {
|
|
184
100
|
return;
|
|
185
101
|
}
|
|
186
102
|
if (hasConfiguredCssEntries(ctx)) {
|
|
@@ -192,8 +108,8 @@ function warnMissingCssEntries(ctx, patcher) {
|
|
|
192
108
|
);
|
|
193
109
|
}
|
|
194
110
|
function applyV4CssCalcDefaults(cssCalc, patcher) {
|
|
195
|
-
const cssCalcOptions = _nullishCoalesce(cssCalc, () => ( _optionalChain([patcher, 'optionalAccess',
|
|
196
|
-
if (_optionalChain([patcher, 'optionalAccess',
|
|
111
|
+
const cssCalcOptions = _nullishCoalesce(cssCalc, () => ( _optionalChain([patcher, 'optionalAccess', _12 => _12.majorVersion]) === 4));
|
|
112
|
+
if (_optionalChain([patcher, 'optionalAccess', _13 => _13.majorVersion]) === 4 && cssCalcOptions) {
|
|
197
113
|
return ensureDefaultsIncluded(cssCalcOptions);
|
|
198
114
|
}
|
|
199
115
|
return cssCalcOptions;
|
|
@@ -202,21 +118,189 @@ function applyV4CssCalcDefaults(cssCalc, patcher) {
|
|
|
202
118
|
// src/tailwindcss/v4/patcher.ts
|
|
203
119
|
|
|
204
120
|
|
|
205
|
-
|
|
206
121
|
// src/tailwindcss/patcher.ts
|
|
207
|
-
|
|
208
|
-
var _module = require('module');
|
|
209
|
-
|
|
122
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
210
123
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
211
|
-
var _url = require('url');
|
|
212
124
|
|
|
213
125
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
214
126
|
var _tailwindcsspatch = require('tailwindcss-patch');
|
|
127
|
+
|
|
128
|
+
// src/context/workspace.ts
|
|
129
|
+
var _fs = require('fs');
|
|
130
|
+
|
|
131
|
+
var IGNORED_WORKSPACE_DIRS = /* @__PURE__ */ new Set([
|
|
132
|
+
"node_modules",
|
|
133
|
+
".git",
|
|
134
|
+
".hg",
|
|
135
|
+
".svn",
|
|
136
|
+
".turbo",
|
|
137
|
+
".output",
|
|
138
|
+
".next",
|
|
139
|
+
"dist",
|
|
140
|
+
"build"
|
|
141
|
+
]);
|
|
142
|
+
function findWorkspaceRoot(startDir) {
|
|
143
|
+
if (!startDir) {
|
|
144
|
+
return void 0;
|
|
145
|
+
}
|
|
146
|
+
let current = _path2.default.resolve(startDir);
|
|
147
|
+
while (true) {
|
|
148
|
+
const workspaceFile = _path2.default.join(current, "pnpm-workspace.yaml");
|
|
149
|
+
if (_fs.existsSync.call(void 0, workspaceFile)) {
|
|
150
|
+
return current;
|
|
151
|
+
}
|
|
152
|
+
const parent = _path2.default.dirname(current);
|
|
153
|
+
if (parent === current) {
|
|
154
|
+
return void 0;
|
|
155
|
+
}
|
|
156
|
+
current = parent;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function findNearestPackageRoot(startDir) {
|
|
160
|
+
if (!startDir) {
|
|
161
|
+
return void 0;
|
|
162
|
+
}
|
|
163
|
+
let current = _path2.default.resolve(startDir);
|
|
164
|
+
while (true) {
|
|
165
|
+
const pkgPath = _path2.default.join(current, "package.json");
|
|
166
|
+
if (_fs.existsSync.call(void 0, pkgPath)) {
|
|
167
|
+
return current;
|
|
168
|
+
}
|
|
169
|
+
const parent = _path2.default.dirname(current);
|
|
170
|
+
if (parent === current) {
|
|
171
|
+
return void 0;
|
|
172
|
+
}
|
|
173
|
+
current = parent;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function findWorkspacePackageDir(rootDir, packageName) {
|
|
177
|
+
const visited = /* @__PURE__ */ new Set();
|
|
178
|
+
const queue = [_path2.default.resolve(rootDir)];
|
|
179
|
+
while (queue.length > 0) {
|
|
180
|
+
const current = queue.shift();
|
|
181
|
+
const normalized = _path2.default.normalize(current);
|
|
182
|
+
if (visited.has(normalized)) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
visited.add(normalized);
|
|
186
|
+
try {
|
|
187
|
+
const pkgPath = _path2.default.join(normalized, "package.json");
|
|
188
|
+
if (_fs.existsSync.call(void 0, pkgPath)) {
|
|
189
|
+
const pkg = JSON.parse(_fs.readFileSync.call(void 0, pkgPath, "utf8"));
|
|
190
|
+
if (_optionalChain([pkg, 'optionalAccess', _14 => _14.name]) === packageName) {
|
|
191
|
+
return normalized;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
} catch (e) {
|
|
195
|
+
}
|
|
196
|
+
let entries;
|
|
197
|
+
try {
|
|
198
|
+
entries = _fs.readdirSync.call(void 0, normalized, { withFileTypes: true });
|
|
199
|
+
} catch (e2) {
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
for (const entry of entries) {
|
|
203
|
+
if (!entry.isDirectory() || IGNORED_WORKSPACE_DIRS.has(entry.name) || _optionalChain([entry, 'access', _15 => _15.isSymbolicLink, 'optionalCall', _16 => _16()])) {
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
queue.push(_path2.default.join(normalized, entry.name));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return void 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// src/tailwindcss/patcher-options.ts
|
|
213
|
+
function normalizeExtendLengthUnits(value) {
|
|
214
|
+
if (value === false) {
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
if (value === true) {
|
|
218
|
+
return { enabled: true };
|
|
219
|
+
}
|
|
220
|
+
if (value && typeof value === "object") {
|
|
221
|
+
return {
|
|
222
|
+
enabled: true,
|
|
223
|
+
...value
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
return void 0;
|
|
227
|
+
}
|
|
228
|
+
function normalizeTailwindcssPatcherOptions(options) {
|
|
229
|
+
if (!options) {
|
|
230
|
+
return void 0;
|
|
231
|
+
}
|
|
232
|
+
if ("patch" in options) {
|
|
233
|
+
const { cache, patch } = options;
|
|
234
|
+
const normalized = {};
|
|
235
|
+
if (cache !== void 0) {
|
|
236
|
+
normalized.cache = cache;
|
|
237
|
+
}
|
|
238
|
+
if (_optionalChain([patch, 'optionalAccess', _17 => _17.overwrite]) !== void 0) {
|
|
239
|
+
normalized.overwrite = patch.overwrite;
|
|
240
|
+
}
|
|
241
|
+
if (_optionalChain([patch, 'optionalAccess', _18 => _18.filter])) {
|
|
242
|
+
normalized.filter = patch.filter;
|
|
243
|
+
}
|
|
244
|
+
const extendLengthUnits = normalizeExtendLengthUnits(_optionalChain([patch, 'optionalAccess', _19 => _19.applyPatches, 'optionalAccess', _20 => _20.extendLengthUnits]));
|
|
245
|
+
const exposeContext = _optionalChain([patch, 'optionalAccess', _21 => _21.applyPatches, 'optionalAccess', _22 => _22.exportContext]);
|
|
246
|
+
if (extendLengthUnits !== void 0 || exposeContext !== void 0) {
|
|
247
|
+
normalized.features = {
|
|
248
|
+
exposeContext,
|
|
249
|
+
extendLengthUnits
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const cwd = _nullishCoalesce(_optionalChain([patch, 'optionalAccess', _23 => _23.cwd]), () => ( _optionalChain([patch, 'optionalAccess', _24 => _24.basedir])));
|
|
253
|
+
if (cwd) {
|
|
254
|
+
normalized.cwd = cwd;
|
|
255
|
+
}
|
|
256
|
+
const tailwindOptions = _optionalChain([patch, 'optionalAccess', _25 => _25.tailwindcss]) ? { ...patch.tailwindcss } : void 0;
|
|
257
|
+
const legacyResolve = _optionalChain([patch, 'optionalAccess', _26 => _26.resolve]);
|
|
258
|
+
let nextTailwindOptions = tailwindOptions;
|
|
259
|
+
if (_optionalChain([nextTailwindOptions, 'optionalAccess', _27 => _27.version]) === 2 && !nextTailwindOptions.packageName) {
|
|
260
|
+
nextTailwindOptions = {
|
|
261
|
+
...nextTailwindOptions,
|
|
262
|
+
packageName: "@tailwindcss/postcss7-compat",
|
|
263
|
+
postcssPlugin: nextTailwindOptions.postcssPlugin
|
|
264
|
+
};
|
|
265
|
+
if (!nextTailwindOptions.postcssPlugin) {
|
|
266
|
+
nextTailwindOptions.postcssPlugin = "@tailwindcss/postcss7-compat";
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (nextTailwindOptions || legacyResolve) {
|
|
270
|
+
const resolveOptions = _optionalChain([nextTailwindOptions, 'optionalAccess', _28 => _28.resolve]);
|
|
271
|
+
const mergedResolve = legacyResolve || resolveOptions ? {
|
|
272
|
+
..._nullishCoalesce(resolveOptions, () => ( {})),
|
|
273
|
+
..._nullishCoalesce(legacyResolve, () => ( {}))
|
|
274
|
+
} : void 0;
|
|
275
|
+
normalized.tailwind = {
|
|
276
|
+
..._nullishCoalesce(nextTailwindOptions, () => ( {})),
|
|
277
|
+
...mergedResolve ? { resolve: mergedResolve } : {}
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
return normalized;
|
|
281
|
+
}
|
|
282
|
+
return options;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// src/tailwindcss/patcher-resolve.ts
|
|
286
|
+
|
|
287
|
+
var _module = require('module');
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
var _url = require('url');
|
|
215
291
|
var GENERIC_RELATIVE_SPECIFIERS = [".", ".."];
|
|
216
292
|
var DEFAULT_TAILWIND_CONFIG_SPECIFIERS = [
|
|
217
293
|
"stubs/config.full.js",
|
|
218
294
|
"defaultConfig.js"
|
|
219
295
|
];
|
|
296
|
+
var TAILWIND_CONFIG_FILES = [
|
|
297
|
+
"tailwind.config.js",
|
|
298
|
+
"tailwind.config.cjs",
|
|
299
|
+
"tailwind.config.mjs",
|
|
300
|
+
"tailwind.config.ts",
|
|
301
|
+
"tailwind.config.cts",
|
|
302
|
+
"tailwind.config.mts"
|
|
303
|
+
];
|
|
220
304
|
function isPathSpecifier(specifier) {
|
|
221
305
|
if (!specifier) {
|
|
222
306
|
return false;
|
|
@@ -234,7 +318,7 @@ function resolveModuleFromPaths(specifier, paths) {
|
|
|
234
318
|
return void 0;
|
|
235
319
|
}
|
|
236
320
|
try {
|
|
237
|
-
const req = _module.createRequire.call(void 0,
|
|
321
|
+
const req = _module.createRequire.call(void 0, _chunkY6F6NBA7js.importMetaUrl);
|
|
238
322
|
return req.resolve(specifier, { paths });
|
|
239
323
|
} catch (e3) {
|
|
240
324
|
return void 0;
|
|
@@ -253,43 +337,6 @@ function resolveTailwindConfigFallback(packageName, paths) {
|
|
|
253
337
|
}
|
|
254
338
|
return void 0;
|
|
255
339
|
}
|
|
256
|
-
function createFallbackTailwindcssPatcher() {
|
|
257
|
-
const packageInfo = {
|
|
258
|
-
name: "tailwindcss",
|
|
259
|
-
version: void 0,
|
|
260
|
-
rootPath: "",
|
|
261
|
-
packageJsonPath: "",
|
|
262
|
-
packageJson: {}
|
|
263
|
-
};
|
|
264
|
-
return {
|
|
265
|
-
packageInfo,
|
|
266
|
-
async patch() {
|
|
267
|
-
return {
|
|
268
|
-
exposeContext: void 0,
|
|
269
|
-
extendLengthUnits: void 0
|
|
270
|
-
};
|
|
271
|
-
},
|
|
272
|
-
async getClassSet() {
|
|
273
|
-
return /* @__PURE__ */ new Set();
|
|
274
|
-
},
|
|
275
|
-
async extract(_options) {
|
|
276
|
-
const classSet = /* @__PURE__ */ new Set();
|
|
277
|
-
return {
|
|
278
|
-
classList: [],
|
|
279
|
-
classSet
|
|
280
|
-
};
|
|
281
|
-
},
|
|
282
|
-
async collectContentTokens() {
|
|
283
|
-
return {
|
|
284
|
-
entries: [],
|
|
285
|
-
filesScanned: 0,
|
|
286
|
-
sources: [],
|
|
287
|
-
skippedFiles: []
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
var hasLoggedMissingTailwind = false;
|
|
293
340
|
function appendNodeModules(paths, dir) {
|
|
294
341
|
if (!dir) {
|
|
295
342
|
return;
|
|
@@ -299,14 +346,6 @@ function appendNodeModules(paths, dir) {
|
|
|
299
346
|
paths.add(nodeModulesDir);
|
|
300
347
|
}
|
|
301
348
|
}
|
|
302
|
-
var TAILWIND_CONFIG_FILES = [
|
|
303
|
-
"tailwind.config.js",
|
|
304
|
-
"tailwind.config.cjs",
|
|
305
|
-
"tailwind.config.mjs",
|
|
306
|
-
"tailwind.config.ts",
|
|
307
|
-
"tailwind.config.cts",
|
|
308
|
-
"tailwind.config.mts"
|
|
309
|
-
];
|
|
310
349
|
function findTailwindConfig(searchRoots) {
|
|
311
350
|
for (const root of searchRoots) {
|
|
312
351
|
for (const file of TAILWIND_CONFIG_FILES) {
|
|
@@ -334,11 +373,11 @@ function createDefaultResolvePaths(basedir) {
|
|
|
334
373
|
const cwd = _process2.default.cwd();
|
|
335
374
|
appendNodeModules(paths, cwd);
|
|
336
375
|
try {
|
|
337
|
-
const modulePath = _url.fileURLToPath.call(void 0,
|
|
376
|
+
const modulePath = _url.fileURLToPath.call(void 0, _chunkY6F6NBA7js.importMetaUrl);
|
|
338
377
|
const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
|
|
339
378
|
paths.add(candidate);
|
|
340
379
|
} catch (e4) {
|
|
341
|
-
paths.add(
|
|
380
|
+
paths.add(_chunkY6F6NBA7js.importMetaUrl);
|
|
342
381
|
}
|
|
343
382
|
if (paths.size === 0) {
|
|
344
383
|
fallbackCandidates = fallbackCandidates.filter(Boolean);
|
|
@@ -351,77 +390,45 @@ function createDefaultResolvePaths(basedir) {
|
|
|
351
390
|
}
|
|
352
391
|
return [...paths];
|
|
353
392
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
if (!options) {
|
|
371
|
-
return void 0;
|
|
372
|
-
}
|
|
373
|
-
if ("patch" in options) {
|
|
374
|
-
const { cache, patch } = options;
|
|
375
|
-
const normalized = {};
|
|
376
|
-
if (cache !== void 0) {
|
|
377
|
-
normalized.cache = cache;
|
|
378
|
-
}
|
|
379
|
-
if (_optionalChain([patch, 'optionalAccess', _17 => _17.overwrite]) !== void 0) {
|
|
380
|
-
normalized.overwrite = patch.overwrite;
|
|
381
|
-
}
|
|
382
|
-
if (_optionalChain([patch, 'optionalAccess', _18 => _18.filter])) {
|
|
383
|
-
normalized.filter = patch.filter;
|
|
384
|
-
}
|
|
385
|
-
const extendLengthUnits = normalizeExtendLengthUnits(_optionalChain([patch, 'optionalAccess', _19 => _19.applyPatches, 'optionalAccess', _20 => _20.extendLengthUnits]));
|
|
386
|
-
const exposeContext = _optionalChain([patch, 'optionalAccess', _21 => _21.applyPatches, 'optionalAccess', _22 => _22.exportContext]);
|
|
387
|
-
if (extendLengthUnits !== void 0 || exposeContext !== void 0) {
|
|
388
|
-
normalized.features = {
|
|
389
|
-
exposeContext,
|
|
390
|
-
extendLengthUnits
|
|
393
|
+
|
|
394
|
+
// src/tailwindcss/patcher.ts
|
|
395
|
+
function createFallbackTailwindcssPatcher() {
|
|
396
|
+
const packageInfo = {
|
|
397
|
+
name: "tailwindcss",
|
|
398
|
+
version: void 0,
|
|
399
|
+
rootPath: "",
|
|
400
|
+
packageJsonPath: "",
|
|
401
|
+
packageJson: {}
|
|
402
|
+
};
|
|
403
|
+
return {
|
|
404
|
+
packageInfo,
|
|
405
|
+
async patch() {
|
|
406
|
+
return {
|
|
407
|
+
exposeContext: void 0,
|
|
408
|
+
extendLengthUnits: void 0
|
|
391
409
|
};
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
nextTailwindOptions = {
|
|
402
|
-
...nextTailwindOptions,
|
|
403
|
-
packageName: "@tailwindcss/postcss7-compat",
|
|
404
|
-
postcssPlugin: nextTailwindOptions.postcssPlugin
|
|
410
|
+
},
|
|
411
|
+
async getClassSet() {
|
|
412
|
+
return /* @__PURE__ */ new Set();
|
|
413
|
+
},
|
|
414
|
+
async extract(_options) {
|
|
415
|
+
const classSet = /* @__PURE__ */ new Set();
|
|
416
|
+
return {
|
|
417
|
+
classList: [],
|
|
418
|
+
classSet
|
|
405
419
|
};
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
..._nullishCoalesce(resolveOptions, () => ( {})),
|
|
414
|
-
..._nullishCoalesce(legacyResolve, () => ( {}))
|
|
415
|
-
} : void 0;
|
|
416
|
-
normalized.tailwind = {
|
|
417
|
-
..._nullishCoalesce(nextTailwindOptions, () => ( {})),
|
|
418
|
-
...mergedResolve ? { resolve: mergedResolve } : {}
|
|
420
|
+
},
|
|
421
|
+
async collectContentTokens() {
|
|
422
|
+
return {
|
|
423
|
+
entries: [],
|
|
424
|
+
filesScanned: 0,
|
|
425
|
+
sources: [],
|
|
426
|
+
skippedFiles: []
|
|
419
427
|
};
|
|
420
428
|
}
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
return options;
|
|
429
|
+
};
|
|
424
430
|
}
|
|
431
|
+
var hasLoggedMissingTailwind = false;
|
|
425
432
|
function createTailwindcssPatcher(options) {
|
|
426
433
|
const { basedir, cacheDir, supportCustomLengthUnitsPatch, tailwindcss, tailwindcssPatcherOptions } = options || {};
|
|
427
434
|
const cache = {
|
|
@@ -532,35 +539,182 @@ function createTailwindcssPatcher(options) {
|
|
|
532
539
|
}
|
|
533
540
|
}
|
|
534
541
|
}
|
|
535
|
-
if (!resolvedOptions.tailwind.cwd && configPath) {
|
|
536
|
-
resolvedOptions.tailwind.cwd = _path2.default.dirname(configPath);
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
try {
|
|
540
|
-
return new (0, _tailwindcsspatch.TailwindcssPatcher)(resolvedOptions);
|
|
541
|
-
} catch (error) {
|
|
542
|
-
const searchPaths = _optionalChain([resolvedOptions, 'access', _35 => _35.tailwind, 'optionalAccess', _36 => _36.resolve, 'optionalAccess', _37 => _37.paths]);
|
|
543
|
-
if (error instanceof Error && /tailwindcss not found/i.test(error.message)) {
|
|
544
|
-
if (!hasLoggedMissingTailwind) {
|
|
545
|
-
_logger.logger.warn("Tailwind CSS \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7 Tailwind \u76F8\u5173\u8865\u4E01\u3002\u82E5\u9700\u4F7F\u7528 Tailwind \u80FD\u529B\uFF0C\u8BF7\u5B89\u88C5 tailwindcss\u3002");
|
|
546
|
-
hasLoggedMissingTailwind = true;
|
|
542
|
+
if (!resolvedOptions.tailwind.cwd && configPath) {
|
|
543
|
+
resolvedOptions.tailwind.cwd = _path2.default.dirname(configPath);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
try {
|
|
547
|
+
return new (0, _tailwindcsspatch.TailwindcssPatcher)(resolvedOptions);
|
|
548
|
+
} catch (error) {
|
|
549
|
+
const searchPaths = _optionalChain([resolvedOptions, 'access', _35 => _35.tailwind, 'optionalAccess', _36 => _36.resolve, 'optionalAccess', _37 => _37.paths]);
|
|
550
|
+
if (error instanceof Error && /tailwindcss not found/i.test(error.message)) {
|
|
551
|
+
if (!hasLoggedMissingTailwind) {
|
|
552
|
+
_logger.logger.warn("Tailwind CSS \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7 Tailwind \u76F8\u5173\u8865\u4E01\u3002\u82E5\u9700\u4F7F\u7528 Tailwind \u80FD\u529B\uFF0C\u8BF7\u5B89\u88C5 tailwindcss\u3002");
|
|
553
|
+
hasLoggedMissingTailwind = true;
|
|
554
|
+
}
|
|
555
|
+
return createFallbackTailwindcssPatcher();
|
|
556
|
+
}
|
|
557
|
+
if (error instanceof Error && /unable to locate tailwind css package/i.test(error.message)) {
|
|
558
|
+
_logger.logger.error('\u65E0\u6CD5\u5B9A\u4F4D Tailwind CSS \u5305 "%s"\uFF0C\u5DF2\u5C1D\u8BD5\u8DEF\u5F84: %O', _optionalChain([resolvedOptions, 'access', _38 => _38.tailwind, 'optionalAccess', _39 => _39.packageName]), searchPaths);
|
|
559
|
+
}
|
|
560
|
+
throw error;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// src/tailwindcss/v4/multi-patcher.ts
|
|
565
|
+
function createMultiTailwindcssPatcher(patchers) {
|
|
566
|
+
if (patchers.length <= 1) {
|
|
567
|
+
return patchers[0];
|
|
568
|
+
}
|
|
569
|
+
const [first] = patchers;
|
|
570
|
+
const multiPatcher = {
|
|
571
|
+
...first,
|
|
572
|
+
packageInfo: _optionalChain([first, 'optionalAccess', _40 => _40.packageInfo]),
|
|
573
|
+
majorVersion: _optionalChain([first, 'optionalAccess', _41 => _41.majorVersion]),
|
|
574
|
+
options: _optionalChain([first, 'optionalAccess', _42 => _42.options]),
|
|
575
|
+
async patch() {
|
|
576
|
+
let exposeContext;
|
|
577
|
+
let extendLengthUnits;
|
|
578
|
+
for (const patcher of patchers) {
|
|
579
|
+
const result = await patcher.patch();
|
|
580
|
+
if (_optionalChain([result, 'optionalAccess', _43 => _43.exposeContext]) && exposeContext == null) {
|
|
581
|
+
exposeContext = result.exposeContext;
|
|
582
|
+
}
|
|
583
|
+
if (_optionalChain([result, 'optionalAccess', _44 => _44.extendLengthUnits]) && extendLengthUnits == null) {
|
|
584
|
+
extendLengthUnits = result.extendLengthUnits;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
return {
|
|
588
|
+
exposeContext,
|
|
589
|
+
extendLengthUnits
|
|
590
|
+
};
|
|
591
|
+
},
|
|
592
|
+
async getClassSet() {
|
|
593
|
+
const aggregated = /* @__PURE__ */ new Set();
|
|
594
|
+
for (const patcher of patchers) {
|
|
595
|
+
const current = await patcher.getClassSet();
|
|
596
|
+
for (const className of current) {
|
|
597
|
+
aggregated.add(className);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
return aggregated;
|
|
601
|
+
},
|
|
602
|
+
async extract(options) {
|
|
603
|
+
const aggregatedSet = /* @__PURE__ */ new Set();
|
|
604
|
+
const aggregatedList = [];
|
|
605
|
+
let filename;
|
|
606
|
+
for (const patcher of patchers) {
|
|
607
|
+
const result = await patcher.extract(options);
|
|
608
|
+
if (!result) {
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
if (filename === void 0 && result.filename) {
|
|
612
|
+
filename = result.filename;
|
|
613
|
+
}
|
|
614
|
+
if (result.classList) {
|
|
615
|
+
for (const className of result.classList) {
|
|
616
|
+
if (!aggregatedSet.has(className)) {
|
|
617
|
+
aggregatedList.push(className);
|
|
618
|
+
}
|
|
619
|
+
aggregatedSet.add(className);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (result.classSet) {
|
|
623
|
+
for (const className of result.classSet) {
|
|
624
|
+
aggregatedSet.add(className);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
return {
|
|
629
|
+
classList: aggregatedList,
|
|
630
|
+
classSet: aggregatedSet,
|
|
631
|
+
filename
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
if (patchers.every((patcher) => typeof patcher.getClassSetSync === "function")) {
|
|
636
|
+
multiPatcher.getClassSetSync = () => {
|
|
637
|
+
const aggregated = /* @__PURE__ */ new Set();
|
|
638
|
+
for (const patcher of patchers) {
|
|
639
|
+
const current = _optionalChain([patcher, 'access', _45 => _45.getClassSetSync, 'optionalCall', _46 => _46()]);
|
|
640
|
+
if (!current) {
|
|
641
|
+
continue;
|
|
642
|
+
}
|
|
643
|
+
for (const className of current) {
|
|
644
|
+
aggregated.add(className);
|
|
645
|
+
}
|
|
547
646
|
}
|
|
548
|
-
return
|
|
549
|
-
}
|
|
550
|
-
if (error instanceof Error && /unable to locate tailwind css package/i.test(error.message)) {
|
|
551
|
-
_logger.logger.error('\u65E0\u6CD5\u5B9A\u4F4D Tailwind CSS \u5305 "%s"\uFF0C\u5DF2\u5C1D\u8BD5\u8DEF\u5F84: %O', _optionalChain([resolvedOptions, 'access', _38 => _38.tailwind, 'optionalAccess', _39 => _39.packageName]), searchPaths);
|
|
552
|
-
}
|
|
553
|
-
throw error;
|
|
647
|
+
return aggregated;
|
|
648
|
+
};
|
|
554
649
|
}
|
|
650
|
+
return multiPatcher;
|
|
555
651
|
}
|
|
556
652
|
|
|
557
|
-
// src/tailwindcss/v4/patcher.ts
|
|
653
|
+
// src/tailwindcss/v4/patcher-options.ts
|
|
558
654
|
function isLegacyTailwindcssPatcherOptions(options) {
|
|
559
655
|
return typeof options === "object" && options !== null && "patch" in options;
|
|
560
656
|
}
|
|
561
657
|
function isModernTailwindcssPatchOptions(options) {
|
|
562
658
|
return typeof options === "object" && options !== null && !("patch" in options);
|
|
563
659
|
}
|
|
660
|
+
function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries) {
|
|
661
|
+
const hasCssEntries = cssEntries.length > 0;
|
|
662
|
+
if (!options) {
|
|
663
|
+
return options;
|
|
664
|
+
}
|
|
665
|
+
if (isLegacyTailwindcssPatcherOptions(options)) {
|
|
666
|
+
const patchOptions = options.patch;
|
|
667
|
+
if (!patchOptions) {
|
|
668
|
+
return options;
|
|
669
|
+
}
|
|
670
|
+
const nextPatch = {
|
|
671
|
+
...patchOptions,
|
|
672
|
+
basedir: baseDir,
|
|
673
|
+
cwd: _nullishCoalesce(patchOptions.cwd, () => ( baseDir))
|
|
674
|
+
};
|
|
675
|
+
if (patchOptions.tailwindcss) {
|
|
676
|
+
const nextV4 = {
|
|
677
|
+
..._nullishCoalesce(patchOptions.tailwindcss.v4, () => ( {}))
|
|
678
|
+
};
|
|
679
|
+
if (hasCssEntries) {
|
|
680
|
+
nextV4.cssEntries = cssEntries;
|
|
681
|
+
} else {
|
|
682
|
+
nextV4.cssEntries = _nullishCoalesce(nextV4.cssEntries, () => ( cssEntries));
|
|
683
|
+
if (nextV4.base === void 0) {
|
|
684
|
+
nextV4.base = baseDir;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
nextPatch.tailwindcss = {
|
|
688
|
+
...patchOptions.tailwindcss,
|
|
689
|
+
v4: nextV4
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
return {
|
|
693
|
+
...options,
|
|
694
|
+
patch: nextPatch
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
if (!isModernTailwindcssPatchOptions(options)) {
|
|
698
|
+
return options;
|
|
699
|
+
}
|
|
700
|
+
if (!options.tailwind) {
|
|
701
|
+
return options;
|
|
702
|
+
}
|
|
703
|
+
return {
|
|
704
|
+
...options,
|
|
705
|
+
tailwind: {
|
|
706
|
+
...options.tailwind,
|
|
707
|
+
v4: {
|
|
708
|
+
..._nullishCoalesce(options.tailwind.v4, () => ( {})),
|
|
709
|
+
...hasCssEntries ? {} : { base: _nullishCoalesce(_optionalChain([options, 'access', _47 => _47.tailwind, 'access', _48 => _48.v4, 'optionalAccess', _49 => _49.base]), () => ( baseDir)) },
|
|
710
|
+
cssEntries: hasCssEntries ? cssEntries : _nullishCoalesce(_optionalChain([options, 'access', _50 => _50.tailwind, 'access', _51 => _51.v4, 'optionalAccess', _52 => _52.cssEntries]), () => ( cssEntries))
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
// src/tailwindcss/v4/css-entries.ts
|
|
717
|
+
|
|
564
718
|
function guessBasedirFromEntries(entries) {
|
|
565
719
|
if (!entries) {
|
|
566
720
|
return void 0;
|
|
@@ -639,68 +793,15 @@ function groupCssEntriesByBase(entries, options = {}) {
|
|
|
639
793
|
}
|
|
640
794
|
return groups;
|
|
641
795
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
if (!options) {
|
|
645
|
-
return options;
|
|
646
|
-
}
|
|
647
|
-
if (isLegacyTailwindcssPatcherOptions(options)) {
|
|
648
|
-
const patchOptions = options.patch;
|
|
649
|
-
if (!patchOptions) {
|
|
650
|
-
return options;
|
|
651
|
-
}
|
|
652
|
-
const nextPatch = {
|
|
653
|
-
...patchOptions,
|
|
654
|
-
basedir: baseDir,
|
|
655
|
-
cwd: _nullishCoalesce(patchOptions.cwd, () => ( baseDir))
|
|
656
|
-
};
|
|
657
|
-
if (patchOptions.tailwindcss) {
|
|
658
|
-
const nextV4 = {
|
|
659
|
-
..._nullishCoalesce(patchOptions.tailwindcss.v4, () => ( {}))
|
|
660
|
-
};
|
|
661
|
-
if (hasCssEntries) {
|
|
662
|
-
nextV4.cssEntries = cssEntries;
|
|
663
|
-
} else {
|
|
664
|
-
nextV4.cssEntries = _nullishCoalesce(nextV4.cssEntries, () => ( cssEntries));
|
|
665
|
-
if (nextV4.base === void 0) {
|
|
666
|
-
nextV4.base = baseDir;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
nextPatch.tailwindcss = {
|
|
670
|
-
...patchOptions.tailwindcss,
|
|
671
|
-
v4: nextV4
|
|
672
|
-
};
|
|
673
|
-
}
|
|
674
|
-
return {
|
|
675
|
-
...options,
|
|
676
|
-
patch: nextPatch
|
|
677
|
-
};
|
|
678
|
-
}
|
|
679
|
-
if (!isModernTailwindcssPatchOptions(options)) {
|
|
680
|
-
return options;
|
|
681
|
-
}
|
|
682
|
-
if (!options.tailwind) {
|
|
683
|
-
return options;
|
|
684
|
-
}
|
|
685
|
-
return {
|
|
686
|
-
...options,
|
|
687
|
-
tailwind: {
|
|
688
|
-
...options.tailwind,
|
|
689
|
-
v4: {
|
|
690
|
-
..._nullishCoalesce(options.tailwind.v4, () => ( {})),
|
|
691
|
-
...hasCssEntries ? {} : { base: _nullishCoalesce(_optionalChain([options, 'access', _40 => _40.tailwind, 'access', _41 => _41.v4, 'optionalAccess', _42 => _42.base]), () => ( baseDir)) },
|
|
692
|
-
cssEntries: hasCssEntries ? cssEntries : _nullishCoalesce(_optionalChain([options, 'access', _43 => _43.tailwind, 'access', _44 => _44.v4, 'optionalAccess', _45 => _45.cssEntries]), () => ( cssEntries))
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
};
|
|
696
|
-
}
|
|
796
|
+
|
|
797
|
+
// src/tailwindcss/v4/patcher.ts
|
|
697
798
|
function createPatcherForBase(baseDir, cssEntries, options) {
|
|
698
799
|
const {
|
|
699
800
|
tailwindcss,
|
|
700
801
|
tailwindcssPatcherOptions,
|
|
701
802
|
supportCustomLengthUnitsPatch
|
|
702
803
|
} = options;
|
|
703
|
-
const hasCssEntries = Boolean(_optionalChain([cssEntries, 'optionalAccess',
|
|
804
|
+
const hasCssEntries = Boolean(_optionalChain([cssEntries, 'optionalAccess', _53 => _53.length]));
|
|
704
805
|
const defaultTailwindcssConfig = {
|
|
705
806
|
cwd: baseDir,
|
|
706
807
|
v2: {
|
|
@@ -731,7 +832,7 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
731
832
|
mergedTailwindOptions.v4.base = baseDir;
|
|
732
833
|
}
|
|
733
834
|
if (hasCssEntries) {
|
|
734
|
-
if (_optionalChain([cssEntries, 'optionalAccess',
|
|
835
|
+
if (_optionalChain([cssEntries, 'optionalAccess', _54 => _54.length])) {
|
|
735
836
|
mergedTailwindOptions.v4.cssEntries = cssEntries;
|
|
736
837
|
} else if (!mergedTailwindOptions.v4.cssEntries) {
|
|
737
838
|
mergedTailwindOptions.v4.cssEntries = [];
|
|
@@ -745,8 +846,8 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
745
846
|
baseDir,
|
|
746
847
|
_nullishCoalesce(cssEntries, () => ( []))
|
|
747
848
|
);
|
|
748
|
-
const configuredPackageName = _optionalChain([tailwindcss, 'optionalAccess',
|
|
749
|
-
const configuredVersion = _optionalChain([tailwindcss, 'optionalAccess',
|
|
849
|
+
const configuredPackageName = _optionalChain([tailwindcss, 'optionalAccess', _55 => _55.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _56 => _56.tailwind, 'optionalAccess', _57 => _57.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _58 => _58.patch, 'optionalAccess', _59 => _59.tailwindcss, 'optionalAccess', _60 => _60.packageName]);
|
|
850
|
+
const configuredVersion = _optionalChain([tailwindcss, 'optionalAccess', _61 => _61.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _62 => _62.tailwind, 'optionalAccess', _63 => _63.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _64 => _64.patch, 'optionalAccess', _65 => _65.tailwindcss, 'optionalAccess', _66 => _66.version]) || mergedTailwindOptions.version;
|
|
750
851
|
const isTailwindcss4Package = (packageName) => Boolean(
|
|
751
852
|
packageName && (packageName === "tailwindcss4" || packageName === "@tailwindcss/postcss" || packageName.includes("tailwindcss4"))
|
|
752
853
|
);
|
|
@@ -774,93 +875,6 @@ function createPatcherForBase(baseDir, cssEntries, options) {
|
|
|
774
875
|
});
|
|
775
876
|
return patchers.length === 1 ? patchers[0] : createMultiTailwindcssPatcher(patchers);
|
|
776
877
|
}
|
|
777
|
-
function createMultiTailwindcssPatcher(patchers) {
|
|
778
|
-
if (patchers.length <= 1) {
|
|
779
|
-
return patchers[0];
|
|
780
|
-
}
|
|
781
|
-
const [first] = patchers;
|
|
782
|
-
const multiPatcher = {
|
|
783
|
-
...first,
|
|
784
|
-
packageInfo: _optionalChain([first, 'optionalAccess', _60 => _60.packageInfo]),
|
|
785
|
-
majorVersion: _optionalChain([first, 'optionalAccess', _61 => _61.majorVersion]),
|
|
786
|
-
options: _optionalChain([first, 'optionalAccess', _62 => _62.options]),
|
|
787
|
-
async patch() {
|
|
788
|
-
let exposeContext;
|
|
789
|
-
let extendLengthUnits;
|
|
790
|
-
for (const patcher of patchers) {
|
|
791
|
-
const result = await patcher.patch();
|
|
792
|
-
if (_optionalChain([result, 'optionalAccess', _63 => _63.exposeContext]) && exposeContext == null) {
|
|
793
|
-
exposeContext = result.exposeContext;
|
|
794
|
-
}
|
|
795
|
-
if (_optionalChain([result, 'optionalAccess', _64 => _64.extendLengthUnits]) && extendLengthUnits == null) {
|
|
796
|
-
extendLengthUnits = result.extendLengthUnits;
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
return {
|
|
800
|
-
exposeContext,
|
|
801
|
-
extendLengthUnits
|
|
802
|
-
};
|
|
803
|
-
},
|
|
804
|
-
async getClassSet() {
|
|
805
|
-
const aggregated = /* @__PURE__ */ new Set();
|
|
806
|
-
for (const patcher of patchers) {
|
|
807
|
-
const current = await patcher.getClassSet();
|
|
808
|
-
for (const className of current) {
|
|
809
|
-
aggregated.add(className);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
return aggregated;
|
|
813
|
-
},
|
|
814
|
-
async extract(options) {
|
|
815
|
-
const aggregatedSet = /* @__PURE__ */ new Set();
|
|
816
|
-
const aggregatedList = [];
|
|
817
|
-
let filename;
|
|
818
|
-
for (const patcher of patchers) {
|
|
819
|
-
const result = await patcher.extract(options);
|
|
820
|
-
if (!result) {
|
|
821
|
-
continue;
|
|
822
|
-
}
|
|
823
|
-
if (filename === void 0 && result.filename) {
|
|
824
|
-
filename = result.filename;
|
|
825
|
-
}
|
|
826
|
-
if (result.classList) {
|
|
827
|
-
for (const className of result.classList) {
|
|
828
|
-
if (!aggregatedSet.has(className)) {
|
|
829
|
-
aggregatedList.push(className);
|
|
830
|
-
}
|
|
831
|
-
aggregatedSet.add(className);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
if (result.classSet) {
|
|
835
|
-
for (const className of result.classSet) {
|
|
836
|
-
aggregatedSet.add(className);
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
return {
|
|
841
|
-
classList: aggregatedList,
|
|
842
|
-
classSet: aggregatedSet,
|
|
843
|
-
filename
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
};
|
|
847
|
-
if (patchers.every((patcher) => typeof patcher.getClassSetSync === "function")) {
|
|
848
|
-
multiPatcher.getClassSetSync = () => {
|
|
849
|
-
const aggregated = /* @__PURE__ */ new Set();
|
|
850
|
-
for (const patcher of patchers) {
|
|
851
|
-
const current = _optionalChain([patcher, 'access', _65 => _65.getClassSetSync, 'optionalCall', _66 => _66()]);
|
|
852
|
-
if (!current) {
|
|
853
|
-
continue;
|
|
854
|
-
}
|
|
855
|
-
for (const className of current) {
|
|
856
|
-
aggregated.add(className);
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
return aggregated;
|
|
860
|
-
};
|
|
861
|
-
}
|
|
862
|
-
return multiPatcher;
|
|
863
|
-
}
|
|
864
878
|
function tryCreateMultiTailwindcssPatcher(groups, options) {
|
|
865
879
|
if (groups.size <= 1) {
|
|
866
880
|
return void 0;
|
|
@@ -873,8 +887,7 @@ function tryCreateMultiTailwindcssPatcher(groups, options) {
|
|
|
873
887
|
return createMultiTailwindcssPatcher(patchers);
|
|
874
888
|
}
|
|
875
889
|
|
|
876
|
-
// src/context/tailwindcss.ts
|
|
877
|
-
|
|
890
|
+
// src/context/tailwindcss/basedir.ts
|
|
878
891
|
|
|
879
892
|
|
|
880
893
|
|
|
@@ -1026,6 +1039,14 @@ function resolveTailwindcssBasedir(basedir, fallback) {
|
|
|
1026
1039
|
}
|
|
1027
1040
|
return _path2.default.normalize(cwd);
|
|
1028
1041
|
}
|
|
1042
|
+
|
|
1043
|
+
// src/context/tailwindcss.ts
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
// src/context/tailwindcss/rax.ts
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
|
|
1029
1050
|
function isRaxWorkspace(appType, baseDir) {
|
|
1030
1051
|
if (appType === "rax") {
|
|
1031
1052
|
return true;
|
|
@@ -1086,6 +1107,8 @@ function detectImplicitCssEntries(appType, baseDir) {
|
|
|
1086
1107
|
}
|
|
1087
1108
|
return void 0;
|
|
1088
1109
|
}
|
|
1110
|
+
|
|
1111
|
+
// src/context/tailwindcss.ts
|
|
1089
1112
|
function createTailwindcssPatcherFromContext(ctx) {
|
|
1090
1113
|
const {
|
|
1091
1114
|
tailwindcssBasedir,
|