weapp-tailwindcss 5.0.0-next.9 → 5.0.1

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 (167) hide show
  1. package/README.md +2 -2
  2. package/dist/auto-DEHRmEAx.mjs +200 -0
  3. package/dist/auto-dPpsm6FB.js +238 -0
  4. package/dist/bundle-state-CBF5YX1m.js +529 -0
  5. package/dist/bundle-state-CQmxxx0R.mjs +413 -0
  6. package/dist/bundlers/shared/cache.d.ts +9 -7
  7. package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -2
  8. package/dist/bundlers/shared/css-cleanup.d.ts +1 -3
  9. package/dist/bundlers/shared/css-imports.d.ts +3 -3
  10. package/dist/bundlers/shared/generated-css-marker.d.ts +3 -0
  11. package/dist/bundlers/shared/generator-css/directives.d.ts +11 -3
  12. package/dist/bundlers/shared/generator-css/markers.d.ts +12 -0
  13. package/dist/bundlers/shared/generator-css/source-files.d.ts +9 -6
  14. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +16 -2
  15. package/dist/bundlers/shared/generator-css/user-layer-order.d.ts +10 -0
  16. package/dist/bundlers/shared/generator-css.d.ts +6 -2
  17. package/dist/bundlers/shared/hmr-timing.d.ts +22 -0
  18. package/dist/bundlers/shared/style-requests.d.ts +2 -0
  19. package/dist/bundlers/vite/bundle-state.d.ts +1 -0
  20. package/dist/bundlers/vite/css-finalizer.d.ts +6 -0
  21. package/dist/bundlers/vite/generate-bundle/candidates.d.ts +1 -1
  22. package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +5 -1
  23. package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +1 -0
  24. package/dist/bundlers/vite/generate-bundle.d.ts +13 -1
  25. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +10 -2
  26. package/dist/bundlers/vite/index.d.ts +5 -2
  27. package/dist/bundlers/vite/processed-css-assets.d.ts +32 -0
  28. package/dist/bundlers/vite/rewrite-css-imports.d.ts +8 -5
  29. package/dist/bundlers/vite/runtime-class-set.d.ts +5 -1
  30. package/dist/bundlers/vite/serve-css-generation.d.ts +11 -0
  31. package/dist/bundlers/vite/source-candidates.d.ts +24 -2
  32. package/dist/bundlers/vite/source-scan.d.ts +26 -0
  33. package/dist/bundlers/vite/static-config-content.d.ts +5 -0
  34. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +5 -0
  35. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +5 -1
  36. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +8 -3
  37. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
  38. package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +31 -0
  39. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +2 -8
  40. package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +3 -7
  41. package/dist/cache/index.d.ts +6 -6
  42. package/dist/{chunk-8l464Juk.js → chunk-C5U5_Hdc.js} +14 -0
  43. package/dist/cli/context.d.ts +1 -11
  44. package/dist/cli/doctor/types.d.ts +11 -11
  45. package/dist/cli/vscode-entry.d.ts +3 -3
  46. package/dist/cli.js +684 -41
  47. package/dist/cli.mjs +682 -40
  48. package/dist/context/runtime-package-replacements.d.ts +2 -0
  49. package/dist/context/style-options.d.ts +3 -0
  50. package/dist/context/tailwindcss.d.ts +1 -1
  51. package/dist/core.js +1 -2
  52. package/dist/core.mjs +1 -1
  53. package/dist/css-macro/auto.d.ts +11 -0
  54. package/dist/css-macro/constants.d.ts +5 -2
  55. package/dist/css-macro/postcss.d.ts +1 -0
  56. package/dist/css-macro/postcss.js +7 -46
  57. package/dist/css-macro/postcss.mjs +2 -46
  58. package/dist/css-macro.js +16 -7
  59. package/dist/css-macro.mjs +15 -6
  60. package/dist/defaults-8xrgzxFY.mjs +151 -0
  61. package/dist/defaults-zKUH2mDe.js +193 -0
  62. package/dist/defaults.js +6 -150
  63. package/dist/defaults.mjs +1 -143
  64. package/dist/escape.js +10 -2
  65. package/dist/escape.mjs +10 -2
  66. package/dist/generator/options.d.ts +11 -6
  67. package/dist/generator/types.d.ts +3 -3
  68. package/dist/generator-CvmsIQFI.js +92 -0
  69. package/dist/generator-DDtsUvkH.mjs +67 -0
  70. package/dist/generator.js +12 -12
  71. package/dist/generator.mjs +2 -1
  72. package/dist/gulp.js +163 -40
  73. package/dist/gulp.mjs +155 -32
  74. package/dist/incremental-runtime-class-set-BffodqHh.js +2366 -0
  75. package/dist/incremental-runtime-class-set-DArodvWs.mjs +2291 -0
  76. package/dist/index.d.ts +2 -1
  77. package/dist/index.js +17 -5
  78. package/dist/index.mjs +6 -5
  79. package/dist/js/babel/cache-options.d.ts +3 -0
  80. package/dist/js/babel/parse.d.ts +7 -4
  81. package/dist/js/precheck.d.ts +2 -2
  82. package/dist/js/replacement-cache.d.ts +5 -0
  83. package/dist/{postcss-w48mGIhe.mjs → postcss-BzNYQUOH.mjs} +54 -114
  84. package/dist/postcss-C7BMYpEF.mjs +169 -0
  85. package/dist/postcss-CiYLsqZn.js +192 -0
  86. package/dist/{postcss-QIXwT40c.js → postcss-DE0TOtV9.js} +60 -121
  87. package/dist/postcss-html-transform.js +1 -1
  88. package/dist/postcss.js +1 -1
  89. package/dist/postcss.mjs +1 -1
  90. package/dist/precheck-BzYPm-EG.js +4842 -0
  91. package/dist/precheck-jZvTVXXG.mjs +4716 -0
  92. package/dist/presets/index.d.ts +1 -0
  93. package/dist/presets/uni-app-x.d.ts +1 -0
  94. package/dist/presets.js +27 -13
  95. package/dist/presets.mjs +25 -13
  96. package/dist/reset.js +1 -1
  97. package/dist/runtime-registry-DpcR3IHI.js +5496 -0
  98. package/dist/shared/mpx.d.ts +1 -0
  99. package/dist/source-candidates-BuTlMabx.mjs +322 -0
  100. package/dist/source-candidates-CxoIaS88.js +335 -0
  101. package/dist/tailwindcss/miniprogram.d.ts +1 -5
  102. package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -2
  103. package/dist/tailwindcss/runtime/cache.d.ts +4 -3
  104. package/dist/tailwindcss/runtime.d.ts +9 -9
  105. package/dist/tailwindcss/source-scan.d.ts +35 -0
  106. package/dist/tailwindcss/v3-engine/types.d.ts +19 -14
  107. package/dist/tailwindcss/v4/css-entries.d.ts +2 -2
  108. package/dist/tailwindcss/v4/patcher.d.ts +1 -1
  109. package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
  110. package/dist/tailwindcss/v4-engine/types.d.ts +18 -5
  111. package/dist/{tailwindcss-C5IgPlQ0.mjs → tailwindcss-CCZcu0lr.mjs} +75 -98
  112. package/dist/{tailwindcss-Bu-RWIHx.js → tailwindcss-DZckITp1.js} +83 -106
  113. package/dist/typedoc.export.d.ts +1 -1
  114. package/dist/types/index.d.ts +51 -41
  115. package/dist/types/shared.d.ts +3 -0
  116. package/dist/types/typedoc-tailwindcss-patch.d.ts +67 -0
  117. package/dist/types/user-defined-options/general.d.ts +25 -22
  118. package/dist/types/user-defined-options/important.d.ts +32 -27
  119. package/dist/types/user-defined-options/lifecycle.d.ts +4 -4
  120. package/dist/types/user-defined-options/matcher.d.ts +6 -6
  121. package/dist/unocss/index.d.ts +2 -0
  122. package/dist/utils/object.d.ts +9 -0
  123. package/dist/utils/options.d.ts +2 -0
  124. package/dist/utils/regex.d.ts +1 -0
  125. package/dist/{utils-BiShvil9.js → utils-D7Ygohep.js} +2 -2
  126. package/dist/{utils-Btw1iOVV.mjs → utils-DsaS975I.mjs} +1 -1
  127. package/dist/v3-engine-DGBhUnjn.mjs +3419 -0
  128. package/dist/v3-engine-M6Aqru5T.js +3714 -0
  129. package/dist/vite-BBcQIJpD.mjs +24493 -0
  130. package/dist/vite-DgRkWVPG.js +24507 -0
  131. package/dist/vite.js +1 -1
  132. package/dist/vite.mjs +1 -1
  133. package/dist/weapp-tw-css-import-rewrite-loader.js +5456 -22
  134. package/dist/weapp-tw-runtime-classset-loader.js +32 -9
  135. package/dist/{webpack-BzN2ly34.js → webpack-D-gb4ZvO.js} +341 -96
  136. package/dist/{webpack-DJazm5sT.mjs → webpack-D43aMQzO.mjs} +323 -79
  137. package/dist/webpack.d.ts +1 -3
  138. package/dist/webpack.js +3 -4
  139. package/dist/webpack.mjs +2 -2
  140. package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -4
  141. package/package.json +22 -20
  142. package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +0 -3
  143. package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +0 -4
  144. package/dist/bundlers/shared/css-cleanup/selectors.d.ts +0 -8
  145. package/dist/cache-BVAiJV3J.js +0 -502
  146. package/dist/cache-CHs4DXui.mjs +0 -434
  147. package/dist/constants-BoB_6lFw.js +0 -73
  148. package/dist/constants-E_loJC49.mjs +0 -44
  149. package/dist/generator-DKkhJbOg.js +0 -1531
  150. package/dist/generator-UBmfduYg.mjs +0 -1432
  151. package/dist/generator-css-Bwp3nbrl.js +0 -1381
  152. package/dist/generator-css-DeLLmp2N.mjs +0 -1342
  153. package/dist/lightningcss/index.d.ts +0 -8
  154. package/dist/lightningcss/style-handler/options.d.ts +0 -3
  155. package/dist/lightningcss/style-handler/selector-transform.d.ts +0 -10
  156. package/dist/lightningcss/style-handler/selector-utils.d.ts +0 -10
  157. package/dist/lightningcss/style-handler.d.ts +0 -17
  158. package/dist/precheck-B32p-gLI.js +0 -2736
  159. package/dist/precheck-B4RH6ZNN.mjs +0 -2622
  160. package/dist/run-tasks-B50A3pxt.js +0 -128
  161. package/dist/run-tasks-DdNi-hkk.mjs +0 -91
  162. package/dist/runtime-patch-CwN5ya72.mjs +0 -71
  163. package/dist/runtime-patch-D6mBo_KB.js +0 -85
  164. package/dist/vite-By5KQi9s.js +0 -2419
  165. package/dist/vite-Cyp42bBf.mjs +0 -2406
  166. /package/dist/{logger-Bub1jggA.mjs → logger-BNzxZbZj.mjs} +0 -0
  167. /package/dist/{logger-BRy6XPQ2.js → logger-TlKT3xmR.js} +0 -0
@@ -1,3 +1,4 @@
1
+ export * from './hbuilderx';
1
2
  export * from './shared';
2
3
  export * from './uni-app';
3
4
  export * from './uni-app-x';
@@ -6,6 +6,7 @@ export interface UniAppXOptions {
6
6
  rem2rpx?: UserDefinedOptions['rem2rpx'];
7
7
  generator?: UserDefinedOptions['generator'];
8
8
  unitsToPx?: UserDefinedOptions['unitsToPx'];
9
+ unitConversion?: UserDefinedOptions['unitConversion'];
9
10
  rawOptions?: UserDefinedOptions;
10
11
  resolve?: PackageResolvingOptions;
11
12
  customAttributes?: UserDefinedOptions['customAttributes'];
package/dist/presets.js CHANGED
@@ -1,11 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_chunk = require("./chunk-8l464Juk.js");
3
- require("./cache-BVAiJV3J.js");
4
- const require_utils = require("./utils-BiShvil9.js");
5
- const require_tailwindcss = require("./tailwindcss-Bu-RWIHx.js");
6
- require("./logger-BRy6XPQ2.js");
2
+ const require_chunk = require("./chunk-C5U5_Hdc.js");
3
+ const require_v3_engine = require("./v3-engine-M6Aqru5T.js");
4
+ const require_utils = require("./utils-D7Ygohep.js");
5
+ const require_tailwindcss = require("./tailwindcss-DZckITp1.js");
6
+ require("./logger-TlKT3xmR.js");
7
7
  let node_process = require("node:process");
8
8
  node_process = require_chunk.__toESM(node_process);
9
+ let node_path = require("node:path");
10
+ node_path = require_chunk.__toESM(node_path);
9
11
  let local_pkg = require("local-pkg");
10
12
  let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
11
13
  let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
@@ -22,10 +24,10 @@ function createBasePreset(options = {}) {
22
24
  const tailwindConfig = {
23
25
  v2: { cwd: baseDir },
24
26
  v3: { cwd: baseDir },
25
- v4: {
27
+ v4: require_v3_engine.omitUndefined({
26
28
  base: baseDir,
27
29
  cssEntries: normalizedCssEntries
28
- }
30
+ })
29
31
  };
30
32
  if (normalizedCssEntries && normalizedCssEntries.length > 0) tailwindConfig.version = 4;
31
33
  const preset = {
@@ -42,9 +44,14 @@ function createBasePreset(options = {}) {
42
44
  return (0, _weapp_tailwindcss_shared.defuOverrideArray)((0, _weapp_tailwindcss_shared.defuOverrideArray)(userOptions, rawOptions ?? {}), preset);
43
45
  }
44
46
  //#endregion
47
+ //#region src/presets/hbuilderx.ts
48
+ function hbuilderx(options = {}) {
49
+ return createBasePreset({ ...options });
50
+ }
51
+ //#endregion
45
52
  //#region src/presets/uni-app.ts
46
53
  function uniApp(options = {}) {
47
- const uniPlatform = node_process.default.env.UNI_PLATFORM;
54
+ const uniPlatform = node_process.default.env["UNI_PLATFORM"];
48
55
  return createBasePreset({
49
56
  disabled: uniPlatform === "h5" || uniPlatform === "app" || uniPlatform === "app-plus" ? true : void 0,
50
57
  ...options
@@ -61,7 +68,11 @@ function resolveTailwindResolveOptions(base, resolve) {
61
68
  const currentPaths = Array.isArray(resolve?.paths) ? resolve.paths : [];
62
69
  return {
63
70
  ...resolve ?? {},
64
- paths: [...new Set([base, ...currentPaths])]
71
+ paths: [...new Set([
72
+ node_path.default.join(base, "node_modules"),
73
+ base,
74
+ ...currentPaths
75
+ ])]
65
76
  };
66
77
  }
67
78
  function resolveInstalledTailwindDefaults(resolve) {
@@ -81,9 +92,9 @@ function resolveInstalledTailwindDefaults(resolve) {
81
92
  };
82
93
  }
83
94
  function uniAppX(options) {
84
- _weapp_tailwindcss_logger.logger.info(`UNI_PLATFORM: ${node_process.default.env.UNI_PLATFORM}`);
95
+ _weapp_tailwindcss_logger.logger.info(`UNI_PLATFORM: ${node_process.default.env["UNI_PLATFORM"]}`);
85
96
  const utsPlatform = require_utils.resolveUniUtsPlatform();
86
- const uniPlatform = require_utils.resolveUniUtsPlatform(node_process.default.env.UNI_PLATFORM);
97
+ const uniPlatform = require_utils.resolveUniUtsPlatform(node_process.default.env["UNI_PLATFORM"]);
87
98
  _weapp_tailwindcss_logger.logger.info(`UNI_UTS_PLATFORM: ${utsPlatform.raw ?? "undefined"}`);
88
99
  const isApp = utsPlatform.isApp || uniPlatform.isApp;
89
100
  const cssEntries = normalizeCssEntries(options.cssEntries);
@@ -101,6 +112,8 @@ function uniAppX(options) {
101
112
  ...options.generator !== void 0 ? { generator: options.generator } : {},
102
113
  rem2rpx: options.rem2rpx,
103
114
  unitsToPx: options.unitsToPx,
115
+ unitConversion: options.unitConversion,
116
+ appType: "uni-app-x",
104
117
  tailwindcssBasedir: options.base,
105
118
  tailwindcssPatcherOptions: {
106
119
  projectRoot: options.base,
@@ -109,10 +122,10 @@ function uniAppX(options) {
109
122
  cwd: options.base,
110
123
  resolve: resolvedResolve,
111
124
  v3: { cwd: options.base },
112
- v4: {
125
+ v4: require_v3_engine.omitUndefined({
113
126
  base: options.base,
114
127
  cssEntries
115
- }
128
+ })
116
129
  }
117
130
  },
118
131
  tailwindcss: {
@@ -126,6 +139,7 @@ function uniAppX(options) {
126
139
  }
127
140
  //#endregion
128
141
  exports.createBasePreset = createBasePreset;
142
+ exports.hbuilderx = hbuilderx;
129
143
  exports.normalizeCssEntries = normalizeCssEntries;
130
144
  exports.uniApp = uniApp;
131
145
  exports.uniAppX = uniAppX;
package/dist/presets.mjs CHANGED
@@ -1,8 +1,9 @@
1
- import "./cache-CHs4DXui.mjs";
2
- import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-Btw1iOVV.mjs";
3
- import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-C5IgPlQ0.mjs";
4
- import { t as logger } from "./logger-Bub1jggA.mjs";
1
+ import { q as omitUndefined } from "./v3-engine-DGBhUnjn.mjs";
2
+ import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
3
+ import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-CCZcu0lr.mjs";
4
+ import { t as logger } from "./logger-BNzxZbZj.mjs";
5
5
  import process from "node:process";
6
+ import path from "node:path";
6
7
  import { getPackageInfoSync } from "local-pkg";
7
8
  //#region src/presets/shared.ts
8
9
  function normalizeCssEntries(entries) {
@@ -17,10 +18,10 @@ function createBasePreset(options = {}) {
17
18
  const tailwindConfig = {
18
19
  v2: { cwd: baseDir },
19
20
  v3: { cwd: baseDir },
20
- v4: {
21
+ v4: omitUndefined({
21
22
  base: baseDir,
22
23
  cssEntries: normalizedCssEntries
23
- }
24
+ })
24
25
  };
25
26
  if (normalizedCssEntries && normalizedCssEntries.length > 0) tailwindConfig.version = 4;
26
27
  const preset = {
@@ -37,9 +38,14 @@ function createBasePreset(options = {}) {
37
38
  return defuOverrideArray(defuOverrideArray(userOptions, rawOptions ?? {}), preset);
38
39
  }
39
40
  //#endregion
41
+ //#region src/presets/hbuilderx.ts
42
+ function hbuilderx(options = {}) {
43
+ return createBasePreset({ ...options });
44
+ }
45
+ //#endregion
40
46
  //#region src/presets/uni-app.ts
41
47
  function uniApp(options = {}) {
42
- const uniPlatform = process.env.UNI_PLATFORM;
48
+ const uniPlatform = process.env["UNI_PLATFORM"];
43
49
  return createBasePreset({
44
50
  disabled: uniPlatform === "h5" || uniPlatform === "app" || uniPlatform === "app-plus" ? true : void 0,
45
51
  ...options
@@ -56,7 +62,11 @@ function resolveTailwindResolveOptions(base, resolve) {
56
62
  const currentPaths = Array.isArray(resolve?.paths) ? resolve.paths : [];
57
63
  return {
58
64
  ...resolve ?? {},
59
- paths: [...new Set([base, ...currentPaths])]
65
+ paths: [...new Set([
66
+ path.join(base, "node_modules"),
67
+ base,
68
+ ...currentPaths
69
+ ])]
60
70
  };
61
71
  }
62
72
  function resolveInstalledTailwindDefaults(resolve) {
@@ -76,9 +86,9 @@ function resolveInstalledTailwindDefaults(resolve) {
76
86
  };
77
87
  }
78
88
  function uniAppX(options) {
79
- logger.info(`UNI_PLATFORM: ${process.env.UNI_PLATFORM}`);
89
+ logger.info(`UNI_PLATFORM: ${process.env["UNI_PLATFORM"]}`);
80
90
  const utsPlatform = resolveUniUtsPlatform();
81
- const uniPlatform = resolveUniUtsPlatform(process.env.UNI_PLATFORM);
91
+ const uniPlatform = resolveUniUtsPlatform(process.env["UNI_PLATFORM"]);
82
92
  logger.info(`UNI_UTS_PLATFORM: ${utsPlatform.raw ?? "undefined"}`);
83
93
  const isApp = utsPlatform.isApp || uniPlatform.isApp;
84
94
  const cssEntries = normalizeCssEntries(options.cssEntries);
@@ -96,6 +106,8 @@ function uniAppX(options) {
96
106
  ...options.generator !== void 0 ? { generator: options.generator } : {},
97
107
  rem2rpx: options.rem2rpx,
98
108
  unitsToPx: options.unitsToPx,
109
+ unitConversion: options.unitConversion,
110
+ appType: "uni-app-x",
99
111
  tailwindcssBasedir: options.base,
100
112
  tailwindcssPatcherOptions: {
101
113
  projectRoot: options.base,
@@ -104,10 +116,10 @@ function uniAppX(options) {
104
116
  cwd: options.base,
105
117
  resolve: resolvedResolve,
106
118
  v3: { cwd: options.base },
107
- v4: {
119
+ v4: omitUndefined({
108
120
  base: options.base,
109
121
  cssEntries
110
- }
122
+ })
111
123
  }
112
124
  },
113
125
  tailwindcss: {
@@ -120,4 +132,4 @@ function uniAppX(options) {
120
132
  });
121
133
  }
122
134
  //#endregion
123
- export { createBasePreset, normalizeCssEntries, uniApp, uniAppX };
135
+ export { createBasePreset, hbuilderx, normalizeCssEntries, uniApp, uniAppX };
package/dist/reset.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_chunk = require("./chunk-8l464Juk.js");
5
+ const require_chunk = require("./chunk-C5U5_Hdc.js");
6
6
  let _weapp_tailwindcss_reset = require("@weapp-tailwindcss/reset");
7
7
  _weapp_tailwindcss_reset = require_chunk.__toESM(_weapp_tailwindcss_reset);
8
8
  Object.defineProperty(exports, "default", {