weapp-tailwindcss 5.0.12 → 5.1.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.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/auto-Ba6hDrse.mjs +13 -0
- package/dist/auto-DtU6f3X6.js +18 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/directives.d.ts +2 -1
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +27 -10
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-files.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/source-resolver/config.d.ts +7 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +15 -0
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +22 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +6 -23
- package/dist/bundlers/shared/generator-css/types.d.ts +15 -1
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -1
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -0
- package/dist/bundlers/shared/run-tasks.d.ts +1 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +11 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
- package/dist/bundlers/vite/css-memory.d.ts +37 -0
- package/dist/bundlers/vite/generate-bundle/bundle-file-names.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +0 -1
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +9 -7
- package/dist/bundlers/vite/generate-bundle/env-flags.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +12 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +63 -0
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +31 -0
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +80 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +53 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/runtime-linked-css.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +21 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +5 -2
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +30 -0
- package/dist/bundlers/vite/generate-bundle/timing.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +3 -1
- package/dist/bundlers/vite/generate-bundle/uni-app-x-postprocess.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/vite-css-cache.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +4 -1
- package/dist/bundlers/vite/hot-css-modules.d.ts +5 -0
- package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +1 -0
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +3 -3
- package/dist/bundlers/vite/map-cache.d.ts +2 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +16 -0
- package/dist/bundlers/vite/resolve-app-type.d.ts +1 -2
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +5 -5
- package/dist/bundlers/vite/source-candidate-scan-signature.d.ts +13 -0
- package/dist/bundlers/vite/source-candidates/script.d.ts +1 -7
- package/dist/bundlers/vite/source-candidates.d.ts +12 -2
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +3 -6
- package/dist/bundlers/vite/source-scan.d.ts +3 -3
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +1 -1
- package/dist/bundlers/vite/utils.d.ts +1 -0
- package/dist/bundlers/vite/weapp-vite-config.d.ts +3 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +24 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -10
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +28 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +5 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +15 -1
- package/dist/bundlers/webpack/shared/css-loader-runtime.d.ts +1 -0
- package/dist/cache/index.d.ts +1 -0
- package/dist/cli/mount-options.d.ts +2 -2
- package/dist/cli.js +126 -439
- package/dist/cli.mjs +121 -434
- package/dist/context/index.d.ts +3 -3
- package/dist/context/style-options.d.ts +4 -1
- package/dist/context/tailwindcss.d.ts +1 -1
- package/dist/{precheck-30zNPRlI.js → context-BHxLe743.js} +484 -175
- package/dist/{precheck-CsFr1q2l.mjs → context-Mbzkek1q.mjs} +461 -159
- package/dist/core.js +15 -12
- package/dist/core.mjs +10 -7
- package/dist/css-macro.js +2 -2
- package/dist/css-macro.mjs +2 -2
- package/dist/{defaults-Boc26eel.js → defaults-CVcKbXBG.js} +6 -50
- package/dist/{defaults-DH0ZQRhy.mjs → defaults-ZElj1zKc.mjs} +7 -45
- package/dist/defaults.d.ts +1 -7
- package/dist/defaults.js +1 -2
- package/dist/defaults.mjs +2 -2
- package/dist/framework/index.d.ts +59 -0
- package/dist/framework.d.ts +1 -0
- package/dist/framework.js +198 -0
- package/dist/framework.mjs +180 -0
- package/dist/generator/index.d.ts +6 -7
- package/dist/generator/options.d.ts +3 -3
- package/dist/generator/types.d.ts +9 -10
- package/dist/generator-9rUz4Hcb.js +170 -0
- package/dist/generator-Dc4qaPmT.mjs +123 -0
- package/dist/generator.js +10 -16
- package/dist/generator.mjs +3 -3
- package/dist/{gulp-CxGZU0-v.js → gulp-B_sdP6dx.js} +80 -92
- package/dist/{gulp-BfZpaYSQ.mjs → gulp-uM36oIJs.mjs} +73 -85
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DNjF8bWA.mjs → hmr-timing-BXMLsF4b.mjs} +1289 -909
- package/dist/{hmr-timing-DFR51wgo.js → hmr-timing-CogqkFaF.js} +1397 -939
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -4
- package/dist/index.mjs +6 -5
- package/dist/js/fast-path/oxc.d.ts +4 -0
- package/dist/js/precheck.d.ts +1 -0
- package/dist/postcss.js +3 -4
- package/dist/postcss.mjs +2 -3
- package/dist/presets.js +10 -20
- package/dist/presets.mjs +9 -19
- package/dist/runtime-branch/create-branch.d.ts +2 -0
- package/dist/runtime-branch/generator-target-env.d.ts +4 -0
- package/dist/runtime-branch/index.d.ts +6 -0
- package/dist/runtime-branch/mini-program.d.ts +2 -0
- package/dist/runtime-branch/native-app.d.ts +2 -0
- package/dist/runtime-branch/platform.d.ts +6 -0
- package/dist/runtime-branch/tailwind-version.d.ts +2 -0
- package/dist/runtime-branch/types.d.ts +37 -0
- package/dist/runtime-branch/web.d.ts +2 -0
- package/dist/runtime-branch.d.ts +1 -0
- package/dist/{bundle-state-DU2ATDhw.js → source-candidate-scan-signature-2ybpptAK.js} +262 -20
- package/dist/{bundle-state-BxMNKjBV.mjs → source-candidate-scan-signature-Cvb5z1ha.mjs} +187 -17
- package/dist/tailwindcss/candidates.d.ts +7 -0
- package/dist/tailwindcss/index.d.ts +2 -2
- package/dist/tailwindcss/runtime/cache.d.ts +6 -6
- package/dist/tailwindcss/runtime-factory.d.ts +12 -0
- package/dist/tailwindcss/runtime-options.d.ts +8 -0
- package/dist/tailwindcss/runtime-types.d.ts +86 -0
- package/dist/tailwindcss/runtime.d.ts +6 -6
- package/dist/tailwindcss/source-scan.d.ts +1 -1
- package/dist/tailwindcss/targets.d.ts +2 -2
- package/dist/tailwindcss/v4/config.d.ts +3 -3
- package/dist/tailwindcss/v4/css-entries.d.ts +1 -0
- package/dist/tailwindcss/v4/css-sources.d.ts +4 -2
- package/dist/tailwindcss/v4/index.d.ts +1 -1
- package/dist/tailwindcss/v4/multi-runtime.d.ts +2 -0
- package/dist/tailwindcss/v4/runtime-factory.d.ts +15 -0
- package/dist/tailwindcss/v4/runtime-options.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +3 -3
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator.d.ts +10 -3
- package/dist/tailwindcss/v4-engine/index.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +7 -1
- package/dist/tailwindcss/v4-engine/source.d.ts +23 -6
- package/dist/tailwindcss/v4-engine/types.d.ts +8 -9
- package/dist/tailwindcss/version.d.ts +1 -1
- package/dist/tailwindcss-DHIYcqXT.js +1523 -0
- package/dist/tailwindcss-wyUHrfil.mjs +1418 -0
- package/dist/{transform-CaVEBOuR.js → transform-CQVOgmzM.js} +45 -37
- package/dist/{transform-Cju08-aJ.mjs → transform-tExdt40m.mjs} +30 -22
- package/dist/typedoc.export.d.ts +1 -1
- package/dist/types/index.d.ts +16 -17
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/{typedoc-tailwindcss-patch.d.ts → typedoc-tailwindcss-runtime.d.ts} +4 -10
- package/dist/types/user-defined-options/general.d.ts +8 -4
- package/dist/types/user-defined-options/important.d.ts +2 -2
- package/dist/uni-app-x/style-asset.d.ts +1 -0
- package/dist/{utils-Dolmt8EO.js → utils-BCa37Wqj.js} +2 -17
- package/dist/{utils-DsaS975I.mjs → utils-DodxWHGz.mjs} +2 -17
- package/dist/v4-engine-CF9zt4Cw.mjs +2396 -0
- package/dist/v4-engine-D4ubP7N5.js +2778 -0
- package/dist/{vite-BBGOjh9e.js → vite-CP0ylSxZ.js} +2887 -1683
- package/dist/{vite-CS5DE-HD.mjs → vite-CPO83EhA.mjs} +2753 -1548
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +5741 -4396
- package/dist/weapp-tw-runtime-classset-loader.js +36 -0
- package/dist/webpack-Bsek8VhR.js +2094 -0
- package/dist/webpack-BzqhJ8yK.mjs +2082 -0
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +11 -7
- package/dist/auto-CTp6wE5a.js +0 -33
- package/dist/auto-Cl8_hsG6.mjs +0 -22
- package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +0 -13
- package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +0 -1
- package/dist/context/tailwindcss/rax.d.ts +0 -2
- package/dist/generator-Cb1Zp3Al.js +0 -92
- package/dist/generator-mvNFUvns.mjs +0 -67
- package/dist/tailwindcss/patcher-options.d.ts +0 -8
- package/dist/tailwindcss/patcher.d.ts +0 -12
- package/dist/tailwindcss/runtime-patch.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +0 -3
- package/dist/tailwindcss/v3-engine/generator/content.d.ts +0 -10
- package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +0 -2
- package/dist/tailwindcss/v3-engine/generator.d.ts +0 -19
- package/dist/tailwindcss/v3-engine/index.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/miniprogram.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/source.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/types.d.ts +0 -61
- package/dist/tailwindcss/v4/multi-patcher.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher-options.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher.d.ts +0 -15
- package/dist/tailwindcss/v4-engine/tailwind-v3-compatibility.d.ts +0 -1
- package/dist/tailwindcss/v4-engine/tailwind-v3-default-colors.d.ts +0 -1
- package/dist/tailwindcss-CK84uGBp.mjs +0 -556
- package/dist/tailwindcss-Clpkz1oR.js +0 -613
- package/dist/v3-engine-CQE5JJNZ.js +0 -4639
- package/dist/v3-engine-DKBaKWGL.mjs +0 -4231
- package/dist/webpack-DIWrcpRo.js +0 -1066
- package/dist/webpack-SPcri_D8.mjs +0 -1054
- /package/dist/tailwindcss/{patcher-resolve.d.ts → runtime-resolve.d.ts} +0 -0
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> English | [简体中文](./README.md)
|
|
4
4
|
|
|
5
|
-
This is the core package that brings Tailwind CSS to mini program ecosystems, handling class transformation, CSS compatibility, framework build adapters, and Tailwind
|
|
5
|
+
This is the core package that brings Tailwind CSS to mini program ecosystems, handling class transformation, CSS compatibility, framework build adapters, and Tailwind v4 support.
|
|
6
6
|
|
|
7
7
|
## Website
|
|
8
8
|
|
package/README.md
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { hasCssMacroStyleOptions, hasCssMacroTailwindV4Directive, transformCssMacroCss, withCssMacroStyleOptions } from "@weapp-tailwindcss/postcss";
|
|
2
|
+
//#region src/css-macro/auto.ts
|
|
3
|
+
const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
|
|
4
|
+
function markCssMacroPlugin(value) {
|
|
5
|
+
Object.defineProperty(value, CSS_MACRO_PLUGIN_MARKER, {
|
|
6
|
+
configurable: false,
|
|
7
|
+
enumerable: false,
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { withCssMacroStyleOptions as a, transformCssMacroCss as i, hasCssMacroTailwindV4Directive as n, markCssMacroPlugin as r, hasCssMacroStyleOptions as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require("@weapp-tailwindcss/postcss");
|
|
2
|
+
//#region src/css-macro/auto.ts
|
|
3
|
+
const CSS_MACRO_PLUGIN_MARKER = "__weappTailwindcssCssMacro";
|
|
4
|
+
function markCssMacroPlugin(value) {
|
|
5
|
+
Object.defineProperty(value, CSS_MACRO_PLUGIN_MARKER, {
|
|
6
|
+
configurable: false,
|
|
7
|
+
enumerable: false,
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
Object.defineProperty(exports, "markCssMacroPlugin", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function() {
|
|
16
|
+
return markCssMacroPlugin;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { finalizeMiniProgramCss, hoistTailwindPreflightBase, pruneMiniProgramGeneratedCss, removeUnsupportedAtSupports, removeUnsupportedMiniProgramAtRules, } from '@weapp-tailwindcss/postcss';
|
|
1
|
+
export { finalizeMiniProgramCss, hasMiniProgramCssSpecificityPlaceholders, hoistTailwindPreflightBase, pruneMiniProgramGeneratedCss, removeUnsupportedAtSupports, removeUnsupportedMiniProgramAtRules, stripMiniProgramCssSpecificityPlaceholders, } from '@weapp-tailwindcss/postcss';
|
|
@@ -5,10 +5,11 @@ export declare function parseImportRequest(params: string): string | undefined;
|
|
|
5
5
|
export declare function hasLocalCssImport(rawSource: string): boolean;
|
|
6
6
|
export declare function normalizeTailwindConfigDirectives(rawSource: string, base: string): string;
|
|
7
7
|
export declare function normalizeTailwindSourceForGenerator(rawSource: string, options?: TailwindDirectiveOptions): string;
|
|
8
|
-
export declare function normalizeTailwindV3CssEntrySource(rawSource: string): string;
|
|
9
8
|
export declare function normalizeTailwindSourceDirectives(rawSource: string, options?: TailwindDirectiveOptions): string;
|
|
10
9
|
export declare function removeTailwindSourceDirectives(rawSource: string, options?: TailwindDirectiveOptions): string;
|
|
11
10
|
export declare function hasTailwindSourceDirectives(rawSource: string, options?: TailwindDirectiveOptions): boolean;
|
|
11
|
+
export declare function hasTailwindNonRootGenerationDirectives(rawSource: string, options?: TailwindDirectiveOptions): boolean;
|
|
12
|
+
export declare function hasTailwindRootImportDirectives(rawSource: string, options?: TailwindDirectiveOptions): boolean;
|
|
12
13
|
export declare function hasTailwindRootDirectives(rawSource: string, options?: TailwindDirectiveOptions): boolean;
|
|
13
14
|
export declare function hasTailwindApplyDirective(rawSource: string): boolean;
|
|
14
15
|
export declare function resolveCssEntrySource(rawSource: string, base: string, options?: {
|
|
@@ -3,8 +3,10 @@ import type { GeneratorResolvedSource } from './source-resolver';
|
|
|
3
3
|
import type { createWeappTailwindcssGenerator } from '../../../generator';
|
|
4
4
|
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
5
5
|
import type { InternalUserDefinedOptions } from '../../../types';
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function hasMiniProgramTailwindV4PreflightReset(css: string): boolean;
|
|
7
|
+
export declare function finalizeMiniProgramGeneratorCss(css: string, target: string, _majorVersion: number | undefined, cssPreflight: InternalUserDefinedOptions['cssPreflight'], options?: {
|
|
7
8
|
injectPreflight?: boolean;
|
|
9
|
+
styleOptions?: Partial<IStyleHandlerOptions> | undefined;
|
|
8
10
|
}): string;
|
|
9
11
|
export declare function shouldInjectMiniProgramPreflightForGeneratorCss(opts: InternalUserDefinedOptions, options: {
|
|
10
12
|
cssHandlerOptions: IStyleHandlerOptions;
|
|
@@ -15,19 +17,23 @@ export declare function mergeScopedRuntimeWithCurrentRuntime(scopedRuntime: Set<
|
|
|
15
17
|
currentCssCandidates?: string[] | undefined;
|
|
16
18
|
cssHandlerOptions: IStyleHandlerOptions;
|
|
17
19
|
isolateCssSource: boolean;
|
|
20
|
+
majorVersion?: number | undefined;
|
|
18
21
|
matchedCssSourceFile: boolean;
|
|
19
22
|
}): Set<string>;
|
|
20
|
-
export declare function shouldIsolateScopedCssSource(source: GeneratorResolvedSource, sourceEntries: TailwindSourceEntry[] | undefined
|
|
21
|
-
|
|
23
|
+
export declare function shouldIsolateScopedCssSource(_majorVersion: number | undefined, source: GeneratorResolvedSource, sourceEntries: TailwindSourceEntry[] | undefined, options: {
|
|
24
|
+
cssHandlerOptions?: IStyleHandlerOptions | undefined;
|
|
25
|
+
target: string;
|
|
26
|
+
}): boolean;
|
|
27
|
+
export declare function shouldIsolateCurrentTailwindV4CssCandidates(_majorVersion: number | undefined, cssHandlerOptions: IStyleHandlerOptions, options: {
|
|
22
28
|
hasGeneratedCss: boolean;
|
|
23
29
|
hasGeneratedMarkers: boolean;
|
|
24
30
|
rawSource: string;
|
|
25
31
|
}): boolean;
|
|
26
32
|
export declare function shouldScanTailwindV4Sources(majorVersion: number | undefined, target: string, generatorRuntime: Set<string>, isolateCssSource: boolean): boolean;
|
|
27
|
-
export declare function shouldAppendWebBundleCssFallback(target: string,
|
|
33
|
+
export declare function shouldAppendWebBundleCssFallback(target: string, _options: {
|
|
28
34
|
hasSourceDirectives: boolean;
|
|
29
35
|
hasMatchedCssSourceFile: boolean;
|
|
30
|
-
}):
|
|
36
|
+
}): target is "web";
|
|
31
37
|
export declare function isEmptyCssSourceOrderParts(parts: {
|
|
32
38
|
before: string;
|
|
33
39
|
after: string;
|
|
@@ -39,18 +45,29 @@ export declare function splitRawSourceByGeneratedCssOrder(rawSource: string, raw
|
|
|
39
45
|
before: string;
|
|
40
46
|
after: string;
|
|
41
47
|
} | undefined;
|
|
42
|
-
export declare function shouldUseGeneratorForCurrentCss(
|
|
48
|
+
export declare function shouldUseGeneratorForCurrentCss(_majorVersion: number | undefined, cssHandlerOptions: IStyleHandlerOptions, options: {
|
|
49
|
+
forceGenerator?: boolean | undefined;
|
|
43
50
|
hasGeneratedCss: boolean;
|
|
44
51
|
hasGeneratedMarkers: boolean;
|
|
45
52
|
hasSourceDirectives: boolean;
|
|
46
53
|
rawSource: string;
|
|
47
|
-
}): boolean
|
|
54
|
+
}): boolean;
|
|
48
55
|
export declare function hasGeneratorSourceDirectives(source: string, importFallback: boolean): boolean;
|
|
49
56
|
export declare function createRuntimeWithCurrentCssCandidates(runtime: Set<string>, currentCssCandidates: string[], isolateCurrentCssCandidates: boolean): Set<string>;
|
|
50
57
|
export declare function mergeGeneratorResults(generatedResults: GeneratorResult[]): (import("@/generator").TailwindV4GenerateResult & {
|
|
51
|
-
target:
|
|
58
|
+
target: WeappTailwindcssGeneratorTarget;
|
|
52
59
|
rawCss: string;
|
|
53
|
-
}) |
|
|
60
|
+
}) | {
|
|
61
|
+
css: string;
|
|
62
|
+
rawCss: string;
|
|
63
|
+
incrementalCss: string | undefined;
|
|
64
|
+
incrementalRawCss: string | undefined;
|
|
65
|
+
classSet: Set<string>;
|
|
66
|
+
dependencies: string[];
|
|
67
|
+
sources: import("@tailwindcss-mangle/engine").TailwindV4SourcePattern[];
|
|
68
|
+
target: any;
|
|
69
|
+
root: import("@tailwindcss-mangle/engine").TailwindV4CompiledSourceRoot;
|
|
70
|
+
rawCandidates: Set<string>;
|
|
71
|
+
} | undefined;
|
|
54
72
|
type GeneratorResult = Awaited<ReturnType<ReturnType<typeof createWeappTailwindcssGenerator>['generate']>>;
|
|
55
|
-
export declare function isSupportedGeneratorMajorVersion(majorVersion: number | undefined): boolean;
|
|
56
73
|
export {};
|
|
@@ -5,3 +5,6 @@ export declare function splitLocalCssImports(source: string): {
|
|
|
5
5
|
source: string;
|
|
6
6
|
} | undefined;
|
|
7
7
|
export declare function restoreLocalCssImports(css: string, imports: string | undefined): string;
|
|
8
|
+
export declare function rewriteLocalCssImportRequestsForOutput(css: string, options?: {
|
|
9
|
+
styleOutputExtension?: string | undefined;
|
|
10
|
+
}): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function resolveExistingConfigPath(config: string | undefined, configRequest: string | undefined, file: string, sourceOptions: {
|
|
2
|
+
projectRoot?: string | undefined;
|
|
3
|
+
cwd?: string | undefined;
|
|
4
|
+
config?: string | undefined;
|
|
5
|
+
sourceFile?: string | undefined;
|
|
6
|
+
outputRoot?: string | undefined;
|
|
7
|
+
}): string | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SourceStyleMatchOptions } from './types';
|
|
2
|
+
export declare function normalizeCssSourceForCompare(css: string): string;
|
|
3
|
+
export declare function scoreTailwindV4CssSourceFileMatch(file: string, cssSourceFile: string, sourceOptions: SourceStyleMatchOptions): number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SourceSideCssEntrySource } from '../source-files';
|
|
2
|
+
import type { TailwindResolvedSource } from '../../../../generator';
|
|
3
|
+
import type { TailwindSourceEntry } from '../../../../tailwindcss/source-scan';
|
|
4
|
+
export interface GeneratorSourceMetadata {
|
|
5
|
+
isolateCssSource?: boolean | undefined;
|
|
6
|
+
matchedCssSourceFile?: string | undefined;
|
|
7
|
+
sourceEntries?: TailwindSourceEntry[] | undefined;
|
|
8
|
+
sourceBase?: string | undefined;
|
|
9
|
+
sourceCss?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export type GeneratorResolvedSource = TailwindResolvedSource & {
|
|
12
|
+
__weappTailwindcssMeta?: GeneratorSourceMetadata | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare function withGeneratorSourceMetadata(source: TailwindResolvedSource, metadata: GeneratorSourceMetadata): GeneratorResolvedSource;
|
|
15
|
+
export declare function withMatchedSourceSideMetadata(source: TailwindResolvedSource, resolvedEntrySource: SourceSideCssEntrySource): import("@tailwindcss-mangle/engine").TailwindV4ResolvedSource;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { TailwindV4CssSource } from './types';
|
|
3
|
+
export declare function resolvePostcssFromOption(cssHandlerOptions: IStyleHandlerOptions): string | undefined;
|
|
4
|
+
export declare function resolvePostcssSourceFile(cssHandlerOptions: IStyleHandlerOptions): string | undefined;
|
|
5
|
+
export declare function resolveCssHandlerSourceOptions(cssHandlerOptions: IStyleHandlerOptions): {
|
|
6
|
+
outputRoot?: string | undefined;
|
|
7
|
+
sourceFile?: string | undefined;
|
|
8
|
+
sourceCss?: string | undefined;
|
|
9
|
+
cssSources?: TailwindV4CssSource[] | undefined;
|
|
10
|
+
cssEntries?: string[] | undefined;
|
|
11
|
+
} | undefined;
|
|
12
|
+
export declare function resolveCssSourceBase(file: string, cssHandlerOptions: IStyleHandlerOptions): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SourceSideCssEntryOptions } from '../source-files';
|
|
2
|
+
import type { resolveTailwindV4SourceOptionsFromRuntime } from '../../../../generator';
|
|
3
|
+
import type { TailwindSourceEntry } from '../../../../tailwindcss/source-scan';
|
|
4
|
+
import type { InternalUserDefinedOptions } from '../../../../types';
|
|
5
|
+
export interface GeneratorSourceRuntimeState {
|
|
6
|
+
tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
7
|
+
}
|
|
8
|
+
export interface GeneratorSourceSelectionOptions {
|
|
9
|
+
runtime?: Set<string> | undefined;
|
|
10
|
+
getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
|
|
11
|
+
cssEntries?: string[] | undefined;
|
|
12
|
+
cssSources?: TailwindV4CssSource[] | undefined;
|
|
13
|
+
}
|
|
14
|
+
export type TailwindV4SourceOptions = ReturnType<typeof resolveTailwindV4SourceOptionsFromRuntime> & {
|
|
15
|
+
config?: string | undefined;
|
|
16
|
+
outputRoot?: string | undefined;
|
|
17
|
+
sourceFile?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type TailwindV4CssSource = NonNullable<TailwindV4SourceOptions['cssSources']>[number];
|
|
20
|
+
export type TailwindV4CssSourceRef = Pick<TailwindV4CssSource, 'file'>;
|
|
21
|
+
export interface SourceStyleMatchOptions extends SourceSideCssEntryOptions {
|
|
22
|
+
}
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { GeneratorSourceRuntimeState, GeneratorSourceSelectionOptions } from './source-resolver/types';
|
|
2
3
|
import type { NormalizedWeappTailwindcssGeneratorOptions, TailwindResolvedSource } from '../../../generator';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
interface GeneratorSourceSelectionOptions {
|
|
9
|
-
runtime?: Set<string> | undefined;
|
|
10
|
-
getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
|
|
11
|
-
cssEntries?: string[] | undefined;
|
|
12
|
-
}
|
|
13
|
-
export interface GeneratorSourceMetadata {
|
|
14
|
-
matchedCssSourceFile?: string | undefined;
|
|
15
|
-
sourceEntries?: TailwindSourceEntry[] | undefined;
|
|
16
|
-
sourceBase?: string | undefined;
|
|
17
|
-
sourceCss?: string | undefined;
|
|
18
|
-
}
|
|
19
|
-
export type GeneratorResolvedSource = TailwindResolvedSource & {
|
|
20
|
-
__weappTailwindcssMeta?: GeneratorSourceMetadata | undefined;
|
|
21
|
-
};
|
|
22
|
-
export declare function resolveCssSourceBase(file: string, cssHandlerOptions: IStyleHandlerOptions): string;
|
|
23
|
-
export declare function resolveGeneratorSource(majorVersion: number | undefined, runtimeState: GeneratorSourceRuntimeState, rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions, generatorOptions?: NormalizedWeappTailwindcssGeneratorOptions, selectionOptions?: GeneratorSourceSelectionOptions): Promise<import("@/generator").TailwindV3ResolvedSource | import("tailwindcss-patch").TailwindV4ResolvedSource | undefined>;
|
|
4
|
+
export type { GeneratorResolvedSource, GeneratorSourceMetadata } from './source-resolver/metadata';
|
|
5
|
+
export { resolveCssSourceBase } from './source-resolver/postcss-source';
|
|
6
|
+
export type { GeneratorSourceRuntimeState, GeneratorSourceSelectionOptions } from './source-resolver/types';
|
|
7
|
+
export declare function resolveGeneratorSource(_majorVersion: number | undefined, runtimeState: GeneratorSourceRuntimeState, rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions, generatorOptions?: NormalizedWeappTailwindcssGeneratorOptions, selectionOptions?: GeneratorSourceSelectionOptions): Promise<import("@tailwindcss-mangle/engine").TailwindV4ResolvedSource | undefined>;
|
|
24
8
|
export declare function resolveGeneratorSources(majorVersion: number | undefined, runtimeState: GeneratorSourceRuntimeState, rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions, generatorOptions?: NormalizedWeappTailwindcssGeneratorOptions, selectionOptions?: GeneratorSourceSelectionOptions): Promise<TailwindResolvedSource[]>;
|
|
25
|
-
export declare function resolveGeneratorSourceEntries(source: TailwindResolvedSource, runtimeState?: GeneratorSourceRuntimeState): Promise<
|
|
26
|
-
export {};
|
|
9
|
+
export declare function resolveGeneratorSourceEntries(source: TailwindResolvedSource, runtimeState?: GeneratorSourceRuntimeState): Promise<any>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { TailwindV4CssSource } from './source-resolver/types';
|
|
2
3
|
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan';
|
|
3
4
|
import type { InternalUserDefinedOptions } from '../../../types';
|
|
4
5
|
export interface GenerateCssByGeneratorOptions {
|
|
5
6
|
opts: InternalUserDefinedOptions;
|
|
6
7
|
runtimeState: {
|
|
7
|
-
|
|
8
|
+
tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
8
9
|
readyPromise: Promise<void>;
|
|
9
10
|
};
|
|
10
11
|
runtime: Set<string>;
|
|
@@ -12,16 +13,29 @@ export interface GenerateCssByGeneratorOptions {
|
|
|
12
13
|
file: string;
|
|
13
14
|
cssHandlerOptions: IStyleHandlerOptions;
|
|
14
15
|
cssUserHandlerOptions: IStyleHandlerOptions;
|
|
16
|
+
cssSources?: TailwindV4CssSource[] | undefined;
|
|
15
17
|
getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
|
|
18
|
+
sourceCandidates?: Set<string> | undefined;
|
|
16
19
|
styleHandler: InternalUserDefinedOptions['styleHandler'];
|
|
17
20
|
debug: (format: string, ...args: unknown[]) => void;
|
|
21
|
+
userRawSource?: string | undefined;
|
|
22
|
+
userRawSourceProcessed?: boolean | undefined;
|
|
23
|
+
forceGenerator?: boolean | undefined;
|
|
18
24
|
previousCss?: string | undefined;
|
|
19
25
|
deferEmptyScopedCssSource?: boolean | undefined;
|
|
26
|
+
restoreLocalCssImports?: boolean | undefined;
|
|
20
27
|
}
|
|
21
28
|
export interface GenerateCssByGeneratorResult {
|
|
22
29
|
css: string;
|
|
30
|
+
classSet: Set<string>;
|
|
23
31
|
target: string;
|
|
24
32
|
source: 'generator';
|
|
25
33
|
dependencies: string[];
|
|
26
34
|
incremental?: boolean | undefined;
|
|
35
|
+
metadata?: {
|
|
36
|
+
file: string;
|
|
37
|
+
majorVersion?: number | undefined;
|
|
38
|
+
outputFile?: string | undefined;
|
|
39
|
+
rawCss?: string | undefined;
|
|
40
|
+
} | undefined;
|
|
27
41
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
2
|
import type { InternalUserDefinedOptions } from '../../../types';
|
|
3
|
+
export declare function removeTailwindV4GeneratedUserCssArtifacts(source: string): string;
|
|
3
4
|
export declare function removeTailwindV4GeneratorAtRules(source: string): string;
|
|
5
|
+
export declare function isCommentOnlyCss(source: string): boolean;
|
|
6
|
+
export declare function removeMiniProgramHoverSelectors(source: string, enabled?: boolean | undefined): string;
|
|
4
7
|
export declare function stripTailwindSourceMediaFragments(source: string): string;
|
|
5
8
|
export declare function stripUnmatchedTailwindSourceMediaCloseFragments(source: string): string;
|
|
6
9
|
export declare function splitUserCssLayerBlocks(source: string): {
|
|
@@ -13,7 +16,7 @@ export declare function extractGeneratedCssForUserLayerSelectors(css: string, us
|
|
|
13
16
|
rest: string;
|
|
14
17
|
};
|
|
15
18
|
export declare function filterApplyOnlyGeneratedCss(css: string, source: string): string;
|
|
16
|
-
export declare function shouldFilterApplyOnlyGeneratedCss(
|
|
19
|
+
export declare function shouldFilterApplyOnlyGeneratedCss(_majorVersion: number | undefined, target: string, source: string, options: {
|
|
17
20
|
hasGeneratedCss: boolean;
|
|
18
21
|
hasGeneratedMarkers: boolean;
|
|
19
22
|
}): boolean;
|
|
@@ -23,4 +26,5 @@ export declare function transformGeneratorUserCss(source: string, options: {
|
|
|
23
26
|
cssUserHandlerOptions: IStyleHandlerOptions;
|
|
24
27
|
styleHandler: InternalUserDefinedOptions['styleHandler'];
|
|
25
28
|
importFallback: boolean;
|
|
29
|
+
processed?: boolean | undefined;
|
|
26
30
|
}): Promise<string>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GenerateCssByGeneratorOptions } from './types';
|
|
2
2
|
export interface ValidateCandidatesByGeneratorOptions extends Omit<GenerateCssByGeneratorOptions, 'runtime'> {
|
|
3
3
|
candidates: Set<string>;
|
|
4
|
+
skipGenerateFallback?: boolean | undefined;
|
|
4
5
|
}
|
|
5
6
|
export declare function validateCandidatesByGenerator(options: ValidateCandidatesByGeneratorOptions): Promise<Set<string>>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare function runWithConcurrency<T>(factories: Array<() => Promise<T>>, limit?: number): Promise<T[]>;
|
|
2
|
+
export declare function resolveTaskConcurrency(defaultLimit?: number): number;
|
|
2
3
|
export declare function pushConcurrentTaskFactories(queue: Array<Promise<void>>, factories: Array<() => Promise<unknown>>, limit?: number): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GenerateCssByGeneratorOptions, GenerateCssByGeneratorResult } from './generator-css';
|
|
2
|
+
export interface TailwindV4GenerationCoreInput extends GenerateCssByGeneratorOptions {
|
|
3
|
+
outputFile?: string | undefined;
|
|
4
|
+
sourceCandidates?: Set<string> | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface TailwindV4GenerationCoreResult extends GenerateCssByGeneratorResult {
|
|
7
|
+
classSet: Set<string>;
|
|
8
|
+
dependencies: string[];
|
|
9
|
+
metadata: NonNullable<GenerateCssByGeneratorResult['metadata']>;
|
|
10
|
+
}
|
|
11
|
+
export declare function generateTailwindV4Css(options: TailwindV4GenerationCoreInput): Promise<TailwindV4GenerationCoreResult | undefined>;
|
|
@@ -9,7 +9,7 @@ interface RememberedMainCssSource {
|
|
|
9
9
|
interface CssFinalizerContext {
|
|
10
10
|
opts: InternalUserDefinedOptions;
|
|
11
11
|
runtimeState: {
|
|
12
|
-
|
|
12
|
+
tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime'];
|
|
13
13
|
readyPromise: Promise<void>;
|
|
14
14
|
};
|
|
15
15
|
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { RememberedCssSource } from './generate-bundle';
|
|
2
|
+
export declare function normalizeCssSourceIdentity(sourceFile: string): string;
|
|
3
|
+
export declare function shouldCollectTransformedSourceCandidates(id: string): boolean;
|
|
4
|
+
export declare function createViteCssMemory(options: {
|
|
5
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
6
|
+
getSourceCandidateSource: (file: string) => string | undefined;
|
|
7
|
+
}): {
|
|
8
|
+
getKnownSfcSource: (file: string) => string | undefined;
|
|
9
|
+
getRememberedCssSignature: (file: string) => string | undefined;
|
|
10
|
+
getRememberedCssSourceEntry: (file: string) => RememberedCssSource | undefined;
|
|
11
|
+
getRememberedCssSources: () => Map<string, RememberedCssSource>;
|
|
12
|
+
getStats: () => {
|
|
13
|
+
rememberedCssSources: number;
|
|
14
|
+
rememberedCssSourcesRaw: {
|
|
15
|
+
bytes: number;
|
|
16
|
+
mb: number;
|
|
17
|
+
size: number;
|
|
18
|
+
};
|
|
19
|
+
rememberedCssSignatureByFile: number;
|
|
20
|
+
knownSfcSources: number;
|
|
21
|
+
knownSfcSourcesRaw: {
|
|
22
|
+
bytes: number;
|
|
23
|
+
mb: number;
|
|
24
|
+
size: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
rememberCssSource: (entry: RememberedCssSource, cssRuntimeSignature?: string) => void;
|
|
28
|
+
rememberKnownSfcSource: (id: string, code: string) => void;
|
|
29
|
+
refreshRememberedCssSource: (remembered: RememberedCssSource) => Promise<RememberedCssSource | undefined>;
|
|
30
|
+
refreshRememberedCssSourceByCurrentFile: (sourceFile: string) => Promise<void>;
|
|
31
|
+
refreshRememberedCssSourceBySourceFile: (sourceFile: string, rawSource: string) => void;
|
|
32
|
+
setRememberedCssSignature: (file: string, cssRuntimeSignature: string) => void;
|
|
33
|
+
prune: (pruneOptions: {
|
|
34
|
+
activeFiles: Set<string>;
|
|
35
|
+
activeKnownSfcFiles?: Set<string> | undefined;
|
|
36
|
+
}) => void;
|
|
37
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TailwindV4CssSource } from '@tailwindcss-mangle/engine';
|
|
2
|
+
import type { InternalUserDefinedOptions } from '../../../types';
|
|
3
|
+
export interface ConfiguredCssSourceEntry {
|
|
4
|
+
file: string;
|
|
5
|
+
source: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function collectConfiguredTailwindV4CssSources(opts: InternalUserDefinedOptions): TailwindV4CssSource[];
|
|
8
|
+
export declare function collectConfiguredTailwindV4CssSourceEntries(opts: InternalUserDefinedOptions, fallbackBase: string): ConfiguredCssSourceEntry[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OutputAsset } from 'rollup';
|
|
2
|
+
import type { GenerateBundleThis } from './types';
|
|
3
|
+
export declare function createCssAssetEmitter(context: Pick<GenerateBundleThis, 'emitFile'>): (fileName: string, source: string) => OutputAsset;
|
|
4
|
+
export declare function resolveAssetSourceFile(asset: OutputAsset, fallbackFile: string): string;
|
|
@@ -21,5 +21,10 @@ export interface CssHandlerOptionsCache {
|
|
|
21
21
|
getCssHandlerOptions: (file: string) => CssHandlerOptions;
|
|
22
22
|
getCssUserHandlerOptions: (file: string) => CssHandlerOptions;
|
|
23
23
|
}
|
|
24
|
+
export declare function resolveViteCssHandlerExtraOptions(file: string): {
|
|
25
|
+
isMainChunk: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
isMainChunk?: never;
|
|
28
|
+
};
|
|
24
29
|
export declare function createCssHandlerOptionsCache(options: CssHandlerOptionsCacheOptions): CssHandlerOptionsCache;
|
|
25
30
|
export {};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { InternalUserDefinedOptions } from '../../../types';
|
|
2
2
|
export declare const SOURCE_STYLE_OUTPUT_EXT_RE: RegExp;
|
|
3
3
|
export declare const CSS_SOURCE_OUTPUT_EXT_RE: RegExp;
|
|
4
|
-
export declare
|
|
4
|
+
export declare function resolveMiniProgramStyleOutputExtension(options?: {
|
|
5
|
+
cssMatcher?: ((file: string) => boolean) | undefined;
|
|
6
|
+
fallback?: string | undefined;
|
|
7
|
+
files?: Iterable<string> | undefined;
|
|
8
|
+
stem?: string | undefined;
|
|
9
|
+
}): string;
|
|
5
10
|
export declare function resolveReplayCssOutputFile(rootDir: string, file: string): string;
|
|
6
11
|
export declare function resolveReplayCssOutputFileFromSourceRoot(rootDir: string, file: string, sourceRoot: string | undefined): string;
|
|
7
|
-
export declare function resolveViteCssOutputFile(file: string, opts: InternalUserDefinedOptions, isWebGeneratorTarget: boolean, preserveCssExtension?: boolean): string;
|
|
8
|
-
export declare function resolveViteCssPipelineOutputFile(file: string,
|
|
12
|
+
export declare function resolveViteCssOutputFile(file: string, opts: InternalUserDefinedOptions, isWebGeneratorTarget: boolean, preserveCssExtension?: boolean, styleOutputExtension?: string | undefined, styleOutputFiles?: Iterable<string> | undefined): string;
|
|
13
|
+
export declare function resolveViteCssPipelineOutputFile(file: string, opts: Pick<InternalUserDefinedOptions, 'cssMatcher' | 'platform'>, rootDir: string, isWebGeneratorTarget?: boolean, preserveCssExtension?: boolean, sourceRoot?: string | undefined, styleOutputExtension?: string | undefined, styleOutputFiles?: Iterable<string> | undefined): string;
|
|
14
|
+
export declare function resolveViteCssPipelineOutputFileFromSourceFile(sourceFile: string, opts: Pick<InternalUserDefinedOptions, 'cssMatcher' | 'platform'>, rootDir: string, isWebGeneratorTarget?: boolean, preserveCssExtension?: boolean, sourceRoot?: string | undefined, styleOutputExtension?: string | undefined, styleOutputFiles?: Iterable<string> | undefined): string;
|
|
9
15
|
export declare function canProcessViteSourceStyleAsCss(source: string, file: string): boolean;
|
|
10
16
|
export declare function normalizeCssSourceForCompare(css: string): string;
|
|
11
17
|
export declare function stripStyleFileExtension(file: string): string;
|
|
12
|
-
export declare function isAppOriginCssFile(file: string): boolean;
|
|
13
|
-
export declare function isMainAppCssFile(file: string): boolean;
|
|
14
|
-
export declare function isMainStyleEntryCssFile(file: string): boolean;
|
|
15
|
-
export declare function isTailwindEntryCssFile(file: string): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { GenerateBundleContext } from './types';
|
|
3
|
+
export declare function finalizeMiniProgramCssAssets(bundle: Record<string, OutputAsset | OutputChunk>, options: {
|
|
4
|
+
cssMatcher: GenerateBundleContext['opts']['cssMatcher'];
|
|
5
|
+
getCssHandlerOptions: GenerateBundleContext['getCssHandlerOptions'];
|
|
6
|
+
isWebGeneratorTarget: boolean;
|
|
7
|
+
lastCssResultByFile?: Map<string, string> | undefined;
|
|
8
|
+
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
9
|
+
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
10
|
+
styleHandler: GenerateBundleContext['opts']['styleHandler'];
|
|
11
|
+
debug?: GenerateBundleContext['debug'];
|
|
12
|
+
}): Promise<number>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { BundleBuildState, BundleSnapshot } from '../bundle-state';
|
|
3
|
+
import type { BundleMetrics } from './metrics';
|
|
4
|
+
import type { GenerateBundleContext } from './types';
|
|
5
|
+
interface FinalizeGenerateBundleOptions {
|
|
6
|
+
activeProcessCacheKeys: Set<string>;
|
|
7
|
+
activeProcessHashKeys: Set<string | number>;
|
|
8
|
+
activeViteCssCacheFiles: Set<string>;
|
|
9
|
+
bundle: Record<string, OutputAsset | OutputChunk>;
|
|
10
|
+
bundleFiles: string[];
|
|
11
|
+
cache: GenerateBundleContext['opts']['cache'];
|
|
12
|
+
cssTaskFactories: Array<() => Promise<void>>;
|
|
13
|
+
debug: GenerateBundleContext['debug'];
|
|
14
|
+
defaultStyleOutputExtension: string;
|
|
15
|
+
formatIteration: number;
|
|
16
|
+
generatorCandidateSignature: string;
|
|
17
|
+
generatorRuntime: Set<string>;
|
|
18
|
+
getCssHandlerOptions: (file: string) => ReturnType<ReturnType<typeof import('./css-handler-options').createCssHandlerOptionsCache>['getCssHandlerOptions']>;
|
|
19
|
+
getSourceCandidateSourcesForEntries: GenerateBundleContext['getSourceCandidateSourcesForEntries'];
|
|
20
|
+
getSourceCandidatesForEntries: GenerateBundleContext['getSourceCandidatesForEntries'];
|
|
21
|
+
getViteCssCacheStats: GenerateBundleContext['getViteCssCacheStats'];
|
|
22
|
+
getViteProcessedCssAssetResults: GenerateBundleContext['getViteProcessedCssAssetResults'];
|
|
23
|
+
hmrTimingRecorder: GenerateBundleContext['hmrTimingRecorder'];
|
|
24
|
+
hmrTimingStartedAt: number;
|
|
25
|
+
isHarmonyAppStyleTarget: boolean;
|
|
26
|
+
isNativeAppStyleTarget: boolean;
|
|
27
|
+
isViteProcessedCssAsset: GenerateBundleContext['isViteProcessedCssAsset'];
|
|
28
|
+
isWebGeneratorTarget: boolean;
|
|
29
|
+
lastCssResultByFile: Map<string, string>;
|
|
30
|
+
lastCssSourceHashByFile: Map<string, string>;
|
|
31
|
+
linkedByEntry: Map<string, Set<string>> | undefined;
|
|
32
|
+
markCssAssetProcessed: GenerateBundleContext['markCssAssetProcessed'];
|
|
33
|
+
metrics: BundleMetrics;
|
|
34
|
+
onEnd: GenerateBundleContext['opts']['onEnd'];
|
|
35
|
+
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
36
|
+
opts: GenerateBundleContext['opts'];
|
|
37
|
+
outDir: string;
|
|
38
|
+
pendingLinkedUpdates: Array<() => void>;
|
|
39
|
+
pruneViteCssCaches: GenerateBundleContext['pruneViteCssCaches'];
|
|
40
|
+
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
41
|
+
recordTimingDetail: (name: string, startedAt: number) => void;
|
|
42
|
+
recordViteProcessedCssAssetResult: GenerateBundleContext['recordViteProcessedCssAssetResult'];
|
|
43
|
+
rootDir: string;
|
|
44
|
+
runtime: Set<string>;
|
|
45
|
+
runtimeState: GenerateBundleContext['runtimeState'];
|
|
46
|
+
shouldPreserveAppCssExtension: boolean;
|
|
47
|
+
snapshot: BundleSnapshot;
|
|
48
|
+
sourceCandidates: Set<string>;
|
|
49
|
+
sourceRoot: string | undefined;
|
|
50
|
+
state: BundleBuildState;
|
|
51
|
+
styleHandler: GenerateBundleContext['opts']['styleHandler'];
|
|
52
|
+
tasks: Promise<void>[];
|
|
53
|
+
timingDetails: Record<string, number>;
|
|
54
|
+
transformRuntime: Set<string>;
|
|
55
|
+
useIncrementalMode: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare function normalizeTaroRootImportShellAssets(bundle: Record<string, OutputAsset | OutputChunk>, options: Pick<GenerateBundleContext['opts'], 'appType' | 'cssMatcher'> & {
|
|
58
|
+
debug: GenerateBundleContext['debug'];
|
|
59
|
+
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
60
|
+
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
61
|
+
}): number;
|
|
62
|
+
export declare function finalizeGenerateBundle(options: FinalizeGenerateBundleOptions): Promise<void>;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { BundleSnapshot, BundleStateEntry } from '../bundle-state';
|
|
3
|
+
import type { BundleMetrics } from './metrics';
|
|
4
|
+
import type { GenerateBundleContext } from './types';
|
|
5
|
+
import type { CreateJsHandlerOptions, LinkedJsModuleResult } from '../../../types';
|
|
6
|
+
interface ProcessJsBundleEntryOptions {
|
|
7
|
+
applyLinkedUpdates: (linked?: Record<string, LinkedJsModuleResult>) => void;
|
|
8
|
+
bundle: Record<string, OutputAsset | OutputChunk>;
|
|
9
|
+
cache: GenerateBundleContext['opts']['cache'];
|
|
10
|
+
createHandlerOptions: (absoluteFilename: string, extra?: CreateJsHandlerOptions) => CreateJsHandlerOptions;
|
|
11
|
+
debug: GenerateBundleContext['debug'];
|
|
12
|
+
disableJsPrecheck: boolean;
|
|
13
|
+
entry: BundleStateEntry;
|
|
14
|
+
getJsEntry: ReturnType<typeof import('./js-entries').createJsEntryResolver>;
|
|
15
|
+
jsHandler: GenerateBundleContext['opts']['jsHandler'];
|
|
16
|
+
jsTaskFactories: Array<() => Promise<void>>;
|
|
17
|
+
linkedByEntry: Map<string, Set<string>> | undefined;
|
|
18
|
+
metrics: BundleMetrics;
|
|
19
|
+
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
20
|
+
outDir: string;
|
|
21
|
+
processFiles: BundleSnapshot['processFiles'];
|
|
22
|
+
rememberProcessCacheKey: (cacheKey: string, hashKey?: string | number) => void;
|
|
23
|
+
runtimeSignature: string;
|
|
24
|
+
snapshot: BundleSnapshot;
|
|
25
|
+
timeTask: (name: string, task: () => Promise<void>) => Promise<void>;
|
|
26
|
+
transformRuntime: Set<string>;
|
|
27
|
+
uniAppX: GenerateBundleContext['opts']['uniAppX'];
|
|
28
|
+
useIncrementalMode: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function processJsBundleEntry(options: ProcessJsBundleEntryOptions): void;
|
|
31
|
+
export {};
|