weapp-tailwindcss 3.2.1 → 3.3.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 (58) hide show
  1. package/dist/bundlers/vite/index.d.ts +1 -1
  2. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +1 -1
  3. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
  4. package/dist/cli.js +12 -11
  5. package/dist/cli.mjs +6 -6
  6. package/dist/{constants-D-YMDg7M.js → constants-CFM1J-h1.js} +3 -3
  7. package/dist/{constants-CcqTvLgQ.mjs → constants-Dy2Dd3Fz.mjs} +3 -3
  8. package/dist/core.d.ts +1 -1
  9. package/dist/core.js +12 -13
  10. package/dist/core.mjs +12 -13
  11. package/dist/css-macro/index.js +2 -2
  12. package/dist/css-macro/index.mjs +2 -2
  13. package/dist/css-macro/postcss.js +8 -8
  14. package/dist/css-macro/postcss.mjs +8 -8
  15. package/dist/{defaults-DOGbAFEj.mjs → defaults-BDivGN-J.mjs} +10 -10
  16. package/dist/{defaults-CGBcgdIr.js → defaults-z7wUEh47.js} +10 -10
  17. package/dist/defaults.js +1 -1
  18. package/dist/defaults.mjs +1 -1
  19. package/dist/extractors/split.d.ts +1 -1
  20. package/dist/gulp.js +7 -5
  21. package/dist/gulp.mjs +7 -5
  22. package/dist/{index-UGtfFwsf.mjs → index-BMv1aBKz.mjs} +13 -16
  23. package/dist/{index-DC60ES8u.mjs → index-BPzIdybK.mjs} +91 -91
  24. package/dist/{index-EnQF5WiI.mjs → index-Bm-88xa7.mjs} +14 -16
  25. package/dist/{index-iiM-deHl.js → index-CeRMFNvT.js} +13 -16
  26. package/dist/{index-6BUjj8Rl.js → index-DwZHOkK3.js} +91 -91
  27. package/dist/{index-BpY7tq3j.js → index-oneQz6yy.js} +20 -22
  28. package/dist/index.js +9 -7
  29. package/dist/index.mjs +9 -7
  30. package/dist/js/handlers.d.ts +1 -1
  31. package/dist/mangle/index.d.ts +1 -1
  32. package/dist/{options-BjZGMFOk.js → options-DCor-e5I.js} +80 -74
  33. package/dist/{options-D1IYbX_E.mjs → options-SmfRHxH0.mjs} +82 -75
  34. package/dist/postcss/plugins/index.d.ts +2 -2
  35. package/dist/postcss/preflight.d.ts +1 -1
  36. package/dist/postcss/selectorParser.d.ts +1 -1
  37. package/dist/postcss/shared.d.ts +1 -1
  38. package/dist/postcss.js +2 -2
  39. package/dist/postcss.mjs +2 -2
  40. package/dist/replace.d.ts +1 -1
  41. package/dist/replace.js +3 -3
  42. package/dist/replace.mjs +3 -3
  43. package/dist/{shared-BX0VV-pr.mjs → shared-DbJl6i6a.mjs} +2 -2
  44. package/dist/{shared-BDew1Ric.js → shared-hzYeE1wX.js} +2 -2
  45. package/dist/tailwindcss/patcher.d.ts +4 -3
  46. package/dist/types.d.ts +7 -5
  47. package/dist/utils.d.ts +1 -1
  48. package/dist/{v5-C6FTqEeL.mjs → v5-CQUeTJ2W.mjs} +16 -19
  49. package/dist/{v5-DA4DSMKO.js → v5-ea_QoULz.js} +16 -19
  50. package/dist/vite.js +6 -5
  51. package/dist/vite.mjs +6 -5
  52. package/dist/webpack.js +6 -5
  53. package/dist/webpack.mjs +6 -5
  54. package/dist/webpack4.js +17 -19
  55. package/dist/webpack4.mjs +17 -19
  56. package/dist/wxml/shared.d.ts +1 -1
  57. package/dist/wxml/utils.d.ts +2 -2
  58. package/package.json +80 -78
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-BjZGMFOk.js');
3
+ var options = require('./options-DCor-e5I.js');
4
4
  var stream = require('node:stream');
5
+ var node_buffer = require('node:buffer');
5
6
  var index = require('./index-HC-Qkn0i.js');
6
7
 
7
8
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
@@ -12,18 +13,15 @@ const debug = index.createDebug();
12
13
  const Transform = stream__default["default"].Transform;
13
14
  function createPlugins(options$1 = {}) {
14
15
  const opts = options.getOptions(options$1);
15
- const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, tailwindcssBasedir, cache } = opts;
16
+ const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
16
17
  let runtimeSet = new Set();
17
18
  patch === null || patch === void 0 ? void 0 : patch();
18
- const twPatcher = options.createTailwindcssPatcher();
19
19
  function transformWxss(options$1 = {}) {
20
20
  return new Transform({
21
21
  objectMode: true,
22
- transform: function (file, encoding, callback) {
22
+ transform(file, encoding, callback) {
23
23
  return options.__awaiter(this, void 0, void 0, function* () {
24
- runtimeSet = twPatcher.getClassSet({
25
- basedir: tailwindcssBasedir
26
- });
24
+ runtimeSet = twPatcher.getClassSet();
27
25
  setMangleRuntimeSet(runtimeSet);
28
26
  const error = null;
29
27
  if (file.contents) {
@@ -33,7 +31,7 @@ function createPlugins(options$1 = {}) {
33
31
  yield cache.process(file.path, () => {
34
32
  const source = cache.get(file.path);
35
33
  if (source) {
36
- file.contents = Buffer.from(source);
34
+ file.contents = node_buffer.Buffer.from(source);
37
35
  debug('css cache hit: %s', file.path);
38
36
  }
39
37
  else {
@@ -41,23 +39,23 @@ function createPlugins(options$1 = {}) {
41
39
  }
42
40
  }, () => options.__awaiter(this, void 0, void 0, function* () {
43
41
  const code = yield styleHandler(rawSource, Object.assign({ isMainChunk: true }, options$1));
44
- file.contents = Buffer.from(code);
42
+ file.contents = node_buffer.Buffer.from(code);
45
43
  debug('css handle: %s', file.path);
46
44
  return {
47
45
  key: file.path,
48
- source: code
46
+ source: code,
49
47
  };
50
48
  }));
51
49
  }
52
50
  callback(error, file);
53
51
  });
54
- }
52
+ },
55
53
  });
56
54
  }
57
55
  function transformJs(options$1 = {}) {
58
56
  return new Transform({
59
57
  objectMode: true,
60
- transform: function (file, encoding, callback) {
58
+ transform(file, encoding, callback) {
61
59
  return options.__awaiter(this, void 0, void 0, function* () {
62
60
  const error = null;
63
61
  if (file.contents) {
@@ -67,7 +65,7 @@ function createPlugins(options$1 = {}) {
67
65
  yield cache.process(file.path, () => {
68
66
  const source = cache.get(file.path);
69
67
  if (source) {
70
- file.contents = Buffer.from(source);
68
+ file.contents = node_buffer.Buffer.from(source);
71
69
  debug('js cache hit: %s', file.path);
72
70
  }
73
71
  else {
@@ -75,23 +73,23 @@ function createPlugins(options$1 = {}) {
75
73
  }
76
74
  }, () => options.__awaiter(this, void 0, void 0, function* () {
77
75
  const { code } = yield jsHandler(rawSource, runtimeSet, options$1);
78
- file.contents = Buffer.from(code);
76
+ file.contents = node_buffer.Buffer.from(code);
79
77
  debug('js handle: %s', file.path);
80
78
  return {
81
79
  key: file.path,
82
- source: code
80
+ source: code,
83
81
  };
84
82
  }));
85
83
  }
86
84
  callback(error, file);
87
85
  });
88
- }
86
+ },
89
87
  });
90
88
  }
91
89
  function transformWxml(options$1 = {}) {
92
90
  return new Transform({
93
91
  objectMode: true,
94
- transform: function (file, encoding, callback) {
92
+ transform(file, encoding, callback) {
95
93
  return options.__awaiter(this, void 0, void 0, function* () {
96
94
  const error = null;
97
95
  if (file.contents) {
@@ -101,7 +99,7 @@ function createPlugins(options$1 = {}) {
101
99
  yield cache.process(file.path, () => {
102
100
  const source = cache.get(file.path);
103
101
  if (source) {
104
- file.contents = Buffer.from(source);
102
+ file.contents = node_buffer.Buffer.from(source);
105
103
  debug('html cache hit: %s', file.path);
106
104
  }
107
105
  else {
@@ -109,23 +107,23 @@ function createPlugins(options$1 = {}) {
109
107
  }
110
108
  }, () => options.__awaiter(this, void 0, void 0, function* () {
111
109
  const code = yield templateHandler(rawSource, Object.assign({ runtimeSet }, options$1));
112
- file.contents = Buffer.from(code);
110
+ file.contents = node_buffer.Buffer.from(code);
113
111
  debug('html handle: %s', file.path);
114
112
  return {
115
113
  key: file.path,
116
- source: code
114
+ source: code,
117
115
  };
118
116
  }));
119
117
  }
120
118
  callback(error, file);
121
119
  });
122
- }
120
+ },
123
121
  });
124
122
  }
125
123
  return {
126
124
  transformWxss,
127
125
  transformWxml,
128
- transformJs
126
+ transformJs,
129
127
  };
130
128
  }
131
129
 
package/dist/index.js CHANGED
@@ -2,30 +2,31 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var v5 = require('./v5-DA4DSMKO.js');
6
- var index = require('./index-iiM-deHl.js');
7
- var index$1 = require('./index-BpY7tq3j.js');
8
- require('./options-BjZGMFOk.js');
5
+ var v5 = require('./v5-ea_QoULz.js');
6
+ var index = require('./index-CeRMFNvT.js');
7
+ var index$1 = require('./index-oneQz6yy.js');
8
+ require('./options-DCor-e5I.js');
9
9
  require('magic-string');
10
10
  require('./replace.js');
11
11
  require('@weapp-core/escape');
12
12
  require('@ast-core/escape');
13
- require('./shared-BDew1Ric.js');
13
+ require('./shared-hzYeE1wX.js');
14
14
  require('@weapp-core/regex');
15
15
  require('@babel/generator');
16
16
  require('@babel/traverse');
17
17
  require('@babel/parser');
18
- require('./defaults-CGBcgdIr.js');
18
+ require('./defaults-z7wUEh47.js');
19
19
  require('./defu-Cdz2PomB.js');
20
20
  require('@babel/types');
21
21
  require('htmlparser2');
22
22
  require('postcss');
23
- require('./index-6BUjj8Rl.js');
23
+ require('./index-DwZHOkK3.js');
24
24
  require('@csstools/postcss-is-pseudo-class');
25
25
  require('postcss-rem-to-responsive-pixel');
26
26
  require('postcss-selector-parser');
27
27
  require('node:path');
28
28
  require('node:fs');
29
+ require('node:process');
29
30
  require('semver');
30
31
  require('tailwindcss-patch');
31
32
  require('@tailwindcss-mangle/shared');
@@ -34,6 +35,7 @@ require('md5');
34
35
  require('./index-HC-Qkn0i.js');
35
36
  require('debug');
36
37
  require('node:stream');
38
+ require('node:buffer');
37
39
 
38
40
 
39
41
 
package/dist/index.mjs CHANGED
@@ -1,27 +1,28 @@
1
- export { U as UnifiedWebpackPluginV5 } from './v5-C6FTqEeL.mjs';
2
- export { U as UnifiedViteWeappTailwindcssPlugin } from './index-UGtfFwsf.mjs';
3
- export { c as createPlugins } from './index-EnQF5WiI.mjs';
4
- import './options-D1IYbX_E.mjs';
1
+ export { U as UnifiedWebpackPluginV5 } from './v5-CQUeTJ2W.mjs';
2
+ export { U as UnifiedViteWeappTailwindcssPlugin } from './index-BMv1aBKz.mjs';
3
+ export { c as createPlugins } from './index-Bm-88xa7.mjs';
4
+ import './options-SmfRHxH0.mjs';
5
5
  import 'magic-string';
6
6
  import './replace.mjs';
7
7
  import '@weapp-core/escape';
8
8
  import '@ast-core/escape';
9
- import './shared-BX0VV-pr.mjs';
9
+ import './shared-DbJl6i6a.mjs';
10
10
  import '@weapp-core/regex';
11
11
  import '@babel/generator';
12
12
  import '@babel/traverse';
13
13
  import '@babel/parser';
14
- import './defaults-DOGbAFEj.mjs';
14
+ import './defaults-BDivGN-J.mjs';
15
15
  import './defu-n46TJT6t.mjs';
16
16
  import '@babel/types';
17
17
  import 'htmlparser2';
18
18
  import 'postcss';
19
- import './index-DC60ES8u.mjs';
19
+ import './index-BPzIdybK.mjs';
20
20
  import '@csstools/postcss-is-pseudo-class';
21
21
  import 'postcss-rem-to-responsive-pixel';
22
22
  import 'postcss-selector-parser';
23
23
  import 'node:path';
24
24
  import 'node:fs';
25
+ import 'node:process';
25
26
  import 'semver';
26
27
  import 'tailwindcss-patch';
27
28
  import '@tailwindcss-mangle/shared';
@@ -30,3 +31,4 @@ import 'md5';
30
31
  import './index-BEIjgKpF.mjs';
31
32
  import 'debug';
32
33
  import 'node:stream';
34
+ import 'node:buffer';
@@ -1,4 +1,4 @@
1
- import MagicString from 'magic-string';
1
+ import type MagicString from 'magic-string';
2
2
  import type { IJsHandlerOptions } from "../types";
3
3
  interface ReplaceNode {
4
4
  leadingComments?: {
@@ -1,4 +1,4 @@
1
- import type { UserDefinedOptions, IMangleScopeContext } from "../types";
1
+ import type { IMangleScopeContext, UserDefinedOptions } from "../types";
2
2
  export declare const defaultMangleContext: IMangleScopeContext;
3
3
  export declare function useMangleStore(): {
4
4
  mangleContext: IMangleScopeContext;