weapp-tailwindcss 5.0.0-next.3 → 5.0.0-next.31

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 (244) hide show
  1. package/README.md +6 -7
  2. package/bin/weapp-tailwindcss.js +1 -21
  3. package/dist/auto-TH1jG2UW.js +115 -0
  4. package/dist/auto-XyKTOP7B.mjs +78 -0
  5. package/dist/bundle-state-Bi-cQua6.mjs +413 -0
  6. package/dist/bundle-state-Ct_8GcSR.js +529 -0
  7. package/dist/bundlers/shared/cache.d.ts +6 -6
  8. package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -0
  9. package/dist/bundlers/shared/css-cleanup.d.ts +1 -4
  10. package/dist/bundlers/shared/css-imports.d.ts +3 -3
  11. package/dist/bundlers/shared/generated-css-marker.d.ts +3 -0
  12. package/dist/bundlers/shared/generator-css/config-directive.d.ts +2 -0
  13. package/dist/bundlers/shared/generator-css/directives.d.ts +21 -0
  14. package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +7 -0
  15. package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +5 -0
  16. package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -0
  17. package/dist/bundlers/shared/generator-css/markers.d.ts +28 -0
  18. package/dist/bundlers/shared/generator-css/source-files.d.ts +14 -0
  19. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +24 -0
  20. package/dist/bundlers/shared/generator-css/user-layer-order.d.ts +10 -0
  21. package/dist/bundlers/shared/generator-css.d.ts +16 -22
  22. package/dist/bundlers/shared/hmr-timing.d.ts +22 -0
  23. package/dist/bundlers/shared/style-requests.d.ts +2 -0
  24. package/dist/bundlers/vite/bundle-state.d.ts +1 -0
  25. package/dist/bundlers/vite/css-finalizer.d.ts +7 -1
  26. package/dist/bundlers/vite/generate-bundle/candidates.d.ts +2 -0
  27. package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +24 -0
  28. package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +4 -0
  29. package/dist/bundlers/vite/generate-bundle/dirty-state.d.ts +1 -0
  30. package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +2 -0
  31. package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +8 -0
  32. package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +13 -0
  33. package/dist/bundlers/vite/generate-bundle/metrics.d.ts +17 -0
  34. package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +9 -0
  35. package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +7 -0
  36. package/dist/bundlers/vite/generate-bundle/signatures.d.ts +8 -0
  37. package/dist/bundlers/vite/generate-bundle.d.ts +14 -2
  38. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +5 -1
  39. package/dist/bundlers/vite/index.d.ts +5 -2
  40. package/dist/bundlers/vite/official-tailwind-plugins.d.ts +5 -0
  41. package/dist/bundlers/vite/postcss-config.d.ts +6 -0
  42. package/dist/bundlers/vite/processed-css-assets.d.ts +32 -0
  43. package/dist/bundlers/vite/rewrite-css-imports.d.ts +8 -3
  44. package/dist/bundlers/vite/runtime-class-set.d.ts +25 -0
  45. package/dist/bundlers/vite/serve-css-generation.d.ts +11 -0
  46. package/dist/bundlers/vite/source-candidates.d.ts +19 -1
  47. package/dist/bundlers/vite/source-scan.d.ts +26 -0
  48. package/dist/bundlers/vite/static-config-content.d.ts +5 -0
  49. package/dist/bundlers/vite/tailwind-basedir.d.ts +1 -0
  50. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +6 -0
  51. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +6 -2
  52. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +9 -3
  53. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +2 -1
  54. package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +31 -0
  55. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +2 -6
  56. package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +3 -7
  57. package/dist/cache/index.d.ts +6 -6
  58. package/dist/{chunk-8l464Juk.js → chunk-C5U5_Hdc.js} +14 -0
  59. package/dist/cli/context.d.ts +1 -14
  60. package/dist/cli/doctor/types.d.ts +11 -11
  61. package/dist/cli/helpers.d.ts +1 -2
  62. package/dist/cli/mount-options.d.ts +2 -0
  63. package/dist/cli/types.d.ts +0 -2
  64. package/dist/cli/vscode-entry.d.ts +3 -3
  65. package/dist/cli.js +758 -604
  66. package/dist/cli.mjs +766 -612
  67. package/dist/constants.d.ts +1 -2
  68. package/dist/context/runtime-package-replacements.d.ts +2 -0
  69. package/dist/context/style-options.d.ts +3 -0
  70. package/dist/core.js +12 -20
  71. package/dist/core.mjs +8 -14
  72. package/dist/css-macro/auto.d.ts +10 -0
  73. package/dist/css-macro/constants.d.ts +5 -2
  74. package/dist/css-macro/postcss.d.ts +1 -0
  75. package/dist/css-macro/postcss.js +7 -46
  76. package/dist/css-macro/postcss.mjs +2 -46
  77. package/dist/css-macro.d.ts +1 -0
  78. package/dist/css-macro.js +16 -7
  79. package/dist/css-macro.mjs +15 -6
  80. package/dist/defaults-8xrgzxFY.mjs +151 -0
  81. package/dist/defaults-zKUH2mDe.js +193 -0
  82. package/dist/defaults.d.ts +15 -1
  83. package/dist/defaults.js +6 -131
  84. package/dist/defaults.mjs +2 -129
  85. package/dist/escape.js +10 -2
  86. package/dist/escape.mjs +10 -2
  87. package/dist/generator/index.d.ts +1 -1
  88. package/dist/generator/options.d.ts +9 -8
  89. package/dist/generator/types.d.ts +3 -3
  90. package/dist/generator-CrU-Ghc1.js +90 -0
  91. package/dist/generator-Qw-tZ0Z2.mjs +65 -0
  92. package/dist/generator.js +12 -12
  93. package/dist/generator.mjs +2 -1
  94. package/dist/gulp.js +187 -48
  95. package/dist/gulp.mjs +180 -41
  96. package/dist/incremental-runtime-class-set-Boqi1QlB.mjs +2224 -0
  97. package/dist/incremental-runtime-class-set-FAOHZmzh.js +2293 -0
  98. package/dist/index.d.ts +3 -2
  99. package/dist/index.js +19 -7
  100. package/dist/index.mjs +6 -5
  101. package/dist/js/babel/cache-options.d.ts +3 -0
  102. package/dist/js/babel/parse.d.ts +7 -4
  103. package/dist/js/index.d.ts +1 -0
  104. package/dist/js/literal-transform.d.ts +2 -0
  105. package/dist/js/precheck.d.ts +2 -2
  106. package/dist/logger-BNzxZbZj.mjs +2 -0
  107. package/dist/logger-TlKT3xmR.js +1 -0
  108. package/dist/postcss/config-directive.d.ts +1 -0
  109. package/dist/postcss/context.d.ts +9 -0
  110. package/dist/postcss/source-files.d.ts +8 -0
  111. package/dist/postcss/tailwind-version.d.ts +3 -0
  112. package/dist/postcss-C6zOQqlL.mjs +228 -0
  113. package/dist/postcss-C7BMYpEF.mjs +169 -0
  114. package/dist/postcss-CiYLsqZn.js +192 -0
  115. package/dist/postcss-DAWf9D3C.js +237 -0
  116. package/dist/postcss-html-transform.js +1 -1
  117. package/dist/postcss.d.ts +2 -2
  118. package/dist/postcss.js +3 -276
  119. package/dist/postcss.mjs +1 -269
  120. package/dist/precheck-D7K12zeX.mjs +4716 -0
  121. package/dist/precheck-D7gJSmJz.js +4842 -0
  122. package/dist/presets/index.d.ts +1 -0
  123. package/dist/presets/uni-app-x.d.ts +1 -0
  124. package/dist/presets.js +29 -13
  125. package/dist/presets.mjs +25 -11
  126. package/dist/reset.d.ts +1 -0
  127. package/dist/reset.js +1 -1
  128. package/dist/runtime-registry-DpcR3IHI.js +5496 -0
  129. package/dist/shared/mpx.d.ts +1 -0
  130. package/dist/source-candidates-CX2ozpKM.mjs +322 -0
  131. package/dist/source-candidates-DNM8iwXW.js +335 -0
  132. package/dist/tailwindcss/miniprogram.d.ts +1 -1
  133. package/dist/tailwindcss/patcher-options.d.ts +3 -51
  134. package/dist/tailwindcss/patcher.d.ts +1 -2
  135. package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -2
  136. package/dist/tailwindcss/runtime/cache.d.ts +4 -3
  137. package/dist/tailwindcss/runtime-patch.d.ts +5 -0
  138. package/dist/tailwindcss/runtime.d.ts +11 -12
  139. package/dist/tailwindcss/source-scan.d.ts +35 -0
  140. package/dist/tailwindcss/targets.d.ts +1 -5
  141. package/dist/tailwindcss/v3-engine/types.d.ts +17 -14
  142. package/dist/tailwindcss/v4/css-entries.d.ts +2 -2
  143. package/dist/tailwindcss/v4/css-sources.d.ts +5 -0
  144. package/dist/tailwindcss/v4/patcher-options.d.ts +1 -23
  145. package/dist/tailwindcss/v4/patcher.d.ts +1 -0
  146. package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
  147. package/dist/tailwindcss/v4-engine/types.d.ts +17 -5
  148. package/dist/tailwindcss/version.d.ts +4 -0
  149. package/dist/tailwindcss-B-e2RiXr.js +642 -0
  150. package/dist/tailwindcss-C7dJHZ0G.mjs +591 -0
  151. package/dist/typedoc.export.d.ts +0 -2
  152. package/dist/types/index.d.ts +52 -49
  153. package/dist/types/shared.d.ts +6 -0
  154. package/dist/types/user-defined-options/general.d.ts +25 -24
  155. package/dist/types/user-defined-options/important.d.ts +33 -28
  156. package/dist/types/user-defined-options/lifecycle.d.ts +4 -4
  157. package/dist/types/user-defined-options/matcher.d.ts +6 -6
  158. package/dist/uni-app-x/vite.d.ts +1 -1
  159. package/dist/unocss/index.d.ts +2 -0
  160. package/dist/utils/disabled.d.ts +2 -3
  161. package/dist/utils/object.d.ts +9 -0
  162. package/dist/utils/options.d.ts +2 -0
  163. package/dist/utils/regex.d.ts +1 -0
  164. package/dist/{utils-DmC9_In3.js → utils-D7Ygohep.js} +2 -2
  165. package/dist/{utils-7DUGTFED.mjs → utils-DsaS975I.mjs} +1 -1
  166. package/dist/v3-engine-CHItlVq5.js +3616 -0
  167. package/dist/v3-engine-DcvCCHfs.mjs +3321 -0
  168. package/dist/vite-BgTPSkQS.js +24446 -0
  169. package/dist/vite-fFRpSvyz.mjs +24432 -0
  170. package/dist/vite.d.ts +1 -2
  171. package/dist/vite.js +3 -4
  172. package/dist/vite.mjs +2 -2
  173. package/dist/weapp-tw-css-import-rewrite-loader.js +5227 -18
  174. package/dist/weapp-tw-runtime-classset-loader.js +32 -9
  175. package/dist/webpack-BXSWVdXh.js +851 -0
  176. package/dist/webpack-Dx2AZpGU.mjs +841 -0
  177. package/dist/webpack.d.ts +1 -3
  178. package/dist/webpack.js +3 -4
  179. package/dist/webpack.mjs +2 -2
  180. package/package.json +38 -48
  181. package/dist/bundlers/shared/generator-candidates.d.ts +0 -5
  182. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +0 -14
  183. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +0 -15
  184. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -9
  185. package/dist/bundlers/webpack/shared/css-imports.d.ts +0 -6
  186. package/dist/cli/config.d.ts +0 -5
  187. package/dist/cli/helpers/patch-cwd.d.ts +0 -1
  188. package/dist/cli/mount-options/patch-status.d.ts +0 -2
  189. package/dist/cli/patch-options.d.ts +0 -6
  190. package/dist/cli/tokens.d.ts +0 -4
  191. package/dist/cli/workspace/package-dirs.d.ts +0 -3
  192. package/dist/cli/workspace/patch-package.d.ts +0 -3
  193. package/dist/cli/workspace/patch-utils.d.ts +0 -3
  194. package/dist/cli/workspace/types.d.ts +0 -11
  195. package/dist/cli/workspace/workspace-globs.d.ts +0 -2
  196. package/dist/cli/workspace/workspace-io.d.ts +0 -1
  197. package/dist/cli/workspace/workspace-lock.d.ts +0 -1
  198. package/dist/cli/workspace.d.ts +0 -2
  199. package/dist/constants-B-_T5UnW.mjs +0 -44
  200. package/dist/constants-p1dyh1x1.js +0 -73
  201. package/dist/css-imports-BbrbluP9.js +0 -177
  202. package/dist/css-imports-CSdPq_Sc.mjs +0 -128
  203. package/dist/experimental/index.d.ts +0 -2
  204. package/dist/experimental/oxc/ast-utils.d.ts +0 -30
  205. package/dist/experimental/oxc/index.d.ts +0 -2
  206. package/dist/experimental/oxc/module-specifiers.d.ts +0 -2
  207. package/dist/experimental/shared/cache.d.ts +0 -3
  208. package/dist/experimental/shared/transform.d.ts +0 -3
  209. package/dist/experimental/shared.d.ts +0 -8
  210. package/dist/experimental/swc/ast-utils.d.ts +0 -30
  211. package/dist/experimental/swc/index.d.ts +0 -2
  212. package/dist/experimental/swc/module-specifiers.d.ts +0 -2
  213. package/dist/generator-Y-Ikv4Fu.mjs +0 -1177
  214. package/dist/generator-css-Bwy_Uz89.mjs +0 -1097
  215. package/dist/generator-css-CRLrHW4F.js +0 -1124
  216. package/dist/generator-mmhXzZnv.js +0 -1276
  217. package/dist/js/syntax.d.ts +0 -10
  218. package/dist/lightningcss/index.d.ts +0 -8
  219. package/dist/lightningcss/style-handler/options.d.ts +0 -3
  220. package/dist/lightningcss/style-handler/selector-transform.d.ts +0 -10
  221. package/dist/lightningcss/style-handler/selector-utils.d.ts +0 -10
  222. package/dist/lightningcss/style-handler.d.ts +0 -17
  223. package/dist/loader-anchors-1MumTAtA.mjs +0 -205
  224. package/dist/loader-anchors-TrFvT6g1.js +0 -273
  225. package/dist/logger-BZ45DZJT.js +0 -1003
  226. package/dist/logger-BoVx1Dbt.mjs +0 -935
  227. package/dist/patcher-options-6gJN2EXy.js +0 -115
  228. package/dist/patcher-options-DQfR5xxT.mjs +0 -92
  229. package/dist/recorder-GdTJ3QqX.js +0 -2878
  230. package/dist/recorder-XdFvVASS.mjs +0 -2763
  231. package/dist/tailwindcss/recorder.d.ts +0 -13
  232. package/dist/tailwindcss/targets/paths.d.ts +0 -13
  233. package/dist/tailwindcss/targets/record-io.d.ts +0 -5
  234. package/dist/tailwindcss/targets/recorder.d.ts +0 -3
  235. package/dist/tailwindcss/targets/types.d.ts +0 -35
  236. package/dist/types/disabled-options.d.ts +0 -4
  237. package/dist/vite-BDywuCjn.mjs +0 -2186
  238. package/dist/vite-DgRh_GXn.js +0 -2199
  239. package/dist/webpack-CAJR4hhP.js +0 -456
  240. package/dist/webpack-CiHqVZTg.mjs +0 -441
  241. package/dist/webpack4.d.ts +0 -4
  242. package/dist/webpack4.js +0 -387
  243. package/dist/webpack4.mjs +0 -379
  244. package/scripts/postinstall.mjs +0 -59
package/dist/webpack.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- export * from './bundlers/webpack/index';
2
- export { UnifiedWebpackPluginV5 as WeappTailwindcss } from './bundlers/webpack/index';
3
- export { UnifiedWebpackPluginV5 as weappTailwindcss } from './bundlers/webpack/index';
1
+ export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir, } from './bundlers/webpack/index';
4
2
  export type { UserDefinedOptions } from './types';
package/dist/webpack.js CHANGED
@@ -1,6 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_webpack = require("./webpack-CAJR4hhP.js");
3
- exports.UnifiedWebpackPluginV5 = require_webpack.UnifiedWebpackPluginV5;
4
- exports.WeappTailwindcss = require_webpack.UnifiedWebpackPluginV5;
5
- exports.weappTailwindcss = require_webpack.UnifiedWebpackPluginV5;
2
+ const require_webpack = require("./webpack-BXSWVdXh.js");
3
+ exports.WeappTailwindcss = require_webpack.WeappTailwindcss;
4
+ exports.weappTailwindcss = require_webpack.WeappTailwindcss;
6
5
  exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
package/dist/webpack.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as weappTailwindcssPackageDir, t as UnifiedWebpackPluginV5 } from "./webpack-CiHqVZTg.mjs";
2
- export { UnifiedWebpackPluginV5, UnifiedWebpackPluginV5 as WeappTailwindcss, UnifiedWebpackPluginV5 as weappTailwindcss, weappTailwindcssPackageDir };
1
+ import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-Dx2AZpGU.mjs";
2
+ export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weapp-tailwindcss",
3
- "version": "5.0.0-next.3",
3
+ "version": "5.0.0-next.31",
4
4
  "description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -61,11 +61,6 @@
61
61
  "import": "./dist/webpack.mjs",
62
62
  "require": "./dist/webpack.js"
63
63
  },
64
- "./webpack4": {
65
- "types": "./dist/webpack4.d.ts",
66
- "import": "./dist/webpack4.mjs",
67
- "require": "./dist/webpack4.js"
68
- },
69
64
  "./core": {
70
65
  "types": "./dist/core.d.ts",
71
66
  "import": "./dist/core.mjs",
@@ -150,7 +145,6 @@
150
145
  }
151
146
  },
152
147
  "bin": {
153
- "weapp-tailwindcss-webpack-plugin": "bin/weapp-tailwindcss.js",
154
148
  "weapp-tailwindcss": "bin/weapp-tailwindcss.js",
155
149
  "weapp-tw": "bin/weapp-tailwindcss.js"
156
150
  },
@@ -161,7 +155,6 @@
161
155
  "generator-placeholder.css",
162
156
  "index.css",
163
157
  "preflight.css",
164
- "scripts/postinstall.mjs",
165
158
  "theme.css",
166
159
  "uni-app-x.css",
167
160
  "utilities.css",
@@ -176,61 +169,58 @@
176
169
  },
177
170
  "dependencies": {
178
171
  "@ast-core/escape": "~1.0.1",
179
- "@babel/parser": "~7.29.3",
180
- "@babel/traverse": "~7.29.0",
181
- "@babel/types": "~7.29.0",
182
- "@tailwindcss-mangle/config": "^7.0.1",
183
- "@vue/compiler-dom": "^3.5.34",
184
- "@vue/compiler-sfc": "^3.5.34",
185
- "@weapp-core/escape": "~7.0.0",
186
- "@weapp-core/regex": "~1.0.1",
187
- "cac": "6.7.14",
188
- "comment-json": "^4.6.2",
172
+ "@babel/parser": "~7.29.7",
173
+ "@babel/traverse": "~7.29.7",
174
+ "@babel/types": "~7.29.7",
175
+ "@weapp-core/escape": "~8.0.0",
176
+ "comment-json": "^5.0.0",
189
177
  "debug": "~4.4.3",
190
178
  "fast-glob": "^3.3.3",
191
- "htmlparser2": "10.1.0",
192
- "loader-utils": "2.0.4",
193
- "local-pkg": "^1.1.2",
194
- "lru-cache": "10.4.3",
179
+ "local-pkg": "^1.2.1",
180
+ "lru-cache": "11.5.1",
195
181
  "magic-string": "0.30.21",
182
+ "micromatch": "^4.0.8",
196
183
  "postcss-load-config": "^6.0.1",
197
- "semver": "~7.7.4",
198
- "tailwindcss-patch": "9.2.0",
199
- "webpack-sources": "3.3.4",
200
- "yaml": "^2.8.4",
201
- "@weapp-tailwindcss/logger": "1.1.0",
202
- "@weapp-tailwindcss/postcss": "2.2.0",
203
- "@weapp-tailwindcss/reset": "0.1.0",
204
- "tailwindcss-config": "1.1.6-next.0",
205
- "@weapp-tailwindcss/shared": "1.1.3"
184
+ "semver": "~7.8.1",
185
+ "tailwindcss-patch": "9.3.7",
186
+ "yaml": "^2.9.0",
187
+ "@weapp-tailwindcss/logger": "2.0.0-next.0",
188
+ "@weapp-tailwindcss/postcss": "3.0.0-next.8",
189
+ "@weapp-tailwindcss/reset": "0.1.1-next.1",
190
+ "@weapp-tailwindcss/shared": "2.0.0-next.0",
191
+ "tailwindcss-config": "2.0.0-next.2"
192
+ },
193
+ "devDependencies": {
194
+ "@vue/compiler-dom": "^3.5.35",
195
+ "@vue/compiler-sfc": "^3.5.35",
196
+ "htmlparser2": "12.0.0"
206
197
  },
207
198
  "scripts": {
208
199
  "dev": "tsdown --watch --sourcemap",
209
- "build": "tsdown && pnpm run build:types && node scripts/ensure-escape-dts.mjs",
210
- "build:types": "tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --declarationDir dist --noEmit false && node scripts/rewrite-dts-aliases.mjs && node scripts/create-entry-dts.mjs",
200
+ "build": "tsdown && pnpm run build:types && pnpm --filter @weapp-tailwindcss/scripts ensure-escape-dts",
201
+ "build:types": "tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --declarationDir dist --noEmit false && pnpm --filter @weapp-tailwindcss/scripts build:types",
211
202
  "build:tsc": "cross-env NODE_ENV=development tsc --build tsconfig.json",
212
203
  "build:cli": "cd plugins/cli && pnpm run build",
213
- "build:css": "tsx scripts/build-css.ts",
214
- "build:weapp-theme": "tsx scripts/build-weapp-theme.ts",
215
- "test": "pnpm run cli:patch && vitest run",
204
+ "build:css": "pnpm --filter @weapp-tailwindcss/scripts build:css",
205
+ "build:weapp-theme": "pnpm --filter @weapp-tailwindcss/scripts build:weapp-theme",
206
+ "test": "vitest run",
216
207
  "test:dev": "vitest",
217
208
  "test:ui": "vitest --ui",
218
209
  "bench": "vitest bench --config ./vitest.config.ts",
219
- "bench:vite-perf": "tsx scripts/vite-perf-bench.ts",
220
- "bench:vite-perf:summary": "tsx scripts/vite-perf-summary.ts",
221
- "bench:js-handlers": "tsx scripts/js-bench.ts",
222
- "bench:js-diff": "tsx scripts/js-bench-diff.ts",
210
+ "bench:vite-perf": "pnpm --filter @weapp-tailwindcss/scripts bench:vite-perf",
211
+ "bench:vite-perf:summary": "pnpm --filter @weapp-tailwindcss/scripts bench:vite-perf:summary",
212
+ "bench:js-handlers": "pnpm --filter @weapp-tailwindcss/scripts bench:js-handlers",
213
+ "bench:js-diff": "pnpm --filter @weapp-tailwindcss/scripts bench:js-diff",
223
214
  "tsd": "tsd",
224
- "clean": "tsx scripts/clean.ts",
225
- "get-decl": "tsx scripts/get-decl.ts",
215
+ "clean": "pnpm --filter @weapp-tailwindcss/scripts clean:core",
216
+ "get-decl": "pnpm --filter @weapp-tailwindcss/scripts get-decl",
226
217
  "ls:pack": "npm pack --dry-run",
227
- "cli:patch": "node bin/weapp-tailwindcss.js patch",
228
- "colors": "tsx scripts/colors.ts",
229
- "release": "tsx scripts/release.ts",
218
+ "colors": "pnpm --filter @weapp-tailwindcss/scripts colors",
219
+ "release": "pnpm --filter @weapp-tailwindcss/scripts release",
230
220
  "lint": "eslint .",
231
221
  "lint:fix": "eslint ./src --fix",
232
- "postinstall": "node scripts/postinstall.mjs",
233
- "bench:vite-dev-hmr": "tsx scripts/vite-dev-hmr-bench.ts",
234
- "test:watch-hmr": "node --import tsx scripts/watch-hmr-regression/index.ts"
222
+ "bench:vite-dev-hmr": "pnpm --filter @weapp-tailwindcss/scripts bench:vite-dev-hmr",
223
+ "watch-hmr:speed-report": "pnpm --filter @weapp-tailwindcss/scripts watch-hmr:speed-report",
224
+ "test:watch-hmr": "pnpm --filter @weapp-tailwindcss/scripts test:watch-hmr"
235
225
  }
236
226
  }
@@ -1,5 +0,0 @@
1
- export interface GeneratorCandidateSource {
2
- content: string;
3
- extension?: string;
4
- }
5
- export declare function collectGeneratorCandidatesFromSources(sources: GeneratorCandidateSource[], baseCandidates?: Iterable<string>): Promise<Set<string>>;
@@ -1,14 +0,0 @@
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 {};
@@ -1,15 +0,0 @@
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 {};
@@ -1,9 +0,0 @@
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
- }
@@ -1,6 +0,0 @@
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;
@@ -1,5 +0,0 @@
1
- export interface TailwindcssMangleConfigModule {
2
- initConfig: (cwd: string) => Promise<void>;
3
- CONFIG_NAME: string;
4
- }
5
- export declare function loadTailwindcssMangleConfig(): Promise<TailwindcssMangleConfigModule | undefined>;
@@ -1 +0,0 @@
1
- export declare function resolvePatchDefaultCwd(currentCwd?: string): string;
@@ -1,2 +0,0 @@
1
- import type { PatchStatusReport } from 'tailwindcss-patch';
2
- export declare function logPatchStatusReport(report: PatchStatusReport): void;
@@ -1,6 +0,0 @@
1
- import type { TailwindCssPatchOptions } from 'tailwindcss-patch';
2
- type ExtendLengthUnitsFeature = Exclude<NonNullable<NonNullable<TailwindCssPatchOptions['apply']>['extendLengthUnits']>, false>;
3
- export declare const DEFAULT_EXTEND_LENGTH_UNITS_FEATURE: ExtendLengthUnitsFeature;
4
- export declare function withDefaultExtendLengthUnits(options: TailwindCssPatchOptions | undefined): TailwindCssPatchOptions;
5
- export declare function buildExtendLengthUnitsOverride(options: TailwindCssPatchOptions | undefined): TailwindCssPatchOptions | undefined;
6
- export {};
@@ -1,4 +0,0 @@
1
- import type { TailwindTokenReport } from 'tailwindcss-patch';
2
- export declare function collectTailwindTokens(patcher: unknown): Promise<TailwindTokenReport>;
3
- export declare function formatTokenLine(entry: TailwindTokenReport['entries'][number]): string;
4
- export declare function logTokenPreview(report: TailwindTokenReport, format: string, groupKey: 'relative' | 'absolute'): void;
@@ -1,3 +0,0 @@
1
- import { tryReadJson } from './workspace-io';
2
- export declare function resolveWorkspacePackageDirs(workspaceRoot: string): Promise<string[]>;
3
- export { tryReadJson };
@@ -1,3 +0,0 @@
1
- import type { WorkspacePatchOptions, WorkspacePatchResult } from './types';
2
- export declare function patchWorkspacePackage(workspaceRoot: string, dir: string, pkgName: string | undefined, options: WorkspacePatchOptions): Promise<WorkspacePatchResult>;
3
- export { summarizeWorkspaceResults } from './patch-utils';
@@ -1,3 +0,0 @@
1
- import type { WorkspacePatchResult } from './types';
2
- export declare function formatDisplayName(workspaceRoot: string, dir: string, name?: string): string;
3
- export declare function summarizeWorkspaceResults(results: WorkspacePatchResult[]): void;
@@ -1,11 +0,0 @@
1
- export interface WorkspacePatchOptions {
2
- cwd: string | undefined;
3
- clearCache?: boolean;
4
- recordTarget?: boolean;
5
- }
6
- export interface WorkspacePatchResult {
7
- dir: string;
8
- name?: string;
9
- status: 'patched' | 'skipped' | 'failed';
10
- message?: string;
11
- }
@@ -1,2 +0,0 @@
1
- export declare function parseWorkspaceGlobsFromPackageJson(workspaceRoot: string): string[];
2
- export declare function parseWorkspaceGlobsFromWorkspaceFile(workspaceRoot: string): string[];
@@ -1 +0,0 @@
1
- export declare function tryReadJson<T extends Record<string, any>>(file: string): T | undefined;
@@ -1 +0,0 @@
1
- export declare function parseImportersFromLock(workspaceRoot: string): string[];
@@ -1,2 +0,0 @@
1
- import type { WorkspacePatchOptions } from './workspace/types';
2
- export declare function patchWorkspace(options: WorkspacePatchOptions): Promise<void>;
@@ -1,44 +0,0 @@
1
- //#region src/css-macro/constants.ts
2
- const queryKey = "weapp-tw-platform";
3
- function createMediaQuery(value) {
4
- return `@media (${queryKey}:"${value}"){&}`;
5
- }
6
- function createNegativeMediaQuery(value) {
7
- return `@media not screen and (${queryKey}:"${value}"){&}`;
8
- }
9
- const UNESCAPED_UNDERSCORE_RE = /(?<!\\)_/g;
10
- const WHITESPACE_RE = /\s+/g;
11
- const LOGICAL_OPERATOR_RE = /\s*(\|\||&&)\s*/g;
12
- function normalComment(text) {
13
- if (typeof text === "string") {
14
- const normalized = text.replaceAll(UNESCAPED_UNDERSCORE_RE, " ").replaceAll(WHITESPACE_RE, " ").trim();
15
- if (normalized.includes("\\")) return normalized;
16
- return normalized.replaceAll(LOGICAL_OPERATOR_RE, " $1 ").replaceAll(WHITESPACE_RE, " ").trim();
17
- }
18
- return text;
19
- }
20
- function ifdef(text) {
21
- return {
22
- start: `#ifdef ${normalComment(text)}`,
23
- end: `#endif`
24
- };
25
- }
26
- function ifndef(text) {
27
- return {
28
- start: `#ifndef ${normalComment(text)}`,
29
- end: `#endif`
30
- };
31
- }
32
- const QUERY_KEY_REGEX = new RegExp(`\\(\\s*${queryKey}\\s*:\\s*"([^)]*)"\\)`, "g");
33
- function matchCustomPropertyFromValue(str, cb) {
34
- let index = 0;
35
- QUERY_KEY_REGEX.lastIndex = 0;
36
- let arr = QUERY_KEY_REGEX.exec(str);
37
- while (arr !== null) {
38
- cb(arr, index);
39
- index++;
40
- arr = QUERY_KEY_REGEX.exec(str);
41
- }
42
- }
43
- //#endregion
44
- export { matchCustomPropertyFromValue as a, ifndef as i, createNegativeMediaQuery as n, ifdef as r, createMediaQuery as t };
@@ -1,73 +0,0 @@
1
- //#region src/css-macro/constants.ts
2
- const queryKey = "weapp-tw-platform";
3
- function createMediaQuery(value) {
4
- return `@media (${queryKey}:"${value}"){&}`;
5
- }
6
- function createNegativeMediaQuery(value) {
7
- return `@media not screen and (${queryKey}:"${value}"){&}`;
8
- }
9
- const UNESCAPED_UNDERSCORE_RE = /(?<!\\)_/g;
10
- const WHITESPACE_RE = /\s+/g;
11
- const LOGICAL_OPERATOR_RE = /\s*(\|\||&&)\s*/g;
12
- function normalComment(text) {
13
- if (typeof text === "string") {
14
- const normalized = text.replaceAll(UNESCAPED_UNDERSCORE_RE, " ").replaceAll(WHITESPACE_RE, " ").trim();
15
- if (normalized.includes("\\")) return normalized;
16
- return normalized.replaceAll(LOGICAL_OPERATOR_RE, " $1 ").replaceAll(WHITESPACE_RE, " ").trim();
17
- }
18
- return text;
19
- }
20
- function ifdef(text) {
21
- return {
22
- start: `#ifdef ${normalComment(text)}`,
23
- end: `#endif`
24
- };
25
- }
26
- function ifndef(text) {
27
- return {
28
- start: `#ifndef ${normalComment(text)}`,
29
- end: `#endif`
30
- };
31
- }
32
- const QUERY_KEY_REGEX = new RegExp(`\\(\\s*${queryKey}\\s*:\\s*"([^)]*)"\\)`, "g");
33
- function matchCustomPropertyFromValue(str, cb) {
34
- let index = 0;
35
- QUERY_KEY_REGEX.lastIndex = 0;
36
- let arr = QUERY_KEY_REGEX.exec(str);
37
- while (arr !== null) {
38
- cb(arr, index);
39
- index++;
40
- arr = QUERY_KEY_REGEX.exec(str);
41
- }
42
- }
43
- //#endregion
44
- Object.defineProperty(exports, "createMediaQuery", {
45
- enumerable: true,
46
- get: function() {
47
- return createMediaQuery;
48
- }
49
- });
50
- Object.defineProperty(exports, "createNegativeMediaQuery", {
51
- enumerable: true,
52
- get: function() {
53
- return createNegativeMediaQuery;
54
- }
55
- });
56
- Object.defineProperty(exports, "ifdef", {
57
- enumerable: true,
58
- get: function() {
59
- return ifdef;
60
- }
61
- });
62
- Object.defineProperty(exports, "ifndef", {
63
- enumerable: true,
64
- get: function() {
65
- return ifndef;
66
- }
67
- });
68
- Object.defineProperty(exports, "matchCustomPropertyFromValue", {
69
- enumerable: true,
70
- get: function() {
71
- return matchCustomPropertyFromValue;
72
- }
73
- });
@@ -1,177 +0,0 @@
1
- const require_chunk = require("./chunk-8l464Juk.js");
2
- let node_module = require("node:module");
3
- let node_path = require("node:path");
4
- node_path = require_chunk.__toESM(node_path);
5
- //#region src/bundlers/shared/module-graph.ts
6
- const QUERY_HASH_RE = /[?#].*$/u;
7
- const PROTOCOL_RE = /^[a-z][a-z+.-]*:/iu;
8
- const WINDOWS_ABSOLUTE_RE = /^[a-z]:[\\/]/iu;
9
- const VIRTUAL_PREFIX = "\0";
10
- const JS_EXTENSIONS = [
11
- ".js",
12
- ".mjs",
13
- ".cjs"
14
- ];
15
- function normalizeOutputPathKey(value) {
16
- return node_path.default.normalize(value).replace(/\\/g, "/");
17
- }
18
- function stripQueryAndHash(specifier) {
19
- return specifier.replace(QUERY_HASH_RE, "");
20
- }
21
- function isResolvableSpecifier(specifier) {
22
- if (!specifier) return false;
23
- const normalized = stripQueryAndHash(specifier);
24
- if (normalized.startsWith(VIRTUAL_PREFIX)) return false;
25
- if (node_path.default.isAbsolute(normalized) || WINDOWS_ABSOLUTE_RE.test(normalized)) return true;
26
- return !PROTOCOL_RE.test(normalized);
27
- }
28
- function toAbsoluteOutputPath(fileName, outDir) {
29
- if (node_path.default.isAbsolute(fileName) || WINDOWS_ABSOLUTE_RE.test(fileName)) return node_path.default.normalize(fileName);
30
- return node_path.default.resolve(outDir, fileName);
31
- }
32
- function matchWithExtensions(candidate, hasOutput) {
33
- if (hasOutput(candidate)) return candidate;
34
- if (!node_path.default.extname(candidate)) for (const ext of JS_EXTENSIONS) {
35
- const extended = `${candidate}${ext}`;
36
- if (hasOutput(extended)) return extended;
37
- }
38
- }
39
- function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
40
- if (!isResolvableSpecifier(specifier)) return;
41
- const normalized = stripQueryAndHash(specifier);
42
- let candidate;
43
- if (node_path.default.isAbsolute(normalized) || WINDOWS_ABSOLUTE_RE.test(normalized)) candidate = node_path.default.normalize(normalized);
44
- else if (normalized.startsWith("/")) candidate = node_path.default.resolve(outDir, normalized.slice(1));
45
- else candidate = node_path.default.resolve(node_path.default.dirname(importer), normalized);
46
- return matchWithExtensions(candidate, hasOutput);
47
- }
48
- //#endregion
49
- //#region src/utils/disabled.ts
50
- function resolveDisabledOptions(disabled) {
51
- if (disabled === true) return {
52
- plugin: true,
53
- rewriteCssImports: false
54
- };
55
- if (disabled === false || disabled == null) return {
56
- plugin: false,
57
- rewriteCssImports: false
58
- };
59
- return {
60
- plugin: disabled.plugin ?? false,
61
- rewriteCssImports: disabled.rewriteCssImports ?? false
62
- };
63
- }
64
- //#endregion
65
- //#region src/utils/resolve-package.ts
66
- const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
67
- function resolvePackageDir(name) {
68
- const pkgPath = require$1.resolve(`${name}/package.json`);
69
- return node_path.default.dirname(pkgPath);
70
- }
71
- //#endregion
72
- //#region src/bundlers/shared/run-tasks.ts
73
- async function runWithConcurrency(factories, limit = Math.min(4, Math.max(1, factories.length))) {
74
- if (factories.length === 0) return [];
75
- const results = Array.from({ length: factories.length });
76
- const executing = /* @__PURE__ */ new Set();
77
- let cursor = 0;
78
- const effectiveLimit = Math.max(1, limit);
79
- const scheduleNext = () => {
80
- if (cursor >= factories.length) return;
81
- const currentIndex = cursor++;
82
- const wrapped = Promise.resolve(factories[currentIndex]()).then((value) => {
83
- results[currentIndex] = value;
84
- }).finally(() => {
85
- executing.delete(wrapped);
86
- });
87
- executing.add(wrapped);
88
- };
89
- while (cursor < factories.length && executing.size < effectiveLimit) scheduleNext();
90
- while (cursor < factories.length) {
91
- await Promise.race(executing);
92
- scheduleNext();
93
- }
94
- await Promise.all(executing);
95
- return results;
96
- }
97
- function pushConcurrentTaskFactories(queue, factories, limit) {
98
- if (factories.length === 0) return;
99
- queue.push(runWithConcurrency(factories, limit).then(() => void 0));
100
- }
101
- //#endregion
102
- //#region src/bundlers/shared/css-imports.ts
103
- const tailwindcssImportRE = /^tailwindcss(?:\/.*)?$/;
104
- const tailwindcssCssImportStatementRE = /(@import\s+(?:url\(\s*)?)(["'])(tailwindcss(?:\/[^"']*)?\$?)(\2\s*\)?)/gi;
105
- function normalizeTailwindcssSpecifier(specifier) {
106
- if (specifier === "tailwindcss$") return "tailwindcss";
107
- return specifier;
108
- }
109
- function getTailwindcssSubpath(specifier) {
110
- if (specifier === "tailwindcss") return "index.css";
111
- return specifier.slice(12);
112
- }
113
- function resolveTailwindcssImport(specifier, pkgDir, options) {
114
- const normalized = normalizeTailwindcssSpecifier(specifier);
115
- if (!tailwindcssImportRE.test(normalized)) return null;
116
- if (normalized === "tailwindcss") return options?.rootImport ?? "weapp-tailwindcss/index.css";
117
- return (options?.join ?? node_path.default.join)(pkgDir, getTailwindcssSubpath(normalized));
118
- }
119
- function rewriteTailwindcssImportsInCode(code, pkgDir, options) {
120
- let hasReplacements = false;
121
- const rewritten = code.replace(tailwindcssCssImportStatementRE, (full, prefix, quote, specifier, suffix) => {
122
- const replacement = resolveTailwindcssImport(specifier, pkgDir, options);
123
- if (!replacement) return full;
124
- hasReplacements = true;
125
- return `${prefix}${quote}${replacement}${suffix}`;
126
- });
127
- return hasReplacements ? rewritten : void 0;
128
- }
129
- //#endregion
130
- Object.defineProperty(exports, "normalizeOutputPathKey", {
131
- enumerable: true,
132
- get: function() {
133
- return normalizeOutputPathKey;
134
- }
135
- });
136
- Object.defineProperty(exports, "pushConcurrentTaskFactories", {
137
- enumerable: true,
138
- get: function() {
139
- return pushConcurrentTaskFactories;
140
- }
141
- });
142
- Object.defineProperty(exports, "resolveDisabledOptions", {
143
- enumerable: true,
144
- get: function() {
145
- return resolveDisabledOptions;
146
- }
147
- });
148
- Object.defineProperty(exports, "resolveOutputSpecifier", {
149
- enumerable: true,
150
- get: function() {
151
- return resolveOutputSpecifier;
152
- }
153
- });
154
- Object.defineProperty(exports, "resolvePackageDir", {
155
- enumerable: true,
156
- get: function() {
157
- return resolvePackageDir;
158
- }
159
- });
160
- Object.defineProperty(exports, "resolveTailwindcssImport", {
161
- enumerable: true,
162
- get: function() {
163
- return resolveTailwindcssImport;
164
- }
165
- });
166
- Object.defineProperty(exports, "rewriteTailwindcssImportsInCode", {
167
- enumerable: true,
168
- get: function() {
169
- return rewriteTailwindcssImportsInCode;
170
- }
171
- });
172
- Object.defineProperty(exports, "toAbsoluteOutputPath", {
173
- enumerable: true,
174
- get: function() {
175
- return toAbsoluteOutputPath;
176
- }
177
- });