weapp-tailwindcss 4.12.0 → 5.0.0-next.10

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 (324) hide show
  1. package/README.md +4 -5
  2. package/bin/weapp-tailwindcss.js +1 -21
  3. package/dist/babel/index.d.ts +3 -0
  4. package/dist/bundle-state-BWqi5ZyX.mjs +343 -0
  5. package/dist/bundle-state-EUbcdKqo.js +410 -0
  6. package/dist/bundlers/gulp/index.d.ts +7 -0
  7. package/dist/bundlers/shared/cache.d.ts +16 -0
  8. package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +2 -0
  9. package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +3 -0
  10. package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +4 -0
  11. package/dist/bundlers/shared/css-cleanup/selectors.d.ts +8 -0
  12. package/dist/bundlers/shared/css-cleanup.d.ts +3 -0
  13. package/dist/bundlers/shared/css-imports.d.ts +8 -0
  14. package/dist/bundlers/shared/generator-css/config-directive.d.ts +2 -0
  15. package/dist/bundlers/shared/generator-css/directives.d.ts +13 -0
  16. package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +7 -0
  17. package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +5 -0
  18. package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -0
  19. package/dist/bundlers/shared/generator-css/markers.d.ts +16 -0
  20. package/dist/bundlers/shared/generator-css/source-files.d.ts +11 -0
  21. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +10 -0
  22. package/dist/bundlers/shared/generator-css.d.ts +33 -0
  23. package/dist/bundlers/shared/module-graph.d.ts +5 -0
  24. package/dist/bundlers/shared/run-tasks.d.ts +2 -0
  25. package/dist/bundlers/vite/bundle-entries.d.ts +14 -0
  26. package/dist/bundlers/vite/bundle-state.d.ts +43 -0
  27. package/dist/bundlers/vite/css-finalizer.d.ts +22 -0
  28. package/dist/bundlers/vite/generate-bundle/candidates.d.ts +2 -0
  29. package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +20 -0
  30. package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +3 -0
  31. package/dist/bundlers/vite/generate-bundle/dirty-state.d.ts +1 -0
  32. package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +2 -0
  33. package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +8 -0
  34. package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +13 -0
  35. package/dist/bundlers/vite/generate-bundle/metrics.d.ts +17 -0
  36. package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +9 -0
  37. package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +7 -0
  38. package/dist/bundlers/vite/generate-bundle/signatures.d.ts +8 -0
  39. package/dist/bundlers/vite/generate-bundle.d.ts +34 -0
  40. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +21 -0
  41. package/dist/bundlers/vite/index.d.ts +3 -0
  42. package/dist/bundlers/vite/js-precheck.d.ts +1 -0
  43. package/dist/bundlers/vite/official-tailwind-plugins.d.ts +5 -0
  44. package/dist/bundlers/vite/postcss-config.d.ts +6 -0
  45. package/dist/bundlers/vite/query.d.ts +15 -0
  46. package/dist/bundlers/vite/resolve-app-type.d.ts +2 -0
  47. package/dist/bundlers/vite/rewrite-css-imports.d.ts +13 -0
  48. package/dist/bundlers/vite/runtime-affecting-signature.d.ts +2 -0
  49. package/dist/bundlers/vite/runtime-class-set.d.ts +22 -0
  50. package/dist/bundlers/vite/source-candidates.d.ts +18 -0
  51. package/dist/bundlers/vite/source-scan.d.ts +8 -0
  52. package/dist/bundlers/vite/tailwind-basedir.d.ts +1 -0
  53. package/dist/bundlers/vite/utils.d.ts +9 -0
  54. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +21 -0
  55. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +20 -0
  56. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +20 -0
  57. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +10 -0
  58. package/dist/bundlers/webpack/index.d.ts +1 -0
  59. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +14 -0
  60. package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +11 -0
  61. package/dist/bundlers/webpack/shared/loader-anchors.d.ts +8 -0
  62. package/dist/cache/index.d.ts +38 -0
  63. package/dist/cache/md5.d.ts +1 -0
  64. package/dist/cache-BVAiJV3J.js +502 -0
  65. package/dist/cache-CHs4DXui.mjs +434 -0
  66. package/dist/chunk-8l464Juk.js +28 -0
  67. package/dist/cli/context.d.ts +13 -0
  68. package/dist/cli/doctor/constants.d.ts +7 -0
  69. package/dist/cli/doctor/types.d.ts +31 -0
  70. package/dist/cli/doctor.d.ts +4 -0
  71. package/dist/cli/helpers/options/format.d.ts +2 -0
  72. package/dist/cli/helpers/options/parse.d.ts +3 -0
  73. package/dist/cli/helpers/options/resolve.d.ts +1 -0
  74. package/dist/cli/helpers/options.d.ts +3 -0
  75. package/dist/cli/helpers.d.ts +4 -0
  76. package/dist/cli/mount-options.d.ts +4 -0
  77. package/dist/cli/types.d.ts +15 -0
  78. package/dist/cli/vscode-entry.d.ts +14 -0
  79. package/dist/cli.d.ts +1 -2
  80. package/dist/cli.js +1985 -3574
  81. package/dist/cli.mjs +1962 -3554
  82. package/dist/constants-BG12WAKw.mjs +44 -0
  83. package/dist/constants-BeeyfJ9k.js +73 -0
  84. package/dist/constants.d.ts +12 -0
  85. package/dist/context/compiler-context-cache.d.ts +3 -0
  86. package/dist/context/custom-attributes.d.ts +2 -0
  87. package/dist/context/handlers.d.ts +6 -0
  88. package/dist/context/index.d.ts +7 -0
  89. package/dist/context/logger.d.ts +4 -0
  90. package/dist/context/tailwindcss/basedir.d.ts +1 -0
  91. package/dist/context/tailwindcss/rax.d.ts +2 -0
  92. package/dist/context/tailwindcss.d.ts +4 -0
  93. package/dist/context/workspace.d.ts +3 -0
  94. package/dist/core.d.ts +5 -21
  95. package/dist/core.js +131 -180
  96. package/dist/core.mjs +129 -180
  97. package/dist/css-macro/constants.d.ts +14 -0
  98. package/dist/css-macro/index.d.ts +15 -0
  99. package/dist/css-macro/postcss.d.ts +3 -7
  100. package/dist/css-macro/postcss.js +44 -58
  101. package/dist/css-macro/postcss.mjs +44 -56
  102. package/dist/css-macro.d.ts +2 -20
  103. package/dist/css-macro.js +37 -50
  104. package/dist/css-macro.mjs +33 -47
  105. package/dist/debug/index.d.ts +5 -0
  106. package/dist/defaults.d.ts +16 -11
  107. package/dist/defaults.js +151 -8
  108. package/dist/defaults.mjs +143 -7
  109. package/dist/escape.js +31 -54
  110. package/dist/escape.mjs +18 -25
  111. package/dist/generator/index.d.ts +11 -0
  112. package/dist/generator/options.d.ts +16 -0
  113. package/dist/generator/types.d.ts +20 -0
  114. package/dist/generator-DKkhJbOg.js +1531 -0
  115. package/dist/generator-UBmfduYg.mjs +1432 -0
  116. package/dist/generator.d.ts +1 -0
  117. package/dist/generator.js +19 -0
  118. package/dist/generator.mjs +2 -0
  119. package/dist/gulp.d.ts +4 -24
  120. package/dist/gulp.js +370 -13
  121. package/dist/gulp.mjs +362 -13
  122. package/dist/incremental-runtime-class-set-BYmzQ-_f.js +1555 -0
  123. package/dist/incremental-runtime-class-set-BgMW6wf2.mjs +1510 -0
  124. package/dist/index.d.ts +8 -15
  125. package/dist/index.js +12 -24
  126. package/dist/index.mjs +6 -24
  127. package/dist/js/JsTokenUpdater.d.ts +14 -0
  128. package/dist/js/ModuleGraph.d.ts +18 -0
  129. package/dist/js/NodePathWalker.d.ts +33 -0
  130. package/dist/js/babel/parse.d.ts +9 -0
  131. package/dist/js/babel/process.d.ts +4 -0
  132. package/dist/js/babel.d.ts +13 -0
  133. package/dist/js/class-context.d.ts +3 -0
  134. package/dist/js/evalTransforms.d.ts +7 -0
  135. package/dist/js/handlers.d.ts +5 -0
  136. package/dist/js/index.d.ts +5 -0
  137. package/dist/js/literal-transform.d.ts +2 -0
  138. package/dist/js/module-graph/ignored-exports.d.ts +18 -0
  139. package/dist/js/module-graph/types.d.ts +17 -0
  140. package/dist/js/node-path-walker/export-handlers.d.ts +12 -0
  141. package/dist/js/node-path-walker/import-tokens.d.ts +24 -0
  142. package/dist/js/precheck.d.ts +2 -0
  143. package/dist/js/sourceAnalysis.d.ts +17 -0
  144. package/dist/js/taggedTemplateIgnore.d.ts +13 -0
  145. package/dist/js/types.d.ts +11 -0
  146. package/dist/lightningcss/index.d.ts +8 -0
  147. package/dist/lightningcss/style-handler/options.d.ts +3 -0
  148. package/dist/lightningcss/style-handler/selector-transform.d.ts +10 -0
  149. package/dist/lightningcss/style-handler/selector-utils.d.ts +10 -0
  150. package/dist/lightningcss/style-handler.d.ts +17 -0
  151. package/dist/logger/index.d.ts +2 -0
  152. package/dist/logger-CZUxvJJD.mjs +2 -0
  153. package/dist/logger-EVNB9z7i.js +1 -0
  154. package/dist/postcss/config-directive.d.ts +1 -0
  155. package/dist/postcss/context.d.ts +9 -0
  156. package/dist/postcss/source-files.d.ts +8 -0
  157. package/dist/postcss/tailwind-version.d.ts +3 -0
  158. package/dist/postcss-C7efq3hr.mjs +231 -0
  159. package/dist/postcss-Dg-_lyHS.js +240 -0
  160. package/dist/postcss-html-transform.d.ts +3 -3
  161. package/dist/postcss-html-transform.js +7 -10
  162. package/dist/postcss-html-transform.mjs +3 -6
  163. package/dist/postcss.d.ts +15 -0
  164. package/dist/postcss.js +7 -0
  165. package/dist/postcss.mjs +2 -0
  166. package/dist/precheck-B32p-gLI.js +2736 -0
  167. package/dist/precheck-B4RH6ZNN.mjs +2622 -0
  168. package/dist/presets/hbuilderx.d.ts +4 -0
  169. package/dist/presets/index.d.ts +3 -0
  170. package/dist/presets/shared.d.ts +10 -0
  171. package/dist/presets/taro.d.ts +4 -0
  172. package/dist/presets/uni-app-x.d.ts +16 -0
  173. package/dist/presets/uni-app.d.ts +4 -0
  174. package/dist/presets.d.ts +1 -76
  175. package/dist/presets.js +117 -163
  176. package/dist/presets.mjs +109 -163
  177. package/dist/reset/index.d.ts +2 -0
  178. package/dist/reset.d.ts +2 -4
  179. package/dist/reset.js +19 -8
  180. package/dist/reset.mjs +2 -8
  181. package/dist/runtime-patch-CwN5ya72.mjs +71 -0
  182. package/dist/runtime-patch-D6mBo_KB.js +85 -0
  183. package/dist/shared/classname-transform.d.ts +14 -0
  184. package/dist/shared/mpx.d.ts +7 -0
  185. package/dist/shared/tailwindcss-css-redirect.d.ts +1 -0
  186. package/dist/source-scan-BaYvNx-k.js +293 -0
  187. package/dist/source-scan-cGZxoJqP.mjs +254 -0
  188. package/dist/tailwindcss/index.d.ts +11 -0
  189. package/dist/tailwindcss/miniprogram.d.ts +5 -0
  190. package/dist/tailwindcss/patcher-options.d.ts +8 -0
  191. package/dist/tailwindcss/patcher-resolve.d.ts +4 -0
  192. package/dist/tailwindcss/patcher.d.ts +12 -0
  193. package/dist/tailwindcss/remove-unsupported-css.d.ts +2 -0
  194. package/dist/tailwindcss/runtime/cache.d.ts +11 -0
  195. package/dist/tailwindcss/runtime-logs.d.ts +3 -0
  196. package/dist/tailwindcss/runtime-patch.d.ts +5 -0
  197. package/dist/tailwindcss/runtime.d.ts +28 -0
  198. package/dist/tailwindcss/source-scan.d.ts +25 -0
  199. package/dist/tailwindcss/targets.d.ts +2 -0
  200. package/dist/tailwindcss/v3-engine/generator.d.ts +2 -0
  201. package/dist/tailwindcss/v3-engine/index.d.ts +4 -0
  202. package/dist/tailwindcss/v3-engine/miniprogram.d.ts +4 -0
  203. package/dist/tailwindcss/v3-engine/source.d.ts +5 -0
  204. package/dist/tailwindcss/v3-engine/types.d.ts +55 -0
  205. package/dist/tailwindcss/v4/config.d.ts +5 -0
  206. package/dist/tailwindcss/v4/css-entries.d.ts +7 -0
  207. package/dist/tailwindcss/v4/css-sources.d.ts +5 -0
  208. package/dist/tailwindcss/v4/index.d.ts +2 -0
  209. package/dist/tailwindcss/v4/multi-patcher.d.ts +2 -0
  210. package/dist/tailwindcss/v4/patcher-options.d.ts +2 -0
  211. package/dist/tailwindcss/v4/patcher.d.ts +15 -0
  212. package/dist/tailwindcss/v4-engine/candidates.d.ts +2 -0
  213. package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -0
  214. package/dist/tailwindcss/v4-engine/generator.d.ts +2 -0
  215. package/dist/tailwindcss/v4-engine/index.d.ts +5 -0
  216. package/dist/tailwindcss/v4-engine/miniprogram.d.ts +5 -0
  217. package/dist/tailwindcss/v4-engine/source.d.ts +7 -0
  218. package/dist/tailwindcss/v4-engine/tailwind-v3-compatibility.d.ts +1 -0
  219. package/dist/tailwindcss/v4-engine/tailwind-v3-default-colors.d.ts +1 -0
  220. package/dist/tailwindcss/v4-engine/tailwind-v4-default-colors.d.ts +1 -0
  221. package/dist/tailwindcss/v4-engine/types.d.ts +19 -0
  222. package/dist/tailwindcss/version.d.ts +4 -0
  223. package/dist/tailwindcss-Bu-RWIHx.js +630 -0
  224. package/dist/tailwindcss-C5IgPlQ0.mjs +579 -0
  225. package/dist/typedoc.export.d.ts +3 -0
  226. package/dist/types/base.d.ts +1 -0
  227. package/dist/types/index.d.ts +97 -0
  228. package/dist/types/shared.d.ts +10 -0
  229. package/dist/types/user-defined-options/general.d.ts +29 -0
  230. package/dist/types/user-defined-options/important.d.ts +37 -0
  231. package/dist/types/user-defined-options/index.d.ts +11 -0
  232. package/dist/types/user-defined-options/lifecycle.d.ts +6 -0
  233. package/dist/types/user-defined-options/matcher.d.ts +9 -0
  234. package/dist/types.d.ts +1 -150
  235. package/dist/types.js +0 -1
  236. package/dist/types.mjs +1 -1
  237. package/dist/uni-app-x/component-local-style.d.ts +19 -0
  238. package/dist/uni-app-x/index.d.ts +2 -0
  239. package/dist/uni-app-x/options.d.ts +12 -0
  240. package/dist/uni-app-x/style-isolation.d.ts +2 -0
  241. package/dist/uni-app-x/transform.d.ts +9 -0
  242. package/dist/uni-app-x/vite.d.ts +36 -0
  243. package/dist/utils/decode.d.ts +2 -0
  244. package/dist/utils/disabled.d.ts +5 -0
  245. package/dist/utils/hbuilderx.d.ts +5 -0
  246. package/dist/utils/index.d.ts +7 -0
  247. package/dist/utils/nameMatcher.d.ts +4 -0
  248. package/dist/utils/resolve-package.d.ts +1 -0
  249. package/dist/utils/uni-platform.d.ts +11 -0
  250. package/dist/utils-BiShvil9.js +61 -0
  251. package/dist/utils-Btw1iOVV.mjs +48 -0
  252. package/dist/vite-BU74SkOi.mjs +2246 -0
  253. package/dist/vite-CKjx_5c3.js +2261 -0
  254. package/dist/vite.d.ts +3 -17
  255. package/dist/vite.js +4 -14
  256. package/dist/vite.mjs +2 -14
  257. package/dist/weapp-tw-css-import-rewrite-loader.js +68 -92
  258. package/dist/weapp-tw-runtime-classset-loader.js +31 -50
  259. package/dist/webpack-CAk_ITq7.mjs +713 -0
  260. package/dist/webpack-damWiYqY.js +723 -0
  261. package/dist/webpack.d.ts +4 -25
  262. package/dist/webpack.js +6 -17
  263. package/dist/webpack.mjs +2 -17
  264. package/dist/wxml/Tokenizer.d.ts +15 -0
  265. package/dist/wxml/custom-attributes.d.ts +4 -0
  266. package/dist/wxml/index.d.ts +2 -0
  267. package/dist/wxml/shared.d.ts +2 -0
  268. package/dist/wxml/tokenizer/types.d.ts +18 -0
  269. package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +2 -0
  270. package/dist/wxml/utils/codegen/legacy-visitor.d.ts +8 -0
  271. package/dist/wxml/utils/codegen.d.ts +2 -0
  272. package/dist/wxml/utils/custom-template.d.ts +3 -0
  273. package/dist/wxml/utils/fragment-helpers.d.ts +6 -0
  274. package/dist/wxml/utils/fragment-updater.d.ts +4 -0
  275. package/dist/wxml/utils/template-fragments.d.ts +3 -0
  276. package/dist/wxml/utils.d.ts +8 -0
  277. package/dist/wxml/whitespace.d.ts +2 -0
  278. package/generator-placeholder.css +1 -0
  279. package/package.json +39 -38
  280. package/dist/chunk-24AGZQVR.js +0 -183
  281. package/dist/chunk-3VQKDHGP.mjs +0 -179
  282. package/dist/chunk-4AFQP74Z.js +0 -24
  283. package/dist/chunk-57SOQCAU.mjs +0 -582
  284. package/dist/chunk-5ZYHNDEK.mjs +0 -2439
  285. package/dist/chunk-76S2EME4.mjs +0 -34
  286. package/dist/chunk-A5PB4KZT.js +0 -138
  287. package/dist/chunk-DUHYLR2R.js +0 -276
  288. package/dist/chunk-DYLQ6UOI.js +0 -71
  289. package/dist/chunk-E7I5TW5K.js +0 -52
  290. package/dist/chunk-FS2NOOEB.js +0 -292
  291. package/dist/chunk-HVNGIKLS.js +0 -3930
  292. package/dist/chunk-JZQBZHN5.js +0 -579
  293. package/dist/chunk-KGTVD4EP.mjs +0 -3930
  294. package/dist/chunk-NNOQDMUP.mjs +0 -10
  295. package/dist/chunk-OF6MFURR.js +0 -34
  296. package/dist/chunk-OFB2KBRP.js +0 -2442
  297. package/dist/chunk-OOHJLO5M.mjs +0 -71
  298. package/dist/chunk-PCDYXXSK.mjs +0 -1515
  299. package/dist/chunk-RKISS72P.js +0 -7
  300. package/dist/chunk-RRQZL7FQ.mjs +0 -292
  301. package/dist/chunk-XAKAD2CR.mjs +0 -138
  302. package/dist/chunk-XZP3MREK.mjs +0 -276
  303. package/dist/chunk-ZAA5ZG3D.js +0 -1518
  304. package/dist/chunk-ZCH4YINE.mjs +0 -52
  305. package/dist/cli.d.mts +0 -2
  306. package/dist/core.d.mts +0 -26
  307. package/dist/css-macro/postcss.d.mts +0 -7
  308. package/dist/css-macro.d.mts +0 -18
  309. package/dist/defaults.d.mts +0 -11
  310. package/dist/gulp.d.mts +0 -24
  311. package/dist/index-BXrmQelt.d.mts +0 -672
  312. package/dist/index-BXrmQelt.d.ts +0 -672
  313. package/dist/index.d.mts +0 -15
  314. package/dist/postcss-html-transform.d.mts +0 -2
  315. package/dist/presets.d.mts +0 -76
  316. package/dist/reset.d.mts +0 -1
  317. package/dist/types.d.mts +0 -150
  318. package/dist/vite.d.mts +0 -17
  319. package/dist/webpack.d.mts +0 -25
  320. package/dist/webpack4.d.mts +0 -26
  321. package/dist/webpack4.d.ts +0 -26
  322. package/dist/webpack4.js +0 -493
  323. package/dist/webpack4.mjs +0 -495
  324. package/scripts/postinstall.mjs +0 -59
@@ -0,0 +1,10 @@
1
+ import type { ItemOrItemArray } from './base';
2
+ export type AppType = 'uni-app' | 'uni-app-vite' | 'uni-app-x' | 'taro' | 'remax' | 'rax' | 'native' | 'kbone' | 'mpx' | 'weapp-vite';
3
+ export type ICustomAttributes = Record<string, ItemOrItemArray<string | RegExp>> | Map<string | RegExp, ItemOrItemArray<string | RegExp>>;
4
+ export type ICustomAttributesEntities = [string | RegExp, ItemOrItemArray<string | RegExp>][];
5
+ export interface IArbitraryValues {
6
+ allowDoubleQuotes?: boolean;
7
+ bareArbitraryValues?: boolean | {
8
+ units?: string[];
9
+ };
10
+ }
@@ -0,0 +1,29 @@
1
+ import type { ParserOptions } from '@babel/parser';
2
+ import type { LoadedPostcssOptions } from '@weapp-tailwindcss/postcss/types';
3
+ import type { ILengthUnitsPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
4
+ import type { ICreateCacheReturnType } from '../../cache';
5
+ import type { WeappTailwindcssGeneratorUserOptions } from '../../generator';
6
+ import type { AppType, IArbitraryValues } from '../shared';
7
+ export interface UserDefinedOptionsGeneralPart {
8
+ supportCustomLengthUnitsPatch?: ILengthUnitsPatchOptions | boolean;
9
+ appType?: AppType;
10
+ arbitraryValues?: IArbitraryValues;
11
+ jsPreserveClass?: (keyword: string) => boolean | undefined;
12
+ jsArbitraryValueFallback?: boolean | 'auto';
13
+ replaceRuntimePackages?: boolean | Record<string, string>;
14
+ generator?: WeappTailwindcssGeneratorUserOptions;
15
+ disabledDefaultTemplateHandler?: boolean;
16
+ runtimeLoaderPath?: string;
17
+ tailwindcssBasedir?: string;
18
+ cache?: boolean | ICreateCacheReturnType;
19
+ babelParserOptions?: ParserOptions & {
20
+ cache?: boolean;
21
+ cacheKey?: string;
22
+ };
23
+ cssChildCombinatorReplaceValue?: string | string[];
24
+ postcssOptions?: LoadedPostcssOptions;
25
+ cssRemoveHoverPseudoClass?: boolean;
26
+ cssRemoveProperty?: boolean;
27
+ tailwindcssPatcherOptions?: TailwindCssPatchOptions;
28
+ logLevel?: 'info' | 'warn' | 'error' | 'silent';
29
+ }
@@ -0,0 +1,37 @@
1
+ import type { CssCalcOptions, CssPreflightOptions, PresetEnvOptions, Px2rpxOptions, Rem2rpxOptions, UniAppXUnsupportedMode, UnitsToPxOptions, WeappAutoprefixerOptions } from '@weapp-tailwindcss/postcss/types';
2
+ import type { TailwindCssPatchOptions } from 'tailwindcss-patch';
3
+ import type { ICustomAttributes } from '../shared';
4
+ export interface UniAppXComponentLocalStylesOptions {
5
+ enabled?: boolean;
6
+ onlyWhenStyleIsolationVersion2?: boolean;
7
+ }
8
+ export interface UniAppXOptions {
9
+ enabled?: boolean;
10
+ componentLocalStyles?: boolean | UniAppXComponentLocalStylesOptions;
11
+ uvueUnsupported?: UniAppXUnsupportedMode;
12
+ }
13
+ export interface UserDefinedOptionsImportantPart {
14
+ disabled?: boolean | {
15
+ plugin?: boolean;
16
+ };
17
+ customAttributes?: ICustomAttributes;
18
+ customReplaceDictionary?: Record<string, string>;
19
+ ignoreTaggedTemplateExpressionIdentifiers?: (string | RegExp)[];
20
+ ignoreCallExpressionIdentifiers?: (string | RegExp)[];
21
+ cssPreflight?: CssPreflightOptions;
22
+ cssPreflightRange?: 'all';
23
+ cssCalc?: boolean | CssCalcOptions | (string | RegExp)[];
24
+ injectAdditionalCssVarScope?: boolean;
25
+ cssSelectorReplacement?: {
26
+ root?: string | string[] | false;
27
+ universal?: string | string[] | false;
28
+ };
29
+ rem2rpx?: boolean | Rem2rpxOptions;
30
+ px2rpx?: boolean | Px2rpxOptions;
31
+ unitsToPx?: boolean | UnitsToPxOptions;
32
+ cssPresetEnv?: PresetEnvOptions;
33
+ autoprefixer?: WeappAutoprefixerOptions;
34
+ tailwindcss?: TailwindCssPatchOptions['tailwindcss'];
35
+ cssEntries?: string[];
36
+ uniAppX?: boolean | UniAppXOptions;
37
+ }
@@ -0,0 +1,11 @@
1
+ import type { UserDefinedOptionsGeneralPart } from './general';
2
+ import type { UserDefinedOptionsImportantPart } from './important';
3
+ import type { UserDefinedOptionsLifecyclePart } from './lifecycle';
4
+ import type { UserDefinedOptionsMatcherPart } from './matcher';
5
+ export type { UserDefinedOptionsGeneralPart, } from './general';
6
+ export type { UniAppXComponentLocalStylesOptions, UniAppXOptions, } from './important';
7
+ export type { UserDefinedOptionsImportantPart, } from './important';
8
+ export type { UserDefinedOptionsLifecyclePart, } from './lifecycle';
9
+ export type { UserDefinedOptionsMatcherPart, } from './matcher';
10
+ export interface UserDefinedOptions extends UserDefinedOptionsGeneralPart, UserDefinedOptionsImportantPart, UserDefinedOptionsLifecyclePart, UserDefinedOptionsMatcherPart {
11
+ }
@@ -0,0 +1,6 @@
1
+ export interface UserDefinedOptionsLifecyclePart {
2
+ onLoad?: () => void;
3
+ onStart?: () => void;
4
+ onUpdate?: (filename: string, oldVal: string, newVal: string) => void;
5
+ onEnd?: () => void;
6
+ }
@@ -0,0 +1,9 @@
1
+ import type { AppType } from '../shared';
2
+ export interface UserDefinedOptionsMatcherPart {
3
+ htmlMatcher?: (name: string) => boolean;
4
+ cssMatcher?: (name: string) => boolean;
5
+ jsMatcher?: (name: string) => boolean;
6
+ mainCssChunkMatcher?: (name: string, appType?: AppType) => boolean;
7
+ wxsMatcher?: (name: string) => boolean;
8
+ inlineWxs?: boolean;
9
+ }
package/dist/types.d.ts CHANGED
@@ -1,150 +1 @@
1
- import { ParserOptions, ParseError } from '@babel/parser';
2
- import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
3
- export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
4
- import { SourceMap } from 'magic-string';
5
- import { Result, Root, Document } from 'postcss';
6
- import { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
7
- import { I as IArbitraryValues, e as UserDefinedOptions, b as ICustomAttributesEntities, f as ICreateCacheReturnType, A as AppType } from './index-BXrmQelt.js';
8
- export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions } from './index-BXrmQelt.js';
9
- import 'node:buffer';
10
- import 'webpack';
11
- import 'lru-cache';
12
-
13
- type AsyncableMethod<T> = T extends (...args: infer A) => infer R ? (...args: A) => Promise<Awaited<R>> | Awaited<R> : never;
14
-
15
- interface LinkedJsModuleResult {
16
- code: string;
17
- }
18
- interface JsHandlerResult {
19
- code: string;
20
- map?: SourceMap;
21
- error?: ParseError;
22
- /**
23
- * 因跨文件分析而被转换的额外模块,使用绝对文件路径作为键。
24
- */
25
- linked?: Record<string, LinkedJsModuleResult>;
26
- }
27
- interface TailwindcssPatcherLike {
28
- packageInfo: TailwindcssPatcher['packageInfo'];
29
- majorVersion?: TailwindcssPatcher['majorVersion'];
30
- patch: TailwindcssPatcher['patch'];
31
- getClassSet: AsyncableMethod<TailwindcssPatcher['getClassSet']>;
32
- getClassSetSync?: TailwindcssPatcher['getClassSetSync'];
33
- extract: TailwindcssPatcher['extract'];
34
- collectContentTokens?: TailwindcssPatcher['collectContentTokens'];
35
- options?: TailwindcssPatcher['options'];
36
- }
37
- interface RefreshTailwindcssPatcherOptions {
38
- clearCache?: boolean;
39
- }
40
- interface IJsHandlerOptions {
41
- escapeMap?: Record<string, string>;
42
- classNameSet?: Set<string>;
43
- /**
44
- * 兼容字段:不再参与 JS 候选判定。
45
- *
46
- * JS 转译统一遵循 `classNameSet` 精确命中策略,仅转换 tailwindcss-patch 提供的类名集合。
47
- */
48
- staleClassNameFallback?: boolean;
49
- /**
50
- * 控制在 classNameSet 异常时的任意值兜底策略。
51
- *
52
- * - `false`:关闭兜底。
53
- * - `true`:在 class 语义上下文中允许任意值兜底。
54
- * - `'auto'`:仅在 TailwindCSS v4 且 classNameSet 为空时启用。
55
- */
56
- jsArbitraryValueFallback?: boolean | 'auto';
57
- /**
58
- * 当前 TailwindCSS 主版本号,用于自动兜底判定。
59
- */
60
- tailwindcssMajorVersion?: number;
61
- arbitraryValues?: IArbitraryValues;
62
- jsPreserveClass?: (keyword: string) => boolean | undefined;
63
- needEscaped?: boolean;
64
- generateMap?: boolean;
65
- alwaysEscape?: boolean;
66
- unescapeUnicode?: boolean;
67
- babelParserOptions?: ParserOptions;
68
- ignoreTaggedTemplateExpressionIdentifiers?: (string | RegExp)[];
69
- ignoreCallExpressionIdentifiers?: (string | RegExp)[];
70
- uniAppX?: boolean;
71
- moduleSpecifierReplacements?: Record<string, string>;
72
- /**
73
- * 为 `true` 时将输入视作独立表达式,而非完整的程序。
74
- * 适用于 `:class="{ 'foo bar': cond }"` 等模板绑定场景。
75
- */
76
- wrapExpression?: boolean;
77
- /**
78
- * 当前正在转换的模块绝对路径。
79
- * 启用跨文件分析时必须提供。
80
- */
81
- filename?: string;
82
- /**
83
- * 配置跨文件模块图分析行为。
84
- */
85
- moduleGraph?: JsModuleGraphOptions;
86
- }
87
- interface JsHandler {
88
- (rawSource: string, set?: Set<string>, options?: CreateJsHandlerOptions): JsHandlerResult;
89
- }
90
- interface ICommonReplaceOptions {
91
- keepEOL?: boolean;
92
- escapeMap?: Record<string, string>;
93
- }
94
- interface ITemplateHandlerOptions extends ICommonReplaceOptions {
95
- customAttributesEntities?: ICustomAttributesEntities;
96
- escapeMap?: Record<string, string>;
97
- inlineWxs?: boolean;
98
- jsHandler?: JsHandler;
99
- runtimeSet?: Set<string>;
100
- disabledDefaultTemplateHandler?: boolean;
101
- quote?: string | null;
102
- ignoreHead?: boolean;
103
- wrapExpression?: boolean;
104
- }
105
- type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, 'supportCustomLengthUnitsPatch' | 'customReplaceDictionary' | 'cache'> & {
106
- supportCustomLengthUnitsPatch: ILengthUnitsPatchOptions | boolean;
107
- templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => Promise<string>;
108
- styleHandler: (rawSource: string, options?: IStyleHandlerOptions) => Promise<Result<Root | Document>>;
109
- jsHandler: JsHandler;
110
- escapeMap: Record<string, string>;
111
- customReplaceDictionary: Record<string, string>;
112
- cache: ICreateCacheReturnType;
113
- twPatcher: TailwindcssPatcherLike;
114
- refreshTailwindcssPatcher: (options?: RefreshTailwindcssPatcherOptions) => Promise<TailwindcssPatcherLike>;
115
- }>;
116
- type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | 'cssPreflightRange' | 'disabled'>;
117
- interface IBaseWebpackPlugin {
118
- options: InternalUserDefinedOptions;
119
- appType?: AppType;
120
- apply: (compiler: any) => void;
121
- }
122
- /**
123
- * @description InternalPatchResult
124
- */
125
- interface InternalPatchResult {
126
- dataTypes?: string;
127
- processTailwindFeatures?: string;
128
- plugin?: string;
129
- }
130
- type CreateJsHandlerOptions = Omit<IJsHandlerOptions, 'classNameSet'>;
131
- interface JsModuleGraphOptions {
132
- /**
133
- * 将导入的标识符解析为绝对文件路径。
134
- */
135
- resolve: (specifier: string, importer: string) => string | undefined;
136
- /**
137
- * 同步加载模块源码。
138
- */
139
- load: (id: string) => string | undefined;
140
- /**
141
- * 可选过滤器,用于跳过特定模块。
142
- */
143
- filter?: (id: string, specifier: string, importer: string) => boolean;
144
- /**
145
- * 最大遍历深度,默认无限制(`Infinity`)。
146
- */
147
- maxDepth?: number;
148
- }
149
-
150
- export { AppType, type CreateJsHandlerOptions, IArbitraryValues, type IBaseWebpackPlugin, type ICommonReplaceOptions, ICustomAttributesEntities, type IJsHandlerOptions, type ITemplateHandlerOptions, type InternalPatchResult, type InternalPostcssOptions, type InternalUserDefinedOptions, type JsHandler, type JsHandlerResult, type JsModuleGraphOptions, type LinkedJsModuleResult, type RefreshTailwindcssPatcherOptions, type TailwindcssPatcherLike, UserDefinedOptions };
1
+ export * from './types/index'
package/dist/types.js CHANGED
@@ -1 +0,0 @@
1
- "use strict";require('./chunk-RKISS72P.js');
package/dist/types.mjs CHANGED
@@ -1 +1 @@
1
- import "./chunk-NNOQDMUP.mjs";
1
+ export {};
@@ -0,0 +1,19 @@
1
+ interface RewriteCodeOptions {
2
+ wrapExpression?: boolean;
3
+ }
4
+ export declare function shouldEnableComponentLocalStyle(id: string): boolean;
5
+ export declare class UniAppXComponentLocalStyleCollector {
6
+ private readonly fileId;
7
+ private readonly runtimeSet?;
8
+ private aliasByUtility;
9
+ private aliasByLookup;
10
+ constructor(fileId: string, runtimeSet?: Set<string> | undefined);
11
+ private ensureAlias;
12
+ private rewriteLiteral;
13
+ collectAndRewriteStaticClass(literal: string): string;
14
+ collectRuntimeClasses(rawSource: string, options?: RewriteCodeOptions): void;
15
+ rewriteTransformedCode(rawSource: string, options?: RewriteCodeOptions): string;
16
+ hasStyles(): boolean;
17
+ toStyleBlock(): string;
18
+ }
19
+ export {};
@@ -0,0 +1,2 @@
1
+ export { transformUVue } from './transform';
2
+ export { createUniAppXAssetTask, createUniAppXPlugins } from './vite';
@@ -0,0 +1,12 @@
1
+ import type { UserDefinedOptions } from '../types';
2
+ export interface ResolvedUniAppXComponentLocalStylesOptions {
3
+ enabled: boolean;
4
+ onlyWhenStyleIsolationVersion2: boolean;
5
+ }
6
+ export interface ResolvedUniAppXOptions {
7
+ enabled: boolean;
8
+ componentLocalStyles: ResolvedUniAppXComponentLocalStylesOptions;
9
+ uvueUnsupported: 'error' | 'warn' | 'silent';
10
+ }
11
+ export declare function resolveUniAppXOptions(option: UserDefinedOptions['uniAppX']): ResolvedUniAppXOptions;
12
+ export declare function isUniAppXEnabled(option: UserDefinedOptions['uniAppX']): boolean;
@@ -0,0 +1,2 @@
1
+ export declare function resolveUniAppXStyleIsolationEnabled(root?: string): boolean;
2
+ export declare function clearUniAppXStyleIsolationCache(): void;
@@ -0,0 +1,9 @@
1
+ import type { TransformResult } from 'vite';
2
+ import type { ICustomAttributesEntities, JsHandler } from '../types';
3
+ interface TransformUVueOptions {
4
+ customAttributesEntities?: ICustomAttributesEntities;
5
+ disabledDefaultTemplateHandler?: boolean;
6
+ enableComponentLocalStyle?: boolean;
7
+ }
8
+ export declare function transformUVue(code: string, id: string, jsHandler: JsHandler, runtimeSet?: Set<string>, options?: TransformUVueOptions): undefined | TransformResult;
9
+ export {};
@@ -0,0 +1,36 @@
1
+ import type { OutputAsset } from 'rollup';
2
+ import type { Plugin, ResolvedConfig } from 'vite';
3
+ import type { ICreateCacheReturnType } from '../cache';
4
+ import type { AppType, CreateJsHandlerOptions, ICustomAttributesEntities, InternalUserDefinedOptions, JsHandler, LinkedJsModuleResult } from '../types';
5
+ interface UniAppXRuntimeState {
6
+ readyPromise: Promise<unknown>;
7
+ }
8
+ interface CreateUniAppXPluginsOptions {
9
+ appType: AppType;
10
+ customAttributesEntities: ICustomAttributesEntities;
11
+ disabledDefaultTemplateHandler: boolean;
12
+ mainCssChunkMatcher: NonNullable<InternalUserDefinedOptions['mainCssChunkMatcher']>;
13
+ runtimeState: UniAppXRuntimeState;
14
+ styleHandler: InternalUserDefinedOptions['styleHandler'];
15
+ jsHandler: JsHandler;
16
+ ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
17
+ getResolvedConfig: () => ResolvedConfig | undefined;
18
+ isIosPlatform?: boolean;
19
+ uniAppX?: InternalUserDefinedOptions['uniAppX'];
20
+ }
21
+ export declare function createUniAppXPlugins(options: CreateUniAppXPluginsOptions): Plugin[];
22
+ type ApplyLinkedResults = (linked: Record<string, LinkedJsModuleResult> | undefined) => void;
23
+ interface CreateUniAppXAssetTaskOptions {
24
+ cache: ICreateCacheReturnType;
25
+ hashKey?: string;
26
+ hashSalt?: string;
27
+ createHandlerOptions: (absoluteFilename: string, extra?: CreateJsHandlerOptions) => CreateJsHandlerOptions;
28
+ debug: (format: string, ...args: unknown[]) => void;
29
+ jsHandler: JsHandler;
30
+ onUpdate: (filename: string, oldVal: string, newVal: string) => void;
31
+ runtimeSet: Set<string>;
32
+ applyLinkedResults: ApplyLinkedResults;
33
+ uniAppX?: InternalUserDefinedOptions['uniAppX'];
34
+ }
35
+ export declare function createUniAppXAssetTask(file: string, originalSource: OutputAsset, outDir: string, options: CreateUniAppXAssetTaskOptions): () => Promise<void>;
36
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function decodeUnicode(value: string): string;
2
+ export declare function decodeUnicode2(input: string): any;
@@ -0,0 +1,5 @@
1
+ import type { UserDefinedOptions } from '../types';
2
+ export interface ResolvedPluginDisabledState {
3
+ plugin: boolean;
4
+ }
5
+ export declare function resolvePluginDisabledState(disabled: UserDefinedOptions['disabled']): ResolvedPluginDisabledState;
@@ -0,0 +1,5 @@
1
+ export interface HBuilderXRuntimeHints {
2
+ cwd?: string;
3
+ nodePath?: string | null;
4
+ }
5
+ export declare function isRunningInHBuilderX(options?: HBuilderXRuntimeHints): boolean;
@@ -0,0 +1,7 @@
1
+ import type { InternalUserDefinedOptions } from '../types';
2
+ import { defu, defuOverrideArray, groupBy, isMap, isRegexp, noop, regExpTest, removeExt } from '@weapp-tailwindcss/shared';
3
+ export * from './hbuilderx';
4
+ export * from './uni-platform';
5
+ export { defu, defuOverrideArray, groupBy, isMap, isRegexp, noop, regExpTest, removeExt, };
6
+ export type EntryGroup = 'css' | 'html' | 'js' | 'other';
7
+ export declare function getGroupedEntries<T>(entries: [string, T][], options: InternalUserDefinedOptions): Record<EntryGroup, [string, T][]>;
@@ -0,0 +1,4 @@
1
+ export type NameMatcher = (value: string) => boolean;
2
+ export declare function createNameMatcher(list: (string | RegExp)[] | undefined, { exact }?: {
3
+ exact?: boolean;
4
+ }): NameMatcher;
@@ -0,0 +1 @@
1
+ export declare function resolvePackageDir(name: string): string;
@@ -0,0 +1,11 @@
1
+ export interface UniUtsPlatformInfo {
2
+ raw: string | undefined;
3
+ normalized: string | undefined;
4
+ isApp: boolean;
5
+ isAppAndroid: boolean;
6
+ isAppHarmony: boolean;
7
+ isAppIos: boolean;
8
+ isMp: boolean;
9
+ isWeb: boolean;
10
+ }
11
+ export declare function resolveUniUtsPlatform(value?: string | undefined): UniUtsPlatformInfo;
@@ -0,0 +1,61 @@
1
+ const require_chunk = require("./chunk-8l464Juk.js");
2
+ let node_process = require("node:process");
3
+ node_process = require_chunk.__toESM(node_process);
4
+ require("@weapp-tailwindcss/shared");
5
+ //#region src/utils/uni-platform.ts
6
+ function normalizePlatform(value) {
7
+ return value?.trim().toLowerCase() || void 0;
8
+ }
9
+ function resolveUniUtsPlatform(value = node_process.default.env.UNI_UTS_PLATFORM) {
10
+ const normalized = normalizePlatform(value);
11
+ const isAppAndroid = normalized === "app-android";
12
+ const isAppIos = normalized === "app-ios";
13
+ const isAppHarmony = normalized === "app-harmony";
14
+ return {
15
+ raw: value,
16
+ normalized,
17
+ isApp: normalized?.startsWith("app-") === true || normalized === "app" || normalized === "app-plus",
18
+ isAppAndroid,
19
+ isAppHarmony,
20
+ isAppIos,
21
+ isMp: normalized?.startsWith("mp-") === true,
22
+ isWeb: normalized?.startsWith("web") === true || normalized === "h5"
23
+ };
24
+ }
25
+ //#endregion
26
+ //#region src/utils/index.ts
27
+ function classifyEntry(filename, options) {
28
+ if (options.cssMatcher(filename)) return "css";
29
+ if (options.htmlMatcher(filename)) return "html";
30
+ if (options.jsMatcher(filename) || options.wxsMatcher(filename)) return "js";
31
+ return "other";
32
+ }
33
+ function createEmptyGroups() {
34
+ return {
35
+ css: [],
36
+ html: [],
37
+ js: [],
38
+ other: []
39
+ };
40
+ }
41
+ function getGroupedEntries(entries, options) {
42
+ const groups = createEmptyGroups();
43
+ for (const entry of entries) {
44
+ const [filename] = entry;
45
+ groups[classifyEntry(filename, options)].push(entry);
46
+ }
47
+ return groups;
48
+ }
49
+ //#endregion
50
+ Object.defineProperty(exports, "getGroupedEntries", {
51
+ enumerable: true,
52
+ get: function() {
53
+ return getGroupedEntries;
54
+ }
55
+ });
56
+ Object.defineProperty(exports, "resolveUniUtsPlatform", {
57
+ enumerable: true,
58
+ get: function() {
59
+ return resolveUniUtsPlatform;
60
+ }
61
+ });
@@ -0,0 +1,48 @@
1
+ import process from "node:process";
2
+ import { defu, defuOverrideArray as defuOverrideArray$1, isMap, noop } from "@weapp-tailwindcss/shared";
3
+ //#region src/utils/uni-platform.ts
4
+ function normalizePlatform(value) {
5
+ return value?.trim().toLowerCase() || void 0;
6
+ }
7
+ function resolveUniUtsPlatform(value = process.env.UNI_UTS_PLATFORM) {
8
+ const normalized = normalizePlatform(value);
9
+ const isAppAndroid = normalized === "app-android";
10
+ const isAppIos = normalized === "app-ios";
11
+ const isAppHarmony = normalized === "app-harmony";
12
+ return {
13
+ raw: value,
14
+ normalized,
15
+ isApp: normalized?.startsWith("app-") === true || normalized === "app" || normalized === "app-plus",
16
+ isAppAndroid,
17
+ isAppHarmony,
18
+ isAppIos,
19
+ isMp: normalized?.startsWith("mp-") === true,
20
+ isWeb: normalized?.startsWith("web") === true || normalized === "h5"
21
+ };
22
+ }
23
+ //#endregion
24
+ //#region src/utils/index.ts
25
+ function classifyEntry(filename, options) {
26
+ if (options.cssMatcher(filename)) return "css";
27
+ if (options.htmlMatcher(filename)) return "html";
28
+ if (options.jsMatcher(filename) || options.wxsMatcher(filename)) return "js";
29
+ return "other";
30
+ }
31
+ function createEmptyGroups() {
32
+ return {
33
+ css: [],
34
+ html: [],
35
+ js: [],
36
+ other: []
37
+ };
38
+ }
39
+ function getGroupedEntries(entries, options) {
40
+ const groups = createEmptyGroups();
41
+ for (const entry of entries) {
42
+ const [filename] = entry;
43
+ groups[classifyEntry(filename, options)].push(entry);
44
+ }
45
+ return groups;
46
+ }
47
+ //#endregion
48
+ export { noop as a, isMap as i, defuOverrideArray$1 as n, resolveUniUtsPlatform as o, getGroupedEntries as r, defu as t };