weapp-tailwindcss 5.0.0-next.9 → 5.0.1

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 (167) hide show
  1. package/README.md +2 -2
  2. package/dist/auto-DEHRmEAx.mjs +200 -0
  3. package/dist/auto-dPpsm6FB.js +238 -0
  4. package/dist/bundle-state-CBF5YX1m.js +529 -0
  5. package/dist/bundle-state-CQmxxx0R.mjs +413 -0
  6. package/dist/bundlers/shared/cache.d.ts +9 -7
  7. package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -2
  8. package/dist/bundlers/shared/css-cleanup.d.ts +1 -3
  9. package/dist/bundlers/shared/css-imports.d.ts +3 -3
  10. package/dist/bundlers/shared/generated-css-marker.d.ts +3 -0
  11. package/dist/bundlers/shared/generator-css/directives.d.ts +11 -3
  12. package/dist/bundlers/shared/generator-css/markers.d.ts +12 -0
  13. package/dist/bundlers/shared/generator-css/source-files.d.ts +9 -6
  14. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +16 -2
  15. package/dist/bundlers/shared/generator-css/user-layer-order.d.ts +10 -0
  16. package/dist/bundlers/shared/generator-css.d.ts +6 -2
  17. package/dist/bundlers/shared/hmr-timing.d.ts +22 -0
  18. package/dist/bundlers/shared/style-requests.d.ts +2 -0
  19. package/dist/bundlers/vite/bundle-state.d.ts +1 -0
  20. package/dist/bundlers/vite/css-finalizer.d.ts +6 -0
  21. package/dist/bundlers/vite/generate-bundle/candidates.d.ts +1 -1
  22. package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +5 -1
  23. package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +1 -0
  24. package/dist/bundlers/vite/generate-bundle.d.ts +13 -1
  25. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +10 -2
  26. package/dist/bundlers/vite/index.d.ts +5 -2
  27. package/dist/bundlers/vite/processed-css-assets.d.ts +32 -0
  28. package/dist/bundlers/vite/rewrite-css-imports.d.ts +8 -5
  29. package/dist/bundlers/vite/runtime-class-set.d.ts +5 -1
  30. package/dist/bundlers/vite/serve-css-generation.d.ts +11 -0
  31. package/dist/bundlers/vite/source-candidates.d.ts +24 -2
  32. package/dist/bundlers/vite/source-scan.d.ts +26 -0
  33. package/dist/bundlers/vite/static-config-content.d.ts +5 -0
  34. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +5 -0
  35. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +5 -1
  36. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +8 -3
  37. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
  38. package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +31 -0
  39. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +2 -8
  40. package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +3 -7
  41. package/dist/cache/index.d.ts +6 -6
  42. package/dist/{chunk-8l464Juk.js → chunk-C5U5_Hdc.js} +14 -0
  43. package/dist/cli/context.d.ts +1 -11
  44. package/dist/cli/doctor/types.d.ts +11 -11
  45. package/dist/cli/vscode-entry.d.ts +3 -3
  46. package/dist/cli.js +684 -41
  47. package/dist/cli.mjs +682 -40
  48. package/dist/context/runtime-package-replacements.d.ts +2 -0
  49. package/dist/context/style-options.d.ts +3 -0
  50. package/dist/context/tailwindcss.d.ts +1 -1
  51. package/dist/core.js +1 -2
  52. package/dist/core.mjs +1 -1
  53. package/dist/css-macro/auto.d.ts +11 -0
  54. package/dist/css-macro/constants.d.ts +5 -2
  55. package/dist/css-macro/postcss.d.ts +1 -0
  56. package/dist/css-macro/postcss.js +7 -46
  57. package/dist/css-macro/postcss.mjs +2 -46
  58. package/dist/css-macro.js +16 -7
  59. package/dist/css-macro.mjs +15 -6
  60. package/dist/defaults-8xrgzxFY.mjs +151 -0
  61. package/dist/defaults-zKUH2mDe.js +193 -0
  62. package/dist/defaults.js +6 -150
  63. package/dist/defaults.mjs +1 -143
  64. package/dist/escape.js +10 -2
  65. package/dist/escape.mjs +10 -2
  66. package/dist/generator/options.d.ts +11 -6
  67. package/dist/generator/types.d.ts +3 -3
  68. package/dist/generator-CvmsIQFI.js +92 -0
  69. package/dist/generator-DDtsUvkH.mjs +67 -0
  70. package/dist/generator.js +12 -12
  71. package/dist/generator.mjs +2 -1
  72. package/dist/gulp.js +163 -40
  73. package/dist/gulp.mjs +155 -32
  74. package/dist/incremental-runtime-class-set-BffodqHh.js +2366 -0
  75. package/dist/incremental-runtime-class-set-DArodvWs.mjs +2291 -0
  76. package/dist/index.d.ts +2 -1
  77. package/dist/index.js +17 -5
  78. package/dist/index.mjs +6 -5
  79. package/dist/js/babel/cache-options.d.ts +3 -0
  80. package/dist/js/babel/parse.d.ts +7 -4
  81. package/dist/js/precheck.d.ts +2 -2
  82. package/dist/js/replacement-cache.d.ts +5 -0
  83. package/dist/{postcss-w48mGIhe.mjs → postcss-BzNYQUOH.mjs} +54 -114
  84. package/dist/postcss-C7BMYpEF.mjs +169 -0
  85. package/dist/postcss-CiYLsqZn.js +192 -0
  86. package/dist/{postcss-QIXwT40c.js → postcss-DE0TOtV9.js} +60 -121
  87. package/dist/postcss-html-transform.js +1 -1
  88. package/dist/postcss.js +1 -1
  89. package/dist/postcss.mjs +1 -1
  90. package/dist/precheck-BzYPm-EG.js +4842 -0
  91. package/dist/precheck-jZvTVXXG.mjs +4716 -0
  92. package/dist/presets/index.d.ts +1 -0
  93. package/dist/presets/uni-app-x.d.ts +1 -0
  94. package/dist/presets.js +27 -13
  95. package/dist/presets.mjs +25 -13
  96. package/dist/reset.js +1 -1
  97. package/dist/runtime-registry-DpcR3IHI.js +5496 -0
  98. package/dist/shared/mpx.d.ts +1 -0
  99. package/dist/source-candidates-BuTlMabx.mjs +322 -0
  100. package/dist/source-candidates-CxoIaS88.js +335 -0
  101. package/dist/tailwindcss/miniprogram.d.ts +1 -5
  102. package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -2
  103. package/dist/tailwindcss/runtime/cache.d.ts +4 -3
  104. package/dist/tailwindcss/runtime.d.ts +9 -9
  105. package/dist/tailwindcss/source-scan.d.ts +35 -0
  106. package/dist/tailwindcss/v3-engine/types.d.ts +19 -14
  107. package/dist/tailwindcss/v4/css-entries.d.ts +2 -2
  108. package/dist/tailwindcss/v4/patcher.d.ts +1 -1
  109. package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
  110. package/dist/tailwindcss/v4-engine/types.d.ts +18 -5
  111. package/dist/{tailwindcss-C5IgPlQ0.mjs → tailwindcss-CCZcu0lr.mjs} +75 -98
  112. package/dist/{tailwindcss-Bu-RWIHx.js → tailwindcss-DZckITp1.js} +83 -106
  113. package/dist/typedoc.export.d.ts +1 -1
  114. package/dist/types/index.d.ts +51 -41
  115. package/dist/types/shared.d.ts +3 -0
  116. package/dist/types/typedoc-tailwindcss-patch.d.ts +67 -0
  117. package/dist/types/user-defined-options/general.d.ts +25 -22
  118. package/dist/types/user-defined-options/important.d.ts +32 -27
  119. package/dist/types/user-defined-options/lifecycle.d.ts +4 -4
  120. package/dist/types/user-defined-options/matcher.d.ts +6 -6
  121. package/dist/unocss/index.d.ts +2 -0
  122. package/dist/utils/object.d.ts +9 -0
  123. package/dist/utils/options.d.ts +2 -0
  124. package/dist/utils/regex.d.ts +1 -0
  125. package/dist/{utils-BiShvil9.js → utils-D7Ygohep.js} +2 -2
  126. package/dist/{utils-Btw1iOVV.mjs → utils-DsaS975I.mjs} +1 -1
  127. package/dist/v3-engine-DGBhUnjn.mjs +3419 -0
  128. package/dist/v3-engine-M6Aqru5T.js +3714 -0
  129. package/dist/vite-BBcQIJpD.mjs +24493 -0
  130. package/dist/vite-DgRkWVPG.js +24507 -0
  131. package/dist/vite.js +1 -1
  132. package/dist/vite.mjs +1 -1
  133. package/dist/weapp-tw-css-import-rewrite-loader.js +5456 -22
  134. package/dist/weapp-tw-runtime-classset-loader.js +32 -9
  135. package/dist/{webpack-BzN2ly34.js → webpack-D-gb4ZvO.js} +341 -96
  136. package/dist/{webpack-DJazm5sT.mjs → webpack-D43aMQzO.mjs} +323 -79
  137. package/dist/webpack.d.ts +1 -3
  138. package/dist/webpack.js +3 -4
  139. package/dist/webpack.mjs +2 -2
  140. package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -4
  141. package/package.json +22 -20
  142. package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +0 -3
  143. package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +0 -4
  144. package/dist/bundlers/shared/css-cleanup/selectors.d.ts +0 -8
  145. package/dist/cache-BVAiJV3J.js +0 -502
  146. package/dist/cache-CHs4DXui.mjs +0 -434
  147. package/dist/constants-BoB_6lFw.js +0 -73
  148. package/dist/constants-E_loJC49.mjs +0 -44
  149. package/dist/generator-DKkhJbOg.js +0 -1531
  150. package/dist/generator-UBmfduYg.mjs +0 -1432
  151. package/dist/generator-css-Bwp3nbrl.js +0 -1381
  152. package/dist/generator-css-DeLLmp2N.mjs +0 -1342
  153. package/dist/lightningcss/index.d.ts +0 -8
  154. package/dist/lightningcss/style-handler/options.d.ts +0 -3
  155. package/dist/lightningcss/style-handler/selector-transform.d.ts +0 -10
  156. package/dist/lightningcss/style-handler/selector-utils.d.ts +0 -10
  157. package/dist/lightningcss/style-handler.d.ts +0 -17
  158. package/dist/precheck-B32p-gLI.js +0 -2736
  159. package/dist/precheck-B4RH6ZNN.mjs +0 -2622
  160. package/dist/run-tasks-B50A3pxt.js +0 -128
  161. package/dist/run-tasks-DdNi-hkk.mjs +0 -91
  162. package/dist/runtime-patch-CwN5ya72.mjs +0 -71
  163. package/dist/runtime-patch-D6mBo_KB.js +0 -85
  164. package/dist/vite-By5KQi9s.js +0 -2419
  165. package/dist/vite-Cyp42bBf.mjs +0 -2406
  166. /package/dist/{logger-Bub1jggA.mjs → logger-BNzxZbZj.mjs} +0 -0
  167. /package/dist/{logger-BRy6XPQ2.js → logger-TlKT3xmR.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  import type { OutputAsset } from 'rollup';
2
2
  import type { Plugin, ResolvedConfig } from 'vite';
3
+ import type { TailwindSourceEntry } from '../../tailwindcss/source-scan';
3
4
  import type { InternalUserDefinedOptions } from '../../types';
4
5
  interface CssFinalizerContext {
5
6
  opts: InternalUserDefinedOptions;
@@ -13,10 +14,15 @@ interface CssFinalizerContext {
13
14
  debug: (format: string, ...args: unknown[]) => void;
14
15
  getResolvedConfig: () => ResolvedConfig | undefined;
15
16
  recordCssAssetResult?: (file: string, css: string) => void;
17
+ recordViteProcessedCssAssetResult?: (file: string, css: string) => void;
18
+ getViteProcessedCssAssetResults?: () => Iterable<[string, string]>;
16
19
  getRecordedGeneratorCandidates?: () => Set<string> | undefined;
17
20
  getSourceCandidates?: () => Set<string>;
21
+ getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
18
22
  waitForSourceCandidateSyncs?: () => Promise<void>;
19
23
  rememberMainCssSource?: (file: string, rawSource: string) => void;
24
+ getRememberedMainCssSource?: (file: string) => string | undefined;
25
+ isViteProcessedCssAsset?: (asset: OutputAsset, file?: string) => boolean;
20
26
  }
21
27
  export declare function createViteCssFinalizerOutputPlugin(context: CssFinalizerContext): Plugin;
22
28
  export {};
@@ -1,2 +1,2 @@
1
- export declare function collectUnescapedDynamicCandidates(source: string): string[];
1
+ export declare function collectUnescapedDynamicCandidates(source: string, allowedCandidates?: Set<string>): string[];
2
2
  export declare function collectLegacyContainerCompatCandidates(sourceCandidates: Set<string>, candidates: Set<string>): Set<string>;
@@ -6,11 +6,15 @@ type CssHandlerOptions = IStyleHandlerOptions & {
6
6
  };
7
7
  };
8
8
  majorVersion: number | undefined;
9
+ sourceOptions?: {
10
+ outputRoot?: string | undefined;
11
+ } | undefined;
9
12
  };
10
13
  interface CssHandlerOptionsCacheOptions {
11
- appType: InternalUserDefinedOptions['appType'];
14
+ getAppType: () => InternalUserDefinedOptions['appType'];
12
15
  mainCssChunkMatcher: InternalUserDefinedOptions['mainCssChunkMatcher'];
13
16
  getMajorVersion: () => number | undefined;
17
+ getOutputRoot?: (() => string | undefined) | undefined;
14
18
  }
15
19
  export interface CssHandlerOptionsCache {
16
20
  getCssHandlerOptions: (file: string) => CssHandlerOptions;
@@ -1,3 +1,4 @@
1
1
  import type { InternalUserDefinedOptions } from '../../../types';
2
+ export declare function createCssTransformShareScope(file: string, rawSource: string): string;
2
3
  export declare function createCssTransformShareScopeKey(opts: InternalUserDefinedOptions, file: string, rawSource: string): string;
3
4
  export declare function createCssRuntimeSignature(runtimeSignature: string, generatorCandidateSignature: string): string;
@@ -1,6 +1,8 @@
1
1
  import type { OutputAsset, OutputChunk } from 'rollup';
2
2
  import type { ResolvedConfig } from 'vite';
3
+ import type { HmrTimingRecorder } from '../shared/hmr-timing';
3
4
  import type { BundleSnapshot } from './bundle-state';
5
+ import type { TailwindSourceEntry } from '../../tailwindcss/source-scan';
4
6
  import type { InternalUserDefinedOptions } from '../../types';
5
7
  interface GenerateBundleContext {
6
8
  opts: InternalUserDefinedOptions;
@@ -9,18 +11,27 @@ interface GenerateBundleContext {
9
11
  readyPromise: Promise<void>;
10
12
  };
11
13
  ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
12
- ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean) => Promise<Set<string>>;
14
+ ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean, options?: {
15
+ allowBaselineOnlyInitialSync?: boolean | undefined;
16
+ baseClassSet?: Set<string> | undefined;
17
+ transformOnly?: boolean | undefined;
18
+ }) => Promise<Set<string>>;
13
19
  debug: (format: string, ...args: unknown[]) => void;
14
20
  getResolvedConfig: () => ResolvedConfig | undefined;
15
21
  markCssAssetProcessed?: (asset: OutputAsset, file?: string) => void;
22
+ isViteProcessedCssAsset?: (asset: OutputAsset, file?: string) => boolean;
16
23
  recordCssAssetResult?: (file: string, css: string) => void;
24
+ recordViteProcessedCssAssetResult?: (file: string, css: string) => void;
25
+ getViteProcessedCssAssetResults?: () => Iterable<[string, string]>;
17
26
  getSourceCandidates?: () => Set<string>;
27
+ getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
18
28
  waitForSourceCandidateSyncs?: () => Promise<void>;
19
29
  rememberMainCssSource?: (file: string, rawSource: string, cssRuntimeSignature: string) => void;
20
30
  getRememberedMainCssSources?: () => Map<string, string>;
21
31
  getRememberedMainCssSignature?: (file: string) => string | undefined;
22
32
  setRememberedMainCssSignature?: (file: string, cssRuntimeSignature: string) => void;
23
33
  recordGeneratorCandidates?: (candidates: Set<string>) => void;
34
+ hmrTimingRecorder?: HmrTimingRecorder;
24
35
  }
25
36
  interface GenerateBundleThis {
26
37
  addWatchFile?: (id: string) => void;
@@ -30,5 +41,6 @@ interface GenerateBundleThis {
30
41
  source: string;
31
42
  }) => string;
32
43
  }
44
+ export declare function resolveReplayCssOutputFile(rootDir: string, file: string): string;
33
45
  export declare function createGenerateBundleHook(context: GenerateBundleContext): (this: GenerateBundleThis, _opt: unknown, bundle: Record<string, OutputAsset | OutputChunk>) => Promise<void>;
34
46
  export {};
@@ -1,5 +1,6 @@
1
1
  import type { BundleSnapshot } from './bundle-state';
2
2
  import type { TailwindcssPatcherLike } from '../../types';
3
+ import type { IArbitraryValues } from '../../types/shared';
3
4
  import { extractRawCandidatesWithPositions, extractValidCandidates } from 'tailwindcss-patch';
4
5
  type ExtractValidCandidatesOptions = Parameters<typeof extractValidCandidates>[0];
5
6
  type MemoryExtractValidCandidatesOptions = ExtractValidCandidatesOptions & {
@@ -8,12 +9,19 @@ type MemoryExtractValidCandidatesOptions = ExtractValidCandidatesOptions & {
8
9
  };
9
10
  type ExtractValidCandidatesFn = (options?: MemoryExtractValidCandidatesOptions) => Promise<string[]>;
10
11
  type ExtractRawCandidateResult = Awaited<ReturnType<typeof extractRawCandidatesWithPositions>>;
11
- type ExtractRawCandidatesFn = (content: string, extension?: string) => Promise<ExtractRawCandidateResult>;
12
+ type ExtractRawCandidatesFn = (content: string, extension?: string, options?: {
13
+ bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
14
+ }) => Promise<ExtractRawCandidateResult>;
12
15
  export interface BundleRuntimeClassSetManager {
13
- sync: (patcher: TailwindcssPatcherLike, snapshot: BundleSnapshot) => Promise<Set<string>>;
16
+ sync: (patcher: TailwindcssPatcherLike, snapshot: BundleSnapshot, options?: BundleRuntimeClassSetSyncOptions) => Promise<Set<string>>;
14
17
  reset: () => Promise<void>;
15
18
  }
19
+ export interface BundleRuntimeClassSetSyncOptions {
20
+ baseClassSet?: Set<string> | undefined;
21
+ skipInitialFullScanWithBase?: boolean | undefined;
22
+ }
16
23
  interface CreateBundleRuntimeClassSetManagerOptions {
24
+ bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
17
25
  extractCandidates?: ExtractValidCandidatesFn;
18
26
  extractRawCandidates?: ExtractRawCandidatesFn;
19
27
  }
@@ -1,3 +1,6 @@
1
- import type { Plugin } from 'vite';
2
1
  import type { UserDefinedOptions } from '../../types';
3
- export declare function WeappTailwindcss(options?: UserDefinedOptions): Plugin[] | undefined;
2
+ export interface WeappTailwindcssVitePlugin {
3
+ name: string;
4
+ [hook: string]: any;
5
+ }
6
+ export declare function WeappTailwindcss(options?: UserDefinedOptions): WeappTailwindcssVitePlugin[] | undefined;
@@ -0,0 +1,32 @@
1
+ import type { OutputAsset, OutputBundle } from 'rollup';
2
+ import type { InternalUserDefinedOptions } from '../../types';
3
+ interface CssAssetMarkerMatcher {
4
+ (asset: OutputAsset, file?: string): boolean;
5
+ }
6
+ interface CssAssetProcessedMarker {
7
+ (asset: OutputAsset, file?: string): void;
8
+ }
9
+ interface CssAssetResultRecorder {
10
+ (file: string, css: string): void;
11
+ }
12
+ interface CssAssetResultsGetter {
13
+ (): Iterable<[string, string]>;
14
+ }
15
+ interface CollectViteProcessedCssAssetOptions {
16
+ isViteProcessedCssAsset?: CssAssetMarkerMatcher | undefined;
17
+ markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
18
+ recordCssAssetResult?: CssAssetResultRecorder | undefined;
19
+ recordViteProcessedCssAssetResult?: CssAssetResultRecorder | undefined;
20
+ debug?: ((format: string, ...args: unknown[]) => void) | undefined;
21
+ }
22
+ interface InjectViteProcessedCssAssetOptions {
23
+ opts: InternalUserDefinedOptions;
24
+ getViteProcessedCssAssetResults?: CssAssetResultsGetter | undefined;
25
+ markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
26
+ recordCssAssetResult?: CssAssetResultRecorder | undefined;
27
+ debug?: ((format: string, ...args: unknown[]) => void) | undefined;
28
+ onUpdate?: ((file: string, original: string, generated: string) => void) | undefined;
29
+ }
30
+ export declare function collectViteProcessedCssAssetResults(bundle: OutputBundle, options: CollectViteProcessedCssAssetOptions): number;
31
+ export declare function injectViteProcessedCssIntoMainCssAssets(bundle: OutputBundle, options: InjectViteProcessedCssAssetOptions): number;
32
+ export {};
@@ -1,13 +1,16 @@
1
1
  import type { Plugin } from 'vite';
2
2
  import type { AppType } from '../../types';
3
3
  interface RewriteCssImportsOptions {
4
- appType?: AppType;
5
- getAppType?: () => AppType | undefined;
6
- shouldOwnTailwindGeneration?: boolean;
4
+ appType?: AppType | undefined;
5
+ getAppType?: (() => AppType | undefined) | undefined;
6
+ generateTailwindCss?: ((id: string, code: string, hookContext?: {
7
+ addWatchFile?: (id: string) => void;
8
+ }) => Promise<string | undefined> | string | undefined) | undefined;
9
+ shouldOwnTailwindGeneration?: boolean | undefined;
7
10
  shouldRewrite: boolean;
8
- rootImport?: string;
11
+ rootImport?: string | undefined;
9
12
  weappTailwindcssDirPosix: string;
10
- onTailwindRootCss?: (id: string, code: string) => Promise<void> | void;
13
+ onTailwindRootCss?: ((id: string, code: string) => Promise<void> | void) | undefined;
11
14
  }
12
15
  export declare function createRewriteCssImportsPlugins(options: RewriteCssImportsOptions): Plugin[];
13
16
  export {};
@@ -17,6 +17,10 @@ export declare function createViteRuntimeClassSet(options: CreateViteRuntimeClas
17
17
  };
18
18
  refreshRuntimeState: (force: boolean) => Promise<void>;
19
19
  ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
20
- ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean) => Promise<Set<string>>;
20
+ ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean, options?: {
21
+ allowBaselineOnlyInitialSync?: boolean | undefined;
22
+ baseClassSet?: Set<string> | undefined;
23
+ transformOnly?: boolean | undefined;
24
+ }) => Promise<Set<string>>;
21
25
  };
22
26
  export {};
@@ -0,0 +1,11 @@
1
+ import type { Plugin } from 'vite';
2
+ interface ViteServeCssGenerationOptions {
3
+ generateCss: (id: string, code: string, hookContext?: {
4
+ addWatchFile?: (id: string) => void;
5
+ }) => Promise<string | undefined> | string | undefined;
6
+ getCommand: () => string | undefined;
7
+ onTailwindRootCss?: ((id: string, code: string) => Promise<void> | void) | undefined;
8
+ shouldGenerate: () => boolean;
9
+ }
10
+ export declare function createViteServeCssGenerationPlugins(options: ViteServeCssGenerationOptions): Plugin[];
11
+ export {};
@@ -1,15 +1,37 @@
1
+ import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
2
+ import type { IArbitraryValues } from '../../types/shared';
1
3
  export interface SourceCandidateCollector {
2
4
  sync: (id: string, source: string) => Promise<void>;
5
+ syncCss: (id: string, source: string) => Promise<void>;
6
+ merge: (id: string, source: string) => Promise<void>;
3
7
  syncFile: (id: string) => Promise<void>;
8
+ syncCurrentFile: (id: string) => Promise<void>;
4
9
  scanRoot: (options: ScanSourceCandidateRootOptions) => Promise<void>;
10
+ syncInline: (inlineCandidates: TailwindInlineSourceCandidates | undefined) => void;
5
11
  remove: (id: string) => void;
6
12
  values: () => Set<string>;
13
+ valuesForEntries: (entries: TailwindSourceEntry[] | undefined) => Set<string>;
14
+ snapshot: () => SourceCandidateCollectorSnapshot;
15
+ restore: (snapshot: SourceCandidateCollectorSnapshot) => void;
7
16
  clear: () => void;
8
17
  }
18
+ export interface SourceCandidateCollectorSnapshot {
19
+ candidatesById: Array<[string, string[]]>;
20
+ cssCandidatesById?: Array<[string, string[]]> | undefined;
21
+ scanCandidatesById?: Array<[string, string[]]> | undefined;
22
+ transformCandidatesById?: Array<[string, string[]]> | undefined;
23
+ inlineExcludedCandidates: string[];
24
+ inlineIncludedCandidates: string[];
25
+ }
9
26
  interface ScanSourceCandidateRootOptions {
10
27
  root: string;
11
- outDir?: string;
28
+ outDir?: string | undefined;
29
+ entries?: TailwindSourceEntry[] | undefined;
30
+ explicit?: boolean | undefined;
31
+ }
32
+ export interface SourceCandidateCollectorOptions {
33
+ bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
12
34
  }
13
35
  export declare function isSourceCandidateRequest(id: string): boolean;
14
- export declare function createSourceCandidateCollector(): SourceCandidateCollector;
36
+ export declare function createSourceCandidateCollector(options?: SourceCandidateCollectorOptions): SourceCandidateCollector;
15
37
  export {};
@@ -0,0 +1,26 @@
1
+ import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
2
+ import type { TailwindcssPatcherLike, UserDefinedOptions } from '../../types';
3
+ export interface ResolvedTailwindV4CssEntries {
4
+ entries: TailwindSourceEntry[];
5
+ explicit: boolean;
6
+ inlineCandidates: TailwindInlineSourceCandidates;
7
+ dependencies: string[];
8
+ }
9
+ export interface ResolvedViteSourceScan {
10
+ dependencies?: string[] | undefined;
11
+ entries?: TailwindSourceEntry[] | undefined;
12
+ explicit?: boolean | undefined;
13
+ inlineCandidates?: TailwindInlineSourceCandidates | undefined;
14
+ }
15
+ interface ResolveViteSourceScanOptions {
16
+ root?: string | undefined;
17
+ outDir?: string | undefined;
18
+ }
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
+ export declare function resolveViteSourceScanEntries(options: UserDefinedOptions, patcher: TailwindcssPatcherLike, scanOptions?: ResolveViteSourceScanOptions): Promise<ResolvedViteSourceScan | undefined>;
25
+ export declare function createViteSourceScanMatcher(entries: TailwindSourceEntry[] | undefined): ((file: string) => boolean) | undefined;
26
+ export {};
@@ -0,0 +1,5 @@
1
+ type StaticContentValue = string | StaticContentValue[] | {
2
+ files: StaticContentValue;
3
+ };
4
+ export declare function readStaticConfigContent(configPath: string): StaticContentValue | undefined;
5
+ export {};
@@ -15,7 +15,12 @@ interface WebpackWatchChangeLike {
15
15
  modifiedFiles?: Set<string>;
16
16
  removedFiles?: Set<string>;
17
17
  }
18
+ interface RuntimeWatchDependenciesLike {
19
+ files?: Iterable<string>;
20
+ contexts?: Iterable<string>;
21
+ }
18
22
  export declare function createAssetHashByChunkMap(chunks: Iterable<ChunkLike>): Map<string, string>;
19
23
  export declare function createRuntimeAwareCssHash(assetHash: string | undefined, sourceHash: string, runtimeSetHash: string): string;
20
24
  export declare function hasWatchChanges(compiler: WebpackWatchChangeLike): boolean;
25
+ export declare function isWatchFileInRuntimeDependencies(file: string, dependencies: RuntimeWatchDependenciesLike): boolean;
21
26
  export {};
@@ -1,16 +1,20 @@
1
1
  import type { Compiler } from 'webpack';
2
+ import type { BundleRuntimeClassSetManager } from '../../vite/incremental-runtime-class-set';
2
3
  import type { AppType, InternalUserDefinedOptions } from '../../../types';
3
4
  interface SetupWebpackV5ProcessAssetsHookOptions {
4
5
  compiler: Compiler;
5
6
  options: InternalUserDefinedOptions;
6
- appType?: AppType;
7
+ appType?: AppType | undefined;
7
8
  runtimeState: {
8
9
  twPatcher: InternalUserDefinedOptions['twPatcher'];
9
10
  readyPromise: Promise<void>;
10
11
  };
11
12
  getRuntimeRefreshRequirement: () => boolean;
12
13
  refreshRuntimeMetadata: (force: boolean) => Promise<void>;
14
+ isWebpackProcessedCssAsset?: ((file: string, rawSource: string) => boolean) | undefined;
13
15
  consumeRuntimeRefreshRequirement: () => void;
16
+ isWatchMode?: (() => boolean) | undefined;
17
+ runtimeClassSetManager?: BundleRuntimeClassSetManager | undefined;
14
18
  debug: (format: string, ...args: unknown[]) => void;
15
19
  }
16
20
  export declare function setupWebpackV5ProcessAssetsHook(options: SetupWebpackV5ProcessAssetsHookOptions): void;
@@ -1,19 +1,24 @@
1
1
  import type { TailwindV4CssSource } from 'tailwindcss-patch';
2
2
  import type { Compiler } from 'webpack';
3
+ import type { TailwindRuntimeState } from '../../../tailwindcss/runtime';
3
4
  import type { AppType, InternalUserDefinedOptions } from '../../../types';
4
5
  interface SetupWebpackV5LoadersOptions {
5
6
  compiler: Compiler;
6
7
  options: InternalUserDefinedOptions;
7
- appType?: AppType;
8
+ appType?: AppType | undefined;
8
9
  weappTailwindcssPackageDir: string;
9
10
  shouldRewriteCssImports: boolean;
10
- runtimeLoaderPath?: string;
11
- registerAutoCssSource?: (source: TailwindV4CssSource) => Promise<void> | void;
11
+ runtimeLoaderPath?: string | undefined;
12
+ registerAutoCssSource?: ((source: TailwindV4CssSource) => Promise<void> | void) | undefined;
13
+ runtimeState: TailwindRuntimeState;
12
14
  getClassSetInLoader: () => Promise<void>;
15
+ getRuntimeSetInLoader: () => Promise<Set<string>>;
16
+ markWebpackProcessedCssSource?: ((file: string) => void) | undefined;
13
17
  getRuntimeWatchDependencies: () => {
14
18
  files: ReadonlySet<string>;
15
19
  contexts: ReadonlySet<string>;
16
20
  };
21
+ runtimeRegistryKey?: string | undefined;
17
22
  debug: (format: string, ...args: unknown[]) => void;
18
23
  }
19
24
  export declare function setupWebpackV5Loaders(options: SetupWebpackV5LoadersOptions): void;
@@ -1,7 +1,7 @@
1
1
  import type { Compiler } from 'webpack';
2
2
  import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
3
3
  export declare const weappTailwindcssPackageDir: string;
4
- export declare class UnifiedWebpackPluginV5 implements IBaseWebpackPlugin {
4
+ export declare class WeappTailwindcss implements IBaseWebpackPlugin {
5
5
  options: InternalUserDefinedOptions;
6
6
  appType?: AppType;
7
7
  private hasInitialTailwindCssRoots;
@@ -0,0 +1,31 @@
1
+ import type { TailwindV4CssSource } from 'tailwindcss-patch';
2
+ import type { TailwindRuntimeState } from '../../../tailwindcss/runtime';
3
+ import type { AppType, InternalUserDefinedOptions } from '../../../types';
4
+ export interface WebpackRuntimeClassSetLoaderOptions {
5
+ getClassSet?: () => void | Promise<void>;
6
+ getWatchDependencies?: () => RuntimeLoaderWatchDependencies | Promise<RuntimeLoaderWatchDependencies | void> | void;
7
+ }
8
+ export interface RuntimeLoaderWatchDependencies {
9
+ files?: Iterable<string>;
10
+ contexts?: Iterable<string>;
11
+ }
12
+ export interface WebpackCssImportRewriteRuntimeOptions {
13
+ pkgDir: string;
14
+ appType?: AppType;
15
+ compilerOptions?: InternalUserDefinedOptions;
16
+ runtimeState?: TailwindRuntimeState;
17
+ registerCssSource?: (source: TailwindV4CssSource) => Promise<void> | void;
18
+ getRuntimeSet?: () => Promise<Set<string>> | Set<string>;
19
+ markGeneratedCssSource?: (file: string) => void;
20
+ }
21
+ export interface WebpackCssImportRewriteLoaderOptions {
22
+ tailwindcssImportRewrite?: WebpackCssImportRewriteRuntimeOptions;
23
+ tailwindcssImportRewriteRuntimeKey?: string;
24
+ }
25
+ export interface WebpackLoaderRuntimeEntry {
26
+ classSet?: WebpackRuntimeClassSetLoaderOptions;
27
+ cssImportRewrite?: WebpackCssImportRewriteRuntimeOptions;
28
+ }
29
+ export declare function setWebpackLoaderRuntime(key: string, entry: WebpackLoaderRuntimeEntry): void;
30
+ export declare function deleteWebpackLoaderRuntime(key: string): void;
31
+ export declare function getWebpackLoaderRuntime(key?: string): any;
@@ -1,13 +1,7 @@
1
- import type { TailwindV4CssSource } from 'tailwindcss-patch';
2
1
  import type webpack from 'webpack';
3
- import type { AppType } from '../../../types';
2
+ import type { WebpackCssImportRewriteLoaderOptions } from './runtime-registry';
4
3
  import { Buffer } from 'node:buffer';
5
- interface CssImportRewriteLoaderOptions {
6
- tailwindcssImportRewrite?: {
7
- pkgDir: string;
8
- appType?: AppType;
9
- registerCssSource?: (source: TailwindV4CssSource) => Promise<void> | void;
10
- };
4
+ interface CssImportRewriteLoaderOptions extends WebpackCssImportRewriteLoaderOptions {
11
5
  }
12
6
  export declare function transformCssImportRewriteSource(source: string | Buffer, options: CssImportRewriteLoaderOptions | undefined): string | Buffer<ArrayBufferLike>;
13
7
  declare const WeappTwCssImportRewriteLoader: webpack.LoaderDefinitionFunction<CssImportRewriteLoaderOptions>;
@@ -1,11 +1,7 @@
1
1
  import type webpack from 'webpack';
2
- interface RuntimeClassSetLoaderOptions {
3
- getClassSet?: () => void | Promise<void>;
4
- getWatchDependencies?: () => RuntimeLoaderWatchDependencies | Promise<RuntimeLoaderWatchDependencies | void> | void;
5
- }
6
- interface RuntimeLoaderWatchDependencies {
7
- files?: Iterable<string>;
8
- contexts?: Iterable<string>;
2
+ import type { WebpackRuntimeClassSetLoaderOptions } from './runtime-registry';
3
+ interface RuntimeClassSetLoaderOptions extends WebpackRuntimeClassSetLoaderOptions {
4
+ weappTailwindcssRuntimeKey?: string;
9
5
  }
10
6
  declare const WeappTwRuntimeClassSetLoader: webpack.LoaderDefinitionFunction<RuntimeClassSetLoaderOptions>;
11
7
  export default WeappTwRuntimeClassSetLoader;
@@ -9,16 +9,16 @@ export type HashMapKey = string | number;
9
9
  export type CacheValue = sources.Source | string;
10
10
  export interface CacheProcessResult<T extends CacheValue> {
11
11
  result: T;
12
- cacheValue?: CacheValue;
12
+ cacheValue?: CacheValue | undefined;
13
13
  }
14
14
  export interface CacheProcessOptions<T extends CacheValue> {
15
15
  key: string;
16
- hashKey?: HashMapKey;
17
- rawSource?: string | Buffer;
18
- hash?: string;
19
- resolveCache?: () => T | undefined;
16
+ hashKey?: HashMapKey | undefined;
17
+ rawSource?: string | Buffer | undefined;
18
+ hash?: string | undefined;
19
+ resolveCache?: (() => T | undefined) | undefined;
20
20
  transform: () => Promise<CacheProcessResult<T> | T>;
21
- onCacheHit?: (value: T) => void | Promise<void>;
21
+ onCacheHit?: ((value: T) => void | Promise<void>) | undefined;
22
22
  }
23
23
  export interface ICreateCacheReturnType {
24
24
  readonly hashMap: Map<HashMapKey, HashMapValue>;
@@ -5,6 +5,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
10
  var __copyProps = (to, from, except, desc) => {
9
11
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
12
  key = keys[i];
@@ -20,6 +22,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
20
22
  enumerable: true
21
23
  }) : target, mod));
22
24
  //#endregion
25
+ Object.defineProperty(exports, "__commonJSMin", {
26
+ enumerable: true,
27
+ get: function() {
28
+ return __commonJSMin;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "__esmMin", {
32
+ enumerable: true,
33
+ get: function() {
34
+ return __esmMin;
35
+ }
36
+ });
23
37
  Object.defineProperty(exports, "__toESM", {
24
38
  enumerable: true,
25
39
  get: function() {
@@ -1,13 +1,3 @@
1
1
  import type { UserDefinedOptions } from '../types';
2
- export declare function createCliContext(overrides: Partial<UserDefinedOptions> | undefined, resolvedCwd: string | undefined): Required<Omit<UserDefinedOptions, "supportCustomLengthUnitsPatch" | "customReplaceDictionary" | "cache"> & {
3
- supportCustomLengthUnitsPatch: import("tailwindcss-patch").ILengthUnitsPatchOptions | boolean;
4
- templateHandler: (rawSource: string, options?: import("@/types").ITemplateHandlerOptions) => Promise<string>;
5
- styleHandler: (rawSource: string, options?: import("@weapp-tailwindcss/postcss").IStyleHandlerOptions) => Promise<import("postcss").Result<import("postcss").Root | import("postcss").Document>>;
6
- jsHandler: import("@/types").JsHandler;
7
- escapeMap: Record<string, string>;
8
- customReplaceDictionary: Record<string, string>;
9
- cache: import("../cache").ICreateCacheReturnType;
10
- twPatcher: import("@/types").TailwindcssPatcherLike;
11
- refreshTailwindcssPatcher: (options?: import("@/types").RefreshTailwindcssPatcherOptions) => Promise<import("@/types").TailwindcssPatcherLike>;
12
- }>;
2
+ export declare function createCliContext(overrides: Partial<UserDefinedOptions> | undefined, resolvedCwd: string | undefined): import("@/types").InternalUserDefinedOptions;
13
3
  export declare function formatOutputPath(target: string, baseDir?: string): string;
@@ -4,28 +4,28 @@ export interface DoctorCheck {
4
4
  title: string;
5
5
  status: DoctorCheckStatus;
6
6
  message: string;
7
- suggestion?: string;
7
+ suggestion?: string | undefined;
8
8
  }
9
9
  export interface DoctorReport {
10
10
  cwd: string;
11
11
  nodeVersion: string;
12
12
  detected: {
13
- packageManager?: string;
13
+ packageManager?: string | undefined;
14
14
  frameworks: string[];
15
- tailwindcssVersion?: string;
16
- weappTailwindcssVersion?: string;
15
+ tailwindcssVersion?: string | undefined;
16
+ weappTailwindcssVersion?: string | undefined;
17
17
  };
18
18
  summary: Record<DoctorCheckStatus, number>;
19
19
  checks: DoctorCheck[];
20
20
  }
21
21
  export interface DoctorOptions {
22
- cwd?: string;
23
- nodeVersion?: string;
22
+ cwd?: string | undefined;
23
+ nodeVersion?: string | undefined;
24
24
  }
25
25
  export interface PackageJson {
26
- dependencies?: Record<string, string>;
27
- devDependencies?: Record<string, string>;
28
- optionalDependencies?: Record<string, string>;
29
- peerDependencies?: Record<string, string>;
30
- packageManager?: string;
26
+ dependencies?: Record<string, string> | undefined;
27
+ devDependencies?: Record<string, string> | undefined;
28
+ optionalDependencies?: Record<string, string> | undefined;
29
+ peerDependencies?: Record<string, string> | undefined;
30
+ packageManager?: string | undefined;
31
31
  }
@@ -3,9 +3,9 @@ export declare const DEFAULT_VSCODE_SOURCES: string[];
3
3
  export interface GenerateVscodeEntryOptions {
4
4
  baseDir: string;
5
5
  cssEntry: string;
6
- output?: string;
7
- sources?: string[];
8
- force?: boolean;
6
+ output?: string | undefined;
7
+ sources?: string[] | undefined;
8
+ force?: boolean | undefined;
9
9
  }
10
10
  export interface GenerateVscodeEntryResult {
11
11
  outputPath: string;