weapp-tailwindcss 5.0.0-next.20 → 5.0.0-next.22

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.
Files changed (53) hide show
  1. package/dist/{bundle-state-BlXvU4jl.js → bundle-state-BnV8o2Yn.js} +1 -1
  2. package/dist/{bundle-state-PO6MysTJ.mjs → bundle-state-CLnuf2CW.mjs} +1 -1
  3. package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -2
  4. package/dist/bundlers/shared/css-cleanup.d.ts +1 -8
  5. package/dist/core.js +1 -1
  6. package/dist/core.mjs +1 -1
  7. package/dist/{generator-N4jy1HCk.js → generator-CV_APjnB.js} +33 -5
  8. package/dist/generator-DPX8vA2P.mjs +58 -0
  9. package/dist/generator.js +2 -2
  10. package/dist/generator.mjs +2 -2
  11. package/dist/gulp.js +5 -5
  12. package/dist/gulp.mjs +5 -5
  13. package/dist/{incremental-runtime-class-set-CJ0Pnsw2.js → incremental-runtime-class-set-C6akmwlk.js} +11 -433
  14. package/dist/{incremental-runtime-class-set-hF-uiw6W.mjs → incremental-runtime-class-set-Cwpw6aZK.mjs} +5 -427
  15. package/dist/index.js +4 -4
  16. package/dist/index.mjs +4 -4
  17. package/dist/{postcss-DlY-YRvA.js → postcss-Csaggbm7.js} +2 -2
  18. package/dist/{postcss-D4UdbBQ6.mjs → postcss-ioX7S9x5.mjs} +2 -2
  19. package/dist/postcss.js +1 -1
  20. package/dist/postcss.mjs +1 -1
  21. package/dist/{precheck-BjEbVEpX.js → precheck-8pQbjqpq.js} +2 -2
  22. package/dist/{precheck-tbk626YL.mjs → precheck-D1O5AWzy.mjs} +2 -2
  23. package/dist/presets.js +2 -2
  24. package/dist/presets.mjs +2 -2
  25. package/dist/{runtime-registry-D5qnaSpo.js → runtime-registry-CdCV3Opt.js} +0 -20
  26. package/dist/{source-candidates-gxijpPI3.js → source-candidates-CUTNdsiz.js} +1 -1
  27. package/dist/{source-candidates-BrvneDDd.mjs → source-candidates-CnD4vyic.mjs} +1 -1
  28. package/dist/tailwindcss/miniprogram.d.ts +1 -5
  29. package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -2
  30. package/dist/{tailwindcss-c6ROlNNW.mjs → tailwindcss-B_JAdOQf.mjs} +1 -1
  31. package/dist/{tailwindcss-BhG7BtB-.js → tailwindcss-whZE3HpL.js} +1 -1
  32. package/dist/{v3-engine-5LoZUH-4.js → v3-engine-CCwvhRrQ.js} +2 -224
  33. package/dist/{v3-engine-DIXDEDmL.mjs → v3-engine-DyIcbpZm.mjs} +2 -218
  34. package/dist/{vite-B5faZcbE.mjs → vite-BcXuBYy3.mjs} +7 -7
  35. package/dist/{vite-MyXBNux0.js → vite-k4Nlk42j.js} +7 -7
  36. package/dist/vite.js +1 -1
  37. package/dist/vite.mjs +1 -1
  38. package/dist/weapp-tw-css-import-rewrite-loader.js +42 -641
  39. package/dist/weapp-tw-runtime-classset-loader.js +3 -2
  40. package/dist/{webpack-BnVyDmsD.mjs → webpack-C4pViZ7V.mjs} +5 -5
  41. package/dist/{webpack-Mz1V0A9p.js → webpack-DC7v6ylA.js} +5 -5
  42. package/dist/webpack.js +1 -1
  43. package/dist/webpack.mjs +1 -1
  44. package/package.json +7 -7
  45. package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +0 -3
  46. package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +0 -5
  47. package/dist/bundlers/shared/css-cleanup/selectors.d.ts +0 -8
  48. package/dist/generator-DIuglJub.mjs +0 -32
  49. package/dist/lightningcss/index.d.ts +0 -8
  50. package/dist/lightningcss/style-handler/options.d.ts +0 -3
  51. package/dist/lightningcss/style-handler/selector-transform.d.ts +0 -10
  52. package/dist/lightningcss/style-handler/selector-utils.d.ts +0 -10
  53. package/dist/lightningcss/style-handler.d.ts +0 -17
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-8l464Juk.js");
2
- const require_precheck = require("./precheck-BjEbVEpX.js");
2
+ const require_precheck = require("./precheck-8pQbjqpq.js");
3
3
  let node_module = require("node:module");
4
4
  let node_path = require("node:path");
5
5
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { d as traverse, u as babelParse } from "./precheck-tbk626YL.mjs";
1
+ import { d as traverse, u as babelParse } from "./precheck-D1O5AWzy.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import path from "node:path";
4
4
  import process from "node:process";
@@ -1,2 +1 @@
1
- export declare function removeUnsupportedMiniProgramAtRules(css: string): string;
2
- export declare function removeUnsupportedAtSupports(css: string): string;
1
+ export { removeUnsupportedAtSupports, removeUnsupportedMiniProgramAtRules, } from '@weapp-tailwindcss/postcss';
@@ -1,8 +1 @@
1
- import type { CssPreflightOptions } from '../../types';
2
- export { removeUnsupportedAtSupports, removeUnsupportedMiniProgramAtRules } from './css-cleanup/at-rules';
3
- interface FinalizeMiniProgramCssOptions {
4
- cssPreflight?: CssPreflightOptions | undefined;
5
- preservePseudoContentInit?: boolean;
6
- }
7
- export declare function hoistTailwindPreflightBase(css: string): string;
8
- export declare function finalizeMiniProgramCss(css: string, options?: FinalizeMiniProgramCssOptions): string;
1
+ export { finalizeMiniProgramCss, hoistTailwindPreflightBase, removeUnsupportedAtSupports, removeUnsupportedMiniProgramAtRules, } from '@weapp-tailwindcss/postcss';
package/dist/core.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./chunk-8l464Juk.js");
3
- const require_precheck = require("./precheck-BjEbVEpX.js");
3
+ const require_precheck = require("./precheck-8pQbjqpq.js");
4
4
  let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
5
5
  //#region src/core.ts
6
6
  const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
package/dist/core.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-tbk626YL.mjs";
1
+ import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-D1O5AWzy.mjs";
2
2
  import { defuOverrideArray } from "@weapp-tailwindcss/shared";
3
3
  //#region src/core.ts
4
4
  const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
@@ -1,17 +1,45 @@
1
- const require_v3_engine = require("./v3-engine-5LoZUH-4.js");
1
+ const require_chunk = require("./chunk-8l464Juk.js");
2
+ const require_v3_engine = require("./v3-engine-CCwvhRrQ.js");
3
+ let node_process = require("node:process");
4
+ node_process = require_chunk.__toESM(node_process);
2
5
  //#region src/generator/options.ts
6
+ const explicitGeneratorTargetEnvKeys = ["WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
7
+ const uniWebPlatformEnvKeys = ["UNI_PLATFORM", "UNI_UTS_PLATFORM"];
8
+ const mpxWebPlatformEnvKeys = ["MPX_CLI_MODE", "MPX_CURRENT_TARGET_MODE"];
9
+ function getEnvValue(key) {
10
+ return typeof node_process.default === "undefined" ? void 0 : node_process.default.env[key];
11
+ }
12
+ function normalizeGeneratorTargetValue(value) {
13
+ return value === "weapp" || value === "web" || value === "tailwind" ? value : void 0;
14
+ }
15
+ function isUniWebPlatform(value) {
16
+ const normalized = value?.trim().toLowerCase();
17
+ return normalized === "h5" || normalized?.startsWith("web") === true;
18
+ }
19
+ function isMpxWebPlatform(value) {
20
+ return value?.trim().toLowerCase() === "web";
21
+ }
22
+ function inferGeneratorTargetFromEnv() {
23
+ for (const key of explicitGeneratorTargetEnvKeys) {
24
+ const target = normalizeGeneratorTargetValue(getEnvValue(key));
25
+ if (target !== void 0) return target;
26
+ }
27
+ if (uniWebPlatformEnvKeys.some((key) => isUniWebPlatform(getEnvValue(key))) || mpxWebPlatformEnvKeys.some((key) => isMpxWebPlatform(getEnvValue(key))) || getEnvValue("TARO_ENV") === "h5") return "web";
28
+ return "weapp";
29
+ }
3
30
  function normalizeWeappTailwindcssGeneratorOptions(options) {
31
+ const target = options?.target ?? inferGeneratorTargetFromEnv();
4
32
  if (options == null) return {
5
- target: "weapp",
33
+ target,
6
34
  importFallback: true,
7
- tailwindcssV3Compatibility: true
35
+ tailwindcssV3Compatibility: target === "weapp"
8
36
  };
9
37
  return {
10
- target: options.target ?? "weapp",
38
+ target,
11
39
  config: options.config,
12
40
  styleOptions: options.styleOptions,
13
41
  importFallback: options.importFallback ?? true,
14
- tailwindcssV3Compatibility: options.tailwindcssV3Compatibility ?? (options.target ?? "weapp") === "weapp"
42
+ tailwindcssV3Compatibility: options.tailwindcssV3Compatibility ?? target === "weapp"
15
43
  };
16
44
  }
17
45
  //#endregion
@@ -0,0 +1,58 @@
1
+ import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-DyIcbpZm.mjs";
2
+ import process from "node:process";
3
+ //#region src/generator/options.ts
4
+ const explicitGeneratorTargetEnvKeys = ["WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
5
+ const uniWebPlatformEnvKeys = ["UNI_PLATFORM", "UNI_UTS_PLATFORM"];
6
+ const mpxWebPlatformEnvKeys = ["MPX_CLI_MODE", "MPX_CURRENT_TARGET_MODE"];
7
+ function getEnvValue(key) {
8
+ return typeof process === "undefined" ? void 0 : process.env[key];
9
+ }
10
+ function normalizeGeneratorTargetValue(value) {
11
+ return value === "weapp" || value === "web" || value === "tailwind" ? value : void 0;
12
+ }
13
+ function isUniWebPlatform(value) {
14
+ const normalized = value?.trim().toLowerCase();
15
+ return normalized === "h5" || normalized?.startsWith("web") === true;
16
+ }
17
+ function isMpxWebPlatform(value) {
18
+ return value?.trim().toLowerCase() === "web";
19
+ }
20
+ function inferGeneratorTargetFromEnv() {
21
+ for (const key of explicitGeneratorTargetEnvKeys) {
22
+ const target = normalizeGeneratorTargetValue(getEnvValue(key));
23
+ if (target !== void 0) return target;
24
+ }
25
+ if (uniWebPlatformEnvKeys.some((key) => isUniWebPlatform(getEnvValue(key))) || mpxWebPlatformEnvKeys.some((key) => isMpxWebPlatform(getEnvValue(key))) || getEnvValue("TARO_ENV") === "h5") return "web";
26
+ return "weapp";
27
+ }
28
+ function normalizeWeappTailwindcssGeneratorOptions(options) {
29
+ const target = options?.target ?? inferGeneratorTargetFromEnv();
30
+ if (options == null) return {
31
+ target,
32
+ importFallback: true,
33
+ tailwindcssV3Compatibility: target === "weapp"
34
+ };
35
+ return {
36
+ target,
37
+ config: options.config,
38
+ styleOptions: options.styleOptions,
39
+ importFallback: options.importFallback ?? true,
40
+ tailwindcssV3Compatibility: options.tailwindcssV3Compatibility ?? target === "weapp"
41
+ };
42
+ }
43
+ //#endregion
44
+ //#region src/generator/index.ts
45
+ function isTailwindV3Source(source) {
46
+ return "version" in source && source.version === 3;
47
+ }
48
+ function createWeappTailwindcssGenerator(source) {
49
+ return isTailwindV3Source(source) ? createTailwindV3Engine(source) : createTailwindV4Engine(source);
50
+ }
51
+ async function resolveTailwindSourceFromPatcher(patcher) {
52
+ return patcher.majorVersion === 3 ? resolveTailwindV3SourceFromPatcher(patcher) : resolveTailwindV4SourceFromPatcher(patcher);
53
+ }
54
+ async function createWeappTailwindcssGeneratorFromPatcher(patcher) {
55
+ return createWeappTailwindcssGenerator(await resolveTailwindSourceFromPatcher(patcher));
56
+ }
57
+ //#endregion
58
+ export { normalizeWeappTailwindcssGeneratorOptions as i, createWeappTailwindcssGeneratorFromPatcher as n, resolveTailwindSourceFromPatcher as r, createWeappTailwindcssGenerator as t };
package/dist/generator.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./chunk-8l464Juk.js");
3
- const require_v3_engine = require("./v3-engine-5LoZUH-4.js");
4
- const require_generator = require("./generator-N4jy1HCk.js");
3
+ const require_v3_engine = require("./v3-engine-CCwvhRrQ.js");
4
+ const require_generator = require("./generator-CV_APjnB.js");
5
5
  let tailwindcss_patch = require("tailwindcss-patch");
6
6
  exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
7
7
  exports.createWeappTailwindcssGeneratorFromPatcher = require_generator.createWeappTailwindcssGeneratorFromPatcher;
@@ -1,3 +1,3 @@
1
- import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-DIXDEDmL.mjs";
2
- import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-DIuglJub.mjs";
1
+ import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-DyIcbpZm.mjs";
2
+ import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-DPX8vA2P.mjs";
3
3
  export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromPatcher, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromPatcher, resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
package/dist/gulp.js CHANGED
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-8l464Juk.js");
3
- const require_v3_engine = require("./v3-engine-5LoZUH-4.js");
4
- const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-CJ0Pnsw2.js");
5
- const require_precheck = require("./precheck-BjEbVEpX.js");
6
- const require_tailwindcss = require("./tailwindcss-BhG7BtB-.js");
7
- const require_source_candidates = require("./source-candidates-gxijpPI3.js");
3
+ const require_v3_engine = require("./v3-engine-CCwvhRrQ.js");
4
+ const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-C6akmwlk.js");
5
+ const require_precheck = require("./precheck-8pQbjqpq.js");
6
+ const require_tailwindcss = require("./tailwindcss-whZE3HpL.js");
7
+ const require_source_candidates = require("./source-candidates-CUTNdsiz.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
10
10
  let node_path = require("node:path");
package/dist/gulp.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { V as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-DIXDEDmL.mjs";
2
- import { i as generateCssByGenerator, l as normalizeTailwindSourceForGenerator, o as processCachedTask, r as emitHmrTiming, s as hasTailwindRootDirectives, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-hF-uiw6W.mjs";
3
- import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-tbk626YL.mjs";
4
- import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-c6ROlNNW.mjs";
5
- import { t as createSourceCandidateCollector } from "./source-candidates-BrvneDDd.mjs";
1
+ import { B as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-DyIcbpZm.mjs";
2
+ import { i as generateCssByGenerator, l as normalizeTailwindSourceForGenerator, o as processCachedTask, r as emitHmrTiming, s as hasTailwindRootDirectives, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-Cwpw6aZK.mjs";
3
+ import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-D1O5AWzy.mjs";
4
+ import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-B_JAdOQf.mjs";
5
+ import { t as createSourceCandidateCollector } from "./source-candidates-CnD4vyic.mjs";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
8
8
  import process from "node:process";