weapp-tailwindcss 4.12.0 → 5.0.0-next.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 (308) hide show
  1. package/dist/babel/index.d.ts +3 -0
  2. package/dist/bundlers/gulp/index.d.ts +7 -0
  3. package/dist/bundlers/shared/cache.d.ts +16 -0
  4. package/dist/bundlers/shared/css-cleanup.d.ts +4 -0
  5. package/dist/bundlers/shared/css-imports.d.ts +8 -0
  6. package/dist/bundlers/shared/generator-candidates.d.ts +5 -0
  7. package/dist/bundlers/shared/generator-css.d.ts +41 -0
  8. package/dist/bundlers/shared/module-graph.d.ts +5 -0
  9. package/dist/bundlers/shared/run-tasks.d.ts +2 -0
  10. package/dist/bundlers/vite/bundle-entries.d.ts +14 -0
  11. package/dist/bundlers/vite/bundle-state.d.ts +43 -0
  12. package/dist/bundlers/vite/css-finalizer.d.ts +19 -0
  13. package/dist/bundlers/vite/generate-bundle.d.ts +20 -0
  14. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +21 -0
  15. package/dist/bundlers/vite/index.d.ts +3 -0
  16. package/dist/bundlers/vite/js-precheck.d.ts +1 -0
  17. package/dist/bundlers/vite/query.d.ts +15 -0
  18. package/dist/bundlers/vite/resolve-app-type.d.ts +2 -0
  19. package/dist/bundlers/vite/rewrite-css-imports.d.ts +11 -0
  20. package/dist/bundlers/vite/runtime-affecting-signature.d.ts +2 -0
  21. package/dist/bundlers/vite/utils.d.ts +9 -0
  22. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +20 -0
  23. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +14 -0
  24. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +15 -0
  25. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +9 -0
  26. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +17 -0
  27. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +19 -0
  28. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +9 -0
  29. package/dist/bundlers/webpack/index.d.ts +1 -0
  30. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +12 -0
  31. package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +11 -0
  32. package/dist/bundlers/webpack/shared/css-imports.d.ts +6 -0
  33. package/dist/bundlers/webpack/shared/loader-anchors.d.ts +8 -0
  34. package/dist/cache/index.d.ts +38 -0
  35. package/dist/cache/md5.d.ts +1 -0
  36. package/dist/chunk-8l464Juk.js +28 -0
  37. package/dist/cli/config.d.ts +5 -0
  38. package/dist/cli/context.d.ts +16 -0
  39. package/dist/cli/doctor/constants.d.ts +7 -0
  40. package/dist/cli/doctor/types.d.ts +31 -0
  41. package/dist/cli/doctor.d.ts +4 -0
  42. package/dist/cli/helpers/options/format.d.ts +2 -0
  43. package/dist/cli/helpers/options/parse.d.ts +3 -0
  44. package/dist/cli/helpers/options/resolve.d.ts +1 -0
  45. package/dist/cli/helpers/options.d.ts +3 -0
  46. package/dist/cli/helpers/patch-cwd.d.ts +1 -0
  47. package/dist/cli/helpers.d.ts +5 -0
  48. package/dist/cli/mount-options/patch-status.d.ts +2 -0
  49. package/dist/cli/mount-options.d.ts +2 -0
  50. package/dist/cli/patch-options.d.ts +6 -0
  51. package/dist/cli/tokens.d.ts +4 -0
  52. package/dist/cli/types.d.ts +17 -0
  53. package/dist/cli/vscode-entry.d.ts +14 -0
  54. package/dist/cli/workspace/package-dirs.d.ts +3 -0
  55. package/dist/cli/workspace/patch-package.d.ts +3 -0
  56. package/dist/cli/workspace/patch-utils.d.ts +3 -0
  57. package/dist/cli/workspace/types.d.ts +11 -0
  58. package/dist/cli/workspace/workspace-globs.d.ts +2 -0
  59. package/dist/cli/workspace/workspace-io.d.ts +1 -0
  60. package/dist/cli/workspace/workspace-lock.d.ts +1 -0
  61. package/dist/cli/workspace.d.ts +2 -0
  62. package/dist/cli.d.ts +1 -2
  63. package/dist/cli.js +2425 -3524
  64. package/dist/cli.mjs +2402 -3505
  65. package/dist/constants-B-_T5UnW.mjs +44 -0
  66. package/dist/constants-p1dyh1x1.js +73 -0
  67. package/dist/constants.d.ts +13 -0
  68. package/dist/context/compiler-context-cache.d.ts +3 -0
  69. package/dist/context/custom-attributes.d.ts +2 -0
  70. package/dist/context/handlers.d.ts +6 -0
  71. package/dist/context/index.d.ts +7 -0
  72. package/dist/context/logger.d.ts +4 -0
  73. package/dist/context/tailwindcss/basedir.d.ts +1 -0
  74. package/dist/context/tailwindcss/rax.d.ts +2 -0
  75. package/dist/context/tailwindcss.d.ts +4 -0
  76. package/dist/context/workspace.d.ts +3 -0
  77. package/dist/core.d.ts +5 -21
  78. package/dist/core.js +138 -180
  79. package/dist/core.mjs +135 -180
  80. package/dist/css-imports-BbrbluP9.js +177 -0
  81. package/dist/css-imports-CSdPq_Sc.mjs +128 -0
  82. package/dist/css-macro/constants.d.ts +14 -0
  83. package/dist/css-macro/index.d.ts +15 -0
  84. package/dist/css-macro/postcss.d.ts +3 -7
  85. package/dist/css-macro/postcss.js +44 -58
  86. package/dist/css-macro/postcss.mjs +44 -56
  87. package/dist/css-macro.d.ts +1 -20
  88. package/dist/css-macro.js +37 -50
  89. package/dist/css-macro.mjs +33 -47
  90. package/dist/debug/index.d.ts +5 -0
  91. package/dist/defaults.d.ts +2 -11
  92. package/dist/defaults.js +132 -8
  93. package/dist/defaults.mjs +128 -7
  94. package/dist/escape.js +31 -54
  95. package/dist/escape.mjs +18 -25
  96. package/dist/experimental/index.d.ts +2 -0
  97. package/dist/experimental/oxc/ast-utils.d.ts +30 -0
  98. package/dist/experimental/oxc/index.d.ts +2 -0
  99. package/dist/experimental/oxc/module-specifiers.d.ts +2 -0
  100. package/dist/experimental/shared/cache.d.ts +3 -0
  101. package/dist/experimental/shared/transform.d.ts +3 -0
  102. package/dist/experimental/shared.d.ts +8 -0
  103. package/dist/experimental/swc/ast-utils.d.ts +30 -0
  104. package/dist/experimental/swc/index.d.ts +2 -0
  105. package/dist/experimental/swc/module-specifiers.d.ts +2 -0
  106. package/dist/generator/index.d.ts +11 -0
  107. package/dist/generator/options.d.ts +15 -0
  108. package/dist/generator/types.d.ts +19 -0
  109. package/dist/generator-CZ-JXw6T.js +492 -0
  110. package/dist/generator-Dwxgra97.mjs +399 -0
  111. package/dist/generator-css-CnYjiMrD.js +1084 -0
  112. package/dist/generator-css-DhPFjSzK.mjs +1057 -0
  113. package/dist/generator.d.ts +1 -0
  114. package/dist/generator.js +19 -0
  115. package/dist/generator.mjs +2 -0
  116. package/dist/gulp.d.ts +4 -24
  117. package/dist/gulp.js +271 -13
  118. package/dist/gulp.mjs +263 -13
  119. package/dist/index.d.ts +8 -15
  120. package/dist/index.js +12 -24
  121. package/dist/index.mjs +6 -24
  122. package/dist/js/JsTokenUpdater.d.ts +14 -0
  123. package/dist/js/ModuleGraph.d.ts +18 -0
  124. package/dist/js/NodePathWalker.d.ts +33 -0
  125. package/dist/js/babel/parse.d.ts +9 -0
  126. package/dist/js/babel/process.d.ts +4 -0
  127. package/dist/js/babel.d.ts +13 -0
  128. package/dist/js/class-context.d.ts +3 -0
  129. package/dist/js/evalTransforms.d.ts +7 -0
  130. package/dist/js/handlers.d.ts +5 -0
  131. package/dist/js/index.d.ts +4 -0
  132. package/dist/js/module-graph/ignored-exports.d.ts +18 -0
  133. package/dist/js/module-graph/types.d.ts +17 -0
  134. package/dist/js/node-path-walker/export-handlers.d.ts +12 -0
  135. package/dist/js/node-path-walker/import-tokens.d.ts +24 -0
  136. package/dist/js/precheck.d.ts +2 -0
  137. package/dist/js/sourceAnalysis.d.ts +17 -0
  138. package/dist/js/syntax.d.ts +10 -0
  139. package/dist/js/taggedTemplateIgnore.d.ts +13 -0
  140. package/dist/js/types.d.ts +11 -0
  141. package/dist/lightningcss/index.d.ts +8 -0
  142. package/dist/lightningcss/style-handler/options.d.ts +3 -0
  143. package/dist/lightningcss/style-handler/selector-transform.d.ts +10 -0
  144. package/dist/lightningcss/style-handler/selector-utils.d.ts +10 -0
  145. package/dist/lightningcss/style-handler.d.ts +17 -0
  146. package/dist/loader-anchors-DvwgIYdA.mjs +205 -0
  147. package/dist/loader-anchors-cprm4Klq.js +273 -0
  148. package/dist/logger/index.d.ts +2 -0
  149. package/dist/logger-BZ45DZJT.js +1003 -0
  150. package/dist/logger-BoVx1Dbt.mjs +935 -0
  151. package/dist/patcher-options-6gJN2EXy.js +115 -0
  152. package/dist/patcher-options-DQfR5xxT.mjs +92 -0
  153. package/dist/postcss-html-transform.d.ts +3 -3
  154. package/dist/postcss-html-transform.js +7 -10
  155. package/dist/postcss-html-transform.mjs +3 -6
  156. package/dist/postcss.d.ts +15 -0
  157. package/dist/postcss.js +278 -0
  158. package/dist/postcss.mjs +268 -0
  159. package/dist/presets/hbuilderx.d.ts +4 -0
  160. package/dist/presets/index.d.ts +3 -0
  161. package/dist/presets/shared.d.ts +10 -0
  162. package/dist/presets/taro.d.ts +4 -0
  163. package/dist/presets/uni-app-x.d.ts +16 -0
  164. package/dist/presets/uni-app.d.ts +4 -0
  165. package/dist/presets.d.ts +1 -76
  166. package/dist/presets.js +115 -163
  167. package/dist/presets.mjs +107 -163
  168. package/dist/recorder-B_XyZ576.mjs +2763 -0
  169. package/dist/recorder-rn_2v_nd.js +2878 -0
  170. package/dist/reset/index.d.ts +2 -0
  171. package/dist/reset.d.ts +1 -4
  172. package/dist/reset.js +19 -8
  173. package/dist/reset.mjs +2 -8
  174. package/dist/shared/classname-transform.d.ts +14 -0
  175. package/dist/shared/mpx.d.ts +7 -0
  176. package/dist/shared/tailwindcss-css-redirect.d.ts +1 -0
  177. package/dist/tailwindcss/index.d.ts +11 -0
  178. package/dist/tailwindcss/miniprogram.d.ts +1 -0
  179. package/dist/tailwindcss/patcher-options.d.ts +56 -0
  180. package/dist/tailwindcss/patcher-resolve.d.ts +4 -0
  181. package/dist/tailwindcss/patcher.d.ts +13 -0
  182. package/dist/tailwindcss/recorder.d.ts +13 -0
  183. package/dist/tailwindcss/remove-unsupported-css.d.ts +2 -0
  184. package/dist/tailwindcss/runtime/cache.d.ts +11 -0
  185. package/dist/tailwindcss/runtime-logs.d.ts +3 -0
  186. package/dist/tailwindcss/runtime.d.ts +29 -0
  187. package/dist/tailwindcss/targets/paths.d.ts +13 -0
  188. package/dist/tailwindcss/targets/record-io.d.ts +5 -0
  189. package/dist/tailwindcss/targets/recorder.d.ts +3 -0
  190. package/dist/tailwindcss/targets/types.d.ts +35 -0
  191. package/dist/tailwindcss/targets.d.ts +6 -0
  192. package/dist/tailwindcss/v3-engine/generator.d.ts +2 -0
  193. package/dist/tailwindcss/v3-engine/index.d.ts +4 -0
  194. package/dist/tailwindcss/v3-engine/miniprogram.d.ts +4 -0
  195. package/dist/tailwindcss/v3-engine/source.d.ts +5 -0
  196. package/dist/tailwindcss/v3-engine/types.d.ts +55 -0
  197. package/dist/tailwindcss/v4/config.d.ts +5 -0
  198. package/dist/tailwindcss/v4/css-entries.d.ts +7 -0
  199. package/dist/tailwindcss/v4/index.d.ts +2 -0
  200. package/dist/tailwindcss/v4/multi-patcher.d.ts +2 -0
  201. package/dist/tailwindcss/v4/patcher-options.d.ts +24 -0
  202. package/dist/tailwindcss/v4/patcher.d.ts +14 -0
  203. package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -0
  204. package/dist/tailwindcss/v4-engine/generator.d.ts +2 -0
  205. package/dist/tailwindcss/v4-engine/index.d.ts +5 -0
  206. package/dist/tailwindcss/v4-engine/miniprogram.d.ts +4 -0
  207. package/dist/tailwindcss/v4-engine/source.d.ts +7 -0
  208. package/dist/tailwindcss/v4-engine/types.d.ts +17 -0
  209. package/dist/typedoc.export.d.ts +5 -0
  210. package/dist/types/base.d.ts +1 -0
  211. package/dist/types/disabled-options.d.ts +4 -0
  212. package/dist/types/index.d.ts +104 -0
  213. package/dist/types/shared.d.ts +7 -0
  214. package/dist/types/user-defined-options/general.d.ts +31 -0
  215. package/dist/types/user-defined-options/important.d.ts +37 -0
  216. package/dist/types/user-defined-options/index.d.ts +11 -0
  217. package/dist/types/user-defined-options/lifecycle.d.ts +6 -0
  218. package/dist/types/user-defined-options/matcher.d.ts +9 -0
  219. package/dist/types.d.ts +1 -150
  220. package/dist/types.js +0 -1
  221. package/dist/types.mjs +1 -1
  222. package/dist/uni-app-x/component-local-style.d.ts +19 -0
  223. package/dist/uni-app-x/index.d.ts +2 -0
  224. package/dist/uni-app-x/options.d.ts +12 -0
  225. package/dist/uni-app-x/style-isolation.d.ts +2 -0
  226. package/dist/uni-app-x/transform.d.ts +9 -0
  227. package/dist/uni-app-x/vite.d.ts +36 -0
  228. package/dist/utils/decode.d.ts +2 -0
  229. package/dist/utils/disabled.d.ts +6 -0
  230. package/dist/utils/hbuilderx.d.ts +5 -0
  231. package/dist/utils/index.d.ts +7 -0
  232. package/dist/utils/nameMatcher.d.ts +4 -0
  233. package/dist/utils/resolve-package.d.ts +1 -0
  234. package/dist/utils/uni-platform.d.ts +11 -0
  235. package/dist/utils-7DUGTFED.mjs +48 -0
  236. package/dist/utils-DmC9_In3.js +61 -0
  237. package/dist/vite-BHpAqldo.js +1952 -0
  238. package/dist/vite-C8JlHiyR.mjs +1940 -0
  239. package/dist/vite.d.ts +4 -17
  240. package/dist/vite.js +5 -14
  241. package/dist/vite.mjs +2 -14
  242. package/dist/weapp-tw-css-import-rewrite-loader.js +59 -92
  243. package/dist/weapp-tw-runtime-classset-loader.js +31 -50
  244. package/dist/webpack-CABjKGGQ.mjs +441 -0
  245. package/dist/webpack-DNIJ0ysE.js +456 -0
  246. package/dist/webpack.d.ts +4 -25
  247. package/dist/webpack.js +6 -17
  248. package/dist/webpack.mjs +2 -17
  249. package/dist/webpack4.d.ts +4 -26
  250. package/dist/webpack4.js +375 -481
  251. package/dist/webpack4.mjs +366 -482
  252. package/dist/wxml/Tokenizer.d.ts +15 -0
  253. package/dist/wxml/custom-attributes.d.ts +4 -0
  254. package/dist/wxml/index.d.ts +2 -0
  255. package/dist/wxml/shared.d.ts +2 -0
  256. package/dist/wxml/tokenizer/types.d.ts +18 -0
  257. package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +2 -0
  258. package/dist/wxml/utils/codegen/legacy-visitor.d.ts +8 -0
  259. package/dist/wxml/utils/codegen.d.ts +2 -0
  260. package/dist/wxml/utils/custom-template.d.ts +3 -0
  261. package/dist/wxml/utils/fragment-helpers.d.ts +6 -0
  262. package/dist/wxml/utils/fragment-updater.d.ts +4 -0
  263. package/dist/wxml/utils/template-fragments.d.ts +3 -0
  264. package/dist/wxml/utils.d.ts +8 -0
  265. package/dist/wxml/whitespace.d.ts +2 -0
  266. package/generator-placeholder.css +1 -0
  267. package/package.json +19 -5
  268. package/dist/chunk-24AGZQVR.js +0 -183
  269. package/dist/chunk-3VQKDHGP.mjs +0 -179
  270. package/dist/chunk-4AFQP74Z.js +0 -24
  271. package/dist/chunk-57SOQCAU.mjs +0 -582
  272. package/dist/chunk-5ZYHNDEK.mjs +0 -2439
  273. package/dist/chunk-76S2EME4.mjs +0 -34
  274. package/dist/chunk-A5PB4KZT.js +0 -138
  275. package/dist/chunk-DUHYLR2R.js +0 -276
  276. package/dist/chunk-DYLQ6UOI.js +0 -71
  277. package/dist/chunk-E7I5TW5K.js +0 -52
  278. package/dist/chunk-FS2NOOEB.js +0 -292
  279. package/dist/chunk-HVNGIKLS.js +0 -3930
  280. package/dist/chunk-JZQBZHN5.js +0 -579
  281. package/dist/chunk-KGTVD4EP.mjs +0 -3930
  282. package/dist/chunk-NNOQDMUP.mjs +0 -10
  283. package/dist/chunk-OF6MFURR.js +0 -34
  284. package/dist/chunk-OFB2KBRP.js +0 -2442
  285. package/dist/chunk-OOHJLO5M.mjs +0 -71
  286. package/dist/chunk-PCDYXXSK.mjs +0 -1515
  287. package/dist/chunk-RKISS72P.js +0 -7
  288. package/dist/chunk-RRQZL7FQ.mjs +0 -292
  289. package/dist/chunk-XAKAD2CR.mjs +0 -138
  290. package/dist/chunk-XZP3MREK.mjs +0 -276
  291. package/dist/chunk-ZAA5ZG3D.js +0 -1518
  292. package/dist/chunk-ZCH4YINE.mjs +0 -52
  293. package/dist/cli.d.mts +0 -2
  294. package/dist/core.d.mts +0 -26
  295. package/dist/css-macro/postcss.d.mts +0 -7
  296. package/dist/css-macro.d.mts +0 -18
  297. package/dist/defaults.d.mts +0 -11
  298. package/dist/gulp.d.mts +0 -24
  299. package/dist/index-BXrmQelt.d.mts +0 -672
  300. package/dist/index-BXrmQelt.d.ts +0 -672
  301. package/dist/index.d.mts +0 -15
  302. package/dist/postcss-html-transform.d.mts +0 -2
  303. package/dist/presets.d.mts +0 -76
  304. package/dist/reset.d.mts +0 -1
  305. package/dist/types.d.mts +0 -150
  306. package/dist/vite.d.mts +0 -17
  307. package/dist/webpack.d.mts +0 -25
  308. package/dist/webpack4.d.mts +0 -26
@@ -0,0 +1,3 @@
1
+ import _babelTraverse from '@babel/traverse';
2
+ export { parse, parseExpression } from '@babel/parser';
3
+ export declare const traverse: typeof _babelTraverse;
@@ -0,0 +1,7 @@
1
+ import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from '../../types';
2
+ import stream from 'node:stream';
3
+ export declare function createPlugins(options?: UserDefinedOptions): {
4
+ transformWxss: (options?: Partial<IStyleHandlerOptions>) => stream.Transform;
5
+ transformWxml: (options?: Partial<ITemplateHandlerOptions>) => stream.Transform;
6
+ transformJs: (options?: Partial<CreateJsHandlerOptions>) => stream.Transform;
7
+ };
@@ -0,0 +1,16 @@
1
+ import type { CacheValue, HashMapKey, ICreateCacheReturnType } from '../../cache';
2
+ export interface ProcessCachedTaskOptions<TValue extends CacheValue> {
3
+ cache: ICreateCacheReturnType;
4
+ cacheKey: string;
5
+ hashKey?: HashMapKey;
6
+ rawSource?: string;
7
+ hash?: string;
8
+ readCache?: () => TValue | undefined;
9
+ applyResult: (value: TValue) => void | Promise<void>;
10
+ transform: () => Promise<{
11
+ result: TValue;
12
+ cacheValue?: CacheValue;
13
+ }>;
14
+ onCacheHit?: () => void;
15
+ }
16
+ export declare function processCachedTask<TValue extends CacheValue>({ cache, cacheKey, hashKey, rawSource, hash, readCache, applyResult, transform, onCacheHit, }: ProcessCachedTaskOptions<TValue>): Promise<void>;
@@ -0,0 +1,4 @@
1
+ export declare function removeUnsupportedMiniProgramAtRules(css: string): string;
2
+ export declare function removeUnsupportedAtSupports(css: string): string;
3
+ export declare function hoistTailwindPreflightBase(css: string): string;
4
+ export declare function finalizeMiniProgramCss(css: string): string;
@@ -0,0 +1,8 @@
1
+ import type { AppType } from '../../types';
2
+ export interface ResolveTailwindcssImportOptions {
3
+ join?: (base: string, subpath: string) => string;
4
+ appType?: AppType;
5
+ rootImport?: string;
6
+ }
7
+ export declare function resolveTailwindcssImport(specifier: string, pkgDir: string, options?: ResolveTailwindcssImportOptions): string | null;
8
+ export declare function rewriteTailwindcssImportsInCode(code: string, pkgDir: string, options?: ResolveTailwindcssImportOptions): string | undefined;
@@ -0,0 +1,5 @@
1
+ export interface GeneratorCandidateSource {
2
+ content: string;
3
+ extension?: string;
4
+ }
5
+ export declare function collectGeneratorCandidatesFromSources(sources: GeneratorCandidateSource[], baseCandidates?: Iterable<string>): Promise<Set<string>>;
@@ -0,0 +1,41 @@
1
+ import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
2
+ import type { InternalUserDefinedOptions } from '../../types';
3
+ export interface GenerateCssByGeneratorOptions {
4
+ opts: InternalUserDefinedOptions;
5
+ runtimeState: {
6
+ twPatcher: InternalUserDefinedOptions['twPatcher'];
7
+ patchPromise: Promise<void>;
8
+ };
9
+ runtime: Set<string>;
10
+ rawSource: string;
11
+ file: string;
12
+ cssHandlerOptions: IStyleHandlerOptions;
13
+ cssUserHandlerOptions: IStyleHandlerOptions;
14
+ styleHandler: InternalUserDefinedOptions['styleHandler'];
15
+ debug: (format: string, ...args: unknown[]) => void;
16
+ }
17
+ export interface GenerateCssByGeneratorResult {
18
+ css: string;
19
+ target: string;
20
+ source: 'generator' | 'generator-forced';
21
+ }
22
+ export declare function createCssAppend(base: string, extra: string): string;
23
+ export declare function splitTailwindV4GeneratedCss(rawSource: string, rawTailwindCss: string): string | undefined;
24
+ export declare function removeTailwindGeneratedCssByBanner(rawSource: string): string | undefined;
25
+ export declare function stripTailwindBanner(css: string): string;
26
+ export declare function stripTailwindBanners(css: string): string;
27
+ export declare function stripGeneratorPlaceholderMarkers(css: string): string;
28
+ export declare function hasTailwindGeneratedCss(rawSource: string): boolean;
29
+ export declare function hasTailwindGeneratedCssMarkers(rawSource: string): boolean;
30
+ export declare function inheritLegacyUnitConvertedDeclarations(css: string, legacyCss: string): string;
31
+ export declare function removeTailwindSourceDirectives(rawSource: string): string;
32
+ export declare function hasTailwindSourceDirectives(rawSource: string): boolean;
33
+ export declare function resolveCssEntrySource(rawSource: string, base: string): {
34
+ css: string;
35
+ config: string | undefined;
36
+ configRequest: string | undefined;
37
+ base: string;
38
+ } | undefined;
39
+ export declare function resolveGeneratorSource(majorVersion: number | undefined, runtimeState: GenerateCssByGeneratorOptions['runtimeState'], rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions): Promise<import("@/generator").TailwindV3ResolvedSource | import("tailwindcss-patch").TailwindV4ResolvedSource>;
40
+ export declare function isPureLocalCssImportWrapper(css: string): boolean;
41
+ export declare function generateCssByGenerator(options: GenerateCssByGeneratorOptions): Promise<GenerateCssByGeneratorResult | undefined>;
@@ -0,0 +1,5 @@
1
+ export declare function normalizeOutputPathKey(value: string): string;
2
+ export declare function stripQueryAndHash(specifier: string): string;
3
+ export declare function isResolvableSpecifier(specifier: string): boolean;
4
+ export declare function toAbsoluteOutputPath(fileName: string, outDir: string): string;
5
+ export declare function resolveOutputSpecifier(specifier: string, importer: string, outDir: string, hasOutput: (value: string) => boolean): string | undefined;
@@ -0,0 +1,2 @@
1
+ export declare function runWithConcurrency<T>(factories: Array<() => Promise<T>>, limit?: number): Promise<T[]>;
2
+ export declare function pushConcurrentTaskFactories(queue: Array<Promise<void>>, factories: Array<() => Promise<unknown>>, limit?: number): void;
@@ -0,0 +1,14 @@
1
+ import type { OutputAsset, OutputChunk } from 'rollup';
2
+ import type { LinkedJsModuleResult } from '../../types';
3
+ export interface OutputEntry {
4
+ fileName: string;
5
+ output: OutputAsset | OutputChunk;
6
+ }
7
+ export declare function readOutputEntry(entry: OutputEntry): string | undefined;
8
+ export declare function isJavaScriptEntry(entry: OutputEntry): boolean;
9
+ export declare function createBundleModuleGraphOptions(outputDir: string, entries: Map<string, OutputEntry>): {
10
+ resolve(specifier: string, importer: string): string | undefined;
11
+ load(id: string): string | undefined;
12
+ filter(id: string): boolean;
13
+ };
14
+ export declare function applyLinkedResults(linked: Record<string, LinkedJsModuleResult> | undefined, entries: Map<string, OutputEntry>, onLinkedUpdate: (fileName: string, previous: string, next: string) => void, onApplied?: (entry: OutputEntry, code: string) => void): void;
@@ -0,0 +1,43 @@
1
+ import type { OutputAsset, OutputChunk } from 'rollup';
2
+ import type { OutputEntry } from './bundle-entries';
3
+ import type { InternalUserDefinedOptions } from '../../types';
4
+ export type EntryType = 'html' | 'js' | 'css' | 'other';
5
+ export interface BundleStateEntry {
6
+ file: string;
7
+ output: OutputAsset | OutputChunk;
8
+ source: string;
9
+ type: EntryType;
10
+ }
11
+ export interface ProcessFileSets {
12
+ html: Set<string>;
13
+ js: Set<string>;
14
+ css: Set<string>;
15
+ }
16
+ export interface BundleSnapshot {
17
+ entries: BundleStateEntry[];
18
+ jsEntries: Map<string, OutputEntry>;
19
+ sourceHashByFile: Map<string, string>;
20
+ runtimeAffectingSignatureByFile: Map<string, string>;
21
+ runtimeAffectingHashByFile: Map<string, string>;
22
+ changedByType: Record<EntryType, Set<string>>;
23
+ runtimeAffectingChangedByType: Record<EntryType, Set<string>>;
24
+ processFiles: ProcessFileSets;
25
+ linkedImpactsByEntry: Map<string, Set<string>>;
26
+ }
27
+ export interface BundleBuildState {
28
+ iteration: number;
29
+ sourceHashByFile: Map<string, string>;
30
+ runtimeAffectingSignatureByFile: Map<string, string>;
31
+ runtimeAffectingHashByFile: Map<string, string>;
32
+ linkedByEntry: Map<string, Set<string>>;
33
+ dependentsByLinkedFile: Map<string, Set<string>>;
34
+ }
35
+ interface UpdateBundleBuildStateOptions {
36
+ incremental?: boolean;
37
+ }
38
+ export declare function createBundleBuildState(): BundleBuildState;
39
+ export declare function classifyBundleEntry(file: string, opts: InternalUserDefinedOptions): EntryType;
40
+ export declare function buildBundleSnapshot(bundle: Record<string, OutputAsset | OutputChunk>, opts: InternalUserDefinedOptions, outDir: string, state: BundleBuildState, forceAll?: boolean): BundleSnapshot;
41
+ export declare function buildBundleSnapshotForBuild(bundle: Record<string, OutputAsset | OutputChunk>, opts: InternalUserDefinedOptions, outDir: string): BundleSnapshot;
42
+ export declare function updateBundleBuildState(state: BundleBuildState, snapshot: BundleSnapshot, linkedByEntry: Map<string, Set<string>>, options?: UpdateBundleBuildStateOptions): void;
43
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { OutputAsset } from 'rollup';
2
+ import type { Plugin, ResolvedConfig } from 'vite';
3
+ import type { InternalUserDefinedOptions } from '../../types';
4
+ interface CssFinalizerContext {
5
+ opts: InternalUserDefinedOptions;
6
+ runtimeState: {
7
+ twPatcher: InternalUserDefinedOptions['twPatcher'];
8
+ patchPromise: Promise<void>;
9
+ };
10
+ ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
11
+ isCssAssetProcessed: (asset: OutputAsset, file?: string) => boolean;
12
+ markCssAssetProcessed: (asset: OutputAsset, file?: string) => void;
13
+ debug: (format: string, ...args: unknown[]) => void;
14
+ getResolvedConfig: () => ResolvedConfig | undefined;
15
+ recordCssAssetResult?: (file: string, css: string) => void;
16
+ getRecordedGeneratorCandidates?: () => Set<string> | undefined;
17
+ }
18
+ export declare function createViteCssFinalizerOutputPlugin(context: CssFinalizerContext): Plugin;
19
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { OutputAsset, OutputChunk } from 'rollup';
2
+ import type { ResolvedConfig } from 'vite';
3
+ import type { BundleSnapshot } from './bundle-state';
4
+ import type { InternalUserDefinedOptions } from '../../types';
5
+ interface GenerateBundleContext {
6
+ opts: InternalUserDefinedOptions;
7
+ runtimeState: {
8
+ twPatcher: InternalUserDefinedOptions['twPatcher'];
9
+ patchPromise: Promise<void>;
10
+ };
11
+ ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
12
+ ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean) => Promise<Set<string>>;
13
+ debug: (format: string, ...args: unknown[]) => void;
14
+ getResolvedConfig: () => ResolvedConfig | undefined;
15
+ markCssAssetProcessed?: (asset: OutputAsset, file?: string) => void;
16
+ recordCssAssetResult?: (file: string, css: string) => void;
17
+ recordGeneratorCandidates?: (candidates: Set<string>) => void;
18
+ }
19
+ export declare function createGenerateBundleHook(context: GenerateBundleContext): (_opt: unknown, bundle: Record<string, OutputAsset | OutputChunk>) => Promise<void>;
20
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { BundleSnapshot } from './bundle-state';
2
+ import type { TailwindcssPatcherLike } from '../../types';
3
+ import { extractRawCandidatesWithPositions, extractValidCandidates } from 'tailwindcss-patch';
4
+ type ExtractValidCandidatesOptions = Parameters<typeof extractValidCandidates>[0];
5
+ type MemoryExtractValidCandidatesOptions = ExtractValidCandidatesOptions & {
6
+ content?: string;
7
+ extension?: string;
8
+ };
9
+ type ExtractValidCandidatesFn = (options?: MemoryExtractValidCandidatesOptions) => Promise<string[]>;
10
+ type ExtractRawCandidateResult = Awaited<ReturnType<typeof extractRawCandidatesWithPositions>>;
11
+ type ExtractRawCandidatesFn = (content: string, extension?: string) => Promise<ExtractRawCandidateResult>;
12
+ export interface BundleRuntimeClassSetManager {
13
+ sync: (patcher: TailwindcssPatcherLike, snapshot: BundleSnapshot) => Promise<Set<string>>;
14
+ reset: () => Promise<void>;
15
+ }
16
+ interface CreateBundleRuntimeClassSetManagerOptions {
17
+ extractCandidates?: ExtractValidCandidatesFn;
18
+ extractRawCandidates?: ExtractRawCandidatesFn;
19
+ }
20
+ export declare function createBundleRuntimeClassSetManager(options?: CreateBundleRuntimeClassSetManagerOptions): BundleRuntimeClassSetManager;
21
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from 'vite';
2
+ import type { UserDefinedOptions } from '../../types';
3
+ export declare function UnifiedViteWeappTailwindcssPlugin(options?: UserDefinedOptions): Plugin[] | undefined;
@@ -0,0 +1 @@
1
+ export { shouldSkipJsTransform as shouldSkipViteJsTransform } from '../../js/precheck';
@@ -0,0 +1,15 @@
1
+ export interface VueQuery {
2
+ vue?: boolean;
3
+ src?: string;
4
+ type?: 'script' | 'template' | 'style' | 'custom';
5
+ index?: number;
6
+ lang?: string;
7
+ raw?: boolean;
8
+ url?: boolean;
9
+ scoped?: boolean;
10
+ id?: string;
11
+ }
12
+ export declare function parseVueRequest(id: string): {
13
+ filename: string;
14
+ query: VueQuery;
15
+ };
@@ -0,0 +1,2 @@
1
+ import type { AppType } from '../../types';
2
+ export declare function resolveImplicitAppTypeFromViteRoot(root: string): AppType | undefined;
@@ -0,0 +1,11 @@
1
+ import type { Plugin } from 'vite';
2
+ import type { AppType } from '../../types';
3
+ interface RewriteCssImportsOptions {
4
+ appType?: AppType;
5
+ getAppType?: () => AppType | undefined;
6
+ shouldRewrite: boolean;
7
+ rootImport?: string;
8
+ weappTailwindcssDirPosix: string;
9
+ }
10
+ export declare function createRewriteCssImportsPlugins(options: RewriteCssImportsOptions): Plugin[];
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { EntryType } from './bundle-state';
2
+ export declare function createRuntimeAffectingSourceSignature(source: string, type: EntryType): string;
@@ -0,0 +1,9 @@
1
+ import type { ExistingRawSourceMap } from 'rollup';
2
+ import { cleanUrl } from '@weapp-tailwindcss/shared';
3
+ export declare function slash(p: string): string;
4
+ export declare const isWindows: boolean;
5
+ export declare const cssLangRE: RegExp;
6
+ export declare function isCSSRequest(request: string): boolean;
7
+ export declare function normalizePath(id: string): string;
8
+ export { cleanUrl };
9
+ export declare function formatPostcssSourceMap(rawMap: ExistingRawSourceMap, file: string): Promise<ExistingRawSourceMap>;
@@ -0,0 +1,20 @@
1
+ import type { AppType } from '../../../types';
2
+ export declare function getCacheKey(filename: string): string;
3
+ export declare function stripResourceQuery(resource?: string): string | undefined;
4
+ export declare function isCssLikeModuleResource(resource: string | undefined, cssMatcher: (file: string) => boolean, appType?: AppType): boolean;
5
+ export declare function hasLoaderEntry(entries: Array<{
6
+ loader?: string;
7
+ }>, target?: string): boolean;
8
+ interface ChunkLike {
9
+ id?: string | number | null;
10
+ name?: string;
11
+ hash?: string | null;
12
+ files?: Iterable<string> | Array<string>;
13
+ }
14
+ interface WebpackWatchChangeLike {
15
+ modifiedFiles?: Set<string>;
16
+ removedFiles?: Set<string>;
17
+ }
18
+ export declare function createAssetHashByChunkMap(chunks: Iterable<ChunkLike>): Map<string, string>;
19
+ export declare function hasWatchChanges(compiler: WebpackWatchChangeLike): boolean;
20
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { Compiler } from 'webpack4';
2
+ import type { AppType, InternalUserDefinedOptions } from '../../../types';
3
+ interface SetupWebpackV4EmitHookOptions {
4
+ compiler: Compiler;
5
+ options: InternalUserDefinedOptions;
6
+ appType?: AppType;
7
+ runtimeState: {
8
+ twPatcher: InternalUserDefinedOptions['twPatcher'];
9
+ patchPromise: Promise<void>;
10
+ };
11
+ debug: (format: string, ...args: unknown[]) => void;
12
+ }
13
+ export declare function setupWebpackV4EmitHook(options: SetupWebpackV4EmitHookOptions): void;
14
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { Compiler } from 'webpack4';
2
+ import type { AppType, InternalUserDefinedOptions } from '../../../types';
3
+ interface SetupWebpackV4LoadersOptions {
4
+ compiler: Compiler;
5
+ options: InternalUserDefinedOptions;
6
+ appType?: AppType;
7
+ weappTailwindcssPackageDir: string;
8
+ shouldRewriteCssImports: boolean;
9
+ runtimeLoaderPath?: string;
10
+ runtimeCssImportRewriteLoaderPath?: string;
11
+ getClassSetInLoader: () => Promise<void>;
12
+ debug: (format: string, ...args: unknown[]) => void;
13
+ }
14
+ export declare function setupWebpackV4Loaders(options: SetupWebpackV4LoadersOptions): void;
15
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Compiler } from 'webpack4';
2
+ import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
3
+ export declare const weappTailwindcssPackageDir: string;
4
+ export declare class UnifiedWebpackPluginV4 implements IBaseWebpackPlugin {
5
+ options: InternalUserDefinedOptions;
6
+ appType?: AppType;
7
+ constructor(options?: UserDefinedOptions);
8
+ apply(compiler: Compiler): void;
9
+ }
@@ -0,0 +1,17 @@
1
+ import type { Compiler } from 'webpack';
2
+ import type { AppType, InternalUserDefinedOptions } from '../../../types';
3
+ interface SetupWebpackV5ProcessAssetsHookOptions {
4
+ compiler: Compiler;
5
+ options: InternalUserDefinedOptions;
6
+ appType?: AppType;
7
+ runtimeState: {
8
+ twPatcher: InternalUserDefinedOptions['twPatcher'];
9
+ patchPromise: Promise<void>;
10
+ };
11
+ getRuntimeRefreshRequirement: () => boolean;
12
+ refreshRuntimeMetadata: (force: boolean) => Promise<void>;
13
+ consumeRuntimeRefreshRequirement: () => void;
14
+ debug: (format: string, ...args: unknown[]) => void;
15
+ }
16
+ export declare function setupWebpackV5ProcessAssetsHook(options: SetupWebpackV5ProcessAssetsHookOptions): void;
17
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { Compiler } from 'webpack';
2
+ import type { AppType, InternalUserDefinedOptions } from '../../../types';
3
+ interface SetupWebpackV5LoadersOptions {
4
+ compiler: Compiler;
5
+ options: InternalUserDefinedOptions;
6
+ appType?: AppType;
7
+ weappTailwindcssPackageDir: string;
8
+ shouldRewriteCssImports: boolean;
9
+ runtimeLoaderPath?: string;
10
+ runtimeCssImportRewriteLoaderPath?: string;
11
+ getClassSetInLoader: () => Promise<void>;
12
+ getRuntimeWatchDependencies: () => {
13
+ files: ReadonlySet<string>;
14
+ contexts: ReadonlySet<string>;
15
+ };
16
+ debug: (format: string, ...args: unknown[]) => void;
17
+ }
18
+ export declare function setupWebpackV5Loaders(options: SetupWebpackV5LoadersOptions): void;
19
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Compiler } from 'webpack';
2
+ import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
3
+ export declare const weappTailwindcssPackageDir: string;
4
+ export declare class UnifiedWebpackPluginV5 implements IBaseWebpackPlugin {
5
+ options: InternalUserDefinedOptions;
6
+ appType?: AppType;
7
+ constructor(options?: UserDefinedOptions);
8
+ apply(compiler: Compiler): void;
9
+ }
@@ -0,0 +1 @@
1
+ export * from './BaseUnifiedPlugin/v5';
@@ -0,0 +1,12 @@
1
+ import type webpack from 'webpack';
2
+ import type { AppType } from '../../../types';
3
+ import { Buffer } from 'node:buffer';
4
+ interface CssImportRewriteLoaderOptions {
5
+ rewriteCssImports?: {
6
+ pkgDir: string;
7
+ appType?: AppType;
8
+ };
9
+ }
10
+ export declare function transformCssImportRewriteSource(source: string | Buffer, options: CssImportRewriteLoaderOptions | undefined): string | Buffer<ArrayBufferLike>;
11
+ declare const WeappTwCssImportRewriteLoader: webpack.LoaderDefinitionFunction<CssImportRewriteLoaderOptions>;
12
+ export default WeappTwCssImportRewriteLoader;
@@ -0,0 +1,11 @@
1
+ import type webpack from 'webpack';
2
+ interface RuntimeClassSetLoaderOptions {
3
+ getClassSet?: () => void | Promise<void>;
4
+ getWatchDependencies?: () => RuntimeLoaderWatchDependencies | Promise<RuntimeLoaderWatchDependencies | void> | void;
5
+ }
6
+ interface RuntimeLoaderWatchDependencies {
7
+ files?: Iterable<string>;
8
+ contexts?: Iterable<string>;
9
+ }
10
+ declare const WeappTwRuntimeClassSetLoader: webpack.LoaderDefinitionFunction<RuntimeClassSetLoaderOptions>;
11
+ export default WeappTwRuntimeClassSetLoader;
@@ -0,0 +1,6 @@
1
+ import type { AppType } from '../../../types';
2
+ export declare function applyTailwindcssCssImportRewrite(compiler: any, options: {
3
+ pkgDir: string;
4
+ enabled: boolean;
5
+ appType?: AppType;
6
+ }): void;
@@ -0,0 +1,8 @@
1
+ import type { AppType } from '../../../types';
2
+ export interface LoaderEntry {
3
+ loader?: string;
4
+ }
5
+ export declare function createLoaderAnchorFinders(appType?: AppType): {
6
+ findRewriteAnchor: (entries: LoaderEntry[]) => number;
7
+ findClassSetAnchor: (entries: LoaderEntry[]) => number;
8
+ };
@@ -0,0 +1,38 @@
1
+ import type { Buffer } from 'node:buffer';
2
+ import type { sources } from 'webpack';
3
+ import { LRUCache } from 'lru-cache';
4
+ export interface HashMapValue {
5
+ hash: string;
6
+ changed: boolean;
7
+ }
8
+ export type HashMapKey = string | number;
9
+ export type CacheValue = sources.Source | string;
10
+ export interface CacheProcessResult<T extends CacheValue> {
11
+ result: T;
12
+ cacheValue?: CacheValue;
13
+ }
14
+ export interface CacheProcessOptions<T extends CacheValue> {
15
+ key: string;
16
+ hashKey?: HashMapKey;
17
+ rawSource?: string | Buffer;
18
+ hash?: string;
19
+ resolveCache?: () => T | undefined;
20
+ transform: () => Promise<CacheProcessResult<T> | T>;
21
+ onCacheHit?: (value: T) => void | Promise<void>;
22
+ }
23
+ export interface ICreateCacheReturnType {
24
+ readonly hashMap: Map<HashMapKey, HashMapValue>;
25
+ readonly instance: LRUCache<string, CacheValue>;
26
+ hasHashKey: (key: HashMapKey) => boolean;
27
+ getHashValue: (key: HashMapKey) => HashMapValue | undefined;
28
+ setHashValue: (key: HashMapKey, value: HashMapValue) => Map<HashMapKey, HashMapValue>;
29
+ computeHash: (message: string | Buffer) => string;
30
+ get: <V extends CacheValue = sources.Source>(key: string) => V | undefined;
31
+ set: <V extends CacheValue = sources.Source>(key: string, value: V) => LRUCache<string, CacheValue>;
32
+ has: (key: string) => boolean;
33
+ calcHashValueChanged: (key: HashMapKey, hash: string) => ICreateCacheReturnType;
34
+ process: <T extends CacheValue>(options: CacheProcessOptions<T>) => Promise<T>;
35
+ }
36
+ declare function createCache(options?: boolean): ICreateCacheReturnType;
37
+ declare function initializeCache(cacheConfig?: boolean | ICreateCacheReturnType): ICreateCacheReturnType;
38
+ export { createCache, initializeCache };
@@ -0,0 +1 @@
1
+ export { md5 as md5Hash } from '@weapp-tailwindcss/shared/node';
@@ -0,0 +1,28 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ Object.defineProperty(exports, "__toESM", {
24
+ enumerable: true,
25
+ get: function() {
26
+ return __toESM;
27
+ }
28
+ });
@@ -0,0 +1,5 @@
1
+ export interface TailwindcssMangleConfigModule {
2
+ initConfig: (cwd: string) => Promise<void>;
3
+ CONFIG_NAME: string;
4
+ }
5
+ export declare function loadTailwindcssMangleConfig(): Promise<TailwindcssMangleConfigModule | undefined>;
@@ -0,0 +1,16 @@
1
+ import type { CompatTailwindCssPatchOptions } from '../tailwindcss/patcher-options';
2
+ import type { UserDefinedOptions } from '../types';
3
+ export declare function resolveEntry(entry: string, cwd: string | undefined): string;
4
+ export declare function buildTailwindcssPatcherOptions(overrides: Partial<CompatTailwindCssPatchOptions> | undefined): CompatTailwindCssPatchOptions | undefined;
5
+ export declare function createCliContext(overrides: Partial<UserDefinedOptions> | undefined, resolvedCwd: string | undefined): Required<Omit<UserDefinedOptions, "supportCustomLengthUnitsPatch" | "customReplaceDictionary" | "cache"> & {
6
+ supportCustomLengthUnitsPatch: import("tailwindcss-patch").ILengthUnitsPatchOptions | boolean;
7
+ templateHandler: (rawSource: string, options?: import("@/types").ITemplateHandlerOptions) => Promise<string>;
8
+ styleHandler: (rawSource: string, options?: import("@weapp-tailwindcss/postcss").IStyleHandlerOptions) => Promise<import("postcss").Result<import("postcss").Root | import("postcss").Document>>;
9
+ jsHandler: import("@/types").JsHandler;
10
+ escapeMap: Record<string, string>;
11
+ customReplaceDictionary: Record<string, string>;
12
+ cache: import("../cache").ICreateCacheReturnType;
13
+ twPatcher: import("@/types").TailwindcssPatcherLike;
14
+ refreshTailwindcssPatcher: (options?: import("@/types").RefreshTailwindcssPatcherOptions) => Promise<import("@/types").TailwindcssPatcherLike>;
15
+ }>;
16
+ export declare function formatOutputPath(target: string, baseDir?: string): string;
@@ -0,0 +1,7 @@
1
+ export declare const CONFIG_FILES: {
2
+ tailwind: string[];
3
+ postcss: string[];
4
+ vite: string[];
5
+ webpack: string[];
6
+ };
7
+ export declare const FRAMEWORK_DEPS: Array<[string, string]>;
@@ -0,0 +1,31 @@
1
+ export type DoctorCheckStatus = 'ok' | 'warn' | 'error' | 'info';
2
+ export interface DoctorCheck {
3
+ id: string;
4
+ title: string;
5
+ status: DoctorCheckStatus;
6
+ message: string;
7
+ suggestion?: string;
8
+ }
9
+ export interface DoctorReport {
10
+ cwd: string;
11
+ nodeVersion: string;
12
+ detected: {
13
+ packageManager?: string;
14
+ frameworks: string[];
15
+ tailwindcssVersion?: string;
16
+ weappTailwindcssVersion?: string;
17
+ };
18
+ summary: Record<DoctorCheckStatus, number>;
19
+ checks: DoctorCheck[];
20
+ }
21
+ export interface DoctorOptions {
22
+ cwd?: string;
23
+ nodeVersion?: string;
24
+ }
25
+ export interface PackageJson {
26
+ dependencies?: Record<string, string>;
27
+ devDependencies?: Record<string, string>;
28
+ optionalDependencies?: Record<string, string>;
29
+ peerDependencies?: Record<string, string>;
30
+ packageManager?: string;
31
+ }
@@ -0,0 +1,4 @@
1
+ import type { DoctorOptions, DoctorReport } from './doctor/types';
2
+ export declare function createDoctorReport(options?: DoctorOptions): DoctorReport;
3
+ export declare function hasDoctorFailure(report: DoctorReport, strict?: boolean): boolean;
4
+ export declare function formatDoctorReport(report: DoctorReport): string;
@@ -0,0 +1,2 @@
1
+ export declare function normalizeTokenFormat(format: string): "json" | "lines" | "grouped-json";
2
+ export declare function normalizeExtractFormat(format: string | undefined): 'json' | 'lines' | undefined;
@@ -0,0 +1,3 @@
1
+ export declare function readStringOption(flag: string, value: unknown): string | undefined;
2
+ export declare function readStringArrayOption(flag: string, value: unknown): string[] | undefined;
3
+ export declare function toBoolean(value: unknown, fallback: boolean): boolean;
@@ -0,0 +1 @@
1
+ export declare function resolveCliCwd(value: unknown): string | undefined;
@@ -0,0 +1,3 @@
1
+ export { normalizeExtractFormat, normalizeTokenFormat } from './options/format';
2
+ export { readStringArrayOption, readStringOption, toBoolean } from './options/parse';
3
+ export { resolveCliCwd } from './options/resolve';
@@ -0,0 +1 @@
1
+ export declare function resolvePatchDefaultCwd(currentCwd?: string): string;
@@ -0,0 +1,5 @@
1
+ import { normalizeExtractFormat, normalizeTokenFormat, readStringArrayOption, readStringOption, resolveCliCwd, toBoolean } from './helpers/options';
2
+ import { resolvePatchDefaultCwd } from './helpers/patch-cwd';
3
+ export declare function ensureDir(dir: string): Promise<void>;
4
+ export declare function commandAction<T extends unknown[]>(handler: (...args: T) => Promise<void>): (...args: T) => Promise<void>;
5
+ export { normalizeExtractFormat, normalizeTokenFormat, readStringArrayOption, readStringOption, resolveCliCwd, resolvePatchDefaultCwd, toBoolean, };
@@ -0,0 +1,2 @@
1
+ import type { PatchStatusReport } from 'tailwindcss-patch';
2
+ export declare function logPatchStatusReport(report: PatchStatusReport): void;