weapp-tailwindcss 5.0.12 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/auto-Ba6hDrse.mjs +13 -0
- package/dist/auto-DtU6f3X6.js +18 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/directives.d.ts +2 -1
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +27 -10
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-files.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/source-resolver/config.d.ts +7 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +15 -0
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +22 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +6 -23
- package/dist/bundlers/shared/generator-css/types.d.ts +15 -1
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -1
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -0
- package/dist/bundlers/shared/run-tasks.d.ts +1 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +11 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
- package/dist/bundlers/vite/css-memory.d.ts +37 -0
- package/dist/bundlers/vite/generate-bundle/bundle-file-names.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +0 -1
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +9 -7
- package/dist/bundlers/vite/generate-bundle/env-flags.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +12 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +63 -0
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +31 -0
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +80 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +53 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/runtime-linked-css.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +21 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +5 -2
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +30 -0
- package/dist/bundlers/vite/generate-bundle/timing.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +3 -1
- package/dist/bundlers/vite/generate-bundle/uni-app-x-postprocess.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/vite-css-cache.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +4 -1
- package/dist/bundlers/vite/hot-css-modules.d.ts +5 -0
- package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +1 -0
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +3 -3
- package/dist/bundlers/vite/map-cache.d.ts +2 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +16 -0
- package/dist/bundlers/vite/resolve-app-type.d.ts +1 -2
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +5 -5
- package/dist/bundlers/vite/source-candidate-scan-signature.d.ts +13 -0
- package/dist/bundlers/vite/source-candidates/script.d.ts +1 -7
- package/dist/bundlers/vite/source-candidates.d.ts +12 -2
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +3 -6
- package/dist/bundlers/vite/source-scan.d.ts +3 -3
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +1 -1
- package/dist/bundlers/vite/utils.d.ts +1 -0
- package/dist/bundlers/vite/weapp-vite-config.d.ts +3 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +24 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -10
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +28 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +5 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +15 -1
- package/dist/bundlers/webpack/shared/css-loader-runtime.d.ts +1 -0
- package/dist/cache/index.d.ts +1 -0
- package/dist/cli/mount-options.d.ts +2 -2
- package/dist/cli.js +126 -439
- package/dist/cli.mjs +121 -434
- package/dist/context/index.d.ts +3 -3
- package/dist/context/style-options.d.ts +4 -1
- package/dist/context/tailwindcss.d.ts +1 -1
- package/dist/{precheck-30zNPRlI.js → context-BHxLe743.js} +484 -175
- package/dist/{precheck-CsFr1q2l.mjs → context-Mbzkek1q.mjs} +461 -159
- package/dist/core.js +15 -12
- package/dist/core.mjs +10 -7
- package/dist/css-macro.js +2 -2
- package/dist/css-macro.mjs +2 -2
- package/dist/{defaults-Boc26eel.js → defaults-CVcKbXBG.js} +6 -50
- package/dist/{defaults-DH0ZQRhy.mjs → defaults-ZElj1zKc.mjs} +7 -45
- package/dist/defaults.d.ts +1 -7
- package/dist/defaults.js +1 -2
- package/dist/defaults.mjs +2 -2
- package/dist/framework/index.d.ts +59 -0
- package/dist/framework.d.ts +1 -0
- package/dist/framework.js +198 -0
- package/dist/framework.mjs +180 -0
- package/dist/generator/index.d.ts +6 -7
- package/dist/generator/options.d.ts +3 -3
- package/dist/generator/types.d.ts +9 -10
- package/dist/generator-9rUz4Hcb.js +170 -0
- package/dist/generator-Dc4qaPmT.mjs +123 -0
- package/dist/generator.js +10 -16
- package/dist/generator.mjs +3 -3
- package/dist/{gulp-CxGZU0-v.js → gulp-B_sdP6dx.js} +80 -92
- package/dist/{gulp-BfZpaYSQ.mjs → gulp-uM36oIJs.mjs} +73 -85
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DNjF8bWA.mjs → hmr-timing-BXMLsF4b.mjs} +1289 -909
- package/dist/{hmr-timing-DFR51wgo.js → hmr-timing-CogqkFaF.js} +1397 -939
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -4
- package/dist/index.mjs +6 -5
- package/dist/js/fast-path/oxc.d.ts +4 -0
- package/dist/js/precheck.d.ts +1 -0
- package/dist/postcss.js +3 -4
- package/dist/postcss.mjs +2 -3
- package/dist/presets.js +10 -20
- package/dist/presets.mjs +9 -19
- package/dist/runtime-branch/create-branch.d.ts +2 -0
- package/dist/runtime-branch/generator-target-env.d.ts +4 -0
- package/dist/runtime-branch/index.d.ts +6 -0
- package/dist/runtime-branch/mini-program.d.ts +2 -0
- package/dist/runtime-branch/native-app.d.ts +2 -0
- package/dist/runtime-branch/platform.d.ts +6 -0
- package/dist/runtime-branch/tailwind-version.d.ts +2 -0
- package/dist/runtime-branch/types.d.ts +37 -0
- package/dist/runtime-branch/web.d.ts +2 -0
- package/dist/runtime-branch.d.ts +1 -0
- package/dist/{bundle-state-DU2ATDhw.js → source-candidate-scan-signature-2ybpptAK.js} +262 -20
- package/dist/{bundle-state-BxMNKjBV.mjs → source-candidate-scan-signature-Cvb5z1ha.mjs} +187 -17
- package/dist/tailwindcss/candidates.d.ts +7 -0
- package/dist/tailwindcss/index.d.ts +2 -2
- package/dist/tailwindcss/runtime/cache.d.ts +6 -6
- package/dist/tailwindcss/runtime-factory.d.ts +12 -0
- package/dist/tailwindcss/runtime-options.d.ts +8 -0
- package/dist/tailwindcss/runtime-types.d.ts +86 -0
- package/dist/tailwindcss/runtime.d.ts +6 -6
- package/dist/tailwindcss/source-scan.d.ts +1 -1
- package/dist/tailwindcss/targets.d.ts +2 -2
- package/dist/tailwindcss/v4/config.d.ts +3 -3
- package/dist/tailwindcss/v4/css-entries.d.ts +1 -0
- package/dist/tailwindcss/v4/css-sources.d.ts +4 -2
- package/dist/tailwindcss/v4/index.d.ts +1 -1
- package/dist/tailwindcss/v4/multi-runtime.d.ts +2 -0
- package/dist/tailwindcss/v4/runtime-factory.d.ts +15 -0
- package/dist/tailwindcss/v4/runtime-options.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +3 -3
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator.d.ts +10 -3
- package/dist/tailwindcss/v4-engine/index.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +7 -1
- package/dist/tailwindcss/v4-engine/source.d.ts +23 -6
- package/dist/tailwindcss/v4-engine/types.d.ts +8 -9
- package/dist/tailwindcss/version.d.ts +1 -1
- package/dist/tailwindcss-DHIYcqXT.js +1523 -0
- package/dist/tailwindcss-wyUHrfil.mjs +1418 -0
- package/dist/{transform-CaVEBOuR.js → transform-CQVOgmzM.js} +45 -37
- package/dist/{transform-Cju08-aJ.mjs → transform-tExdt40m.mjs} +30 -22
- package/dist/typedoc.export.d.ts +1 -1
- package/dist/types/index.d.ts +16 -17
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/{typedoc-tailwindcss-patch.d.ts → typedoc-tailwindcss-runtime.d.ts} +4 -10
- package/dist/types/user-defined-options/general.d.ts +8 -4
- package/dist/types/user-defined-options/important.d.ts +2 -2
- package/dist/uni-app-x/style-asset.d.ts +1 -0
- package/dist/{utils-Dolmt8EO.js → utils-BCa37Wqj.js} +2 -17
- package/dist/{utils-DsaS975I.mjs → utils-DodxWHGz.mjs} +2 -17
- package/dist/v4-engine-CF9zt4Cw.mjs +2396 -0
- package/dist/v4-engine-D4ubP7N5.js +2778 -0
- package/dist/{vite-BBGOjh9e.js → vite-CP0ylSxZ.js} +2887 -1683
- package/dist/{vite-CS5DE-HD.mjs → vite-CPO83EhA.mjs} +2753 -1548
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +5741 -4396
- package/dist/weapp-tw-runtime-classset-loader.js +36 -0
- package/dist/webpack-Bsek8VhR.js +2094 -0
- package/dist/webpack-BzqhJ8yK.mjs +2082 -0
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +11 -7
- package/dist/auto-CTp6wE5a.js +0 -33
- package/dist/auto-Cl8_hsG6.mjs +0 -22
- package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +0 -13
- package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +0 -1
- package/dist/context/tailwindcss/rax.d.ts +0 -2
- package/dist/generator-Cb1Zp3Al.js +0 -92
- package/dist/generator-mvNFUvns.mjs +0 -67
- package/dist/tailwindcss/patcher-options.d.ts +0 -8
- package/dist/tailwindcss/patcher.d.ts +0 -12
- package/dist/tailwindcss/runtime-patch.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +0 -3
- package/dist/tailwindcss/v3-engine/generator/content.d.ts +0 -10
- package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +0 -2
- package/dist/tailwindcss/v3-engine/generator.d.ts +0 -19
- package/dist/tailwindcss/v3-engine/index.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/miniprogram.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/source.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/types.d.ts +0 -61
- package/dist/tailwindcss/v4/multi-patcher.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher-options.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher.d.ts +0 -15
- package/dist/tailwindcss/v4-engine/tailwind-v3-compatibility.d.ts +0 -1
- package/dist/tailwindcss/v4-engine/tailwind-v3-default-colors.d.ts +0 -1
- package/dist/tailwindcss-CK84uGBp.mjs +0 -556
- package/dist/tailwindcss-Clpkz1oR.js +0 -613
- package/dist/v3-engine-CQE5JJNZ.js +0 -4639
- package/dist/v3-engine-DKBaKWGL.mjs +0 -4231
- package/dist/webpack-DIWrcpRo.js +0 -1066
- package/dist/webpack-SPcri_D8.mjs +0 -1054
- /package/dist/tailwindcss/{patcher-resolve.d.ts → runtime-resolve.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_framework = require("./framework.js");
|
|
3
|
+
const require_generator = require("./generator-9rUz4Hcb.js");
|
|
4
|
+
const require_gulp = require("./gulp-B_sdP6dx.js");
|
|
4
5
|
const require_postcss = require("./postcss.js");
|
|
5
|
-
const require_vite = require("./vite-
|
|
6
|
-
const require_webpack = require("./webpack-
|
|
6
|
+
const require_vite = require("./vite-CP0ylSxZ.js");
|
|
7
|
+
const require_webpack = require("./webpack-Bsek8VhR.js");
|
|
7
8
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
8
9
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
9
10
|
exports.createPlugins = require_gulp.createPlugins;
|
|
10
11
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
12
|
+
exports.detectAppType = require_framework.detectAppType;
|
|
13
|
+
exports.detectAppTypeFromEnv = require_framework.detectAppTypeFromEnv;
|
|
14
|
+
exports.detectAppTypeFromPackageJson = require_framework.detectAppTypeFromPackageJson;
|
|
15
|
+
exports.isMpxPackage = require_framework.isMpxPackage;
|
|
16
|
+
exports.isRunningInHBuilderX = require_framework.isRunningInHBuilderX;
|
|
17
|
+
exports.isTaroPackage = require_framework.isTaroPackage;
|
|
18
|
+
exports.isUniAppPackage = require_framework.isUniAppPackage;
|
|
19
|
+
exports.isUniAppVitePackage = require_framework.isUniAppVitePackage;
|
|
20
|
+
exports.isUniAppXManifest = require_framework.isUniAppXManifest;
|
|
21
|
+
exports.isUniAppXPackage = require_framework.isUniAppXPackage;
|
|
22
|
+
exports.isWeappVitePackage = require_framework.isWeappVitePackage;
|
|
23
|
+
exports.resolveImplicitAppTypeFromViteRoot = require_framework.resolveImplicitAppTypeFromViteRoot;
|
|
24
|
+
exports.resolveUniPlatform = require_framework.resolveUniPlatform;
|
|
25
|
+
exports.resolveUniPlatformsFromEnv = require_framework.resolveUniPlatformsFromEnv;
|
|
26
|
+
exports.resolveUniUtsPlatform = require_framework.resolveUniUtsPlatform;
|
|
11
27
|
Object.defineProperty(exports, "unitConversionComposeRules", {
|
|
12
28
|
enumerable: true,
|
|
13
29
|
get: function() {
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform } from "./framework.mjs";
|
|
2
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-Dc4qaPmT.mjs";
|
|
3
|
+
import { t as createPlugins } from "./gulp-uM36oIJs.mjs";
|
|
3
4
|
import weappTailwindcssPostcssPlugin from "./postcss.mjs";
|
|
4
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
5
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
5
|
+
import { t as WeappTailwindcss } from "./vite-CPO83EhA.mjs";
|
|
6
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-BzqhJ8yK.mjs";
|
|
6
7
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
7
|
-
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
|
8
|
+
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IJsHandlerOptions, JsHandlerResult } from '../../types';
|
|
2
|
+
export declare function isOxcParserRuntimeSupported(version?: string): boolean;
|
|
3
|
+
export declare function canUseOxcJsFastPath(options: IJsHandlerOptions): boolean;
|
|
4
|
+
export declare function oxcJsHandler(rawSource: string, options: IJsHandlerOptions): JsHandlerResult | undefined;
|
package/dist/js/precheck.d.ts
CHANGED
package/dist/postcss.js
CHANGED
|
@@ -2,15 +2,14 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
const require_generator = require("./generator-
|
|
5
|
+
const require_v4_engine = require("./v4-engine-D4ubP7N5.js");
|
|
6
|
+
const require_generator = require("./generator-9rUz4Hcb.js");
|
|
7
7
|
const weappTailwindcssPostcssPlugin = (0, require("@weapp-tailwindcss/postcss").createWeappTailwindcssPostcssPlugin)({
|
|
8
8
|
createGenerator: (source) => {
|
|
9
9
|
return require_generator.createWeappTailwindcssGenerator(source);
|
|
10
10
|
},
|
|
11
11
|
normalizeGeneratorOptions: (options) => require_generator.normalizeWeappTailwindcssGeneratorOptions(options),
|
|
12
|
-
|
|
13
|
-
resolveTailwindV4Source: (options) => require_v3_engine.resolveTailwindV4Source(options)
|
|
12
|
+
resolveTailwindV4Source: (options) => require_v4_engine.resolveTailwindV4Source(options)
|
|
14
13
|
});
|
|
15
14
|
//#endregion
|
|
16
15
|
exports.default = weappTailwindcssPostcssPlugin;
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { t as resolveTailwindV4Source } from "./v4-engine-CF9zt4Cw.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-Dc4qaPmT.mjs";
|
|
3
3
|
import { createWeappTailwindcssPostcssPlugin } from "@weapp-tailwindcss/postcss";
|
|
4
4
|
const weappTailwindcssPostcssPlugin = createWeappTailwindcssPostcssPlugin({
|
|
5
5
|
createGenerator: (source) => {
|
|
6
6
|
return createWeappTailwindcssGenerator(source);
|
|
7
7
|
},
|
|
8
8
|
normalizeGeneratorOptions: (options) => normalizeWeappTailwindcssGeneratorOptions(options),
|
|
9
|
-
resolveTailwindV3Source: (options) => resolveTailwindV3Source(options),
|
|
10
9
|
resolveTailwindV4Source: (options) => resolveTailwindV4Source(options)
|
|
11
10
|
});
|
|
12
11
|
//#endregion
|
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-emK7D4bc.js");
|
|
3
|
-
const
|
|
4
|
-
const require_utils = require("./utils-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
3
|
+
const require_v4_engine = require("./v4-engine-D4ubP7N5.js");
|
|
4
|
+
const require_utils = require("./utils-BCa37Wqj.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-DHIYcqXT.js");
|
|
6
6
|
require("./logger-TlKT3xmR.js");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -21,19 +21,15 @@ function createBasePreset(options = {}) {
|
|
|
21
21
|
const { base, cssEntries, resolve, rawOptions, ...userOptions } = options;
|
|
22
22
|
const baseDir = require_tailwindcss.resolveTailwindcssBasedir(base);
|
|
23
23
|
const normalizedCssEntries = normalizeCssEntries(cssEntries);
|
|
24
|
-
const tailwindConfig = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
base: baseDir,
|
|
29
|
-
cssEntries: normalizedCssEntries
|
|
30
|
-
})
|
|
31
|
-
};
|
|
24
|
+
const tailwindConfig = { v4: require_v4_engine.omitUndefined({
|
|
25
|
+
base: baseDir,
|
|
26
|
+
cssEntries: normalizedCssEntries
|
|
27
|
+
}) };
|
|
32
28
|
if (normalizedCssEntries && normalizedCssEntries.length > 0) tailwindConfig.version = 4;
|
|
33
29
|
const preset = {
|
|
34
30
|
tailwindcssBasedir: baseDir,
|
|
35
31
|
tailwindcss: tailwindConfig,
|
|
36
|
-
|
|
32
|
+
tailwindcssRuntimeOptions: {
|
|
37
33
|
projectRoot: baseDir,
|
|
38
34
|
tailwindcss: resolve ? {
|
|
39
35
|
...tailwindConfig,
|
|
@@ -85,11 +81,6 @@ function resolveInstalledTailwindDefaults(resolve) {
|
|
|
85
81
|
packageName: "tailwindcss",
|
|
86
82
|
postcssPlugin: "@tailwindcss/postcss"
|
|
87
83
|
};
|
|
88
|
-
if (major === 3) return {
|
|
89
|
-
version: 3,
|
|
90
|
-
packageName: "tailwindcss",
|
|
91
|
-
postcssPlugin: "tailwindcss"
|
|
92
|
-
};
|
|
93
84
|
}
|
|
94
85
|
function uniAppX(options) {
|
|
95
86
|
_weapp_tailwindcss_logger.logger.info(`UNI_PLATFORM: ${node_process.default.env["UNI_PLATFORM"]}`);
|
|
@@ -115,14 +106,13 @@ function uniAppX(options) {
|
|
|
115
106
|
unitConversion: options.unitConversion,
|
|
116
107
|
appType: "uni-app-x",
|
|
117
108
|
tailwindcssBasedir: options.base,
|
|
118
|
-
|
|
109
|
+
tailwindcssRuntimeOptions: {
|
|
119
110
|
projectRoot: options.base,
|
|
120
111
|
tailwindcss: {
|
|
121
112
|
...installedTailwindDefaults ?? {},
|
|
122
113
|
cwd: options.base,
|
|
123
114
|
resolve: resolvedResolve,
|
|
124
|
-
|
|
125
|
-
v4: require_v3_engine.omitUndefined({
|
|
115
|
+
v4: require_v4_engine.omitUndefined({
|
|
126
116
|
base: options.base,
|
|
127
117
|
cssEntries
|
|
128
118
|
})
|
package/dist/presets.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
1
|
+
import { ct as omitUndefined } from "./v4-engine-CF9zt4Cw.mjs";
|
|
2
|
+
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DodxWHGz.mjs";
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-wyUHrfil.mjs";
|
|
4
4
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process from "node:process";
|
|
@@ -15,19 +15,15 @@ function createBasePreset(options = {}) {
|
|
|
15
15
|
const { base, cssEntries, resolve, rawOptions, ...userOptions } = options;
|
|
16
16
|
const baseDir = resolveTailwindcssBasedir(base);
|
|
17
17
|
const normalizedCssEntries = normalizeCssEntries(cssEntries);
|
|
18
|
-
const tailwindConfig = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
base: baseDir,
|
|
23
|
-
cssEntries: normalizedCssEntries
|
|
24
|
-
})
|
|
25
|
-
};
|
|
18
|
+
const tailwindConfig = { v4: omitUndefined({
|
|
19
|
+
base: baseDir,
|
|
20
|
+
cssEntries: normalizedCssEntries
|
|
21
|
+
}) };
|
|
26
22
|
if (normalizedCssEntries && normalizedCssEntries.length > 0) tailwindConfig.version = 4;
|
|
27
23
|
const preset = {
|
|
28
24
|
tailwindcssBasedir: baseDir,
|
|
29
25
|
tailwindcss: tailwindConfig,
|
|
30
|
-
|
|
26
|
+
tailwindcssRuntimeOptions: {
|
|
31
27
|
projectRoot: baseDir,
|
|
32
28
|
tailwindcss: resolve ? {
|
|
33
29
|
...tailwindConfig,
|
|
@@ -79,11 +75,6 @@ function resolveInstalledTailwindDefaults(resolve) {
|
|
|
79
75
|
packageName: "tailwindcss",
|
|
80
76
|
postcssPlugin: "@tailwindcss/postcss"
|
|
81
77
|
};
|
|
82
|
-
if (major === 3) return {
|
|
83
|
-
version: 3,
|
|
84
|
-
packageName: "tailwindcss",
|
|
85
|
-
postcssPlugin: "tailwindcss"
|
|
86
|
-
};
|
|
87
78
|
}
|
|
88
79
|
function uniAppX(options) {
|
|
89
80
|
logger.info(`UNI_PLATFORM: ${process.env["UNI_PLATFORM"]}`);
|
|
@@ -109,13 +100,12 @@ function uniAppX(options) {
|
|
|
109
100
|
unitConversion: options.unitConversion,
|
|
110
101
|
appType: "uni-app-x",
|
|
111
102
|
tailwindcssBasedir: options.base,
|
|
112
|
-
|
|
103
|
+
tailwindcssRuntimeOptions: {
|
|
113
104
|
projectRoot: options.base,
|
|
114
105
|
tailwindcss: {
|
|
115
106
|
...installedTailwindDefaults ?? {},
|
|
116
107
|
cwd: options.base,
|
|
117
108
|
resolve: resolvedResolve,
|
|
118
|
-
v3: { cwd: options.base },
|
|
119
109
|
v4: omitUndefined({
|
|
120
110
|
base: options.base,
|
|
121
111
|
cssEntries
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { RuntimeBranch, RuntimeBranchBaseContext, RuntimePlatformFamily } from './types';
|
|
2
|
+
export declare function createRuntimeBranch(base: RuntimeBranchBaseContext, platformFamily: RuntimePlatformFamily, options: Pick<RuntimeBranch, 'platform'> & Partial<Pick<RuntimeBranch, 'nativeAppPlatform'>>): RuntimeBranch;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WeappTailwindcssGeneratorTarget } from './types';
|
|
2
|
+
export declare const generatorTargetEnvKeys: readonly ["UNI_PLATFORM", "UNI_UTS_PLATFORM", "MPX_CLI_MODE", "MPX_CURRENT_TARGET_MODE", "TARO_ENV", "WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
|
|
3
|
+
export declare function shouldUseWebGeneratorTargetFromEnv(): boolean;
|
|
4
|
+
export declare function inferGeneratorTargetFromEnv(): WeappTailwindcssGeneratorTarget;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RuntimeBranch, RuntimeBranchContext, RuntimeBranchGeneratorOptions } from './types';
|
|
2
|
+
export declare function resolveRuntimeBranch(context: RuntimeBranchContext): RuntimeBranch;
|
|
3
|
+
export declare function resolveGeneratorRuntimeBranch(options: RuntimeBranchGeneratorOptions, context?: Omit<RuntimeBranchContext, 'generatorTarget'>): RuntimeBranch;
|
|
4
|
+
export declare function shouldUseMiniProgramCssBranch(branch: RuntimeBranch): boolean;
|
|
5
|
+
export declare function shouldUseNativeAppCssBranch(branch: RuntimeBranch): boolean;
|
|
6
|
+
export type { NativeAppPlatform, RuntimeBranch, RuntimeBranchContext, RuntimeBranchGeneratorOptions, RuntimePlatformFamily, TailwindcssBranchVersion, } from './types';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NativeAppPlatform, RuntimeBranchContext } from './types';
|
|
2
|
+
import type { UniUtsPlatformInfo } from '../utils';
|
|
3
|
+
export declare function isRuntimeUniAppXEnabled(value: RuntimeBranchContext['uniAppX']): boolean;
|
|
4
|
+
export declare function normalizeRuntimeUniUtsPlatform(value: RuntimeBranchContext['uniUtsPlatform']): UniUtsPlatformInfo;
|
|
5
|
+
export declare function resolveNativeAppPlatform(platform: UniUtsPlatformInfo): NativeAppPlatform;
|
|
6
|
+
export declare function resolveExplicitOrEnvPlatform(context: RuntimeBranchContext, uniUtsPlatform: UniUtsPlatformInfo): string | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { AppType } from '../types/shared';
|
|
3
|
+
import type { UniUtsPlatformInfo } from '../utils';
|
|
4
|
+
export type TailwindcssBranchVersion = 4;
|
|
5
|
+
export type RuntimePlatformFamily = 'web' | 'mini-program' | 'native-app';
|
|
6
|
+
export type NativeAppPlatform = 'android' | 'ios' | 'harmony' | 'unknown';
|
|
7
|
+
export type WeappTailwindcssGeneratorTarget = 'weapp' | 'web';
|
|
8
|
+
export interface RuntimeBranchContext {
|
|
9
|
+
appType?: AppType | undefined;
|
|
10
|
+
generatorTarget: WeappTailwindcssGeneratorTarget;
|
|
11
|
+
platform?: IStyleHandlerOptions['platform'] | undefined;
|
|
12
|
+
tailwindcssMajorVersion?: number | undefined;
|
|
13
|
+
uniAppX?: boolean | {
|
|
14
|
+
enabled?: boolean | undefined;
|
|
15
|
+
} | undefined;
|
|
16
|
+
uniUtsPlatform?: string | UniUtsPlatformInfo | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface RuntimeBranch {
|
|
19
|
+
tailwindcssVersion: TailwindcssBranchVersion;
|
|
20
|
+
generatorTarget: WeappTailwindcssGeneratorTarget;
|
|
21
|
+
platformFamily: RuntimePlatformFamily;
|
|
22
|
+
platform: string | undefined;
|
|
23
|
+
nativeAppPlatform?: NativeAppPlatform | undefined;
|
|
24
|
+
isTailwindV4: boolean;
|
|
25
|
+
isWeb: boolean;
|
|
26
|
+
isMiniProgram: boolean;
|
|
27
|
+
isNativeApp: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface RuntimeBranchGeneratorOptions {
|
|
30
|
+
target: WeappTailwindcssGeneratorTarget;
|
|
31
|
+
branch?: RuntimeBranch | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface RuntimeBranchBaseContext {
|
|
34
|
+
context: RuntimeBranchContext;
|
|
35
|
+
tailwindcssVersion: TailwindcssBranchVersion;
|
|
36
|
+
uniUtsPlatform: UniUtsPlatformInfo;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './runtime-branch/index';
|