weapp-tailwindcss 5.3.6 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +3 -3
  2. package/README.zh-CN.md +4 -4
  3. package/dist/bundlers/shared/framework-postcss.d.ts +3 -0
  4. package/dist/bundlers/shared/generator-css/result-helpers.d.ts +1 -1
  5. package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +1 -1
  6. package/dist/bundlers/shared/generator-css/types.d.ts +3 -1
  7. package/dist/bundlers/shared/source-candidates/snapshot.d.ts +19 -0
  8. package/dist/bundlers/shared/source-candidates/source-priority.d.ts +1 -0
  9. package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -0
  10. package/dist/bundlers/shared/source-candidates/views.d.ts +12 -0
  11. package/dist/bundlers/shared/style-requests.d.ts +1 -0
  12. package/dist/bundlers/vite/bundle-state.d.ts +9 -1
  13. package/dist/bundlers/vite/capability-profile.d.ts +18 -0
  14. package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +12 -0
  15. package/dist/bundlers/vite/hot-css-modules.d.ts +2 -2
  16. package/dist/bundlers/vite/shared/configured-css-entry-observer.d.ts +29 -0
  17. package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +8 -0
  18. package/dist/bundlers/vite/shared/framework-css-generation-queue.d.ts +1 -0
  19. package/dist/bundlers/vite/shared/framework-hmr-module-version.d.ts +9 -0
  20. package/dist/bundlers/vite/shared/framework-runtime-utils.d.ts +5 -0
  21. package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +12 -2
  22. package/dist/compiler/compilation-session-pool.d.ts +1 -0
  23. package/dist/compiler/framework-compiler-session.d.ts +21 -0
  24. package/dist/compiler/index.d.ts +1 -0
  25. package/dist/{context-DTLRADfE.cjs → compiler-C93NfxSe.cjs} +859 -11
  26. package/dist/{context-4ittVpgt.js → compiler-qDa3phIv.js} +764 -5
  27. package/dist/context/handlers.d.ts +1 -1
  28. package/dist/core/compiler/compiler.d.ts +2 -0
  29. package/dist/core/compiler/generation-cache.d.ts +30 -0
  30. package/dist/core/compiler/generation-state.d.ts +17 -0
  31. package/dist/core/compiler/index.d.ts +2 -0
  32. package/dist/core/compiler/root-store.d.ts +38 -0
  33. package/dist/core/compiler/snapshot.d.ts +35 -0
  34. package/dist/core/compiler/source-fingerprint.d.ts +3 -0
  35. package/dist/core/compiler/transforms.d.ts +15 -0
  36. package/dist/core/compiler/types.d.ts +69 -0
  37. package/dist/core.cjs +9 -8
  38. package/dist/core.d.ts +2 -1
  39. package/dist/core.js +2 -2
  40. package/dist/framework/index.d.ts +3 -1
  41. package/dist/framework.cjs +6 -1
  42. package/dist/framework.js +6 -1
  43. package/dist/{generator-EnTXLBlK.js → generator-C0m2S4WI.js} +3 -2
  44. package/dist/{generator-DKiYbTFR.cjs → generator-CKJ6sj1f.cjs} +3 -2
  45. package/dist/generator.cjs +1 -1
  46. package/dist/generator.js +1 -1
  47. package/dist/{gulp-CUysZjW3.cjs → gulp-CW6JGqVn.cjs} +14 -16
  48. package/dist/{gulp-DwtrU4V1.js → gulp-e2iWsmEK.js} +7 -7
  49. package/dist/gulp.cjs +1 -1
  50. package/dist/gulp.js +1 -1
  51. package/dist/{hmr-timing-utmOgn6p.js → hmr-timing-DgMgwSce.js} +367 -289
  52. package/dist/{hmr-timing-Cvh5UgnM.cjs → hmr-timing-n7QQKFp7.cjs} +4 -4
  53. package/dist/index.cjs +4 -4
  54. package/dist/index.js +4 -4
  55. package/dist/{pipeline-helpers-CyVXL3h6.cjs → pipeline-helpers-DoLQy44Q.cjs} +6 -6
  56. package/dist/postcss.cjs +1 -1
  57. package/dist/postcss.js +1 -1
  58. package/dist/presets.cjs +2 -3
  59. package/dist/presets.js +1 -1
  60. package/dist/rspack.cjs +2 -2
  61. package/dist/rspack.js +2 -2
  62. package/dist/{source-candidate-scan-signature-CDrLxVKu.js → source-candidate-scan-signature-B0lOMiwB.js} +3 -3
  63. package/dist/{source-candidate-scan-signature-BNt7NrrI.cjs → source-candidate-scan-signature-Chb-Zrwt.cjs} +5 -5
  64. package/dist/{tailwindcss-CexDJBhx.cjs → tailwindcss-BGlJ1m1l.cjs} +763 -5
  65. package/dist/{tailwindcss-ChnpCv25.js → tailwindcss-BSKl0FTD.js} +1 -1
  66. package/dist/{transform-CL-UZW1U.cjs → transform-C6k9zTQR.cjs} +12 -4
  67. package/dist/{transform-Bfi1_VgN.js → transform-DQhgAarN.js} +12 -4
  68. package/dist/typedoc.export.d.ts +1 -0
  69. package/dist/types/index.d.ts +1 -0
  70. package/dist/uni-app-x/component-local-style.d.ts +2 -0
  71. package/dist/uni-app-x/transform.d.ts +1 -0
  72. package/dist/uni-app-x/vite/asset-task.d.ts +21 -0
  73. package/dist/uni-app-x/vite/plugin-options.d.ts +8 -0
  74. package/dist/uni-app-x/vite/web-local-style.d.ts +2 -1
  75. package/dist/uni-app-x/vite.d.ts +1 -21
  76. package/dist/{v4-generation-core-Dhsu9Deu.cjs → v4-generation-core-B2sUkkgq.cjs} +378 -300
  77. package/dist/{vite-DMX5zoID.cjs → vite-B0IPgrvM.cjs} +807 -200
  78. package/dist/{vite-DJkhb8n1.js → vite-CcEb2SOl.js} +774 -165
  79. package/dist/vite.cjs +1 -1
  80. package/dist/vite.js +1 -1
  81. package/dist/weapp-tw-css-generation-loader.cjs +1 -1
  82. package/dist/weapp-tw-css-import-rewrite-loader.cjs +7 -7
  83. package/dist/{webpack-Cpy_yggg.cjs → webpack-B5vc13U_.cjs} +33 -35
  84. package/dist/{webpack-CzhrD9p3.js → webpack-BPA5I79o.js} +7 -7
  85. package/dist/webpack.cjs +1 -1
  86. package/dist/webpack.js +1 -1
  87. package/dist/wxml/utils.d.ts +1 -1
  88. package/dist/{wxml-B7OAVpXJ.js → wxml-CvKyV69S.js} +10 -2
  89. package/dist/{wxml-PrK-8ARX.cjs → wxml-o-CUulAM.cjs} +40 -32
  90. package/package.json +12 -11
  91. package/dist/options-BJrtIQbH.cjs +0 -768
  92. package/dist/style-options-DW30H5PV.cjs +0 -82
package/README.md CHANGED
@@ -22,7 +22,7 @@ Bring Tailwind CSS to every platform. `weapp-tailwindcss` is the core compiler a
22
22
  | React Native / Expo | `@weapp-tailwindcss/react-native` |
23
23
  | ReactLynx / Rspeedy | `@weapp-tailwindcss/lynx` |
24
24
 
25
- Start with the [installation guide](https://tw.icebreaker.top/docs/quick-start/install) or select a framework from the [documentation website](https://tw.icebreaker.top/).
25
+ Start with the [installation guide](https://tw.weapp.dev/docs/quick-start/install) or select a framework from the [documentation website](https://tw.weapp.dev/).
26
26
 
27
27
  ## Tailwind CSS 4 entry
28
28
 
@@ -46,7 +46,7 @@ pnpm exec weapp-tw -i src/input.css -o dist/output.css --watch
46
46
 
47
47
  The CLI generates Web CSS by default. `--target weapp` performs CSS-only mini-program compatibility conversion; complete WXML, JavaScript, and WXSS projects still require a bundler integration. Watch mode uses `@parcel/watcher` native events by default and supports explicit polling with `--poll`.
48
48
 
49
- See the [CLI guide](https://tw.icebreaker.top/docs/tools/weapp-tw-cli) for source maps, stdin/stdout, watch mode, and `canonicalize`.
49
+ See the [CLI guide](https://tw.weapp.dev/docs/tools/weapp-tw-cli) for source maps, stdin/stdout, watch mode, and `canonicalize`.
50
50
 
51
51
  ## Runtime requirements
52
52
 
@@ -55,7 +55,7 @@ See the [CLI guide](https://tw.icebreaker.top/docs/tools/weapp-tw-cli) for sourc
55
55
 
56
56
  ## Community and support
57
57
 
58
- - [Documentation](https://tw.icebreaker.top/)
58
+ - [Documentation](https://tw.weapp.dev/)
59
59
  - [GitHub Issues](https://github.com/sonofmagic/weapp-tailwindcss/issues)
60
60
  - [GitHub Discussions](https://github.com/sonofmagic/weapp-tailwindcss/discussions)
61
61
 
package/README.zh-CN.md CHANGED
@@ -22,7 +22,7 @@
22
22
  | React Native / Expo | `@weapp-tailwindcss/react-native` |
23
23
  | ReactLynx / Rspeedy | `@weapp-tailwindcss/lynx` |
24
24
 
25
- 从[安装指南](https://tw.icebreaker.top/zh-cn/docs/quick-start/install)开始,或在[中文官网](https://tw.icebreaker.top/zh-cn/)按框架选择接入方式。
25
+ 从[安装指南](https://tw.weapp.dev/zh-cn/docs/quick-start/install)开始,或在[中文官网](https://tw.weapp.dev/zh-cn/)按框架选择接入方式。
26
26
 
27
27
  ## Tailwind CSS 4 入口
28
28
 
@@ -46,7 +46,7 @@ pnpm exec weapp-tw -i src/input.css -o dist/output.css --watch
46
46
 
47
47
  CLI 默认生成 Web CSS。`--target weapp` 只进行小程序 CSS 兼容转换;完整 WXML、JavaScript 与 WXSS 项目仍需使用构建器集成。watch 默认使用 `@parcel/watcher` 原生事件,也可以通过 `--poll` 显式切换轮询。
48
48
 
49
- source map、stdin/stdout、watch 与 `canonicalize` 的完整用法见 [CLI 指南](https://tw.icebreaker.top/zh-cn/docs/tools/weapp-tw-cli)。
49
+ source map、stdin/stdout、watch 与 `canonicalize` 的完整用法见 [CLI 指南](https://tw.weapp.dev/zh-cn/docs/tools/weapp-tw-cli)。
50
50
 
51
51
  ## 运行环境
52
52
 
@@ -55,9 +55,9 @@ source map、stdin/stdout、watch 与 `canonicalize` 的完整用法见 [CLI 指
55
55
 
56
56
  ## 社区与支持
57
57
 
58
- - [官方文档](https://tw.icebreaker.top)
58
+ - [官方文档](https://tw.weapp.dev)
59
59
  - [GitHub Issues](https://github.com/sonofmagic/weapp-tailwindcss/issues)
60
- - [技术交流群](https://tw.icebreaker.top/zh-cn/docs/community/group)
60
+ - [技术交流群](https://tw.weapp.dev/zh-cn/docs/community/group)
61
61
 
62
62
  ## License
63
63
 
@@ -1,5 +1,6 @@
1
1
  import type { IStyleHandlerOptions, LoadedPostcssOptions } from '@weapp-tailwindcss/postcss/types';
2
2
  import type { GenerateCssByGeneratorResult } from './generator-css.js';
3
+ import type { Compiler, CompilerSnapshot } from '../../core/compiler/index.js';
3
4
  import type { InternalUserDefinedOptions } from '../../types/index.js';
4
5
  export declare function resolveFrameworkPostcssOptions(value: unknown): LoadedPostcssOptions | undefined;
5
6
  export declare function collectFrameworkPostcssOptionsFromLoaderEntries(entries: unknown[], loaderContext?: unknown): LoadedPostcssOptions | undefined;
@@ -18,4 +19,6 @@ export declare function adaptGeneratedCssWithFrameworkRootPipeline(owner: Intern
18
19
  majorVersion: number;
19
20
  rawCandidates: Iterable<string>;
20
21
  styleHandler: InternalUserDefinedOptions['styleHandler'];
22
+ compiler?: Compiler | undefined;
23
+ snapshot?: CompilerSnapshot | undefined;
21
24
  }): Promise<string>;
@@ -1,6 +1,6 @@
1
1
  import type { normalizeWeappTailwindcssGeneratorOptions } from '../../../generator/index.js';
2
2
  import { finalizeMiniProgramGeneratorCss } from './generation-helpers.js';
3
3
  export declare function isCssAlreadyRepresentedByMarkers(css: string, source: string): boolean;
4
- export declare function resolveGeneratedCssClassSet(target: string, classSet: Set<string>, candidates: Iterable<string>, css: string, escapeMap: Record<string, string> | undefined, previousClassSet?: Set<string> | undefined): Set<string>;
4
+ export declare function resolveGeneratedCssClassSet(target: string, classSet: ReadonlySet<string>, candidates: Iterable<string>, css: string, escapeMap: Record<string, string> | undefined, previousClassSet?: Set<string> | undefined): Set<string>;
5
5
  export declare function finalizeWebGeneratorCss(css: string, target: string, webCompat: ReturnType<typeof normalizeWeappTailwindcssGeneratorOptions>['webCompat']): string;
6
6
  export declare function finalizeIncrementalGeneratorCss(previousCss: string, incrementalCss: string, target: string, majorVersion: number | undefined, cssPreflight: Parameters<typeof finalizeMiniProgramGeneratorCss>[3], options: Parameters<typeof finalizeMiniProgramGeneratorCss>[4], webCompat: ReturnType<typeof normalizeWeappTailwindcssGeneratorOptions>['webCompat']): string;
@@ -13,4 +13,4 @@ export declare function resolveCandidateMatchedTailwindV4CssSource(_rawSource: s
13
13
  export declare function resolveTailwindV4CssEntryIncludesPreflight(cssEntry: string): Promise<boolean | undefined>;
14
14
  export declare function resolveCandidateMatchedTailwindV4CssEntry(sourceOptions: TailwindV4SourceOptions, selectionOptions: GeneratorSourceSelectionOptions | undefined): Promise<import("./metadata.js").GeneratorResolvedSource | undefined>;
15
15
  export declare function createTailwindV4CssSourceResolver(sourceOptions: TailwindV4SourceOptions, generatorOptions: NormalizedWeappTailwindcssGeneratorOptions | undefined): (cssSource: NonNullable<typeof sourceOptions.cssSources>[number], index: number) => Promise<import("./metadata.js").GeneratorResolvedSource>;
16
- export declare function resolveTailwindV4SourceSideEntrySource(resolvedEntrySource: ReturnType<typeof resolveSourceSideCssEntrySource>, sourceOptions: ReturnType<typeof resolveTailwindV4SourceOptionsFromRuntime>, generatorOptions: NormalizedWeappTailwindcssGeneratorOptions | undefined, file: string): Promise<import("../../../../generator/index.js").TailwindV4ResolvedSource | undefined>;
16
+ export declare function resolveTailwindV4SourceSideEntrySource(resolvedEntrySource: ReturnType<typeof resolveSourceSideCssEntrySource>, sourceOptions: ReturnType<typeof resolveTailwindV4SourceOptionsFromRuntime>, generatorOptions: NormalizedWeappTailwindcssGeneratorOptions | undefined, file: string, currentCss?: string): Promise<import("../../../../generator/index.js").TailwindV4ResolvedSource | undefined>;
@@ -1,6 +1,7 @@
1
1
  import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
2
2
  import type { TailwindV4CssSource } from './source-resolver/types.js';
3
3
  import type { CompilationDependencyChange, SourceScope } from '../../../compiler/index.js';
4
+ import type { CompilerSnapshot } from '../../../core/compiler/index.js';
4
5
  import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan.js';
5
6
  import type { InternalUserDefinedOptions } from '../../../types/index.js';
6
7
  export interface GenerateCssByGeneratorOptions {
@@ -40,10 +41,11 @@ export interface GenerateCssByGeneratorOptions {
40
41
  }
41
42
  export interface GenerateCssByGeneratorResult {
42
43
  css: string;
43
- classSet: Set<string>;
44
+ classSet: ReadonlySet<string>;
44
45
  target: string;
45
46
  source: 'generator';
46
47
  dependencies: string[];
48
+ snapshot?: CompilerSnapshot | undefined;
47
49
  incremental?: boolean | undefined;
48
50
  metadata?: {
49
51
  file: string;
@@ -0,0 +1,19 @@
1
+ import type { SourceCandidateCollectorSnapshot } from './types-and-cache.js';
2
+ type CandidateMap = Map<string, Set<string>>;
3
+ type SourceMap = Map<string, string>;
4
+ interface SnapshotMaps {
5
+ candidatesById: CandidateMap;
6
+ scanCandidatesById: CandidateMap;
7
+ transformCandidatesById: CandidateMap;
8
+ cssCandidatesById: CandidateMap;
9
+ moduleCandidatesById: CandidateMap;
10
+ scanSourceById: SourceMap;
11
+ transformSourceById: SourceMap;
12
+ cssSourceById: SourceMap;
13
+ moduleSourceById: SourceMap;
14
+ inlineIncludedCandidates: Set<string>;
15
+ inlineExcludedCandidates: Set<string>;
16
+ }
17
+ export declare function createCandidateSnapshot(maps: SnapshotMaps): SourceCandidateCollectorSnapshot;
18
+ export declare function restoreCandidateSnapshot(maps: SnapshotMaps, snapshot: SourceCandidateCollectorSnapshot, clear: () => void, recompute: (id: string) => void, setInlineCandidates: (included: Set<string>, excluded: Set<string>) => void): void;
19
+ export {};
@@ -0,0 +1 @@
1
+ export declare function mergeSourcesByPriority(moduleSourceById: Map<string, string>, transformSourceById: Map<string, string>, cssSourceById: Map<string, string>, scanSourceById: Map<string, string>): Map<string, string>;
@@ -25,6 +25,7 @@ export interface SourceCandidateStore {
25
25
  clearScan: () => void;
26
26
  resetScan: () => void;
27
27
  clear: () => void;
28
+ getRevision: () => number;
28
29
  }
29
30
  export interface SourceCandidateCollector extends SourceCandidateStore {
30
31
  }
@@ -0,0 +1,12 @@
1
+ import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan.js';
2
+ type CandidateMap = Map<string, Set<string>>;
3
+ interface CandidateViewOptions {
4
+ candidatesById: CandidateMap;
5
+ moduleCandidatesById: CandidateMap;
6
+ candidateCount: Map<string, number>;
7
+ inlineIncludedCandidates: Set<string>;
8
+ inlineExcludedCandidates: Set<string>;
9
+ }
10
+ export declare function collectCandidateValues(view: CandidateViewOptions, entries?: TailwindSourceEntry[], excludeEntries?: TailwindSourceEntry[]): Set<string>;
11
+ export declare function collectCandidateSources(view: CandidateViewOptions, entries?: TailwindSourceEntry[], excludeEntries?: TailwindSourceEntry[]): Map<string, Set<string>>;
12
+ export {};
@@ -1,4 +1,5 @@
1
1
  export declare function stripRequestQuery(request: string): string;
2
2
  export declare function isSourceStyleRequest(request: string | undefined): boolean;
3
+ export declare function isSfcStyleSourceRequest(request: string | undefined): boolean;
3
4
  export declare function isSourcePreprocessorRequest(request: string | undefined, lang?: string): boolean;
4
5
  export declare function isVueScopedStyleRequest(request: string | undefined): boolean;
@@ -9,7 +9,14 @@ export interface BundleStateEntry extends RuntimeSnapshotEntry {
9
9
  export interface BundleSnapshot extends RuntimeCompilationSnapshot<BundleStateEntry> {
10
10
  jsEntries: Map<string, OutputEntry>;
11
11
  }
12
- export type BundleBuildState = RuntimeCompilationBuildState;
12
+ interface BundleEntryMetadata {
13
+ outputType: OutputAsset['type'] | OutputChunk['type'];
14
+ runtimeCandidate: boolean;
15
+ type: EntryType;
16
+ }
17
+ export interface BundleBuildState extends RuntimeCompilationBuildState {
18
+ entryMetadataByFile: Map<string, BundleEntryMetadata>;
19
+ }
13
20
  export interface BuildBundleSnapshotOptions {
14
21
  hasOmittedKnownFiles?: boolean | undefined;
15
22
  removedFiles?: Iterable<string> | undefined;
@@ -20,3 +27,4 @@ export declare function classifyBundleEntry(file: string, opts: InternalUserDefi
20
27
  export declare function buildBundleSnapshot(bundle: Record<string, OutputAsset | OutputChunk>, opts: InternalUserDefinedOptions, outDir: string, state: BundleBuildState, forceAll?: boolean, options?: BuildBundleSnapshotOptions): BundleSnapshot;
21
28
  export declare function buildBundleSnapshotForBuild(bundle: Record<string, OutputAsset | OutputChunk>, opts: InternalUserDefinedOptions, outDir: string): BundleSnapshot;
22
29
  export declare function updateBundleBuildState(state: BundleBuildState, snapshot: BundleSnapshot, linkedByEntry: Map<string, Set<string>>, options?: UpdateRuntimeCompilationBuildStateOptions): void;
30
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { ViteFrameworkName } from '../framework-selector.js';
2
+ import type { UserDefinedOptions } from '../../types/index.js';
3
+ export interface ViteCapabilityProfile {
4
+ name: 'framework' | 'generic-web';
5
+ frameworkName: ViteFrameworkName;
6
+ generatorTarget: 'web' | 'weapp' | 'app' | undefined;
7
+ platformFamily: 'web' | 'native-app' | 'mini-program' | 'unknown';
8
+ command?: 'serve' | 'build' | undefined;
9
+ watch?: boolean;
10
+ ssr?: boolean;
11
+ environmentName?: string;
12
+ sourceCandidates: boolean;
13
+ frameworkExtras: boolean;
14
+ serveJsTransform: boolean;
15
+ styleInjector: boolean;
16
+ }
17
+ export declare const frameworkViteCapabilityProfile: ViteCapabilityProfile;
18
+ export declare function createGenericWebViteCapabilityProfile(options: UserDefinedOptions): ViteCapabilityProfile;
@@ -32,5 +32,17 @@ interface ProcessJsBundleEntryOptions {
32
32
  uniAppX: GenerateBundleContext['opts']['uniAppX'];
33
33
  useIncrementalMode: boolean;
34
34
  }
35
+ interface ReplayCleanJsBundleEntryOptions {
36
+ cache: GenerateBundleContext['opts']['cache'];
37
+ debug: GenerateBundleContext['debug'];
38
+ entry: BundleStateEntry;
39
+ metrics: BundleMetrics;
40
+ rememberProcessCacheKey: (cacheKey: string, hashKey?: string | number) => void;
41
+ snapshot: BundleSnapshot;
42
+ transformFilterSignature: string;
43
+ transformRuntimeSignature: string;
44
+ useIncrementalMode: boolean;
45
+ }
46
+ export declare function replayCleanJsBundleEntry(options: ReplayCleanJsBundleEntryOptions): boolean;
35
47
  export declare function processJsBundleEntry(options: ProcessJsBundleEntryOptions): void;
36
48
  export {};
@@ -1,8 +1,8 @@
1
1
  import type { HmrContext, ModuleNode } from 'vite';
2
- export declare function resolveHotTailwindCssModules(ctx: HmrContext, tailwindRootCssModuleIds: Iterable<string | null | undefined>): Promise<ModuleNode[]>;
2
+ export declare function resolveHotTailwindCssModules(ctx: HmrContext, tailwindRootCssModuleIds: Iterable<string | null | undefined>, selectModules?: (modules: ModuleNode[]) => ModuleNode[]): Promise<ModuleNode[]>;
3
3
  export declare function resolveHotSourceModulesByIds(ctx: HmrContext, ids: Iterable<string | null | undefined>): Promise<ModuleNode[]>;
4
4
  export declare function resolveHotSourceModules(ctx: HmrContext): Promise<ModuleNode[]>;
5
5
  export declare function mergeHotModulesByIdentity(root: string, ...groups: ModuleNode[][]): ModuleNode[];
6
6
  export declare function hasSelfAcceptingNonStyleHotModule(modules: ModuleNode[]): boolean;
7
- export declare function sendSupplementalCssHotUpdates(ctx: HmrContext, cssModules: ModuleNode[], fallbackCssIds?: Iterable<string>, fallbackSourceIds?: Iterable<string>): void;
7
+ export declare function sendSupplementalCssHotUpdates(ctx: HmrContext, cssModules: ModuleNode[], fallbackCssIds?: Iterable<string>, fallbackSourceIds?: Iterable<string>, handledModules?: ModuleNode[]): void;
8
8
  export declare function sendFullReloadForUnresolvedHotUpdate(ctx: HmrContext): void;
@@ -0,0 +1,29 @@
1
+ import type { Plugin } from 'vite';
2
+ interface ConfiguredCssEntryObserverOptions {
3
+ delayMs?: number;
4
+ getEntries: () => string[] | undefined;
5
+ getRoot: () => string | undefined;
6
+ onMissing: (entries: string[]) => void;
7
+ }
8
+ export declare function createConfiguredCssEntryObserver(options: ConfiguredCssEntryObserverOptions): {
9
+ dispose(): void;
10
+ flush: () => void;
11
+ observe(id: string): void;
12
+ observeSourceImports(source: string, sourceId: string): void;
13
+ requestCheck(): void;
14
+ };
15
+ export declare function createConfiguredCssEntryDiagnostics(options: {
16
+ getEntries: () => string[] | undefined;
17
+ getRoot: () => string | undefined;
18
+ isWeb: () => boolean;
19
+ }): {
20
+ observer: {
21
+ dispose(): void;
22
+ flush: () => void;
23
+ observe(id: string): void;
24
+ observeSourceImports(source: string, sourceId: string): void;
25
+ requestCheck(): void;
26
+ };
27
+ plugin: Plugin<any>;
28
+ };
29
+ export {};
@@ -1,6 +1,7 @@
1
1
  import type { HmrContext, Plugin, ResolvedConfig } from 'vite';
2
2
  import type { ViteFrameworkName } from '../../framework-selector.js';
3
3
  import type { createViteRuntimeClassSet } from '../runtime-class-set.js';
4
+ import type { ViteHmrCssModuleVersionTracker } from './framework-hmr-module-version.js';
4
5
  import type { ViteFrameworkCssPipelineStrategy, ViteFrameworkExtraPluginPlatform, ViteFrameworkRuntimeFeatureContext } from './framework-strategy.js';
5
6
  import type { getCompilerContext } from '../../../context/index.js';
6
7
  import type { toCustomAttributesEntities } from '../../../context/custom-attributes.js';
@@ -26,6 +27,7 @@ export interface ViteFrameworkExtraPluginContext {
26
27
  ensureRuntimeClassSet: (...args: any[]) => Promise<Set<string>>;
27
28
  generateCss: (...args: any[]) => Promise<string | undefined>;
28
29
  getResolvedConfig: () => ResolvedConfig | undefined;
30
+ hmrCssModuleVersions: ViteHmrCssModuleVersionTracker;
29
31
  isEnabled: () => boolean;
30
32
  isIosPlatform: boolean;
31
33
  isNativeAppStyleTarget: () => boolean;
@@ -39,5 +41,11 @@ export interface ViteFrameworkExtraPluginContext {
39
41
  tailwindRootCssModuleIds: Set<string>;
40
42
  uniAppX: ReturnType<typeof getCompilerContext>['uniAppX'];
41
43
  viteProcessedCssSourceFiles: Iterable<string>;
44
+ webCssEntryDiagnostics: {
45
+ dispose: () => void;
46
+ flush: () => void;
47
+ observeSourceImports: (source: string, sourceId: string) => void;
48
+ requestCheck: () => void;
49
+ };
42
50
  }
43
51
  export declare function createViteFrameworkPlugins(options: (UserDefinedOptions | InternalUserDefinedOptions) | undefined, frameworkBranch: ViteFrameworkBranchContext): WeappTailwindcssVitePlugin[] | undefined;
@@ -0,0 +1 @@
1
+ export declare function createFrameworkCssGenerationQueue<Args extends unknown[], Result>(normalizeId: (id: string) => string, generate: (id: string, ...args: Args) => Promise<Result>): (id: string, ...args: Args) => Promise<Result>;
@@ -0,0 +1,9 @@
1
+ import type { ModuleNode, Plugin } from 'vite';
2
+ export interface ViteHmrCssModuleVersionTracker {
3
+ clear: () => void;
4
+ filterIds: (ids: Iterable<string>, timestamp: number, root: string) => string[];
5
+ filterModules: (modules: ModuleNode[], timestamp: number, root: string) => ModuleNode[];
6
+ reserveRefreshTimestamp: (modules: ModuleNode[], timestamp: number, root: string) => number;
7
+ }
8
+ export declare function createViteHmrCssModuleVersionTracker(): ViteHmrCssModuleVersionTracker;
9
+ export declare function createViteHmrCssModuleVersionFilterPlugin(tracker: ViteHmrCssModuleVersionTracker): Plugin;
@@ -0,0 +1,5 @@
1
+ export declare function collectConfiguredCssEntries(options: any): any[] | undefined;
2
+ export declare function inferPlatformFromOutDir(outDir: any): string | undefined;
3
+ export declare function isWebOrNativeAppPlatform(platform: any): boolean;
4
+ export declare function isInternalUserDefinedOptions(options: any): boolean;
5
+ export declare function isNuxtPageHotModule(id: any): boolean;
@@ -2,11 +2,16 @@ import type { HmrContext } from 'vite';
2
2
  import type { createViteCssMemory } from '../css-memory.js';
3
3
  import type { createViteRuntimeClassSet } from '../runtime-class-set.js';
4
4
  import type { createSourceCandidateCollector } from '../source-candidates.js';
5
- import type { createViteHmrCandidateState, ViteSourceCandidateChange } from './framework-hmr-candidate-state.js';
5
+ import type { createViteHmrCandidateState } from './framework-hmr-candidate-state.js';
6
6
  type SourceCandidateCollector = ReturnType<typeof createSourceCandidateCollector>;
7
7
  type CssMemory = ReturnType<typeof createViteCssMemory>;
8
8
  type RuntimeState = ReturnType<typeof createViteRuntimeClassSet>['runtimeState'];
9
9
  type HmrCandidateState = ReturnType<typeof createViteHmrCandidateState>;
10
+ interface PendingSourceCandidateFileChange {
11
+ file: string;
12
+ source?: string;
13
+ event: 'create' | 'update' | 'delete';
14
+ }
10
15
  interface FrameworkSourceScanSessionOptions {
11
16
  cssMemory: CssMemory;
12
17
  debug: (...args: any[]) => void;
@@ -26,17 +31,22 @@ export declare function createFrameworkSourceScanSession(options: FrameworkSourc
26
31
  getStats: () => {
27
32
  pendingSourceCandidateSyncByFile: number;
28
33
  pendingSourceCandidateSyncs: number;
34
+ pendingChangedFiles: number;
29
35
  pendingHotUpdateChangeByFile: number;
30
36
  sourceCandidateScanCache: number;
31
37
  };
32
38
  invalidate: () => void;
33
39
  isDependency: (file: string) => boolean;
34
40
  matches: (file: string) => boolean;
41
+ queueChangedFile: (change: Omit<PendingSourceCandidateFileChange, "file"> & {
42
+ id: string;
43
+ }) => void;
44
+ flushChangedFiles: () => any;
35
45
  shouldDiscoverAutoCssSources: (autoCssSourcesDiscovered: boolean) => boolean;
36
46
  sync: (syncOptions?: {
37
47
  force?: boolean;
38
48
  }) => Promise<void>;
39
- syncChangedFile: (id: string, sourceOverride?: string) => Promise<ViteSourceCandidateChange | undefined>;
49
+ syncChangedFile: (id: string, sourceOverride?: string) => any;
40
50
  waitForPendingSyncs: () => Promise<void>;
41
51
  };
42
52
  export {};
@@ -8,6 +8,7 @@ export interface CompilationScopeSource extends CompilationScopeGraphSource {
8
8
  export interface CompilationScopeGenerationResult {
9
9
  classSet: Iterable<string>;
10
10
  dependenciesBySource?: Iterable<readonly [string, Iterable<CompilationScopeDependency>]> | undefined;
11
+ snapshot?: unknown;
11
12
  }
12
13
  export interface CompilationScopeRequest {
13
14
  scope: SourceScope;
@@ -0,0 +1,21 @@
1
+ import type { Compiler, CompilerGenerateRequest, CompilerGenerateResult, CompilerSnapshot } from '../core/compiler/types.js';
2
+ import type { TailwindV4ResolvedSource } from '../generator/index.js';
3
+ import type { InternalUserDefinedOptions } from '../types/index.js';
4
+ export declare class FrameworkCompilerSession {
5
+ readonly compiler: Compiler;
6
+ private readonly scopeRoots;
7
+ private readonly activeRoots;
8
+ private transactionId;
9
+ private disposed;
10
+ constructor(options: InternalUserDefinedOptions);
11
+ rootId(scopeId: string, sourceId: string): string;
12
+ generate(scopeId: string, sourceId: string, source: TailwindV4ResolvedSource, request: Omit<CompilerGenerateRequest, 'id' | 'source' | 'sourceOptions'>): Promise<CompilerGenerateResult>;
13
+ syncScope(scopeId: string, sourceIds: Iterable<string>): Promise<void>;
14
+ removeScope(scopeId: string): Promise<void>;
15
+ invalidate(ids: Iterable<string>): readonly string[];
16
+ mergeSnapshots(snapshots: Iterable<CompilerSnapshot>): CompilerSnapshot;
17
+ dispose(): Promise<void>;
18
+ private encode;
19
+ }
20
+ export declare function getFrameworkCompilerSession(owner: object, options: InternalUserDefinedOptions): FrameworkCompilerSession;
21
+ export declare function disposeFrameworkCompilerSession(owner: object): Promise<void>;
@@ -5,6 +5,7 @@ export * from './compilation-scope-graph.js';
5
5
  export * from './compilation-session-pool.js';
6
6
  export * from './composition.js';
7
7
  export * from './emission-plan.js';
8
+ export * from './framework-compiler-session.js';
8
9
  export * from './invalidation.js';
9
10
  export * from './mode.js';
10
11
  export * from './owner-lifecycle.js';