weapp-tailwindcss 5.0.6 → 5.0.8

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 (103) hide show
  1. package/dist/{bundle-state-CdNXQl-o.mjs → bundle-state-5FtFktJr.mjs} +2 -1
  2. package/dist/{bundle-state-CFgzVHFP.js → bundle-state-cHwTyrOS.js} +2 -1
  3. package/dist/bundlers/gulp/index.d.ts +3 -4
  4. package/dist/bundlers/gulp/module-graph.d.ts +2 -0
  5. package/dist/bundlers/gulp/runtime-snapshot.d.ts +5 -0
  6. package/dist/bundlers/gulp/vinyl-transform.d.ts +3 -0
  7. package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
  8. package/dist/bundlers/shared/css-source-trace.d.ts +20 -0
  9. package/dist/bundlers/shared/generator-css/directives/fallback.d.ts +11 -0
  10. package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +56 -0
  11. package/dist/bundlers/shared/generator-css/local-imports.d.ts +7 -0
  12. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -1
  13. package/dist/bundlers/shared/generator-css/types.d.ts +27 -0
  14. package/dist/bundlers/shared/generator-css/user-css.d.ts +26 -0
  15. package/dist/bundlers/shared/generator-css/validate.d.ts +5 -0
  16. package/dist/bundlers/shared/generator-css.d.ts +4 -32
  17. package/dist/bundlers/vite/css-finalizer.d.ts +3 -0
  18. package/dist/bundlers/vite/generate-bundle/css-config-directives.d.ts +2 -0
  19. package/dist/bundlers/vite/generate-bundle/css-output.d.ts +14 -0
  20. package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +11 -0
  21. package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +9 -0
  22. package/dist/bundlers/vite/generate-bundle/style-matching.d.ts +5 -0
  23. package/dist/bundlers/vite/generate-bundle/subpackages.d.ts +7 -0
  24. package/dist/bundlers/vite/generate-bundle/types.d.ts +68 -0
  25. package/dist/bundlers/vite/generate-bundle.d.ts +4 -62
  26. package/dist/bundlers/vite/incremental-runtime-class-set/entries.d.ts +4 -0
  27. package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +2 -0
  28. package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +13 -0
  29. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +1 -0
  30. package/dist/bundlers/vite/processed-css-assets/css-rules.d.ts +17 -0
  31. package/dist/bundlers/vite/processed-css-assets.d.ts +2 -0
  32. package/dist/bundlers/vite/source-candidates/scan-root.d.ts +10 -0
  33. package/dist/bundlers/vite/source-candidates/script.d.ts +7 -0
  34. package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +1 -0
  35. package/dist/bundlers/vite/source-candidates.d.ts +8 -3
  36. package/dist/bundlers/vite/source-scan/css-entries.d.ts +20 -0
  37. package/dist/bundlers/vite/source-scan/dependencies.d.ts +2 -0
  38. package/dist/bundlers/vite/source-scan.d.ts +2 -12
  39. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -0
  40. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +1 -20
  41. package/dist/cli.js +71 -69
  42. package/dist/cli.mjs +71 -69
  43. package/dist/core.js +1 -1
  44. package/dist/core.mjs +1 -1
  45. package/dist/{defaults-BPUuNYcD.js → defaults-Boc26eel.js} +1 -0
  46. package/dist/{defaults-8xrgzxFY.mjs → defaults-DH0ZQRhy.mjs} +1 -0
  47. package/dist/defaults.js +1 -1
  48. package/dist/defaults.mjs +1 -1
  49. package/dist/{generator-C56PJYxA.js → generator-C--TrAod.js} +1 -1
  50. package/dist/{generator-Bgn4m8An.mjs → generator-DnwUQOXB.mjs} +1 -1
  51. package/dist/generator.js +2 -2
  52. package/dist/generator.mjs +2 -2
  53. package/dist/gulp-5Tan5bHG.js +473 -0
  54. package/dist/gulp-B22YSGU_.mjs +463 -0
  55. package/dist/gulp.js +4 -414
  56. package/dist/gulp.mjs +1 -406
  57. package/dist/{incremental-runtime-class-set-Bmzdjlk0.js → hmr-timing-CscCNKb9.js} +1205 -449
  58. package/dist/{incremental-runtime-class-set-BEYHQkZc.mjs → hmr-timing-DK-mine6.mjs} +1169 -467
  59. package/dist/index.js +5 -5
  60. package/dist/index.mjs +5 -5
  61. package/dist/{postcss-BgINK7Nm.mjs → postcss-CjWuDZwL.mjs} +4 -4
  62. package/dist/{postcss-B7QNe78h.js → postcss-R5pDVHUy.js} +7 -7
  63. package/dist/postcss.js +1 -1
  64. package/dist/postcss.mjs +1 -1
  65. package/dist/{precheck-CyPbGn38.js → precheck-B8y6tDvG.js} +19 -5
  66. package/dist/{precheck-Copn2SqE.mjs → precheck-CcxTR7E_.mjs} +19 -5
  67. package/dist/presets.js +2 -2
  68. package/dist/presets.mjs +2 -2
  69. package/dist/tailwindcss/source-scan/inline-source.d.ts +7 -0
  70. package/dist/tailwindcss/source-scan.d.ts +2 -7
  71. package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +3 -0
  72. package/dist/tailwindcss/v3-engine/generator/content.d.ts +10 -0
  73. package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +2 -0
  74. package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +2 -0
  75. package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +6 -0
  76. package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +2 -0
  77. package/dist/tailwindcss/v4-engine/types.d.ts +1 -1
  78. package/dist/{tailwindcss-C0Zgo3Es.mjs → tailwindcss-0DaftXcU.mjs} +2 -2
  79. package/dist/{tailwindcss-Tw6CSVHL.js → tailwindcss-DbZ4o4m_.js} +2 -2
  80. package/dist/{transform-DgCFGtQR.mjs → transform-DRyWUN5X.mjs} +11 -2
  81. package/dist/{transform-95ivJthq.js → transform-DiW_u3eD.js} +11 -2
  82. package/dist/types/typedoc-tailwindcss-patch.d.ts +4 -2
  83. package/dist/types/user-defined-options/general.d.ts +5 -0
  84. package/dist/uni-app-x/component-local-style.d.ts +1 -0
  85. package/dist/uni-app-x/harmony.d.ts +1 -0
  86. package/dist/uni-app-x/style-asset/style-value.d.ts +16 -0
  87. package/dist/uni-app-x/style-asset.d.ts +20 -0
  88. package/dist/uni-app-x/transform.d.ts +1 -0
  89. package/dist/uni-app-x/vite.d.ts +1 -0
  90. package/dist/{v3-engine-Ji6AXPh2.mjs → v3-engine-ArQVHEau.mjs} +786 -699
  91. package/dist/{v3-engine-6FVAcrZl.js → v3-engine-DdlvXpID.js} +788 -701
  92. package/dist/{vite-Bw6LOXvf.js → vite-C_IUnDBy.js} +1797 -386
  93. package/dist/{vite-ChZ2cbn4.mjs → vite-_iUhzc4t.mjs} +1779 -369
  94. package/dist/vite.js +1 -1
  95. package/dist/vite.mjs +1 -1
  96. package/dist/weapp-tw-css-import-rewrite-loader.js +1148 -987
  97. package/dist/{webpack-CMJ7iqN7.mjs → webpack-CqnI4Ymw.mjs} +104 -37
  98. package/dist/{webpack-nn3P8_S_.js → webpack-KLoTb5Dr.js} +113 -45
  99. package/dist/webpack.js +1 -1
  100. package/dist/webpack.mjs +1 -1
  101. package/package.json +6 -5
  102. package/dist/source-candidates-BODCmzz5.mjs +0 -355
  103. package/dist/source-candidates-Caf2GDvx.js +0 -374
@@ -1,5 +1,6 @@
1
1
  import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
2
2
  import type { IArbitraryValues } from '../../types/shared';
3
+ export { createTailwindV3DefaultExtractor } from './source-candidates/tailwind-v3-default-extractor';
3
4
  export interface SourceCandidateCollector {
4
5
  sync: (id: string, source: string) => Promise<void>;
5
6
  syncCss: (id: string, source: string) => Promise<void>;
@@ -9,8 +10,10 @@ export interface SourceCandidateCollector {
9
10
  scanRoot: (options: ScanSourceCandidateRootOptions) => Promise<void>;
10
11
  syncInline: (inlineCandidates: TailwindInlineSourceCandidates | undefined) => void;
11
12
  remove: (id: string) => void;
13
+ source: (id: string) => string | undefined;
12
14
  values: () => Set<string>;
13
- valuesForEntries: (entries: TailwindSourceEntry[] | undefined) => Set<string>;
15
+ valuesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>;
16
+ sourcesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>;
14
17
  snapshot: () => SourceCandidateCollectorSnapshot;
15
18
  restore: (snapshot: SourceCandidateCollectorSnapshot) => void;
16
19
  clear: () => void;
@@ -19,10 +22,14 @@ export interface SourceCandidateCollectorSnapshot {
19
22
  candidatesById: Array<[string, string[]]>;
20
23
  cssCandidatesById?: Array<[string, string[]]> | undefined;
21
24
  scanCandidatesById?: Array<[string, string[]]> | undefined;
25
+ sourceById?: Array<[string, string]> | undefined;
22
26
  transformCandidatesById?: Array<[string, string[]]> | undefined;
23
27
  inlineExcludedCandidates: string[];
24
28
  inlineIncludedCandidates: string[];
25
29
  }
30
+ export interface SourceCandidateFilterOptions {
31
+ excludeEntries?: TailwindSourceEntry[] | undefined;
32
+ }
26
33
  interface ScanSourceCandidateRootOptions {
27
34
  root: string;
28
35
  outDir?: string | undefined;
@@ -33,7 +40,5 @@ export interface SourceCandidateCollectorOptions {
33
40
  bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
34
41
  extractor?: ((source: string, extension: string) => Promise<Iterable<string>> | Iterable<string>) | undefined;
35
42
  }
36
- export declare function createTailwindV3DefaultExtractor(): ((source: string) => Set<string>) | undefined;
37
43
  export declare function isSourceCandidateRequest(id: string): boolean;
38
44
  export declare function createSourceCandidateCollector(options?: SourceCandidateCollectorOptions): SourceCandidateCollector;
39
- export {};
@@ -0,0 +1,20 @@
1
+ import type { TailwindV4CssSource } from 'tailwindcss-patch';
2
+ import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../../tailwindcss/source-scan';
3
+ import type { TailwindcssPatcherLike, UserDefinedOptions } from '../../../types';
4
+ export interface ResolvedTailwindV4CssEntries {
5
+ entries: TailwindSourceEntry[];
6
+ explicit: boolean;
7
+ inlineCandidates: TailwindInlineSourceCandidates;
8
+ dependencies: string[];
9
+ }
10
+ export declare function mergeTailwindInlineSourceCandidates(allInlineCandidates: Array<TailwindInlineSourceCandidates | undefined>): TailwindInlineSourceCandidates | undefined;
11
+ export declare function resolveTailwindV4EntriesFromCss(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
12
+ export declare function resolveViteTailwindV4CssDependencies(css: string, base: string): Promise<string[]>;
13
+ export declare function collectExistingCssEntries(options: UserDefinedOptions): string[];
14
+ export declare function resolveTailwindV3CssEntryScan(options: UserDefinedOptions, patcher: TailwindcssPatcherLike): Promise<{
15
+ entries: TailwindSourceEntry[];
16
+ dependencies: Set<string>;
17
+ }>;
18
+ export declare function resolveTailwindV4EntriesFromCssCached(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
19
+ export declare function discoverTailwindV4CssEntries(root: string, outDir: string | undefined): Promise<string[]>;
20
+ export declare function collectConfiguredCssSources(options: UserDefinedOptions): TailwindV4CssSource[];
@@ -0,0 +1,2 @@
1
+ export declare function addSourceScanDependency(dependencies: Set<string>, file: string | undefined): void;
2
+ export declare function addSourceScanDependencies(dependencies: Set<string>, files: string[] | undefined): void;
@@ -1,11 +1,7 @@
1
1
  import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
2
2
  import type { TailwindcssPatcherLike, UserDefinedOptions } from '../../types';
3
- export interface ResolvedTailwindV4CssEntries {
4
- entries: TailwindSourceEntry[];
5
- explicit: boolean;
6
- inlineCandidates: TailwindInlineSourceCandidates;
7
- dependencies: string[];
8
- }
3
+ export { discoverTailwindV4CssEntries, resolveTailwindV4EntriesFromCss, resolveTailwindV4EntriesFromCssCached, resolveViteTailwindV4CssDependencies, } from './source-scan/css-entries';
4
+ export type { ResolvedTailwindV4CssEntries } from './source-scan/css-entries';
9
5
  export interface ResolvedViteSourceScan {
10
6
  dependencies?: string[] | undefined;
11
7
  entries?: TailwindSourceEntry[] | undefined;
@@ -16,11 +12,5 @@ interface ResolveViteSourceScanOptions {
16
12
  root?: string | undefined;
17
13
  outDir?: string | undefined;
18
14
  }
19
- export declare function mergeTailwindInlineSourceCandidates(allInlineCandidates: Array<TailwindInlineSourceCandidates | undefined>): TailwindInlineSourceCandidates | undefined;
20
- export declare function resolveTailwindV4EntriesFromCss(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
21
- export declare function resolveViteTailwindV4CssDependencies(css: string, base: string): Promise<string[]>;
22
- export declare function resolveTailwindV4EntriesFromCssCached(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
23
- export declare function discoverTailwindV4CssEntries(root: string, outDir: string | undefined): Promise<string[]>;
24
15
  export declare function resolveViteSourceScanEntries(options: UserDefinedOptions, patcher: TailwindcssPatcherLike, scanOptions?: ResolveViteSourceScanOptions): Promise<ResolvedViteSourceScan | undefined>;
25
16
  export declare function createViteSourceScanMatcher(entries: TailwindSourceEntry[] | undefined): ((file: string) => boolean) | undefined;
26
- export {};
@@ -0,0 +1,48 @@
1
+ import type { Compiler, sources as WebpackSources } from 'webpack';
2
+ import type { BundleRuntimeClassSetManager } from '../../../vite/incremental-runtime-class-set';
3
+ import type { AppType, InternalUserDefinedOptions } from '../../../../types';
4
+ export interface SetupWebpackV5ProcessAssetsHookOptions {
5
+ compiler: Compiler;
6
+ options: InternalUserDefinedOptions;
7
+ appType?: AppType | undefined;
8
+ runtimeState: {
9
+ twPatcher: InternalUserDefinedOptions['twPatcher'];
10
+ readyPromise: Promise<void>;
11
+ };
12
+ getRuntimeRefreshRequirement: () => boolean;
13
+ refreshRuntimeMetadata: (force: boolean) => Promise<void>;
14
+ isWebpackProcessedCssAsset?: ((file: string, rawSource: string) => boolean) | undefined;
15
+ consumeRuntimeRefreshRequirement: () => void;
16
+ isWatchMode?: (() => boolean) | undefined;
17
+ runtimeClassSetManager?: BundleRuntimeClassSetManager | undefined;
18
+ debug: (format: string, ...args: unknown[]) => void;
19
+ }
20
+ export type WebpackSourceLike = string | WebpackSources.Source;
21
+ export declare function createWebpackSnapshotAssets(assets: Record<string, {
22
+ source: () => unknown;
23
+ }>): {
24
+ [k: string]: {
25
+ fileName: string;
26
+ source: string;
27
+ type: string;
28
+ };
29
+ };
30
+ export declare function stringifyWebpackSource(source: unknown): string;
31
+ export declare function createWebpackAssetUpdater(options: {
32
+ compilation: {
33
+ getAsset: (file: string) => {
34
+ source: {
35
+ source: () => unknown;
36
+ };
37
+ } | undefined;
38
+ updateAsset: (file: string, source: WebpackSourceLike) => void;
39
+ };
40
+ ConcatSource: new (source: string) => WebpackSources.Source;
41
+ onUpdate: (file: string, previousSource: string, nextSource: string) => void;
42
+ debug: (format: string, ...args: unknown[]) => void;
43
+ }): {
44
+ getCurrentAssetSource: (file: string) => string | undefined;
45
+ updateAssetIfChanged: (file: string, source: WebpackSourceLike, { notifyUpdate }?: {
46
+ notifyUpdate?: boolean;
47
+ }) => boolean;
48
+ };
@@ -1,21 +1,2 @@
1
- import type { Compiler } from 'webpack';
2
- import type { BundleRuntimeClassSetManager } from '../../vite/incremental-runtime-class-set';
3
- import type { AppType, InternalUserDefinedOptions } from '../../../types';
4
- interface SetupWebpackV5ProcessAssetsHookOptions {
5
- compiler: Compiler;
6
- options: InternalUserDefinedOptions;
7
- appType?: AppType | undefined;
8
- runtimeState: {
9
- twPatcher: InternalUserDefinedOptions['twPatcher'];
10
- readyPromise: Promise<void>;
11
- };
12
- getRuntimeRefreshRequirement: () => boolean;
13
- refreshRuntimeMetadata: (force: boolean) => Promise<void>;
14
- isWebpackProcessedCssAsset?: ((file: string, rawSource: string) => boolean) | undefined;
15
- consumeRuntimeRefreshRequirement: () => void;
16
- isWatchMode?: (() => boolean) | undefined;
17
- runtimeClassSetManager?: BundleRuntimeClassSetManager | undefined;
18
- debug: (format: string, ...args: unknown[]) => void;
19
- }
1
+ import type { SetupWebpackV5ProcessAssetsHookOptions } from './v5-assets/helpers';
20
2
  export declare function setupWebpackV5ProcessAssetsHook(options: SetupWebpackV5ProcessAssetsHookOptions): void;
21
- export {};
package/dist/cli.js CHANGED
@@ -25,6 +25,7 @@ node_process = __toESM(node_process);
25
25
  let semver = require("semver");
26
26
  semver = __toESM(semver);
27
27
  let tailwindcss_patch = require("tailwindcss-patch");
28
+ tailwindcss_patch = __toESM(tailwindcss_patch);
28
29
  let node_path = require("node:path");
29
30
  node_path = __toESM(node_path);
30
31
  let node_fs_promises = require("node:fs/promises");
@@ -41,8 +42,8 @@ require("postcss");
41
42
  require("micromatch");
42
43
  let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
43
44
  let node_module = require("node:module");
44
- require("fast-glob");
45
45
  require("tailwindcss-config");
46
+ require("fast-glob");
46
47
  let _babel_traverse = require("@babel/traverse");
47
48
  _babel_traverse = __toESM(_babel_traverse);
48
49
  let _babel_parser = require("@babel/parser");
@@ -227,68 +228,6 @@ const creator = () => {
227
228
  };
228
229
  creator.postcss = true;
229
230
  //#endregion
230
- //#region src/tailwindcss/source-scan.ts
231
- const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
232
- "html",
233
- "wxml",
234
- "axml",
235
- "jxml",
236
- "ksml",
237
- "ttml",
238
- "qml",
239
- "tyml",
240
- "xhsml",
241
- "swan",
242
- "vue",
243
- "mpx",
244
- "js",
245
- "jsx",
246
- "ts",
247
- "tsx"
248
- ];
249
- const FULL_SOURCE_SCAN_EXTENSIONS = [
250
- "js",
251
- "jsx",
252
- "mjs",
253
- "cjs",
254
- "ts",
255
- "tsx",
256
- "mts",
257
- "cts",
258
- "vue",
259
- "uvue",
260
- "nvue",
261
- "svelte",
262
- "mpx",
263
- "html",
264
- "wxml",
265
- "axml",
266
- "jxml",
267
- "ksml",
268
- "ttml",
269
- "qml",
270
- "tyml",
271
- "xhsml",
272
- "swan",
273
- "css",
274
- "wxss",
275
- "acss",
276
- "jxss",
277
- "ttss",
278
- "qss",
279
- "tyss",
280
- "scss",
281
- "sass",
282
- "less",
283
- "styl",
284
- "stylus"
285
- ];
286
- function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
287
- return `**/*.{${extensions.join(",")}}`;
288
- }
289
- createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
290
- new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
291
- //#endregion
292
231
  //#region src/utils/object.ts
293
232
  function definedEntries(value) {
294
233
  return Object.entries(value).filter(([, item]) => item !== void 0);
@@ -296,12 +235,6 @@ function definedEntries(value) {
296
235
  function omitUndefined(value) {
297
236
  return Object.fromEntries(definedEntries(value));
298
237
  }
299
- (0, _weapp_tailwindcss_postcss.createStyleHandler)({
300
- cssChildCombinatorReplaceValue: ["view", "text"],
301
- cssRemoveHoverPseudoClass: true,
302
- isMainChunk: true,
303
- majorVersion: 4
304
- });
305
238
  //#endregion
306
239
  //#region src/tailwindcss/v4-engine/tailwind-v3-default-colors.ts
307
240
  const TAILWIND_V3_COLOR_STEPS = [
@@ -664,6 +597,74 @@ function createTailwindV3DefaultColorThemeCss() {
664
597
  " margin: auto;",
665
598
  "}"
666
599
  ].join("\n");
600
+ //#endregion
601
+ //#region src/tailwindcss/source-scan.ts
602
+ const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
603
+ "html",
604
+ "wxml",
605
+ "axml",
606
+ "jxml",
607
+ "ksml",
608
+ "ttml",
609
+ "qml",
610
+ "tyml",
611
+ "xhsml",
612
+ "swan",
613
+ "vue",
614
+ "mpx",
615
+ "js",
616
+ "jsx",
617
+ "ts",
618
+ "tsx"
619
+ ];
620
+ const FULL_SOURCE_SCAN_EXTENSIONS = [
621
+ "js",
622
+ "jsx",
623
+ "mjs",
624
+ "cjs",
625
+ "ts",
626
+ "tsx",
627
+ "mts",
628
+ "cts",
629
+ "vue",
630
+ "uvue",
631
+ "nvue",
632
+ "svelte",
633
+ "mpx",
634
+ "html",
635
+ "wxml",
636
+ "axml",
637
+ "jxml",
638
+ "ksml",
639
+ "ttml",
640
+ "qml",
641
+ "tyml",
642
+ "xhsml",
643
+ "swan",
644
+ "css",
645
+ "wxss",
646
+ "acss",
647
+ "jxss",
648
+ "ttss",
649
+ "qss",
650
+ "tyss",
651
+ "scss",
652
+ "sass",
653
+ "less",
654
+ "styl",
655
+ "stylus"
656
+ ];
657
+ function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
658
+ return `**/*.{${extensions.join(",")}}`;
659
+ }
660
+ createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
661
+ new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
662
+ (0, _weapp_tailwindcss_postcss.createStyleHandler)({
663
+ cssChildCombinatorReplaceValue: ["view", "text"],
664
+ cssRemoveHoverPseudoClass: true,
665
+ isMainChunk: true,
666
+ majorVersion: 4
667
+ });
667
668
  (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
668
669
  (0, _weapp_tailwindcss_postcss.createStyleHandler)({
669
670
  cssChildCombinatorReplaceValue: ["view", "text"],
@@ -671,6 +672,7 @@ function createTailwindV3DefaultColorThemeCss() {
671
672
  isMainChunk: true,
672
673
  majorVersion: 3
673
674
  });
675
+ typeof tailwindcss_patch.generateTailwindV3RawStyle === "function" && tailwindcss_patch.generateTailwindV3RawStyle;
674
676
  [
675
677
  "@tailwind base;",
676
678
  "@tailwind components;",
package/dist/cli.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { createRequire } from "node:module";
2
2
  import process from "node:process";
3
3
  import semver from "semver";
4
+ import * as tailwindcssPatch from "tailwindcss-patch";
4
5
  import { createTailwindcssPatchCli, splitCandidateTokens } from "tailwindcss-patch";
5
6
  import path from "node:path";
6
7
  import { access, mkdir, writeFile } from "node:fs/promises";
@@ -14,8 +15,8 @@ import { constants, existsSync, readFileSync } from "node:fs";
14
15
  import "postcss";
15
16
  import "micromatch";
16
17
  import { createStyleHandler } from "@weapp-tailwindcss/postcss";
17
- import "fast-glob";
18
18
  import "tailwindcss-config";
19
+ import "fast-glob";
19
20
  import _babelTraverse from "@babel/traverse";
20
21
  import { parse } from "@babel/parser";
21
22
  import MagicString from "magic-string";
@@ -198,68 +199,6 @@ const creator = () => {
198
199
  };
199
200
  creator.postcss = true;
200
201
  //#endregion
201
- //#region src/tailwindcss/source-scan.ts
202
- const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
203
- "html",
204
- "wxml",
205
- "axml",
206
- "jxml",
207
- "ksml",
208
- "ttml",
209
- "qml",
210
- "tyml",
211
- "xhsml",
212
- "swan",
213
- "vue",
214
- "mpx",
215
- "js",
216
- "jsx",
217
- "ts",
218
- "tsx"
219
- ];
220
- const FULL_SOURCE_SCAN_EXTENSIONS = [
221
- "js",
222
- "jsx",
223
- "mjs",
224
- "cjs",
225
- "ts",
226
- "tsx",
227
- "mts",
228
- "cts",
229
- "vue",
230
- "uvue",
231
- "nvue",
232
- "svelte",
233
- "mpx",
234
- "html",
235
- "wxml",
236
- "axml",
237
- "jxml",
238
- "ksml",
239
- "ttml",
240
- "qml",
241
- "tyml",
242
- "xhsml",
243
- "swan",
244
- "css",
245
- "wxss",
246
- "acss",
247
- "jxss",
248
- "ttss",
249
- "qss",
250
- "tyss",
251
- "scss",
252
- "sass",
253
- "less",
254
- "styl",
255
- "stylus"
256
- ];
257
- function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
258
- return `**/*.{${extensions.join(",")}}`;
259
- }
260
- createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
261
- new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
262
- //#endregion
263
202
  //#region src/utils/object.ts
264
203
  function definedEntries(value) {
265
204
  return Object.entries(value).filter(([, item]) => item !== void 0);
@@ -267,12 +206,6 @@ function definedEntries(value) {
267
206
  function omitUndefined(value) {
268
207
  return Object.fromEntries(definedEntries(value));
269
208
  }
270
- createStyleHandler({
271
- cssChildCombinatorReplaceValue: ["view", "text"],
272
- cssRemoveHoverPseudoClass: true,
273
- isMainChunk: true,
274
- majorVersion: 4
275
- });
276
209
  //#endregion
277
210
  //#region src/tailwindcss/v4-engine/tailwind-v3-default-colors.ts
278
211
  const TAILWIND_V3_COLOR_STEPS = [
@@ -635,6 +568,74 @@ function createTailwindV3DefaultColorThemeCss() {
635
568
  " margin: auto;",
636
569
  "}"
637
570
  ].join("\n");
571
+ //#endregion
572
+ //#region src/tailwindcss/source-scan.ts
573
+ const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
574
+ "html",
575
+ "wxml",
576
+ "axml",
577
+ "jxml",
578
+ "ksml",
579
+ "ttml",
580
+ "qml",
581
+ "tyml",
582
+ "xhsml",
583
+ "swan",
584
+ "vue",
585
+ "mpx",
586
+ "js",
587
+ "jsx",
588
+ "ts",
589
+ "tsx"
590
+ ];
591
+ const FULL_SOURCE_SCAN_EXTENSIONS = [
592
+ "js",
593
+ "jsx",
594
+ "mjs",
595
+ "cjs",
596
+ "ts",
597
+ "tsx",
598
+ "mts",
599
+ "cts",
600
+ "vue",
601
+ "uvue",
602
+ "nvue",
603
+ "svelte",
604
+ "mpx",
605
+ "html",
606
+ "wxml",
607
+ "axml",
608
+ "jxml",
609
+ "ksml",
610
+ "ttml",
611
+ "qml",
612
+ "tyml",
613
+ "xhsml",
614
+ "swan",
615
+ "css",
616
+ "wxss",
617
+ "acss",
618
+ "jxss",
619
+ "ttss",
620
+ "qss",
621
+ "tyss",
622
+ "scss",
623
+ "sass",
624
+ "less",
625
+ "styl",
626
+ "stylus"
627
+ ];
628
+ function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
629
+ return `**/*.{${extensions.join(",")}}`;
630
+ }
631
+ createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
632
+ new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
633
+ createStyleHandler({
634
+ cssChildCombinatorReplaceValue: ["view", "text"],
635
+ cssRemoveHoverPseudoClass: true,
636
+ isMainChunk: true,
637
+ majorVersion: 4
638
+ });
638
639
  createRequire(import.meta.url);
639
640
  createStyleHandler({
640
641
  cssChildCombinatorReplaceValue: ["view", "text"],
@@ -642,6 +643,7 @@ createStyleHandler({
642
643
  isMainChunk: true,
643
644
  majorVersion: 3
644
645
  });
646
+ typeof tailwindcssPatch.generateTailwindV3RawStyle === "function" && tailwindcssPatch.generateTailwindV3RawStyle;
645
647
  [
646
648
  "@tailwind base;",
647
649
  "@tailwind components;",
package/dist/core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_precheck = require("./precheck-CyPbGn38.js");
2
+ const require_precheck = require("./precheck-B8y6tDvG.js");
3
3
  let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
4
4
  //#region src/core.ts
5
5
  const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
package/dist/core.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as getCompilerContext, t as shouldSkipJsTransform, v as createTailwindRuntimeReadyPromise, y as ensureRuntimeClassSet } from "./precheck-Copn2SqE.mjs";
1
+ import { n as getCompilerContext, t as shouldSkipJsTransform, v as createTailwindRuntimeReadyPromise, y as ensureRuntimeClassSet } from "./precheck-CcxTR7E_.mjs";
2
2
  import { defuOverrideArray } from "@weapp-tailwindcss/shared";
3
3
  //#region src/core.ts
4
4
  const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
@@ -142,6 +142,7 @@ function getDefaultOptions() {
142
142
  ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
143
143
  replaceRuntimePackages: false,
144
144
  generator: {},
145
+ cssSourceTrace: false,
145
146
  tailwindcssPatcherOptions: { filter(className) {
146
147
  return !(0, _weapp_core_escape.isAllowedClassName)(className);
147
148
  } },
@@ -141,6 +141,7 @@ function getDefaultOptions() {
141
141
  ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
142
142
  replaceRuntimePackages: false,
143
143
  generator: {},
144
+ cssSourceTrace: false,
144
145
  tailwindcssPatcherOptions: { filter(className) {
145
146
  return !isAllowedClassName(className);
146
147
  } },
package/dist/defaults.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_defaults = require("./defaults-BPUuNYcD.js");
2
+ const require_defaults = require("./defaults-Boc26eel.js");
3
3
  exports.TAILWIND_V3_CSS_PREFLIGHT = require_defaults.TAILWIND_V3_CSS_PREFLIGHT;
4
4
  exports.TAILWIND_V4_CSS_PREFLIGHT = require_defaults.TAILWIND_V4_CSS_PREFLIGHT;
5
5
  exports.getDefaultCssPreflight = require_defaults.getDefaultCssPreflight;
package/dist/defaults.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as resolveDefaultCssPreflight, i as getDefaultOptions, n as TAILWIND_V4_CSS_PREFLIGHT, r as getDefaultCssPreflight, t as TAILWIND_V3_CSS_PREFLIGHT } from "./defaults-8xrgzxFY.mjs";
1
+ import { a as resolveDefaultCssPreflight, i as getDefaultOptions, n as TAILWIND_V4_CSS_PREFLIGHT, r as getDefaultCssPreflight, t as TAILWIND_V3_CSS_PREFLIGHT } from "./defaults-DH0ZQRhy.mjs";
2
2
  export { TAILWIND_V3_CSS_PREFLIGHT, TAILWIND_V4_CSS_PREFLIGHT, getDefaultCssPreflight, getDefaultOptions, resolveDefaultCssPreflight };
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_v3_engine = require("./v3-engine-6FVAcrZl.js");
2
+ const require_v3_engine = require("./v3-engine-DdlvXpID.js");
3
3
  let node_process = require("node:process");
4
4
  node_process = require_chunk.__toESM(node_process);
5
5
  //#region src/generator/options.ts
@@ -1,4 +1,4 @@
1
- import { K as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-Ji6AXPh2.mjs";
1
+ import { K as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-ArQVHEau.mjs";
2
2
  import process from "node:process";
3
3
  //#region src/generator/options.ts
4
4
  const explicitGeneratorTargetEnvKeys = ["WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
package/dist/generator.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_v3_engine = require("./v3-engine-6FVAcrZl.js");
3
- const require_generator = require("./generator-C56PJYxA.js");
2
+ const require_v3_engine = require("./v3-engine-DdlvXpID.js");
3
+ const require_generator = require("./generator-C--TrAod.js");
4
4
  let tailwindcss_patch = require("tailwindcss-patch");
5
5
  exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
6
6
  exports.createWeappTailwindcssGeneratorFromPatcher = require_generator.createWeappTailwindcssGeneratorFromPatcher;
@@ -1,3 +1,3 @@
1
- import { J as transformTailwindV4CssToWeapp, S as resolveTailwindV4SourceOptionsFromPatcher, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, q as transformTailwindV4CssByTarget, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-Ji6AXPh2.mjs";
2
- import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-Bgn4m8An.mjs";
1
+ import { J as transformTailwindV4CssToWeapp, S as resolveTailwindV4SourceOptionsFromPatcher, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, q as transformTailwindV4CssByTarget, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-ArQVHEau.mjs";
2
+ import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-DnwUQOXB.mjs";
3
3
  export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromPatcher, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromPatcher, resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };