weapp-tailwindcss 5.5.4 → 5.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +5 -4
- package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -2
- package/dist/bundlers/shared/framework-css-composition.d.ts +1 -0
- package/dist/bundlers/shared/framework-postcss.d.ts +2 -1
- package/dist/bundlers/shared/framework-user-css.d.ts +1 -0
- package/dist/bundlers/shared/generated-css-marker.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +5 -7
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +4 -1
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +4 -2
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/types.d.ts +6 -3
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/user-css/compile-functions.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +3 -1
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +3 -0
- package/dist/bundlers/shared/style-handler-options.d.ts +7 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +0 -1
- package/dist/bundlers/vite/css-finalizer/css-calc.d.ts +3 -0
- package/dist/bundlers/vite/css-finalizer/final-assets.d.ts +3 -0
- package/dist/bundlers/vite/css-handler-options.d.ts +1 -1
- package/dist/bundlers/vite/frameworks/generic/web.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/css-transform-decision-plan.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/finalize/sync-processed-css.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/framework-style-memory.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/runtime.d.ts +3 -1
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/temporary-css-assets.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/types.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/web-css-module.d.ts +1 -0
- package/dist/bundlers/vite/plugin-hook.d.ts +3 -0
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +3 -1
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +1 -1
- package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +3 -1
- package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +2 -1
- package/dist/bundlers/vite/shared/framework-runtime-configuration.d.ts +3 -0
- package/dist/bundlers/vite/shared/framework-runtime-options.d.ts +9 -0
- package/dist/bundlers/vite/shared/framework-runtime-utils.d.ts +6 -5
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +3 -3
- package/dist/bundlers/vite/shared/framework-strategy.d.ts +3 -1
- package/dist/bundlers/vite/shared/hmr-source.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/processed-css-task.d.ts +2 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
- package/dist/bundlers/webpack/shared/create-framework-plugin/plugin.d.ts +1 -1
- package/dist/compiler/index.d.ts +2 -0
- package/dist/compiler/semantic-css.d.ts +1 -1
- package/dist/compiler/types.d.ts +1 -1
- package/dist/{compiler-DFROuh5Z.cjs → compiler-C8FqI-P3.cjs} +1060 -1163
- package/dist/{compiler-CJ5yX-on.js → compiler-D3GBwxoa.js} +32 -23
- package/dist/core/compiler/transforms.d.ts +1 -1
- package/dist/core.cjs +4 -4
- package/dist/core.js +4 -4
- package/dist/{css-imports-_5cwJnx-.cjs → css-imports-XvtI1zCY.cjs} +2 -3
- package/dist/css-macro.cjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/{defaults-CKx-4LcW.js → defaults-AQuvJS-h.js} +4 -2
- package/dist/{defaults-CiGsr8Xq.cjs → defaults-CyX5iO9y.cjs} +4 -2
- package/dist/defaults.cjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/final-css-cleanup-CDTmVAye.cjs +1 -0
- package/dist/{final-css-cleanup-B0HUBtiE.js → final-css-cleanup-u_sI2p56.js} +1 -126
- package/dist/framework/index.d.ts +1 -1
- package/dist/framework/platform.d.ts +2 -2
- package/dist/{generator-RK2HtgOb.cjs → generator-Bvr4WmuF.cjs} +150 -150
- package/dist/{generator-BgbYHNgD.js → generator-C0BJjyLM.js} +131 -131
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-BS7fTmyj.cjs → gulp-BExe5RBF.cjs} +8 -8
- package/dist/{gulp-nl-2p5Dw.js → gulp-BhkIIk7J.js} +5 -5
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-BfxWwMeT.js → hmr-timing-B9Yt86-U.js} +299 -404
- package/dist/{hmr-timing-D45cTIzM.cjs → hmr-timing-CoiJIqDu.cjs} +4 -4
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/js/NodePathWalker.d.ts +1 -1
- package/dist/js/node-path-walker/export-handlers.d.ts +1 -1
- package/dist/js/node-path-walker/import-tokens.d.ts +1 -1
- package/dist/{pipeline-helpers-BEhISt4D.cjs → pipeline-helpers-BOjTEmMi.cjs} +6 -6
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +2 -2
- package/dist/presets.js +2 -2
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +2 -2
- package/dist/{scoped-generator-Dqq2iLky.js → scoped-generator-B6Y1bxzM.js} +46 -31
- package/dist/{scoped-generator-DccPwmJT.cjs → scoped-generator-BUBls_oM.cjs} +46 -31
- package/dist/{source-candidate-scan-signature-CnUlGWhP.cjs → source-candidate-scan-signature-BtJZp28T.cjs} +32 -3
- package/dist/{source-candidate-scan-signature-BJkQJtRM.js → source-candidate-scan-signature-DNuGKTqf.js} +21 -4
- package/dist/style-injector/internal.d.ts +118 -8
- package/dist/style-injector/options.d.ts +5 -1
- package/dist/tailwindcss/runtime-options.d.ts +5 -0
- package/dist/tailwindcss/v4/preflight.d.ts +0 -1
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/generator/style-context.d.ts +4 -0
- package/dist/{tailwindcss-o3Xe-o7M.js → tailwindcss-B_4E52WF.js} +7 -13
- package/dist/{tailwindcss-B03BGeTO.cjs → tailwindcss-CBYjzRmV.cjs} +4 -10
- package/dist/{transform-BVH7iLHn.js → transform-CkEnJYIP.js} +18 -12
- package/dist/{transform-MIhriZRr.cjs → transform-FkqbTBJR.cjs} +17 -11
- package/dist/types/index.d.ts +3 -2
- package/dist/uni-app-x/border-preflight.d.ts +1 -2
- package/dist/uni-app-x/component-local-style.d.ts +2 -1
- package/dist/uni-app-x/transform.d.ts +4 -2
- package/dist/uni-app-x/vite/author-apply.d.ts +3 -1
- package/dist/uni-app-x/vite/native-hmr.d.ts +1 -1
- package/dist/uni-app-x/vite/style-result.d.ts +5 -0
- package/dist/{v4-generation-core-BvW2aK23.cjs → v4-generation-core-Cz1D7wm1.cjs} +313 -418
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-4RznbXVI.cjs → vite-DxuKPZlp.cjs} +565 -592
- package/dist/{vite-hGECCqfq.js → vite-lP35OguX.js} +558 -578
- package/dist/vite-web.d.ts +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +2 -2
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +7 -7
- package/dist/{web-0FAisq6H.js → web-Dfz_jpNj.js} +144 -107
- package/dist/{web-DQZ27KWH.cjs → web-DhDxhlkq.cjs} +156 -107
- package/dist/{webpack-8cQlXIo4.js → webpack-D6jp1o3m.js} +18 -17
- package/dist/{webpack-DOQ_3ViW.cjs → webpack-R2Sbggiy.cjs} +20 -20
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -2
- package/dist/wxml/utils/custom-template.d.ts +1 -1
- package/package.json +9 -11
- package/dist/final-css-cleanup-DSjczga3.cjs +0 -138
- package/dist/tailwindcss/v4-engine/css-import.d.ts +0 -14
- package/dist/uni-app-x/style-asset/source-parser.d.ts +0 -2
|
@@ -6,9 +6,8 @@ import fs, { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs
|
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
import { createTailwindGenerationSession, createTailwindV4Engine, extractRawCandidates, loadTailwindV4DesignSystem, resolveProjectSourceFiles, resolveTailwindV4Source, resolveValidTailwindV4Candidates as resolveValidTailwindV4Candidates$1 } from "@tailwindcss-mangle/engine";
|
|
9
|
-
import { analyzeTailwindCssDirectives, createStyleHandler, filterExistingCssRules, finalizeMiniProgramCss as finalizeMiniProgramCss$1, hasMiniProgramCssSpecificityPlaceholders, isTailwindCssGenerationDirective, isTailwindCssImportAtRule, isTailwindCssPackageJsonImportRequest, normalizeTailwindCssImportRequest, normalizeTailwindcssWebRpxDeclarations, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, pruneMiniProgramGeneratedCss as pruneMiniProgramGeneratedCss$1, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, selectorContainsPseudoClass, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss";
|
|
9
|
+
import { analyzeTailwindCssDirectives, applyConfiguredCssCalc, createStyleHandler, filterExistingCssRules, finalizeMiniProgramCss as finalizeMiniProgramCss$1, hasMiniProgramCssSpecificityPlaceholders, isTailwindCssGenerationDirective, isTailwindCssImport, isTailwindCssImportAtRule, isTailwindCssPackageJsonImportRequest, isTailwindRuntimePropertyRule, normalizeTailwindCssImportRequest, normalizeTailwindcssWebRpxDeclarations, parseCssImportSpecifier, parseImportSourceParam, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, pruneMiniProgramGeneratedCss as pruneMiniProgramGeneratedCss$1, quoteCssImportSpecifier, removeTailwindV4PreflightImports, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, removeUnsupportedThemeVendorKeyframes, selectorContainsPseudoClass, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss";
|
|
10
10
|
import { LRUCache } from "lru-cache";
|
|
11
|
-
import { TokenType, tokenize } from "@csstools/css-tokenizer";
|
|
12
11
|
import { stat } from "node:fs/promises";
|
|
13
12
|
import micromatch from "micromatch";
|
|
14
13
|
//#region src/runtime-branch/generator-target-env.ts
|
|
@@ -316,7 +315,7 @@ async function transformTailwindV4CssToWeapp(css, options) {
|
|
|
316
315
|
...options
|
|
317
316
|
});
|
|
318
317
|
const pruneOptions = {
|
|
319
|
-
|
|
318
|
+
...options?.uniAppX === true && options.uniAppXCssTarget === "uvue" ? { preserveContentInit: false } : {},
|
|
320
319
|
preservePreflight: true,
|
|
321
320
|
preserveConditionalComments: hasCssMacroStyleOptions(options)
|
|
322
321
|
};
|
|
@@ -334,48 +333,8 @@ function transformTailwindV4WebRpxCss(css) {
|
|
|
334
333
|
async function transformTailwindV4CssByTarget(css, target, options) {
|
|
335
334
|
if (target === "weapp") return transformTailwindV4CssToWeapp(css, options);
|
|
336
335
|
const resolvedWebCss = await (hasCssMacroStyleOptions(options) ? transformCssMacroCss(css, options) : css);
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
//#endregion
|
|
340
|
-
//#region src/tailwindcss/v4-engine/css-import.ts
|
|
341
|
-
function parseCssImportSpecifier(params) {
|
|
342
|
-
const tokens = tokenize({ css: params }).filter((token) => token[0] !== TokenType.Whitespace && token[0] !== TokenType.Comment);
|
|
343
|
-
const first = tokens[0];
|
|
344
|
-
if (!first) return;
|
|
345
|
-
if (first[0] === TokenType.String || first[0] === TokenType.URL) return {
|
|
346
|
-
specifier: first[4].value,
|
|
347
|
-
raw: first[1],
|
|
348
|
-
quote: first[0] === TokenType.String ? first[1][0] : void 0
|
|
349
|
-
};
|
|
350
|
-
if (first[0] === TokenType.Function && first[4].value.toLowerCase() === "url" && tokens[1]?.[0] === TokenType.String && tokens[2]?.[0] === TokenType.CloseParen) return {
|
|
351
|
-
specifier: tokens[1][4].value,
|
|
352
|
-
raw: params.slice(first[2], tokens[2][3] + 1),
|
|
353
|
-
quote: tokens[1][1][0]
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
function quoteCssImportSpecifier(file, quote = "\"") {
|
|
357
|
-
return `${quote}${(path.sep === "\\" || /^[a-z]:[\\/]|^\\\\/i.test(file) ? file.replaceAll("\\", "/") : file).replaceAll("\\", "\\\\").replaceAll(quote, `\\${quote}`).replaceAll("\n", "\\a ").replaceAll("\r", "\\d ")}${quote}`;
|
|
358
|
-
}
|
|
359
|
-
function isTailwindCssImport(params) {
|
|
360
|
-
const specifier = parseCssImportSpecifier(params)?.specifier;
|
|
361
|
-
if (!specifier) return false;
|
|
362
|
-
if (specifier === "tailwindcss" || specifier.startsWith("tailwindcss/")) return true;
|
|
363
|
-
const paths = specifier.includes("\\") ? path.win32 : path.posix;
|
|
364
|
-
return paths.basename(specifier) === "index.css" && paths.basename(paths.dirname(specifier)) === "tailwindcss";
|
|
365
|
-
}
|
|
366
|
-
function parseImportSourceParam(params) {
|
|
367
|
-
const tokens = tokenize({ css: params }).filter((token) => token[0] !== TokenType.Whitespace && token[0] !== TokenType.Comment);
|
|
368
|
-
const index = tokens.findIndex((token) => token[0] === TokenType.Function && token[4].value === "source");
|
|
369
|
-
const value = tokens[index + 1];
|
|
370
|
-
if (index < 0 || tokens[index + 2]?.[0] !== TokenType.CloseParen) return;
|
|
371
|
-
if (value?.[0] === TokenType.Ident && value[4].value === "none") return {
|
|
372
|
-
none: true,
|
|
373
|
-
sourcePath: void 0
|
|
374
|
-
};
|
|
375
|
-
return value?.[0] === TokenType.String ? {
|
|
376
|
-
none: false,
|
|
377
|
-
sourcePath: value[4].value
|
|
378
|
-
} : void 0;
|
|
336
|
+
const calculatedWebCss = await applyConfiguredCssCalc(resolvedWebCss, options ?? {});
|
|
337
|
+
return shouldUseUniAppWebRpxCompatibility(options?.appType) ? transformTailwindV4WebRpxCss(calculatedWebCss) : calculatedWebCss;
|
|
379
338
|
}
|
|
380
339
|
//#endregion
|
|
381
340
|
//#region src/tailwindcss/v4-engine/tailwind-v4-default-colors.ts
|
|
@@ -799,58 +758,10 @@ function applyMiniProgramTailwindV4DefaultColorCss(css, source) {
|
|
|
799
758
|
if (insertionIndex === 0) return `${themeCss}\n${css}`;
|
|
800
759
|
return `${css.slice(0, insertionIndex)}\n${themeCss}\n${css.slice(insertionIndex)}`;
|
|
801
760
|
}
|
|
802
|
-
function isTailwindCssPreflightImport(params) {
|
|
803
|
-
const specifier = parseCssImportSpecifier(params)?.specifier;
|
|
804
|
-
return specifier === "tailwindcss/preflight.css" || specifier === "tailwindcss/preflight";
|
|
805
|
-
}
|
|
806
|
-
function removeTailwindV4PreflightImports(css) {
|
|
807
|
-
if (!css.includes("preflight")) return css;
|
|
808
|
-
let root;
|
|
809
|
-
try {
|
|
810
|
-
root = postcss.parse(css);
|
|
811
|
-
} catch {
|
|
812
|
-
return css;
|
|
813
|
-
}
|
|
814
|
-
let changed = false;
|
|
815
|
-
root.walkAtRules("import", (rule) => {
|
|
816
|
-
if (isTailwindCssPreflightImport(rule.params)) {
|
|
817
|
-
rule.remove();
|
|
818
|
-
changed = true;
|
|
819
|
-
}
|
|
820
|
-
});
|
|
821
|
-
return changed ? root.toString() : css;
|
|
822
|
-
}
|
|
823
|
-
function hasThemeParent(rule) {
|
|
824
|
-
let parent = rule.parent;
|
|
825
|
-
while (parent) {
|
|
826
|
-
if (parent.type === "atrule" && parent.name === "theme") return true;
|
|
827
|
-
parent = parent.parent;
|
|
828
|
-
}
|
|
829
|
-
return false;
|
|
830
|
-
}
|
|
831
|
-
function isVendorPrefixedKeyframes(rule) {
|
|
832
|
-
return rule.name.startsWith("-") && rule.name.endsWith("keyframes");
|
|
833
|
-
}
|
|
834
|
-
function removeUnsupportedThemeVendorKeyframes(css) {
|
|
835
|
-
if (!css.includes("@theme") || !css.includes("@-")) return css;
|
|
836
|
-
let root;
|
|
837
|
-
try {
|
|
838
|
-
root = postcss.parse(css);
|
|
839
|
-
} catch {
|
|
840
|
-
return css;
|
|
841
|
-
}
|
|
842
|
-
let changed = false;
|
|
843
|
-
root.walkAtRules((rule) => {
|
|
844
|
-
if (isVendorPrefixedKeyframes(rule) && hasThemeParent(rule)) {
|
|
845
|
-
rule.remove();
|
|
846
|
-
changed = true;
|
|
847
|
-
}
|
|
848
|
-
});
|
|
849
|
-
return changed ? root.toString() : css;
|
|
850
|
-
}
|
|
851
761
|
function createCompatibleSource(source, target) {
|
|
852
762
|
const filteredSourceCss = target === "weapp" ? removeTailwindV4PreflightImports(source.css) : source.css;
|
|
853
|
-
const
|
|
763
|
+
const sourceCss = target === "weapp" ? applyMiniProgramTailwindV4DefaultColorCss(filteredSourceCss, source) : filteredSourceCss;
|
|
764
|
+
const compatibleSourceCss = removeUnsupportedThemeVendorKeyframes(sourceCss);
|
|
854
765
|
return compatibleSourceCss === source.css ? source : {
|
|
855
766
|
...source,
|
|
856
767
|
css: compatibleSourceCss
|
|
@@ -1268,7 +1179,7 @@ async function resolveCssDefinedScanSources(source) {
|
|
|
1268
1179
|
const definitions = [{
|
|
1269
1180
|
css: source.css,
|
|
1270
1181
|
base: source.base,
|
|
1271
|
-
from: source.dependencies[0]
|
|
1182
|
+
...source.dependencies[0] === void 0 ? {} : { from: source.dependencies[0] }
|
|
1272
1183
|
}];
|
|
1273
1184
|
for (const dependency of source.dependencies.slice(1)) {
|
|
1274
1185
|
if (!existsSync(dependency)) continue;
|
|
@@ -1296,20 +1207,14 @@ async function resolveCssDefinedScanSources(source) {
|
|
|
1296
1207
|
});
|
|
1297
1208
|
sourcePatterns.push(...await resolveCssSourceEntries(root, definition.base, "**/*"));
|
|
1298
1209
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
}
|
|
1308
|
-
return [
|
|
1309
|
-
await resolveTailwindSourceEntry(".", importSourceBase, false, "**/*"),
|
|
1310
|
-
...sourcePatterns,
|
|
1311
|
-
...createDefaultIgnoredScanSources(importSourceBase)
|
|
1312
|
-
];
|
|
1210
|
+
let entries;
|
|
1211
|
+
if (importSourceBase) entries = [await resolveTailwindSourceEntry(".", importSourceBase, false, "**/*"), ...sourcePatterns];
|
|
1212
|
+
else if (sourcePatterns.length > 0) entries = normalizeCssDefinedScanSources(source.base, sourcePatterns);
|
|
1213
|
+
else if (hasSourceNone) return false;
|
|
1214
|
+
else if (hasTailwindImport) entries = [await resolveTailwindSourceEntry(".", resolveDefaultSourceBase(source), false, "**/*")];
|
|
1215
|
+
else return;
|
|
1216
|
+
const scanBases = /* @__PURE__ */ new Set([importSourceBase ?? (sourcePatterns.length > 0 ? source.base : resolveDefaultSourceBase(source)), ...entries.filter((entry) => !entry.negated).map((entry) => entry.base)]);
|
|
1217
|
+
return [...entries, ...[...scanBases].flatMap((base) => createDefaultIgnoredScanSources(base))];
|
|
1313
1218
|
}
|
|
1314
1219
|
async function resolveScanSources(source, scanSources) {
|
|
1315
1220
|
if (scanSources !== true) return scanSources;
|
|
@@ -1337,6 +1242,20 @@ function resolveCompiledSourceRoot(source) {
|
|
|
1337
1242
|
return root;
|
|
1338
1243
|
}
|
|
1339
1244
|
//#endregion
|
|
1245
|
+
//#region src/tailwindcss/v4-engine/generator/style-context.ts
|
|
1246
|
+
function resolveGenerationStyleContext(sourceCss, generatedCss, options) {
|
|
1247
|
+
const calc = options?.cssOptions?.cssCalc ?? options?.cssCalc;
|
|
1248
|
+
const include = Array.isArray(calc) ? calc : calc && typeof calc === "object" ? calc.includeCustomProperties : void 0;
|
|
1249
|
+
if (calc !== true && !include?.length) return options;
|
|
1250
|
+
const customPropertyValues = collectCustomPropertyValues(sourceCss);
|
|
1251
|
+
mergeCustomPropertyValues(customPropertyValues, generatedCss);
|
|
1252
|
+
for (const [name, value] of options?.customPropertyValues ?? []) customPropertyValues.set(name, value);
|
|
1253
|
+
return {
|
|
1254
|
+
...options,
|
|
1255
|
+
customPropertyValues
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
//#endregion
|
|
1340
1259
|
//#region src/tailwindcss/v4-engine/generator/engine.ts
|
|
1341
1260
|
function isCssSyntaxError(error) {
|
|
1342
1261
|
return error instanceof Error && error.name === "CssSyntaxError";
|
|
@@ -1383,7 +1302,7 @@ function createTailwindV4Engine$1(source) {
|
|
|
1383
1302
|
}
|
|
1384
1303
|
const sources = Array.isArray(resolvedScanSources) ? resolvedScanSources : [];
|
|
1385
1304
|
const rawCss = restoreRpxLengthCssSelectors(generatedCss, normalizedCandidates.restoreCandidates);
|
|
1386
|
-
const css = await transformTailwindV4CssByTarget(rawCss, target, resolvedStyleOptions);
|
|
1305
|
+
const css = await transformTailwindV4CssByTarget(rawCss, target, resolveGenerationStyleContext(compatibleSource.css, rawCss, resolvedStyleOptions));
|
|
1387
1306
|
return {
|
|
1388
1307
|
classSet: restoreRpxLengthCandidates(classSet, normalizedCandidates.restoreCandidates),
|
|
1389
1308
|
rawCandidates: restoreRpxLengthCandidates(rawCandidates, normalizedCandidates.restoreCandidates),
|
|
@@ -2049,8 +1968,7 @@ function createCssNodeSignature(node) {
|
|
|
2049
1968
|
node.selector,
|
|
2050
1969
|
node.nodes?.map(createCssNodeSignature) ?? null
|
|
2051
1970
|
]);
|
|
2052
|
-
|
|
2053
|
-
return node.toString();
|
|
1971
|
+
return JSON.stringify(["comment", node.text]);
|
|
2054
1972
|
}
|
|
2055
1973
|
function createRuleBodySignature(rule) {
|
|
2056
1974
|
return JSON.stringify(rule.nodes?.map(createCssNodeSignature) ?? []);
|
|
@@ -2058,7 +1976,7 @@ function createRuleBodySignature(rule) {
|
|
|
2058
1976
|
function createRuleAtRuleContextSignature(rule) {
|
|
2059
1977
|
const context = [];
|
|
2060
1978
|
let parent = rule.parent;
|
|
2061
|
-
while (parent && parent.type !== "root"
|
|
1979
|
+
while (parent && parent.type !== "root") {
|
|
2062
1980
|
if (parent.type === "atrule") context.unshift(JSON.stringify([parent.name, parent.params]));
|
|
2063
1981
|
parent = parent.parent;
|
|
2064
1982
|
}
|
|
@@ -2252,6 +2170,7 @@ function filterApplyOnlyGeneratedCss(css, source, options = {}) {
|
|
|
2252
2170
|
});
|
|
2253
2171
|
});
|
|
2254
2172
|
const isVariableRule = rule.nodes?.some((node) => node.type === "decl" && node.prop.startsWith("--"));
|
|
2173
|
+
if (options.preserveRuntimeProperties && isTailwindRuntimePropertyRule(rule)) return;
|
|
2255
2174
|
if (!isApplySelector && (!preserveVariables || !isVariableRule)) rule.remove();
|
|
2256
2175
|
});
|
|
2257
2176
|
root.walkAtRules((rule) => {
|
|
@@ -2334,9 +2253,38 @@ function isTailwindGeneratedThemeScopeSelector(selector) {
|
|
|
2334
2253
|
if (!selectors.every((item) => TAILWIND_GENERATED_THEME_SCOPE_SELECTORS.has(item))) return false;
|
|
2335
2254
|
return selectorSet.size === 2 && selectorSet.has(":root") && selectorSet.has(":host") || selectorSet.size === 4 && selectorSet.has(":host") && selectorSet.has("page") && selectorSet.has(".tw-root") && selectorSet.has("wx-root-portal-content");
|
|
2336
2255
|
}
|
|
2337
|
-
function
|
|
2338
|
-
|
|
2339
|
-
|
|
2256
|
+
function themeDeclarationContext(declaration) {
|
|
2257
|
+
const context = [];
|
|
2258
|
+
let parent = declaration.parent?.parent;
|
|
2259
|
+
while (parent && parent.type !== "root") {
|
|
2260
|
+
if (parent.type === "atrule" && parent.name !== "layer") context.unshift(`@${parent.name} ${parent.params}`);
|
|
2261
|
+
parent = parent.parent;
|
|
2262
|
+
}
|
|
2263
|
+
return context;
|
|
2264
|
+
}
|
|
2265
|
+
function themeDeclarationKey(declaration) {
|
|
2266
|
+
const value = declaration.value.trim().replace(/^(-?)0\.(\d+(?:[a-z]+|%)?)$/i, "$1.$2");
|
|
2267
|
+
return JSON.stringify([
|
|
2268
|
+
themeDeclarationContext(declaration),
|
|
2269
|
+
declaration.prop,
|
|
2270
|
+
value,
|
|
2271
|
+
Boolean(declaration.important)
|
|
2272
|
+
]);
|
|
2273
|
+
}
|
|
2274
|
+
function collectGeneratedThemeDeclarations(source) {
|
|
2275
|
+
const declarations = /* @__PURE__ */ new Set();
|
|
2276
|
+
try {
|
|
2277
|
+
postcss.parse(source).walkRules((rule) => {
|
|
2278
|
+
if (!isTailwindGeneratedThemeScopeSelector(rule.selector.replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").trim())) return;
|
|
2279
|
+
for (const child of rule.nodes ?? []) if (child.type === "decl") declarations.add(themeDeclarationKey(child));
|
|
2280
|
+
});
|
|
2281
|
+
} catch {}
|
|
2282
|
+
return declarations;
|
|
2283
|
+
}
|
|
2284
|
+
/** 同一轮框架恢复共享声明索引;只有遇到根变量时才解析生成产物。 */
|
|
2285
|
+
function createGeneratedThemeDeclarationResolver(source) {
|
|
2286
|
+
let declarations;
|
|
2287
|
+
return () => declarations ?? (declarations = collectGeneratedThemeDeclarations(source));
|
|
2340
2288
|
}
|
|
2341
2289
|
function isTailwindGeneratedPreflightRule(selector, node) {
|
|
2342
2290
|
if (selector === "view,text,::after,::before" || selector === "view, text, ::after, ::before" || selector === "*" || selector === "::after" || selector === "::before" || selector === "::backdrop" || selector === ":host" || selector === "[hidden]:not([hidden=\"until-found\"])" || selector === "[hidden]:not([hidden='until-found'])" || selector === "button,input[type=\"button\"],input[type=\"reset\"],input[type=\"submit\"]" || selector === "button, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"]" || selector === "button,input[type='button'],input[type='reset'],input[type='submit']" || selector === "button, input[type='button'], input[type='reset'], input[type='submit']") return true;
|
|
@@ -2344,7 +2292,7 @@ function isTailwindGeneratedPreflightRule(selector, node) {
|
|
|
2344
2292
|
if (selector === ":host") return node.nodes?.some((child) => child.type === "decl" && child.value?.includes("--theme(")) ?? false;
|
|
2345
2293
|
return false;
|
|
2346
2294
|
}
|
|
2347
|
-
function removeTailwindV4GeneratedUserCssArtifacts(source) {
|
|
2295
|
+
function removeTailwindV4GeneratedUserCssArtifacts(source, generatedSource) {
|
|
2348
2296
|
try {
|
|
2349
2297
|
const root = postcss.parse(source);
|
|
2350
2298
|
let changed = false;
|
|
@@ -2353,9 +2301,27 @@ function removeTailwindV4GeneratedUserCssArtifacts(source) {
|
|
|
2353
2301
|
comment.remove();
|
|
2354
2302
|
changed = true;
|
|
2355
2303
|
});
|
|
2304
|
+
let generatedDeclarations;
|
|
2305
|
+
const overriddenProperties = /* @__PURE__ */ new Set();
|
|
2356
2306
|
root.walkRules((rule) => {
|
|
2357
|
-
const selector = rule.selector.replace(/\s+/g, " ").trim();
|
|
2358
|
-
if (
|
|
2307
|
+
const selector = rule.selector.replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").trim();
|
|
2308
|
+
if (isTailwindGeneratedThemeScopeSelector(selector) || TAILWIND_GENERATED_THEME_SCOPE_SELECTORS.has(selector) && rule.nodes.some((child) => child.type === "decl" && child.prop.startsWith("--"))) {
|
|
2309
|
+
generatedDeclarations ?? (generatedDeclarations = typeof generatedSource === "function" ? generatedSource() : generatedSource ? collectGeneratedThemeDeclarations(generatedSource) : /* @__PURE__ */ new Set());
|
|
2310
|
+
for (const child of [...rule.nodes]) {
|
|
2311
|
+
if (child.type !== "decl") continue;
|
|
2312
|
+
const propertyKey = JSON.stringify([themeDeclarationContext(child), child.prop]);
|
|
2313
|
+
if (generatedDeclarations?.has(themeDeclarationKey(child)) && !overriddenProperties.has(propertyKey)) {
|
|
2314
|
+
child.remove();
|
|
2315
|
+
changed = true;
|
|
2316
|
+
} else overriddenProperties.add(propertyKey);
|
|
2317
|
+
}
|
|
2318
|
+
if (rule.nodes.length === 0) {
|
|
2319
|
+
rule.remove();
|
|
2320
|
+
changed = true;
|
|
2321
|
+
}
|
|
2322
|
+
return;
|
|
2323
|
+
}
|
|
2324
|
+
if (isTailwindGeneratedPreflightRule(selector, rule)) {
|
|
2359
2325
|
rule.remove();
|
|
2360
2326
|
changed = true;
|
|
2361
2327
|
}
|
|
@@ -2619,16 +2585,37 @@ function unwrapMiniProgramCascadeLayers(source) {
|
|
|
2619
2585
|
function hasClassSelector(selector) {
|
|
2620
2586
|
return /(?:^|[^\w-])\.[_a-z\u00A0-\uFFFF\\-]/i.test(selector);
|
|
2621
2587
|
}
|
|
2622
|
-
function collectBareSelectorUserCss(source) {
|
|
2588
|
+
function collectBareSelectorUserCss(source, transformedCss) {
|
|
2623
2589
|
try {
|
|
2624
2590
|
const root = postcss.parse(source);
|
|
2591
|
+
const representedSelectors = /* @__PURE__ */ new Set();
|
|
2592
|
+
const rootSelectors = /* @__PURE__ */ new Set([
|
|
2593
|
+
":root",
|
|
2594
|
+
":host",
|
|
2595
|
+
"page",
|
|
2596
|
+
".tw-root",
|
|
2597
|
+
"wx-root-portal-content"
|
|
2598
|
+
]);
|
|
2599
|
+
const selectorKey = (rule, selector) => {
|
|
2600
|
+
const context = [];
|
|
2601
|
+
let parent = rule.parent;
|
|
2602
|
+
while (parent && parent.type !== "root") {
|
|
2603
|
+
if (parent.type === "atrule") context.unshift(`@${parent.name} ${parent.params}`);
|
|
2604
|
+
parent = parent.parent;
|
|
2605
|
+
}
|
|
2606
|
+
return JSON.stringify([...context, rootSelectors.has(selector.trim()) ? ":root" : selector.trim()]);
|
|
2607
|
+
};
|
|
2608
|
+
if (transformedCss !== void 0) postcss.parse(transformedCss).walkRules((rule) => {
|
|
2609
|
+
for (const selector of rule.selectors) representedSelectors.add(selectorKey(rule, selector));
|
|
2610
|
+
});
|
|
2625
2611
|
let changed = false;
|
|
2626
2612
|
root.walkAtRules("import", (rule) => {
|
|
2627
2613
|
rule.remove();
|
|
2628
2614
|
changed = true;
|
|
2629
2615
|
});
|
|
2630
2616
|
root.walkRules((rule) => {
|
|
2631
|
-
|
|
2617
|
+
const selectors = rule.selectors?.length ? rule.selectors : [rule.selector];
|
|
2618
|
+
if (selectors.some((selector) => hasClassSelector(selector)) || selectors.every((selector) => representedSelectors.has(selectorKey(rule, selector)))) {
|
|
2632
2619
|
rule.remove();
|
|
2633
2620
|
changed = true;
|
|
2634
2621
|
}
|
|
@@ -2674,22 +2661,30 @@ function stripUnmatchedTailwindSourceMediaCloseFragments(source) {
|
|
|
2674
2661
|
//#region src/bundlers/shared/generator-css/user-css/transform.ts
|
|
2675
2662
|
async function transformGeneratorUserCss(source, options) {
|
|
2676
2663
|
if (source.trim().length === 0) return "";
|
|
2677
|
-
if (options.processed)
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2664
|
+
if (options.processed) {
|
|
2665
|
+
const compiledSource = await options.compileAuthorCssFunctions?.(source) ?? source;
|
|
2666
|
+
return stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(removeTailwindV4GeneratorAtRules(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(unwrapMiniProgramCascadeLayers(removeProcessedMiniProgramUnsupportedCss(compiledSource, {
|
|
2667
|
+
...options.generatorStyleOptions,
|
|
2668
|
+
...options.cssUserHandlerOptions
|
|
2669
|
+
})), options.generatedSource) : compiledSource)));
|
|
2670
|
+
}
|
|
2681
2671
|
const cleanedSource = removeTailwindSourceDirectives(removeTailwindV4GeneratorAtRules(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(source))), { importFallback: options.importFallback });
|
|
2682
2672
|
if (cleanedSource.trim().length === 0) return "";
|
|
2683
|
-
const
|
|
2673
|
+
const authorSource = stripUnmatchedTailwindSourceMediaCloseFragments(removeTailwindApplyAtRules(removeTailwindSourceDirectives(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(removeUnsupportedMiniProgramAtRules(unwrapMiniProgramCascadeLayers(stripTailwindBanners(cleanedSource))), options.generatedSource) : cleanedSource)), { importFallback: options.importFallback })));
|
|
2674
|
+
const userSource = await options.compileAuthorCssFunctions?.(authorSource) ?? authorSource;
|
|
2684
2675
|
if (userSource.trim().length === 0) return "";
|
|
2685
2676
|
if (isCommentOnlyCss(userSource)) return userSource;
|
|
2686
|
-
if (options.generatorTarget !== "weapp") return userSource
|
|
2677
|
+
if (options.generatorTarget !== "weapp") return applyConfiguredCssCalc(userSource, {
|
|
2678
|
+
cssCalc: options.generatorStyleOptions.cssOptions?.cssCalc ?? options.generatorStyleOptions.cssCalc ?? options.cssUserHandlerOptions.cssOptions?.cssCalc ?? options.cssUserHandlerOptions.cssCalc,
|
|
2679
|
+
customPropertyValues: options.generatorStyleOptions.customPropertyValues ?? options.cssUserHandlerOptions.customPropertyValues,
|
|
2680
|
+
contextCss: typeof options.generatedSource === "string" ? options.generatedSource : void 0
|
|
2681
|
+
});
|
|
2687
2682
|
const { css } = await options.styleHandler(userSource, {
|
|
2688
2683
|
...options.generatorStyleOptions,
|
|
2689
2684
|
...options.cssUserHandlerOptions
|
|
2690
2685
|
});
|
|
2691
|
-
const transformedCss = removeTailwindV4GeneratedUserCssArtifacts(removeUnsupportedMiniProgramAtRules(css));
|
|
2692
|
-
const bareSelectorUserCss = collectBareSelectorUserCss(userSource);
|
|
2686
|
+
const transformedCss = removeTailwindV4GeneratedUserCssArtifacts(removeUnsupportedMiniProgramAtRules(stripTailwindBanners(css)), options.generatedSource);
|
|
2687
|
+
const bareSelectorUserCss = collectBareSelectorUserCss(userSource, transformedCss);
|
|
2693
2688
|
const missingBareSelectorUserCss = bareSelectorUserCss.trim().length > 0 ? filterExistingCssRules(transformedCss, bareSelectorUserCss) : "";
|
|
2694
2689
|
return missingBareSelectorUserCss.trim().length > 0 ? `${transformedCss}\n${missingBareSelectorUserCss}` : transformedCss;
|
|
2695
2690
|
}
|
|
@@ -2723,6 +2718,11 @@ function normalizeExtendLengthUnits(value) {
|
|
|
2723
2718
|
function normalizeTailwindcssRuntimeOptions(options) {
|
|
2724
2719
|
return options;
|
|
2725
2720
|
}
|
|
2721
|
+
/** 清除可选字段中的 undefined,再交给引擎候选校验与生成契约。 */
|
|
2722
|
+
function resolveRuntimeBareArbitraryValues(options) {
|
|
2723
|
+
const value = resolveTailwindcssOptions(options)?.v4?.bareArbitraryValues;
|
|
2724
|
+
return value && typeof value === "object" ? value.units === void 0 ? {} : { units: value.units } : value;
|
|
2725
|
+
}
|
|
2726
2726
|
//#endregion
|
|
2727
2727
|
//#region src/utils/object.ts
|
|
2728
2728
|
function definedEntries(value) {
|
|
@@ -3340,4 +3340,4 @@ async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
|
3340
3340
|
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
3341
3341
|
}
|
|
3342
3342
|
//#endregion
|
|
3343
|
-
export {
|
|
3343
|
+
export { hasTailwindApplyDirective as $, normalizeStringListOption as A, resolveCssSourceEntries as At, pruneMiniProgramGeneratedCss as B, shouldUseUniAppWebRpxCompatibility as Bt, findWorkspacePackageDir as C, FULL_SOURCE_SCAN_EXTENSION_RE as Ct, normalizeTailwindcssRuntimeOptions as D, isFileMatchedByTailwindSourceEntries as Dt, normalizeExtendLengthUnits as E, isFileExcludedByTailwindSourceEntries as Et, removeTailwindV4GeneratorAtRules as F, transformTailwindV4CssByTarget as Ft, filterApplyOnlyGeneratedCss as G, stripMiniProgramCssSpecificityPlaceholders as H, resolveValidTailwindV4Candidates$1 as Ht, stripTailwindSourceMediaFragments as I, transformTailwindV4CssToWeapp as It, extractGeneratedCssForUserLayerSelectors as J, normalizeEmptyTailwindCustomVariants as K, stripUnmatchedTailwindSourceMediaCloseFragments as L, resolveCssMacroTailwindV4Source as Lt, transformGeneratorUserCss as M, resolveTailwindV4CssSourceBase as Mt, isCommentOnlyCss as N, toPosixPath as Nt, resolveRuntimeBareArbitraryValues as O, normalizeLegacyContentEntries as Ot, removeMiniProgramInteractiveSelectors as P, _defineProperty as Pt, hasLocalCssImport as Q, finalizeMiniProgramCss$1 as R, getTailwindV4IncrementalGenerateCacheStats as Rt, findNearestPackageRoot as S, createTailwindV4Engine$1 as St, omitUndefined as T, expandTailwindSourceEntries as Tt, createGeneratedThemeDeclarationResolver as U, removeUnsupportedMiniProgramAtRules as V, loadTailwindV4DesignSystem as Vt, removeTailwindV4GeneratedUserCssArtifacts as W, splitUserCssLayerBlocks as X, hasUserCssLayerBlocks as Y, preferScopedGeneratedCssRules as Z, upsertTailwindV4CssSource as _, stripGeneratorPlaceholderMarkers as _t, resolveGeneratorRuntimeBranch as a, normalizeTailwindSourceForGenerator as at, isTailwindV4CssEntry as b, normalizeConfigDirective as bt, shouldUseNativeAppCssBranch as c, resolveCssEntrySource as ct, resolveTailwindV4SourceFromRuntime as d, createCssAppend as dt, hasTailwindNonRootGenerationDirectives as et, resolveTailwindV4SourceFromRuntimeOptions as f, hasTailwindGeneratedCss as ft, removeTailwindV4CssSource as g, splitTailwindV4GeneratedCssBySourceOrder as gt, hasConfiguredTailwindV4CssRoots as h, splitTailwindGeneratedCssByBanner as ht, normalizeWeappTailwindcssGeneratorOptions as i, normalizeTailwindSourceDirectives as it, resolveBooleanObjectOption as j, resolveSourceScanPath as jt, resolveTailwindcssOptions as k, parseConfigParam as kt, resolveUniUtsPlatform as l, GENERATOR_PLACEHOLDER_MARKER_RE as lt, filterTailwindV4CssSourceRoots as m, splitGeneratorPlaceholderCssBySourceOrder as mt, createWeappTailwindcssGeneratorFromRuntime as n, hasTailwindSourceDirectives as nt, resolveRuntimeBranch as o, parseImportRequest as ot, resolveTailwindV4SourceOptionsFromRuntime as p, hasTailwindGeneratedCssMarkers as pt, shouldFilterApplyOnlyGeneratedCss as q, resolveTailwindSourceFromRuntime as r, normalizeTailwindConfigDirectives as rt, shouldUseMiniProgramCssBranch as s, removeTailwindSourceDirectives as st, createWeappTailwindcssGenerator as t, hasTailwindRootDirectives as tt, resolveTailwindV4Source$1 as u, VITE_MARKER_RE as ut, groupCssEntriesByBase as v, stripTailwindBanner as vt, findWorkspaceRoot as w, FULL_SOURCE_SCAN_PATTERN as wt, normalizeCssEntries as x, prependConfigDirective as xt, guessBasedirFromEntries as y, stripTailwindBanners as yt, hasMiniProgramCssSpecificityPlaceholders as z, filterUnsupportedMiniProgramTailwindV4Candidates as zt };
|
package/dist/generator.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-Bvr4WmuF.cjs");
|
|
3
3
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
4
4
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
5
5
|
exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
|
package/dist/generator.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Ft as transformTailwindV4CssByTarget, It as transformTailwindV4CssToWeapp, Vt as loadTailwindV4DesignSystem, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-
|
|
1
|
+
import { Ft as transformTailwindV4CssByTarget, It as transformTailwindV4CssToWeapp, Vt as loadTailwindV4DesignSystem, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-C0BJjyLM.js";
|
|
2
2
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromRuntime, loadTailwindV4DesignSystem, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromRuntime, resolveTailwindV4Source, resolveTailwindV4SourceFromRuntime, resolveTailwindV4SourceFromRuntimeOptions, resolveTailwindV4SourceOptionsFromRuntime, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
-
const require_generator = require("./generator-
|
|
3
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
4
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
5
|
-
const require_compiler = require("./compiler-
|
|
2
|
+
const require_generator = require("./generator-Bvr4WmuF.cjs");
|
|
3
|
+
const require_tailwindcss = require("./tailwindcss-CBYjzRmV.cjs");
|
|
4
|
+
const require_v4_generation_core = require("./v4-generation-core-Cz1D7wm1.cjs");
|
|
5
|
+
const require_compiler = require("./compiler-C8FqI-P3.cjs");
|
|
6
6
|
const require_runtime_state = require("./runtime-state-XYSycuGu.cjs");
|
|
7
7
|
const require_cache = require("./cache-CBJFB1HN.cjs");
|
|
8
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
9
|
-
|
|
8
|
+
const require_hmr_timing = require("./hmr-timing-CoiJIqDu.cjs");
|
|
9
|
+
require("./final-css-cleanup-CDTmVAye.cjs");
|
|
10
10
|
let node_fs = require("node:fs");
|
|
11
11
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
12
12
|
let node_path = require("node:path");
|
|
@@ -262,7 +262,7 @@ function createGulpFileTransforms(context) {
|
|
|
262
262
|
const generatedCss = stage === "generate" && generated ? `${require_v4_generation_core.createBundlerGeneratedCssMarker("gulp", file.path)}\n${css}` : css;
|
|
263
263
|
const outputCss = stage === "generate" ? generatedCss : (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(generatedCss, { styleOutputExtension });
|
|
264
264
|
debug("css handle: %s", file.path);
|
|
265
|
-
return { result: stage === "transform" ?
|
|
265
|
+
return { result: stage === "transform" ? (0, _weapp_tailwindcss_postcss.finalizeMiniProgramCssStructure)(outputCss) : outputCss };
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
268
|
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
@@ -286,7 +286,7 @@ function createGulpFileTransforms(context) {
|
|
|
286
286
|
styleOptions: cssHandlerOptions
|
|
287
287
|
}) : handled.css;
|
|
288
288
|
const outputCss = (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(finalized, { styleOutputExtension });
|
|
289
|
-
writeGulpFileAsset(file,
|
|
289
|
+
writeGulpFileAsset(file, (0, _weapp_tailwindcss_postcss.finalizeMiniProgramCssStructure)(outputCss));
|
|
290
290
|
debug("css adapt: %s", file.path);
|
|
291
291
|
}, () => resolveGulpTransformTimingDetails("css:adapt"));
|
|
292
292
|
const transformJs = (options = {}) => createVinylTransform("js", async (file) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as resolveSourceScanEntries, l as getRuntimeClassSetSignature } from "./tailwindcss-
|
|
3
|
-
import { A as
|
|
4
|
-
import { C as createTailwindRuntimeReadyPromise, K as createDebug, L as createCompilationDependencyChanges, M as invalidateCompilationScope, N as recordCompilationDependencyChanges, O as AssetEmissionPlan, a as beginCompilerShadowRun, c as getCompilerShadowRunSnapshot, f as getCompilerContext, i as disposeCompilerOwner, j as getCompilationScopeDependencyRevision, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, v as shouldSkipJsTransform, w as ensureRuntimeClassSet } from "./compiler-
|
|
5
|
-
import { i as buildRuntimeCompilationSnapshot, l as updateRuntimeCompilationBuildState, o as createRuntimeCompilationBuildState, r as processCachedTask, s as removeRuntimeCompilationBuildStateFiles, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-
|
|
1
|
+
import { Rt as getTailwindV4IncrementalGenerateCacheStats, _ as upsertTailwindV4CssSource, at as normalizeTailwindSourceForGenerator, g as removeTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, rt as normalizeTailwindConfigDirectives, tt as hasTailwindRootDirectives, xt as prependConfigDirective } from "./generator-C0BJjyLM.js";
|
|
2
|
+
import { f as resolveSourceScanEntries, l as getRuntimeClassSetSignature } from "./tailwindcss-B_4E52WF.js";
|
|
3
|
+
import { A as annotateCssSourceTrace, B as finalizeCompilerShadowRun, D as hasBundlerGeneratedCssMarker, E as createBundlerGeneratedCssMarker, M as createCssTokenSourceMap, P as createRuntimeClassSetManager, R as rewriteLocalCssImportRequestsForOutput, V as createSourceCandidateCollector, b as finalizeMiniProgramGeneratorCss, j as createCssSourceTraceCacheSignature, k as stripBundlerGeneratedCssMarkers, n as emitHmrTiming, r as generateTailwindV4Css, z as splitLocalCssImports } from "./hmr-timing-B9Yt86-U.js";
|
|
4
|
+
import { C as createTailwindRuntimeReadyPromise, K as createDebug, L as createCompilationDependencyChanges, M as invalidateCompilationScope, N as recordCompilationDependencyChanges, O as AssetEmissionPlan, a as beginCompilerShadowRun, c as getCompilerShadowRunSnapshot, f as getCompilerContext, i as disposeCompilerOwner, j as getCompilationScopeDependencyRevision, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, v as shouldSkipJsTransform, w as ensureRuntimeClassSet } from "./compiler-D3GBwxoa.js";
|
|
5
|
+
import { i as buildRuntimeCompilationSnapshot, l as updateRuntimeCompilationBuildState, o as createRuntimeCompilationBuildState, r as processCachedTask, s as removeRuntimeCompilationBuildStateFiles, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-u_sI2p56.js";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|
package/dist/gulp.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_gulp = require("./gulp-
|
|
2
|
+
const require_gulp = require("./gulp-BExe5RBF.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_gulp.createPlugins;
|
|
4
4
|
exports.createPlugins = require_gulp.createPlugins;
|
|
5
5
|
exports.weappTailwindcss = require_gulp.createPlugins;
|
package/dist/gulp.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPlugins } from "./gulp-
|
|
1
|
+
import { t as createPlugins } from "./gulp-BhkIIk7J.js";
|
|
2
2
|
export { createPlugins as WeappTailwindcss, createPlugins, createPlugins as weappTailwindcss };
|