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

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 (171) hide show
  1. package/README.md +4 -5
  2. package/bin/weapp-tailwindcss.js +1 -21
  3. package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +2 -0
  4. package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +3 -0
  5. package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +4 -0
  6. package/dist/bundlers/shared/css-cleanup/selectors.d.ts +8 -0
  7. package/dist/bundlers/shared/css-cleanup.d.ts +1 -2
  8. package/dist/bundlers/shared/generator-css/config-directive.d.ts +2 -0
  9. package/dist/bundlers/shared/generator-css/directives.d.ts +11 -0
  10. package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +7 -0
  11. package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +5 -0
  12. package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -0
  13. package/dist/bundlers/shared/generator-css/markers.d.ts +16 -0
  14. package/dist/bundlers/shared/generator-css/source-files.d.ts +11 -0
  15. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +10 -0
  16. package/dist/bundlers/shared/generator-css.d.ts +12 -22
  17. package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
  18. package/dist/bundlers/vite/generate-bundle/candidates.d.ts +2 -0
  19. package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +20 -0
  20. package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +3 -0
  21. package/dist/bundlers/vite/generate-bundle/dirty-state.d.ts +1 -0
  22. package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +2 -0
  23. package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +8 -0
  24. package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +13 -0
  25. package/dist/bundlers/vite/generate-bundle/metrics.d.ts +17 -0
  26. package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +9 -0
  27. package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +7 -0
  28. package/dist/bundlers/vite/generate-bundle/signatures.d.ts +8 -0
  29. package/dist/bundlers/vite/generate-bundle.d.ts +2 -1
  30. package/dist/bundlers/vite/index.d.ts +1 -1
  31. package/dist/bundlers/vite/official-tailwind-plugins.d.ts +5 -0
  32. package/dist/bundlers/vite/postcss-config.d.ts +6 -0
  33. package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
  34. package/dist/bundlers/vite/runtime-class-set.d.ts +22 -0
  35. package/dist/bundlers/vite/tailwind-basedir.d.ts +1 -0
  36. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +1 -0
  37. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +1 -1
  38. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +0 -1
  39. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +1 -1
  40. package/dist/cache-DPN5yKSX.js +497 -0
  41. package/dist/cache-nq0_XJoS.mjs +429 -0
  42. package/dist/cli/context.d.ts +0 -3
  43. package/dist/cli/helpers.d.ts +1 -2
  44. package/dist/cli/mount-options.d.ts +2 -0
  45. package/dist/cli/types.d.ts +0 -2
  46. package/dist/cli.js +108 -598
  47. package/dist/cli.mjs +119 -608
  48. package/dist/constants.d.ts +1 -2
  49. package/dist/context/tailwindcss.d.ts +1 -1
  50. package/dist/core.js +13 -20
  51. package/dist/core.mjs +8 -14
  52. package/dist/css-macro/postcss.js +1 -1
  53. package/dist/css-macro/postcss.mjs +1 -1
  54. package/dist/css-macro.d.ts +1 -0
  55. package/dist/css-macro.js +2 -2
  56. package/dist/css-macro.mjs +2 -2
  57. package/dist/defaults.d.ts +15 -1
  58. package/dist/defaults.js +33 -14
  59. package/dist/defaults.mjs +30 -15
  60. package/dist/generator/index.d.ts +1 -1
  61. package/dist/generator/options.d.ts +3 -4
  62. package/dist/{generator-Y-Ikv4Fu.mjs → generator-CzfdCZyd.mjs} +277 -23
  63. package/dist/{generator-mmhXzZnv.js → generator-TOp4uz7c.js} +281 -27
  64. package/dist/{generator-css-Bwy_Uz89.mjs → generator-css-B938WI9a.mjs} +694 -506
  65. package/dist/{generator-css-CRLrHW4F.js → generator-css-Dnpl-IY2.js} +699 -505
  66. package/dist/generator.js +1 -1
  67. package/dist/generator.mjs +1 -1
  68. package/dist/gulp.js +29 -28
  69. package/dist/gulp.mjs +25 -24
  70. package/dist/index.d.ts +1 -1
  71. package/dist/index.js +6 -6
  72. package/dist/index.mjs +5 -5
  73. package/dist/js/index.d.ts +1 -0
  74. package/dist/js/literal-transform.d.ts +2 -0
  75. package/dist/logger-BRy6XPQ2.js +1 -0
  76. package/dist/logger-Bub1jggA.mjs +2 -0
  77. package/dist/postcss/config-directive.d.ts +1 -0
  78. package/dist/postcss/context.d.ts +9 -0
  79. package/dist/postcss/source-files.d.ts +8 -0
  80. package/dist/postcss/tailwind-version.d.ts +3 -0
  81. package/dist/postcss-BtAP6sQO.mjs +288 -0
  82. package/dist/postcss-WsXlC7A-.js +298 -0
  83. package/dist/postcss.d.ts +2 -2
  84. package/dist/postcss.js +3 -276
  85. package/dist/postcss.mjs +1 -269
  86. package/dist/{recorder-GdTJ3QqX.js → precheck-Dka94ArV.js} +141 -283
  87. package/dist/{recorder-XdFvVASS.mjs → precheck-DlrmwCc-.mjs} +106 -247
  88. package/dist/presets.js +6 -4
  89. package/dist/presets.mjs +4 -2
  90. package/dist/reset.d.ts +1 -0
  91. package/dist/{css-imports-BbrbluP9.js → run-tasks-B50A3pxt.js} +6 -55
  92. package/dist/{css-imports-CSdPq_Sc.mjs → run-tasks-DdNi-hkk.mjs} +5 -42
  93. package/dist/runtime-patch-pGdCqAEu.mjs +71 -0
  94. package/dist/runtime-patch-qwuisukL.js +85 -0
  95. package/dist/tailwindcss/miniprogram.d.ts +5 -1
  96. package/dist/tailwindcss/patcher-options.d.ts +3 -51
  97. package/dist/tailwindcss/patcher.d.ts +1 -2
  98. package/dist/tailwindcss/runtime-patch.d.ts +5 -0
  99. package/dist/tailwindcss/runtime.d.ts +2 -3
  100. package/dist/tailwindcss/targets.d.ts +1 -5
  101. package/dist/tailwindcss/v4/patcher-options.d.ts +1 -23
  102. package/dist/tailwindcss/v4/patcher.d.ts +2 -1
  103. package/dist/tailwindcss/v4-engine/types.d.ts +1 -1
  104. package/dist/tailwindcss/version.d.ts +4 -0
  105. package/dist/{logger-BoVx1Dbt.mjs → tailwindcss-BIJ185GB.mjs} +25 -434
  106. package/dist/{logger-BZ45DZJT.js → tailwindcss-T1U5T-iF.js} +30 -468
  107. package/dist/typedoc.export.d.ts +0 -2
  108. package/dist/types/index.d.ts +2 -9
  109. package/dist/types/shared.d.ts +3 -0
  110. package/dist/types/user-defined-options/general.d.ts +0 -2
  111. package/dist/types/user-defined-options/important.d.ts +3 -3
  112. package/dist/uni-app-x/vite.d.ts +1 -1
  113. package/dist/utils/disabled.d.ts +2 -3
  114. package/dist/{vite-BDywuCjn.mjs → vite-BXChkciE.mjs} +669 -481
  115. package/dist/{vite-DgRh_GXn.js → vite-D0CoRblu.js} +707 -519
  116. package/dist/vite.d.ts +1 -2
  117. package/dist/vite.js +3 -4
  118. package/dist/vite.mjs +2 -2
  119. package/dist/weapp-tw-css-import-rewrite-loader.js +1 -1
  120. package/dist/{webpack-CiHqVZTg.mjs → webpack-BNdGm9KL.mjs} +224 -38
  121. package/dist/{webpack-CAJR4hhP.js → webpack-D-sUCY0u.js} +250 -69
  122. package/dist/webpack.js +1 -1
  123. package/dist/webpack.mjs +1 -1
  124. package/package.json +23 -35
  125. package/dist/bundlers/shared/generator-candidates.d.ts +0 -5
  126. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +0 -14
  127. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +0 -15
  128. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -9
  129. package/dist/bundlers/webpack/shared/css-imports.d.ts +0 -6
  130. package/dist/cli/config.d.ts +0 -5
  131. package/dist/cli/helpers/patch-cwd.d.ts +0 -1
  132. package/dist/cli/mount-options/patch-status.d.ts +0 -2
  133. package/dist/cli/patch-options.d.ts +0 -6
  134. package/dist/cli/tokens.d.ts +0 -4
  135. package/dist/cli/workspace/package-dirs.d.ts +0 -3
  136. package/dist/cli/workspace/patch-package.d.ts +0 -3
  137. package/dist/cli/workspace/patch-utils.d.ts +0 -3
  138. package/dist/cli/workspace/types.d.ts +0 -11
  139. package/dist/cli/workspace/workspace-globs.d.ts +0 -2
  140. package/dist/cli/workspace/workspace-io.d.ts +0 -1
  141. package/dist/cli/workspace/workspace-lock.d.ts +0 -1
  142. package/dist/cli/workspace.d.ts +0 -2
  143. package/dist/experimental/index.d.ts +0 -2
  144. package/dist/experimental/oxc/ast-utils.d.ts +0 -30
  145. package/dist/experimental/oxc/index.d.ts +0 -2
  146. package/dist/experimental/oxc/module-specifiers.d.ts +0 -2
  147. package/dist/experimental/shared/cache.d.ts +0 -3
  148. package/dist/experimental/shared/transform.d.ts +0 -3
  149. package/dist/experimental/shared.d.ts +0 -8
  150. package/dist/experimental/swc/ast-utils.d.ts +0 -30
  151. package/dist/experimental/swc/index.d.ts +0 -2
  152. package/dist/experimental/swc/module-specifiers.d.ts +0 -2
  153. package/dist/js/syntax.d.ts +0 -10
  154. package/dist/loader-anchors-1MumTAtA.mjs +0 -205
  155. package/dist/loader-anchors-TrFvT6g1.js +0 -273
  156. package/dist/patcher-options-6gJN2EXy.js +0 -115
  157. package/dist/patcher-options-DQfR5xxT.mjs +0 -92
  158. package/dist/tailwindcss/recorder.d.ts +0 -13
  159. package/dist/tailwindcss/targets/paths.d.ts +0 -13
  160. package/dist/tailwindcss/targets/record-io.d.ts +0 -5
  161. package/dist/tailwindcss/targets/recorder.d.ts +0 -3
  162. package/dist/tailwindcss/targets/types.d.ts +0 -35
  163. package/dist/types/disabled-options.d.ts +0 -4
  164. package/dist/webpack4.d.ts +0 -4
  165. package/dist/webpack4.js +0 -387
  166. package/dist/webpack4.mjs +0 -379
  167. package/scripts/postinstall.mjs +0 -59
  168. /package/dist/{constants-p1dyh1x1.js → constants-BoB_6lFw.js} +0 -0
  169. /package/dist/{constants-B-_T5UnW.mjs → constants-E_loJC49.mjs} +0 -0
  170. /package/dist/{utils-7DUGTFED.mjs → utils-BJjKRQgf.mjs} +0 -0
  171. /package/dist/{utils-DmC9_In3.js → utils-VZvGusYs.js} +0 -0
@@ -45,19 +45,10 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
45
45
  }
46
46
  //#endregion
47
47
  //#region src/utils/disabled.ts
48
- function resolveDisabledOptions(disabled) {
49
- if (disabled === true) return {
50
- plugin: true,
51
- rewriteCssImports: false
52
- };
53
- if (disabled === false || disabled == null) return {
54
- plugin: false,
55
- rewriteCssImports: false
56
- };
57
- return {
58
- plugin: disabled.plugin ?? false,
59
- rewriteCssImports: disabled.rewriteCssImports ?? false
60
- };
48
+ function resolvePluginDisabledState(disabled) {
49
+ if (disabled === true) return { plugin: true };
50
+ if (disabled === false || disabled == null) return { plugin: false };
51
+ return { plugin: disabled.plugin ?? false };
61
52
  }
62
53
  //#endregion
63
54
  //#region src/utils/resolve-package.ts
@@ -97,32 +88,4 @@ function pushConcurrentTaskFactories(queue, factories, limit) {
97
88
  queue.push(runWithConcurrency(factories, limit).then(() => void 0));
98
89
  }
99
90
  //#endregion
100
- //#region src/bundlers/shared/css-imports.ts
101
- const tailwindcssImportRE = /^tailwindcss(?:\/.*)?$/;
102
- const tailwindcssCssImportStatementRE = /(@import\s+(?:url\(\s*)?)(["'])(tailwindcss(?:\/[^"']*)?\$?)(\2\s*\)?)/gi;
103
- function normalizeTailwindcssSpecifier(specifier) {
104
- if (specifier === "tailwindcss$") return "tailwindcss";
105
- return specifier;
106
- }
107
- function getTailwindcssSubpath(specifier) {
108
- if (specifier === "tailwindcss") return "index.css";
109
- return specifier.slice(12);
110
- }
111
- function resolveTailwindcssImport(specifier, pkgDir, options) {
112
- const normalized = normalizeTailwindcssSpecifier(specifier);
113
- if (!tailwindcssImportRE.test(normalized)) return null;
114
- if (normalized === "tailwindcss") return options?.rootImport ?? "weapp-tailwindcss/index.css";
115
- return (options?.join ?? path.join)(pkgDir, getTailwindcssSubpath(normalized));
116
- }
117
- function rewriteTailwindcssImportsInCode(code, pkgDir, options) {
118
- let hasReplacements = false;
119
- const rewritten = code.replace(tailwindcssCssImportStatementRE, (full, prefix, quote, specifier, suffix) => {
120
- const replacement = resolveTailwindcssImport(specifier, pkgDir, options);
121
- if (!replacement) return full;
122
- hasReplacements = true;
123
- return `${prefix}${quote}${replacement}${suffix}`;
124
- });
125
- return hasReplacements ? rewritten : void 0;
126
- }
127
- //#endregion
128
- export { resolveDisabledOptions as a, toAbsoluteOutputPath as c, resolvePackageDir as i, rewriteTailwindcssImportsInCode as n, normalizeOutputPathKey as o, pushConcurrentTaskFactories as r, resolveOutputSpecifier as s, resolveTailwindcssImport as t };
91
+ export { resolveOutputSpecifier as a, normalizeOutputPathKey as i, resolvePackageDir as n, toAbsoluteOutputPath as o, resolvePluginDisabledState as r, pushConcurrentTaskFactories as t };
@@ -0,0 +1,71 @@
1
+ import { i as runtimeSignaturePatchersSymbol } from "./cache-nq0_XJoS.mjs";
2
+ import { createRequire } from "node:module";
3
+ import path from "node:path";
4
+ import _createDebug from "debug";
5
+ //#region src/debug/index.ts
6
+ const _debug = _createDebug("weapp-tw");
7
+ function createDebug(prefix) {
8
+ const debug = ((formatter, ...args) => {
9
+ return _debug((prefix ?? "") + formatter, ...args);
10
+ });
11
+ Object.defineProperty(debug, "enabled", {
12
+ enumerable: false,
13
+ configurable: false,
14
+ get() {
15
+ return _debug.enabled;
16
+ }
17
+ });
18
+ return debug;
19
+ }
20
+ //#endregion
21
+ //#region src/tailwindcss/runtime-patch.ts
22
+ const debug = createDebug("[tailwindcss:runtime-patch] ");
23
+ const require = createRequire(import.meta.url);
24
+ const runtimePatchPromiseCache = /* @__PURE__ */ new WeakMap();
25
+ function getNestedPatchers(twPatcher) {
26
+ const nested = twPatcher[runtimeSignaturePatchersSymbol];
27
+ return Array.isArray(nested) && nested.length > 0 ? nested : void 0;
28
+ }
29
+ function shouldApplyRuntimePatch(twPatcher) {
30
+ return twPatcher.majorVersion === 3 && typeof twPatcher.patch === "function";
31
+ }
32
+ function clearTailwindcssRequireCache(twPatcher) {
33
+ const rootPath = twPatcher.packageInfo?.rootPath;
34
+ if (!rootPath) return;
35
+ const normalizedRoot = path.resolve(rootPath);
36
+ let count = 0;
37
+ for (const id of Object.keys(require.cache)) {
38
+ const normalizedId = path.resolve(id);
39
+ if (normalizedId === normalizedRoot || normalizedId.startsWith(`${normalizedRoot}${path.sep}`)) {
40
+ delete require.cache[id];
41
+ count += 1;
42
+ }
43
+ }
44
+ if (count > 0) debug("clear tailwindcss require cache after runtime patch, count=%d root=%s", count, normalizedRoot);
45
+ }
46
+ async function ensureTailwindcssRuntimePatch(twPatcher, options = {}) {
47
+ const nestedPatchers = getNestedPatchers(twPatcher);
48
+ if (nestedPatchers) {
49
+ await Promise.all(nestedPatchers.map((patcher) => ensureTailwindcssRuntimePatch(patcher)));
50
+ return;
51
+ }
52
+ if (!shouldApplyRuntimePatch(twPatcher)) return;
53
+ const cached = runtimePatchPromiseCache.get(twPatcher);
54
+ if (cached) {
55
+ await cached;
56
+ if (options.clearRequireCache) clearTailwindcssRequireCache(twPatcher);
57
+ return;
58
+ }
59
+ const task = Promise.resolve().then(async () => {
60
+ debug("apply tailwindcss runtime patch, package=%s version=%s root=%s", twPatcher.packageInfo?.name ?? "tailwindcss", twPatcher.packageInfo?.version ?? "unknown", twPatcher.packageInfo?.rootPath ?? "unknown");
61
+ await twPatcher.patch?.();
62
+ if (options.clearRequireCache) clearTailwindcssRequireCache(twPatcher);
63
+ }).catch((error) => {
64
+ runtimePatchPromiseCache.delete(twPatcher);
65
+ throw error;
66
+ });
67
+ runtimePatchPromiseCache.set(twPatcher, task);
68
+ return task;
69
+ }
70
+ //#endregion
71
+ export { createDebug as n, ensureTailwindcssRuntimePatch as t };
@@ -0,0 +1,85 @@
1
+ const require_chunk = require("./chunk-8l464Juk.js");
2
+ const require_cache = require("./cache-DPN5yKSX.js");
3
+ let node_module = require("node:module");
4
+ let node_path = require("node:path");
5
+ node_path = require_chunk.__toESM(node_path);
6
+ let debug = require("debug");
7
+ debug = require_chunk.__toESM(debug);
8
+ //#region src/debug/index.ts
9
+ const _debug = (0, debug.default)("weapp-tw");
10
+ function createDebug(prefix) {
11
+ const debug$2 = ((formatter, ...args) => {
12
+ return _debug((prefix ?? "") + formatter, ...args);
13
+ });
14
+ Object.defineProperty(debug$2, "enabled", {
15
+ enumerable: false,
16
+ configurable: false,
17
+ get() {
18
+ return _debug.enabled;
19
+ }
20
+ });
21
+ return debug$2;
22
+ }
23
+ //#endregion
24
+ //#region src/tailwindcss/runtime-patch.ts
25
+ const debug$1 = createDebug("[tailwindcss:runtime-patch] ");
26
+ const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
27
+ const runtimePatchPromiseCache = /* @__PURE__ */ new WeakMap();
28
+ function getNestedPatchers(twPatcher) {
29
+ const nested = twPatcher[require_cache.runtimeSignaturePatchersSymbol];
30
+ return Array.isArray(nested) && nested.length > 0 ? nested : void 0;
31
+ }
32
+ function shouldApplyRuntimePatch(twPatcher) {
33
+ return twPatcher.majorVersion === 3 && typeof twPatcher.patch === "function";
34
+ }
35
+ function clearTailwindcssRequireCache(twPatcher) {
36
+ const rootPath = twPatcher.packageInfo?.rootPath;
37
+ if (!rootPath) return;
38
+ const normalizedRoot = node_path.default.resolve(rootPath);
39
+ let count = 0;
40
+ for (const id of Object.keys(require$1.cache)) {
41
+ const normalizedId = node_path.default.resolve(id);
42
+ if (normalizedId === normalizedRoot || normalizedId.startsWith(`${normalizedRoot}${node_path.default.sep}`)) {
43
+ delete require$1.cache[id];
44
+ count += 1;
45
+ }
46
+ }
47
+ if (count > 0) debug$1("clear tailwindcss require cache after runtime patch, count=%d root=%s", count, normalizedRoot);
48
+ }
49
+ async function ensureTailwindcssRuntimePatch(twPatcher, options = {}) {
50
+ const nestedPatchers = getNestedPatchers(twPatcher);
51
+ if (nestedPatchers) {
52
+ await Promise.all(nestedPatchers.map((patcher) => ensureTailwindcssRuntimePatch(patcher)));
53
+ return;
54
+ }
55
+ if (!shouldApplyRuntimePatch(twPatcher)) return;
56
+ const cached = runtimePatchPromiseCache.get(twPatcher);
57
+ if (cached) {
58
+ await cached;
59
+ if (options.clearRequireCache) clearTailwindcssRequireCache(twPatcher);
60
+ return;
61
+ }
62
+ const task = Promise.resolve().then(async () => {
63
+ debug$1("apply tailwindcss runtime patch, package=%s version=%s root=%s", twPatcher.packageInfo?.name ?? "tailwindcss", twPatcher.packageInfo?.version ?? "unknown", twPatcher.packageInfo?.rootPath ?? "unknown");
64
+ await twPatcher.patch?.();
65
+ if (options.clearRequireCache) clearTailwindcssRequireCache(twPatcher);
66
+ }).catch((error) => {
67
+ runtimePatchPromiseCache.delete(twPatcher);
68
+ throw error;
69
+ });
70
+ runtimePatchPromiseCache.set(twPatcher, task);
71
+ return task;
72
+ }
73
+ //#endregion
74
+ Object.defineProperty(exports, "createDebug", {
75
+ enumerable: true,
76
+ get: function() {
77
+ return createDebug;
78
+ }
79
+ });
80
+ Object.defineProperty(exports, "ensureTailwindcssRuntimePatch", {
81
+ enumerable: true,
82
+ get: function() {
83
+ return ensureTailwindcssRuntimePatch;
84
+ }
85
+ });
@@ -1 +1,5 @@
1
- export declare function pruneMiniProgramGeneratedCss(css: string): string;
1
+ interface PruneMiniProgramGeneratedCssOptions {
2
+ preservePreflight?: boolean;
3
+ }
4
+ export declare function pruneMiniProgramGeneratedCss(css: string, options?: PruneMiniProgramGeneratedCssOptions): string;
5
+ export {};
@@ -1,56 +1,8 @@
1
- import type { PackageResolvingOptions } from 'local-pkg';
2
- import type { ILengthUnitsPatchOptions, NormalizedTailwindCssPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
1
+ import type { ILengthUnitsPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
3
2
  type TailwindUserOptions = NonNullable<TailwindCssPatchOptions['tailwindcss']>;
4
- type ResolvedTailwindUserOptions = TailwindUserOptions | NormalizedTailwindCssPatchOptions['tailwind'];
5
3
  type TailwindApplyOptions = NonNullable<TailwindCssPatchOptions['apply']>;
6
- type TailwindExtractOptions = NonNullable<TailwindCssPatchOptions['extract']>;
7
4
  type TailwindExtendLengthUnitsOption = TailwindApplyOptions['extendLengthUnits'];
8
- export interface LegacyTailwindcssPatcherOptions {
9
- cache?: boolean | {
10
- enabled?: boolean;
11
- cwd?: string;
12
- dir?: string;
13
- file?: string;
14
- strategy?: 'merge' | 'overwrite';
15
- };
16
- patch?: {
17
- overwrite?: boolean;
18
- basedir?: string;
19
- cwd?: string;
20
- filter?: (className: string) => boolean;
21
- resolve?: PackageResolvingOptions;
22
- tailwindcss?: TailwindUserOptions;
23
- applyPatches?: {
24
- exportContext?: boolean;
25
- extendLengthUnits?: boolean | ILengthUnitsPatchOptions;
26
- };
27
- output?: {
28
- filename?: string;
29
- loose?: boolean;
30
- removeUniversalSelector?: boolean;
31
- };
32
- };
33
- }
34
- export interface LegacyTailwindcssOutputOptions {
35
- enabled?: boolean;
36
- file?: string;
37
- format?: TailwindExtractOptions['format'];
38
- pretty?: TailwindExtractOptions['pretty'];
39
- removeUniversalSelector?: boolean;
40
- }
41
- export interface LegacyTailwindcssFeatureOptions {
42
- exposeContext?: TailwindApplyOptions['exposeContext'];
43
- extendLengthUnits?: boolean | ILengthUnitsPatchOptions | TailwindExtendLengthUnitsOption;
44
- }
45
- export type CompatTailwindCssPatchOptions = TailwindCssPatchOptions & {
46
- cwd?: string;
47
- overwrite?: boolean;
48
- features?: LegacyTailwindcssFeatureOptions;
49
- output?: LegacyTailwindcssOutputOptions;
50
- tailwind?: ResolvedTailwindUserOptions;
51
- };
52
- export declare function resolveTailwindcssOptions(options?: CompatTailwindCssPatchOptions | LegacyTailwindcssPatcherOptions): ResolvedTailwindUserOptions | undefined;
5
+ export declare function resolveTailwindcssOptions(options?: TailwindCssPatchOptions): TailwindUserOptions | undefined;
53
6
  export declare function normalizeExtendLengthUnits(value: boolean | ILengthUnitsPatchOptions | undefined): TailwindExtendLengthUnitsOption | undefined;
54
- export declare function normalizeTailwindcssPatcherOptions(options?: CompatTailwindCssPatchOptions | LegacyTailwindcssPatcherOptions): TailwindCssPatchOptions | undefined;
55
- export declare function toModernTailwindcssPatchOptions(options?: CompatTailwindCssPatchOptions): TailwindCssPatchOptions | undefined;
7
+ export declare function normalizeTailwindcssPatcherOptions(options?: TailwindCssPatchOptions): TailwindCssPatchOptions | undefined;
56
8
  export {};
@@ -1,5 +1,4 @@
1
1
  import type { ILengthUnitsPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
2
- import type { LegacyTailwindcssPatcherOptions } from './patcher-options';
3
2
  import type { TailwindcssPatcherLike } from '../types';
4
3
  type TailwindUserOptions = NonNullable<TailwindCssPatchOptions['tailwindcss']>;
5
4
  export interface CreateTailwindcssPatcherOptions {
@@ -7,7 +6,7 @@ export interface CreateTailwindcssPatcherOptions {
7
6
  cacheDir?: string;
8
7
  supportCustomLengthUnitsPatch?: boolean | ILengthUnitsPatchOptions;
9
8
  tailwindcss?: TailwindUserOptions;
10
- tailwindcssPatcherOptions?: TailwindCssPatchOptions | LegacyTailwindcssPatcherOptions;
9
+ tailwindcssPatcherOptions?: TailwindCssPatchOptions;
11
10
  }
12
11
  export declare function createTailwindcssPatcher(options?: CreateTailwindcssPatcherOptions): TailwindcssPatcherLike;
13
12
  export {};
@@ -0,0 +1,5 @@
1
+ import type { TailwindcssPatcherLike } from '../types';
2
+ export interface EnsureTailwindcssRuntimePatchOptions {
3
+ clearRequireCache?: boolean;
4
+ }
5
+ export declare function ensureTailwindcssRuntimePatch(twPatcher: TailwindcssPatcherLike, options?: EnsureTailwindcssRuntimePatchOptions): Promise<void>;
@@ -10,12 +10,11 @@ export interface RefreshTailwindRuntimeStateOptions {
10
10
  force: boolean;
11
11
  clearCache?: boolean;
12
12
  }
13
- export declare function createTailwindPatchPromise(twPatcher: TailwindcssPatcherLike, onPatched?: () => Promise<void> | void): Promise<void>;
13
+ export declare function createTailwindRuntimeReadyPromise(twPatcher: TailwindcssPatcherLike): Promise<void>;
14
14
  export interface TailwindRuntimeState {
15
15
  twPatcher: TailwindcssPatcherLike;
16
- patchPromise: Promise<void>;
16
+ readyPromise: Promise<void>;
17
17
  refreshTailwindcssPatcher?: (options?: RefreshTailwindcssPatcherOptions) => Promise<TailwindcssPatcherLike>;
18
- onPatchCompleted?: () => Promise<void> | void;
19
18
  }
20
19
  export declare function refreshTailwindRuntimeState(state: TailwindRuntimeState, forceOrOptions: boolean | RefreshTailwindRuntimeStateOptions): Promise<boolean>;
21
20
  export interface EnsureRuntimeClassSetOptions {
@@ -1,6 +1,2 @@
1
1
  import type { TailwindcssPatcherLike } from '../types';
2
- import { __resetPatchTargetRecordWarningsForTests, saveCliPatchTargetRecord } from './targets/record-io';
3
- import { createPatchTargetRecorder } from './targets/recorder';
4
- export type { PatchTargetRecorder, PatchTargetRecorderOptions, SavePatchTargetRecordOptions } from './targets/types';
5
- export declare function logTailwindcssTarget(kind: 'cli' | 'runtime', patcher: TailwindcssPatcherLike | undefined, baseDir?: string): void;
6
- export { __resetPatchTargetRecordWarningsForTests, createPatchTargetRecorder, saveCliPatchTargetRecord, };
2
+ export declare function logTailwindcssTarget(patcher: TailwindcssPatcherLike | undefined, baseDir?: string): void;
@@ -1,24 +1,2 @@
1
1
  import type { TailwindCssPatchOptions } from 'tailwindcss-patch';
2
- type TailwindUserOptions = NonNullable<TailwindCssPatchOptions['tailwindcss']>;
3
- export interface LegacyTailwindcssPatcherOptionsLike {
4
- patch?: {
5
- basedir?: string;
6
- cwd?: string;
7
- tailwindcss?: TailwindUserOptions & {
8
- v4?: {
9
- base?: string;
10
- cssEntries?: string[];
11
- sources?: Array<{
12
- base?: string;
13
- pattern: string;
14
- negated?: boolean;
15
- }>;
16
- };
17
- };
18
- [key: string]: unknown;
19
- };
20
- [key: string]: unknown;
21
- }
22
- type TailwindcssPatcherOptionsForBase = TailwindCssPatchOptions | LegacyTailwindcssPatcherOptionsLike | undefined;
23
- export declare function overrideTailwindcssPatcherOptionsForBase(options: TailwindcssPatcherOptionsForBase, baseDir: string, cssEntries: string[]): TailwindcssPatcherOptionsForBase;
24
- export {};
2
+ export declare function overrideTailwindcssPatcherOptionsForBase(options: TailwindCssPatchOptions | undefined, baseDir: string, cssEntries: string[]): TailwindCssPatchOptions | undefined;
@@ -9,6 +9,7 @@ export interface TailwindcssPatcherFactoryOptions {
9
9
  tailwindcssPatcherOptions?: CreateTailwindcssPatcherOptions['tailwindcssPatcherOptions'];
10
10
  supportCustomLengthUnitsPatch: InternalUserDefinedOptions['supportCustomLengthUnitsPatch'];
11
11
  appType: InternalUserDefinedOptions['appType'];
12
+ bareArbitraryValues?: InternalUserDefinedOptions['arbitraryValues']['bareArbitraryValues'];
12
13
  }
13
- export declare function createPatcherForBase(baseDir: string, cssEntries: string[] | undefined, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike;
14
+ export declare function createPatcherForBase(baseDir: string, cssEntries: string[] | undefined, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike | undefined;
14
15
  export declare function tryCreateMultiTailwindcssPatcher(groups: Map<string, string[]>, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike | undefined;
@@ -5,7 +5,7 @@ export interface TailwindV4GenerateOptions extends PatchTailwindV4GenerateOption
5
5
  target?: TailwindV4GenerateTarget;
6
6
  styleOptions?: Partial<IStyleHandlerOptions>;
7
7
  tailwindcssV3Compatibility?: boolean;
8
- scanSources?: boolean;
8
+ scanSources?: PatchTailwindV4GenerateOptions['scanSources'];
9
9
  }
10
10
  export interface TailwindV4GenerateResult extends Omit<PatchTailwindV4GenerateResult, 'css'> {
11
11
  css: string;
@@ -0,0 +1,4 @@
1
+ export type SupportedTailwindcssMajorVersion = 3 | 4;
2
+ export declare const DEFAULT_TAILWINDCSS_GENERATOR_MAJOR_VERSION: SupportedTailwindcssMajorVersion;
3
+ export declare function normalizeSupportedTailwindcssMajorVersion(version: number | undefined): SupportedTailwindcssMajorVersion | undefined;
4
+ export declare function readInstalledPackageMajorVersion(packageName: string, base: string): SupportedTailwindcssMajorVersion | undefined;