weapp-tailwindcss 5.5.6 → 5.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auto-DtU6f3X6.cjs → auto-B1OyRrE8.cjs} +1 -1
- package/dist/{auto-2dg_uhEJ.js → auto-ENr4xzzw.js} +1 -1
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +1 -1
- package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -1
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/css-source-trace.d.ts +2 -5
- package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/framework-css-composition.d.ts +1 -1
- package/dist/bundlers/shared/framework-postcss.d.ts +1 -25
- package/dist/bundlers/shared/framework-user-css.d.ts +1 -4
- package/dist/bundlers/shared/generated-css-marker.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/candidates.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/class-selectors.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/config-directive.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/directives/fallback.d.ts +1 -11
- package/dist/bundlers/shared/generator-css/directives.d.ts +1 -25
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +1 -19
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +1 -23
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +1 -30
- package/dist/bundlers/shared/generator-css/generation-helpers/source-order.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +1 -12
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/markers.d.ts +1 -28
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +1 -8
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +1 -60
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +1 -6
- package/dist/bundlers/shared/generator-css/scoped-rules.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-files.d.ts +1 -21
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +1 -13
- package/dist/bundlers/shared/generator-css/source-resolver/config.d.ts +1 -7
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +1 -33
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -28
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +1 -14
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-source.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +1 -16
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +1 -22
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -7
- package/dist/bundlers/shared/generator-css/types.d.ts +1 -64
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/user-css/at-rules.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/user-css/compile-functions.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +1 -6
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +1 -15
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +1 -13
- package/dist/bundlers/shared/generator-css/user-css/user-layers.d.ts +1 -15
- package/dist/bundlers/shared/generator-css/user-css.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/user-layer-order.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -7
- package/dist/bundlers/shared/generator-css.d.ts +1 -9
- package/dist/bundlers/shared/run-tasks.d.ts +1 -3
- package/dist/bundlers/shared/runtime-class-set.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/collector.d.ts +1 -8
- package/dist/bundlers/shared/source-candidates/scan-root.d.ts +1 -12
- package/dist/bundlers/shared/source-candidates/script.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/snapshot.d.ts +1 -19
- package/dist/bundlers/shared/source-candidates/source-priority.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/store.d.ts +1 -2
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -75
- package/dist/bundlers/shared/source-candidates/views.d.ts +1 -12
- package/dist/bundlers/shared/source-candidates.d.ts +1 -4
- package/dist/bundlers/shared/source-scan/css-entries.d.ts +1 -18
- package/dist/bundlers/shared/source-scan/dependencies.d.ts +1 -2
- package/dist/bundlers/shared/source-scan.d.ts +1 -16
- package/dist/bundlers/shared/static-config-content.d.ts +1 -5
- package/dist/bundlers/shared/style-handler-options.d.ts +1 -7
- package/dist/bundlers/shared/style-requests.d.ts +1 -5
- package/dist/bundlers/shared/v4-generation-core.d.ts +1 -20
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-transform-task.d.ts +2 -2
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +1 -12
- package/dist/bundlers/vite/processed-css-assets/injection-plan.d.ts +1 -4
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +4 -7
- package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +1 -13
- package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +2 -2
- package/dist/bundlers/vite/source-candidates/scan-root.d.ts +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/finalize.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/generated-css.d.ts +2 -7
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +4 -8
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css-markers.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +2 -7
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/watch-dependencies.d.ts +6 -0
- package/dist/cache/index.d.ts +4 -4
- package/dist/cache/source.d.ts +29 -0
- package/dist/{cache-CBJFB1HN.cjs → cache-CzvIGfwS.cjs} +1 -0
- package/dist/compiler/composition.d.ts +1 -1
- package/dist/compiler/runtime-affecting-signature/js.d.ts +1 -0
- package/dist/compiler/semantic-css.d.ts +1 -1
- package/dist/compiler/types.d.ts +1 -1
- package/dist/{compiler-D3GBwxoa.js → compiler-CThodfGH.js} +3098 -3067
- package/dist/{compiler-C8FqI-P3.cjs → compiler-DbwS3329.cjs} +20979 -20870
- package/dist/core/compiler/generation-cache.d.ts +4 -2
- package/dist/core/compiler/types.d.ts +1 -1
- package/dist/core.cjs +7 -7
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -2
- package/dist/css-cleanup-B6FUJC3z.cjs +1 -0
- package/dist/{css-imports-XvtI1zCY.cjs → css-imports-R_RDMjPz.cjs} +7 -21
- package/dist/css-macro/auto.d.ts +1 -1
- package/dist/css-macro/postcss.cjs +1 -1
- package/dist/css-macro.cjs +2 -2
- package/dist/css-macro.js +1 -1
- package/dist/final-css-cleanup-B6FUJC3z.cjs +1 -0
- package/dist/{final-css-cleanup-u_sI2p56.js → final-css-cleanup-BOzhuhGz.js} +3 -2
- package/dist/framework.cjs +1 -1
- package/dist/{v4-generation-core-Cz1D7wm1.cjs → generated-css-marker-B0RyziOH.cjs} +638 -1546
- package/dist/generation/candidates.d.ts +1 -0
- package/dist/generation/class-selectors.d.ts +4 -0
- package/dist/generation/config-directive.d.ts +1 -0
- package/dist/generation/directives/fallback.d.ts +1 -0
- package/dist/generation/directives.d.ts +1 -0
- package/dist/generation/framework-css-composition.d.ts +1 -0
- package/dist/generation/framework-postcss.d.ts +25 -0
- package/dist/generation/framework-user-css.d.ts +5 -0
- package/dist/generation/generation-helpers/preflight.d.ts +19 -0
- package/dist/generation/generation-helpers/results.d.ts +23 -0
- package/dist/generation/generation-helpers/runtime-isolation.d.ts +30 -0
- package/dist/generation/generation-helpers/source-order.d.ts +1 -0
- package/dist/generation/generation-helpers.d.ts +4 -0
- package/dist/generation/index.d.ts +9 -0
- package/dist/generation/legacy-compat.d.ts +12 -0
- package/dist/generation/legacy-selectors.d.ts +1 -0
- package/dist/generation/legacy-units.d.ts +1 -0
- package/dist/generation/local-imports.d.ts +1 -0
- package/dist/generation/markers.d.ts +1 -0
- package/dist/generation/output-import-shell.d.ts +1 -0
- package/dist/generation/pipeline/context.d.ts +60 -0
- package/dist/generation/pipeline/deferred-output.d.ts +3 -0
- package/dist/generation/pipeline/execution.d.ts +3 -0
- package/dist/generation/pipeline/fallback-output.d.ts +3 -0
- package/dist/generation/pipeline/ordered-output.d.ts +3 -0
- package/dist/generation/pipeline/preparation.d.ts +19 -0
- package/dist/generation/pipeline.d.ts +2 -0
- package/dist/generation/result-helpers.d.ts +6 -0
- package/dist/generation/scoped-rules.d.ts +1 -0
- package/dist/generation/service.d.ts +20 -0
- package/dist/generation/source-files.d.ts +21 -0
- package/dist/generation/source-resolver/apply-reference.d.ts +10 -0
- package/dist/generation/source-resolver/config.d.ts +7 -0
- package/dist/generation/source-resolver/configuration.d.ts +33 -0
- package/dist/generation/source-resolver/matching.d.ts +3 -0
- package/dist/generation/source-resolver/metadata.d.ts +28 -0
- package/dist/generation/source-resolver/postcss-source.d.ts +14 -0
- package/dist/generation/source-resolver/resolve-source.d.ts +4 -0
- package/dist/generation/source-resolver/resolve-sources.d.ts +5 -0
- package/dist/generation/source-resolver/single-source.d.ts +16 -0
- package/dist/generation/source-resolver/source-entries.d.ts +3 -0
- package/dist/generation/source-resolver/source-matching.d.ts +5 -0
- package/dist/generation/source-resolver/types.d.ts +22 -0
- package/dist/generation/source-resolver.d.ts +7 -0
- package/dist/generation/style-options.d.ts +8 -0
- package/dist/generation/style-requests.d.ts +5 -0
- package/dist/generation/types.d.ts +65 -0
- package/dist/generation/user-css/apply-only.d.ts +5 -0
- package/dist/generation/user-css/at-rules.d.ts +1 -0
- package/dist/generation/user-css/compile-functions.d.ts +3 -0
- package/dist/generation/user-css/generated-cleanup.d.ts +1 -0
- package/dist/generation/user-css/source-fragments.d.ts +1 -0
- package/dist/generation/user-css/transform.d.ts +1 -0
- package/dist/generation/user-css/user-layers.d.ts +1 -0
- package/dist/generation/user-css.d.ts +5 -0
- package/dist/generation/user-layer-order.d.ts +1 -0
- package/dist/generation/validate.d.ts +7 -0
- package/dist/generator-CxauQbx3.cjs +1868 -0
- package/dist/generator-oKZ5mCJ5.js +1637 -0
- package/dist/generator.cjs +10 -4
- package/dist/generator.js +1 -1
- package/dist/{gulp-BExe5RBF.cjs → gulp-CngHA9cU.cjs} +27 -26
- package/dist/{gulp-BhkIIk7J.js → gulp-DhddVxGA.js} +6 -5
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-CoiJIqDu.cjs → hmr-timing-Dc4c1VRg.cjs} +13 -13
- package/dist/{hmr-timing-B9Yt86-U.js → hmr-timing-xPpat-km.js} +518 -1360
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/js/ModuleGraph.d.ts +3 -1
- package/dist/js/babel/analyze.d.ts +6 -0
- package/dist/js/babel.d.ts +1 -2
- package/dist/js/fast-path/analysis.d.ts +14 -0
- package/dist/js/fast-path/oxc.d.ts +1 -1
- package/dist/js/oxc-parser.d.ts +4 -0
- package/dist/pipeline-helpers-EUud9R2K.cjs +516 -0
- package/dist/postcss-html-transform.cjs +1 -1
- package/dist/postcss.cjs +3 -2
- package/dist/postcss.d.ts +1 -1
- package/dist/postcss.js +3 -2
- package/dist/presets.cjs +3 -3
- package/dist/presets.js +2 -2
- package/dist/project-sources/candidates/collector.d.ts +8 -0
- package/dist/project-sources/candidates/scan-root.d.ts +12 -0
- package/dist/project-sources/candidates/script.d.ts +1 -0
- package/dist/project-sources/candidates/snapshot.d.ts +19 -0
- package/dist/project-sources/candidates/source-priority.d.ts +1 -0
- package/dist/project-sources/candidates/store.d.ts +2 -0
- package/dist/project-sources/candidates/types-and-cache.d.ts +75 -0
- package/dist/project-sources/candidates/views.d.ts +12 -0
- package/dist/project-sources/candidates.d.ts +4 -0
- package/dist/project-sources/css-entries.d.ts +18 -0
- package/dist/project-sources/dependencies.d.ts +2 -0
- package/dist/project-sources/index.d.ts +16 -0
- package/dist/project-sources/static-config-content.d.ts +5 -0
- package/dist/reset.cjs +1 -1
- package/dist/{rolldown-runtime-Ctb5zv51.cjs → rolldown-runtime-fg3euq-1.cjs} +7 -0
- package/dist/rspack.cjs +4 -4
- package/dist/rspack.js +2 -2
- package/dist/{runtime-state-XYSycuGu.cjs → runtime-state-BOzuVoKl.cjs} +1 -1
- package/dist/{scoped-generator-B6Y1bxzM.js → scoped-generator-DlQrVbuC.js} +7 -6
- package/dist/{scoped-generator-BUBls_oM.cjs → scoped-generator-lbTwL6mD.cjs} +9 -9
- package/dist/{source-candidate-scan-signature-DNuGKTqf.js → source-candidate-scan-signature-BjVQYL-C.js} +3 -3
- package/dist/{source-candidate-scan-signature-BtJZp28T.cjs → source-candidate-scan-signature-nG-rg809.cjs} +4 -4
- package/dist/style-injector/internal.d.ts +35 -35
- package/dist/style-injector/options.d.ts +1 -1
- package/dist/tailwindcss/miniprogram.d.ts +1 -1
- package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -1
- package/dist/tailwindcss/source-scan/inline-source.d.ts +1 -7
- package/dist/tailwindcss/source-scan.d.ts +3 -32
- package/dist/tailwindcss/v4/css-sources.d.ts +1 -1
- package/dist/tailwindcss/v4/preflight.d.ts +1 -3
- package/dist/tailwindcss/v4/rpx-theme-warning.d.ts +4 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +2 -3
- package/dist/tailwindcss/v4-engine/generator/native-session.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +1 -6
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +5 -2
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +3 -7
- package/dist/tailwindcss/v4-engine/source.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/types.d.ts +3 -1
- package/dist/{tailwindcss-CBYjzRmV.cjs → tailwindcss-U3KIUegn.cjs} +65 -264
- package/dist/{tailwindcss-B_4E52WF.js → tailwindcss-kSd0ykiX.js} +71 -243
- package/dist/{transform-CkEnJYIP.js → transform-BAon9ykq.js} +25 -16
- package/dist/{transform-FkqbTBJR.cjs → transform-DVg4q8hh.cjs} +32 -23
- package/dist/types/index.d.ts +2 -2
- package/dist/types/user-defined-options/general.d.ts +1 -1
- package/dist/uni-app-x/border-preflight.d.ts +1 -1
- package/dist/uni-app-x/component-local-style.d.ts +3 -1
- package/dist/uni-app-x/vite/style-result.d.ts +1 -1
- package/dist/utils/run-tasks.d.ts +3 -0
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-lP35OguX.js → vite-D-RGkmOE.js} +62 -674
- package/dist/{vite-DxuKPZlp.cjs → vite-IX83wh_L.cjs} +217 -828
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-GbC14Rlt.cjs → watch-dependencies-C1so1whD.cjs} +14 -1
- package/dist/weapp-tw-css-generation-loader.cjs +4 -3
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +33 -28
- package/dist/weapp-tw-runtime-classset-loader.cjs +5 -18
- package/dist/{web-Dfz_jpNj.js → web--kA4HUTm.js} +16 -115
- package/dist/{web-DhDxhlkq.cjs → web-DHfZ_KC9.cjs} +83 -192
- package/dist/{webpack-R2Sbggiy.cjs → webpack-BetjemzT.cjs} +87 -87
- package/dist/{webpack-D6jp1o3m.js → webpack-Bhkd27Rs.js} +28 -441
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +12 -7
- package/dist/final-css-cleanup-CDTmVAye.cjs +0 -1
- package/dist/generator-Bvr4WmuF.cjs +0 -3891
- package/dist/generator-C0BJjyLM.js +0 -3343
- package/dist/pipeline-helpers-BOjTEmMi.cjs +0 -971
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
import type { TailwindV4CssSource } from '@tailwindcss
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
base: string;
|
|
5
|
-
pattern: string;
|
|
6
|
-
negated: boolean;
|
|
7
|
-
}
|
|
8
|
-
export type { TailwindInlineSourceCandidates } from './source-scan/inline-source.js';
|
|
9
|
-
export { collectCssInlineSourceCandidates, expandInlineSourceCandidatePattern } from './source-scan/inline-source.js';
|
|
10
|
-
export declare const DEFAULT_SOURCE_SCAN_EXTENSIONS: string[];
|
|
11
|
-
export declare const FULL_SOURCE_SCAN_EXTENSIONS: string[];
|
|
12
|
-
export declare function createSourceScanPattern(extensions?: string[]): string;
|
|
13
|
-
export declare const FULL_SOURCE_SCAN_PATTERN: string;
|
|
14
|
-
export declare const FULL_SOURCE_SCAN_EXTENSION_RE: RegExp;
|
|
15
|
-
export declare function toPosixPath(value: string): string;
|
|
16
|
-
export declare function resolveSourceScanPath(value: string): string;
|
|
17
|
-
export declare function isFileExcludedByTailwindSourceEntries(file: string, entries: TailwindSourceEntry[] | undefined): boolean;
|
|
18
|
-
export declare function isFileMatchedByTailwindSourceEntries(file: string, entries: TailwindSourceEntry[] | undefined): boolean;
|
|
19
|
-
export declare function createTailwindSourceEntryMatcher(entries: TailwindSourceEntry[] | undefined): ((file: string) => boolean) | undefined;
|
|
1
|
+
import type { TailwindV4CssSource } from '@weapp-tailwindcss/engine';
|
|
2
|
+
export { collectCssInlineSourceCandidates, expandInlineSourceCandidatePattern, expandTailwindSourceEntries, parseConfigParam, parseSourceFileParam, resolveCssSourceEntries, type TailwindInlineSourceCandidates } from '@weapp-tailwindcss/postcss/syntax';
|
|
3
|
+
export * from '@weapp-tailwindcss/source-scan';
|
|
20
4
|
export declare function resolveTailwindV4CssSourceBase(source: Pick<TailwindV4CssSource, 'base' | 'file'>, fallbackBase: string): string;
|
|
21
|
-
export declare function parseConfigParam(params: string): string | undefined;
|
|
22
|
-
export declare function normalizeLegacyContentEntries(content: unknown, base: string, options?: {
|
|
23
|
-
relativeBase?: string | undefined;
|
|
24
|
-
}): TailwindSourceEntry[];
|
|
25
|
-
export declare function resolveTailwindSourceEntry(sourcePath: string, base: string, negated: boolean, defaultPattern?: string): Promise<TailwindSourceEntry>;
|
|
26
|
-
export declare function parseSourceFileParam(params: string): {
|
|
27
|
-
negated: boolean;
|
|
28
|
-
sourcePath: string;
|
|
29
|
-
} | undefined;
|
|
30
|
-
export declare function resolveCssSourceEntries(root: Root, base: string, defaultPattern?: string): Promise<TailwindSourceEntry[]>;
|
|
31
|
-
export declare function expandTailwindSourceEntries(entries: TailwindSourceEntry[], options?: {
|
|
32
|
-
ignore?: string[];
|
|
33
|
-
}): Promise<string[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TailwindV4CssSource } from '@tailwindcss
|
|
1
|
+
import type { TailwindV4CssSource } from '@weapp-tailwindcss/engine';
|
|
2
2
|
import type { UserDefinedOptions } from '../../types/index.js';
|
|
3
3
|
export declare function hasCssSourcesValue(value: unknown): boolean;
|
|
4
4
|
export declare function isTailwindV4CssSourceRoot(source: unknown): source is TailwindV4CssSource;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare function isTailwindV4PreflightImportParam(params: string): boolean;
|
|
3
|
-
export declare function includesTailwindV4PreflightDirective(css: string): boolean;
|
|
1
|
+
export { includesTailwindV4PreflightDirective, isTailwindV4CssImportParam, isTailwindV4PreflightImportParam } from '@weapp-tailwindcss/postcss/transform';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { InternalUserDefinedOptions } from '../../types/index.js';
|
|
2
|
+
export declare function shouldCheckRpxThemeRisk(session: object, target: string, opts: Pick<InternalUserDefinedOptions, 'logLevel' | 'platform' | 'cssOptions' | 'appType'>, platform?: string): boolean;
|
|
3
|
+
export declare function collectRpxThemeRiskSources(sources: Iterable<string>): string[];
|
|
4
|
+
export declare function warnRpxThemeRisk(session: object, variables: readonly string[], outputCss: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { loadTailwindV4DesignSystem, resolveValidTailwindV4Candidates, } from '@tailwindcss
|
|
1
|
+
export { loadTailwindV4DesignSystem, resolveValidTailwindV4Candidates, } from '@weapp-tailwindcss/engine';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
2
|
import type { TailwindV4DesignSystem, TailwindV4Engine, TailwindV4GenerateOptions, TailwindV4GenerateTarget, TailwindV4ResolvedSource, TailwindV4SourcePattern } from '../types.js';
|
|
3
|
+
import { collectCustomPropertyValues, mergeCustomPropertyValues } from '@weapp-tailwindcss/postcss/transform';
|
|
3
4
|
import { LRUCache } from 'lru-cache';
|
|
4
5
|
export declare const INCREMENTAL_GENERATE_CACHE_MAX = 8;
|
|
5
6
|
export declare const INCREMENTAL_GENERATE_TASK_CACHE_MAX = 32;
|
|
@@ -37,8 +38,7 @@ export declare function runIncrementalGenerateTask(cacheKey: string, requestedCa
|
|
|
37
38
|
export declare function resolveTargetCandidates(candidates: Iterable<string> | undefined, target: TailwindV4GenerateTarget): Set<string>;
|
|
38
39
|
export declare function createIncrementalStyleOptions(styleOptions: Partial<IStyleHandlerOptions> | undefined): Partial<IStyleHandlerOptions>;
|
|
39
40
|
export declare function resolveStyleOptions(source: TailwindV4ResolvedSource, options: Partial<IStyleHandlerOptions> | undefined): Partial<IStyleHandlerOptions> | undefined;
|
|
40
|
-
export
|
|
41
|
-
export declare function mergeCustomPropertyValues(target: Map<string, string>, css: string): void;
|
|
41
|
+
export { collectCustomPropertyValues, mergeCustomPropertyValues };
|
|
42
42
|
export declare function summarizeIncrementalCacheKey(key: string): {
|
|
43
43
|
keyHash: string;
|
|
44
44
|
keyBytes: number;
|
|
@@ -49,4 +49,3 @@ export declare function normalizeTargetRpxLengthCandidates(candidates: Iterable<
|
|
|
49
49
|
candidates: Set<string>;
|
|
50
50
|
restoreCandidates: Map<string, string>;
|
|
51
51
|
};
|
|
52
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GenerationRequest, SourceEntry, TailwindGenerationArtifact, TailwindGenerationSession, TailwindV4CandidateSource, TailwindV4ResolvedSource } from '@tailwindcss
|
|
1
|
+
import type { GenerationRequest, SourceEntry, TailwindGenerationArtifact, TailwindGenerationSession, TailwindV4CandidateSource, TailwindV4ResolvedSource } from '@weapp-tailwindcss/engine';
|
|
2
2
|
import type { TailwindV4GenerateTarget } from '../types.js';
|
|
3
3
|
type CreateTailwindGenerationSession = (source: TailwindV4ResolvedSource) => TailwindGenerationSession;
|
|
4
4
|
export declare class TailwindV4NativeSessionPool {
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
candidates: Set<string>;
|
|
3
|
-
restoreCandidates: Map<string, string>;
|
|
4
|
-
};
|
|
5
|
-
export declare function restoreRpxLengthCandidates(candidates: Iterable<string>, restoreCandidates: ReadonlyMap<string, string>): Set<string>;
|
|
6
|
-
export declare function restoreRpxLengthCssSelectors(css: string, restoreCandidates: ReadonlyMap<string, string>): string;
|
|
1
|
+
export { normalizeRpxLengthCandidates, restoreRpxLengthCandidates, restoreRpxLengthCssSelectors } from '@weapp-tailwindcss/postcss/transform';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { TailwindV4GenerateOptions, TailwindV4ResolvedSource } from '../types.js';
|
|
2
|
-
export declare function resolveScanSources(source: TailwindV4ResolvedSource, scanSources: TailwindV4GenerateOptions['scanSources']): Promise<
|
|
3
|
-
export declare function resolveCompiledSourceRoot(source: Pick<TailwindV4ResolvedSource, 'base' | 'css'>):
|
|
2
|
+
export declare function resolveScanSources(source: TailwindV4ResolvedSource, scanSources: TailwindV4GenerateOptions['scanSources']): Promise<false | import("@weapp-tailwindcss/engine").TailwindV4SourcePattern[] | undefined>;
|
|
3
|
+
export declare function resolveCompiledSourceRoot(source: Pick<TailwindV4ResolvedSource, 'base' | 'css'>): "none" | {
|
|
4
|
+
base: string;
|
|
5
|
+
pattern: string;
|
|
6
|
+
} | null;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
2
|
import type { TailwindV4GenerateTarget } from './types.js';
|
|
3
3
|
import type { AppType } from '../../types/index.js';
|
|
4
|
-
|
|
4
|
+
export { normalizeTailwindV4GeneratedUrlValues, transformTailwindV4CssToWeapp, transformTailwindV4WebRpxCss, } from '@weapp-tailwindcss/postcss/transform';
|
|
5
|
+
export declare function transformTailwindV4CssByTarget(css: string, target: TailwindV4GenerateTarget, options?: Partial<IStyleHandlerOptions> & {
|
|
5
6
|
appType?: AppType | undefined;
|
|
6
|
-
}
|
|
7
|
-
export declare function normalizeTailwindV4GeneratedUrlValues(css: string): string;
|
|
8
|
-
export declare function transformTailwindV4CssToWeapp(css: string, options?: Partial<IStyleHandlerOptions>): Promise<string>;
|
|
9
|
-
export declare function transformTailwindV4WebRpxCss(css: string): string;
|
|
10
|
-
export declare function transformTailwindV4CssByTarget(css: string, target: TailwindV4GenerateTarget, options?: TailwindV4TargetStyleOptions): Promise<string>;
|
|
11
|
-
export {};
|
|
7
|
+
}): Promise<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TailwindV4ResolvedSource, TailwindV4SourceOptions, TailwindV4SourceOptionsWithSources } from './types.js';
|
|
2
2
|
import type { TailwindcssRuntimeLike } from '../../types/index.js';
|
|
3
|
-
export declare function normalizeTailwindV4SourceOptions(options: TailwindV4SourceOptions | undefined): import("@tailwindcss
|
|
3
|
+
export declare function normalizeTailwindV4SourceOptions(options: TailwindV4SourceOptions | undefined): import("@weapp-tailwindcss/engine").TailwindV4SourceOptions | undefined;
|
|
4
4
|
export declare function resolveTailwindV4SourceOptionsFromRuntime(runtime: TailwindcssRuntimeLike): TailwindV4SourceOptionsWithSources;
|
|
5
5
|
export declare function resolveTailwindV4Source(options?: TailwindV4SourceOptions): Promise<TailwindV4ResolvedSource>;
|
|
6
6
|
export declare function resolveTailwindV4SourceFromRuntimeOptions(options?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TailwindV4Engine as EngineTailwindV4Engine, TailwindV4GenerateOptions as EngineTailwindV4GenerateOptions, TailwindV4GenerateResult as EngineTailwindV4GenerateResult, TailwindV4ResolvedSource as EngineTailwindV4ResolvedSource, TailwindV4SourceOptions as EngineTailwindV4SourceOptions, TailwindV4CandidateSource, TailwindV4DesignSystem } from '@tailwindcss
|
|
1
|
+
import type { TailwindV4Engine as EngineTailwindV4Engine, TailwindV4GenerateOptions as EngineTailwindV4GenerateOptions, TailwindV4GenerateResult as EngineTailwindV4GenerateResult, TailwindV4ResolvedSource as EngineTailwindV4ResolvedSource, TailwindV4SourceOptions as EngineTailwindV4SourceOptions, TailwindV4CandidateSource, TailwindV4DesignSystem } from '@weapp-tailwindcss/engine';
|
|
2
2
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
3
3
|
export type TailwindV4GenerateTarget = 'weapp' | 'web';
|
|
4
4
|
export interface TailwindV4SourcePattern {
|
|
@@ -10,12 +10,14 @@ type TailwindV4EngineGenerateOptions = Omit<EngineTailwindV4GenerateOptions, 'ta
|
|
|
10
10
|
export type TailwindV4SourceOptions = EngineTailwindV4SourceOptions;
|
|
11
11
|
export type TailwindV4CssSource = NonNullable<TailwindV4SourceOptions['cssSources']>[number];
|
|
12
12
|
export interface TailwindV4ResolvedSource extends EngineTailwindV4ResolvedSource {
|
|
13
|
+
rpxThemeVariables?: string[] | undefined;
|
|
13
14
|
cwd?: string | undefined;
|
|
14
15
|
projectRoot: string;
|
|
15
16
|
cssSources?: TailwindV4CssSource[] | undefined;
|
|
16
17
|
sources?: TailwindV4SourcePattern[] | undefined;
|
|
17
18
|
}
|
|
18
19
|
export interface TailwindV4GenerateOptions extends TailwindV4EngineGenerateOptions {
|
|
20
|
+
scanMode?: 'compiled' | undefined;
|
|
19
21
|
incrementalCache?: boolean | undefined;
|
|
20
22
|
bareArbitraryValues?: EngineTailwindV4GenerateOptions['bareArbitraryValues'] | undefined;
|
|
21
23
|
target?: TailwindV4GenerateTarget | undefined;
|
|
@@ -1,179 +1,40 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const require_generator = require("./generator-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-fg3euq-1.cjs");
|
|
2
|
+
const require_generator = require("./generator-CxauQbx3.cjs");
|
|
3
3
|
require("./utils-CuKLf1Zv.cjs");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_path = require("node:path");
|
|
6
6
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
7
7
|
let node_process = require("node:process");
|
|
8
8
|
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
9
|
-
let
|
|
10
|
-
let
|
|
9
|
+
let _weapp_tailwindcss_engine = require("@weapp-tailwindcss/engine");
|
|
10
|
+
let _weapp_tailwindcss_postcss_transform = require("@weapp-tailwindcss/postcss/transform");
|
|
11
11
|
let node_module = require("node:module");
|
|
12
|
-
let node_fs_promises = require("node:fs/promises");
|
|
13
12
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
13
|
+
let _weapp_tailwindcss_postcss_syntax = require("@weapp-tailwindcss/postcss/syntax");
|
|
14
|
+
let node_fs_promises = require("node:fs/promises");
|
|
15
|
+
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
14
16
|
let fast_glob = require("fast-glob");
|
|
15
17
|
fast_glob = require_rolldown_runtime.__toESM(fast_glob, 1);
|
|
16
18
|
let tailwindcss_config = require("tailwindcss-config");
|
|
17
|
-
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
18
19
|
let node_url = require("node:url");
|
|
19
|
-
//#region src/tailwindcss/source-scan
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if (char === "\"" || char === "'") {
|
|
37
|
-
quote = char;
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
if (char === "(") {
|
|
41
|
-
stack.push(")");
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (char === "[") {
|
|
45
|
-
stack.push("]");
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
if (char === "{") {
|
|
49
|
-
stack.push("}");
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
if (stack.length > 0 && char === stack[stack.length - 1]) {
|
|
53
|
-
stack.pop();
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
if (stack.length === 0 && char === separator) {
|
|
57
|
-
const part = input.slice(lastPos, index);
|
|
58
|
-
if (part || options.keepEmpty) parts.push(part);
|
|
59
|
-
lastPos = index + 1;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const part = input.slice(lastPos);
|
|
63
|
-
if (part || options.keepEmpty) parts.push(part);
|
|
64
|
-
return parts;
|
|
65
|
-
}
|
|
66
|
-
function isSequence(value) {
|
|
67
|
-
return NUMERICAL_RANGE_RE.test(value);
|
|
68
|
-
}
|
|
69
|
-
function expandSequence(value) {
|
|
70
|
-
const match = value.match(NUMERICAL_RANGE_RE);
|
|
71
|
-
if (!match) return [value];
|
|
72
|
-
const [, start, end, stepValue] = match;
|
|
73
|
-
if (start === void 0 || end === void 0) return [value];
|
|
74
|
-
let step = stepValue ? Number.parseInt(stepValue, 10) : void 0;
|
|
75
|
-
const startNumber = Number.parseInt(start, 10);
|
|
76
|
-
const endNumber = Number.parseInt(end, 10);
|
|
77
|
-
const increasing = startNumber < endNumber;
|
|
78
|
-
if (step === void 0) step = increasing ? 1 : -1;
|
|
79
|
-
if (step === 0) return [];
|
|
80
|
-
if (increasing && step < 0) step = -step;
|
|
81
|
-
if (!increasing && step > 0) step = -step;
|
|
82
|
-
const result = [];
|
|
83
|
-
for (let value = startNumber; increasing ? value <= endNumber : value >= endNumber; value += step) result.push(String(value));
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
function expandInlineSourceCandidatePattern(pattern) {
|
|
87
|
-
const index = pattern.indexOf("{");
|
|
88
|
-
if (index === -1) return [pattern];
|
|
89
|
-
const prefix = pattern.slice(0, index);
|
|
90
|
-
const rest = pattern.slice(index);
|
|
91
|
-
let depth = 0;
|
|
92
|
-
let endIndex = -1;
|
|
93
|
-
for (let index = 0; index < rest.length; index++) {
|
|
94
|
-
const char = rest[index];
|
|
95
|
-
if (char === "{") depth += 1;
|
|
96
|
-
else if (char === "}") {
|
|
97
|
-
depth -= 1;
|
|
98
|
-
if (depth === 0) {
|
|
99
|
-
endIndex = index;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (endIndex === -1) return [pattern];
|
|
105
|
-
const inner = rest.slice(1, endIndex);
|
|
106
|
-
const suffix = rest.slice(endIndex + 1);
|
|
107
|
-
const parts = (isSequence(inner) ? expandSequence(inner) : segmentTopLevel(inner, ",", { keepEmpty: true })).flatMap((part) => expandInlineSourceCandidatePattern(part));
|
|
108
|
-
return expandInlineSourceCandidatePattern(suffix).flatMap((suffix) => parts.map((part) => `${prefix}${part}${suffix}`));
|
|
109
|
-
}
|
|
110
|
-
function parseSourceInlineParam(params) {
|
|
111
|
-
let value = params.trim();
|
|
112
|
-
const negated = value.startsWith("not ");
|
|
113
|
-
if (negated) value = value.slice(4).trim();
|
|
114
|
-
if (!value.startsWith("inline(") || !value.endsWith(")")) return;
|
|
115
|
-
const inlineValue = value.slice(7, -1).trim();
|
|
116
|
-
const match = /^(['"])([\s\S]*)\1$/.exec(inlineValue);
|
|
117
|
-
if (!match) return;
|
|
118
|
-
const source = match[2];
|
|
119
|
-
if (source === void 0) return;
|
|
120
|
-
return {
|
|
121
|
-
negated,
|
|
122
|
-
source
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function collectCssInlineSourceCandidates(root) {
|
|
126
|
-
const included = /* @__PURE__ */ new Set();
|
|
127
|
-
const excluded = /* @__PURE__ */ new Set();
|
|
128
|
-
root.walkAtRules("source", (rule) => {
|
|
129
|
-
const parsed = parseSourceInlineParam(rule.params);
|
|
130
|
-
if (!parsed) return;
|
|
131
|
-
const target = parsed.negated ? excluded : included;
|
|
132
|
-
for (const source of segmentTopLevel(parsed.source, " ")) {
|
|
133
|
-
const trimmed = source.trim();
|
|
134
|
-
if (!trimmed) continue;
|
|
135
|
-
for (const candidate of expandInlineSourceCandidatePattern(trimmed)) {
|
|
136
|
-
const normalized = candidate.trim();
|
|
137
|
-
if (normalized) target.add(normalized);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
for (const candidate of excluded) included.delete(candidate);
|
|
142
|
-
return {
|
|
143
|
-
included,
|
|
144
|
-
excluded
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region src/tailwindcss/v4/preflight.ts
|
|
149
|
-
function normalizeTailwindImportSpecifier(params) {
|
|
150
|
-
return (0, _weapp_tailwindcss_postcss.parseCssImportSpecifier)(params)?.specifier.replaceAll("\\", "/");
|
|
151
|
-
}
|
|
152
|
-
function isTailwindV4CssImportParam(params) {
|
|
153
|
-
const specifier = normalizeTailwindImportSpecifier(params);
|
|
154
|
-
return specifier === "tailwindcss" || specifier === "tailwindcss4" || specifier?.startsWith("tailwindcss/") === true || specifier?.startsWith("tailwindcss4/") === true || specifier?.endsWith("/tailwindcss/index.css") === true;
|
|
155
|
-
}
|
|
156
|
-
function isTailwindV4PreflightImportParam(params) {
|
|
157
|
-
const specifier = normalizeTailwindImportSpecifier(params);
|
|
158
|
-
return specifier === "tailwindcss" || specifier === "tailwindcss4" || specifier === "tailwindcss/preflight" || specifier === "tailwindcss/preflight.css" || specifier === "tailwindcss4/preflight" || specifier === "tailwindcss4/preflight.css" || specifier?.endsWith("/tailwindcss/index.css") === true || specifier?.endsWith("/tailwindcss/preflight.css") === true;
|
|
159
|
-
}
|
|
160
|
-
function includesTailwindV4PreflightDirective(css) {
|
|
161
|
-
try {
|
|
162
|
-
const root = _weapp_tailwindcss_postcss.postcss.parse(css);
|
|
163
|
-
let includesPreflight = false;
|
|
164
|
-
root.walkAtRules("import", (rule) => {
|
|
165
|
-
includesPreflight || (includesPreflight = isTailwindV4PreflightImportParam(rule.params));
|
|
166
|
-
});
|
|
167
|
-
root.walkAtRules("tailwind", (rule) => {
|
|
168
|
-
includesPreflight || (includesPreflight = rule.params.trim() === "base");
|
|
169
|
-
});
|
|
170
|
-
return includesPreflight;
|
|
171
|
-
} catch {
|
|
172
|
-
return /@import\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/(?:preflight(?:\.css)?|index\.css))?["')\s;]/.test(css) || /@tailwind\s+base\b/.test(css);
|
|
173
|
-
}
|
|
20
|
+
//#region src/tailwindcss/source-scan.ts
|
|
21
|
+
var source_scan_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
22
|
+
collectCssInlineSourceCandidates: () => _weapp_tailwindcss_postcss_syntax.collectCssInlineSourceCandidates,
|
|
23
|
+
expandInlineSourceCandidatePattern: () => _weapp_tailwindcss_postcss_syntax.expandInlineSourceCandidatePattern,
|
|
24
|
+
expandTailwindSourceEntries: () => _weapp_tailwindcss_postcss_syntax.expandTailwindSourceEntries,
|
|
25
|
+
parseConfigParam: () => _weapp_tailwindcss_postcss_syntax.parseConfigParam,
|
|
26
|
+
parseSourceFileParam: () => _weapp_tailwindcss_postcss_syntax.parseSourceFileParam,
|
|
27
|
+
resolveCssSourceEntries: () => _weapp_tailwindcss_postcss_syntax.resolveCssSourceEntries,
|
|
28
|
+
resolveTailwindV4CssSourceBase: () => resolveTailwindV4CssSourceBase
|
|
29
|
+
});
|
|
30
|
+
require_rolldown_runtime.__reExport(source_scan_exports, require("@weapp-tailwindcss/source-scan"));
|
|
31
|
+
function resolveTailwindV4CssSourceBase(source, fallbackBase) {
|
|
32
|
+
if (typeof source.base === "string" && source.base.length > 0) return source.base;
|
|
33
|
+
if (typeof source.file === "string" && source.file.length > 0) return node_path.default.dirname(source.file);
|
|
34
|
+
return fallbackBase;
|
|
174
35
|
}
|
|
175
36
|
//#endregion
|
|
176
|
-
//#region src/
|
|
37
|
+
//#region src/project-sources/static-config-content.ts
|
|
177
38
|
function skipWhitespaceAndComments(source, start) {
|
|
178
39
|
let index = start;
|
|
179
40
|
while (index < source.length) {
|
|
@@ -343,18 +204,10 @@ function readStaticConfigContent(configPath) {
|
|
|
343
204
|
return parseStaticContentValue(source, contentProperty.start)?.value;
|
|
344
205
|
}
|
|
345
206
|
//#endregion
|
|
346
|
-
//#region src/
|
|
347
|
-
const SOURCE_CANDIDATE_PATTERN =
|
|
207
|
+
//#region src/project-sources/css-entries.ts
|
|
208
|
+
const SOURCE_CANDIDATE_PATTERN = source_scan_exports.FULL_SOURCE_SCAN_PATTERN;
|
|
348
209
|
const TAILWIND_CSS_ENTRY_PATTERN = "**/*.css";
|
|
349
210
|
const tailwindV4CssEntriesCache = /* @__PURE__ */ new Map();
|
|
350
|
-
function parseImportSourceParam(params) {
|
|
351
|
-
const match = /\bsource\(\s*(none|(['"])(.*?)\2)\s*\)/.exec(params);
|
|
352
|
-
if (!match) return;
|
|
353
|
-
return {
|
|
354
|
-
none: match[1] === "none",
|
|
355
|
-
sourcePath: match[3]
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
211
|
function resolveSourceBase(base, sourcePath) {
|
|
359
212
|
return node_path.default.isAbsolute(sourcePath) ? sourcePath : node_path.default.resolve(base, sourcePath);
|
|
360
213
|
}
|
|
@@ -369,9 +222,9 @@ function createCssEntriesCacheKey(css, base, dependencies) {
|
|
|
369
222
|
dependencies
|
|
370
223
|
});
|
|
371
224
|
}
|
|
372
|
-
|
|
225
|
+
function statConfigDependency(file) {
|
|
373
226
|
try {
|
|
374
|
-
const stats =
|
|
227
|
+
const stats = (0, node_fs.statSync)(file);
|
|
375
228
|
return {
|
|
376
229
|
file,
|
|
377
230
|
mtimeMs: stats.mtimeMs,
|
|
@@ -385,13 +238,8 @@ async function statConfigDependency(file) {
|
|
|
385
238
|
};
|
|
386
239
|
}
|
|
387
240
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
root.walkAtRules("config", (rule) => {
|
|
391
|
-
const configPath = require_generator.parseConfigParam(rule.params);
|
|
392
|
-
if (configPath) configPaths.add(resolveConfigPath(base, configPath));
|
|
393
|
-
});
|
|
394
|
-
return Promise.all([...configPaths].sort().map(statConfigDependency));
|
|
241
|
+
function collectConfigDependencySignatures(requests, base) {
|
|
242
|
+
return [...new Set(requests.map((request) => resolveConfigPath(base, request)))].sort().map(statConfigDependency);
|
|
395
243
|
}
|
|
396
244
|
function mergeTailwindInlineSourceCandidates(allInlineCandidates) {
|
|
397
245
|
const merged = {
|
|
@@ -408,17 +256,13 @@ function mergeTailwindInlineSourceCandidates(allInlineCandidates) {
|
|
|
408
256
|
}
|
|
409
257
|
return merged.included.size > 0 || merged.excluded.size > 0 ? merged : void 0;
|
|
410
258
|
}
|
|
411
|
-
async function resolveConfigContentEntries(
|
|
412
|
-
const configPaths =
|
|
413
|
-
root.walkAtRules("config", (rule) => {
|
|
414
|
-
const configPath = require_generator.parseConfigParam(rule.params);
|
|
415
|
-
if (configPath) configPaths.add(resolveConfigPath(base, configPath));
|
|
416
|
-
});
|
|
259
|
+
async function resolveConfigContentEntries(requests, base) {
|
|
260
|
+
const configPaths = new Set(requests.map((request) => resolveConfigPath(base, request)));
|
|
417
261
|
const entries = [];
|
|
418
262
|
for (const configPath of configPaths) {
|
|
419
263
|
const staticContent = readStaticConfigContent(configPath);
|
|
420
264
|
if (staticContent !== void 0) {
|
|
421
|
-
entries.push(...
|
|
265
|
+
entries.push(...(0, source_scan_exports.normalizeLegacyContentEntries)(staticContent, node_path.default.dirname(configPath), { relativeBase: node_path.default.dirname(configPath) }));
|
|
422
266
|
continue;
|
|
423
267
|
}
|
|
424
268
|
try {
|
|
@@ -426,7 +270,7 @@ async function resolveConfigContentEntries(root, base) {
|
|
|
426
270
|
config: configPath,
|
|
427
271
|
cwd: node_path.default.dirname(configPath)
|
|
428
272
|
});
|
|
429
|
-
entries.push(...
|
|
273
|
+
entries.push(...(0, source_scan_exports.normalizeLegacyContentEntries)(loaded?.config.content, node_path.default.dirname(configPath), { relativeBase: node_path.default.dirname(configPath) }));
|
|
430
274
|
} catch {}
|
|
431
275
|
}
|
|
432
276
|
return {
|
|
@@ -435,31 +279,15 @@ async function resolveConfigContentEntries(root, base) {
|
|
|
435
279
|
};
|
|
436
280
|
}
|
|
437
281
|
async function resolveTailwindV4EntriesFromCss(css, base) {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
let hasSourceNone = false;
|
|
446
|
-
let hasTailwindCssImport = false;
|
|
447
|
-
let includesPreflight = false;
|
|
448
|
-
const [sourceEntries, configEntries] = await Promise.all([require_generator.resolveCssSourceEntries(root, base, SOURCE_CANDIDATE_PATTERN), resolveConfigContentEntries(root, base)]);
|
|
282
|
+
const analysis = (0, _weapp_tailwindcss_postcss_transform.analyzeTailwindV4EntrySource)(css);
|
|
283
|
+
return analysis ? resolveTailwindV4EntriesFromAnalysis(analysis, base) : void 0;
|
|
284
|
+
}
|
|
285
|
+
async function resolveTailwindV4EntriesFromAnalysis(analysis, base) {
|
|
286
|
+
const { hasSourceNone, hasTailwindCssImport, includesPreflight, inlineCandidates, sourceRequests, importSourcePath } = analysis.getSourceDirectives();
|
|
287
|
+
const importSourceBase = importSourcePath ? resolveSourceBase(base, importSourcePath) : void 0;
|
|
288
|
+
const [sourceEntries, configEntries] = await Promise.all([Promise.all(sourceRequests.map((request) => (0, source_scan_exports.resolveTailwindSourceEntry)(request.sourcePath, base, request.negated, SOURCE_CANDIDATE_PATTERN))), resolveConfigContentEntries(analysis.configRequests, base)]);
|
|
449
289
|
const entries = [...configEntries.entries, ...sourceEntries];
|
|
450
290
|
const hasPositiveEntries = entries.some((entry) => !entry.negated);
|
|
451
|
-
const inlineCandidates = collectCssInlineSourceCandidates(root);
|
|
452
|
-
root.walkAtRules("import", (rule) => {
|
|
453
|
-
if (!isTailwindV4CssImportParam(rule.params)) return;
|
|
454
|
-
hasTailwindCssImport = true;
|
|
455
|
-
includesPreflight || (includesPreflight = isTailwindV4PreflightImportParam(rule.params));
|
|
456
|
-
const sourceParam = parseImportSourceParam(rule.params);
|
|
457
|
-
if (sourceParam?.none) hasSourceNone = true;
|
|
458
|
-
if (sourceParam?.sourcePath) importSourceBase = resolveSourceBase(base, sourceParam.sourcePath);
|
|
459
|
-
});
|
|
460
|
-
root.walkAtRules("tailwind", (rule) => {
|
|
461
|
-
includesPreflight || (includesPreflight = rule.params.trim() === "base");
|
|
462
|
-
});
|
|
463
291
|
if (importSourceBase) return {
|
|
464
292
|
entries: [{
|
|
465
293
|
base: importSourceBase,
|
|
@@ -518,16 +346,12 @@ async function pathExistsAsFile(file) {
|
|
|
518
346
|
}
|
|
519
347
|
}
|
|
520
348
|
async function resolveTailwindV4EntriesFromCssCached(css, base) {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
} catch {
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
const cacheKey = createCssEntriesCacheKey(css, base, await collectConfigDependencySignatures(root, base));
|
|
349
|
+
const analysis = (0, _weapp_tailwindcss_postcss_transform.analyzeTailwindV4EntrySource)(css);
|
|
350
|
+
if (!analysis) return;
|
|
351
|
+
const cacheKey = createCssEntriesCacheKey(css, base, collectConfigDependencySignatures(analysis.configRequests, base));
|
|
528
352
|
const cached = tailwindV4CssEntriesCache.get(cacheKey);
|
|
529
353
|
if (cached) return cached;
|
|
530
|
-
const task =
|
|
354
|
+
const task = resolveTailwindV4EntriesFromAnalysis(analysis, base).catch((error) => {
|
|
531
355
|
tailwindV4CssEntriesCache.delete(cacheKey);
|
|
532
356
|
throw error;
|
|
533
357
|
});
|
|
@@ -565,7 +389,7 @@ function collectConfiguredCssSources(options) {
|
|
|
565
389
|
return require_generator.filterTailwindV4CssSourceRoots([...options.tailwindcss?.v4?.cssSources ?? [], ...options.tailwindcssRuntimeOptions?.tailwindcss?.v4?.cssSources ?? []]) ?? [];
|
|
566
390
|
}
|
|
567
391
|
//#endregion
|
|
568
|
-
//#region src/
|
|
392
|
+
//#region src/project-sources/dependencies.ts
|
|
569
393
|
function addSourceScanDependency(dependencies, file) {
|
|
570
394
|
if (typeof file === "string" && file.length > 0) dependencies.add(node_path.default.resolve(file));
|
|
571
395
|
}
|
|
@@ -573,7 +397,7 @@ function addSourceScanDependencies(dependencies, files) {
|
|
|
573
397
|
for (const file of files ?? []) addSourceScanDependency(dependencies, file);
|
|
574
398
|
}
|
|
575
399
|
//#endregion
|
|
576
|
-
//#region src/
|
|
400
|
+
//#region src/project-sources/index.ts
|
|
577
401
|
function createResolvedSourceScan(input, dependencies) {
|
|
578
402
|
return {
|
|
579
403
|
...input,
|
|
@@ -647,7 +471,7 @@ async function resolveSourceScanEntries(options, runtime, scanOptions = {}) {
|
|
|
647
471
|
if (typeof cssSource.css !== "string" || cssSource.css.length === 0) continue;
|
|
648
472
|
addSourceScanDependency(dependencies, cssSource.file);
|
|
649
473
|
addSourceScanDependencies(dependencies, cssSource.dependencies);
|
|
650
|
-
const resolved = await resolveTailwindV4EntriesFromCssCached(cssSource.css,
|
|
474
|
+
const resolved = await resolveTailwindV4EntriesFromCssCached(cssSource.css, resolveTailwindV4CssSourceBase(cssSource, sourceOptionBase));
|
|
651
475
|
if (resolved) {
|
|
652
476
|
entries.push(...resolved.entries);
|
|
653
477
|
cssInlineCandidates.push(resolved.inlineCandidates);
|
|
@@ -738,14 +562,14 @@ async function collectTailwindV4TrackedSourceFiles(tailwindRuntime) {
|
|
|
738
562
|
for (const cssEntry of tailwindOptions?.v4?.cssEntries ?? []) {
|
|
739
563
|
if (!(0, node_fs.existsSync)(cssEntry)) continue;
|
|
740
564
|
const resolved = await resolveTailwindV4EntriesFromCssCached((0, node_fs.readFileSync)(cssEntry, "utf8"), node_path.default.dirname(cssEntry));
|
|
741
|
-
const expanded = resolved?.entries?.length ? await
|
|
565
|
+
const expanded = resolved?.entries?.length ? await (0, _weapp_tailwindcss_postcss_syntax.expandTailwindSourceEntries)(resolved.entries) : [];
|
|
742
566
|
for (const file of expanded) files.add(file);
|
|
743
567
|
}
|
|
744
568
|
for (const cssSource of tailwindOptions?.v4?.cssSources ?? []) {
|
|
745
569
|
if (typeof cssSource.css !== "string" || cssSource.css.length === 0) continue;
|
|
746
570
|
const base = typeof cssSource.file === "string" && cssSource.file.length > 0 ? node_path.default.dirname(cssSource.file) : tailwindOptions?.v4?.base ?? tailwindOptions?.cwd ?? tailwindRuntime.options?.projectRoot ?? node_process.default.cwd();
|
|
747
571
|
const resolved = await resolveTailwindV4EntriesFromCssCached(cssSource.css, base);
|
|
748
|
-
const expanded = resolved?.entries?.length ? await
|
|
572
|
+
const expanded = resolved?.entries?.length ? await (0, _weapp_tailwindcss_postcss_syntax.expandTailwindSourceEntries)(resolved.entries) : [];
|
|
749
573
|
for (const file of expanded) files.add(file);
|
|
750
574
|
}
|
|
751
575
|
const result = [...files].sort((a, b) => a.localeCompare(b));
|
|
@@ -1101,19 +925,6 @@ function createEngineTailwindcssRuntime(options) {
|
|
|
1101
925
|
if (typeof options.filter !== "function") return classSet;
|
|
1102
926
|
return new Set([...classSet].filter((className) => options.filter?.(className) !== false));
|
|
1103
927
|
}
|
|
1104
|
-
function hasTailwindV4ApplyContext(css) {
|
|
1105
|
-
if (!css.includes("@apply")) return false;
|
|
1106
|
-
try {
|
|
1107
|
-
const root = _weapp_tailwindcss_postcss.postcss.parse(css);
|
|
1108
|
-
let hasContext = false;
|
|
1109
|
-
root.walkAtRules((rule) => {
|
|
1110
|
-
if (rule.name === "reference" || rule.name === "import" || rule.name === "tailwind" && rule.params.trim() === "utilities") hasContext = true;
|
|
1111
|
-
});
|
|
1112
|
-
return hasContext;
|
|
1113
|
-
} catch {
|
|
1114
|
-
return false;
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
928
|
async function collectClassSet() {
|
|
1118
929
|
const report = await collectContentTokens();
|
|
1119
930
|
const rawCandidates = new Set(report.entries.map((entry) => {
|
|
@@ -1121,29 +932,19 @@ function createEngineTailwindcssRuntime(options) {
|
|
|
1121
932
|
}).filter((entry) => typeof entry === "string" && entry.length > 0));
|
|
1122
933
|
const source = require_generator.resolveCssMacroTailwindV4Source(await require_generator.resolveTailwindV4SourceFromRuntime(runtime));
|
|
1123
934
|
const bareArbitraryValues = require_generator.resolveRuntimeBareArbitraryValues(runtime.options);
|
|
1124
|
-
const designSystem = await (0,
|
|
1125
|
-
const candidates = new Set((0,
|
|
935
|
+
const designSystem = await (0, _weapp_tailwindcss_engine.loadTailwindV4DesignSystem)(source);
|
|
936
|
+
const candidates = new Set((0, _weapp_tailwindcss_engine.resolveValidTailwindV4Candidates)(designSystem, rawCandidates, { ...bareArbitraryValues === void 0 ? {} : { bareArbitraryValues } }));
|
|
1126
937
|
await collectTailwindV4CssCandidates(candidates);
|
|
1127
938
|
return applyClassSetFilter(candidates);
|
|
1128
939
|
}
|
|
1129
940
|
async function collectTailwindV4CssCandidates(candidates) {
|
|
1130
941
|
const source = require_generator.resolveCssMacroTailwindV4Source(await require_generator.resolveTailwindV4SourceFromRuntime(runtime));
|
|
1131
942
|
const cssList = [source.css, ...(source.cssSources ?? []).map((cssSource) => cssSource.css).filter((css) => typeof css === "string")];
|
|
1132
|
-
for (const css of cssList)
|
|
1133
|
-
if (!hasTailwindV4ApplyContext(css)) continue;
|
|
1134
|
-
try {
|
|
1135
|
-
_weapp_tailwindcss_postcss.postcss.parse(css).walkAtRules("apply", (rule) => {
|
|
1136
|
-
for (const candidate of rule.params.split(/\s+/)) {
|
|
1137
|
-
const normalized = candidate.replace(/!important$/, "").trim();
|
|
1138
|
-
if (normalized) candidates.add(normalized);
|
|
1139
|
-
}
|
|
1140
|
-
});
|
|
1141
|
-
} catch {}
|
|
1142
|
-
}
|
|
943
|
+
for (const css of cssList) for (const candidate of (0, _weapp_tailwindcss_postcss_transform.collectRuntimeApplyCandidates)(css)) candidates.add(candidate);
|
|
1143
944
|
}
|
|
1144
945
|
async function collectContentTokens() {
|
|
1145
946
|
const source = require_generator.resolveCssMacroTailwindV4Source(await require_generator.resolveTailwindV4SourceFromRuntime(runtime));
|
|
1146
|
-
const report = await (0,
|
|
947
|
+
const report = await (0, _weapp_tailwindcss_engine.extractProjectCandidatesWithPositions)({
|
|
1147
948
|
base: source.base,
|
|
1148
949
|
baseFallbacks: source.baseFallbacks,
|
|
1149
950
|
css: source.css,
|
|
@@ -1610,12 +1411,6 @@ Object.defineProperty(exports, "applyV4CssCalcDefaults", {
|
|
|
1610
1411
|
return applyV4CssCalcDefaults;
|
|
1611
1412
|
}
|
|
1612
1413
|
});
|
|
1613
|
-
Object.defineProperty(exports, "collectCssInlineSourceCandidates", {
|
|
1614
|
-
enumerable: true,
|
|
1615
|
-
get: function() {
|
|
1616
|
-
return collectCssInlineSourceCandidates;
|
|
1617
|
-
}
|
|
1618
|
-
});
|
|
1619
1414
|
Object.defineProperty(exports, "createTailwindcssRuntimeFromContext", {
|
|
1620
1415
|
enumerable: true,
|
|
1621
1416
|
get: function() {
|
|
@@ -1652,12 +1447,6 @@ Object.defineProperty(exports, "getRuntimeClassSetSignatureWithSources", {
|
|
|
1652
1447
|
return getRuntimeClassSetSignatureWithSources;
|
|
1653
1448
|
}
|
|
1654
1449
|
});
|
|
1655
|
-
Object.defineProperty(exports, "includesTailwindV4PreflightDirective", {
|
|
1656
|
-
enumerable: true,
|
|
1657
|
-
get: function() {
|
|
1658
|
-
return includesTailwindV4PreflightDirective;
|
|
1659
|
-
}
|
|
1660
|
-
});
|
|
1661
1450
|
Object.defineProperty(exports, "invalidateRuntimeClassSet", {
|
|
1662
1451
|
enumerable: true,
|
|
1663
1452
|
get: function() {
|
|
@@ -1682,6 +1471,12 @@ Object.defineProperty(exports, "resolveTailwindV4CssDependencies", {
|
|
|
1682
1471
|
return resolveTailwindV4CssDependencies;
|
|
1683
1472
|
}
|
|
1684
1473
|
});
|
|
1474
|
+
Object.defineProperty(exports, "resolveTailwindV4CssSourceBase", {
|
|
1475
|
+
enumerable: true,
|
|
1476
|
+
get: function() {
|
|
1477
|
+
return resolveTailwindV4CssSourceBase;
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1685
1480
|
Object.defineProperty(exports, "resolveTailwindV4EntriesFromCss", {
|
|
1686
1481
|
enumerable: true,
|
|
1687
1482
|
get: function() {
|
|
@@ -1706,6 +1501,12 @@ Object.defineProperty(exports, "resolveUniAppXOptions", {
|
|
|
1706
1501
|
return resolveUniAppXOptions;
|
|
1707
1502
|
}
|
|
1708
1503
|
});
|
|
1504
|
+
Object.defineProperty(exports, "source_scan_exports", {
|
|
1505
|
+
enumerable: true,
|
|
1506
|
+
get: function() {
|
|
1507
|
+
return source_scan_exports;
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1709
1510
|
Object.defineProperty(exports, "warnMissingCssEntries", {
|
|
1710
1511
|
enumerable: true,
|
|
1711
1512
|
get: function() {
|