weapp-tailwindcss 4.9.2 → 4.9.3

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 (54) hide show
  1. package/dist/{chunk-DNRNFN4I.js → chunk-3UOPODB3.js} +44 -44
  2. package/dist/{chunk-2L6NDZIQ.mjs → chunk-4HESZS5A.mjs} +2 -2
  3. package/dist/{chunk-5O6237HX.js → chunk-4RUFPPI6.js} +400 -377
  4. package/dist/{chunk-ZE7JKKFT.mjs → chunk-7D27E7TU.mjs} +438 -415
  5. package/dist/{chunk-W3MTTQ5M.js → chunk-A2BRI46M.js} +5 -5
  6. package/dist/{chunk-3SKEY32E.mjs → chunk-F2CKKG6Q.mjs} +67 -67
  7. package/dist/{chunk-VU2GIXVH.js → chunk-I3IRT5VH.js} +7 -7
  8. package/dist/chunk-IMOEZLDR.js +441 -0
  9. package/dist/{chunk-WGBJY2H3.mjs → chunk-IW3B6ZJD.mjs} +646 -565
  10. package/dist/{chunk-U7BH6QHE.js → chunk-KXZ4MP4L.js} +277 -236
  11. package/dist/chunk-PU5CC4ZI.mjs +444 -0
  12. package/dist/{chunk-FFGR5V3H.mjs → chunk-SPH6SCTM.mjs} +1 -1
  13. package/dist/{chunk-XXJNXESJ.js → chunk-VOD2WUH6.js} +635 -554
  14. package/dist/{chunk-2WPTDMN3.js → chunk-VPHA77FH.js} +61 -61
  15. package/dist/{chunk-CBOVUIXD.mjs → chunk-WH65CIYG.mjs} +41 -41
  16. package/dist/{chunk-UAEME5HT.js → chunk-Y6F6NBA7.js} +1 -1
  17. package/dist/{chunk-DSD5JRCQ.mjs → chunk-Z2D5NSG5.mjs} +265 -224
  18. package/dist/{chunk-G5OV7IOU.mjs → chunk-ZL22KEHH.mjs} +2 -2
  19. package/dist/cli.js +182 -136
  20. package/dist/cli.mjs +194 -148
  21. package/dist/core.js +10 -10
  22. package/dist/core.mjs +4 -4
  23. package/dist/css-macro/postcss.js +1 -1
  24. package/dist/css-macro/postcss.mjs +1 -1
  25. package/dist/css-macro.js +1 -1
  26. package/dist/css-macro.mjs +1 -1
  27. package/dist/defaults.js +1 -1
  28. package/dist/defaults.mjs +1 -1
  29. package/dist/gulp.js +6 -6
  30. package/dist/gulp.mjs +5 -5
  31. package/dist/index.js +10 -10
  32. package/dist/index.mjs +9 -9
  33. package/dist/postcss-html-transform.js +1 -1
  34. package/dist/postcss-html-transform.mjs +1 -1
  35. package/dist/presets.js +5 -5
  36. package/dist/presets.mjs +2 -2
  37. package/dist/reset.d.mts +2 -1
  38. package/dist/reset.d.ts +2 -1
  39. package/dist/reset.js +25 -21
  40. package/dist/reset.mjs +25 -21
  41. package/dist/types.d.mts +503 -474
  42. package/dist/types.d.ts +503 -474
  43. package/dist/types.js +1 -1
  44. package/dist/types.mjs +1 -1
  45. package/dist/vite.js +7 -7
  46. package/dist/vite.mjs +6 -6
  47. package/dist/weapp-tw-css-import-rewrite-loader.js +2 -4
  48. package/dist/webpack.js +8 -8
  49. package/dist/webpack.mjs +7 -7
  50. package/dist/webpack4.js +351 -307
  51. package/dist/webpack4.mjs +341 -297
  52. package/package.json +10 -10
  53. package/dist/chunk-5AKI6FQP.mjs +0 -397
  54. package/dist/chunk-SNEMGP42.js +0 -394
@@ -1,22 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
4
+ var _chunkVOD2WUH6js = require('./chunk-VOD2WUH6.js');
5
5
 
6
6
 
7
- var _chunk5O6237HXjs = require('./chunk-5O6237HX.js');
7
+ var _chunk4RUFPPI6js = require('./chunk-4RUFPPI6.js');
8
8
 
9
9
  // src/tailwindcss/recorder.ts
10
10
  function setupPatchRecorder(patcher, baseDir, options) {
11
- const recorder = _chunkXXJNXESJjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
11
+ const recorder = _chunkVOD2WUH6js.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
12
12
  if (_optionalChain([recorder, 'optionalAccess', _ => _.message]) && _optionalChain([options, 'optionalAccess', _2 => _2.logMessage]) !== false) {
13
13
  const prefix = _optionalChain([options, 'optionalAccess', _3 => _3.messagePrefix]) ? `${options.messagePrefix} ` : "";
14
- _chunk5O6237HXjs.logger.info("%s%s", prefix, recorder.message);
14
+ _chunk4RUFPPI6js.logger.info("%s%s", prefix, recorder.message);
15
15
  }
16
16
  const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _4 => _4.onPatched]) ? async () => {
17
17
  await recorder.onPatched();
18
18
  } : void 0;
19
- const patchPromise = patcher ? _chunkXXJNXESJjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
19
+ const patchPromise = patcher ? _chunkVOD2WUH6js.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
20
20
  return {
21
21
  recorder,
22
22
  patchPromise,
@@ -1,5 +1,28 @@
1
- // src/bundlers/shared/module-graph.ts
1
+ // src/utils/disabled.ts
2
+ function resolveDisabledOptions(disabled) {
3
+ if (disabled === true) {
4
+ return { plugin: true, rewriteCssImports: false };
5
+ }
6
+ if (disabled === false || disabled == null) {
7
+ return { plugin: false, rewriteCssImports: false };
8
+ }
9
+ return {
10
+ plugin: disabled.plugin ?? false,
11
+ rewriteCssImports: disabled.rewriteCssImports ?? false
12
+ };
13
+ }
14
+
15
+ // src/utils/resolve-package.ts
16
+ import { createRequire } from "module";
2
17
  import path from "path";
18
+ var require2 = createRequire(import.meta.url);
19
+ function resolvePackageDir(name) {
20
+ const pkgPath = require2.resolve(`${name}/package.json`);
21
+ return path.dirname(pkgPath);
22
+ }
23
+
24
+ // src/bundlers/shared/module-graph.ts
25
+ import path2 from "path";
3
26
  var QUERY_HASH_RE = /[?#].*$/u;
4
27
  var PROTOCOL_RE = /^[a-z][a-z+.-]*:/iu;
5
28
  var VIRTUAL_PREFIX = "\0";
@@ -18,16 +41,16 @@ function isResolvableSpecifier(specifier) {
18
41
  return !PROTOCOL_RE.test(normalized);
19
42
  }
20
43
  function toAbsoluteOutputPath(fileName, outDir) {
21
- if (path.isAbsolute(fileName)) {
44
+ if (path2.isAbsolute(fileName)) {
22
45
  return fileName;
23
46
  }
24
- return path.resolve(outDir, fileName);
47
+ return path2.resolve(outDir, fileName);
25
48
  }
26
49
  function matchWithExtensions(candidate, hasOutput) {
27
50
  if (hasOutput(candidate)) {
28
51
  return candidate;
29
52
  }
30
- if (!path.extname(candidate)) {
53
+ if (!path2.extname(candidate)) {
31
54
  for (const ext of JS_EXTENSIONS) {
32
55
  const extended = `${candidate}${ext}`;
33
56
  if (hasOutput(extended)) {
@@ -43,37 +66,54 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
43
66
  }
44
67
  const normalized = stripQueryAndHash(specifier);
45
68
  let candidate;
46
- if (path.isAbsolute(normalized)) {
69
+ if (path2.isAbsolute(normalized)) {
47
70
  candidate = normalized;
48
71
  } else if (normalized.startsWith("/")) {
49
- candidate = path.resolve(outDir, normalized.slice(1));
72
+ candidate = path2.resolve(outDir, normalized.slice(1));
50
73
  } else {
51
- candidate = path.resolve(path.dirname(importer), normalized);
74
+ candidate = path2.resolve(path2.dirname(importer), normalized);
52
75
  }
53
76
  return matchWithExtensions(candidate, hasOutput);
54
77
  }
55
78
 
56
- // src/utils/disabled.ts
57
- function resolveDisabledOptions(disabled) {
58
- if (disabled === true) {
59
- return { plugin: true, rewriteCssImports: false };
60
- }
61
- if (disabled === false || disabled == null) {
62
- return { plugin: false, rewriteCssImports: false };
79
+ // src/bundlers/shared/run-tasks.ts
80
+ async function runWithConcurrency(factories, limit = Math.min(4, Math.max(1, factories.length))) {
81
+ if (factories.length === 0) {
82
+ return [];
63
83
  }
64
- return {
65
- plugin: disabled.plugin ?? false,
66
- rewriteCssImports: disabled.rewriteCssImports ?? false
84
+ const results = Array.from({ length: factories.length });
85
+ const executing = /* @__PURE__ */ new Set();
86
+ let cursor = 0;
87
+ const effectiveLimit = Math.max(1, limit);
88
+ const scheduleNext = () => {
89
+ if (cursor >= factories.length) {
90
+ return;
91
+ }
92
+ const currentIndex = cursor++;
93
+ const wrapped = Promise.resolve(factories[currentIndex]()).then((value) => {
94
+ results[currentIndex] = value;
95
+ }).finally(() => {
96
+ executing.delete(wrapped);
97
+ });
98
+ executing.add(wrapped);
67
99
  };
100
+ while (cursor < factories.length && executing.size < effectiveLimit) {
101
+ scheduleNext();
102
+ }
103
+ while (cursor < factories.length) {
104
+ await Promise.race(executing);
105
+ scheduleNext();
106
+ }
107
+ await Promise.all(executing);
108
+ return results;
68
109
  }
69
-
70
- // src/utils/resolve-package.ts
71
- import { createRequire } from "module";
72
- import path2 from "path";
73
- var require2 = createRequire(import.meta.url);
74
- function resolvePackageDir(name) {
75
- const pkgPath = require2.resolve(`${name}/package.json`);
76
- return path2.dirname(pkgPath);
110
+ function pushConcurrentTaskFactories(queue, factories, limit) {
111
+ if (factories.length === 0) {
112
+ return;
113
+ }
114
+ queue.push(
115
+ runWithConcurrency(factories, limit).then(() => void 0)
116
+ );
77
117
  }
78
118
 
79
119
  // src/bundlers/shared/css-imports.ts
@@ -120,52 +160,12 @@ function rewriteTailwindcssImportsInCode(code, pkgDir, options) {
120
160
  return hasReplacements ? rewritten : void 0;
121
161
  }
122
162
 
123
- // src/bundlers/shared/run-tasks.ts
124
- async function runWithConcurrency(factories, limit = Math.min(4, Math.max(1, factories.length))) {
125
- if (factories.length === 0) {
126
- return [];
127
- }
128
- const results = Array.from({ length: factories.length });
129
- const executing = /* @__PURE__ */ new Set();
130
- let cursor = 0;
131
- const effectiveLimit = Math.max(1, limit);
132
- const scheduleNext = () => {
133
- if (cursor >= factories.length) {
134
- return;
135
- }
136
- const currentIndex = cursor++;
137
- const wrapped = Promise.resolve(factories[currentIndex]()).then((value) => {
138
- results[currentIndex] = value;
139
- }).finally(() => {
140
- executing.delete(wrapped);
141
- });
142
- executing.add(wrapped);
143
- };
144
- while (cursor < factories.length && executing.size < effectiveLimit) {
145
- scheduleNext();
146
- }
147
- while (cursor < factories.length) {
148
- await Promise.race(executing);
149
- scheduleNext();
150
- }
151
- await Promise.all(executing);
152
- return results;
153
- }
154
- function pushConcurrentTaskFactories(queue, factories, limit) {
155
- if (factories.length === 0) {
156
- return;
157
- }
158
- queue.push(
159
- runWithConcurrency(factories, limit).then(() => void 0)
160
- );
161
- }
162
-
163
163
  export {
164
164
  toAbsoluteOutputPath,
165
165
  resolveOutputSpecifier,
166
166
  resolveDisabledOptions,
167
167
  resolvePackageDir,
168
+ pushConcurrentTaskFactories,
168
169
  resolveTailwindcssImport,
169
- rewriteTailwindcssImportsInCode,
170
- pushConcurrentTaskFactories
170
+ rewriteTailwindcssImportsInCode
171
171
  };
@@ -3,13 +3,13 @@
3
3
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
4
4
 
5
5
 
6
- var _chunkW3MTTQ5Mjs = require('./chunk-W3MTTQ5M.js');
6
+ var _chunkA2BRI46Mjs = require('./chunk-A2BRI46M.js');
7
7
 
8
8
 
9
9
 
10
10
 
11
11
 
12
- var _chunkXXJNXESJjs = require('./chunk-XXJNXESJ.js');
12
+ var _chunkVOD2WUH6js = require('./chunk-VOD2WUH6.js');
13
13
 
14
14
  // src/bundlers/gulp/index.ts
15
15
  var _buffer = require('buffer');
@@ -17,12 +17,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
17
17
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
18
18
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
19
19
  var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
20
- var debug = _chunkXXJNXESJjs.createDebug.call(void 0, );
20
+ var debug = _chunkVOD2WUH6js.createDebug.call(void 0, );
21
21
  var Transform = _stream2.default.Transform;
22
22
  function createPlugins(options = {}) {
23
- const opts = _chunkXXJNXESJjs.getCompilerContext.call(void 0, options);
23
+ const opts = _chunkVOD2WUH6js.getCompilerContext.call(void 0, options);
24
24
  const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
25
- const patchRecorderState = _chunkW3MTTQ5Mjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
25
+ const patchRecorderState = _chunkA2BRI46Mjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
26
26
  source: "runtime",
27
27
  cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
28
28
  });
@@ -36,7 +36,7 @@ function createPlugins(options = {}) {
36
36
  const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
37
37
  let runtimeSetInitialized = false;
38
38
  async function refreshRuntimeState(force) {
39
- await _chunkXXJNXESJjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
39
+ await _chunkVOD2WUH6js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
40
40
  }
41
41
  async function refreshRuntimeSet(force = false) {
42
42
  await refreshRuntimeState(force);
@@ -44,7 +44,7 @@ function createPlugins(options = {}) {
44
44
  if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
45
45
  return runtimeSet;
46
46
  }
47
- runtimeSet = await _chunkXXJNXESJjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
47
+ runtimeSet = await _chunkVOD2WUH6js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
48
48
  runtimeSetInitialized = true;
49
49
  return runtimeSet;
50
50
  }