weapp-tailwindcss 3.7.0 → 3.8.0-alpha.0

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 (149) hide show
  1. package/README.md +1 -23
  2. package/dist/chunk-35CYTBPM.js +26 -0
  3. package/dist/chunk-6FNC3XMI.js +45 -0
  4. package/dist/chunk-6Z776ZWK.js +43 -0
  5. package/dist/chunk-75EWCRQW.mjs +13 -0
  6. package/dist/chunk-7J6ZENMS.js +216 -0
  7. package/dist/chunk-A2EDVNQK.mjs +173 -0
  8. package/dist/chunk-AB467PG7.mjs +43 -0
  9. package/dist/chunk-AXBFBHS2.mjs +45 -0
  10. package/dist/chunk-C7DFN4K3.js +152 -0
  11. package/dist/chunk-FYOOMUKL.js +115 -0
  12. package/dist/chunk-HBQASQKY.js +13 -0
  13. package/dist/chunk-JVPRWRPJ.mjs +115 -0
  14. package/dist/chunk-K7CL4YBQ.mjs +216 -0
  15. package/dist/chunk-KE7J6XFD.mjs +537 -0
  16. package/dist/chunk-LQN2VTMU.js +537 -0
  17. package/dist/chunk-MUJ65IQ3.mjs +26 -0
  18. package/dist/chunk-QJPVKPQS.js +1003 -0
  19. package/dist/chunk-RFNUATFD.js +24 -0
  20. package/dist/chunk-T4A3DCFN.mjs +152 -0
  21. package/dist/chunk-U7O2XXYR.mjs +24 -0
  22. package/dist/chunk-VFCTLSC3.mjs +1003 -0
  23. package/dist/chunk-VKSQ6BRD.mjs +27 -0
  24. package/dist/chunk-WMQLIT4T.js +173 -0
  25. package/dist/chunk-XSZXPWWL.js +27 -0
  26. package/dist/cli.d.mts +2 -0
  27. package/dist/cli.d.ts +2 -1
  28. package/dist/cli.js +23 -3400
  29. package/dist/cli.mjs +28 -3392
  30. package/dist/core.d.mts +27 -0
  31. package/dist/core.d.ts +23 -4
  32. package/dist/core.js +34 -56
  33. package/dist/core.mjs +36 -54
  34. package/dist/css-macro/postcss.d.mts +7 -0
  35. package/dist/css-macro/postcss.d.ts +5 -3
  36. package/dist/css-macro/postcss.js +54 -45
  37. package/dist/css-macro/postcss.mjs +54 -45
  38. package/dist/css-macro.d.mts +18 -0
  39. package/dist/css-macro.d.ts +18 -0
  40. package/dist/css-macro.js +40 -0
  41. package/dist/css-macro.mjs +38 -0
  42. package/dist/defaults.d.mts +16 -0
  43. package/dist/defaults.d.ts +16 -2
  44. package/dist/defaults.js +5 -9
  45. package/dist/defaults.mjs +8 -4
  46. package/dist/escape.d.mts +19 -0
  47. package/dist/escape.d.ts +19 -4
  48. package/dist/escape.js +11 -0
  49. package/dist/escape.mjs +11 -0
  50. package/dist/gulp.d.mts +26 -0
  51. package/dist/gulp.d.ts +26 -1
  52. package/dist/gulp.js +11 -36
  53. package/dist/gulp.mjs +14 -31
  54. package/dist/index-g4epDIUu.d.mts +534 -0
  55. package/dist/index-g4epDIUu.d.ts +534 -0
  56. package/dist/index.d.mts +17 -0
  57. package/dist/index.d.ts +17 -4
  58. package/dist/index.js +22 -44
  59. package/dist/index.mjs +22 -34
  60. package/dist/postcss.d.mts +28 -0
  61. package/dist/postcss.d.ts +28 -1
  62. package/dist/postcss.js +9 -24
  63. package/dist/postcss.mjs +16 -8
  64. package/dist/replace.d.mts +22 -0
  65. package/dist/replace.d.ts +22 -3
  66. package/dist/replace.js +33 -50
  67. package/dist/replace.mjs +32 -25
  68. package/dist/shared-5ArEo9kL.d.mts +5 -0
  69. package/dist/shared-DI2Qz1ou.d.ts +5 -0
  70. package/dist/vite.d.mts +22 -0
  71. package/dist/vite.d.ts +22 -1
  72. package/dist/vite.js +11 -34
  73. package/dist/vite.mjs +14 -29
  74. package/dist/weapp-tw-runtime-loader.d.mts +7 -0
  75. package/dist/{bundlers/webpack/loaders/weapp-tw-runtime-loader.d.ts → weapp-tw-runtime-loader.d.ts} +4 -2
  76. package/dist/weapp-tw-runtime-loader.js +12 -12
  77. package/dist/weapp-tw-runtime-loader.mjs +12 -8
  78. package/dist/webpack.d.mts +26 -0
  79. package/dist/webpack.d.ts +26 -1
  80. package/dist/webpack.js +11 -35
  81. package/dist/webpack.mjs +14 -30
  82. package/dist/webpack4.d.mts +27 -0
  83. package/dist/webpack4.d.ts +27 -1
  84. package/dist/webpack4.js +204 -192
  85. package/dist/webpack4.mjs +210 -189
  86. package/package.json +26 -19
  87. package/dist/babel/index.d.ts +0 -5
  88. package/dist/bundlers/gulp/index.d.ts +0 -7
  89. package/dist/bundlers/vite/index.d.ts +0 -3
  90. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -8
  91. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +0 -8
  92. package/dist/bundlers/webpack/index.d.ts +0 -1
  93. package/dist/cache/index.d.ts +0 -31
  94. package/dist/constants-CFM1J-h1.js +0 -42
  95. package/dist/constants-Dy2Dd3Fz.mjs +0 -36
  96. package/dist/constants.d.ts +0 -7
  97. package/dist/css-macro/constants.d.ts +0 -14
  98. package/dist/css-macro/index.d.ts +0 -15
  99. package/dist/css-macro/index.js +0 -36
  100. package/dist/css-macro/index.mjs +0 -30
  101. package/dist/debug/index.d.ts +0 -2
  102. package/dist/defaults-5A8JI2hW.mjs +0 -139
  103. package/dist/defaults-CdqzSWsR.js +0 -145
  104. package/dist/defu-Cdz2PomB.js +0 -60
  105. package/dist/defu-n46TJT6t.mjs +0 -57
  106. package/dist/env.d.ts +0 -2
  107. package/dist/extractors/split.d.ts +0 -3
  108. package/dist/index-BEIjgKpF.mjs +0 -11
  109. package/dist/index-BF8k8rHr.mjs +0 -517
  110. package/dist/index-BTXkyxen.js +0 -136
  111. package/dist/index-C0QsyqD6.mjs +0 -134
  112. package/dist/index-ClSBbhnm.js +0 -130
  113. package/dist/index-DoMb0-xW.mjs +0 -124
  114. package/dist/index-HC-Qkn0i.js +0 -17
  115. package/dist/index-h2-ZMO3S.js +0 -530
  116. package/dist/init.d.ts +0 -34
  117. package/dist/js/ast-grep.d.ts +0 -1
  118. package/dist/js/babel.d.ts +0 -3
  119. package/dist/js/handlers.d.ts +0 -11
  120. package/dist/js/index.d.ts +0 -7
  121. package/dist/logger.d.ts +0 -1
  122. package/dist/mangle/index.d.ts +0 -8
  123. package/dist/npm.d.ts +0 -22
  124. package/dist/options-Bv-1GQJY.js +0 -891
  125. package/dist/options-yXyCFCtr.mjs +0 -858
  126. package/dist/options.d.ts +0 -2
  127. package/dist/postcss/cssVars.d.ts +0 -5
  128. package/dist/postcss/index.d.ts +0 -4
  129. package/dist/postcss/mp.d.ts +0 -8
  130. package/dist/postcss/plugins/ctx.d.ts +0 -6
  131. package/dist/postcss/plugins/index.d.ts +0 -7
  132. package/dist/postcss/plugins/post.d.ts +0 -5
  133. package/dist/postcss/plugins/pre.d.ts +0 -5
  134. package/dist/postcss/preflight.d.ts +0 -3
  135. package/dist/postcss/selectorParser.d.ts +0 -6
  136. package/dist/postcss/shared.d.ts +0 -3
  137. package/dist/postcss/symbols.d.ts +0 -1
  138. package/dist/reg.d.ts +0 -1
  139. package/dist/shared-COWjpokr.mjs +0 -25
  140. package/dist/shared-r_GpWheO.js +0 -28
  141. package/dist/tailwindcss/patcher.d.ts +0 -3
  142. package/dist/types.d.ts +0 -165
  143. package/dist/utils.d.ts +0 -18
  144. package/dist/v5-DwFXG7m_.js +0 -181
  145. package/dist/v5-N5BYJ5JY.mjs +0 -174
  146. package/dist/wxml/Tokenizer.d.ts +0 -31
  147. package/dist/wxml/index.d.ts +0 -2
  148. package/dist/wxml/shared.d.ts +0 -2
  149. package/dist/wxml/utils.d.ts +0 -10
@@ -0,0 +1,27 @@
1
+ // src/postcss/shared.ts
2
+ import { escape, SimpleMappingChars2String } from "@weapp-core/escape";
3
+ function internalCssSelectorReplacer(selectors, options = {
4
+ escapeMap: SimpleMappingChars2String
5
+ }) {
6
+ const { mangleContext, escapeMap } = options;
7
+ if (mangleContext) {
8
+ selectors = mangleContext.cssHandler(selectors);
9
+ }
10
+ return escape(selectors, {
11
+ map: escapeMap
12
+ });
13
+ }
14
+ function composeIsPseudo(strs) {
15
+ if (typeof strs === "string") {
16
+ return strs;
17
+ }
18
+ if (strs.length > 1) {
19
+ return `:is(${strs.join(",")})`;
20
+ }
21
+ return strs.join("");
22
+ }
23
+
24
+ export {
25
+ internalCssSelectorReplacer,
26
+ composeIsPseudo
27
+ };
@@ -0,0 +1,173 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
4
+
5
+
6
+ var _chunkQJPVKPQSjs = require('./chunk-QJPVKPQS.js');
7
+
8
+
9
+ var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
10
+
11
+
12
+ var _chunkLQN2VTMUjs = require('./chunk-LQN2VTMU.js');
13
+
14
+
15
+ var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
16
+
17
+ // src/bundlers/vite/index.ts
18
+ var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
19
+ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
20
+ const opts = _chunkQJPVKPQSjs.getOptions.call(void 0, options);
21
+ const {
22
+ disabled,
23
+ onEnd,
24
+ onLoad,
25
+ onStart,
26
+ onUpdate,
27
+ templateHandler,
28
+ styleHandler,
29
+ patch,
30
+ jsHandler,
31
+ mainCssChunkMatcher,
32
+ appType,
33
+ setMangleRuntimeSet,
34
+ cache,
35
+ twPatcher
36
+ } = opts;
37
+ if (disabled) {
38
+ return;
39
+ }
40
+ patch == null ? void 0 : patch();
41
+ onLoad();
42
+ return {
43
+ name: _chunkLQN2VTMUjs.vitePluginName,
44
+ enforce: "post",
45
+ generateBundle(_opt, bundle) {
46
+ return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
47
+ debug("start");
48
+ onStart();
49
+ const entries = Object.entries(bundle);
50
+ const groupedEntries = _chunk35CYTBPMjs.getGroupedEntries.call(void 0, entries, opts);
51
+ const runtimeSet = twPatcher.getClassSet();
52
+ setMangleRuntimeSet(runtimeSet);
53
+ debug("get runtimeSet, class count: %d", runtimeSet.size);
54
+ if (Array.isArray(groupedEntries.html)) {
55
+ let noCachedCount = 0;
56
+ for (let i = 0; i < groupedEntries.html.length; i++) {
57
+ const [file, originalSource] = groupedEntries.html[i];
58
+ const oldVal = originalSource.source.toString();
59
+ const hash = cache.computeHash(oldVal);
60
+ cache.calcHashValueChanged(file, hash);
61
+ yield cache.process(
62
+ file,
63
+ () => {
64
+ const source = cache.get(file);
65
+ if (source) {
66
+ originalSource.source = source;
67
+ debug("html cache hit: %s", file);
68
+ } else {
69
+ return false;
70
+ }
71
+ },
72
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
73
+ originalSource.source = yield templateHandler(oldVal, {
74
+ runtimeSet
75
+ });
76
+ onUpdate(file, oldVal, originalSource.source);
77
+ debug("html handle: %s", file);
78
+ noCachedCount++;
79
+ return {
80
+ key: file,
81
+ source: originalSource.source
82
+ };
83
+ })
84
+ );
85
+ }
86
+ debug("html handle finish, total: %d, no-cached: %d", groupedEntries.html.length, noCachedCount);
87
+ }
88
+ if (Array.isArray(groupedEntries.js)) {
89
+ let noCachedCount = 0;
90
+ for (let i = 0; i < groupedEntries.js.length; i++) {
91
+ const [file, originalSource] = groupedEntries.js[i];
92
+ const rawSource = originalSource.code;
93
+ const hash = cache.computeHash(rawSource);
94
+ cache.calcHashValueChanged(file, hash);
95
+ yield cache.process(
96
+ file,
97
+ () => {
98
+ const source = cache.get(file);
99
+ if (source) {
100
+ originalSource.code = source;
101
+ debug("js cache hit: %s", file);
102
+ } else {
103
+ return false;
104
+ }
105
+ },
106
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
107
+ const mapFilename = `${file}.map`;
108
+ const hasMap = Boolean(bundle[mapFilename]);
109
+ const { code, map } = yield jsHandler(rawSource, runtimeSet, {
110
+ generateMap: hasMap
111
+ });
112
+ originalSource.code = code;
113
+ onUpdate(file, rawSource, code);
114
+ debug("js handle: %s", file);
115
+ noCachedCount++;
116
+ if (hasMap && map) {
117
+ ;
118
+ bundle[mapFilename].source = map.toString();
119
+ }
120
+ return {
121
+ key: file,
122
+ source: code
123
+ };
124
+ })
125
+ );
126
+ }
127
+ debug("js handle finish, total: %d, no-cached: %d", groupedEntries.js.length, noCachedCount);
128
+ }
129
+ if (Array.isArray(groupedEntries.css)) {
130
+ let noCachedCount = 0;
131
+ for (let i = 0; i < groupedEntries.css.length; i++) {
132
+ const [file, originalSource] = groupedEntries.css[i];
133
+ const rawSource = originalSource.source.toString();
134
+ const hash = cache.computeHash(rawSource);
135
+ cache.calcHashValueChanged(file, hash);
136
+ yield cache.process(
137
+ file,
138
+ () => {
139
+ const source = cache.get(file);
140
+ if (source) {
141
+ originalSource.source = source;
142
+ debug("css cache hit: %s", file);
143
+ } else {
144
+ return false;
145
+ }
146
+ },
147
+ () => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
148
+ const { css } = yield styleHandler(rawSource, {
149
+ isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType)
150
+ });
151
+ originalSource.source = css;
152
+ onUpdate(file, rawSource, css);
153
+ debug("css handle: %s", file);
154
+ noCachedCount++;
155
+ return {
156
+ key: file,
157
+ source: css
158
+ };
159
+ })
160
+ );
161
+ }
162
+ debug("css handle finish, total: %d, no-cached: %d", groupedEntries.css.length, noCachedCount);
163
+ }
164
+ onEnd();
165
+ debug("end");
166
+ });
167
+ }
168
+ };
169
+ }
170
+
171
+
172
+
173
+ exports.UnifiedViteWeappTailwindcssPlugin = UnifiedViteWeappTailwindcssPlugin;
@@ -0,0 +1,27 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/postcss/shared.ts
2
+ var _escape = require('@weapp-core/escape');
3
+ function internalCssSelectorReplacer(selectors, options = {
4
+ escapeMap: _escape.SimpleMappingChars2String
5
+ }) {
6
+ const { mangleContext, escapeMap } = options;
7
+ if (mangleContext) {
8
+ selectors = mangleContext.cssHandler(selectors);
9
+ }
10
+ return _escape.escape.call(void 0, selectors, {
11
+ map: escapeMap
12
+ });
13
+ }
14
+ function composeIsPseudo(strs) {
15
+ if (typeof strs === "string") {
16
+ return strs;
17
+ }
18
+ if (strs.length > 1) {
19
+ return `:is(${strs.join(",")})`;
20
+ }
21
+ return strs.join("");
22
+ }
23
+
24
+
25
+
26
+
27
+ exports.internalCssSelectorReplacer = internalCssSelectorReplacer; exports.composeIsPseudo = composeIsPseudo;
package/dist/cli.d.mts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/cli.d.ts CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+
2
+ export { }